Log in

View Full Version : mbtree vs no-mbtree: better overall quality if mbtree is not used?


Vesdaris
2nd November 2012, 14:42
it probably helps if bitrate is fixed(2pass) and it is quite low, but what about crf encoding 16-17-18?

I did some sample encoding and tbh im kinda confused whether i should use mbtree at all
Encoded from a DVD

Generally I and P frames have lower average QP but B frames get considerably higher with mbtree on.

crf16, mbtreee off, => bitrate 1060
[NoImage] x264 [info]: frame I:57 Avg QP:13.66 size: 40504
-[NoImage] x264 [info]: frame P:627 Avg QP:15.42 size: 10158
-[NoImage] x264 [info]: frame B:1827 Avg QP:18.15 size: 2529
-[NoImage] x264 [info]: consecutive B-frames: 3.3% 3.7% 20.4% 32.5% 15.7% 21.3% 1.7% 1.0% 0.4%
-[NoImage] x264 [info]: mb I I16..4: 13.6% 47.6% 38.8%
-[NoImage] x264 [info]: mb P I16..4: 1.2% 8.1% 2.3% P16..4: 22.5% 22.0% 16.4% 5.5% 1.6% skip:20.3%
-[NoImage] x264 [info]: mb B I16..4: 0.1% 0.9% 0.2% B16..8: 23.4% 14.6% 3.0% direct: 4.6% skip:53.1% L0:32.7% L1:45.5% BI:21.8%
-[NoImage] x264 [info]: 8x8 transform intra:62.4% inter:41.0%
-[NoImage] x264 [info]: direct mvs spatial:99.6% temporal:0.4%
-[NoImage] x264 [info]: coded y,uvDC,uvAC intra: 88.2% 83.7% 72.1% inter: 15.7% 11.1% 4.1%
-[NoImage] x264 [info]: i16 v,h,dc,p: 40% 10% 22% 29%
-[NoImage] x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 14% 16% 7% 7% 8% 8% 10% 12%
-[NoImage] x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 13% 10% 8% 11% 11% 10% 9% 10%
-[NoImage] x264 [info]: i8c dc,h,v,p: 38% 29% 22% 12%
-[NoImage] x264 [info]: Weighted P-Frames: Y:93.6% UV:0.2%
-[NoImage] x264 [info]: ref P L0: 59.7% 10.1% 15.7% 4.5% 3.4% 2.6% 2.2% 1.4% 0.4%
-[NoImage] x264 [info]: ref B L0: 85.6% 8.5% 3.0% 1.4% 0.8% 0.5% 0.3%
-[NoImage] x264 [info]: ref B L1: 94.7% 5.3%
-[NoImage] x264 [info]: kb/s:1059.17
-[NoImage] encoded 2511 frames, 41.61 fps, 1059.24 kb/s, 12.68 MB

2pass,mbtree on, fixed 1060 bitrate(based on previous results)

