michael@0: ; michael@0: ; jdmrgmmx.asm - merged upsampling/color conversion (MMX) michael@0: ; michael@0: ; Copyright 2009 Pierre Ossman for Cendio AB michael@0: ; michael@0: ; Based on michael@0: ; x86 SIMD extension for IJG JPEG library michael@0: ; Copyright (C) 1999-2006, MIYASAKA Masaru. michael@0: ; For conditions of distribution and use, see copyright notice in jsimdext.inc michael@0: ; michael@0: ; This file should be assembled with NASM (Netwide Assembler), michael@0: ; can *not* be assembled with Microsoft's MASM or any compatible michael@0: ; assembler (including Borland's Turbo Assembler). michael@0: ; NASM is available from http://nasm.sourceforge.net/ or michael@0: ; http://sourceforge.net/project/showfiles.php?group_id=6208 michael@0: ; michael@0: ; [TAB8] michael@0: michael@0: %include "jcolsamp.inc" michael@0: michael@0: ; -------------------------------------------------------------------------- michael@0: ; michael@0: ; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. michael@0: ; michael@0: ; GLOBAL(void) michael@0: ; jsimd_h2v1_merged_upsample_mmx (JDIMENSION output_width, michael@0: ; JSAMPIMAGE input_buf, michael@0: ; JDIMENSION in_row_group_ctr, michael@0: ; JSAMPARRAY output_buf); michael@0: ; michael@0: michael@0: %define output_width(b) (b)+8 ; JDIMENSION output_width michael@0: %define input_buf(b) (b)+12 ; JSAMPIMAGE input_buf michael@0: %define in_row_group_ctr(b) (b)+16 ; JDIMENSION in_row_group_ctr michael@0: %define output_buf(b) (b)+20 ; JSAMPARRAY output_buf michael@0: michael@0: %define original_ebp ebp+0 michael@0: %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_MMWORD ; mmword wk[WK_NUM] michael@0: %define WK_NUM 3 michael@0: %define gotptr wk(0)-SIZEOF_POINTER ; void * gotptr michael@0: michael@0: align 16 michael@0: global EXTN(jsimd_h2v1_merged_upsample_mmx) michael@0: michael@0: EXTN(jsimd_h2v1_merged_upsample_mmx): michael@0: push ebp michael@0: mov eax,esp ; eax = original ebp michael@0: sub esp, byte 4 michael@0: and esp, byte (-SIZEOF_MMWORD) ; align to 64 bits michael@0: mov [esp],eax michael@0: mov ebp,esp ; ebp = aligned ebp michael@0: lea esp, [wk(0)] michael@0: pushpic eax ; make a room for GOT address michael@0: push ebx michael@0: ; push ecx ; need not be preserved michael@0: ; push edx ; need not be preserved michael@0: push esi michael@0: push edi michael@0: michael@0: get_GOT ebx ; get GOT address michael@0: movpic POINTER [gotptr], ebx ; save GOT address michael@0: michael@0: mov ecx, JDIMENSION [output_width(eax)] ; col michael@0: test ecx,ecx michael@0: jz near .return michael@0: michael@0: push ecx michael@0: michael@0: mov edi, JSAMPIMAGE [input_buf(eax)] michael@0: mov ecx, JDIMENSION [in_row_group_ctr(eax)] michael@0: mov esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY] michael@0: mov ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY] michael@0: mov edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY] michael@0: mov edi, JSAMPARRAY [output_buf(eax)] michael@0: mov esi, JSAMPROW [esi+ecx*SIZEOF_JSAMPROW] ; inptr0 michael@0: mov ebx, JSAMPROW [ebx+ecx*SIZEOF_JSAMPROW] ; inptr1 michael@0: mov edx, JSAMPROW [edx+ecx*SIZEOF_JSAMPROW] ; inptr2 michael@0: mov edi, JSAMPROW [edi] ; outptr michael@0: michael@0: pop ecx ; col michael@0: michael@0: alignx 16,7 michael@0: .columnloop: michael@0: movpic eax, POINTER [gotptr] ; load GOT address (eax) michael@0: michael@0: movq mm6, MMWORD [ebx] ; mm6=Cb(01234567) michael@0: movq mm7, MMWORD [edx] ; mm7=Cr(01234567) michael@0: michael@0: pxor mm1,mm1 ; mm1=(all 0's) michael@0: pcmpeqw mm3,mm3 michael@0: psllw mm3,7 ; mm3={0xFF80 0xFF80 0xFF80 0xFF80} michael@0: michael@0: movq mm4,mm6 michael@0: punpckhbw mm6,mm1 ; mm6=Cb(4567)=CbH michael@0: punpcklbw mm4,mm1 ; mm4=Cb(0123)=CbL michael@0: movq mm0,mm7 michael@0: punpckhbw mm7,mm1 ; mm7=Cr(4567)=CrH michael@0: punpcklbw mm0,mm1 ; mm0=Cr(0123)=CrL michael@0: michael@0: paddw mm6,mm3 michael@0: paddw mm4,mm3 michael@0: paddw mm7,mm3 michael@0: paddw mm0,mm3 michael@0: michael@0: ; (Original) michael@0: ; R = Y + 1.40200 * Cr michael@0: ; G = Y - 0.34414 * Cb - 0.71414 * Cr michael@0: ; B = Y + 1.77200 * Cb michael@0: ; michael@0: ; (This implementation) michael@0: ; R = Y + 0.40200 * Cr + Cr michael@0: ; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr michael@0: ; B = Y - 0.22800 * Cb + Cb + Cb michael@0: michael@0: movq mm5,mm6 ; mm5=CbH michael@0: movq mm2,mm4 ; mm2=CbL michael@0: paddw mm6,mm6 ; mm6=2*CbH michael@0: paddw mm4,mm4 ; mm4=2*CbL michael@0: movq mm1,mm7 ; mm1=CrH michael@0: movq mm3,mm0 ; mm3=CrL michael@0: paddw mm7,mm7 ; mm7=2*CrH michael@0: paddw mm0,mm0 ; mm0=2*CrL michael@0: michael@0: pmulhw mm6,[GOTOFF(eax,PW_MF0228)] ; mm6=(2*CbH * -FIX(0.22800)) michael@0: pmulhw mm4,[GOTOFF(eax,PW_MF0228)] ; mm4=(2*CbL * -FIX(0.22800)) michael@0: pmulhw mm7,[GOTOFF(eax,PW_F0402)] ; mm7=(2*CrH * FIX(0.40200)) michael@0: pmulhw mm0,[GOTOFF(eax,PW_F0402)] ; mm0=(2*CrL * FIX(0.40200)) michael@0: michael@0: paddw mm6,[GOTOFF(eax,PW_ONE)] michael@0: paddw mm4,[GOTOFF(eax,PW_ONE)] michael@0: psraw mm6,1 ; mm6=(CbH * -FIX(0.22800)) michael@0: psraw mm4,1 ; mm4=(CbL * -FIX(0.22800)) michael@0: paddw mm7,[GOTOFF(eax,PW_ONE)] michael@0: paddw mm0,[GOTOFF(eax,PW_ONE)] michael@0: psraw mm7,1 ; mm7=(CrH * FIX(0.40200)) michael@0: psraw mm0,1 ; mm0=(CrL * FIX(0.40200)) michael@0: michael@0: paddw mm6,mm5 michael@0: paddw mm4,mm2 michael@0: paddw mm6,mm5 ; mm6=(CbH * FIX(1.77200))=(B-Y)H michael@0: paddw mm4,mm2 ; mm4=(CbL * FIX(1.77200))=(B-Y)L michael@0: paddw mm7,mm1 ; mm7=(CrH * FIX(1.40200))=(R-Y)H michael@0: paddw mm0,mm3 ; mm0=(CrL * FIX(1.40200))=(R-Y)L michael@0: michael@0: movq MMWORD [wk(0)], mm6 ; wk(0)=(B-Y)H michael@0: movq MMWORD [wk(1)], mm7 ; wk(1)=(R-Y)H michael@0: michael@0: movq mm6,mm5 michael@0: movq mm7,mm2 michael@0: punpcklwd mm5,mm1 michael@0: punpckhwd mm6,mm1 michael@0: pmaddwd mm5,[GOTOFF(eax,PW_MF0344_F0285)] michael@0: pmaddwd mm6,[GOTOFF(eax,PW_MF0344_F0285)] michael@0: punpcklwd mm2,mm3 michael@0: punpckhwd mm7,mm3 michael@0: pmaddwd mm2,[GOTOFF(eax,PW_MF0344_F0285)] michael@0: pmaddwd mm7,[GOTOFF(eax,PW_MF0344_F0285)] michael@0: michael@0: paddd mm5,[GOTOFF(eax,PD_ONEHALF)] michael@0: paddd mm6,[GOTOFF(eax,PD_ONEHALF)] michael@0: psrad mm5,SCALEBITS michael@0: psrad mm6,SCALEBITS michael@0: paddd mm2,[GOTOFF(eax,PD_ONEHALF)] michael@0: paddd mm7,[GOTOFF(eax,PD_ONEHALF)] michael@0: psrad mm2,SCALEBITS michael@0: psrad mm7,SCALEBITS michael@0: michael@0: packssdw mm5,mm6 ; mm5=CbH*-FIX(0.344)+CrH*FIX(0.285) michael@0: packssdw mm2,mm7 ; mm2=CbL*-FIX(0.344)+CrL*FIX(0.285) michael@0: psubw mm5,mm1 ; mm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H michael@0: psubw mm2,mm3 ; mm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L michael@0: michael@0: movq MMWORD [wk(2)], mm5 ; wk(2)=(G-Y)H michael@0: michael@0: mov al,2 ; Yctr michael@0: jmp short .Yloop_1st michael@0: alignx 16,7 michael@0: michael@0: .Yloop_2nd: michael@0: movq mm0, MMWORD [wk(1)] ; mm0=(R-Y)H michael@0: movq mm2, MMWORD [wk(2)] ; mm2=(G-Y)H michael@0: movq mm4, MMWORD [wk(0)] ; mm4=(B-Y)H michael@0: alignx 16,7 michael@0: michael@0: .Yloop_1st: michael@0: movq mm7, MMWORD [esi] ; mm7=Y(01234567) michael@0: michael@0: pcmpeqw mm6,mm6 michael@0: psrlw mm6,BYTE_BIT ; mm6={0xFF 0x00 0xFF 0x00 ..} michael@0: pand mm6,mm7 ; mm6=Y(0246)=YE michael@0: psrlw mm7,BYTE_BIT ; mm7=Y(1357)=YO michael@0: michael@0: movq mm1,mm0 ; mm1=mm0=(R-Y)(L/H) michael@0: movq mm3,mm2 ; mm3=mm2=(G-Y)(L/H) michael@0: movq mm5,mm4 ; mm5=mm4=(B-Y)(L/H) michael@0: michael@0: paddw mm0,mm6 ; mm0=((R-Y)+YE)=RE=(R0 R2 R4 R6) michael@0: paddw mm1,mm7 ; mm1=((R-Y)+YO)=RO=(R1 R3 R5 R7) michael@0: packuswb mm0,mm0 ; mm0=(R0 R2 R4 R6 ** ** ** **) michael@0: packuswb mm1,mm1 ; mm1=(R1 R3 R5 R7 ** ** ** **) michael@0: michael@0: paddw mm2,mm6 ; mm2=((G-Y)+YE)=GE=(G0 G2 G4 G6) michael@0: paddw mm3,mm7 ; mm3=((G-Y)+YO)=GO=(G1 G3 G5 G7) michael@0: packuswb mm2,mm2 ; mm2=(G0 G2 G4 G6 ** ** ** **) michael@0: packuswb mm3,mm3 ; mm3=(G1 G3 G5 G7 ** ** ** **) michael@0: michael@0: paddw mm4,mm6 ; mm4=((B-Y)+YE)=BE=(B0 B2 B4 B6) michael@0: paddw mm5,mm7 ; mm5=((B-Y)+YO)=BO=(B1 B3 B5 B7) michael@0: packuswb mm4,mm4 ; mm4=(B0 B2 B4 B6 ** ** ** **) michael@0: packuswb mm5,mm5 ; mm5=(B1 B3 B5 B7 ** ** ** **) michael@0: michael@0: %if RGB_PIXELSIZE == 3 ; --------------- michael@0: michael@0: ; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **) michael@0: ; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **) michael@0: ; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **) michael@0: ; mmG=(** ** ** ** ** ** ** **), mmH=(** ** ** ** ** ** ** **) michael@0: michael@0: punpcklbw mmA,mmC ; mmA=(00 10 02 12 04 14 06 16) michael@0: punpcklbw mmE,mmB ; mmE=(20 01 22 03 24 05 26 07) michael@0: punpcklbw mmD,mmF ; mmD=(11 21 13 23 15 25 17 27) michael@0: michael@0: movq mmG,mmA michael@0: movq mmH,mmA michael@0: punpcklwd mmA,mmE ; mmA=(00 10 20 01 02 12 22 03) michael@0: punpckhwd mmG,mmE ; mmG=(04 14 24 05 06 16 26 07) michael@0: michael@0: psrlq mmH,2*BYTE_BIT ; mmH=(02 12 04 14 06 16 -- --) michael@0: psrlq mmE,2*BYTE_BIT ; mmE=(22 03 24 05 26 07 -- --) michael@0: michael@0: movq mmC,mmD michael@0: movq mmB,mmD michael@0: punpcklwd mmD,mmH ; mmD=(11 21 02 12 13 23 04 14) michael@0: punpckhwd mmC,mmH ; mmC=(15 25 06 16 17 27 -- --) michael@0: michael@0: psrlq mmB,2*BYTE_BIT ; mmB=(13 23 15 25 17 27 -- --) michael@0: michael@0: movq mmF,mmE michael@0: punpcklwd mmE,mmB ; mmE=(22 03 13 23 24 05 15 25) michael@0: punpckhwd mmF,mmB ; mmF=(26 07 17 27 -- -- -- --) michael@0: michael@0: punpckldq mmA,mmD ; mmA=(00 10 20 01 11 21 02 12) michael@0: punpckldq mmE,mmG ; mmE=(22 03 13 23 04 14 24 05) michael@0: punpckldq mmC,mmF ; mmC=(15 25 06 16 26 07 17 27) michael@0: michael@0: cmp ecx, byte SIZEOF_MMWORD michael@0: jb short .column_st16 michael@0: michael@0: movq MMWORD [edi+0*SIZEOF_MMWORD], mmA michael@0: movq MMWORD [edi+1*SIZEOF_MMWORD], mmE michael@0: movq MMWORD [edi+2*SIZEOF_MMWORD], mmC michael@0: michael@0: sub ecx, byte SIZEOF_MMWORD michael@0: jz near .endcolumn michael@0: michael@0: add edi, byte RGB_PIXELSIZE*SIZEOF_MMWORD ; outptr michael@0: add esi, byte SIZEOF_MMWORD ; inptr0 michael@0: dec al ; Yctr michael@0: jnz near .Yloop_2nd michael@0: michael@0: add ebx, byte SIZEOF_MMWORD ; inptr1 michael@0: add edx, byte SIZEOF_MMWORD ; inptr2 michael@0: jmp near .columnloop michael@0: alignx 16,7 michael@0: michael@0: .column_st16: michael@0: lea ecx, [ecx+ecx*2] ; imul ecx, RGB_PIXELSIZE michael@0: cmp ecx, byte 2*SIZEOF_MMWORD michael@0: jb short .column_st8 michael@0: movq MMWORD [edi+0*SIZEOF_MMWORD], mmA michael@0: movq MMWORD [edi+1*SIZEOF_MMWORD], mmE michael@0: movq mmA,mmC michael@0: sub ecx, byte 2*SIZEOF_MMWORD michael@0: add edi, byte 2*SIZEOF_MMWORD michael@0: jmp short .column_st4 michael@0: .column_st8: michael@0: cmp ecx, byte SIZEOF_MMWORD michael@0: jb short .column_st4 michael@0: movq MMWORD [edi+0*SIZEOF_MMWORD], mmA michael@0: movq mmA,mmE michael@0: sub ecx, byte SIZEOF_MMWORD michael@0: add edi, byte SIZEOF_MMWORD michael@0: .column_st4: michael@0: movd eax,mmA michael@0: cmp ecx, byte SIZEOF_DWORD michael@0: jb short .column_st2 michael@0: mov DWORD [edi+0*SIZEOF_DWORD], eax michael@0: psrlq mmA,DWORD_BIT michael@0: movd eax,mmA michael@0: sub ecx, byte SIZEOF_DWORD michael@0: add edi, byte SIZEOF_DWORD michael@0: .column_st2: michael@0: cmp ecx, byte SIZEOF_WORD michael@0: jb short .column_st1 michael@0: mov WORD [edi+0*SIZEOF_WORD], ax michael@0: shr eax,WORD_BIT michael@0: sub ecx, byte SIZEOF_WORD michael@0: add edi, byte SIZEOF_WORD michael@0: .column_st1: michael@0: cmp ecx, byte SIZEOF_BYTE michael@0: jb short .endcolumn michael@0: mov BYTE [edi+0*SIZEOF_BYTE], al michael@0: michael@0: %else ; RGB_PIXELSIZE == 4 ; ----------- michael@0: michael@0: %ifdef RGBX_FILLER_0XFF michael@0: pcmpeqb mm6,mm6 ; mm6=(X0 X2 X4 X6 ** ** ** **) michael@0: pcmpeqb mm7,mm7 ; mm7=(X1 X3 X5 X7 ** ** ** **) michael@0: %else michael@0: pxor mm6,mm6 ; mm6=(X0 X2 X4 X6 ** ** ** **) michael@0: pxor mm7,mm7 ; mm7=(X1 X3 X5 X7 ** ** ** **) michael@0: %endif michael@0: ; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **) michael@0: ; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **) michael@0: ; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **) michael@0: ; mmG=(30 32 34 36 ** ** ** **), mmH=(31 33 35 37 ** ** ** **) michael@0: michael@0: punpcklbw mmA,mmC ; mmA=(00 10 02 12 04 14 06 16) michael@0: punpcklbw mmE,mmG ; mmE=(20 30 22 32 24 34 26 36) michael@0: punpcklbw mmB,mmD ; mmB=(01 11 03 13 05 15 07 17) michael@0: punpcklbw mmF,mmH ; mmF=(21 31 23 33 25 35 27 37) michael@0: michael@0: movq mmC,mmA michael@0: punpcklwd mmA,mmE ; mmA=(00 10 20 30 02 12 22 32) michael@0: punpckhwd mmC,mmE ; mmC=(04 14 24 34 06 16 26 36) michael@0: movq mmG,mmB michael@0: punpcklwd mmB,mmF ; mmB=(01 11 21 31 03 13 23 33) michael@0: punpckhwd mmG,mmF ; mmG=(05 15 25 35 07 17 27 37) michael@0: michael@0: movq mmD,mmA michael@0: punpckldq mmA,mmB ; mmA=(00 10 20 30 01 11 21 31) michael@0: punpckhdq mmD,mmB ; mmD=(02 12 22 32 03 13 23 33) michael@0: movq mmH,mmC michael@0: punpckldq mmC,mmG ; mmC=(04 14 24 34 05 15 25 35) michael@0: punpckhdq mmH,mmG ; mmH=(06 16 26 36 07 17 27 37) michael@0: michael@0: cmp ecx, byte SIZEOF_MMWORD michael@0: jb short .column_st16 michael@0: michael@0: movq MMWORD [edi+0*SIZEOF_MMWORD], mmA michael@0: movq MMWORD [edi+1*SIZEOF_MMWORD], mmD michael@0: movq MMWORD [edi+2*SIZEOF_MMWORD], mmC michael@0: movq MMWORD [edi+3*SIZEOF_MMWORD], mmH michael@0: michael@0: sub ecx, byte SIZEOF_MMWORD michael@0: jz short .endcolumn michael@0: michael@0: add edi, byte RGB_PIXELSIZE*SIZEOF_MMWORD ; outptr michael@0: add esi, byte SIZEOF_MMWORD ; inptr0 michael@0: dec al ; Yctr michael@0: jnz near .Yloop_2nd michael@0: michael@0: add ebx, byte SIZEOF_MMWORD ; inptr1 michael@0: add edx, byte SIZEOF_MMWORD ; inptr2 michael@0: jmp near .columnloop michael@0: alignx 16,7 michael@0: michael@0: .column_st16: michael@0: cmp ecx, byte SIZEOF_MMWORD/2 michael@0: jb short .column_st8 michael@0: movq MMWORD [edi+0*SIZEOF_MMWORD], mmA michael@0: movq MMWORD [edi+1*SIZEOF_MMWORD], mmD michael@0: movq mmA,mmC michael@0: movq mmD,mmH michael@0: sub ecx, byte SIZEOF_MMWORD/2 michael@0: add edi, byte 2*SIZEOF_MMWORD michael@0: .column_st8: michael@0: cmp ecx, byte SIZEOF_MMWORD/4 michael@0: jb short .column_st4 michael@0: movq MMWORD [edi+0*SIZEOF_MMWORD], mmA michael@0: movq mmA,mmD michael@0: sub ecx, byte SIZEOF_MMWORD/4 michael@0: add edi, byte 1*SIZEOF_MMWORD michael@0: .column_st4: michael@0: cmp ecx, byte SIZEOF_MMWORD/8 michael@0: jb short .endcolumn michael@0: movd DWORD [edi+0*SIZEOF_DWORD], mmA michael@0: michael@0: %endif ; RGB_PIXELSIZE ; --------------- michael@0: michael@0: .endcolumn: michael@0: emms ; empty MMX state michael@0: michael@0: .return: michael@0: pop edi michael@0: pop esi michael@0: ; pop edx ; need not be preserved michael@0: ; pop ecx ; need not be preserved michael@0: pop ebx michael@0: mov esp,ebp ; esp <- aligned ebp michael@0: pop esp ; esp <- original ebp michael@0: pop ebp michael@0: ret michael@0: michael@0: ; -------------------------------------------------------------------------- michael@0: ; michael@0: ; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. michael@0: ; michael@0: ; GLOBAL(void) michael@0: ; jsimd_h2v2_merged_upsample_mmx (JDIMENSION output_width, michael@0: ; JSAMPIMAGE input_buf, michael@0: ; JDIMENSION in_row_group_ctr, michael@0: ; JSAMPARRAY output_buf); michael@0: ; michael@0: michael@0: %define output_width(b) (b)+8 ; JDIMENSION output_width michael@0: %define input_buf(b) (b)+12 ; JSAMPIMAGE input_buf michael@0: %define in_row_group_ctr(b) (b)+16 ; JDIMENSION in_row_group_ctr michael@0: %define output_buf(b) (b)+20 ; JSAMPARRAY output_buf michael@0: michael@0: align 16 michael@0: global EXTN(jsimd_h2v2_merged_upsample_mmx) michael@0: michael@0: EXTN(jsimd_h2v2_merged_upsample_mmx): michael@0: push ebp michael@0: mov ebp,esp michael@0: push ebx michael@0: ; push ecx ; need not be preserved michael@0: ; push edx ; need not be preserved michael@0: push esi michael@0: push edi michael@0: michael@0: mov eax, JDIMENSION [output_width(ebp)] michael@0: michael@0: mov edi, JSAMPIMAGE [input_buf(ebp)] michael@0: mov ecx, JDIMENSION [in_row_group_ctr(ebp)] michael@0: mov esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY] michael@0: mov ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY] michael@0: mov edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY] michael@0: mov edi, JSAMPARRAY [output_buf(ebp)] michael@0: lea esi, [esi+ecx*SIZEOF_JSAMPROW] michael@0: michael@0: push edx ; inptr2 michael@0: push ebx ; inptr1 michael@0: push esi ; inptr00 michael@0: mov ebx,esp michael@0: michael@0: push edi ; output_buf (outptr0) michael@0: push ecx ; in_row_group_ctr michael@0: push ebx ; input_buf michael@0: push eax ; output_width michael@0: michael@0: call near EXTN(jsimd_h2v1_merged_upsample_mmx) michael@0: michael@0: add esi, byte SIZEOF_JSAMPROW ; inptr01 michael@0: add edi, byte SIZEOF_JSAMPROW ; outptr1 michael@0: mov POINTER [ebx+0*SIZEOF_POINTER], esi michael@0: mov POINTER [ebx-1*SIZEOF_POINTER], edi michael@0: michael@0: call near EXTN(jsimd_h2v1_merged_upsample_mmx) michael@0: michael@0: add esp, byte 7*SIZEOF_DWORD michael@0: michael@0: pop edi michael@0: pop esi michael@0: ; pop edx ; need not be preserved michael@0: ; pop ecx ; need not be preserved michael@0: pop ebx michael@0: pop ebp michael@0: ret michael@0: michael@0: ; For some reason, the OS X linker does not honor the request to align the michael@0: ; segment unless we do this. michael@0: align 16