<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>All,</div><div><br></div><div>First, many thanks to Matt, Steve, and Martin for posting various patchs to allow compilation with MSVC. I was able to sucessfully apply them to latest x264 source and build with the latest current release of MSVC 2013. However, it looks as if (1) the submitted patches don't allow compilation of AviSynth support, and (2) for some reason x264 compiled with MSVC is much slower than the latest GCC. Details follow:</div><div><br></div><div>1. Compilation:</div><div><br></div><div>[output with default 'configure' results]<br>cl -DNDEBUG -O2 -W0 -I. -I. -nologo -DHAVE_STRING_H -I./extras -c -Foinput/avs.<br>o input/avs.c<br>avs.c<br>input/avs.c(383) : error C2275: 'AVS_VideoFrame' : illegal use of this type as a<br>n expression<br>
.\extras/avisynth_c.h(390) : see declaration of 'AVS_VideoFrame'<br>input/avs.c(383) : error C2065: 'frm' : undeclared identifier<br>input/avs.c(389) : error C2065: 'frm' : undeclared identifier<br>input/avs.c(390) : error C2065: 'frm' : undeclared identifier<br>make: *** [input/avs.o] Error 2</div><div>[output with --disable-avs]</div><div>cl -DNDEBUG -O2 -W0 -I. -I. -nologo -DHAVE_STRING_H -I./extras -c -Focommon/ope<br>ncl.o common/opencl.c<br>opencl.c<br>common/opencl.c(129) : error C2275: 'x264_opencl_function_t' : illegal use of th<br>is type as an expression<br> c:\mingw\msys\1.0\home\joseph\x264-snapshot-20140322-2245\common\opencl.<br>h(709) : see declaration of 'x264_opencl_function_t'<br>common/opencl.c(129) : error C2065: 'ocl' : undeclared identifier<br>common/opencl.c(158) : error C2065: 'ocl' : undeclared identifier<br>common/opencl.c(158) : error C2223: left of
'->clCreateProgramWithBinary' must p<br>oint to struct/union<br>make: *** [common/opencl.o] Error 2</div><div>Note that everything compiles and runs fine with --disable-opencl and --disable-avs both enabled.</div><div><br></div><div>2. Speed</div><div><br></div><div>For a test of speed I applied all three of Steve's patchs as posted. I edited out the changes to osdep.h in Martin's first patch and didn't apply the 2nd patch (since it related to AviSynth) and compiled with "--enable-strip --enable-shared --disable-opencl --disable-avisynth" under both MSVC 2013 (defaults) and GCC 4.8.1 (CFLAGS="-march=native"). I then ran test encodes of a number of different clips across two machines, and found that the MSVC compile is 10-20% slow in all cases. Is this expected behavior? One such test is below:</div><div><br></div><div>[GCC]</div><div><a href="mailto:Joseph@jgsnote">Joseph@jgsnote</a> ~/GCC/bin<br>$ time x264 --bitrate 3000
--preset veryslow --tune film --bluray-compat --vbv-<br>maxrate 8000 --vbv-bufsize 8000 --level 3.2 --keyint 30 --open-gop --bff --colo<br>rprim "smpte170m" --transfer "smpte170m" --colormatrix "smpte170m" --sar 40:33<br>--pass 1 -o out.264 ~/test.y4m<br>y4m [info]: 720x480i 8:9 @ 30000/1001 fps (cfr)<br>x264 [warning]: interlace + weightp is not implemented<br>x264 [info]: using SAR=40/33<br>x264 [info]: using cpu capabilities: MMX2 SSE2Slow SlowCTZ<br>x264 [info]: profile Main, level 3.2<br>x264 [info]: frame I:72 Avg QP:19.93 size: 43843<br>x264 [info]: frame P:561 Avg QP:22.54 size: 19626<br>x264 [info]: frame B:1166 Avg QP:23.99 size: 7613<br>x264 [info]: consecutive B-frames: 5.1% 9.9% 47.0% 38.0%<br>x264 [info]: mb I I16..4: 46.3% 0.0% 53.7%<br>x264 [info]: mb P I16..4: 38.7% 0.0% 0.0% P16..4: 56.7% 0.0% 0.0% 0.0%
0<br>.0% skip: 4.6%<br>x264 [info]: mb B I16..4: 9.9% 0.0% 0.0% B16..8: 40.6% 0.0% 0.0% direct:<br>25.6% skip:23.8% L0:32.0% L1:41.9% BI:26.1%<br>x264 [info]: final ratefactor: 19.75<br>x264 [info]: field mbs: intra: 14.5% inter:15.0% skip:6.6%<br>x264 [info]: direct mvs spatial:99.8% temporal:0.2%<br>x264 [info]: coded y,uvDC,uvAC intra: 65.3% 92.3% 65.4% inter: 26.5% 58.6% 17.1%</div><div>x264 [info]: i16 v,h,dc,p: 16% 28% 41% 16%<br>x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 24% 23% 4% 8% 4% 6% 5% 10%<br>x264 [info]: i8c dc,h,v,p: 43% 33% 15% 9%<br>x264 [info]: kb/s:3071.10</div><div>encoded 1799 frames, 35.45 fps, 3071.10 kb/s</div><div>real 0m50.952s<br>user 0m0.000s<br>sys 0m0.047s</div><div><br></div><div>[MSVC]</div><div><a
href="mailto:Joseph@jgsnote">Joseph@jgsnote</a> ~/MSVC/bin<br>$ time x264 --bitrate 3000 --preset veryslow --tune film --bluray-compat --vbv-<br>maxrate 8000 --vbv-bufsize 8000 --level 3.2 --keyint 30 --open-gop --bff --colo<br>rprim "smpte170m" --transfer "smpte170m" --colormatrix "smpte170m" --sar 40:33<br>--pass 1 -o out.264 ~/test.y4m<br>y4m [info]: 720x480i 8:9 @ 30000/1001 fps (cfr)<br>x264 [warning]: interlace + weightp is not implemented<br>x264 [info]: using SAR=40/33<br>x264 [info]: using cpu capabilities: MMX2 SSE2Slow SlowCTZ UnalignedStack<br>x264 [info]: profile Main, level 3.2<br>x264 [info]: frame I:72 Avg QP:19.93 size: 43843<br>x264 [info]: frame P:561 Avg QP:22.54 size: 19626<br>x264 [info]: frame B:1166 Avg QP:23.99 size: 7613<br>x264 [info]: consecutive B-frames: 5.1% 9.9% 47.0% 38.0%<br>x264 [info]: mb I I16..4: 46.3% 0.0% 53.7%<br>x264 [info]: mb
P I16..4: 38.7% 0.0% 0.0% P16..4: 56.7% 0.0% 0.0% 0.0% 0<br>.0% skip: 4.6%<br>x264 [info]: mb B I16..4: 9.9% 0.0% 0.0% B16..8: 40.6% 0.0% 0.0% direct:<br>25.6% skip:23.8% L0:32.0% L1:41.9% BI:26.1%<br>x264 [info]: final ratefactor: 19.75<br>x264 [info]: field mbs: intra: 14.5% inter:15.0% skip:6.6%<br>x264 [info]: direct mvs spatial:99.8% temporal:0.2%<br>x264 [info]: coded y,uvDC,uvAC intra: 65.3% 92.3% 65.4% inter: 26.5% 58.6% 17.1%</div><div>x264 [info]: i16 v,h,dc,p: 16% 28% 41% 16%<br>x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 24% 23% 4% 8% 4% 6% 5% 10%<br>x264 [info]: i8c dc,h,v,p: 43% 33% 15% 9%<br>x264 [info]: kb/s:3071.10</div><div>encoded 1799 frames, 28.89 fps, 3071.10 kb/s</div><div>real 1m2.495s<br>user
0m0.015s<br>sys 0m0.031s</div><div><a href="mailto:Joseph@jgsnote">Joseph@jgsnote</a> ~/MSVC/bin<br>$<br></div><div><br></div><div>This same difference was robust across a variety of different clips (mostly captured ATSC TV streams and/or DVDs I had laying round).</div><div><br></div><div>I am looking to use x264 linked with a MSVC project, but may avoid it if gcc is this much faster. Note that I don't usually use a Windows/MSVC environment so if I have made a simple mistake somewhere please let me know.</div><div><br></div><div>Regards,</div><div><br></div><div>Joe</div></div></body></html>