]> git.videolan.org Git - x264.git/commitdiff
update msvc project files.
authorLoren Merritt <pengvado@videolan.org>
Thu, 20 Apr 2006 04:38:45 +0000 (04:38 +0000)
committerLoren Merritt <pengvado@videolan.org>
Thu, 20 Apr 2006 04:38:45 +0000 (04:38 +0000)
patch by anonymous.

git-svn-id: svn://svn.videolan.org/x264/trunk@504 df754926-b1dd-0310-bc7b-ec298dee348c

Makefile
build/win32/libx264.dsp
build/win32/libx264.vcproj
build/win32/x264.dsp
build/win32/x264.sln [new file with mode: 0644]
build/win32/x264.vcproj
common/frame.h
common/i386/predict-c.c [new file with mode: 0644]
common/i386/predict.c [deleted file]
encoder/ratecontrol.c
encoder/rdo.c

index e268e921a8282b09ba8a3d642355a67dfa245fd2..8ecd46a13ddd0fb8f10b3671cafc733f25953c62 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ endif
 
 # MMX/SSE optims
 ifeq ($(ARCH),X86)
-SRCS   += common/i386/mc-c.c common/i386/dct-c.c common/i386/predict.c
+SRCS   += common/i386/mc-c.c common/i386/dct-c.c common/i386/predict-c.c
 ASMSRC  = common/i386/dct-a.asm common/i386/cpu-a.asm \
           common/i386/pixel-a.asm common/i386/mc-a.asm \
           common/i386/mc-a2.asm common/i386/predict-a.asm \
@@ -31,7 +31,7 @@ endif
 
 # MMX/SSE optims
 ifeq ($(ARCH),X86_64)
-SRCS   += common/i386/mc-c.c common/i386/dct-c.c common/i386/predict.c
+SRCS   += common/i386/mc-c.c common/i386/dct-c.c commoni386/predict-c.c
 ASMSRC  = common/amd64/dct-a.asm common/amd64/cpu-a.asm \
           common/amd64/pixel-a.asm common/amd64/mc-a.asm \
           common/amd64/mc-a2.asm common/amd64/predict-a.asm \
index 215861886c01ea9d9beb4ebb4fb3b33d6c8062ce..d7936c5f9ccd68979062a82d0b66b8966ed6e01a 100644 (file)
@@ -25,7 +25,7 @@ CFG=libx264 - Win32 Debug
 # PROP AllowPerConfigDependencies 0\r
 # PROP Scc_ProjName ""\r
 # PROP Scc_LocalPath ""\r
-CPP=xicl6.exe\r
+CPP=cl.exe\r
 RSC=rc.exe\r
 \r
 !IF  "$(CFG)" == "libx264 - Win32 Release"\r
@@ -41,7 +41,7 @@ RSC=rc.exe
 # PROP Intermediate_Dir "Release"\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c\r
-# ADD CPP /nologo /G6 /W3 /GX /O2 /Ob2 /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "NDEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "ARCH_X86" /D "HAVE_STDINT_H" /FD /c\r
+# ADD CPP /nologo /G6 /W3 /GX /O2 /Ob2 /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "NDEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "HAVE_SSE2" /D "ARCH_X86" /D "HAVE_STDINT_H" /FD /c\r
 # SUBTRACT CPP /YX\r
 # ADD BASE RSC /l 0x804 /d "NDEBUG"\r
 # ADD RSC /l 0x804 /d "NDEBUG"\r
@@ -65,7 +65,7 @@ LIB32=link.exe -lib
 # PROP Intermediate_Dir "Debug"\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c\r
-# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "_DEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "ARCH_X86" /D "HAVE_STDINT_H" /FD /GZ /c\r
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "_DEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "HAVE_SSE2" /D "ARCH_X86" /D "HAVE_STDINT_H" /FD /GZ /c\r
 # SUBTRACT CPP /YX\r
 # ADD BASE RSC /l 0x804 /d "_DEBUG"\r
 # ADD RSC /l 0x804 /d "_DEBUG"\r
@@ -323,7 +323,7 @@ InputPath=..\..\common\i386\cpu-a.asm
 InputName=cpu-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -335,7 +335,7 @@ InputPath=..\..\common\i386\cpu-a.asm
 InputName=cpu-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -354,7 +354,7 @@ InputPath=..\..\common\i386\dct-a.asm
 InputName=dct-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -366,7 +366,7 @@ InputPath=..\..\common\i386\dct-a.asm
 InputName=dct-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -379,6 +379,10 @@ SOURCE="..\..\common\i386\dct-c.c"
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE="..\..\common\i386\predict-c.c"\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=..\..\common\i386\dct.h\r
 # End Source File\r
 # Begin Source File\r
@@ -393,7 +397,7 @@ InputPath=..\..\common\i386\mc-a.asm
 InputName=mc-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -405,7 +409,7 @@ InputPath=..\..\common\i386\mc-a.asm
 InputName=mc-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -424,7 +428,7 @@ InputPath=..\..\common\i386\pixel-a.asm
 InputName=pixel-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -436,7 +440,38 @@ InputPath=..\..\common\i386\pixel-a.asm
 InputName=pixel-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+\r
+# End Custom Build\r
+\r
+!ENDIF \r
+\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE="..\..\common\i386\pixel-sse2.asm"\r
+\r
+!IF  "$(CFG)" == "libx264 - Win32 Release"\r
+\r
+# Begin Custom Build - Assembly $(InputPath)\r
+IntDir=.\Release\r
+InputPath=..\..\common\i386\pixel-sse2.asm\r
+InputName=pixel-sse2\r
+\r
+"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+\r
+# End Custom Build\r
+\r
+!ELSEIF  "$(CFG)" == "libx264 - Win32 Debug"\r
+\r
+# Begin Custom Build - Assembly $(InputPath)\r
+IntDir=.\Debug\r
+InputPath=..\..\common\i386\pixel-sse2.asm\r
+InputName=pixel-sse2\r
+\r
+"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -455,7 +490,7 @@ InputPath=..\..\common\i386\mc-a2.asm
 InputName=mc-a2\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -467,7 +502,7 @@ InputPath=..\..\common\i386\mc-a2.asm
 InputName=mc-a2\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -486,7 +521,7 @@ InputPath=..\..\common\i386\predict-a.asm
 InputName=predict-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -498,7 +533,69 @@ InputPath=..\..\common\i386\predict-a.asm
 InputName=predict-a\r
 \r
 "$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       nasm -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+\r
+# End Custom Build\r
+\r
+!ENDIF \r
+\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE="..\..\common\i386\deblock-a.asm"\r
+\r
+!IF  "$(CFG)" == "libx264 - Win32 Release"\r
+\r
+# Begin Custom Build - Assembly $(InputPath)\r
+IntDir=.\Release\r
+InputPath=..\..\common\i386\deblock-a.asm\r
+InputName=deblock-a\r
+\r
+"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+\r
+# End Custom Build\r
+\r
+!ELSEIF  "$(CFG)" == "libx264 - Win32 Debug"\r
+\r
+# Begin Custom Build - Assembly $(InputPath)\r
+IntDir=.\Debug\r
+InputPath=..\..\common\i386\deblock-a.asm\r
+InputName=deblock-a\r
+\r
+"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+\r
+# End Custom Build\r
+\r
+!ENDIF \r
+\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE="..\..\common\i386\quant-a.asm"\r
+\r
+!IF  "$(CFG)" == "libx264 - Win32 Release"\r
+\r
+# Begin Custom Build - Assembly $(InputPath)\r
+IntDir=.\Release\r
+InputPath=..\..\common\i386\quant-a.asm\r
+InputName=quant-a\r
+\r
+"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
+\r
+# End Custom Build\r
+\r
+!ELSEIF  "$(CFG)" == "libx264 - Win32 Debug"\r
+\r
+# Begin Custom Build - Assembly $(InputPath)\r
+IntDir=.\Debug\r
+InputPath=..\..\common\i386\quant-a.asm\r
+InputName=quant-a\r
+\r
+"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
+       nasm -I..\..\common\i386\ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)\r
 \r
 # End Custom Build\r
 \r
@@ -666,6 +763,36 @@ SOURCE=..\..\common\predict.c
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\..\common\set.c\r
+\r
+!IF  "$(CFG)" == "libx264 - Win32 Release"\r
+\r
+# PROP Intermediate_Dir "obj/core_release"\r
+\r
+!ELSEIF  "$(CFG)" == "libx264 - Win32 Debug"\r
+\r
+# PROP Intermediate_Dir "obj/core_debug"\r
+\r
+!ENDIF \r
+\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\common\quant.c\r
+\r
+!IF  "$(CFG)" == "libx264 - Win32 Release"\r
+\r
+# PROP Intermediate_Dir "obj/core_release"\r
+\r
+!ELSEIF  "$(CFG)" == "libx264 - Win32 Debug"\r
+\r
+# PROP Intermediate_Dir "obj/core_debug"\r
+\r
+!ENDIF \r
+\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=..\..\common\i386\mc-c.c\r
 \r
 !IF  "$(CFG)" == "libx264 - Win32 Release"\r
index 50c3bfbf33c30577ddf1d38d6119a64a52bfb605..21d3305901fc54d3f252d9c6d0308d24f7a7a8e3 100644 (file)
@@ -3,6 +3,7 @@
        ProjectType="Visual C++"\r
        Version="7.10"\r
        Name="libx264"\r
+       ProjectGUID="{A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}"\r
        SccProjectName=""\r
        SccLocalPath="">\r
        <Platforms>\r
                                                ProgramDataBaseFileName="obj/core_release/"/>\r
                                </FileConfiguration>\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\common\i386\predict-c.c">\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                               ObjectFile=".\obj/core_release/"\r