-[NoImage] x264 [info]: frame I:57 Avg QP:11.74 size: 50892
-[NoImage] x264 [info]: frame P:626 Avg QP:16.00 size: 10231
-[NoImage] x264 [info]: frame B:1828 Avg QP:21.28 size: 2190
-[NoImage] x264 [info]: consecutive B-frames: 3.3% 3.7% 20.3% 32.5% 15.9% 21.3% 1.7% 1.0% 0.4%
-[NoImage] x264 [info]: mb I I16..4: 14.8% 43.6% 41.5%
-[NoImage] x264 [info]: mb P I16..4: 0.8% 7.3% 2.0% P16..4: 22.3% 21.1% 15.6% 5.3% 1.7% skip:23.9%
-[NoImage] x264 [info]: mb B I16..4: 0.1% 0.9% 0.2% B16..8: 23.8% 12.1% 2.2% direct: 3.4% skip:57.3% L0:35.7% L1:43.3% BI:21.0%
-[NoImage] x264 [info]: 8x8 transform intra:61.2% inter:44.0%
-[NoImage] x264 [info]: direct mvs spatial:97.1% temporal:2.9%
-[NoImage] x264 [info]: coded y,uvDC,uvAC intra: 87.4% 84.2% 72.0% inter: 13.6% 9.5% 3.7%
-[NoImage] x264 [info]: i16 v,h,dc,p: 43% 9% 17% 30%
-[NoImage] x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 14% 14% 7% 8% 9% 8% 11% 12%
-[NoImage] x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 13% 9% 8% 11% 11% 10% 10% 10%
-[NoImage] x264 [info]: i8c dc,h,v,p: 41% 27% 21% 12%
-[NoImage] x264 [info]: Weighted P-Frames: Y:25.1% UV:0.2%
-[NoImage] x264 [info]: ref P L0: 59.2% 12.4% 12.6% 5.9% 3.8% 2.8% 2.0% 1.2% 0.2%
-[NoImage] x264 [info]: ref B L0: 86.1% 8.3% 3.0% 1.2% 0.8% 0.4% 0.2%
-[NoImage] x264 [info]: ref B L1: 95.2% 4.8%
-[NoImage] x264 [info]: kb/s:1060.01
-[NoImage] encoded 2511 frames, 43.96 fps, 1060.08 kb/s, 12.69 MB



