home *** CD-ROM | disk | FTP | other *** search
- /
- / Copyright (C) 1992-1993 Michael Davidson.
- / All rights reserved.
- /
- / Permission to use, copy, modify, and distribute this software
- / and its documentation for any purpose and without fee is hereby
- / granted, provided that the above copyright notice appear in all
- / copies and that both that copyright notice and this permission
- / notice appear in supporting documentation.
- /
- / This software is provided "as is" without express or implied warranty.
- /
- .text
- /
- / upsample_x1(dst, src, count)
- /
- .globl upsample_x1
- DST = 8
- SRC = 12
- COUNT = 16
-
- upsample_x1:
- pushl %ebp
- movl %esp, %ebp
- pushl %esi
- pushl %edi
-
- movl SRC(%ebp), %esi
- movl DST(%ebp), %edi
- movl COUNT(%ebp), %ecx
- shrl $3, %ecx
-
- .align 8
- L10:
- movl (%esi), %eax
- movl 4(%esi), %edx
- movl %eax, (%edi)
- movl %edx, 4(%edi)
- leal 8(%esi), %esi
- leal 8(%edi), %edi
- decl %ecx
- jg L10
-
- popl %edi
- popl %esi
- popl %ebp
- ret
-
- /
- / upsample_x2(dst, src, count)
- /
- .globl upsample_x2
- DST = 8
- SRC = 12
- COUNT = 16
-
- upsample_x2:
- pushl %ebp
- movl %esp, %ebp
- pushl %esi
- pushl %edi
-
- movl SRC(%ebp), %esi
- movl DST(%ebp), %edi
- movl COUNT(%ebp), %ecx
- shrl $2, %ecx
-
- .align 8
- L20:
- movl (%esi), %eax
- movb %al, %dl
- movb %al, %dh
- roll $16, %edx
- movb %ah, %dl
- movb %ah, %dh
- roll $16, %edx
- roll $16, %eax
- movl %edx,(%edi)
- movb %al, %dl
- movb %al, %dh
- roll $16, %edx
- movb %ah, %dl
- movb %ah, %dh
- roll $16, %edx
- movl %edx, 4(%edi)
- leal 4(%esi), %esi
- leal 8(%edi), %edi
- decl %ecx
- jg L20
-
- popl %edi
- popl %esi
- popl %ebp
- ret
-