Log in

View Full Version : HQ vs Insane preset in megui


Pages : 1 [2]

LoRd_MuldeR
25th June 2009, 16:06
So for 500-800Kbps SD 2.35 and 1.77 encodes I should turn off psy-rd and psy trellis?

As always, there is no general recommendation ;)

You should test various Psy-RDO/Trellis strengths at your traget bitrate at least. Then you can see what you like best...

ChronoCross
25th June 2009, 16:13
Unless user manually set psy-rd value, x264 should tweak the psy-rd automagically according to bitrate and resolution, or we call it "auto psy-rd". It should try to make subme 9 always better than subme 6.

How would this auto adjustment be calculated? Basing this setting off of arbitrary resolutions and bitrates would be absurd as every source is different. There is no good way to determine what psy-rd setting to use so starting off at the current x264 default is always a good balance. The encoder should adjust it to his/her source accordingly.

Chengbin
25th June 2009, 16:16
Would that be considered "low" bitrate though?

roozhou
25th June 2009, 16:35
How would this auto adjustment be calculated? Basing this setting off of arbitrary resolutions and bitrates would be absurd as every source is different. There is no good way to determine what psy-rd setting to use so starting off at the current x264 default is always a good balance. The encoder should adjust it to his/her source accordingly.

Of course it can't be perfect, but better than always leaving it to 1.0.

ChronoCross
25th June 2009, 16:38
Of course it can't be perfect, but better than always leaving it to 1.0.

Evidence?

roozhou
25th June 2009, 16:45
Evidence?

There are plenty of samples showing that psy-rd 1.0 sucks at low bitrates, especially on animes. I have seen many discussions on this topic among fansub makers.

poisondeathray
25th June 2009, 16:51
psy-rd of 1.0 also sucks on non-anime sources at low bitrate. Anyone who has encoded for low bitrate flash will know this. Edges get ratty, and ringing is a lot worse. It's especially evident on clean edges like titles, or graphics (and anime outlines). psy-rd and psy-trellis essentially add noise, which requires more bitrate. If used in a low bitrate constrained scenario something has to give. I just think that 1.0 is too high for a default strength. I bet the general public doesn't even know what psy-rd is, let alone know they are supposed to lower it for lower bitrate scenarios...

ChronoCross
25th June 2009, 17:11
psy-rd of 1.0 also sucks on non-anime sources at low bitrate. Anyone who has encoded for low bitrate flash will know this. Edges get ratty, and ringing is a lot worse. It's especially evident on clean edges like titles, or graphics (and anime outlines). psy-rd and psy-trellis essentially add noise, which requires more bitrate. If used in a low bitrate constrained scenario something has to give. I just think that 1.0 is too high for a default strength. I bet the general public doesn't even know what psy-rd is, let alone know they are supposed to lower it for lower bitrate scenarios...


The general public probably isn't using x264 in flash, or even low bitrate for that matter.

Also just so we could clarify what do you consider low bitrate and how do you suggest we determine what setting to use automatically? Do you have any proposals for this auto psy-rd?

roozhou
25th June 2009, 17:19
The general public probably isn't using x264 in flash, or even low bitrate for that matter.

Also just so we could clarify what do you consider low bitrate and how do you suggest we determine what setting to use automatically? Do you have any proposals for this auto psy-rd?

Let x be bits per pixel*sec for the encoded video, and psy-rd value be f(x). We can make test to determine the optimal f(x) for different range of x.

poisondeathray
25th June 2009, 17:21
The general public probably isn't using x264 in flash, or even low bitrate for that matter.

Also just so we could clarify what do you consider low bitrate and how do you suggest we determine what setting to use automatically? Do you have any proposals for this auto psy-rd?


I just used "flash" as an example of a commonly used low bitrate scenario. Another common low bitrate use is of course anime.

"Low bitrate", of course, is relative. It would depend on the complexity of the content, the fps, and the frame dimensions etc...

I don't have any programming experience so I have no idea how "auto psy-rd" would be implemented. I'm just making the point that psy-rd of 1.0 is too high especially for low bitrate scenarios, and the defaults should be less destructive for the general public (just like psy-trellis was set to 1.0 at one point, and was considered too high)

ChronoCross
25th June 2009, 17:29
Let x be bits per pixel*sec for the encoded video, and psy-rd value be f(x). We can make test to determine the optimal f(x) for different range of x.

how many tests do you plan on doing for how many different sources at how many different bitrates? If your going to try and have something correct stupid user choices your also going to have to test an extensive amount of sources to get any useable values.

Chengbin
25th June 2009, 17:43
Math doesn't work like that. You'll never get psy-rd to turn off because you're either reaching an asymptote or graph is concaving down indefinitely.

roozhou
25th June 2009, 18:15
how many tests do you plan on doing for how many different sources at how many different bitrates? If your going to try and have something correct stupid user choices your also going to have to test an extensive amount of sources to get any useable values.

First we should make it better than constant 1.0. It's not that difficult.

