home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / vg-2.03 / jpeg / upsample.s < prev    next >
Encoding:
Text File  |  1995-05-03  |  1.6 KB  |  95 lines

  1. /
  2. / Copyright (C) 1992-1993 Michael Davidson.
  3. / All rights reserved.
  4. /
  5. / Permission to use, copy, modify, and distribute this software
  6. / and its documentation for any purpose and without fee is hereby
  7. / granted, provided that the above copyright notice appear in all
  8. / copies and that both that copyright notice and this permission
  9. / notice appear in supporting documentation.
  10. /
  11. / This software is provided "as is" without express or implied warranty.
  12. /
  13.     .text
  14. /
  15. / upsample_x1(dst, src, count)
  16. /
  17.     .globl    upsample_x1
  18. DST    =    8
  19. SRC    =    12
  20. COUNT    =    16
  21.  
  22. upsample_x1:
  23.     pushl  %ebp
  24.     movl   %esp, %ebp
  25.     pushl  %esi
  26.     pushl  %edi
  27.  
  28.     movl   SRC(%ebp), %esi
  29.     movl   DST(%ebp), %edi
  30.     movl   COUNT(%ebp), %ecx
  31.     shrl   $3, %ecx
  32.  
  33.     .align    8
  34. L10:
  35.     movl   (%esi), %eax
  36.     movl   4(%esi), %edx
  37.     movl   %eax, (%edi)
  38.     movl   %edx, 4(%edi)
  39.     leal   8(%esi), %esi
  40.     leal   8(%edi), %edi
  41.     decl   %ecx
  42.     jg     L10
  43.  
  44.     popl   %edi
  45.     popl   %esi
  46.     popl   %ebp
  47.     ret    
  48.  
  49. /
  50. / upsample_x2(dst, src, count)
  51. /
  52.     .globl    upsample_x2
  53. DST    =    8
  54. SRC    =    12
  55. COUNT    =    16
  56.  
  57. upsample_x2:
  58.     pushl  %ebp
  59.     movl   %esp, %ebp
  60.     pushl  %esi
  61.     pushl  %edi
  62.  
  63.     movl   SRC(%ebp), %esi
  64.     movl   DST(%ebp), %edi
  65.     movl   COUNT(%ebp), %ecx
  66.     shrl   $2, %ecx
  67.  
  68.     .align    8
  69. L20:
  70.     movl   (%esi), %eax
  71.     movb   %al, %dl
  72.     movb   %al, %dh
  73.     roll   $16, %edx
  74.     movb   %ah, %dl
  75.     movb   %ah, %dh
  76.     roll   $16, %edx
  77.     roll   $16, %eax
  78.     movl   %edx,(%edi)
  79.     movb   %al, %dl
  80.     movb   %al, %dh
  81.     roll   $16, %edx
  82.     movb   %ah, %dl
  83.     movb   %ah, %dh
  84.     roll   $16, %edx
  85.     movl   %edx, 4(%edi)
  86.     leal   4(%esi), %esi
  87.     leal   8(%edi), %edi
  88.     decl   %ecx
  89.     jg     L20
  90.  
  91.     popl   %edi
  92.     popl   %esi
  93.     popl   %ebp
  94.     ret    
  95.