[x264-devel] Bug (or bugs) in x264 rev 2334 OpenCL and one improvement proposal.

Nihil nihil at nihil.nu
Tue Jun 11 10:53:56 CEST 2013


I'm sorry that I can't provide dumps or debug traces of what happens. 
I'm also sorry about the fact that I haven't tested out every possible 
commandline variation.

I downloaded precompiled 32bit Windows executable from x264.nl.

x264 executable: 8bit-depth 32bit Windows

Test system: 32bit Windows XP, nVidia GFX 670 driver 320.18 WHQL

Test video: 1920*1200 Fraps v3.5.9.15586 AVI

Problems:

Using parameters

-p 1
-p 2
-p 3

Fast "indexing input file"

NO -p options

Slow "indexing input file"

-------------------------------------------------------------

-p 1 | OpenCL acceleration enabled - Works
-p 2 | OpenCL not enabled
-p 3 | OpenCL not enabled

NO -p options | OpenCL acceleration enabled - But fails

-------------------------------------------------------------

x264_2334.exe -I 150 -b 100 --b-adapt 2 -B 4000 -m 10 -t 2 --direct auto 
--me esa --merange 24 --partitions all --ref 16 --rc-lookahead 60 
--threads 8 --opencl --qpmin 5 --log-level debug -o test.flv test_enc.avi

ffms [info]: 1920x1200p 0:1 @ 15/1 fps (vfr)
x264 [debug]: using mv_range_thread = 72
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
x264 [info]: OpenCL acceleration enabled with NVIDIA Corporation GeForce 
GTX 670
x264 [info]: profile High, level 5.1
x264 [debug]: frame=   0 QP=12.42 NAL=3 Slice:I Poc:0   I:9000 P:0 
SKIP:0    size=1023133 bytes
flv [info]: initial delay 133 ms
x264 [debug]: frame=   1 QP=15.73 NAL=2 Slice:P Poc:10  I:10   P:1756 
SKIP:7234 size=111586 bytes
x264 [debug]: frame=   2 QP=22.61 NAL=2 Slice:B Poc:6   I:6    P:1200 
SKIP:7615 size=19476 bytes
x264 [debug]: frame=   3 QP=22.41 NAL=0 Slice:B Poc:2   I:1    P:1036 
SKIP:7779 size=12854 bytes
x264 [debug]: frame=   4 QP=22.92 NAL=0 Slice:B Poc:4   I:0    P:1209 
SKIP:7549 size=10635 bytes
x264 [debug]: frame=   5 QP=22.96 NAL=0 Slice:B Poc:8   I:0    P:617 
SKIP:8092 size=7375 bytes
x264 [debug]: frame=   6 QP=15.31 NAL=2 Slice:P Poc:16  I:7    P:1687 
SKIP:7306 size=85615 bytes
x264 [debug]: frame=   7 QP=22.42 NAL=2 Slice:B Poc:14  I:0    P:980 
SKIP:7798 size=8859 bytes
x264 [debug]: frame=   8 QP=22.75 NAL=0 Slice:B Poc:12  I:3    P:1003 
SKIP:7808 size=8233 bytes
x264 [debug]: frame=   9 QP=25.37 NAL=2 Slice:P Poc:28  I:7    P:731 
SKIP:8262 size=19342 bytes
x264 [debug]: frame=  10 QP=22.77 NAL=2 Slice:B Poc:22  I:6    P:762 
SKIP:8061 size=17575 bytes
x264 [error]: malloc of size 10031104 failed
x264 [error]: x264_encoder_encode failed
x264 [info]: frame I:1     Avg QP:12.42  size:1023133
x264 [info]: frame P:3     Avg QP:18.80  size: 72181
x264 [info]: frame B:7     Avg QP:22.69  size: 12144
x264 [info]: consecutive B-frames:  6.7%  0.0% 20.0%  0.0% 33.3% 40.0% 
0.0%  0.0%  0.0%  0.0%  0.0%  0.0%  0.0%  0.0%  0.0%  0.0%  0.0%
x264 [info]: mb I  I16..4:  1.0% 36.5% 62.5%
x264 [info]: mb P  I16..4:  0.0%  0.0%  0.1%  P16..4:  7.0%  1.0%  2.9% 
  2.3%  2.1%    skip:84.5%
x264 [info]: mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  8.2%  1.4%  1.5% 
  direct: 2.1%  skip:86.8%  L0:17.7% L1:47.5% BI:34.9%