ChronoCross
25th June 2009, 18:18
First we should make it better than constant 1.0. It's not that difficult.

what value do you propose for low bitrate content?

roozhou
25th June 2009, 18:49
what value do you propose for low bitrate content?
Turn it off

ChronoCross
25th June 2009, 18:56
Turn it off

okay so what is low bitrate content?

Chengbin
26th June 2009, 02:38
I did a comparison between a comparison psy+psy trellis and no psy+psy trellis. CRF 20

It seems like psy is like a sharpener. Details seems accentuated.

Dark Shikari
26th June 2009, 02:39
I did a comparison between a comparison psy+psy trellis and no psy+psy trellis. CRF 20

It seems like psy is like a sharpener. Details seems accentuated.You can't compare at the same CRF since both psy RD and psy trellis raise bitrate at the same CRF.

Sharktooth
26th June 2009, 03:21
... as usual, COMPARE AT THE SAME BITRATE ...

Chengbin
26th June 2009, 03:56
... as usual, COMPARE AT THE SAME BITRATE ...

Will do, when I have time.

10L23r
26th June 2009, 06:32
No ! How many will it have to be repeated. The only way to judge the efficiency of a setting is to encode with and without the setting at the same visual quality, and to compare the resulting filesize.



Not when A and B are close from one another, which happens with most switches from x264 (when considered alone). So most of the time, you end up concluding nothing. Attempting to match the visual quality can be a long process, but one with which you can conclude something.

A proper methodology to test the setting X would be :
- create an anchor encoding without X, at a defined crf (close to the one you'll use)
- create several encoding with X, at several crfs, so that you have at least one encoding with X that is visually worse, and one that is visually better than the anchor.
- reduce as much as possible the uncertainty interval by refining the crfs of the worse and better encoding with X until they become almost indistinguishable from the anchor.

Once that is done, you have a bitrate interval with setting X enclosing - quality wise, an encoding without X. you can draw your conclusions. If you really have a lot of time to spend, you can do the same without X and draw a second interval around the anchor.

And, in the end, you are even able to tell "using setting X is x% better than not using it", which allows to compare different settings together.

uhm... so should we test at same bitrate or quality...

edit: srsly, i believe that psy-rd is so subjective that only a test on a large, uneducated (regular ppl who do not understand this stuff) sample would yield any meaningful results.

roozhou
26th June 2009, 10:01
uhm... so should we test at same bitrate or quality...

edit: srsly, i believe that psy-rd is so subjective that only a test on a large, uneducated (regular ppl who do not understand this stuff) sample would yield any meaningful results.

Of course same bitrate. How can you measure same quality?

LoRd_MuldeR
26th June 2009, 12:01
Of course same bitrate. How can you measure same quality?

As explained here:
http://forum.doom9.org/showpost.php?p=1293340&postcount=15

It's more work than comparing videos of the same bitrate though, but probably more useful.
For a "quick" compare it should be okay to compare encodes of the same bitrate...

Manao
26th June 2009, 12:47
Do note that the quotes don't quite apply there. In both cases, I was talking of users not being able to see a visual difference - the bitrate being fixed - with some settings, and which then concluded that the setting was useless.

As far as I can tell, people do see the difference between psy-rd and no psy-rd, even at fixed bitrate, so it shouldn't be a problem to say it's worse or better. Of course, if you need to differentiate psy-rd 0.5:0 and psy-rd 0.6:0, that would be another story...

TiGR
26th June 2009, 13:26
2) There are millions of x264 users around the world, but only a small portion go to Doom9 or the mailing-list. From "x264 --longhelp" they are not warned about the side effect of psy-rd at low bitrates.
Sure, a note in --longhelp similiar to the one about --b-adapt 2 would be a reasonable addition. It would not, however, protect an average user, who uses a GUI, from the defaults. Really, I think that adding low-bitrate profiles and tooltips for psy-rd settings into major GUIs (if they don’t have them already) would just work for the millions of unaware users – and the rest doesn’t need more than the commandline warning. No need of extensive testing or overhauling the x264 defaults.

Let x be bits per pixel*sec for the encoded video, and psy-rd value be f(x). We can make test to determine the optimal f(x) for different range of x.
Not that I have a deep understanding of H.264 or programming in general, but this sounds a little too simplistic. For example when the framerate doesn’t quite reflect the nature of material (anime, bobbed video), wouldn’t it screw up the function? Of course, we can’t magically adjust psy-rd to be perfect in every situation, but would such a simple solution work out when we feed it with the data? I’m not so sure.

Sharktooth
26th June 2009, 14:29
that function has no sense. psy-rd effects may be ok on some kind of sources and bad on some others. x264 doesnt know what is going to encode and a simple function is not going to be the solution. the source compressibility will also make a huge difference for the bitrate threshold (of that function), but again, x264 doesnt know the source compressibility...
the point is users must learn how an encoder works BEFORE using it. the same is true for every other software (despite what micro$oft want you to believe...).
settings are there so you can set the encoder properly for your needs. automatic B$ is always suboptimal.

