『漫游』酷论坛>『影音数码技术学习交流』>[聊天]x264的线程数对 ..

[聊天]x264的线程数对质量的影响

zjhray@2009-03-29 21:01

一线程
---[NoImage] x264 [info]: slice I:436 Avg QP:13.99 size: 44840
---[NoImage] x264 [info]: slice P:31941 Avg QP:16.88 size: 7993
---[NoImage] x264 [info]: slice B:2746 Avg QP:15.17 size: 920
---1514.91 kb/s

多线程
---[NoImage] x264 [info]: slice I:433 Avg QP:16.28 size: 37596
---[NoImage] x264 [info]: slice P:16761 Avg QP:18.64 size: 12729
---[NoImage] x264 [info]: slice B:17929 Avg QP:19.93 size: 2418
---1490.85 kb/s

相同参数用crf21压的,很奇怪的是连P、B帧的数量都不一样,而且一线程在质量上明显好太多。看来x264在多线程的优化上还有很长的路要走。
引用

蓝の回忆@2009-03-29 21:20

B桢怎么差了有9倍?
引用

kircheis@2009-03-29 21:22

求2pass试验
引用

hs987654321@2009-03-29 23:06

其他都用的什么参数?
引用

kkk60091@2009-03-30 03:58

嘛,拖了个ripbot+ 1个1080p vc-1 mkv 片段, 弄了几个data。

mediainfo查看的参数
cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=crf / crf=21.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / vbv_maxrate=25000 / vbv_bufsize=25000 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

CQ= 21, thread = 12时:

264 [info]: slice I:7 Avg QP:15.21 size:155667

x264 [info]: slice P:427 Avg QP:17.87 size: 69838

x264 [info]: slice B:308 Avg QP:20.21 size: 26461

x264 [info]: consecutive B-frames: 30.5% 38.9% 6.1% 24.5%

x264 [info]: mb I I16..4: 5.2% 90.1% 4.7%

x264 [info]: mb P I16..4: 1.8% 16.2% 0.8% P16..4: 48.8% 19.0% 9.4% 0.2% 0.2% skip: 3.5%

x264 [info]: mb B I16..4: 0.3% 1.8% 0.1% B16..8: 46.8% 2.0% 2.9% direct: 8.3% skip:37.8% L0:42.9% L1:45.1% BI:12.0%

x264 [info]: 8x8 transform intra:86.1% inter:71.1%

x264 [info]: direct mvs spatial:97.1% temporal:2.9%

x264 [info]: ref P L0 57.2% 23.5% 19.3%

x264 [info]: ref B L0 75.6% 24.4%

x264 [info]: kb/s:10097.1


CQ 21, thread = 1时

x264 [info]: slice I:8 Avg QP:15.30 size:165971

x264 [info]: slice P:426 Avg QP:17.86 size: 69560

x264 [info]: slice B:308 Avg QP:20.21 size: 26384

x264 [info]: consecutive B-frames: 30.4% 39.0% 6.1% 24.5%

x264 [info]: mb I I16..4: 3.7% 92.0% 4.3%

x264 [info]: mb P I16..4: 1.8% 15.8% 0.8% P16..4: 49.1% 19.1% 9.4% 0.2% 0.2% skip: 3.6%

x264 [info]: mb B I16..4: 0.3% 1.8% 0.1% B16..8: 46.0% 1.9% 2.9% direct: 8.4% skip:38.6% L0:42.3% L1:45.7% BI:12.0%

x264 [info]: 8x8 transform intra:86.1% inter:71.0%

x264 [info]: direct mvs spatial:99.7% temporal:0.3%

x264 [info]: ref P L0 57.1% 23.5% 19.4%

x264 [info]: ref B L0 75.2% 24.8%

x264 [info]: kb/s:10103.9

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


cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=1024 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=25000 / vbv_bufsize=25000 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00


2-pass
threads=12 时

x264 [info]: slice I:7 Avg QP:29.13 size: 24608

x264 [info]: slice P:433 Avg QP:31.79 size: 8424

x264 [info]: slice B:302 Avg QP:32.88 size: 1684

x264 [info]: consecutive B-frames: 32.2% 36.7% 6.5% 24.5%

x264 [info]: mb I I16..4: 23.8% 75.5% 0.7%

x264 [info]: mb P I16..4: 17.9% 0.0% 0.0% P16..4: 21.5% 0.0% 0.0% 0.0% 0.0% skip:60.6%

x264 [info]: mb B I16..4: 0.4% 0.0% 0.0% B16..8: 4.5% 0.0% 0.0% direct: 2.0% skip:93.1% L0:53.1% L1:42.3% BI: 4.6%

x264 [info]: final ratefactor: 34.14

x264 [info]: 8x8 transform intra:6.2% inter:69.2%

x264 [info]: direct mvs spatial:95.0% temporal:5.0%

x264 [info]: ref P L0 63.5% 19.3% 17.2%

x264 [info]: ref B L0 69.2% 30.8%

x264 [info]: kb/s:1118.8



x264 [info]: slice I:7 Avg QP:28.96 size: 24618

x264 [info]: slice P:433 Avg QP:33.37 size: 6980

x264 [info]: slice B:302 Avg QP:33.95 size: 2671

x264 [info]: consecutive B-frames: 32.2% 36.7% 6.5% 24.5%

x264 [info]: mb I I16..4: 48.4% 47.7% 3.8%

x264 [info]: mb P I16..4: 4.4% 3.7% 0.0% P16..4: 24.9% 1.5% 0.9% 0.0% 0.0% skip:64.5%

