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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#2 | Link |
|
ffx264/ffhevc author
![]() Join Date: May 2007
Location: /dev/video0
Posts: 2,034
|
http://www.chaneru.com/Roku/HLS/X264_Settings.htm
and for x265 - https://x265.readthedocs.io/en/master/cli.html
__________________
The Cyberpunk Database || NTP & NTS Time Server || Mirror Services ffhevc || ffx264 || ffxvid |
|
|
|
|
|
#4 | Link |
|
ffx264/ffhevc author
![]() Join Date: May 2007
Location: /dev/video0
Posts: 2,034
|
I could be wrong, but I don't think there's extensive description on how each AQ mode works. Read the code?
__________________
The Cyberpunk Database || NTP & NTS Time Server || Mirror Services ffhevc || ffx264 || ffxvid |
|
|
|
|
|
#5 | Link |
|
.
![]() Join Date: Oct 2001
Location: Germany
Posts: 7,853
|
|
|
|
|
|
|
#6 | Link |
|
ffx264/ffhevc author
![]() Join Date: May 2007
Location: /dev/video0
Posts: 2,034
|
Good find, Selur! Especially second link!
__________________
The Cyberpunk Database || NTP & NTS Time Server || Mirror Services ffhevc || ffx264 || ffxvid |
|
|
|
|
|
#7 | Link |
|
Registered User
Join Date: Dec 2022
Posts: 74
|
Selur: Thanks for the original data.
I still have doubts about how AQ works, because other descriptions have given different information. I'll share my thoughts. By default, the quantizer transfers data too strongly from monotonic regions to complex regions. AQ constrains this data transfer. Therefore, if there are few monotonic regions, weak AQ constraint is required, and therefore the AQ strength should be set to a small value less than 1. If there are many monotonic regions, strong AQ constraint is required, and therefore a large AQ strength greater than 1 should be set. AQ mode=2 is two-step constraint, for more accurate work, in short. Is this correct, or can you correct me? |
|
|
|
|
|
#8 | Link |
|
Registered User
Join Date: Mar 2011
Posts: 5,062
|
The x264 Animation preset sets AQ strength to 0.6 by default.
For the Grain tuning it's 0.5. For the Film tuning (or no tuning) it's 1.0. For the Still Image tuning it's 1.2. Based on that, and the explanation on the x264 wiki, I've always understood that when there's less variation in detail throughout the picture, the AQ strength can be lower than when there's a lot of variation. http://www.chaneru.com/Roku/HLS/X264...tm#aq-strength Adaptive Quantization Strength Default: 1.0 Sets the strength of AQ bias towards low detail ('flat') macroblocks. I vaguely remember playing around with the AQ strength for animation years ago and deciding to keep it at 1.0, because if I remember correctly, there was more likely to be banding in gradients when using lower AQ strengths. The background in this image is the sort of thing I'm referring to.
|
|
|
|
|
|
#9 | Link |
|
Donor
![]() Join Date: Jun 2024
Location: South Africa
Posts: 659
|
I stand to be corrected, but AQ does at the frame level what DCT and quantisation do within a macroblock. As DCT groups coefficients by low and high frequencies, quantisation reducing the latter more aggressively, AQ redistributes bits from more complex (HF) macroblocks to flatter (LF) ones by lowering quantisers, in inverse proportion to AQ strength. In other words, the frame-level quantiser varies according to each macroblock's detail. Since the frame's budget is constrained, increasing the quality of one region lowers that of others.
AQ mode 3 performs this bias towards dark as well as flatter blocks. |
|
|
|
|
|
#13 | Link | |
|
Registered User
Join Date: Aug 2024
Location: Between my two ears
Posts: 940
|
Quote:
|
|
|
|
|
|
|
#14 | Link | |
|
Donor
![]() Join Date: Jun 2024
Location: South Africa
Posts: 659
|
Quote:
|
|
|
|
|
|
|
#15 | Link |
|
Registered User
Join Date: Aug 2024
Location: Between my two ears
Posts: 940
|
Sidenote, some time ago I said the "recent" SVT-AV1 variance-boost is similar to AQ1, just from the names and general idea in the showcase, but I haven't take a deeper look.
It does have more dials, so it could be more sophiscated. Though AQ1 (x264/5) is simple and elegant and works very well. Anyways, whatever it is, we didn't have any equivalent of x264 AQ in SVT-AV1 before it, is what I wanted to say. I could be wrong, the "aq-mode" in SVT-AV1 and libaom does have "variance" in one of its options, but if it's the AQ we familiar with, why would variance-boost be needed? (and it's "mode 1", but "crf" requires "mode 2") (me being lazy and don't want to read av1 code )
Last edited by Z2697; 17th November 2025 at 18:15. |
|
|
|
|
|
#16 | Link |
|
Donor
![]() Join Date: Jun 2024
Location: South Africa
Posts: 659
|
Simplicity tends to be best; and Dark Shikari was touched by genius, coming up with and implementing these techniques, not to mention mbtree, which takes a similar concept in the temporal direction.
It's a nightmare trying to decipher SVT-AV1's options. Certainly, we haven't seen this level of inspiration and ingenuity since x264, but it's too confusing; and if one encodes something, there's always doubt: were the settings right, would it handle the range of content well, or did we use the right fork? Didn't variance-boost work analogously to AQ3, helping dark macroblocks? Last edited by GeoffreyA; 17th November 2025 at 10:41. |
|
|
|
|
|
#17 | Link |
|
Registered User
Join Date: Aug 2024
Location: Between my two ears
Posts: 940
|
The essence of x264 AQ1 is just like, 3 or 4 lines of code (or even 2), depending on whether you think the strength multiplied with constant and the loop are lines of code or not.
Code:
strength = h->param.rc.f_aq_strength * 1.0397f;
for each macroblock {
uint32_t energy = ac_energy_mb( h, mb_x, mb_y, frame );
qp_adj = strength * (x264_log2( X264_MAX(energy, 1) ) - (14.427f + 2*(BIT_DEPTH-8)));
}
(ac_energy_mb function does not return the actual variance, it returns the value without the division by (n-1) at the end, if I read the code correctly) |
|
|
|
|
|
#19 | Link | |
|
Registered User
Join Date: Aug 2024
Location: Between my two ears
Posts: 940
|
x265 changed AQ2 "constant" from 14 to 11 and "exponent" from 0.125 to 0.1 for claimed "better bit distribution".
According to my undisclosed test this is the main cause of "grain smearing" (as microchip8 describes it). But I still prefer AQ1 even if the change is reverted. ![]() Quote:
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|