Reputation: 35
I am encoding a video with different initial QP values using the x265 encoder. I am surprised when I checked the bitstream to see the actual QP values for every block across frames are not exactly the same as the given initial QP value. Specifically, the actual QP decreases to minus 3 from the initial value, as shown in the figure below (my initial QP is set to 27). But I don't understand why. Then, I run the encoder from HM-16.20, the actual QP value is the same as the initial QP. Can someone help me to understand the motivation for this? From my point of view, the x265 encoder wants to retain more visual quality by lowering the actual QP values than those in HM software. I used the following command line to run the x265 encoder:
x265.exe --input BQSquare_416x240_60.yuv --fps 60 --input-res 416x240 --interlace 0 -f 20 --input-depth 8 --input-csp i420 --ctu 64 --no-open-gop --keyint 1 --ref 1 --aq-mode 0 --qp 27 -r BQSquare_416x240_8bit_27.yuv --output-depth 8 --output BQSquare_416x240_8bit_27.bin
Upvotes: 1
Views: 896
Reputation: 468
It is due to the hierarchical GOP structure that allocates different QP values to frames in different temporal levels. To incorporate this idea, x265 takes the input QP (27 in your case) and applies different offsets. In your example the offset is -3 apparently.
Upvotes: 1