Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th April 2024, 08:56   #1  |  Link
simple_simon
Registered User
 
Join Date: Feb 2003
Posts: 124
Reducing QComp

Every time I see someone suggesting settings they almost always raise qcomp from the default of 0.6. However lowering qcomp to 0.4 seems to increase compression significantly at same CRF level with minimal visual degradation. Are there any downsides to doing this?

Last edited by simple_simon; 27th April 2024 at 17:28.
simple_simon is offline   Reply With Quote
Old 28th April 2024, 15:21   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,249
The basic idea of the quantizer curve compression algorithm is to raise the quantizers in "complex" frames, compared to simple constant quantizer mode, so that those "complex" frames won't occupy an excessive amount of bits. The bits that are "saved" in the more complex (fast) frames, at the cost of a relatively small quality loss there, can then better be used in the less complex (slow) frames, in order to improve the quality there.

By default, the bit allocation for the frames is controlled by the formula complexity ** 0.6, where "complexity" is the bit size of the frame at a constant quantizer, and 0.6 is the default "qcomp" parameter. In 2-Pass mode this will additionally be scaled by a so-called "rate factor", which is constantly adjusted, so that the target file size (average bitrate) will be hit. In CRF mode, everything is the essentially the same, except that the "rate factor" is a constant.

Consequently, if you adjust the "qcomp" parameter to a larger value, then you are weakening the effect of quantizer curve compression, effectively making the result more like pure constant quantizer mode. Conversely, if you adjust the "qcomp" parameter to a smaller value, then you are strengthening the effect of quantizer curve compression, effectively making the result more like pure constant bitrate mode.

Note that the whole purpose of quantizer curve compression is to improve the overall visual quality, at a certain file size (average bitrate), not to alter the file size (average bitrate). That you may end up witth a different file size (average bitrate) when changing the "qcomp" parameter, while using CRF mode with the same CRF value, is merely a "side effect" of how quantizer curve compression and CRF mode play together, I suppose...

Warning: All of the above only very roughly applies to contemporary x264, because... MB-Tree

Source:
https://code.videolan.org/videolan/x...atecontrol.txt
https://huyunf.github.io/blogs/2017/...ee%20paper.pdf

________

Also, comparing files of different size (average bitrate) and different quality will not give you any insights! You either have to compare the size of files that have the same visual quality, or you have to compare the visual quality of files that have the same size (average bitrate). Because "same visual quality" is extremely difficult to establish, you are probably better off using the second method (i.e. visually compare files that have the same size).

Now, it is not much of a surprise that lowering the "qcomp" parameter results in a smaller file, in CRF mode, at the same CRF value, but you could have achieved that, just as well, by sticking with the default "qcomp" value and simply using a somewhat higher CRF value! You won't know which way is better, until you have assessed them both, by visually comparing files of the same size (average bitrate)

My preference is to pick the slowest "--preset" that you can afford, pick the suitable "--tune" for your kind of source, leave "qcomp" at default, and then simply adjust the CRF value to balance the quality/filesize trade-off as desired...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 28th April 2024 at 20:29.
LoRd_MuldeR is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:51.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.