crf 17, mbtree off => bitrate 900Kbps(
average Qp's are better than with2pass 1060+mbtree on)


-[NoImage] x264 [info]: frame I:57 Avg QP:14.71 size: 36482
-[NoImage] x264 [info]: frame P:627 Avg QP:16.50 size: 8542
-[NoImage] x264 [info]: frame B:1827 Avg QP:19.56 size: 2117
-[NoImage] x264 [info]: consecutive B-frames: 3.3% 3.7% 20.4% 32.5% 15.7% 21.3% 1.7% 1.0% 0.4%
-[NoImage] x264 [info]: mb I I16..4: 12.6% 51.2% 36.1%
-[NoImage] x264 [info]: mb P I16..4: 0.8% 7.5% 1.9% P16..4: 23.9% 23.3% 14.8% 4.4% 1.2% skip:22.2%
-[NoImage] x264 [info]: mb B I16..4: 0.1% 0.8% 0.2% B16..8: 24.0% 13.4% 2.4% direct: 3.7% skip:55.4% L0:32.9% L1:46.9% BI:20.2%
-[NoImage] x264 [info]: 8x8 transform intra:64.7% inter:45.1%
-[NoImage] x264 [info]: direct mvs spatial:99.6% temporal:0.4%
-[NoImage] x264 [info]: coded y,uvDC,uvAC intra: 86.7% 82.2% 67.3% inter: 13.6% 9.4% 2.9%
-[NoImage] x264 [info]: i16 v,h,dc,p: 36% 10% 23% 31%
-[NoImage] x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 13% 14% 7% 8% 9% 9% 11% 12%
-[NoImage] x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 13% 9% 8% 11% 11% 10% 10% 10%
-[NoImage] x264 [info]: i8c dc,h,v,p: 35% 30% 22% 12%
-[NoImage] x264 [info]: Weighted P-Frames: Y:93.6% UV:0.2%
-[NoImage] x264 [info]: ref P L0: 59.3% 10.4% 15.7% 4.5% 3.4% 2.6% 2.2% 1.4% 0.4%
-[NoImage] x264 [info]: ref B L0: 85.6% 8.3% 3.1% 1.4% 0.8% 0.5% 0.3%
-[NoImage] x264 [info]: ref B L1: 94.7% 5.3%
-[NoImage] x264 [info]: kb/s:900.28
-[NoImage] encoded 2511 frames, 43.30 fps, 900.35 kb/s, 10.78 MB
-[NoImage] x264 [info]: ended at Fri Nov 02 04:33:24 2012
-[NoImage] x264 [info]: encoding duration 0:00:58[/spoiler]

full length movie, crf 16, mbtree off

[NoImage] x264 [info]: profile High, level 4.1
-[NoImage] x264 [info]: cabac=1 ref=8 deblock=1:-3:-3 analyse=0x3:0x133 me=umh subme=11 psy=1 fade_compensate=0.00 psy_rd=1.00:0.15 mixed_ref=1 me_range=32 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=-3 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 fgo=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=16.0000 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 pb_ratio=1.30 aq=1 aq-strength=1.00 aq-sensitivity=10.00 aq-ifactor=1.00 aq-pfactor=1.00 aq-bfactor=1.00 aq2=0
-[NoImage] x264 [info]: started at Fri Nov 02 04:39:29 2012
-[NoImage]
[b]-[NoImage] x264 [info]: frame I:959 Avg QP:13.37 size: 35591
-[NoImage] x264 [info]: frame P:34361 Avg QP:15.04 size: 10854
-[NoImage] x264 [info]: frame B:106191 Avg QP:17.59 size: 2828
-[NoImage] x264 [info]: consecutive B-frames: 1.5% 2.6% 17.5% 34.3% 14.5% 25.2% 2.6% 0.8% 0.9%
-[NoImage] x264 [info]: mb I I16..4: 12.5% 54.2% 33.3%
-[NoImage] x264 [info]: mb P I16..4: 1.2% 9.0% 2.4% P16..4: 24.0% 24.4% 16.5% 5.5% 1.3% skip:15.7%
-[NoImage] x264 [info]: mb B I16..4: 0.2% 1.2% 0.2% B16..8: 24.8% 16.4% 3.4% direct: 5.2% skip:48.7% L0:33.6% L1:43.8% BI:22.5%
-[NoImage] x264 [info]: 8x8 transform intra:69.8% inter:40.6%
-[NoImage] x264 [info]: direct mvs spatial:99.8% temporal:0.2%
-[NoImage] x264 [info]: coded y,uvDC,uvAC intra: 86.7% 81.1% 65.4% inter: 17.5% 12.1% 4.3%
-[NoImage] x264 [info]: i16 v,h,dc,p: 36% 10% 20% 34%
-[NoImage] x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 14% 17% 6% 7% 9% 8% 10% 12%
-[NoImage] x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 11% 14% 7% 12% 12% 10% 9% 9%
-[NoImage] x264 [info]: i8c dc,h,v,p: 37% 30% 21% 13%
-[NoImage] x264 [info]: Weighted P-Frames: Y:97.7% UV:0.5%
-[NoImage] x264 [info]: ref P L0: 54.2% 10.8% 16.2% 4.9% 4.3% 3.5% 3.2% 2.3% 0.6% 0.0%
-[NoImage] x264 [info]: ref B L0: 83.8% 9.2% 3.2% 1.5% 1.1% 0.7% 0.4%
-[NoImage] x264 [info]: ref B L1: 94.5% 5.5%
-[NoImage] x264 [info]: kb/s:999.79
-[NoImage] encoded 141511 frames, 39.34 fps, 999.79 kb/s, 674.64 MB

full length movie, crf16 , mbtree on

[NoImage] x264 [info]: cabac=1 ref=8 deblock=1:-3:-3 analyse=0x3:0x133 me=umh subme=11 psy=1 fade_compensate=0.00 psy_rd=1.00:0.15 mixed_ref=1 me_range=32 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=-3 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 fgo=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=200 rc=crf mbtree=1 crf=16.0000 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1 aq-strength=1.00 aq-sensitivity=10.00 aq-ifactor=1.00 aq-pfactor=1.00 aq-bfactor=1.00 aq2=0
-[NoImage] x264 [info]: started at Fri Nov 02 05:39:28 2012
-[NoImage]
-[NoImage] x264 [info]: frame I:959 Avg QP:11.67 size: 44917
-[NoImage] x264 [info]: frame P:34415 Avg QP:15.71 size: 10478
-[NoImage] x264 [info]: frame B:106137 Avg QP:22.26 size: 1859
-[NoImage] x264 [info]: consecutive B-frames: 1.6% 2.7% 17.5% 34.3% 14.5% 25.3% 2.5% 0.7% 1.0%
-[NoImage] x264 [info]: mb I I16..4: 13.5% 49.9% 36.6%
-[NoImage] x264 [info]: mb P I16..4: 0.9% 7.5% 1.7% P16..4: 24.9% 24.6% 16.4% 5.4% 1.6% skip:17.0%
-[NoImage] x264 [info]: mb B I16..4: 0.1% 0.9% 0.1% B16..8: 26.2% 11.9% 2.0% direct: 2.8% skip:55.9% L0:35.5% L1:45.2% BI:19.3%
-[NoImage] x264 [info]: 8x8 transform intra:71.4% inter:45.0%
-[NoImage] x264 [info]: direct mvs spatial:99.8% temporal:0.2%
-[NoImage] x264 [info]: coded y,uvDC,uvAC intra: 83.5% 79.2% 56.3% inter: 13.7% 9.5% 3.4%
-[NoImage] x264 [info]: i16 v,h,dc,p: 37% 10% 11% 42%
-[NoImage] x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 13% 12% 7% 9% 10% 9% 11% 13%
-[NoImage] x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 11% 10% 7% 12% 12% 10% 10% 10%
-[NoImage] x264 [info]: i8c dc,h,v,p: 36% 28% 22% 15%
-[NoImage] x264 [info]: Weighted P-Frames: Y:97.9% UV:0.5%
-[NoImage] x264 [info]: ref P L0: 53.8% 10.7% 15.6% 5.3% 4.3% 3.8% 3.4% 2.5% 0.7% 0.0%
-[NoImage] x264 [info]: ref B L0: 85.7% 7.6% 3.1% 1.4% 1.1% 0.7% 0.4%
-[NoImage] x264 [info]: ref B L1: 94.5% 5.5%
-[NoImage] x264 [info]: kb/s:849.33
-[NoImage] encoded 141511 frames, 42.52 fps, 849.33 kb/s, 573.11 MB

the_weirdo
2nd November 2012, 14:55
Did you actually compare visually those encoded videos with mbtree on and off?

Vesdaris
2nd November 2012, 15:06
I did. Not thoroughly, of course, as i dont have time to watch through the whole encoded movie. its hard to say at these bitrates whether there is a difference or not, but if i don't have intention of saving quite insignificant number of bitrate in favor of smaller size i dont see what else mbtree can bring to the table.Unless im missing something.
I realize that numbers are numbers and visual control is preferable but it seems like a good idea to play it safe,even if we speak only about pure numbers justification., and especially if i dont particularly care whether encoded movie size is a bit larger due to slightly increased bitrate.

Dark Shikari
2nd November 2012, 17:28
Quantizer and quality are not the same thing, and using quantizers as a judge of quality is a terrible idea. If you're going to use arbitrary metrics to measure quality, you should at least use PSNR or SSIM.

Keep in mind that your mbtree encode is 15% smaller, and you cannot assume two encodes at the same CRF are "the same quality" if you're using dramatically different encoding settings on them. Like any other encoding setting, macroblock-tree changes x264's internal definition of "quality", so the same CRF doesn't mean the same thing, and turning it off may result in somewhat higher or lower bitrate on any given video.

Vesdaris
2nd November 2012, 19:52
Keep in mind that your mbtree encode is 15% smaller, and you cannot assume two encodes at the same CRF are "the same quality" if you're using dramatically different encoding settings on them

Mostly I was comparing crf encode( mbtree turned off,1060Kbps) with 2pass encode (same settings, mbtree turned on,1060Kbps). why such a difference in QP? Im worried about B frames

afaik B frames >=22-23+ is not a very good idea. And it looks like turned on mbtree just screws with my more or less precise expectations(generally i get what i aim at with crf) related to crf values (16-17-18) forcing me to reduce them below certain points(say16.)

Dark Shikari
2nd November 2012, 20:52
Mostly I was comparing crf encode( mbtree turned off,1060Kbps) with 2pass encode (same settings, mbtree turned on,1060Kbps). why such a difference in QP? Im worried about B frames

afaik B frames >=22-23+ is not a very good idea.MB-tree has adaptive B-frame quantization; it will tend to use higher QPs (relative to P-frames) when in low-complexity scenes and lower QPs in higher-complexity scenes. Without MB-tree, it uses the same quantizer offset everywhere, which will look significantly worse than P-frames in noisy/high-motion scenes (possibly creating flickering), and possibly be wasteful in low-motion scenes.

If you don't see specific problems in the video, micromanaging the quantizers is probably not a good idea. I also have no idea where the concept of certain average quantizers being a "bad idea" came from; if it looks good, why does it matter?

Chirico
2nd November 2012, 21:27
If you don't see specific problems in the video, micromanaging the quantizers is probably not a good idea.


Some people seem to spend more time frame-stepping through videos rather than just watching them.

I also have no idea where the concept of certain average quantizers being a "bad idea" came from; if it looks good, why does it matter?

Heard it from a guy who heard it from a guy, probably.

nibus
2nd November 2012, 22:35
Mbtree is usually a good idea, simply because it is more efficient. It helps to allocate bits to the more detailed areas of the screen. However sometimes you might notice that flat areas and gradients suffer a bit because of it. Try experimenting with AQ and PSY to counteract this before disabling mbtree altogether.

If you compared the two results thoroughly you would probably find that the sample with mbtree enabled preserved fine detail better and was overall sharper, while the sample with mbtree disabled would have better preserved gradients. Scenes with fast movement and action will also look worse without mbtree, like DS said. I suppose you could leave mbtree disabled and then increase qcomp to compensate for this, but you're probably better off just leaving it on.

mandarinka
3rd November 2012, 00:38
Some people seem to spend more time frame-stepping through videos rather than just watching them.

Just by watching the video, you can't really evaluate the amount of compression loss/ugliness/efficiency (whatever we want to call it) beyond some rather basic level. Comparing frames isn't really sure and easy way either, but if you want to see the effects of compression, you basically have no other choice.

Chirico
3rd November 2012, 01:17
Just by watching the video, you can't really evaluate the amount of compression loss/ugliness/efficiency (whatever we want to call it) beyond some rather basic level. Comparing frames isn't really sure and easy way either, but if you want to see the effects of compression, you basically have no other choice.

Yet if you can't see any issues while actually playing it why does it matter if you can see something when frame-stepping? Seems to be a total waste of time to be constantly tweaking your encodes for things you can only see when frame-stepping and not when actually watching it. But it's not my time being wasted.

gyth
3rd November 2012, 23:35
Weighted P-Frames: Y:97.9% UV:0.5%
I'm curious; what movie?
Does that mean it is nothing but fades???

mandarinka
4th November 2012, 00:01
Yet if you can't see any issues while actually playing it why does it matter if you can see something when frame-stepping? Seems to be a total waste of time to be constantly tweaking your encodes for things you can only see when frame-stepping and not when actually watching it. But it's not my time being wasted.

Stuff you can't see here and now can become visible if for example... you get a better screen, change contrast setting, get glasses...

We are not discussing individual encodes anyway, we care about compression in general. If the manual inspecting gives you more reliable settings (even at the cost of higher bitrates), you can then use those in the future with higher confidence - and thus limit the amount of manual checking (or even just trying to check during watching) needed for later encodes.

Vesdaris
4th November 2012, 01:23
I'm curious; what movie?
Does that mean it is nothing but fades???

I wouldnt say that.
http://www.imdb.com/title/tt1625150/