xiph / rav1e

The fastest and safest AV1 encoder.
BSD 2-Clause "Simplified" License
3.72k stars 253 forks source link

Implement quantization matrices #2973

Open shssoichiro opened 2 years ago

shssoichiro commented 2 years ago

AV1 supports 15 sets of pre-defined quantization weighting matrices, where the quantization step size for each individual frequency component is further scaled differently. Each frame can optionally select a quantization weighting matrix set for luma and chroma planes, respectively.

These quantizer matrices can provide a considerable compression benefit--on average 10% based on testing in aomenc.

BlueSwordM commented 2 years ago

Yeah. The main way rav1e could improve on this change is to actually use a good psycho-visual metric for choosing the quantization mastrix weights, unlike the current MSE used by default/weighing the error in the transform space(frequency weighted PSNR), which is better, but has limitations because of that.

This would allow rav1e to work considerably better at all quality ranges, as the current implementation in aomenc only works well at low-mid/high quality ranges, as getting close to visual transparency makes MSE determined QMs actively detrimental to many parts of a complex image.