+                                               ProgramDataBaseFileName="obj/core_release/"/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="0"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                               BasicRuntimeChecks="3"\r
+                                               ObjectFile=".\obj/core_debug/"\r
+                                               ProgramDataBaseFileName="obj/core_debug/"/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release64|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                               ObjectFile=".\obj/core_release/"\r
+                                               ProgramDataBaseFileName="obj/core_release/"/>\r
+                               </FileConfiguration>\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\common\quant.c">\r
                        </File>\r
                        <Filter\r
                                Name="I386"\r
                                Filter="*.h,*.c,*-a.asm">\r
-                               <File\r
-                                       RelativePath="..\..\common\i386\i386inc.asm">\r
-                               </File>\r
                                <File\r
                                        RelativePath="..\..\common\i386\cpu-a.asm">\r
                                        <FileConfiguration\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                <File\r
                                        RelativePath="..\..\common\i386\dct.h">\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\..\common\i386\deblock-a.asm">\r
+                                       <FileConfiguration\r
+                                               Name="Release|Win32">\r
+                                               <Tool\r
+                                                       Name="VCCustomBuildTool"\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;"\r
+                                                       Outputs="$(IntDir)\$(InputName).obj"/>\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Debug|Win32">\r
+                                               <Tool\r
+                                                       Name="VCCustomBuildTool"\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;"\r
+                                                       Outputs="$(IntDir)\$(InputName).obj"/>\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Release64|Win32">\r
+                                               <Tool\r
+                                                       Name="VCCustomBuildTool"\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;"\r
+                                                       Outputs="$(IntDir)\$(InputName).obj"/>\r
+                                       </FileConfiguration>\r
+                               </File>\r
+                               <File\r
+                                       RelativePath="..\..\common\i386\i386inc.asm">\r
+                                       <FileConfiguration\r
+                                               Name="Release|Win32">\r
+                                               <Tool\r
+                                                       Name="VCCustomBuildTool"\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+"\r
+                                                       Outputs="$(IntDir)\$(InputName).obj"/>\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Debug|Win32">\r
+                                               <Tool\r
+                                                       Name="VCCustomBuildTool"\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+"\r
+                                                       Outputs="$(IntDir)\$(InputName).obj"/>\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Release64|Win32">\r
+                                               <Tool\r
+                                                       Name="VCCustomBuildTool"\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+"\r
+                                                       Outputs="$(IntDir)\$(InputName).obj"/>\r
+                                       </FileConfiguration>\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\..\common\i386\mc-a.asm">\r
                                        <FileConfiguration\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                Name="Release|Win32">\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
-                                                       Outputs="&quot;$(IntDir)\$(InputName)&quot;.obj"/>\r
+                                                       Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                        <FileConfiguration\r
                                                Name="Debug|Win32">\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
-                                                       Outputs="&quot;$(IntDir)\$(InputName)&quot;.obj"/>\r
+                                                       Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                        <FileConfiguration\r
                                                Name="Release64|Win32"\r
                                                ExcludedFromBuild="TRUE">\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
-                                                       Outputs="&quot;$(IntDir)\$(InputName)&quot;.obj"/>\r
+                                                       Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                </File>\r
                                <File\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
                                                        Description="Assembly $(InputPath)"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                Name="Release|Win32">\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                Name="Debug|Win32">\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
                                                ExcludedFromBuild="TRUE">\r
                                                <Tool\r
                                                        Name="VCCustomBuildTool"\r
-                                                       CommandLine="nasm -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
+                                                       Description="Assembly $(InputPath)"\r
+                                                       CommandLine="nasm -I..\..\common\i386\ -f win32 -DPREFIX -o &quot;$(IntDir)\$(InputName)&quot;.obj &quot;$(InputPath)&quot;\r
 "\r
                                                        Outputs="$(IntDir)\$(InputName).obj"/>\r
                                        </FileConfiguration>\r
index 9a0e95f2435b9d068b6e68102511e9768f345e83..b524663bfa8ccc5886e3a996a64d711c13c8af7d 100644 (file)
@@ -42,7 +42,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /W3 /GX /O2 /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /YX /FD /c\r
+# ADD CPP /nologo /W3 /GX /O2 /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "HAVE_SSE2" /D "HAVE_STDINT_H" /YX /FD /c\r
 # ADD BASE RSC /l 0x804 /d "NDEBUG"\r
 # ADD RSC /l 0x804 /d "NDEBUG"\r
 BSC32=bscmake.exe\r
@@ -66,7 +66,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "../../common" /I "../../encode" /I "../../decode" /I "../../extras" /I "../.." /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /YX /FD /GZ /c\r
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "../../common" /I "../../encode" /I "../../decode" /I "../../extras" /I "../.." /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "HAVE_SSE2" /D "HAVE_STDINT_H" /YX /FD /GZ /c\r
 # ADD BASE RSC /l 0x804 /d "_DEBUG"\r
 # ADD RSC /l 0x804 /d "_DEBUG"\r
 BSC32=bscmake.exe\r
@@ -90,5 +90,21 @@ SOURCE=..\..\x264.c
 \r
 SOURCE=..\..\x264.h\r
 # End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\matroska.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\matroska.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\muxers.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\muxers.h\r
+# End Source File\r
 # End Target\r
 # End Project\r
