diff --git a/build/win32/libx264.vcproj b/build/win32/libx264.vcproj index 8497a35..dc28cde 100644 --- a/build/win32/libx264.vcproj +++ b/build/win32/libx264.vcproj @@ -1,117 +1,318 @@ + RootNamespace="libx264" + TargetFrameworkVersion="131072" + > + Name="Win32" + /> + + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + Name="VCPreBuildEventTool" + /> + Name="VCCustomBuildTool" + /> + Name="VCXMLDataGeneratorTool" + /> + Name="VCWebServiceProxyGeneratorTool" + /> + Name="VCMIDLTool" + /> + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../../common;../../extras;../..;../../gpac/include" + PreprocessorDefinitions="_DEBUG;_LIB;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;HAVE_MMX;ARCH_X86;HAVE_PTHREAD;PTW32_STATIC_LIB" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + PrecompiledHeaderFile="$(OutDir)\libx264.pch" + AssemblerListingLocation="$(OutDir)\" + ObjectFile="$(OutDir)\" + ProgramDataBaseFileName="$(OutDir)\" + WarningLevel="3" + SuppressStartupBanner="true" + DebugInformationFormat="3" + CompileAs="0" + /> + Name="VCManagedResourceCompilerTool" + /> + PreprocessorDefinitions="_DEBUG" + Culture="2052" + /> + + + + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCPostBuildEventTool" + /> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + CompileAs="0" + /> + Name="VCManagedResourceCompilerTool" + /> + + + OutputFile=".\bin\Debug64\libx264.lib" + SuppressStartupBanner="true" + /> + + + + + + + + + Name="VCCustomBuildTool" + /> + Name="VCXMLDataGeneratorTool" + /> + Name="VCWebServiceProxyGeneratorTool" + /> + + + Name="VCManagedResourceCompilerTool" + /> + PreprocessorDefinitions="NDEBUG" + Culture="2052" + /> + + Name="VCLibrarianTool" + OutputFile=".\bin\Release\libx264.lib" + SuppressStartupBanner="true" + /> + + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + + + + + + + + + + + + + + + + + + @@ -119,873 +320,2024 @@ + Filter=".c" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RelativePath="..\..\encoder\cavlc.c" + > + + + + + + + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + Name="Release|x64" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + RelativePath="..\..\encoder\encoder.c" + > + + + + + + + + + + + + + + + + + + + + + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + Name="Release|x64" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + RelativePath="..\..\encoder\macroblock.c" + > + Name="Debug|Win32" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + + + + + + + RelativePath="..\..\encoder\me.c" + > + + + + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + + + + RelativePath="..\..\encoder\ratecontrol.c" + > + + + + + + + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + Name="Release|x64" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + RelativePath="..\..\encoder\rdo.c" + > + Name="Debug|Win32" + ExcludedFromBuild="true" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + Name="Debug|x64" + ExcludedFromBuild="true" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + + + + + + + RelativePath="..\..\encoder\set.c" + > + + + + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + + + + RelativePath="..\..\encoder\slicetype.c" + > + + + + + + + Name="Release|Win32" + ExcludedFromBuild="true" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + Name="Release|x64" + ExcludedFromBuild="true" + > + AssemblerListingLocation="$(OutDir)\Enc\" + ObjectFile="$(OutDir)\Enc\" + ProgramDataBaseFileName="$(OutDir)\Enc\" + /> + Filter=".h" + > + RelativePath="..\..\encoder\analyse.h" + > + RelativePath="..\..\encoder\macroblock.h" + > + RelativePath="..\..\encoder\me.h" + > + RelativePath="..\..\encoder\ratecontrol.h" + > + RelativePath="..\..\encoder\set.h" + > + Filter=".c" + > + RelativePath="..\..\common\cabac.c" + > + Name="Debug|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> - - + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Release|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + RelativePath="..\..\common\common.c" + > + Name="Debug|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> - - + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Release|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + RelativePath="..\..\common\cpu.c" + > + Name="Debug|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + + + + + + + RelativePath="..\..\common\dct.c" + > + Name="Debug|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + + + + + + + RelativePath="..\..\common\frame.c" + > + + + + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + + + + RelativePath="..\..\common\macroblock.c" + > + + + + + + + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Release|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + RelativePath="..\..\common\mc.c" + > + + + + + + + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Release|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + RelativePath="..\..\common\mdate.c" + > + + + + + + + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Release|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + RelativePath="..\..\common\pixel.c" + > + + + + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + + + + RelativePath="..\..\common\predict.c" + > + Name="Debug|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + + + + + + + RelativePath="..\..\common\quant.c" + > + Name="Debug|Win32" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\Core\" + ObjectFile="$(OutDir)\Core\" + ProgramDataBaseFileName="$(OutDir)\Core\" + /> + + + + + + + RelativePath="..\..\common\set.c" + > + + + + + + + + + + + + + RelativePath="..\..\common\vlc.c" + > + + + + + + + + + + + + + Filter=".h" + > + RelativePath="..\..\common\bs.h" + > + RelativePath="..\..\common\cabac.h" + > + RelativePath="..\..\common\common.h" + > + RelativePath="..\..\common\cpu.h" + > + RelativePath="..\..\common\dct.h" + > + RelativePath="..\..\common\frame.h" + > + RelativePath="..\..\common\macroblock.h" + > + RelativePath="..\..\common\mc.h" + > + RelativePath="..\..\common\osdep.h" + > + RelativePath="..\..\common\pixel.h" + > + RelativePath="..\..\common\predict.h" + > + RelativePath="..\..\common\quant.h" + > - - + RelativePath="..\..\common\set.h" + > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Filter=".c" + > + RelativePath="..\..\common\x86\mc-c.c" + > + Name="Debug|Win32" + > + Name="VCCLCompilerTool" + AssemblerListingLocation="$(OutDir)\Core\x86\" + ObjectFile="$(OutDir)\Core\x86\" + ProgramDataBaseFileName="$(OutDir)\Core\x86\" + /> + Name="Debug|x64" + > + Name="VCCLCompilerTool" + AssemblerListingLocation="$(OutDir)\Core\x86\" + ObjectFile="$(OutDir)\Core\x86\" + ProgramDataBaseFileName="$(OutDir)\Core\x86\" + /> - - + Name="Release|Win32" + > + Name="VCCLCompilerTool" + AssemblerListingLocation="$(OutDir)\Core\x86\" + ObjectFile="$(OutDir)\Core\x86\" + ProgramDataBaseFileName="$(OutDir)\Core\x86\" + /> + Name="Release|x64" + > + Name="VCCLCompilerTool" + AssemblerListingLocation="$(OutDir)\Core\x86\" + ObjectFile="$(OutDir)\Core\x86\" + ProgramDataBaseFileName="$(OutDir)\Core\x86\" + /> + RelativePath="..\..\common\x86\predict-c.c" + > + Name="Debug|Win32" + > + Name="VCCLCompilerTool" + AssemblerListingLocation="$(OutDir)\Core\x86\" + ObjectFile="$(OutDir)\Core\x86\" + ProgramDataBaseFileName="$(OutDir)\Core\x86\" + /> + Name="Debug|x64" + > + Name="VCCLCompilerTool" + AssemblerListingLocation="$(OutDir)\Core\x86\" + ObjectFile="$(OutDir)\Core\x86\" + ProgramDataBaseFileName="$(OutDir)\Core\x86\" + /> - - + Name="Release|Win32" + > + Name="VCCLCompilerTool" + AssemblerListingLocation="$(OutDir)\Core\x86\" + ObjectFile="$(OutDir)\Core\x86\" + ProgramDataBaseFileName="$(OutDir)\Core\x86\" + /> + Name="Release|x64" + > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="VCCLCompilerTool" + AssemblerListingLocation="$(OutDir)\Core\x86\" + ObjectFile="$(OutDir)\Core\x86\" + ProgramDataBaseFileName="$(OutDir)\Core\x86\" + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Filter=".c" + > + RelativePath="..\..\extras\getopt.c" + > + + + + Name="Debug|x64" + > + AssemblerListingLocation="$(OutDir)\extras\" + ObjectFile="$(OutDir)\extras\" + ProgramDataBaseFileName="$(OutDir)\extras\" + /> + Name="Release|Win32" + > + AssemblerListingLocation="$(OutDir)\extras\" + ObjectFile="$(OutDir)\extras\" + ProgramDataBaseFileName="$(OutDir)\extras\" + /> + + + + Filter=".h" + > + + + RelativePath="..\..\extras\inttypes.h" + > + RelativePath="..\..\extras\stdint.h" + > diff --git a/build/win32/x264.sln b/build/win32/x264.sln index 8fb518d..720bb68 100644 --- a/build/win32/x264.sln +++ b/build/win32/x264.sln @@ -1,7 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libx264", "libx264.vcproj", "{A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x264", "x264.vcproj", "{22E1814D-7955-4456-AEA5-0C9BA7500792}" ProjectSection(ProjectDependencies) = postProject @@ -9,22 +8,31 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x264", "x264.vcproj", "{22E EndProjectSection EndProject Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {22E1814D-7955-4456-AEA5-0C9BA7500792}.Debug.ActiveCfg = Debug|Win32 - {22E1814D-7955-4456-AEA5-0C9BA7500792}.Debug.Build.0 = Debug|Win32 - {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release.ActiveCfg = Release|Win32 - {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release.Build.0 = Release|Win32 - {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Debug.ActiveCfg = Debug|Win32 - {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Debug.Build.0 = Debug|Win32 - {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release.ActiveCfg = Release|Win32 - {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release.Build.0 = Release|Win32 + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Debug|Win32.ActiveCfg = Debug|Win32 + {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Debug|Win32.Build.0 = Debug|Win32 + {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Debug|x64.ActiveCfg = Debug|x64 + {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Debug|x64.Build.0 = Debug|x64 + {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release|Win32.ActiveCfg = Release|Win32 + {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release|Win32.Build.0 = Release|Win32 + {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release|x64.ActiveCfg = Release|x64 + {A8D6E4CD-1885-4B03-8E41-5F3DB825BAA6}.Release|x64.Build.0 = Release|x64 + {22E1814D-7955-4456-AEA5-0C9BA7500792}.Debug|Win32.ActiveCfg = Debug|Win32 + {22E1814D-7955-4456-AEA5-0C9BA7500792}.Debug|Win32.Build.0 = Debug|Win32 + {22E1814D-7955-4456-AEA5-0C9BA7500792}.Debug|x64.ActiveCfg = Debug|x64 + {22E1814D-7955-4456-AEA5-0C9BA7500792}.Debug|x64.Build.0 = Debug|x64 + {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release|Win32.ActiveCfg = Release|Win32 + {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release|Win32.Build.0 = Release|Win32 + {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release|x64.ActiveCfg = Release|x64 + {22E1814D-7955-4456-AEA5-0C9BA7500792}.Release|x64.Build.0 = Release|x64 EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal diff --git a/build/win32/x264.vcproj b/build/win32/x264.vcproj index c567265..570b3e9 100644 --- a/build/win32/x264.vcproj +++ b/build/win32/x264.vcproj @@ -1,176 +1,408 @@ + RootNamespace="x264" + TargetFrameworkVersion="131072" + > + Name="Win32" + /> + + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + CompileAs="0" + /> + + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="2052" + /> + + LargeAddressAware="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" + TargetMachine="1" + /> + Name="VCALinkTool" + /> + + + + + + + + + + + Name="VCXMLDataGeneratorTool" + /> + Name="VCWebServiceProxyGeneratorTool" + /> + Name="VCMIDLTool" + TargetEnvironment="3" + /> + + + Culture="2052" + /> + + + + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + CompileAs="0" + /> + + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="2052" + /> + + LargeAddressAware="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" + TargetMachine="1" + /> + Name="VCALinkTool" + /> + + + + + + + + + + + Name="VCXMLDataGeneratorTool" + /> + Name="VCWebServiceProxyGeneratorTool" + /> + Name="VCMIDLTool" + TargetEnvironment="3" + /> + + + Culture="2052" + /> + + + + + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> + Name="VCPostBuildEventTool" + /> + RelativePath="..\..\matroska.c" + > + RelativePath="..\..\matroska.h" + > + RelativePath="..\..\muxers.c" + > + RelativePath="..\..\muxers.h" + > - - - - - - + RelativePath="..\..\x264.c" + > + RelativePath="..\..\x264.h" + > diff --git a/common/common.h b/common/common.h index 0498139..22e514f 100644 --- a/common/common.h +++ b/common/common.h @@ -165,9 +165,10 @@ extern const float x264_log2_lz_lut[32]; * qp to qscale. */ static ALWAYS_INLINE int x264_exp2fix8( float x ) { + int i; if( x >= 512.f/6.f ) return 0; if( x <= -512.f/6.f ) return 0xffff; - int i = x*(-64.f/6.f) + 512; + i = x*(-64.f/6.f) + 512; return (x264_exp2_lut[i&63]+256) << (i>>6) >> 8; } diff --git a/common/macroblock.c b/common/macroblock.c index 54a095d..452031d 100644 --- a/common/macroblock.c +++ b/common/macroblock.c @@ -666,6 +666,7 @@ int x264_macroblock_cache_init( x264_t *h ) { int i, j; int i_mb_count = h->mb.i_mb_count; + int buf_hpel, buf_ssim, me_range, buf_tesa, buf_mbtree; h->mb.i_mb_stride = h->sps->i_mb_width; h->mb.i_b8_stride = h->sps->i_mb_width * 2; @@ -739,12 +740,12 @@ int x264_macroblock_cache_init( x264_t *h ) h->mb.i_neighbour4[15] = h->mb.i_neighbour8[3] = MB_LEFT|MB_TOP|MB_TOPLEFT; - int buf_hpel = (h->param.i_width+48) * sizeof(int16_t); - int buf_ssim = h->param.analyse.b_ssim * 8 * (h->param.i_width/4+3) * sizeof(int); - int me_range = X264_MIN(h->param.analyse.i_me_range, h->param.analyse.i_mv_range); - int buf_tesa = (h->param.analyse.i_me_method >= X264_ME_ESA) * - ((me_range*2+18) * sizeof(int16_t) + (me_range+4) * (me_range+1) * 4 * sizeof(mvsad_t)); - int buf_mbtree = h->param.rc.b_mb_tree * ((h->sps->i_mb_width+3)&~3) * sizeof(int); + buf_hpel = (h->param.i_width+48) * sizeof(int16_t); + buf_ssim = h->param.analyse.b_ssim * 8 * (h->param.i_width/4+3) * sizeof(int); + me_range = X264_MIN(h->param.analyse.i_me_range, h->param.analyse.i_mv_range); + buf_tesa = (h->param.analyse.i_me_method >= X264_ME_ESA) * + ((me_range*2+18) * sizeof(int16_t) + (me_range+4) * (me_range+1) * 4 * sizeof(mvsad_t)); + buf_mbtree = h->param.rc.b_mb_tree * ((h->sps->i_mb_width+3)&~3) * sizeof(int); CHECKED_MALLOC( h->scratch_buffer, X264_MAX4( buf_hpel, buf_ssim, buf_tesa, buf_mbtree ) ); return 0; diff --git a/common/osdep.h b/common/osdep.h index 71780a2..87ded44 100644 --- a/common/osdep.h +++ b/common/osdep.h @@ -40,6 +40,7 @@ #endif #ifdef _MSC_VER +#include //_finite #define inline __inline #define strcasecmp stricmp #define strncasecmp strnicmp @@ -48,7 +49,7 @@ #define ftell _ftelli64 #define isfinite _finite #define strtok_r strtok_s -#define _CRT_SECURE_NO_DEPRECATE +#define log2f(x) (logf(x)/logf(2)) #define X264_VERSION "" // no configure script for msvc #endif @@ -225,7 +226,7 @@ static int ALWAYS_INLINE x264_clz( uint32_t x ) #endif #ifdef USE_REAL_PTHREAD -#ifdef SYS_MINGW +#ifdef _WIN32 #define x264_lower_thread_priority(p)\ {\ x264_pthread_t handle = pthread_self();\ diff --git a/encoder/analyse.c b/encoder/analyse.c index 5fcfd99..0b3f935 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -2947,7 +2947,7 @@ void x264_macroblock_analyse( x264_t *h ) if( analysis.i_mbrd >= 2 ) { /* Don't bother with bipred or 8x8-and-below, the odds are incredibly low. */ - static const uint8_t check_mv_lists[X264_MBTYPE_MAX] = {[P_L0]=1, [B_L0_L0]=1, [B_L1_L1]=2}; + static const uint8_t check_mv_lists[X264_MBTYPE_MAX] = {0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,0,0,0}; int list = check_mv_lists[h->mb.i_type] - 1; if( list >= 0 && h->mb.i_partition != D_16x16 && *(uint32_t*)&h->mb.cache.mv[list][x264_scan8[0]] == *(uint32_t*)&h->mb.cache.mv[list][x264_scan8[12]] && diff --git a/encoder/encoder.c b/encoder/encoder.c index 9dfe397..f6dc4ed 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -337,6 +337,7 @@ fail: static int x264_validate_parameters( x264_t *h ) { + int max_slices; #ifdef HAVE_MMX if( !(x264_cpu_detect() & X264_CPU_SSE) ) { @@ -466,7 +467,7 @@ static int x264_validate_parameters( x264_t *h ) h->param.i_width, h->param.i_height ); } - int max_slices = (h->param.i_height+((16<param.b_interlaced)-1))/(16<param.b_interlaced); + max_slices = (h->param.i_height+((16<param.b_interlaced)-1))/(16<param.b_interlaced); h->param.i_slice_count = x264_clip3( h->param.i_slice_count, 0, max_slices ); h->param.i_slice_max_size = X264_MAX( h->param.i_slice_max_size, 0 ); h->param.i_slice_max_mbs = X264_MAX( h->param.i_slice_max_mbs, 0 ); @@ -1023,6 +1024,7 @@ static int x264_nal_end( x264_t *h ) static int x264_encoder_encapsulate_nals( x264_t *h ) { int nal_size = 0, i; + uint8_t *nal_buffer; for( i = 0; i < h->out.i_nal; i++ ) nal_size += h->out.nal[i].i_payload; @@ -1036,7 +1038,7 @@ static int x264_encoder_encapsulate_nals( x264_t *h ) h->nal_buffer = buf; } - uint8_t *nal_buffer = h->nal_buffer; + nal_buffer = h->nal_buffer; for( i = 0; i < h->out.i_nal; i++ ) { @@ -1345,6 +1347,8 @@ static int x264_slice_write( x264_t *h ) while( (mb_xy = i_mb_x + i_mb_y * h->sps->i_mb_width) <= h->sh.i_last_mb ) { + int total_bits; + int mb_size; int mb_spos = bs_pos(&h->out.bs) + x264_cabac_pos(&h->cabac); if( h->param.i_slice_max_size > 0 ) { @@ -1408,8 +1412,8 @@ static int x264_slice_write( x264_t *h ) } } - int total_bits = bs_pos(&h->out.bs) + x264_cabac_pos(&h->cabac); - int mb_size = total_bits - mb_spos; + total_bits = bs_pos(&h->out.bs) + x264_cabac_pos(&h->cabac); + mb_size = total_bits - mb_spos; /* We'll just re-encode this last macroblock if we go over the max slice size. */ if( total_bits - starting_bits > slice_max_size && !h->mb.b_reencode_mb ) @@ -1593,10 +1597,12 @@ static void *x264_slices_write( x264_t *h ) h->sh.i_last_mb = h->sh.i_first_mb + h->param.i_slice_max_mbs - 1; else if( h->param.i_slice_count ) { + double height; + int width; x264_emms(); i_slice_num++; - double height = h->sps->i_mb_height >> h->param.b_interlaced; - int width = h->sps->i_mb_width << h->param.b_interlaced; + height = h->sps->i_mb_height >> h->param.b_interlaced; + width = h->sps->i_mb_width << h->param.b_interlaced; h->sh.i_last_mb = (int)(height * i_slice_num / h->param.i_slice_count + 0.5) * width - 1; } h->sh.i_last_mb = X264_MIN( h->sh.i_last_mb, h->mb.i_mb_count - 1 ); @@ -1639,6 +1645,7 @@ int x264_encoder_encode( x264_t *h, int i_nal_ref_idc; int i_global_qp; + int overhead = NALU_OVERHEAD; if( h->param.i_threads > 1) { @@ -1814,8 +1821,6 @@ int x264_encoder_encode( x264_t *h, h->i_nal_type = i_nal_type; h->i_nal_ref_idc = i_nal_ref_idc; - int overhead = NALU_OVERHEAD; - /* Write SPS and PPS */ if( i_nal_type == NAL_SLICE_IDR && h->param.b_repeat_headers ) { @@ -2206,6 +2211,8 @@ void x264_encoder_close ( x264_t *h ) int64_t i_mb_count = i_count * h->mb.i_mb_count; float fps = (float) h->param.i_fps_num / h->param.i_fps_den; float f_bitrate = fps * SUM3(h->stat.i_frame_size) / i_count / 125; + int64_t fixed_pred_modes[3][9] = {{0}}; + int64_t sum_pred_modes[3] = {0}; if( h->pps->b_transform_8x8_mode ) { @@ -2234,8 +2241,6 @@ void x264_encoder_close ( x264_t *h ) h->stat.i_mb_cbp[2] * 100.0 / (i_all_intra ), h->stat.i_mb_cbp[4] * 100.0 / (i_all_intra ), buf ); - int64_t fixed_pred_modes[3][9] = {{0}}; - int64_t sum_pred_modes[3] = {0}; for( i = 0; i <= I_PRED_16x16_DC_128; i++ ) { fixed_pred_modes[0][x264_mb_pred_mode16x16_fix[i]] += h->stat.i_mb_pred_mode[0][i]; diff --git a/encoder/lookahead.c b/encoder/lookahead.c index 968d0fc..957792a 100644 --- a/encoder/lookahead.c +++ b/encoder/lookahead.c @@ -131,8 +131,9 @@ static void x264_lookahead_thread( x264_t *h ) int x264_lookahead_init( x264_t *h, int i_slicetype_length ) { x264_lookahead_t *look; - CHECKED_MALLOCZERO( look, sizeof(x264_lookahead_t) ); int i; + x264_t *look_h; + CHECKED_MALLOCZERO( look, sizeof(x264_lookahead_t) ); for( i = 0; i < h->param.i_threads; i++ ) h->thread[i]->lookahead = look; @@ -150,7 +151,7 @@ int x264_lookahead_init( x264_t *h, int i_slicetype_length ) if( !h->param.i_sync_lookahead ) return 0; - x264_t *look_h = h->thread[h->param.i_threads]; + look_h = h->thread[h->param.i_threads]; *look_h = *h; if( x264_macroblock_cache_init( look_h ) ) goto fail; @@ -248,13 +249,13 @@ void x264_lookahead_get_frames( x264_t *h ) } else { /* We are not running a lookahead thread, so perform all the slicetype decide on the fly */ + int bframes=0; if( h->frames.current[0] || !h->lookahead->next.i_size ) return; x264_stack_align( x264_slicetype_decide, h ); - int bframes=0; while( IS_X264_TYPE_B( h->lookahead->next.list[bframes]->i_type ) ) bframes++; diff --git a/encoder/me.c b/encoder/me.c index 8510ce2..891fffe 100644 --- a/encoder/me.c +++ b/encoder/me.c @@ -197,6 +197,8 @@ void x264_me_search_ref( x264_t *h, x264_me_t *m, int16_t (*mvc)[2], int i_mvc, const uint16_t *p_cost_mvx = m->p_cost_mv - m->mvp[0]; const uint16_t *p_cost_mvy = m->p_cost_mv - m->mvp[1]; + const uint16_t *p_cost_omvx; + const uint16_t *p_cost_omvy; bmx = x264_clip3( m->mvp[0], mv_x_min*4, mv_x_max*4 ); bmy = x264_clip3( m->mvp[1], mv_y_min*4, mv_y_max*4 ); @@ -452,8 +454,8 @@ me_hex2: /* hexagon grid */ omx = bmx; omy = bmy; - const uint16_t *p_cost_omvx = p_cost_mvx + omx*4; - const uint16_t *p_cost_omvy = p_cost_mvy + omy*4; + p_cost_omvx = p_cost_mvx + omx*4; + p_cost_omvy = p_cost_mvy + omy*4; i = 1; do { diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index b082cc7..c106fb5 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -1377,12 +1377,13 @@ static double predict_size( predictor_t *p, double q, double var ) static void update_predictor( predictor_t *p, double q, double var, double bits ) { const double range = 1.5; + double old_coeff, new_coeff, new_coeff_clipped, new_offset; if( var < 10 ) return; - double old_coeff = p->coeff / p->count; - double new_coeff = bits*q / var; - double new_coeff_clipped = x264_clip3f( new_coeff, old_coeff/range, old_coeff*range ); - double new_offset = bits*q - new_coeff_clipped * var; + old_coeff = p->coeff / p->count; + new_coeff = bits*q / var; + new_coeff_clipped = x264_clip3f( new_coeff, old_coeff/range, old_coeff*range ); + new_offset = bits*q - new_coeff_clipped * var; if( new_offset >= 0 ) new_coeff = new_coeff_clipped; else @@ -1499,6 +1500,8 @@ static double clip_qscale( x264_t *h, int pict_type, double q ) /* Fallback to old purely-reactive algorithm: no lookahead. */ else { + double bits; + double qf = 1.0; if( ( pict_type == SLICE_TYPE_P || ( pict_type == SLICE_TYPE_I && rcc->last_non_b_pict_type == SLICE_TYPE_I ) ) && rcc->buffer_fill/rcc->buffer_size < 0.5 ) @@ -1508,8 +1511,7 @@ static double clip_qscale( x264_t *h, int pict_type, double q ) /* Now a hard threshold to make sure the frame fits in VBV. * This one is mostly for I-frames. */ - double bits = predict_size( &rcc->pred[h->sh.i_type], q, rcc->last_satd ); - double qf = 1.0; + bits = predict_size( &rcc->pred[h->sh.i_type], q, rcc->last_satd ); if( bits > rcc->buffer_fill/2 ) qf = x264_clip3f( rcc->buffer_fill/(2*bits), 0.2, 1.0 ); q /= qf; diff --git a/encoder/slicetype.c b/encoder/slicetype.c index 4314062..f75bef0 100644 --- a/encoder/slicetype.c +++ b/encoder/slicetype.c @@ -456,12 +456,16 @@ static void x264_macroblock_tree_propagate( x264_t *h, x264_frame_t **frames, in int idx1 = idx0 + 1; int idx2 = idx0 + h->mb.i_mb_stride; int idx3 = idx0 + h->mb.i_mb_stride + 1; + int idx0weight; + int idx1weight; + int idx2weight; + int idx3weight; x &= 31; y &= 31; - int idx0weight = (32-y)*(32-x); - int idx1weight = (32-y)*x; - int idx2weight = y*(32-x); - int idx3weight = y*x; + idx0weight = (32-y)*(32-x); + idx1weight = (32-y)*x; + idx2weight = y*(32-x); + idx3weight = y*x; /* Apply bipred weighting. */ if( lists_used == 3 ) @@ -653,17 +657,19 @@ static void x264_slicetype_path( x264_t *h, x264_mb_analysis_t *a, x264_frame_t static int scenecut( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, int p0, int p1, int print ) { x264_frame_t *frame = frames[p1]; + int icost, pcost; + int i_gop_size; + float f_thresh_max, f_thresh_min, f_bias; + int res; x264_slicetype_frame_cost( h, a, frames, p0, p1, p1, 0 ); - int icost = frame->i_cost_est[0][0]; - int pcost = frame->i_cost_est[p1-p0][0]; - float f_bias; - int i_gop_size = frame->i_frame - h->lookahead->i_last_idr; - float f_thresh_max = h->param.i_scenecut_threshold / 100.0; + icost = frame->i_cost_est[0][0]; + pcost = frame->i_cost_est[p1-p0][0]; + i_gop_size = frame->i_frame - h->lookahead->i_last_idr; + f_thresh_max = h->param.i_scenecut_threshold / 100.0; /* magic numbers pulled out of thin air */ - float f_thresh_min = f_thresh_max * h->param.i_keyint_min - / ( h->param.i_keyint_max * 4 ); - int res; + f_thresh_min = f_thresh_max * h->param.i_keyint_min + / ( h->param.i_keyint_max * 4 ); if( h->param.i_keyint_min == h->param.i_keyint_max ) f_thresh_min= f_thresh_max; @@ -700,6 +706,12 @@ void x264_slicetype_analyse( x264_t *h, int keyframe ) int i_mb_count = NUM_MBS; int cost1p0, cost2p0, cost1b1, cost2p1; int i_max_search = X264_MIN( h->lookahead->next.i_size, X264_LOOKAHEAD_MAX ); + char best_paths[X264_LOOKAHEAD_MAX][X264_LOOKAHEAD_MAX] = {"","P"}; + int n; + int num_bframes = 0; + int max_bframes; + int num_analysed_frames; + int reset_start; if( h->param.b_deterministic ) i_max_search = X264_MIN( i_max_search, h->lookahead->i_slicetype_length + !keyframe ); @@ -739,12 +751,8 @@ void x264_slicetype_analyse( x264_t *h, int keyframe ) return; } - char best_paths[X264_LOOKAHEAD_MAX][X264_LOOKAHEAD_MAX] = {"","P"}; - int n; - int num_bframes = 0; - int max_bframes = X264_MIN(num_frames-1, h->param.i_bframe); - int num_analysed_frames = num_frames; - int reset_start; + max_bframes = X264_MIN(num_frames-1, h->param.i_bframe); + num_analysed_frames = num_frames; if( h->param.i_scenecut_threshold && scenecut( h, &a, frames, 0, 1, 1 ) ) { frames[1]->i_type = idr_frame_type; diff --git a/extras/inttypes.h b/extras/inttypes.h new file mode 100644 index 0000000..906382b --- /dev/null +++ b/extras/inttypes.h @@ -0,0 +1,261 @@ +/* 7.8 Format conversion of integer types */ + +#ifndef _INTTYPES_H_ +#define _INTTYPES_H_ + +#include +#define __need_wchar_t +#include + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) + +/* 7.8.1 Macros for format specifiers + * + * MS runtime does not yet understand C9x standard "ll" + * length specifier. It appears to treat "ll" as "l". + * The non-standard I64 length specifier causes warning in GCC, + * but understood by MS runtime functions. + */ + +/* fprintf macros for signed types */ +#define PRId8 "d" +#define PRId16 "d" +#define PRId32 "d" +#define PRId64 "I64d" + +#define PRIdLEAST8 "d" +#define PRIdLEAST16 "d" +#define PRIdLEAST32 "d" +#define PRIdLEAST64 "I64d" + +#define PRIdFAST8 "d" +#define PRIdFAST16 "d" +#define PRIdFAST32 "d" +#define PRIdFAST64 "I64d" + +#define PRIdMAX "I64d" + +#define PRIi8 "i" +#define PRIi16 "i" +#define PRIi32 "i" +#define PRIi64 "I64i" + +#define PRIiLEAST8 "i" +#define PRIiLEAST16 "i" +#define PRIiLEAST32 "i" +#define PRIiLEAST64 "I64i" + +#define PRIiFAST8 "i" +#define PRIiFAST16 "i" +#define PRIiFAST32 "i" +#define PRIiFAST64 "I64i" + +#define PRIiMAX "I64i" + +#define PRIo8 "o" +#define PRIo16 "o" +#define PRIo32 "o" +#define PRIo64 "I64o" + +#define PRIoLEAST8 "o" +#define PRIoLEAST16 "o" +#define PRIoLEAST32 "o" +#define PRIoLEAST64 "I64o" + +#define PRIoFAST8 "o" +#define PRIoFAST16 "o" +#define PRIoFAST32 "o" +#define PRIoFAST64 "I64o" + +#define PRIoMAX "I64o" + +/* fprintf macros for unsigned types */ +#define PRIu8 "u" +#define PRIu16 "u" +#define PRIu32 "u" +#define PRIu64 "I64u" + + +#define PRIuLEAST8 "u" +#define PRIuLEAST16 "u" +#define PRIuLEAST32 "u" +#define PRIuLEAST64 "I64u" + +#define PRIuFAST8 "u" +#define PRIuFAST16 "u" +#define PRIuFAST32 "u" +#define PRIuFAST64 "I64u" + +#define PRIuMAX "I64u" + +#define PRIx8 "x" +#define PRIx16 "x" +#define PRIx32 "x" +#define PRIx64 "I64x" + +#define PRIxLEAST8 "x" +#define PRIxLEAST16 "x" +#define PRIxLEAST32 "x" +#define PRIxLEAST64 "I64x" + +#define PRIxFAST8 "x" +#define PRIxFAST16 "x" +#define PRIxFAST32 "x" +#define PRIxFAST64 "I64x" + +#define PRIxMAX "I64x" + +#define PRIX8 "X" +#define PRIX16 "X" +#define PRIX32 "X" +#define PRIX64 "I64X" + +#define PRIXLEAST8 "X" +#define PRIXLEAST16 "X" +#define PRIXLEAST32 "X" +#define PRIXLEAST64 "I64X" + +#define PRIXFAST8 "X" +#define PRIXFAST16 "X" +#define PRIXFAST32 "X" +#define PRIXFAST64 "I64X" + +#define PRIXMAX "I64X" + +/* + * fscanf macros for signed int types + * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t + * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have + * no length identifiers + */ + +#define SCNd16 "hd" +#define SCNd32 "d" +#define SCNd64 "I64d" + +#define SCNdLEAST16 "hd" +#define SCNdLEAST32 "d" +#define SCNdLEAST64 "I64d" + +#define SCNdFAST16 "hd" +#define SCNdFAST32 "d" +#define SCNdFAST64 "I64d" + +#define SCNdMAX "I64d" + +#define SCNi16 "hi" +#define SCNi32 "i" +#define SCNi64 "I64i" + +#define SCNiLEAST16 "hi" +#define SCNiLEAST32 "i" +#define SCNiLEAST64 "I64i" + +#define SCNiFAST16 "hi" +#define SCNiFAST32 "i" +#define SCNiFAST64 "I64i" + +#define SCNiMAX "I64i" + +#define SCNo16 "ho" +#define SCNo32 "o" +#define SCNo64 "I64o" + +#define SCNoLEAST16 "ho" +#define SCNoLEAST32 "o" +#define SCNoLEAST64 "I64o" + +#define SCNoFAST16 "ho" +#define SCNoFAST32 "o" +#define SCNoFAST64 "I64o" + +#define SCNoMAX "I64o" + +#define SCNx16 "hx" +#define SCNx32 "x" +#define SCNx64 "I64x" + +#define SCNxLEAST16 "hx" +#define SCNxLEAST32 "x" +#define SCNxLEAST64 "I64x" + +#define SCNxFAST16 "hx" +#define SCNxFAST32 "x" +#define SCNxFAST64 "I64x" + +#define SCNxMAX "I64x" + +/* fscanf macros for unsigned int types */ + +#define SCNu16 "hu" +#define SCNu32 "u" +#define SCNu64 "I64u" + +#define SCNuLEAST16 "hu" +#define SCNuLEAST32 "u" +#define SCNuLEAST64 "I64u" + +#define SCNuFAST16 "hu" +#define SCNuFAST32 "u" +#define SCNuFAST64 "I64u" + +#define SCNuMAX "I64u" + +#ifdef _WIN64 +#define PRIdPTR "I64d" +#define PRIiPTR "I64i" +#define PRIoPTR "I64o" +#define PRIuPTR "I64u" +#define PRIxPTR "I64x" +#define PRIXPTR "I64X" +#define SCNdPTR "I64d" +#define SCNiPTR "I64i" +#define SCNoPTR "I64o" +#define SCNxPTR "I64x" +#define SCNuPTR "I64u" +#else +#define PRIdPTR "d" +#define PRIiPTR "i" +#define PRIoPTR "o" +#define PRIuPTR "u" +#define PRIxPTR "x" +#define PRIXPTR "X" +#define SCNdPTR "d" +#define SCNiPTR "i" +#define SCNoPTR "o" +#define SCNxPTR "x" + #define SCNuPTR "u" +#endif + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* + * no length modifier for char types prior to C9x + * MS runtime scanf appears to treat "hh" as "h" + */ + +/* signed char */ +#define SCNd8 "hhd" +#define SCNdLEAST8 "hhd" +#define SCNdFAST8 "hhd" + +#define SCNi8 "hhi" +#define SCNiLEAST8 "hhi" +#define SCNiFAST8 "hhi" + +#define SCNo8 "hho" +#define SCNoLEAST8 "hho" +#define SCNoFAST8 "hho" + +#define SCNx8 "hhx" +#define SCNxLEAST8 "hhx" +#define SCNxFAST8 "hhx" + +/* unsigned char */ +#define SCNu8 "hhu" +#define SCNuLEAST8 "hhu" +#define SCNuFAST8 "hhu" +#endif /* __STDC_VERSION__ >= 199901 */ + +#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ + +#endif /* ndef _INTTYPES_H */ diff --git a/extras/stdint.h b/extras/stdint.h index 849d9ab..33d790e 100644 --- a/extras/stdint.h +++ b/extras/stdint.h @@ -56,10 +56,6 @@ typedef unsigned int uint_fast32_t; typedef __int64 int_fast64_t; typedef unsigned __int64 uint_fast64_t; -/* 7.18.1.4 Integer types capable of holding object pointers */ -/*typedef int intptr_t; -typedef unsigned uintptr_t;*/ - /* 7.18.1.5 Greatest-width integer types */ typedef __int64 intmax_t; typedef unsigned __int64 uintmax_t; @@ -117,9 +113,15 @@ typedef unsigned __int64 uintmax_t; /* 7.18.2.4 Limits of integer types capable of holding object pointers */ +#ifdef _WIN64 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#else #define INTPTR_MIN INT32_MIN #define INTPTR_MAX INT32_MAX #define UINTPTR_MAX UINT32_MAX +#endif /* 7.18.2.5 Limits of greatest-width integer types */ #define INTMAX_MIN INT64_MIN @@ -127,13 +129,24 @@ typedef unsigned __int64 uintmax_t; #define UINTMAX_MAX UINT64_MAX /* 7.18.3 Limits of other integer types */ +#ifdef _WIN64 +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#else #define PTRDIFF_MIN INT32_MIN #define PTRDIFF_MAX INT32_MAX +#endif #define SIG_ATOMIC_MIN INT32_MIN #define SIG_ATOMIC_MAX INT32_MAX +#ifndef SIZE_MAX +#ifdef _WIN64 +#define SIZE_MAX UINT64_MAX +#else #define SIZE_MAX UINT32_MAX +#endif +#endif #ifndef WCHAR_MIN /* also in wchar.h */ #define WCHAR_MIN 0 diff --git a/muxers.c b/muxers.c index 7100877..c9c9555 100644 --- a/muxers.c +++ b/muxers.c @@ -343,10 +343,10 @@ typedef struct int open_file_avis( char *psz_filename, hnd_t *p_handle, x264_param_t *p_param ) { avis_input_t *h = malloc( sizeof(avis_input_t) ); - if( !h ) - return -1; AVISTREAMINFO info; int i; + if( !h ) + return -1; *p_handle = (hnd_t)h;