Manao
26th June 2009, 15:29
You don't need to see it from a bitrate point of view. Just make an option in x264 disabling/reducing psy rd when the quantizer of a particular macroblock is over a threshold. settings are there so you can set the encoder properly for your needs. automatic B$ is always suboptimal. I strongly disagree. An encoder should strive to be as self-adaptive as possible. The only settings you ought to have to set are compliancy settings (cabac, gop, bframes, 8x8dct...), rate control (either bitrate driven or quality driven), encoding speed (with a single switch), and perhaps a switch setting the trade off between details and artifacts.

Not everybody has the time to watch pixel per pixel all the encoding he's doing to see if his settings are "optimal".

Sharktooth
26th June 2009, 15:36
that's true but the "theoretical" POV is always different than the practical POV.
it's the same difference between metrics and human eye.
some sources may benefit more than others from PSY-RD even at high quants... visual comparisons are always needed when you're going to get the "best" results.
a certain experience with a certain encoder is always good... so, for a beginner, it's a matter of trial and error until he gains the necessary experience to get the results he wants...
that's perfectly normal and it will never change.

elguaxo
26th June 2009, 20:11
make an option in x264 disabling/reducing psy rd when the quantizer of a particular macroblock is over a threshold.

I think we have something like that already?

Auto sensing mode. Raise or lower Psy-RD with bitrate.

edit: on a frame by frame basis.
x264 already does that. It raises psy-RD based on lambda ;)

The problem isn't that psy-RD needs to be lowered at very low bitrates--it's just that it's less useful overall, probably.


To what extent? If using CRF 18, could I lower Psy-RD to 0.4 and expect x264 to raise it as needed/necessary.
No, it's implicit in the algorithm. The strength is an extra weighting factor.

Judging by the results here, I would have thought it was safe to assume the Psy-RD needs to be lowered on very low bitrates.How can you say that given that we didn't test anything between 0.0 and 1.0? :rolleyes:

Manao
26th June 2009, 20:45
I think we have something like that already?It does change psy rd strength according to quantizer, but it actually increases it when the quantizer raises...

Actually, it's a bit more complicated than that. Without psy-rd, x264 chooses, for a particular MB, the mode that minimizes SSD + lambda x bits. In that formula, lambda depends on the quantizer (the higher the quantizer, the higher the lambda).

When psy-rd was added, it changed the previous formula which became : SSD + gamma x PSY + lambda x bits. It was then decided that gamma should be indexed on lambda (ie, gamma = alpha x lambda, with alpha constant whatever the quantizer, and linear to the psy strength).

That imho is a mistake. It makes sense that gamma may depend on the quantizer, but there are no reasons whatsoever for it to behave as lambda - unless experimental testing validates that. Since Dark_Shikari numerously said that psy-rd was bad at low bitrate/high quantizer, I think it safe to assume that the experimental testing didn't validate it (for the highest quantizers at least)

Dark Shikari
26th June 2009, 20:47
That imho is a mistake. It makes sense that gamma may depend on the quantizer, but there are no reasons whatsoever for it to behave as lambda - unless experimental testing validates that. Since Dark_Shikari numerously said that psy-rd was bad at low bitrate/high quantizer, I think it safe to assume that the experimental testing didn't validate it (for the highest quantizers at least)This is probably true; the lambda relationship may not hold at the highest quantizers.

Chengbin
27th June 2009, 04:07
I just did my little test on psy vs no psy on low bitrates. The video was The Matrix, and both videos are 480Kbps.

Here is my setting

cabac=1 / ref=6 / deblock=1:0:0 / analyse=0x1:0x111 / me=umh / subme=9 / psy_rd=1.0:0.4 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=0 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-4 / threads=3 / nr=0 / decimate=1 / mbaff=0 / bframes=4 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=481 / ratetol=1.0 / qcomp=0.80 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

I like the psy encode better. Details are more accentuated. Even though some high motion scenes are not as good as the no psy version, I was looking for it. Overall I like the psy encode better.

elguaxo
27th June 2009, 19:36
It does change psy rd strength according to quantizer, but it actually increases it when the quantizer raises...

Actually, it's a bit more complicated than that...

thanks for the explanation! :)

10L23r
27th June 2009, 20:42
I just did my little test on psy vs no psy on low bitrates. The video was The Matrix, and both videos are 480Kbps.

Here is my setting

cabac=1 / ref=6 / deblock=1:0:0 / analyse=0x1:0x111 / me=umh / subme=9 / psy_rd=1.0:0.4 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=0 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-4 / threads=3 / nr=0 / decimate=1 / mbaff=0 / bframes=4 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=481 / ratetol=1.0 / qcomp=0.80 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

I like the psy encode better. Details are more accentuated. Even though some high motion scenes are not as good as the no psy version, I was looking for it. Overall I like the psy encode better.

maybe you should try 0.5:0.0, 1.0:0.0, 1.0:0.2, 1.0:1.0 for comparisons.