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 13th May 2014, 05:41   #1  |  Link
MichaelRow
Registered User
 
MichaelRow's Avatar
 
Join Date: Apr 2014
Posts: 18
How to use aq-mod 3&4?

I use taro's x264 build(Known as tmod), and aq-mod 3&4 are included in it. I've read some threads about the OreAQ and MixAQ(--aq-mod 3 --aq3-mod 1&2 in this case), afaik, OreAQ and MixAQ can improve the quality in dark scene and flat areas, especially great to encode animes. But, as for aq-mod 4, I have no idea what it exactly does since I didn't find any information while googling.
Besides I don't know what exactly aq3-boundary,i/p/bfator <up:down> means, and how to set the proper parameters for anime encoding.

Code:
--aq-mode <integer>     AQ method [1]
                                  - 0: Disabled
                                  - 1: Variance AQ (complexity mask)
                                  - 2: Auto-variance AQ (experimental)
                                  - 3: Auto-variance AQ mod1
                                  - 4: Auto-variance AQ mod2
      --aq-strength <float>   Reduces blocking and blurring in flat and
                              textured areas. [1.0]
      --aq-sensitivity <float> "Center" of AQ curve. [10.0]
                                  -  5: most QPs are raised
                                  - 10: good general-use sensitivity
                                  - 15: most QPs are lowered
      --aq-ifactor <float>    AQ strength factor of I-frames [1.00]
      --aq-pfactor <float>    AQ strength factor of P-frames [1.00]
      --aq-bfactor <float>    AQ strength factor of B-frames [1.00]
      --aq2-strength <float>   Use 2nd AQ (Haali's AQ) algorithm for support. [0.0]
                                  0.0: no 2nd AQ
                                  1.1: strong 2nd AQ
      --aq2-sensitivity <float> "Flatness" threshold to trigger 2nd AQ [15.0]
                                    5: applies to almost all blocks
                                   22: only flat blocks
      --aq2-ifactor <float>   2nd AQ strength factor of I-frames [1.00]
      --aq2-pfactor <float>   2nd AQ strength factor of P-frames [1.00]
      --aq2-bfactor <float>   2nd AQ strength factor of B-frames [1.00]
      --aq3-mode <integer>    3rd AQ (OreAQ) method [0]
                                  - 0: Disabled
                                  - 1: OreAQ
                                  - 2: MixOre (experimental)
      --aq3-strength <float>  Reduces blocking and blurring in bump and
                              clear-cut areas. [0.5]
                    <Up:Down> or <Up1:Down1:Up2:Down2:Up3:Down3:Up4:OtherStuff>
                              Set QP up/down strength.
      --aq3-sensitivity <float> "Center" of 3rd AQ curve. [10.0]
                                  -  5: most QPs are raised
                                  - 10: good general-use sensitivity
                                  - 15: most QPs are lowered
      --aq3-ifactor <Up:Down> 3rd AQ strength factor of I-frames [1.0:1.0]
      --aq3-pfactor <Up:Down> 3rd AQ strength factor of P-frames [1.0:1.0]
      --aq3-bfactor <Up:Down> 3rd AQ strength factor of B-frames [1.0:1.0]
      --aq3-boundary <int:int:int>  OreAQ boundary. 
                                       fullrange=off: [192:64:24]
                                       fullrange=on : [205:56:9]
                                       #1: Bright-Middle
                                       #2: Middle-Dark
                                       #3: Dark-M.Dark
MichaelRow is offline   Reply With Quote
Old 15th May 2014, 08:52   #2  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
Here what the author tell me in PM when i've asked him the purpose of these new 3&4 modes :
Quote:
Hi. The idea was to improve --aq-mode 2 in dark areas by allowing lower (for negatives numbers it mean higher absolute values) QP offsets there. Approximation of QP-offset/Variance curves of different AQ modes can be looked here: 1..100000 range but most of the difference between AQ 2/3/4 are in 1..5000 range.

P.S. As users didn't really take active part in my testing I decided to give up on mode 4 [(0.25f - 3.3125f / (qp_adj * qp_adj - 0.75f) one] as too weak (it changes curve only at extremely low variance).
So, basicaly, ignore mode 4.
jpsdr is offline   Reply With Quote
Old 16th May 2014, 19:16   #3  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Overall, do people find that --aq-mode 3 is a "safe" alternative to using --aq-mode 2? In that it doesn't make anything significantly worse?
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 16th May 2014, 21:41   #4  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
aq2 and aq3 are in addition to the normal aq present in unpatched x264 builds.

Normal aq has three modes in vanilla x264, and two additional auto-variance modes (--aq-mode 3/4) in some patched builds. These extra modes do not affect and are not affected by Haali AQ (aq2) or OreAQ (aq3).

The command line parsing automatically treats --aq-mod as being short for --aq-mode; consequently, --aq-mod 3 does not set any aq2 or aq3 parameters.

Last edited by colours; 16th May 2014 at 21:44.
colours is offline   Reply With Quote
Old 17th May 2014, 08:52   #5  |  Link
MichaelRow
Registered User
 
MichaelRow's Avatar
 
Join Date: Apr 2014
Posts: 18
Quote:
Originally Posted by jpsdr View Post
So, basicaly, ignore mode 4.
Thanks for the info.

Quote:
Originally Posted by benwaggoner View Post
Overall, do people find that --aq-mode 3 is a "safe" alternative to using --aq-mode 2? In that it doesn't make anything significantly worse?
Some of my tests show that aq3 would make some light areas a little worse than aq1 at low bitrate.

Last edited by MichaelRow; 17th May 2014 at 08:55.
MichaelRow is offline   Reply With Quote
Old 17th May 2014, 09:11   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Since aq redistributes bits it's expected that some areas get worse.
sneaker_ger is offline   Reply With Quote
Old 18th May 2014, 23:34   #7  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
Quote:
Originally Posted by MichaelRow View Post
Some of my tests show that aq3 would make some light areas a little worse than aq1 at low bitrate.
Quote:
Originally Posted by sneaker_ger View Post
Since aq redistributes bits it's expected that some areas get worse.
Right, light areas got worse while presumably dark areas got better.
Asmodian is offline   Reply With Quote
Old 19th May 2014, 14:02   #8  |  Link
MichaelRow
Registered User
 
MichaelRow's Avatar
 
Join Date: Apr 2014
Posts: 18
Quote:
Originally Posted by Asmodian View Post
Right, light areas got worse while presumably dark areas got better.
It may looks better on dark areas, since what aq does is just moving bits around blocks and frames.

Normal aq3(aq-mod=3,aq3-mod=0) would use different strength to different frames while aq1 use the same strength to all the frames, and banding caused by low bitrate in light areas are not noticeable, to some extent, aq1 is safe but a little waste of bits. I found these opinions when googling, and I confused.
Maybe my tests about aq3 with bitrate at 1200kbps for 1080P are cherry-picked examples.
I'm just wondering if aq3 can help to save bits without much visual difference when using crf=17,aq-mod=3,aq3-mod=0,aq-strength=0.8 or are there a better settings for anime encode?
MichaelRow is offline   Reply With Quote
Old 19th May 2014, 19:39   #9  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by MichaelRow View Post
Some of my tests show that aq3 would make some light areas a little worse than aq1 at low bitrate.
Is that in the same frame that also has some dark areas that are getting improved? Or are you seeing a negative impact on frames without dark areas as well?
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 20th May 2014, 07:05   #10  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,229
For the 'extra' options I'm using:
Code:
--aq-mode 3 --fgo 5 --fade-compensate 0.2 --aq3-mode 2 --aq3-strength 0.3
This is in conjunction with using CRF, and maxing out the standard quality settings.

I'm not saying they're the ideal options, but I feel it's balanced without upsetting the bitrate too much. Setting fgo to 5 is a very light film grain optimisation which gives a nice result. Same with fade compensate being 0.2, it's a small amount, beneficial, without costing too much bitrate. The aq3-mode 2 use is a little experimental, I think it does look good! I use a strength of 0.3 for this, which might sound low, but it seems to be effective. Having this much higher seems to make the bitrate use increasingly higher.
burfadel is offline   Reply With Quote
Old 16th September 2015, 10:44   #11  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
Quote:
Originally Posted by burfadel View Post
For the 'extra' options I'm using:
Code:
--aq-mode 3 --fgo 5 --fade-compensate 0.2 --aq3-mode 2 --aq3-strength 0.3
This is in conjunction with using CRF, and maxing out the standard quality settings.

I'm not saying they're the ideal options, but I feel it's balanced without upsetting the bitrate too much. Setting fgo to 5 is a very light film grain optimisation which gives a nice result. Same with fade compensate being 0.2, it's a small amount, beneficial, without costing too much bitrate. The aq3-mode 2 use is a little experimental, I think it does look good! I use a strength of 0.3 for this, which might sound low, but it seems to be effective. Having this much higher seems to make the bitrate use increasingly higher.
So we can use aq-mode=3 with aq2-strength (haali) AND OreAQ (aq3-mode) at the same time? How will the encoder distribute the bitrate?

Plus, how to use this:

Code:
<Up:Down> or <Up1:Down1:Up2:Down2:Up3:Down3:Up4:OtherStuff>
Is it rather than using one value? if you know, please put an example.


I am interested in OreAQ as it is really good as a concept. I like the fact that we can use aq-mode=3, aq-strength=-0.8 which is great for anime.

So basically:

Normal AQ (aq-mode=3 for example): generally good with all frames, use negative values for anime.
aq2-strength: enhance flat areas.
OreAQ (aq3-mode=1,...): enhance dark areas and so on (maybe control bright areas too?).

^ is this correct?

Also, can we really disable the normal aq-mode and use only aq2 and aq3?

thanks!!
~ VEGETA ~ is offline   Reply With Quote
Old 28th September 2015, 13:58   #12  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
I read that there is a way to visually view the difference using avsutil. anyone tried this?
~ VEGETA ~ is offline   Reply With Quote
Reply

Tags
x264

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 20:39.


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