x264 [info]: final ratefactor: 26.73
x264 [info]: 8x8 transform intra:36.3% inter:5.8%
x264 [info]: direct mvs  spatial:28.6% temporal:71.4%
x264 [info]: coded y,uvDC,uvAC intra: 99.9% 99.4% 98.7% inter: 6.2% 3.8% 
3.3%
x264 [info]: i16 v,h,dc,p: 26% 33% 23% 18%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 17% 13% 10%  6%  5%  5% 
14% 18%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 13%  8% 10% 10%  9% 10% 
12% 15%
x264 [info]: i8c dc,h,v,p: 61% 16% 10% 12%
x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x264 [info]: ref P L0: 83.1%  6.0%  5.4%  4.2%  0.7%  0.6%
x264 [info]: ref B L0: 94.3%  0.9%  4.5%  0.2%  0.2%
x264 [info]: ref B L1: 91.7%  8.3%
x264 [info]: kb/s:14451.09

aborted at input frame 101, output frame 11
encoded 11 frames, 0.90 fps, 15905.30 kb/s

-------------------------------------------------------------

x264_2334.exe -I 150 -b 100 --b-adapt 2 -B 4000 -m 10 -t 2 --direct auto 
--me esa --merange 24 --partitions all --ref 16 --rc-lookahead 60 
--threads 8 --opencl -p 1 --qpmin 5 --log-level debug -o test.flv 
test_enc.avi

ffms [info]: 1920x1200p 0:1 @ 15/1 fps (vfr)
x264 [debug]: using mv_range_thread = 72
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
x264 [info]: OpenCL acceleration enabled with NVIDIA Corporation GeForce 
GTX 670
x264 [info]: profile Main, level 5.0
x264 [debug]: frame=   0 QP=11.98 NAL=3 Slice:I Poc:0   I:9000 P:0 
SKIP:0    size=995889 bytes
flv [info]: initial delay 133 ms
x264 [debug]: frame=   1 QP=13.11 NAL=2 Slice:P Poc:10  I:19   P:2040 
SKIP:6941 size=116963 bytes
x264 [debug]: frame=   2 QP=21.84 NAL=2 Slice:B Poc:6   I:3    P:1082 
SKIP:7915 size=21275 bytes

x264 [debug]: frame= 253 QP=38.22 NAL=0 Slice:B Poc:202 I:0    P:19 
SKIP:8981 size=169 bytes
x264 [debug]: frame= 254 QP=37.94 NAL=0 Slice:B Poc:206 I:0    P:16 
SKIP:8984 size=136 bytes
x264 [info]: frame I:2     Avg QP:21.36  size:575161
x264 [info]: frame P:122   Avg QP:33.86  size: 39450
x264 [info]: frame B:131   Avg QP:36.15  size: 16157
x264 [info]: consecutive B-frames: 27.1% 11.8% 23.5% 18.8%  5.9%  9.4% 
0.0%  0.0%  3.5%  0.0%  0.0%  0.0%  0.0%  0.0%  0.0%  0.0%  0.0%
x264 [info]: mb I  I16..4: 21.8%  0.0% 78.2%
x264 [info]: mb P  I16..4: 24.8%  0.0%  0.0%  P16..4: 40.2%  0.0%  0.0% 
  0.0%  0.0%    skip:35.0%
x264 [info]: mb B  I16..4:  7.7%  0.0%  0.0%  B16..8: 21.6%  0.0%  0.0% 
  direct: 5.5%  skip:65.3%  L0:42.3% L1:49.4% BI: 8.3%
x264 [info]: final ratefactor: 30.27
x264 [info]: direct mvs  spatial:96.2% temporal:3.8%
x264 [info]: coded y,uvDC,uvAC intra: 46.0% 44.2% 17.7% inter: 10.3% 
9.2% 0.8%
x264 [info]: i16 v,h,dc,p: 24% 26% 35% 15%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 18% 12%  9%  8%  8%  8% 
10% 12%
x264 [info]: i8c dc,h,v,p: 67% 17% 12%  3%
x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x264 [info]: kb/s:3802.26

encoded 255 frames, 13.16 fps, 3802.61 kb/s

-------------------------------------------------------------

Bug fix(es):

Malloc fail.

Support --opencl with all encode options -p 1, -p 2, -p 3 and no -p (-p 
2 and -p 3 not using OpenCL could be a bug or improvement proposal don't 
know which one) and with all profiles (profile Main, level 5.0 | profile 
High, level 5.1 | etc).

-------------------------------------------------------------

Another improvement:

Add commandline option for storing ffms file index. I deal with large 
static files (not using AviSynth or some such) and when doing "Nth pass" 
a lot of time is wasted. It would be nice if file index could be saved 
in same manner as x264_lookahead.clbin x264_2pass.log 
x264_2pass.log.mbtree files so file indexing needs to be done only once.


More information about the x264-devel mailing list