x264 [info]: mb B I16..4: 0.0% 0.1% 0.0% B16..8: 26.1% 0.1% 0.1% direct: 0.2% skip:73.5% L0:42.0% L1:57.7% BI: 0.3%

x264 [info]: 8x8 transform intra:46.0% inter:95.1%

x264 [info]: direct mvs spatial:88.1% temporal:11.9%

x264 [info]: ref P L0 60.3% 20.9% 18.9%

x264 [info]: ref B L0 72.9% 27.1%

x264 [info]: kb/s:1034.4


2-pass
threads=1 时

x264 [info]: slice I:5 Avg QP:28.98 size: 28514

x264 [info]: slice P:435 Avg QP:31.78 size: 8324

x264 [info]: slice B:302 Avg QP:32.31 size: 1726

x264 [info]: consecutive B-frames: 32.4% 36.6% 6.5% 24.4%

x264 [info]: mb I I16..4: 22.5% 75.6% 1.9%

x264 [info]: mb P I16..4: 17.9% 0.0% 0.0% P16..4: 21.6% 0.0% 0.0% 0.0% 0.0% skip:60.5%

x264 [info]: mb B I16..4: 0.4% 0.0% 0.0% B16..8: 4.6% 0.0% 0.0% direct: 2.1% skip:93.0% L0:52.6% L1:42.6% BI: 4.7%

x264 [info]: final ratefactor: 34.16

x264 [info]: 8x8 transform intra:4.5% inter:68.6%

x264 [info]: direct mvs spatial:96.4% temporal:3.6%

x264 [info]: ref P L0 63.3% 19.5% 17.3%

x264 [info]: ref B L0 70.2% 29.8%

x264 [info]: kb/s:1107.6


x264 [info]: slice I:5 Avg QP:29.34 size: 24512

x264 [info]: slice P:435 Avg QP:33.36 size: 7030

x264 [info]: slice B:302 Avg QP:34.02 size: 2698

x264 [info]: consecutive B-frames: 32.4% 36.6% 6.5% 24.4%

x264 [info]: mb I I16..4: 45.0% 51.0% 4.0%

x264 [info]: mb P I16..4: 4.3% 3.6% 0.0% P16..4: 25.0% 1.5% 1.0% 0.0% 0.0% skip:64.4%

x264 [info]: mb B I16..4: 0.0% 0.1% 0.0% B16..8: 26.4% 0.1% 0.1% direct: 0.2% skip:73.2% L0:40.9% L1:58.8% BI: 0.3%

x264 [info]: 8x8 transform intra:46.3% inter:95.0%

x264 [info]: direct mvs spatial:87.7% temporal:12.3%

x264 [info]: ref P L0 60.1% 20.8% 19.2%

x264 [info]: ref B L0 73.0% 27.0%

x264 [info]: kb/s:1032.7
引用

zjhray@2009-03-30 07:49

我的是--crf 21.0 --ref 8 --mixed-refs --no-fast-pskip --bframes 16 --b-pyramid --weightb --deblock 1:1 --subme 9 --trellis 2 --psy-rd 0.0:0 --partitions all --8x8dct --me umh --merange 20 --thread-input --aq-mode 0 --sar 1:1 --progress --no-psnr --no-ssim --output
楼上的cpu真的能提供12线程,还是说只是‘12线程’
引用

yeyunlong@2009-03-30 08:05

哦 i7?
引用

kkk60091@2009-03-30 08:18

i7 x264 thread auto = 12
引用

zjhray@2009-03-30 09:57

看了1楼的数据,怎么感觉crf的时候12线程还要好于1线程
引用

roozhou@2009-03-30 10:08

楼主用的是最新版吗?
r1120里去掉了pre-scenecut,多线程对frametype decision的影响已经没这么大了。
另外threads auto那个core*1.5的公式并不准确。在我的E8400上,有时候threads 2就能达到100%使用,有时候threads 4才可以,而threads 3只有90%左右。
引用

zjhray@2009-03-30 10:46

应该是r1120以上的版本,用mediainfo也看不到'pre-scenecut'这个参数,倒是我用threads auto时cpu是吃不满的,是不是只要让cpu100%,就不必在意threads=core*1.5这个关系?
引用

zjhray@2009-03-30 12:44

又来了一遍,直接指定12线程,结果成这样了
---[NoImage] x264 [info]: slice I:434 Avg QP:16.43 size: 37106
---[NoImage] x264 [info]: slice P:15861 Avg QP:18.64 size: 13718
---[NoImage] x264 [info]: slice B:18828 Avg QP:20.16 size: 2620
---1545.68 kb/s
难道有bug?我用的是r1128
引用

qiyuwanjia@2009-03-30 16:24

有时候avs的解码瓶颈了,开再多线程不过增加线程同步来占用CPU
还有,并不是显示100占用,实际就是100占用的,可能还有余地,可能还不少。
引用

roozhou@2009-03-30 17:43

我知道的解码端瓶颈有四种可能
1)大幅度降低分辨率,解码器和resizer成为瓶颈(ffdshow里的resizer支持多线程,所以问题不大,但avs里的...)
2)磁盘读取(常见于编码无损图片序列)
3)蛋疼,用些无聊的速度超慢的滤镜
4)犯贱,像素级的用ass写的特效
引用

qiyuwanjia@2009-03-30 19:15

其实DG解mpeg2不加任何其他滤镜都经常瓶颈,DGAVC就更不必说了,也许参数比较低吧
引用

«12»共2页

| TOP