Video Compression

VideoNerd

Introduction

The idea of CTU-tree (cutree mode) is as follows:

a block is more important if it is referenced by many other blocks, i.e. has many ancestors in the graph (or in the tree). 

cutree makes sense if the lookahead is enabled, otherwise we can’t know ahead how much a given block is referenced in next frames.  Strongly referenced blocks are quantized finer, and poorly reference blocks are quantized coarsely.

For more details i recommend to read the paper the paper “Evaluating the CU-tree algorithm in an HEVC encoder” by Vladimir Grozman.

For evaluation of cutree mode we apply x265 (in ABR mode) on two 4K streams – Sintel (3840×1744, 24 fps) and TOS (3840×1712, 24 fps), with the lookahead buffer size 5 frames, with two different bitrates 30Mbps and 20Mbps.

Notice that x265 does not allow lookahead buffer smaller or equal to the number of consecutive B-frames. Therefore, the minimal lookahead length is equal to 3, since up to 2 successive B-frames are utilized in our evaluation. If the lookahead is disabled (‘–rc-lookahead 0’)

Sintel:

 

 

TOS

 

 

X265 Configuration

All streams are coded with the following fixed parameters:

max CU size = 64, min CU size =  8

max TU size = 32, TU depth = 1 (for both inter and intra)

ME algo = hex, ME range (–merange) = 57, subpel mode (–subme) = 2 (one half-pel iteration in 4 directions, one quarter-pel iteration in 4 directions) ,

maximal number of candidate  MVs in merge/skip mode = 2 (–merge 2)

scenecut = 0    (no scene cut detection)

Gop size = 30 frames

bframes = 2 (IPBBPBB..),  badapt  = yes (B frame can be replaced with P frame), no b-pyramid (i.e. B frames are not used for reference)

refs = 2   (two reference frames)

signhide = yes

tmvp = yes  (temporal motion vector prediction enabled, but with ‘–merge 2’ it impact is expected to be ngeligible)

strong-intra-smoothing = yes (since 32×32 TU used)

deblock, sao = yes

 

Results (PSNR)

Notes:

  • In case of cutree=off, the lookahead buffer length does not impact on quality
  • PSNR is not a good metric to compare the cutree mode, it’s better to use more HVS-correlated metric like VMAF.

 

Sintel, cutree = OFF 

Lookahead Target Bitrate   30 Mbps  Target Bitrate  20 Mbps
5 frames  

PSNR: 44.574

actual bitrate: 37.8 Mbps

 

PSNR: 43

actual bitrate:  25.7 Mbps

 

Sintel, cutree = ON 

Lookahead Target Bitrate   30 Mbps  Target Bitrate  20 Mbps
5 frames  

PSNR: 44.894

actual bitrate: 39.3 Mbps

 

PSNR: 43.367

actual bitrate:  26.7 Mbps

 

TOS , cutree = OFF

Lookahead Target Bitrate   30 Mbps  Target Bitrate  20 Mbps
5 frames  

PSNR: 42.851

actual bitrate: 25.4 Mbps

 

PSNR: 42.333
actual bitrate:  17.6 Mbps

 

TOS , cutree = ON

Lookahead Target Bitrate   30 Mbps  Target Bitrate  20 Mbps
5 frames  

PSNR: 42.644

actual bitrate: 22.3 Mbps

 

PSNR: 42.177
actual bitrate: 15.5 Mbps

 

Conclusion:

Rate control reveals strong overshoots for Sintel and undershoots for TOS. PSNR metric is not adequate to evaluate cutree mode.

 

Appendix

By default cu-tree is enabled.

cu-tree is automatically disabled if lookahead is set to 0, because cu-tree uses the lookahead pass. To disable the lookahead you need set '--rc-lookahead 0'

Example:

x265 --input test1080p.yuv --input-res 1920x1080 --fps 60 --b-adapt 0 -b 0 --ref 1 --no-scenecut --keyint 10 --min-keyint 10 --repeat-headers --bitrate 3000 --frames 60 --rc-lookahead 0 -o test.h265

x265 [info]: Lookahead / bframes / badapt : 0 / 0 / 0
x265 [info]: b-pyramid / weightp / weightb : 0 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 1 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree : 2 / 1.0 / 32 / 0

21 Responses

  1. An impressive share, I just given this onto a colleague who was doing a little analysis on this. And he in fact bought me breakfast because I found it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to discuss this, I feel strongly about it and love reading more on this topic. If possible, as you become expertise, would you mind updating your blog with more details? It is highly helpful for me. Big thumb up for this blog post!

  2. Oh my goodness! an incredible article dude. Thank you However I am experiencing problem with ur rss . Don’t know why Unable to subscribe to it. Is there anybody getting an identical rss drawback? Anybody who knows kindly respond. Thnkx

  3. Howdy very nice web site!! Man .. Excellent .. Amazing .. I’ll bookmark your site and take the feeds additionally?KI am happy to search out numerous helpful information here within the submit, we want develop extra techniques in this regard, thank you for sharing. . . . . .

  4. I’ve been surfing online greater than three hours nowadays, yet I by no means discovered any interesting article like yours. It?¦s lovely price sufficient for me. In my view, if all site owners and bloggers made just right content as you did, the web can be much more helpful than ever before.

  5. I have been exploring for a little for any high quality articles or blog posts on this kind of space . Exploring in Yahoo I ultimately stumbled upon this web site. Reading this information So i am satisfied to express that I’ve an incredibly just right uncanny feeling I discovered just what I needed. I most certainly will make certain to don’t omit this site and give it a look regularly.

  6. Throughout the grand scheme of things you receive a B+ with regard to hard work. Where you actually misplaced me ended up being on all the specifics. You know, people say, the devil is in the details… And that couldn’t be more accurate here. Having said that, allow me reveal to you what did work. The writing can be very engaging which is possibly the reason why I am taking an effort to comment. I do not really make it a regular habit of doing that. Next, even though I can notice a leaps in logic you make, I am definitely not confident of just how you appear to unite the ideas that help to make the actual conclusion. For the moment I will subscribe to your issue however wish in the near future you actually link the facts much better.

    1. most of posts require some background, otherwise they look chaotic.
      i recommend you to read the paper “Evaluating the CU-tree algorithm in an HEVC encoder” by VLADIMIR GROZMAN

Leave a Reply

Your email address will not be published. Required fields are marked *