From: Loren Merritt <pengvado@videolan.org> Date: Wed, 8 Feb 2006 00:53:35 +0000 (+0000) Subject: cosmetics in mc_chroma X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb21f3a920ffefe84a77933c060775b2089a9c6c;p=libx264 cosmetics in mc_chroma git-svn-id: svn://svn.videolan.org/x264/trunk@420 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/common/amd64/mc-a.asm b/common/amd64/mc-a.asm index b55e86f9..debb6aef 100644 --- a/common/amd64/mc-a.asm +++ b/common/amd64/mc-a.asm @@ -70,7 +70,7 @@ cglobal x264_mc_copy_w8_mmxext cglobal x264_mc_copy_w16_mmxext cglobal x264_mc_copy_w16_sse2 -cglobal x264_mc_chroma_sse +cglobal x264_mc_chroma_mmxext ;============================================================================= ; pixel avg @@ -403,13 +403,13 @@ ALIGN 4 ALIGN 16 ;----------------------------------------------------------------------------- -; void x264_mc_chroma_sse( uint8_t *src, int i_src_stride, +; void x264_mc_chroma_mmxext( uint8_t *src, int i_src_stride, ; uint8_t *dst, int i_dst_stride, ; int dx, int dy, -; int i_height, int i_width ) +; int i_width, int i_height ) ;----------------------------------------------------------------------------- -x264_mc_chroma_sse: +x264_mc_chroma_mmxext: movd mm0, parm5d movd mm1, parm6d @@ -432,7 +432,7 @@ x264_mc_chroma_sse: mov rax, parm1q mov r10, parm3q - mov r11d, parm7d + mov r11d, parm8d ALIGN 4 .height_loop @@ -468,14 +468,12 @@ ALIGN 4 dec r11d jnz .height_loop - mov eax, parm8d ; i_width - sub eax, 8 + sub parm7d, 8 jnz .finish ; width != 8 so assume 4 - mov parm8d, eax ; i_width mov r10, parm3q ; dst mov rax, parm1q ; src - mov r11d, parm7d ; i_height + mov r11d, parm8d ; i_height add r10, 4 add rax, 4 jmp .height_loop diff --git a/common/i386/mc-a.asm b/common/i386/mc-a.asm index 5ade06f1..949b68c6 100644 --- a/common/i386/mc-a.asm +++ b/common/i386/mc-a.asm @@ -74,7 +74,7 @@ cglobal x264_mc_copy_w8_mmxext cglobal x264_mc_copy_w16_mmxext cglobal x264_mc_copy_w16_sse2 -cglobal x264_mc_chroma_sse +cglobal x264_mc_chroma_mmxext ;============================================================================= ; pixel avg @@ -504,27 +504,27 @@ ALIGN 4 ALIGN 16 ;----------------------------------------------------------------------------- -; void x264_mc_chroma_sse( uint8_t *src, int i_src_stride, +; void x264_mc_chroma_mmxext( uint8_t *src, int i_src_stride, ; uint8_t *dst, int i_dst_stride, ; int dx, int dy, -; int i_height, int i_width ) +; int i_width, int i_height ) ;----------------------------------------------------------------------------- -x264_mc_chroma_sse: +x264_mc_chroma_mmxext: PUSH_EBX_IF_PIC GET_GOT_IN_EBX_IF_PIC pxor mm3, mm3 - pshufw mm5, [esp+20], 0 ; mm5 - dx - pshufw mm6, [esp+24], 0 ; mm6 - dy + pshufw mm5, [esp+20], 0 ; mm5 = dx + pshufw mm6, [esp+24], 0 ; mm6 = dy movq mm4, [pw_8 GLOBAL] movq mm0, mm4 - psubw mm4, mm5 ; mm4 - 8-dx - psubw mm0, mm6 ; mm0 - 8-dy + psubw mm4, mm5 ; mm4 = 8-dx + psubw mm0, mm6 ; mm0 = 8-dy movq mm7, mm5 pmullw mm5, mm0 ; mm5 = dx*(8-dy) = cB @@ -537,7 +537,7 @@ x264_mc_chroma_sse: mov eax, [esp+4+4] ; src mov edi, [esp+4+12] ; dst mov ecx, [esp+4+8] ; i_src_stride - mov edx, [esp+4+28] ; i_height + mov edx, [esp+4+32] ; i_height ALIGN 4 .height_loop @@ -573,14 +573,12 @@ ALIGN 4 dec edx jnz .height_loop - mov eax, [esp+4+32] - sub eax, 8 - jnz .finish ; width != 8 so assume 4 + sub [esp+4+28], dword 8 + jnz .finish ; width != 8 so assume 4 - mov [esp+4+32], eax mov edi, [esp+4+12] ; dst mov eax, [esp+4+4] ; src - mov edx, [esp+4+28] ; i_height + mov edx, [esp+4+32] ; i_height add edi, 4 add eax, 4 jmp .height_loop diff --git a/common/i386/mc.h b/common/i386/mc.h index 69766167..bde31b0d 100644 --- a/common/i386/mc.h +++ b/common/i386/mc.h @@ -27,8 +27,7 @@ void x264_mc_mmxext_init( x264_mc_functions_t *pf ); void x264_mc_sse2_init( x264_mc_functions_t *pf ); -void x264_mc_chroma_sse( uint8_t *src, int i_src_stride, - uint8_t *dst, int i_dst_stride, - int dx, int dy, - int i_height, int i_width ); +void x264_mc_chroma_mmxext( uint8_t *src, int i_src_stride, + uint8_t *dst, int i_dst_stride, + int dx, int dy, int i_width, int i_height ); #endif diff --git a/common/mc.c b/common/mc.c index 3087b402..9750818a 100644 --- a/common/mc.c +++ b/common/mc.c @@ -323,7 +323,7 @@ static void motion_compensation_chroma( uint8_t *src, int i_src_stride, } #ifdef HAVE_MMXEXT -static void motion_compensation_chroma_sse( uint8_t *src, int i_src_stride, +static void motion_compensation_chroma_mmxext( uint8_t *src, int i_src_stride, uint8_t *dst, int i_dst_stride, int mvx, int mvy, int i_width, int i_height ) @@ -337,8 +337,8 @@ static void motion_compensation_chroma_sse( uint8_t *src, int i_src_stride, src += (mvy >> 3) * i_src_stride + (mvx >> 3); - x264_mc_chroma_sse(src, i_src_stride, dst, i_dst_stride, - d8x, d8y, i_height, i_width); + x264_mc_chroma_mmxext( src, i_src_stride, dst, i_dst_stride, + d8x, d8y, i_width, i_height ); } } #endif @@ -374,7 +374,7 @@ void x264_mc_init( int cpu, x264_mc_functions_t *pf ) #ifdef HAVE_MMXEXT if( cpu&X264_CPU_MMXEXT ) { x264_mc_mmxext_init( pf ); - pf->mc_chroma = motion_compensation_chroma_sse; + pf->mc_chroma = motion_compensation_chroma_mmxext; } #endif #ifdef HAVE_SSE2