diff --git a/build/win32/x264.sln b/build/win32/x264.sln
new file mode 100644 (file)
index 0000000..548276a
--- /dev/null
@@ -0,0 +1,35 @@
+Microsoft Visual Studio Solution File, Format Version 8.00\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libx264", "libx264.vcproj", "{A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x264", "x264.vcproj", "{22E1814D-7955-4456-AEA5-0C9BA7500792}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6} = {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}\r
+       EndProjectSection\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfiguration) = preSolution\r
+               Debug = Debug\r
+               Release = Release\r
+               Release64 = Release64\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfiguration) = postSolution\r
+               {22E1814D-7955-4456-AEA5-0C9BA7500792}.Debug.ActiveCfg = Debug|Win32\r
+               {22E1814D-7955-4456-AEA5-0C9BA7500792}.Debug.Build.0 = Debug|Win32\r
+               {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release.ActiveCfg = Release|Win32\r
+               {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release.Build.0 = Release|Win32\r
+               {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release64.ActiveCfg = Release64|Win32\r
+               {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release64.Build.0 = Release64|Win32\r
+               {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Debug.ActiveCfg = Debug|Win32\r
+               {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Debug.Build.0 = Debug|Win32\r
+               {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release.ActiveCfg = Release|Win32\r
+               {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release.Build.0 = Release|Win32\r
+               {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release64.ActiveCfg = Release64|Win32\r
+               {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release64.Build.0 = Release64|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ExtensibilityGlobals) = postSolution\r
+       EndGlobalSection\r
+       GlobalSection(ExtensibilityAddIns) = postSolution\r
+       EndGlobalSection\r
+EndGlobal\r
index b103db8e351022b71ca902153c49768eb6368ef0..517c7db7fabaf23f33ccbe3f3f5130e7ed2c6f52 100644 (file)
@@ -3,6 +3,7 @@
        ProjectType="Visual C++"\r
        Version="7.10"\r
        Name="x264"\r
+       ProjectGUID="{22E1814D-7955-4456-AEA5-0C9BA7500792}"\r
        SccProjectName=""\r
        SccLocalPath="">\r
        <Platforms>\r
@@ -22,7 +23,7 @@
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
                                AdditionalIncludeDirectories="../../common;../../encode;../../decode;../../extras;../..;L:\gpac\include"\r
-                               PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMXEXT;HAVE_STDINT_H;AVIS_INPUT;MP4_OUTPUT"\r
+                               PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMXEXT;HAVE_STDINT_H;AVIS_INPUT"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="5"\r
                                UsePrecompiledHeader="2"\r
@@ -38,7 +39,7 @@
                                Name="VCCustomBuildTool"/>\r
                        <Tool\r
                                Name="VCLinkerTool"\r
-                               AdditionalDependencies="vfw32.lib ..\..\..\gpac\bin\w32_deb\libgpac_static.lib winmm.lib"\r
+                               AdditionalDependencies="vfw32.lib winmm.lib"\r
                                OutputFile="bin/x264.exe"\r
                                LinkIncremental="1"\r
                                SuppressStartupBanner="TRUE"\r
@@ -84,7 +85,7 @@
                                Optimization="2"\r
                                InlineFunctionExpansion="1"\r
                                AdditionalIncludeDirectories="./common;./encode;./decode;../../extras;../..;L:\gpac\include"\r
-                               PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMXEXT;HAVE_STDINT_H;AVIS_INPUT;MP4_OUTPUT"\r
+                               PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMXEXT;HAVE_STDINT_H;AVIS_INPUT"\r
                                StringPooling="TRUE"\r
                                RuntimeLibrary="0"\r
                                EnableFunctionLevelLinking="TRUE"\r
                                Name="VCCustomBuildTool"/>\r
                        <Tool\r
                                Name="VCLinkerTool"\r
-                               AdditionalDependencies="vfw32.lib ..\..\..\gpac\bin\w32_rel\libgpac_static.lib winmm.lib"\r
+                               AdditionalDependencies="vfw32.lib winmm.lib"\r
                                OutputFile="bin/x264.exe"\r
                                LinkIncremental="1"\r
                                SuppressStartupBanner="TRUE"\r
                <File\r
                        RelativePath="..\..\matroska.h">\r
                </File>\r
+               <File\r
+                       RelativePath="..\..\muxers.c">\r
+               </File>\r
+               <File\r
+                       RelativePath="..\..\muxers.h">\r
+               </File>\r
                <File\r
                        RelativePath="..\..\x264.c">\r
                        <FileConfiguration\r
index e682569a04195076213e626c78c23b8da71bdb9f..2eedff72c104e872788f35a6426c1083f6c04783 100644 (file)
@@ -24,8 +24,6 @@
 #ifndef _FRAME_H
 #define _FRAME_H 1
 
-#include <inttypes.h>
-
 typedef struct
 {
     /* */
diff --git a/common/i386/predict-c.c b/common/i386/predict-c.c
new file mode 100644 (file)
index 0000000..e46f32d
--- /dev/null
@@ -0,0 +1,614 @@
+/*****************************************************************************
+ * predict.c: h264 encoder
+ *****************************************************************************
+ * Copyright (C) 2003 Laurent Aimar
+ * $Id: predict.c,v 1.1 2004/06/03 19:27:07 fenrir Exp $
+ *
+ * Authors: Laurent Aimar <fenrir@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "common/common.h"
+#include "common/clip1.h"
+#include "predict.h"
+
+extern void predict_16x16_v_mmx( uint8_t *src );
+extern void predict_16x16_dc_core_mmxext( uint8_t *src, int i_dc_left );
+extern void predict_16x16_dc_top_mmxext( uint8_t *src );
+extern void predict_16x16_p_core_mmxext( uint8_t *src, int i00, int b, int c );
+extern void predict_8x8c_p_core_mmxext( uint8_t *src, int i00, int b, int c );
+extern void predict_8x8c_dc_core_mmxext( uint8_t *src, int s2, int s3 );
+extern void predict_8x8c_v_mmx( uint8_t *src );
+extern void predict_8x8_v_mmxext( uint8_t *src, int i_neighbors );
+extern void predict_8x8_ddl_mmxext( uint8_t *src, int i_neighbors );
+extern void predict_8x8_ddl_sse2( uint8_t *src, int i_neighbors );
+extern void predict_8x8_ddr_sse2( uint8_t *src, int i_neighbors );
+extern void predict_8x8_vl_sse2( uint8_t *src, int i_neighbors );
+extern void predict_8x8_vr_core_mmxext( uint8_t *src, int i_neighbors, uint16_t ltt0 );
+extern void predict_8x8_dc_core_mmxext( uint8_t *src, int i_neighbors, uint8_t *pix_left );
+extern void predict_4x4_ddl_mmxext( uint8_t *src );
+extern void predict_4x4_vl_mmxext( uint8_t *src );
+
+static void predict_16x16_p( uint8_t *src )
+{
+    int a, b, c, i;
+    int H = 0;
+    int V = 0;
+    int i00;
+
+    for( i = 1; i <= 8; i++ )
+    {
+        H += i * ( src[7+i - FDEC_STRIDE ]  - src[7-i - FDEC_STRIDE ] );
+        V += i * ( src[(7+i)*FDEC_STRIDE -1] - src[(7-i)*FDEC_STRIDE -1] );
+    }
+
+    a = 16 * ( src[15*FDEC_STRIDE -1] + src[15 - FDEC_STRIDE] );
+    b = ( 5 * H + 32 ) >> 6;
+    c = ( 5 * V + 32 ) >> 6;
+    i00 = a - b * 7 - c * 7 + 16;
+
+    predict_16x16_p_core_mmxext( src, i00, b, c );
+}
+
+static void predict_8x8c_p( uint8_t *src )
+{
+    int a, b, c, i;
+    int H = 0;
+    int V = 0;
+    int i00;
+
+    for( i = 1; i <= 4; i++ )
+    {
+        H += i * ( src[3+i - FDEC_STRIDE] - src[3-i - FDEC_STRIDE] );
+        V += i * ( src[(3+i)*FDEC_STRIDE -1] - src[(3-i)*FDEC_STRIDE -1] );
+    }
+
+    a = 16 * ( src[7*FDEC_STRIDE -1] + src[7 - FDEC_STRIDE] );
+    b = ( 17 * H + 16 ) >> 5;
+    c = ( 17 * V + 16 ) >> 5;
+    i00 = a -3*b -3*c + 16;
+
+    predict_8x8c_p_core_mmxext( src, i00, b, c );
+}
+
+static void predict_16x16_dc( uint8_t *src )
+{
+    uint32_t dc=16;
+    int i;
+
+    for( i = 0; i < 16; i+=2 )
+    {
+        dc += src[-1 + i * FDEC_STRIDE];
+        dc += src[-1 + (i+1) * FDEC_STRIDE];
+    }
+
+    predict_16x16_dc_core_mmxext( src, dc );
+}
+
+static void predict_8x8c_dc( uint8_t *src )
+{
+    int s2 = 4
+       + src[-1 + 0*FDEC_STRIDE]
+       + src[-1 + 1*FDEC_STRIDE]
+       + src[-1 + 2*FDEC_STRIDE]
+       + src[-1 + 3*FDEC_STRIDE];
+
+    int s3 = 2
+       + src[-1 + 4*FDEC_STRIDE]
+       + src[-1 + 5*FDEC_STRIDE]
+       + src[-1 + 6*FDEC_STRIDE]
+       + src[-1 + 7*FDEC_STRIDE];
+
+    predict_8x8c_dc_core_mmxext( src, s2, s3 );
+}
+
+#define SRC(x,y) src[(x)+(y)*FDEC_STRIDE]
+static void predict_8x8_dc( uint8_t *src, int i_neighbor )
+{
+    uint8_t l[10];
+    l[0] = i_neighbor&MB_TOPLEFT ? SRC(-1,-1) : SRC(-1,0);
+    l[1] = SRC(-1,0);
+    l[2] = SRC(-1,1);
+    l[3] = SRC(-1,2);
+    l[4] = SRC(-1,3);
+    l[5] = SRC(-1,4);
+    l[6] = SRC(-1,5);
+    l[7] = SRC(-1,6);
+    l[8] =
+    l[9] = SRC(-1,7);
+
+    predict_8x8_dc_core_mmxext( src, i_neighbor, l+1 );
+}
+
+#ifdef ARCH_X86_64
+static void predict_16x16_h( uint8_t *src )
+{
+    int y;
+    for( y = 0; y < 16; y++ )
+    {
+        const uint64_t v = 0x0101010101010101ULL * src[-1];
+        uint64_t *p = (uint64_t*)src;
+        p[0] = p[1] = v;
+        src += FDEC_STRIDE;
+    }
+}
+
+static void predict_8x8c_h( uint8_t *src )
+{
+    int y;
+    for( y = 0; y < 8; y++ )
+    {
+        *(uint64_t*)src = 0x0101010101010101ULL * src[-1];
+        src += FDEC_STRIDE;
+    }
+}
+
+static void predict_16x16_dc_left( uint8_t *src )
+{
+    uint32_t s = 0;
+    uint64_t dc; 
+    int y;
+    
+    for( y = 0; y < 16; y++ )
+    {
+        s += src[-1 + y * FDEC_STRIDE];
+    }   
+    dc = (( s + 8 ) >> 4) * 0x0101010101010101ULL;
+    
+    for( y = 0; y < 16; y++ )
+    {
+        uint64_t *p = (uint64_t*)src;
+        p[0] = p[1] = dc;
+        src += FDEC_STRIDE;
+    }
+}
+
+static void predict_8x8c_dc_left( uint8_t *src )
+{
+    int y;
+    uint32_t s0 = 0, s1 = 0;
+    uint64_t dc0, dc1;
+
+    for( y = 0; y < 4; y++ )
+    {
+        s0 += src[y * FDEC_STRIDE     - 1];
+        s1 += src[(y+4) * FDEC_STRIDE - 1];
+    }
+    dc0 = (( s0 + 2 ) >> 2) * 0x0101010101010101ULL;
+    dc1 = (( s1 + 2 ) >> 2) * 0x0101010101010101ULL;
+
+    for( y = 0; y < 4; y++ )
+    {
+        *(uint64_t*)src = dc0;
+        src += FDEC_STRIDE;
+    }
+    for( y = 0; y < 4; y++ )
+    {
+        *(uint64_t*)src = dc1;
+        src += FDEC_STRIDE;
+    }
+
+}
+
+static void predict_8x8c_dc_top( uint8_t *src )
+{
+    int y, x;
+    uint32_t s0 = 0, s1 = 0;
+    uint64_t dc;
+
+    for( x = 0; x < 4; x++ )
+    {
+        s0 += src[x     - FDEC_STRIDE];
+        s1 += src[x + 4 - FDEC_STRIDE];
+    }
+    dc = (( s0 + 2 ) >> 2) * 0x01010101
+       + (( s1 + 2 ) >> 2) * 0x0101010100000000ULL;
+
+    for( y = 0; y < 8; y++ )
+    {
+        *(uint64_t*)src = dc;
+        src += FDEC_STRIDE;
+    }
+}
+#endif
+
+/* Diagonals */
+
+#define PREDICT_4x4_LOAD_LEFT \
+    const int l0 = src[-1+0*FDEC_STRIDE];   \
+    const int l1 = src[-1+1*FDEC_STRIDE];   \
+    const int l2 = src[-1+2*FDEC_STRIDE];   \
+    UNUSED const int l3 = src[-1+3*FDEC_STRIDE];
+
+#define PREDICT_4x4_LOAD_TOP \
+    const int t0 = src[0-1*FDEC_STRIDE];   \
+    const int t1 = src[1-1*FDEC_STRIDE];   \
+    const int t2 = src[2-1*FDEC_STRIDE];   \
+    UNUSED const int t3 = src[3-1*FDEC_STRIDE];
+
+#define PREDICT_4x4_LOAD_TOP_RIGHT \
+    const int t4 = src[4-1*FDEC_STRIDE];   \
+    const int t5 = src[5-1*FDEC_STRIDE];   \
+    const int t6 = src[6-1*FDEC_STRIDE];   \
+    UNUSED const int t7 = src[7-1*FDEC_STRIDE];
+
+#define F1(a,b)   (((a)+(b)+1)>>1)
+#define F2(a,b,c) (((a)+2*(b)+(c)+2)>>2)
+
+#ifdef ARCH_X86_64 // slower on x86
+#if 0
+static void predict_4x4_ddl( uint8_t *src )
+{
+    PREDICT_4x4_LOAD_TOP
+    PREDICT_4x4_LOAD_TOP_RIGHT
+    uint32_t vec = (F2(t3,t4,t5)<< 0)
+                 + (F2(t4,t5,t6)<< 8)
+                 + (F2(t5,t6,t7)<<16)
+                 + (F2(t6,t7,t7)<<24);
+    *(uint32_t*)&src[3*FDEC_STRIDE] = vec;
+    *(uint32_t*)&src[2*FDEC_STRIDE] = vec = (vec<<8) + F2(t2,t3,t4);
+    *(uint32_t*)&src[1*FDEC_STRIDE] = vec = (vec<<8) + F2(t1,t2,t3);
+    *(uint32_t*)&src[0*FDEC_STRIDE] = vec = (vec<<8) + F2(t0,t1,t2);
+}
+#endif
+
+static void predict_4x4_ddr( uint8_t *src )
+{
+    const int lt = src[-1-FDEC_STRIDE];
+    PREDICT_4x4_LOAD_LEFT
+    PREDICT_4x4_LOAD_TOP
+    uint32_t vec = (F2(l0,lt,t0)<< 0)
+                 + (F2(lt,t0,t1)<< 8)
+                 + (F2(t0,t1,t2)<<16)
+                 + (F2(t1,t2,t3)<<24);
+    *(uint32_t*)&src[0*FDEC_STRIDE] = vec;
+    *(uint32_t*)&src[1*FDEC_STRIDE] = vec = (vec<<8) + F2(l1,l0,lt);
+    *(uint32_t*)&src[2*FDEC_STRIDE] = vec = (vec<<8) + F2(l2,l1,l0);
+    *(uint32_t*)&src[3*FDEC_STRIDE] = vec = (vec<<8) + F2(l3,l2,l1);
+}
+
+static void predict_4x4_vr( uint8_t *src )
+{
+    const int lt = src[-1-FDEC_STRIDE];
+    PREDICT_4x4_LOAD_LEFT
+    PREDICT_4x4_LOAD_TOP
+    const int ltt0 = lt + t0 + 1;
+    const int t0t1 = t0 + t1 + 1;
+    const int t1t2 = t1 + t2 + 1;
+    const int t2t3 = t2 + t3 + 1;
+    const int l0lt = l0 + lt + 1;
+    const int l1l0 = l1 + l0 + 1;
+    const int l2l1 = l2 + l1 + 1;
+
+    src[0*FDEC_STRIDE+0]=
+    src[2*FDEC_STRIDE+1]= ltt0 >> 1;
+
+    src[0*FDEC_STRIDE+1]=
+    src[2*FDEC_STRIDE+2]= t0t1 >> 1;
+
+    src[0*FDEC_STRIDE+2]=
+    src[2*FDEC_STRIDE+3]= t1t2 >> 1;
+
+    src[0*FDEC_STRIDE+3]= t2t3 >> 1;
+
+    src[1*FDEC_STRIDE+0]=
+    src[3*FDEC_STRIDE+1]= (l0lt + ltt0) >> 2;
+
+    src[1*FDEC_STRIDE+1]=
+    src[3*FDEC_STRIDE+2]= (ltt0 + t0t1) >> 2;
+
+    src[1*FDEC_STRIDE+2]=
+    src[3*FDEC_STRIDE+3]= (t0t1 + t1t2) >> 2;
+
+    src[1*FDEC_STRIDE+3]= (t1t2 + t2t3) >> 2;
+    src[2*FDEC_STRIDE+0]= (l1l0 + l0lt) >> 2;
+    src[3*FDEC_STRIDE+0]= (l2l1 + l1l0) >> 2;
+}
+
+static void predict_4x4_hd( uint8_t *src )
+{
+    const int lt= src[-1-1*FDEC_STRIDE];
+    PREDICT_4x4_LOAD_LEFT
+    PREDICT_4x4_LOAD_TOP
+    const int ltt0 = lt + t0 + 1;
+    const int t0t1 = t0 + t1 + 1;
+    const int t1t2 = t1 + t2 + 1;
+    const int l0lt = l0 + lt + 1;
+    const int l1l0 = l1 + l0 + 1;
+    const int l2l1 = l2 + l1 + 1;
+    const int l3l2 = l3 + l2 + 1;
+
+    src[0*FDEC_STRIDE+0]=
+    src[1*FDEC_STRIDE+2]= l0lt >> 1;
+    src[0*FDEC_STRIDE+1]=
+    src[1*FDEC_STRIDE+3]= (l0lt + ltt0) >> 2;
+    src[0*FDEC_STRIDE+2]= (ltt0 + t0t1) >> 2;
+    src[0*FDEC_STRIDE+3]= (t0t1 + t1t2) >> 2;
+    src[1*FDEC_STRIDE+0]=
+    src[2*FDEC_STRIDE+2]= l1l0 >> 1;
+    src[1*FDEC_STRIDE+1]=
+    src[2*FDEC_STRIDE+3]= (l0lt + l1l0) >> 2;
+    src[2*FDEC_STRIDE+0]=
+    src[3*FDEC_STRIDE+2]= l2l1 >> 1;
+    src[2*FDEC_STRIDE+1]=
+    src[3*FDEC_STRIDE+3]= (l1l0 + l2l1) >> 2;
+    src[3*FDEC_STRIDE+0]= l3l2 >> 1;
+    src[3*FDEC_STRIDE+1]= (l2l1 + l3l2) >> 2;
+}
+
+#if 0
+static void predict_4x4_vl( uint8_t *src )
+{
+    PREDICT_4x4_LOAD_TOP
+    PREDICT_4x4_LOAD_TOP_RIGHT
+    const int t0t1 = t0 + t1 + 1;
+    const int t1t2 = t1 + t2 + 1;
+    const int t2t3 = t2 + t3 + 1;
+    const int t3t4 = t3 + t4 + 1;
+    const int t4t5 = t4 + t5 + 1;
+    const int t5t6 = t5 + t6 + 1;
+
+    src[0*FDEC_STRIDE+0]= t0t1 >> 1;
+    src[0*FDEC_STRIDE+1]=
+    src[2*FDEC_STRIDE+0]= t1t2 >> 1;
+    src[0*FDEC_STRIDE+2]=
+    src[2*FDEC_STRIDE+1]= t2t3 >> 1;
+    src[0*FDEC_STRIDE+3]=
+    src[2*FDEC_STRIDE+2]= t3t4 >> 1;
+    src[2*FDEC_STRIDE+3]= t4t5 >> 1;
+    src[1*FDEC_STRIDE+0]= (t0t1 + t1t2) >> 2;
+    src[1*FDEC_STRIDE+1]=
+    src[3*FDEC_STRIDE+0]= (t1t2 + t2t3) >> 2;
+    src[1*FDEC_STRIDE+2]=
+    src[3*FDEC_STRIDE+1]= (t2t3 + t3t4) >> 2;
+    src[1*FDEC_STRIDE+3]=
+    src[3*FDEC_STRIDE+2]= (t3t4 + t4t5) >> 2;
+    src[3*FDEC_STRIDE+3]= (t4t5 + t5t6) >> 2;
+}
+#endif
+
+static void predict_4x4_hu( uint8_t *src )
+{
+    PREDICT_4x4_LOAD_LEFT
+    const int l1l0 = l1 + l0 + 1;
+    const int l2l1 = l2 + l1 + 1;
+    const int l3l2 = l3 + l2 + 1;
+
+    src[0*FDEC_STRIDE+0]= l1l0 >> 1;
+    src[0*FDEC_STRIDE+1]= (l1l0 + l2l1) >> 2;
+
+    src[0*FDEC_STRIDE+2]=
+    src[1*FDEC_STRIDE+0]= l2l1 >> 1;
+
+    src[0*FDEC_STRIDE+3]=
+    src[1*FDEC_STRIDE+1]= (l2l1 + l3l2) >> 2;
+
+    src[1*FDEC_STRIDE+2]=
+    src[2*FDEC_STRIDE+0]= l3l2 >> 1;
+
+    src[1*FDEC_STRIDE+3]=
+    src[2*FDEC_STRIDE+1]= (l2 + 3*l3 + 2) >> 2;
+
+    src[2*FDEC_STRIDE+3]=
+    src[3*FDEC_STRIDE+1]=
+    src[3*FDEC_STRIDE+0]=
+    src[2*FDEC_STRIDE+2]=
+    src[3*FDEC_STRIDE+2]=
+    src[3*FDEC_STRIDE+3]= l3;
+}
+#endif
+
+/****************************************************************************
+ * 8x8 prediction for intra luma block
+ ****************************************************************************/
+
+#define PL(y) \
+    const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
+#define PREDICT_8x8_LOAD_LEFT(have_tl) \
+    const int l0 = ((have_tl || (i_neighbor&MB_TOPLEFT) ? SRC(-1,-1) : SRC(-1,0)) \
+                     + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \
+    PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \
+    UNUSED const int l7 = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2;
+
+#define PT(x) \
+    const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
+#define PREDICT_8x8_LOAD_TOP(have_tl) \
+    const int t0 = ((have_tl || (i_neighbor&MB_TOPLEFT) ? SRC(-1,-1) : SRC(0,-1)) \
+                     + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \
+    PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \
+    UNUSED const int t7 = ((i_neighbor&MB_TOPRIGHT ? SRC(8,-1) : SRC(7,-1)) \
+                     + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2; \
+
+#define PTR(x) \
+    t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
+#define PREDICT_8x8_LOAD_TOPRIGHT \
+    int t8, t9, t10, t11, t12, t13, t14, t15; \
+    if(i_neighbor&MB_TOPRIGHT) { \
+        PTR(8) PTR(9) PTR(10) PTR(11) PTR(12) PTR(13) PTR(14) \
+        t15 = (SRC(14,-1) + 3*SRC(15,-1) + 2) >> 2; \
+    } else t8=t9=t10=t11=t12=t13=t14=t15= SRC(7,-1);
+
+#define PREDICT_8x8_LOAD_TOPLEFT \
+    const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2;
+
+#define PREDICT_8x8_DC(v) \
+    int y; \
+    for( y = 0; y < 8; y++ ) { \
+        ((uint32_t*)src)[0] = \
+        ((uint32_t*)src)[1] = v; \
+        src += FDEC_STRIDE; \
+    }
+
+#define SRC4(x,y) *(uint32_t*)&SRC(x,y)
+
+#if 0
+static void predict_8x8_ddl( uint8_t *src, int i_neighbor )
+{
+    PREDICT_8x8_LOAD_TOP(0)
+    uint32_t vec0, vec1;
+    int t8b;
+    if(i_neighbor&MB_TOPRIGHT)
+    {
+        PREDICT_8x8_LOAD_TOPRIGHT
+        vec1 = (F2(t14,t15,t15)<<24)
+             + (F2(t13,t14,t15)<<16)
+             + (F2(t12,t13,t14)<< 8)
+             + (F2(t11,t12,t13)<< 0);
+        vec0 = (F2(t10,t11,t12)<<24)
+             + (F2( t9,t10,t11)<<16)
+             + (F2( t8, t9,t10)<< 8)
+             + (F2( t7, t8, t9)<< 0);
+        t8b = t8;
+    }
+    else
+    {
+        t8b = SRC(7,-1);
+        vec1 = t8b * 0x01010101;
+        vec0 = (vec1&0xffffff00) + F2(t7,t8b,t8b);
+    }
+    SRC4(4,7) = vec1;
+    SRC4(4,3) =
+    SRC4(0,7) = vec0;
+    SRC4(4,6) = vec1 = (vec1<<8) + (vec0>>24);
+    SRC4(4,2) =
+    SRC4(0,6) = vec0 = (vec0<<8) + F2(t6,t7,t8b);
+    SRC4(4,5) = vec1 = (vec1<<8) + (vec0>>24);
+    SRC4(4,1) =
+    SRC4(0,5) = vec0 = (vec0<<8) + F2(t5,t6,t7);
+    SRC4(4,4) = vec1 = (vec1<<8) + (vec0>>24);
+    SRC4(4,0) =
+    SRC4(0,4) = vec0 = (vec0<<8) + F2(t4,t5,t6);
+    SRC4(0,3) = vec0 = (vec0<<8) + F2(t3,t4,t5);
+    SRC4(0,2) = vec0 = (vec0<<8) + F2(t2,t3,t4);
+    SRC4(0,1) = vec0 = (vec0<<8) + F2(t1,t2,t3);
+    SRC4(0,0) = vec0 = (vec0<<8) + F2(t0,t1,t2);
+}
+#endif
+
+static void predict_8x8_ddr( uint8_t *src, int i_neighbor )
+{
+    PREDICT_8x8_LOAD_TOP(1)
+    PREDICT_8x8_LOAD_LEFT(1)
+    PREDICT_8x8_LOAD_TOPLEFT
+    uint32_t vec0, vec1;
+    vec1 = (F2(t7,t6,t5)<<24)
+         + (F2(t6,t5,t4)<<16)
+         + (F2(t5,t4,t3)<< 8)
+         + (F2(t4,t3,t2)<< 0);
+    vec0 = (F2(t3,t2,t1)<<24)
+         + (F2(t2,t1,t0)<<16)
+         + (F2(t1,t0,lt)<< 8)
+         + (F2(t0,lt,l0)<< 0);
+    SRC4(4,0) = vec1;
+    SRC4(0,0) =
+    SRC4(4,4) = vec0;
+    SRC4(4,1) = vec1 = (vec1<<8) + (vec0>>24);
+    SRC4(0,1) =
+    SRC4(4,5) = vec0 = (vec0<<8) + F2(lt,l0,l1);
+    SRC4(4,2) = vec1 = (vec1<<8) + (vec0>>24);
+    SRC4(0,2) =
+    SRC4(4,6) = vec0 = (vec0<<8) + F2(l0,l1,l2);
+    SRC4(4,3) = vec1 = (vec1<<8) + (vec0>>24);
+    SRC4(0,3) =
+    SRC4(4,7) = vec0 = (vec0<<8) + F2(l1,l2,l3);
+    SRC4(0,4) = vec0 = (vec0<<8) + F2(l2,l3,l4);
+    SRC4(0,5) = vec0 = (vec0<<8) + F2(l3,l4,l5);
+    SRC4(0,6) = vec0 = (vec0<<8) + F2(l4,l5,l6);
+    SRC4(0,7) = vec0 = (vec0<<8) + F2(l5,l6,l7);
+}
+
+#ifdef ARCH_X86_64
+static void predict_8x8_vr_mmxext( uint8_t *src, int i_neighbor )
+{
+    PREDICT_8x8_LOAD_TOPLEFT
+    const int t0 = F2(SRC(-1,-1), SRC(0,-1), SRC(1,-1));
+    predict_8x8_vr_core_mmxext( src, i_neighbor, lt+(t0<<8) );
+    {
+        PREDICT_8x8_LOAD_LEFT(1)
+        SRC(0,1)=SRC(1,3)=SRC(2,5)=SRC(3,7)= (l0 + 2*lt + t0 + 2) >> 2;
+        SRC(0,2)=SRC(1,4)=SRC(2,6)= (l1 + 2*l0 + lt + 2) >> 2;
+        SRC(0,3)=SRC(1,5)=SRC(2,7)= (l2 + 2*l1 + l0 + 2) >> 2;
+        SRC(0,4)=SRC(1,6)= (l3 + 2*l2 + l1 + 2) >> 2;
+        SRC(0,5)=SRC(1,7)= (l4 + 2*l3 + l2 + 2) >> 2;
+        SRC(0,6)= (l5 + 2*l4 + l3 + 2) >> 2;
+        SRC(0,7)= (l6 + 2*l5 + l4 + 2) >> 2;
+    }
+}
+#endif
+
+/****************************************************************************
+ * Exported functions:
+ ****************************************************************************/
+void x264_predict_16x16_init_mmxext( x264_predict_t pf[7] )
+{
+    pf[I_PRED_16x16_V]       = predict_16x16_v_mmx;
+    pf[I_PRED_16x16_DC]      = predict_16x16_dc;
+    pf[I_PRED_16x16_DC_TOP]  = predict_16x16_dc_top_mmxext;
+    pf[I_PRED_16x16_P]       = predict_16x16_p;
+
+#ifdef ARCH_X86_64
+    pf[I_PRED_16x16_H]       = predict_16x16_h;
+    pf[I_PRED_16x16_DC_LEFT] = predict_16x16_dc_left;
+#endif
+}
+
+void x264_predict_8x8c_init_mmxext( x264_predict_t pf[7] )
+{
+    pf[I_PRED_CHROMA_V]       = predict_8x8c_v_mmx;
+    pf[I_PRED_CHROMA_P]       = predict_8x8c_p;
+    pf[I_PRED_CHROMA_DC]      = predict_8x8c_dc;
+
+#ifdef ARCH_X86_64
+    pf[I_PRED_CHROMA_H]       = predict_8x8c_h;
+    pf[I_PRED_CHROMA_DC_LEFT] = predict_8x8c_dc_left;
+    pf[I_PRED_CHROMA_DC_TOP]  = predict_8x8c_dc_top;
+#endif
+}
+
+void x264_predict_8x8_init_mmxext( x264_predict8x8_t pf[12] )
+{
+    pf[I_PRED_8x8_V]   = predict_8x8_v_mmxext;
+    pf[I_PRED_8x8_DC]  = predict_8x8_dc;
+    pf[I_PRED_8x8_DDR] = predict_8x8_ddr;
+#ifdef ARCH_X86_64 // x86 not written yet
+    pf[I_PRED_8x8_DDL] = predict_8x8_ddl_mmxext;
+    pf[I_PRED_8x8_VR]  = predict_8x8_vr_mmxext;
+#endif
+}
+
+void x264_predict_8x8_init_sse2( x264_predict8x8_t pf[12] )
+{
+#ifdef ARCH_X86_64 // x86 not written yet
+    pf[I_PRED_8x8_DDL] = predict_8x8_ddl_sse2;
+    pf[I_PRED_8x8_DDR] = predict_8x8_ddr_sse2;
+    pf[I_PRED_8x8_VL]  = predict_8x8_vl_sse2;
+#endif
+}
+
+void x264_predict_4x4_init_mmxext( x264_predict_t pf[12] )
+{
+#ifdef ARCH_X86_64 // x86 not written yet
+    pf[I_PRED_4x4_DDL] = predict_4x4_ddl_mmxext;
+    pf[I_PRED_4x4_VL]  = predict_4x4_vl_mmxext;
+#endif
+#ifdef ARCH_X86_64 // slower on x86
+    pf[I_PRED_4x4_DDR] = predict_4x4_ddr;
+    pf[I_PRED_4x4_VR]  = predict_4x4_vr;
+    pf[I_PRED_4x4_HD]  = predict_4x4_hd;
+    pf[I_PRED_4x4_HU]  = predict_4x4_hu;
+#endif
+}
+
diff --git a/common/i386/predict.c b/common/i386/predict.c
deleted file mode 100644 (file)
index e46f32d..0000000
+++ /dev/null
@@ -1,614 +0,0 @@
-/*****************************************************************************
- * predict.c: h264 encoder
- *****************************************************************************
- * Copyright (C) 2003 Laurent Aimar
- * $Id: predict.c,v 1.1 2004/06/03 19:27:07 fenrir Exp $
- *
- * Authors: Laurent Aimar <fenrir@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-#include "common/common.h"
-#include "common/clip1.h"
-#include "predict.h"
-
-extern void predict_16x16_v_mmx( uint8_t *src );
-extern void predict_16x16_dc_core_mmxext( uint8_t *src, int i_dc_left );
-extern void predict_16x16_dc_top_mmxext( uint8_t *src );
-extern void predict_16x16_p_core_mmxext( uint8_t *src, int i00, int b, int c );
-extern void predict_8x8c_p_core_mmxext( uint8_t *src, int i00, int b, int c );
-extern void predict_8x8c_dc_core_mmxext( uint8_t *src, int s2, int s3 );
-extern void predict_8x8c_v_mmx( uint8_t *src );
-extern void predict_8x8_v_mmxext( uint8_t *src, int i_neighbors );
-extern void predict_8x8_ddl_mmxext( uint8_t *src, int i_neighbors );
-extern void predict_8x8_ddl_sse2( uint8_t *src, int i_neighbors );
-extern void predict_8x8_ddr_sse2( uint8_t *src, int i_neighbors );
-extern void predict_8x8_vl_sse2( uint8_t *src, int i_neighbors );
-extern void predict_8x8_vr_core_mmxext( uint8_t *src, int i_neighbors, uint16_t ltt0 );
-extern void predict_8x8_dc_core_mmxext( uint8_t *src, int i_neighbors, uint8_t *pix_left );
-extern void predict_4x4_ddl_mmxext( uint8_t *src );
-extern void predict_4x4_vl_mmxext( uint8_t *src );
-
-static void predict_16x16_p( uint8_t *src )
-{
-    int a, b, c, i;
-    int H = 0;
-    int V = 0;
-    int i00;
-
-    for( i = 1; i <= 8; i++ )
-    {
-        H += i * ( src[7+i - FDEC_STRIDE ]  - src[7-i - FDEC_STRIDE ] );
-        V += i * ( src[(7+i)*FDEC_STRIDE -1] - src[(7-i)*FDEC_STRIDE -1] );
-    }
-
-    a = 16 * ( src[15*FDEC_STRIDE -1] + src[15 - FDEC_STRIDE] );
-    b = ( 5 * H + 32 ) >> 6;
-    c = ( 5 * V + 32 ) >> 6;
-    i00 = a - b * 7 - c * 7 + 16;
-
-    predict_16x16_p_core_mmxext( src, i00, b, c );
-}
-
-static void predict_8x8c_p( uint8_t *src )
-{
-    int a, b, c, i;
-    int H = 0;
-    int V = 0;
-    int i00;
-
-    for( i = 1; i <= 4; i++ )
-    {
-        H += i * ( src[3+i - FDEC_STRIDE] - src[3-i - FDEC_STRIDE] );
-        V += i * ( src[(3+i)*FDEC_STRIDE -1] - src[(3-i)*FDEC_STRIDE -1] );
-    }
-
-    a = 16 * ( src[7*FDEC_STRIDE -1] + src[7 - FDEC_STRIDE] );
-    b = ( 17 * H + 16 ) >> 5;
-    c = ( 17 * V + 16 ) >> 5;
-    i00 = a -3*b -3*c + 16;
-
-    predict_8x8c_p_core_mmxext( src, i00, b, c );
-}
-
-static void predict_16x16_dc( uint8_t *src )
-{
-    uint32_t dc=16;
-    int i;
-
-    for( i = 0; i < 16; i+=2 )
-    {
-        dc += src[-1 + i * FDEC_STRIDE];
-        dc += src[-1 + (i+1) * FDEC_STRIDE];
-    }
-
-    predict_16x16_dc_core_mmxext( src, dc );
-}
-
-static void predict_8x8c_dc( uint8_t *src )
-{
-    int s2 = 4
-       + src[-1 + 0*FDEC_STRIDE]
-       + src[-1 + 1*FDEC_STRIDE]
-       + src[-1 + 2*FDEC_STRIDE]
-       + src[-1 + 3*FDEC_STRIDE];
-
-    int s3 = 2
-       + src[-1 + 4*FDEC_STRIDE]
-       + src[-1 + 5*FDEC_STRIDE]
-       + src[-1 + 6*FDEC_STRIDE]
-       + src[-1 + 7*FDEC_STRIDE];
-
-    predict_8x8c_dc_core_mmxext( src, s2, s3 );
-}
-
-#define SRC(x,y) src[(x)+(y)*FDEC_STRIDE]
-static void predict_8x8_dc( uint8_t *src, int i_neighbor )
-{
-    uint8_t l[10];
-    l[0] = i_neighbor&MB_TOPLEFT ? SRC(-1,-1) : SRC(-1,0);
-    l[1] = SRC(-1,0);
-    l[2] = SRC(-1,1);
-    l[3] = SRC(-1,2);
-    l[4] = SRC(-1,3);
-    l[5] = SRC(-1,4);
-    l[6] = SRC(-1,5);
-    l[7] = SRC(-1,6);
-    l[8] =
-    l[9] = SRC(-1,7);
-
-    predict_8x8_dc_core_mmxext( src, i_neighbor, l+1 );
-}
-
-#ifdef ARCH_X86_64
-static void predict_16x16_h( uint8_t *src )
-{
-    int y;
-    for( y = 0; y < 16; y++ )
-    {
-        const uint64_t v = 0x0101010101010101ULL * src[-1];
-        uint64_t *p = (uint64_t*)src;
-        p[0] = p[1] = v;
-        src += FDEC_STRIDE;
-    }
-}
-
-static void predict_8x8c_h( uint8_t *src )
-{
-    int y;
-    for( y = 0; y < 8; y++ )
-    {
-        *(uint64_t*)src = 0x0101010101010101ULL * src[-1];
-        src += FDEC_STRIDE;
-    }
-}
-
-static void predict_16x16_dc_left( uint8_t *src )
-{
-    uint32_t s = 0;
-    uint64_t dc; 
-    int y;
-    
-    for( y = 0; y < 16; y++ )
-    {
-        s += src[-1 + y * FDEC_STRIDE];
-    }   
-    dc = (( s + 8 ) >> 4) * 0x0101010101010101ULL;
-    
-    for( y = 0; y < 16; y++ )
-    {
-        uint64_t *p = (uint64_t*)src;
-        p[0] = p[1] = dc;
-        src += FDEC_STRIDE;
-    }
-}
-
-static void predict_8x8c_dc_left( uint8_t *src )
-{
-    int y;
-    uint32_t s0 = 0, s1 = 0;
-    uint64_t dc0, dc1;
-
-    for( y = 0; y < 4; y++ )
-    {
-        s0 += src[y * FDEC_STRIDE     - 1];
-        s1 += src[(y+4) * FDEC_STRIDE - 1];
-    }
-    dc0 = (( s0 + 2 ) >> 2) * 0x0101010101010101ULL;
-    dc1 = (( s1 + 2 ) >> 2) * 0x0101010101010101ULL;
-
-    for( y = 0; y < 4; y++ )
-    {
-        *(uint64_t*)src = dc0;
-        src += FDEC_STRIDE;
-    }
-    for( y = 0; y < 4; y++ )
-    {
-        *(uint64_t*)src = dc1;
-        src += FDEC_STRIDE;
-    }
-
-}
-
-static void predict_8x8c_dc_top( uint8_t *src )
-{
-    int y, x;
-    uint32_t s0 = 0, s1 = 0;
-    uint64_t dc;
-
-    for( x = 0; x < 4; x++ )
-    {
-        s0 += src[x     - FDEC_STRIDE];
-        s1 += src[x + 4 - FDEC_STRIDE];
-    }
-    dc = (( s0 + 2 ) >> 2) * 0x01010101
-       + (( s1 + 2 ) >> 2) * 0x0101010100000000ULL;
-
-    for( y = 0; y < 8; y++ )
-    {
-        *(uint64_t*)src = dc;
-        src += FDEC_STRIDE;
-    }
-}
-#endif
-
-/* Diagonals */
-
-#define PREDICT_4x4_LOAD_LEFT \
-    const int l0 = src[-1+0*FDEC_STRIDE];   \
-    const int l1 = src[-1+1*FDEC_STRIDE];   \
-    const int l2 = src[-1+2*FDEC_STRIDE];   \
-    UNUSED const int l3 = src[-1+3*FDEC_STRIDE];
-
-#define PREDICT_4x4_LOAD_TOP \
-    const int t0 = src[0-1*FDEC_STRIDE];   \
-    const int t1 = src[1-1*FDEC_STRIDE];   \
-    const int t2 = src[2-1*FDEC_STRIDE];   \
-    UNUSED const int t3 = src[3-1*FDEC_STRIDE];
-
-#define PREDICT_4x4_LOAD_TOP_RIGHT \
-    const int t4 = src[4-1*FDEC_STRIDE];   \
-    const int t5 = src[5-1*FDEC_STRIDE];   \
-    const int t6 = src[6-1*FDEC_STRIDE];   \
-    UNUSED const int t7 = src[7-1*FDEC_STRIDE];
-
-#define F1(a,b)   (((a)+(b)+1)>>1)
-#define F2(a,b,c) (((a)+2*(b)+(c)+2)>>2)
-
-#ifdef ARCH_X86_64 // slower on x86
-#if 0
-static void predict_4x4_ddl( uint8_t *src )
-{
-    PREDICT_4x4_LOAD_TOP
-    PREDICT_4x4_LOAD_TOP_RIGHT
-    uint32_t vec = (F2(t3,t4,t5)<< 0)
-                 + (F2(t4,t5,t6)<< 8)
-                 + (F2(t5,t6,t7)<<16)
-                 + (F2(t6,t7,t7)<<24);
-    *(uint32_t*)&src[3*FDEC_STRIDE] = vec;
-    *(uint32_t*)&src[2*FDEC_STRIDE] = vec = (vec<<8) + F2(t2,t3,t4);
-    *(uint32_t*)&src[1*FDEC_STRIDE] = vec = (vec<<8) + F2(t1,t2,t3);
-    *(uint32_t*)&src[0*FDEC_STRIDE] = vec = (vec<<8) + F2(t0,t1,t2);
-}
-#endif
-
-static void predict_4x4_ddr( uint8_t *src )
-{
-    const int lt = src[-1-FDEC_STRIDE];
-    PREDICT_4x4_LOAD_LEFT
-    PREDICT_4x4_LOAD_TOP
-    uint32_t vec = (F2(l0,lt,t0)<< 0)
-                 + (F2(lt,t0,t1)<< 8)
-                 + (F2(t0,t1,t2)<<16)
-                 + (F2(t1,t2,t3)<<24);
-    *(uint32_t*)&src[0*FDEC_STRIDE] = vec;
-    *(uint32_t*)&src[1*FDEC_STRIDE] = vec = (vec<<8) + F2(l1,l0,lt);
-    *(uint32_t*)&src[2*FDEC_STRIDE] = vec = (vec<<8) + F2(l2,l1,l0);
-    *(uint32_t*)&src[3*FDEC_STRIDE] = vec = (vec<<8) + F2(l3,l2,l1);
-}
-
-static void predict_4x4_vr( uint8_t *src )
-{
-    const int lt = src[-1-FDEC_STRIDE];
-    PREDICT_4x4_LOAD_LEFT
-    PREDICT_4x4_LOAD_TOP
-    const int ltt0 = lt + t0 + 1;
-    const int t0t1 = t0 + t1 + 1;
-    const int t1t2 = t1 + t2 + 1;
-    const int t2t3 = t2 + t3 + 1;
-    const int l0lt = l0 + lt + 1;
-    const int l1l0 = l1 + l0 + 1;
-    const int l2l1 = l2 + l1 + 1;
-
-    src[0*FDEC_STRIDE+0]=
-    src[2*FDEC_STRIDE+1]= ltt0 >> 1;
-
-    src[0*FDEC_STRIDE+1]=
-    src[2*FDEC_STRIDE+2]= t0t1 >> 1;
-
-    src[0*FDEC_STRIDE+2]=
-    src[2*FDEC_STRIDE+3]= t1t2 >> 1;
-
-    src[0*FDEC_STRIDE+3]= t2t3 >> 1;
-
-    src[1*FDEC_STRIDE+0]=
-    src[3*FDEC_STRIDE+1]= (l0lt + ltt0) >> 2;
-
-    src[1*FDEC_STRIDE+1]=
-    src[3*FDEC_STRIDE+2]= (ltt0 + t0t1) >> 2;
-
-    src[1*FDEC_STRIDE+2]=
-    src[3*FDEC_STRIDE+3]= (t0t1 + t1t2) >> 2;
-
-    src[1*FDEC_STRIDE+3]= (t1t2 + t2t3) >> 2;
-    src[2*FDEC_STRIDE+0]= (l1l0 + l0lt) >> 2;
-    src[3*FDEC_STRIDE+0]= (l2l1 + l1l0) >> 2;
-}
-
-static void predict_4x4_hd( uint8_t *src )
-{
-    const int lt= src[-1-1*FDEC_STRIDE];
-    PREDICT_4x4_LOAD_LEFT
-    PREDICT_4x4_LOAD_TOP
-    const int ltt0 = lt + t0 + 1;
-    const int t0t1 = t0 + t1 + 1;
-    const int t1t2 = t1 + t2 + 1;
-    const int l0lt = l0 + lt + 1;
-    const int l1l0 = l1 + l0 + 1;
-    const int l2l1 = l2 + l1 + 1;
-    const int l3l2 = l3 + l2 + 1;
-
-    src[0*FDEC_STRIDE+0]=
-    src[1*FDEC_STRIDE+2]= l0lt >> 1;
-    src[0*FDEC_STRIDE+1]=
-    src[1*FDEC_STRIDE+3]= (l0lt + ltt0) >> 2;
-    src[0*FDEC_STRIDE+2]= (ltt0 + t0t1) >> 2;
-    src[0*FDEC_STRIDE+3]= (t0t1 + t1t2) >> 2;
-    src[1*FDEC_STRIDE+0]=
-    src[2*FDEC_STRIDE+2]= l1l0 >> 1;
-    src[1*FDEC_STRIDE+1]=
-    src[2*FDEC_STRIDE+3]= (l0lt + l1l0) >> 2;
-    src[2*FDEC_STRIDE+0]=
-    src[3*FDEC_STRIDE+2]= l2l1 >> 1;
-    src[2*FDEC_STRIDE+1]=
-    src[3*FDEC_STRIDE+3]= (l1l0 + l2l1) >> 2;
-    src[3*FDEC_STRIDE+0]= l3l2 >> 1;
-    src[3*FDEC_STRIDE+1]= (l2l1 + l3l2) >> 2;
-}
-
-#if 0
-static void predict_4x4_vl( uint8_t *src )
-{
-    PREDICT_4x4_LOAD_TOP
-    PREDICT_4x4_LOAD_TOP_RIGHT
-    const int t0t1 = t0 + t1 + 1;
-    const int t1t2 = t1 + t2 + 1;
-    const int t2t3 = t2 + t3 + 1;
-    const int t3t4 = t3 + t4 + 1;
-    const int t4t5 = t4 + t5 + 1;
-    const int t5t6 = t5 + t6 + 1;
-
-    src[0*FDEC_STRIDE+0]= t0t1 >> 1;
-    src[0*FDEC_STRIDE+1]=
-    src[2*FDEC_STRIDE+0]= t1t2 >> 1;
-    src[0*FDEC_STRIDE+2]=
-    src[2*FDEC_STRIDE+1]= t2t3 >> 1;
-    src[0*FDEC_STRIDE+3]=
-    src[2*FDEC_STRIDE+2]= t3t4 >> 1;
-    src[2*FDEC_STRIDE+3]= t4t5 >> 1;
-    src[1*FDEC_STRIDE+0]= (t0t1 + t1t2) >> 2;
-    src[1*FDEC_STRIDE+1]=
-    src[3*FDEC_STRIDE+0]= (t1t2 + t2t3) >> 2;
-    src[1*FDEC_STRIDE+2]=
-    src[3*FDEC_STRIDE+1]= (t2t3 + t3t4) >> 2;
-    src[1*FDEC_STRIDE+3]=
-    src[3*FDEC_STRIDE+2]= (t3t4 + t4t5) >> 2;
-    src[3*FDEC_STRIDE+3]= (t4t5 + t5t6) >> 2;
-}
-#endif
-
-static void predict_4x4_hu( uint8_t *src )
-{
-    PREDICT_4x4_LOAD_LEFT
-    const int l1l0 = l1 + l0 + 1;
-    const int l2l1 = l2 + l1 + 1;
-    const int l3l2 = l3 + l2 + 1;
-
-    src[0*FDEC_STRIDE+0]= l1l0 >> 1;
-    src[0*FDEC_STRIDE+1]= (l1l0 + l2l1) >> 2;
-
-    src[0*FDEC_STRIDE+2]=
-    src[1*FDEC_STRIDE+0]= l2l1 >> 1;
-
-    src[0*FDEC_STRIDE+3]=
-    src[1*FDEC_STRIDE+1]= (l2l1 + l3l2) >> 2;
-
-    src[1*FDEC_STRIDE+2]=
-    src[2*FDEC_STRIDE+0]= l3l2 >> 1;
-
-    src[1*FDEC_STRIDE+3]=
-    src[2*FDEC_STRIDE+1]= (l2 + 3*l3 + 2) >> 2;
-
-    src[2*FDEC_STRIDE+3]=
-    src[3*FDEC_STRIDE+1]=
-    src[3*FDEC_STRIDE+0]=
-    src[2*FDEC_STRIDE+2]=
-    src[3*FDEC_STRIDE+2]=
-    src[3*FDEC_STRIDE+3]= l3;
-}
-#endif
-
-/****************************************************************************
- * 8x8 prediction for intra luma block
- ****************************************************************************/
-
-#define PL(y) \
-    const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
-#define PREDICT_8x8_LOAD_LEFT(have_tl) \
-    const int l0 = ((have_tl || (i_neighbor&MB_TOPLEFT) ? SRC(-1,-1) : SRC(-1,0)) \
-                     + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \
-    PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \
-    UNUSED const int l7 = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2;
-
-#define PT(x) \
-    const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
-#define PREDICT_8x8_LOAD_TOP(have_tl) \
-    const int t0 = ((have_tl || (i_neighbor&MB_TOPLEFT) ? SRC(-1,-1) : SRC(0,-1)) \
-                     + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \
-    PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \
-    UNUSED const int t7 = ((i_neighbor&MB_TOPRIGHT ? SRC(8,-1) : SRC(7,-1)) \
-                     + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2; \
-
-#define PTR(x) \
-    t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
-#define PREDICT_8x8_LOAD_TOPRIGHT \
-    int t8, t9, t10, t11, t12, t13, t14, t15; \
-    if(i_neighbor&MB_TOPRIGHT) { \
-        PTR(8) PTR(9) PTR(10) PTR(11) PTR(12) PTR(13) PTR(14) \
-        t15 = (SRC(14,-1) + 3*SRC(15,-1) + 2) >> 2; \
-    } else t8=t9=t10=t11=t12=t13=t14=t15= SRC(7,-1);
-
-#define PREDICT_8x8_LOAD_TOPLEFT \
-    const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2;
-
-#define PREDICT_8x8_DC(v) \
-    int y; \
-    for( y = 0; y < 8; y++ ) { \
-        ((uint32_t*)src)[0] = \
-        ((uint32_t*)src)[1] = v; \
-        src += FDEC_STRIDE; \
-    }
-
-#define SRC4(x,y) *(uint32_t*)&SRC(x,y)
-
-#if 0
-static void predict_8x8_ddl( uint8_t *src, int i_neighbor )
-{
-    PREDICT_8x8_LOAD_TOP(0)
-    uint32_t vec0, vec1;
-    int t8b;
-    if(i_neighbor&MB_TOPRIGHT)
-    {
-        PREDICT_8x8_LOAD_TOPRIGHT
-        vec1 = (F2(t14,t15,t15)<<24)
-             + (F2(t13,t14,t15)<<16)
-             + (F2(t12,t13,t14)<< 8)
-             + (F2(t11,t12,t13)<< 0);
-        vec0 = (F2(t10,t11,t12)<<24)
-             + (F2( t9,t10,t11)<<16)
-             + (F2( t8, t9,t10)<< 8)
-             + (F2( t7, t8, t9)<< 0);
-        t8b = t8;
-    }
-    else
-    {
-        t8b = SRC(7,-1);
-        vec1 = t8b * 0x01010101;
-        vec0 = (vec1&0xffffff00) + F2(t7,t8b,t8b);
-    }
-    SRC4(4,7) = vec1;
-    SRC4(4,3) =
-    SRC4(0,7) = vec0;
-    SRC4(4,6) = vec1 = (vec1<<8) + (vec0>>24);
-    SRC4(4,2) =
-    SRC4(0,6) = vec0 = (vec0<<8) + F2(t6,t7,t8b);
-    SRC4(4,5) = vec1 = (vec1<<8) + (vec0>>24);
-    SRC4(4,1) =
-    SRC4(0,5) = vec0 = (vec0<<8) + F2(t5,t6,t7);
-    SRC4(4,4) = vec1 = (vec1<<8) + (vec0>>24);
-    SRC4(4,0) =
-    SRC4(0,4) = vec0 = (vec0<<8) + F2(t4,t5,t6);
-    SRC4(0,3) = vec0 = (vec0<<8) + F2(t3,t4,t5);
-    SRC4(0,2) = vec0 = (vec0<<8) + F2(t2,t3,t4);
-    SRC4(0,1) = vec0 = (vec0<<8) + F2(t1,t2,t3);
-    SRC4(0,0) = vec0 = (vec0<<8) + F2(t0,t1,t2);
-}
-#endif
-
-static void predict_8x8_ddr( uint8_t *src, int i_neighbor )
-{
-    PREDICT_8x8_LOAD_TOP(1)
-    PREDICT_8x8_LOAD_LEFT(1)
-    PREDICT_8x8_LOAD_TOPLEFT
-    uint32_t vec0, vec1;
-    vec1 = (F2(t7,t6,t5)<<24)
-         + (F2(t6,t5,t4)<<16)
-         + (F2(t5,t4,t3)<< 8)
-         + (F2(t4,t3,t2)<< 0);
-    vec0 = (F2(t3,t2,t1)<<24)
-         + (F2(t2,t1,t0)<<16)
-         + (F2(t1,t0,lt)<< 8)
-         + (F2(t0,lt,l0)<< 0);
-    SRC4(4,0) = vec1;
-    SRC4(0,0) =
-    SRC4(4,4) = vec0;
-    SRC4(4,1) = vec1 = (vec1<<8) + (vec0>>24);
-    SRC4(0,1) =
-    SRC4(4,5) = vec0 = (vec0<<8) + F2(lt,l0,l1);
-    SRC4(4,2) = vec1 = (vec1<<8) + (vec0>>24);
-    SRC4(0,2) =
-    SRC4(4,6) = vec0 = (vec0<<8) + F2(l0,l1,l2);
-    SRC4(4,3) = vec1 = (vec1<<8) + (vec0>>24);
-    SRC4(0,3) =
-    SRC4(4,7) = vec0 = (vec0<<8) + F2(l1,l2,l3);
-    SRC4(0,4) = vec0 = (vec0<<8) + F2(l2,l3,l4);
-    SRC4(0,5) = vec0 = (vec0<<8) + F2(l3,l4,l5);
-    SRC4(0,6) = vec0 = (vec0<<8) + F2(l4,l5,l6);
-    SRC4(0,7) = vec0 = (vec0<<8) + F2(l5,l6,l7);
-}
-
-#ifdef ARCH_X86_64
-static void predict_8x8_vr_mmxext( uint8_t *src, int i_neighbor )
-{
-    PREDICT_8x8_LOAD_TOPLEFT
-    const int t0 = F2(SRC(-1,-1), SRC(0,-1), SRC(1,-1));
-    predict_8x8_vr_core_mmxext( src, i_neighbor, lt+(t0<<8) );
-    {
-        PREDICT_8x8_LOAD_LEFT(1)
-        SRC(0,1)=SRC(1,3)=SRC(2,5)=SRC(3,7)= (l0 + 2*lt + t0 + 2) >> 2;
-        SRC(0,2)=SRC(1,4)=SRC(2,6)= (l1 + 2*l0 + lt + 2) >> 2;
-        SRC(0,3)=SRC(1,5)=SRC(2,7)= (l2 + 2*l1 + l0 + 2) >> 2;
-        SRC(0,4)=SRC(1,6)= (l3 + 2*l2 + l1 + 2) >> 2;
-        SRC(0,5)=SRC(1,7)= (l4 + 2*l3 + l2 + 2) >> 2;
-        SRC(0,6)= (l5 + 2*l4 + l3 + 2) >> 2;
-        SRC(0,7)= (l6 + 2*l5 + l4 + 2) >> 2;
-    }
-}
-#endif
-
-/****************************************************************************
- * Exported functions:
- ****************************************************************************/
-void x264_predict_16x16_init_mmxext( x264_predict_t pf[7] )
-{
-    pf[I_PRED_16x16_V]       = predict_16x16_v_mmx;
-    pf[I_PRED_16x16_DC]      = predict_16x16_dc;
-    pf[I_PRED_16x16_DC_TOP]  = predict_16x16_dc_top_mmxext;
-    pf[I_PRED_16x16_P]       = predict_16x16_p;
-
-#ifdef ARCH_X86_64
-    pf[I_PRED_16x16_H]       = predict_16x16_h;
-    pf[I_PRED_16x16_DC_LEFT] = predict_16x16_dc_left;
-#endif
-}
-
-void x264_predict_8x8c_init_mmxext( x264_predict_t pf[7] )
-{
-    pf[I_PRED_CHROMA_V]       = predict_8x8c_v_mmx;
-    pf[I_PRED_CHROMA_P]       = predict_8x8c_p;
-    pf[I_PRED_CHROMA_DC]      = predict_8x8c_dc;
-
-#ifdef ARCH_X86_64
-    pf[I_PRED_CHROMA_H]       = predict_8x8c_h;
-    pf[I_PRED_CHROMA_DC_LEFT] = predict_8x8c_dc_left;
-    pf[I_PRED_CHROMA_DC_TOP]  = predict_8x8c_dc_top;
-#endif
-}
-
-void x264_predict_8x8_init_mmxext( x264_predict8x8_t pf[12] )
-{
-    pf[I_PRED_8x8_V]   = predict_8x8_v_mmxext;
-    pf[I_PRED_8x8_DC]  = predict_8x8_dc;
-    pf[I_PRED_8x8_DDR] = predict_8x8_ddr;
-#ifdef ARCH_X86_64 // x86 not written yet
-    pf[I_PRED_8x8_DDL] = predict_8x8_ddl_mmxext;
-    pf[I_PRED_8x8_VR]  = predict_8x8_vr_mmxext;
-#endif
-}
-
-void x264_predict_8x8_init_sse2( x264_predict8x8_t pf[12] )
-{
-#ifdef ARCH_X86_64 // x86 not written yet
-    pf[I_PRED_8x8_DDL] = predict_8x8_ddl_sse2;
-    pf[I_PRED_8x8_DDR] = predict_8x8_ddr_sse2;
-    pf[I_PRED_8x8_VL]  = predict_8x8_vl_sse2;
-#endif
-}
-
-void x264_predict_4x4_init_mmxext( x264_predict_t pf[12] )
-{
-#ifdef ARCH_X86_64 // x86 not written yet
-    pf[I_PRED_4x4_DDL] = predict_4x4_ddl_mmxext;
-    pf[I_PRED_4x4_VL]  = predict_4x4_vl_mmxext;
-#endif
-#ifdef ARCH_X86_64 // slower on x86
-    pf[I_PRED_4x4_DDR] = predict_4x4_ddr;
-    pf[I_PRED_4x4_VR]  = predict_4x4_vr;
-    pf[I_PRED_4x4_HD]  = predict_4x4_hd;
-    pf[I_PRED_4x4_HU]  = predict_4x4_hu;
-#endif
-}
-
index df58121223831e8533e4aac03d384a1504f5888c..c0b12cf30529f4df6650c10876a140ef6dc5ee29 100644 (file)
@@ -50,7 +50,6 @@
 #define sqrtf sqrt
 #endif
 #ifdef WIN32 // POSIX says that rename() removes the destination, but win32 doesn't.
-#include <unistd.h>
 #define rename(src,dst) (unlink(dst), rename(src,dst))
 #endif
 
index 480d5ec489a5bb2e869249bb0381ff5525d2f4ae..b45c1c7be74df038fbfc7002ea2b794e8c684471 100644 (file)
@@ -182,7 +182,7 @@ int x264_rd_cost_i4x4( x264_t *h, int i_lambda2, int i4, int i_mode )
  * Trellis RD quantization
  ****************************************************************************/
 
-#define TRELLIS_SCORE_MAX (1ULL<<50)
+#define TRELLIS_SCORE_MAX ((uint64_t)1<<50)
 #define CABAC_SIZE_BITS 8
 #define SSD_WEIGHT_BITS 5
 #define LAMBDA_BITS 4