Log in

View Full Version : Q factor and quantization matrix relation


Manngo
6th April 2004, 12:26
there is some mystery about this topic in my head.
I encoded a movie 2 times using different matrix.

First:
8, 8, 8, 8,16,16,16,16
8, 8, 8,16,16,16,16,32
8, 8,16,16,16,16,32,32
8,16,16,16,16,32,32,32
16,16,16,16,32,32,32,32
16,16,16,32,32,32,32,32
16,16,32,32,32,32,32,32
16,32,32,32,32,32,32,32

Second:
8,16,16,16,32,32,32,32
16,16,16,32,32,32,32,64
16,16,32,32,32,32,64,64
16,32,32,32,32,64,64,64
32,32,32,32,64,64,64,64
32,32,32,64,64,64,64,72
32,32,64,64,64,64,72,72
32,64,64,64,64,72,72,72

Encodes were done using D2SRoBa set to fill the full media, so average bitrate become almost the same. Using the second matrix the found Q was significant lower. I'm not sure the quality was better in the second one.
The higher numbers in the matrix mean the more compression and smaller numbers mean higer quality.
Considering all these, I'm thinking this way:
output size given: 1 DVD. want to fill 100% --> average bitrate is given.
After this Q can be changed by playing with the matrix.
Q=1 can be reached always theoretically. But is it an aim?
Exactly I think a matrix can be found for each movie to adjust Q value to a constant level. Which is this level? 1? 40?
What's your idea about all these?

DDogg
6th April 2004, 19:13
CCE version used? also, I sent a PM.

Manngo
6th April 2004, 20:56
I use 2.67.00.23.

Sulik
7th April 2004, 21:13
Actual quantization levels are the matrix multiplied by Qp, so your result is normal.

For example, let's take the coefficient (4,4) (32 in matrix1, 64 in matrix 2):

Actual Q-level (matrix 1) = 32 * Qp
Actual Q-level (matrix 2) = 64 * Qp

If you restrict the bitrate, you indirectly restrict the actual Q-level, ie: 32*Qp1 = 64*Qp2 = actual_Q_level based on bitrate.
In the end you would get a much lower Qp with matrix2, but the same exact results.

The scale of a given matrix has little to do with the final quality, the primary purpose of a matrix is to tell the encoder how to quantize low frequencies vs high frequencies (blockyness vs ringing).

Manngo
8th April 2004, 10:36
Thanx Sulik.

Doesn't couse it problems to RoBa?
I mean the found Q will be lower, when the matrix coefficients are higher. This case Q1 can be reached when martix coefficients are too high --> undersized output. The second pass will be enforced.
When using too small coefficients, (like matrix 1 in my first post) Q will be too high, easyly over 40, resulting RoBa to enforce second pass.
However when the matrix is properly selected the second pass is not necessary. And the results will be the same in all cases.