From 77bce7d16d8a2fc12aff32997def2f966975617c Mon Sep 17 00:00:00 2001 From: Min Chen Date: Thu, 17 Jun 2004 09:01:19 +0000 Subject: [PATCH] update git-svn-id: svn://svn.videolan.org/x264/trunk@9 df754926-b1dd-0310-bc7b-ec298dee348c --- build/win32/libx264.dsp | 63 ++++++++++++++++++++++++++++++++--------- core/i386/mc-c.c | 10 ++++++- core/i386/mc.asm | 46 +++++++++++++++++++++++++++++- 3 files changed, 104 insertions(+), 15 deletions(-) diff --git a/build/win32/libx264.dsp b/build/win32/libx264.dsp index 63a4d6a0..68b217a2 100644 --- a/build/win32/libx264.dsp +++ b/build/win32/libx264.dsp @@ -302,7 +302,7 @@ SOURCE=..\..\core\i386\cpu.asm !IF "$(CFG)" == "libx264 - Win32 Release" -# Begin Custom Build +# Begin Custom Build - Assembly $(InputPath) IntDir=.\Release InputPath=..\..\core\i386\cpu.asm InputName=cpu @@ -314,7 +314,7 @@ InputName=cpu !ELSEIF "$(CFG)" == "libx264 - Win32 Debug" -# Begin Custom Build +# Begin Custom Build - Assembly $(InputPath) IntDir=.\Debug InputPath=..\..\core\i386\cpu.asm InputName=cpu @@ -337,7 +337,7 @@ SOURCE=..\..\core\i386\dct.asm !IF "$(CFG)" == "libx264 - Win32 Release" -# Begin Custom Build +# Begin Custom Build - Assembly $(InputPath) IntDir=.\Release InputPath=..\..\core\i386\dct.asm InputName=dct @@ -349,7 +349,7 @@ InputName=dct !ELSEIF "$(CFG)" == "libx264 - Win32 Debug" -# Begin Custom Build +# Begin Custom Build - Assembly $(InputPath) IntDir=.\Debug InputPath=..\..\core\i386\dct.asm InputName=dct @@ -368,11 +368,55 @@ SOURCE=..\..\core\i386\dct.h # End Source File # Begin Source File +SOURCE="..\..\core\i386\mc-c.c" + +!IF "$(CFG)" == "libx264 - Win32 Release" + +!ELSEIF "$(CFG)" == "libx264 - Win32 Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\core\i386\mc.asm + +!IF "$(CFG)" == "libx264 - Win32 Release" + +# Begin Custom Build - Assembly $(InputPath) +IntDir=.\Release +InputPath=..\..\core\i386\mc.asm +InputName=mc + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath) + +# End Custom Build + +!ELSEIF "$(CFG)" == "libx264 - Win32 Debug" + +# Begin Custom Build - Assembly $(InputPath) +IntDir=.\Debug +InputPath=..\..\core\i386\mc.asm +InputName=mc + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath) + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=..\..\core\i386\pixel.asm !IF "$(CFG)" == "libx264 - Win32 Release" -# Begin Custom Build +# Begin Custom Build - Assembly $(InputPath) IntDir=.\Release InputPath=..\..\core\i386\pixel.asm InputName=pixel @@ -384,7 +428,7 @@ InputName=pixel !ELSEIF "$(CFG)" == "libx264 - Win32 Debug" -# Begin Custom Build +# Begin Custom Build - Assembly $(InputPath) IntDir=.\Debug InputPath=..\..\core\i386\pixel.asm InputName=pixel @@ -450,13 +494,6 @@ SOURCE=..\..\core\cpu.c # Begin Source File SOURCE=..\..\core\csp.c - -!IF "$(CFG)" == "libx264 - Win32 Release" - -!ELSEIF "$(CFG)" == "libx264 - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File diff --git a/core/i386/mc-c.c b/core/i386/mc-c.c index aa3fd7d4..e409b520 100644 --- a/core/i386/mc-c.c +++ b/core/i386/mc-c.c @@ -2,7 +2,7 @@ * mc.c: h264 encoder library (Motion Compensation) ***************************************************************************** * Copyright (C) 2003 Laurent Aimar - * $Id: mc-c.c,v 1.3 2004/06/10 18:13:38 fenrir Exp $ + * $Id: mc-c.c,v 1.4 2004/06/17 09:01:19 chenm001 Exp $ * * Authors: Laurent Aimar * @@ -180,6 +180,7 @@ static inline int x264_tapfilter1( uint8_t *pix ) return pix[-2] - 5*pix[-1] + 20*(pix[0] + pix[1]) - 5*pix[ 2] + pix[ 3]; } +#if 0 static inline void pixel_avg_w4( uint8_t *dst, int i_dst_stride, uint8_t *src1, int i_src1_stride, uint8_t *src2, int i_src2_stride, @@ -197,6 +198,13 @@ static inline void pixel_avg_w4( uint8_t *dst, int i_dst_stride, src2 += i_src2_stride; } } +#else +extern void pixel_avg_w4( uint8_t *dst, int i_dst_stride, + uint8_t *src1, int i_src1_stride, + uint8_t *src2, int i_src2_stride, + int i_height ); +#endif + static inline void pixel_avg_w8( uint8_t *dst, int i_dst_stride, uint8_t *src1, int i_src1_stride, uint8_t *src2, int i_src2_stride, diff --git a/core/i386/mc.asm b/core/i386/mc.asm index 0210a6b3..0f18c04d 100644 --- a/core/i386/mc.asm +++ b/core/i386/mc.asm @@ -2,7 +2,7 @@ ;* mc.asm: h264 encoder library ;***************************************************************************** ;* Copyright (C) 2003 x264 project -;* $Id: mc.asm,v 1.1 2004/06/03 19:27:07 fenrir Exp $ +;* $Id: mc.asm,v 1.2 2004/06/17 09:01:19 chenm001 Exp $ ;* ;* Authors: Min Chen (converted to nasm) ;* Laurent Aimar (init algorithm) @@ -67,6 +67,50 @@ ALIGN 16 SECTION .text +cglobal pixel_avg_w4 + +ALIGN 16 +;----------------------------------------------------------------------------- +; void pixel_avg_w4( uint8_t *dst, int i_dst_stride, +; uint8_t *src1, int i_src1_stride, +; uint8_t *src2, int i_src2_stride, +; int i_height ); +;----------------------------------------------------------------------------- +pixel_avg_w4: + push ebp + push ebx + push esi + push edi + + mov edi, [esp+20] ; dst + mov ebx, [esp+28] ; src1 + mov ecx, [esp+36] ; src2 + mov esi, [esp+24] ; i_dst_stride + mov eax, [esp+32] ; i_src1_stride + mov edx, [esp+40] ; i_src2_stride + mov ebp, [esp+44] ; i_height +ALIGN 4 +.height_loop + movd mm0, [ebx] + pavgb mm0, [ecx] + movd mm1, [ebx+eax] + pavgb mm1, [ecx+edx] + movd [edi], mm0 + movd [edi+esi], mm1 + dec ebp + dec ebp + lea ebx, [ebx+eax*2] + lea ecx, [ecx+edx*2] + lea edi, [edi+esi*2] + jne .height_loop + + pop edi + pop esi + pop ebx + pop ebp + ret + + cglobal mc_copy_w4 ALIGN 16 -- 2.47.3