[x264-devel] MSVC patch test results under MSVC 2013

Joe Stevens jgsteven at yahoo.com
Mon Mar 24 11:05:50 CET 2014


All,

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:

1. Compilation:

[output with default 'configure' results]
cl -DNDEBUG -O2 -W0 -I. -I. -nologo -DHAVE_STRING_H -I./extras  -c -Foinput/avs.
o input/avs.c
avs.c
input/avs.c(383) : error C2275: 'AVS_VideoFrame' : illegal use of this type as a
n expression
        .\extras/avisynth_c.h(390) : see declaration of 'AVS_VideoFrame'
input/avs.c(383) : error C2065: 'frm' : undeclared identifier
input/avs.c(389) : error C2065: 'frm' : undeclared identifier
input/avs.c(390) : error C2065: 'frm' : undeclared identifier
make: *** [input/avs.o] Error 2
[output with --disable-avs]
cl -DNDEBUG -O2 -W0 -I. -I. -nologo -DHAVE_STRING_H -I./extras  -c -Focommon/ope
ncl.o common/opencl.c
opencl.c
common/opencl.c(129) : error C2275: 'x264_opencl_function_t' : illegal use of th
is type as an expression
        c:\mingw\msys\1.0\home\joseph\x264-snapshot-20140322-2245\common\opencl.
h(709) : see declaration of 'x264_opencl_function_t'
common/opencl.c(129) : error C2065: 'ocl' : undeclared identifier
common/opencl.c(158) : error C2065: 'ocl' : undeclared identifier
common/opencl.c(158) : error C2223: left of '->clCreateProgramWithBinary' must p
oint to struct/union
make: *** [common/opencl.o] Error 2
Note that everything compiles and runs fine with --disable-opencl and --disable-avs both enabled.

2. Speed

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:

[GCC]
Joseph at jgsnote ~/GCC/bin
$ time x264 --bitrate 3000 --preset veryslow --tune film --bluray-compat --vbv-
maxrate 8000 --vbv-bufsize 8000 --level 3.2 --keyint 30 --open-gop --bff --colo
rprim "smpte170m" --transfer "smpte170m" --colormatrix "smpte170m" --sar 40:33
--pass 1 -o out.264 ~/test.y4m
y4m [info]: 720x480i 8:9 @ 30000/1001 fps (cfr)
x264 [warning]: interlace + weightp is not implemented
x264 [info]: using SAR=40/33
x264 [info]: using cpu capabilities: MMX2 SSE2Slow SlowCTZ
x264 [info]: profile Main, level 3.2
x264 [info]: frame I:72    Avg QP:19.93  size: 43843
x264 [info]: frame P:561   Avg QP:22.54  size: 19626
x264 [info]: frame B:1166  Avg QP:23.99  size:  7613
x264 [info]: consecutive B-frames:  5.1%  9.9% 47.0% 38.0%
x264 [info]: mb I  I16..4: 46.3%  0.0% 53.7%
x264 [info]: mb P  I16..4: 38.7%  0.0%  0.0%  P16..4: 56.7%  0.0%  0.0%  0.0%  0
.0%    skip: 4.6%
x264 [info]: mb B  I16..4:  9.9%  0.0%  0.0%  B16..8: 40.6%  0.0%  0.0%  direct:
25.6%  skip:23.8%  L0:32.0% L1:41.9% BI:26.1%
x264 [info]: final ratefactor: 19.75
x264 [info]: field mbs: intra: 14.5% inter:15.0% skip:6.6%
x264 [info]: direct mvs  spatial:99.8% temporal:0.2%
x264 [info]: coded y,uvDC,uvAC intra: 65.3% 92.3% 65.4% inter: 26.5% 58.6% 17.1%
x264 [info]: i16 v,h,dc,p: 16% 28% 41% 16%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 24% 23%  4%  8%  4%  6%  5% 10%
x264 [info]: i8c dc,h,v,p: 43% 33% 15%  9%
x264 [info]: kb/s:3071.10
encoded 1799 frames, 35.45 fps, 3071.10 kb/s
real    0m50.952s
user    0m0.000s
sys     0m0.047s

[MSVC]
Joseph at jgsnote ~/MSVC/bin
$ time x264 --bitrate 3000 --preset veryslow --tune film --bluray-compat --vbv-
maxrate 8000 --vbv-bufsize 8000 --level 3.2 --keyint 30 --open-gop --bff --colo
rprim "smpte170m" --transfer "smpte170m" --colormatrix "smpte170m" --sar 40:33
--pass 1 -o out.264 ~/test.y4m
y4m [info]: 720x480i 8:9 @ 30000/1001 fps (cfr)
x264 [warning]: interlace + weightp is not implemented
x264 [info]: using SAR=40/33
x264 [info]: using cpu capabilities: MMX2 SSE2Slow SlowCTZ UnalignedStack
x264 [info]: profile Main, level 3.2
x264 [info]: frame I:72    Avg QP:19.93  size: 43843
x264 [info]: frame P:561   Avg QP:22.54  size: 19626
x264 [info]: frame B:1166  Avg QP:23.99  size:  7613
x264 [info]: consecutive B-frames:  5.1%  9.9% 47.0% 38.0%
x264 [info]: mb I  I16..4: 46.3%  0.0% 53.7%
x264 [info]: mb P  I16..4: 38.7%  0.0%  0.0%  P16..4: 56.7%  0.0%  0.0%  0.0%  0
.0%    skip: 4.6%
x264 [info]: mb B  I16..4:  9.9%  0.0%  0.0%  B16..8: 40.6%  0.0%  0.0%  direct:
25.6%  skip:23.8%  L0:32.0% L1:41.9% BI:26.1%
x264 [info]: final ratefactor: 19.75
x264 [info]: field mbs: intra: 14.5% inter:15.0% skip:6.6%
x264 [info]: direct mvs  spatial:99.8% temporal:0.2%
x264 [info]: coded y,uvDC,uvAC intra: 65.3% 92.3% 65.4% inter: 26.5% 58.6% 17.1%
x264 [info]: i16 v,h,dc,p: 16% 28% 41% 16%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 24% 23%  4%  8%  4%  6%  5% 10%
x264 [info]: i8c dc,h,v,p: 43% 33% 15%  9%
x264 [info]: kb/s:3071.10
encoded 1799 frames, 28.89 fps, 3071.10 kb/s
real    1m2.495s
user    0m0.015s
sys     0m0.031s
Joseph at jgsnote ~/MSVC/bin
$


This same difference was robust across a variety of different clips (mostly captured ATSC TV streams and/or DVDs I had laying round).

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.

Regards,

Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20140324/0a7d9d52/attachment.html>


More information about the x264-devel mailing list