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 29th July 2007, 20:58   #21  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by MarcioAB View Post
Sagittaire, I see, but for example, assume I have a 2 frames sample with PSNR as 35 and 45. Than I change a parm I want to prove will increase quality and end up with numbers like 40 and 40.

Did the quality improve ?

Thank you
Marcio
It probably improved as the quality became more consistent. The eye notices inconsistent quality more than it notices overall bad quality.

SSIM is a much better indicator than PSNR. What you have to take into account in addition to SSIM is primarily the fact that one bad area of an image, or one bad area of a video, is a lot worse than slightly reducing the quality of everything else.

This is the problem with highly optimizing video encoders; they may decide that creating an ugly block here would save enough bitrate to increase the quality a lot more over there. But what we see is the ugly block.
Dark Shikari is offline   Reply With Quote
Old 29th July 2007, 21:23   #22  |  Link
MarcioAB
Registered User
 
MarcioAB's Avatar
 
Join Date: Nov 2005
Posts: 157
Quote:
Originally Posted by Dark Shikari View Post
... is primarily the fact that one bad area of an image, or one bad area of a video, is a lot worse than slightly reducing the quality of everything else.

This is the problem with highly optimizing video encoders; they may decide that creating an ugly block here would save enough bitrate to increase the quality a lot more over there. But what we see is the ugly block.
Fully agree. At least my eyes/brain works like that. Is there any parms in x264 that we can use to minimize this problem ?

Obs: I'm running MSU application [ Blocking (MPEG-4) Beta comparison ] to see if my eyes/brain agree with that. It's very time consuming (on Intel 6600 2.4GHz dual-core at 70% cpus utilization).
MarcioAB is offline   Reply With Quote
Old 29th July 2007, 21:36   #23  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by MarcioAB View Post
Fully agree. At least my eyes/brain works like that. Is there any parms in x264 that we can use to minimize this problem ?

Obs: I'm running MSU application [ Blocking (MPEG-4) Beta comparison ] to see if my eyes/brain agree with that. It's very time consuming (on Intel 6600 2.4GHz dual-core at 70% cpus utilization).
I think --no-dct-decimate or whatever the commandline is helps.

Actually, an idea just struck me: add a new feature to x264 that does the following; it wouldn't be hard (it would be an optional commandline of course):

Commandline: --qf --qf-threshold
Variables: block-width, block-height

Quality Fixer does the following:

1. At the end of encoding an area of the frame equivalent to a block of block-width and block-height, QF is activated.
2. QF does SSIM on the block. If SSIM is less than qf-threshold, it estimates how many more bits are needed to get the quality equal to or above qf-threshold.
3. In the case that SSIM is less than the threshold, the block is re-encoded with a newly estimated quantizer.
4. (Possibly) repeat process until SSIM is above threshold.
5. (Possibly) do the above if SSIM is a lot above the threshold in order to lower the SSIM and save bits. In other words, find the area of the frame where lots of bits are being wasted and fix that.

It would be time-consuming, but it could provide a visually optimum result.

It could even be a new ratecontrol option: not only would it provide a target SSIM, but it would also provide an equal SSIM in all portions of the frame.

Last edited by Dark Shikari; 29th July 2007 at 21:41.
Dark Shikari is offline   Reply With Quote
Old 29th July 2007, 22:29   #24  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Quote:
Originally Posted by Dark Shikari View Post
No, I didn't mean it in order in any way.

I would disagree slightly with that list; --subme 7 provides relatively minimal benefit over --subme 6 (as I showed earlier); its useful, sure, but not that high on the list.
Subme with RDO in general, not just subme 6 or 7. Using a subme level under 6 would give you a similar quality level that a .avi container would yield (which is limited in almost every aspect when it comes to h.264 encoding). From a visual standpoint (without doing a ssim/psnr test), you can easily see the differences between 5 and 7. 7 will give you a great picture, while 5 would give a sorta undetailed result. This's why I have is as no.2.

Quote:
Originally Posted by MarcioAB View Post
Terranigma, that was EXACTLY my initial expectation regard the question, so:

Considering "in-loop deblocking" ( --deblock <alpha:beta> ) is so high in the list, could we have a very quick advice (or link) regard alpha and beta based on yours and all here experience ?

Custom matrices so low in the list: Interesting. So is <NONE> reasonable ?

Thank you
Marcio
--filter -3,-3 (In-Loop)
Actually, all those options are important. I mentioned custom matrices in the first place, because the default quantization tend to block. Try looking for the "Prestige CQM".

One thing I forgot to mention, that should also be on the list (Very High, maybe like no.4 or 5), is the deadzone options. This affects grain retention.

Last edited by Terranigma; 29th July 2007 at 22:35.
Terranigma is offline   Reply With Quote
Old 29th July 2007, 22:35   #25  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by MarcioAB View Post
3) I was not able to find params below in MeGUI. Am I missing something ?

--partitions all
--direct auto
nodct_decimate
I don't know if this is still a problem for you, but here:

AQ still requires custom, as you surmise.

When you reordered the list, lower values should be higher on it than higher. (ie, subme 6 is more important than subme 7, as it provides more benefit compared to the amount of extra time it requires than 7. 7 still provides more absolute benefit, of course. Trellis and reference frames are the same way.) In fact some time ago, someone posted a comparison of most of the options with speed hit and quality gain listed, ordered by the ratio of the two; might have been manao or akupenguin.
foxyshadis is offline   Reply With Quote
Old 29th July 2007, 22:42   #26  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Quote:
Originally Posted by MarcioAB View Post
Fully understand you. In some point I was considering that even looking slowly frame-by-frame and noticing all the issues, like I did, was also not appropriated.

100% agree a number to express visual quality result is necessary. It's just difficult to understand why so talented people like all here was not yet able to find any algorithm to better express the visual quality.

Thanks
Marcio
Simply because metric in practice work very well for codec developpement and for all the codec in the world ... it's simply like that. PSNR seem not work for you but it's simply because you don't know how work metric and how use metric. for a same frame if the PSNR increases then generaly visual quality will increase too. You can't compare differents frames with PSNR: frame A with PSNR at 35 dB could be visually better for eyes than frame B with PSNR at 45 dB for a same video source. Simply because The PSNR is not an absolute measurement of quality ...
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 29th July 2007, 23:30   #27  |  Link
ToS_Maverick
x264 Tester
 
Join Date: Dec 2005
Location: Austria, near Vienna
Posts: 223
Quote:
Originally Posted by MarcioAB View Post
Fully agree. At least my eyes/brain works like that. Is there any parms in x264 that we can use to minimize this problem ?
at the moment, the only way is to use Adaptive Quantisation (AQ), wich works quite well.

just to be complete, here's my current preferred setting:

Code:
 --crf 20.0 --level 3 --keyint 100 --min-keyint 1 --ref 3 --mixed-refs --no-fast-pskip --bframes 2 --b-pyramid --bime --weightb --filter -2,-2 --analyse p8x8,b8x8,i4x4,i8x8 --8x8dct --vbv-bufsize 1835 --vbv-maxrate 10000 --threads auto --thread-input --progress --no-dct-decimate --no-psnr --no-ssim --output "" --aq-strength 0.9
i personally don't like trellis, because it "optimizes away" too much. without it, the picture looks more harmonic, to me. to me it's worth the bitrate increase of 3 % for a faster compression.

beware, i optimize my settings for a good overall "look" and a balanced encoding speed, not for maximum compression or good metrics.
ToS_Maverick is offline   Reply With Quote
Old 29th July 2007, 23:32   #28  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Oh, I must warn you. Never use trellis 2 for 2-pass encoding (At least for the first pass anyways). Doing so would surely cause an erratic behavior; corrupting your encode in the end
e.g.
Presenting blocks where it should'nt be present, not using a high enough bitrate for certain frames, etc...

Only use trellis 2 for the final pass. You can, however, safely use trellis-1 without any noticeable side effects as you would if you use trellis 2 for the passes where it gathers stats.
Terranigma is offline   Reply With Quote
Old 30th July 2007, 01:47   #29  |  Link
MarcioAB
Registered User
 
MarcioAB's Avatar
 
Join Date: Nov 2005
Posts: 157
Quote:
Originally Posted by foxyshadis View Post
I don't know if this is still a problem for you ...
Yes, it is. Well, it was now: Very clear/helpful picture. So --partitions equals -- analyse. OK got it.
Quote:
Originally Posted by foxyshadis View Post
When you reordered the list ... (ie, subme 6 is more important than subme 7)
My expectation is to have a list ordered by the importance of parm in QUALITY with no respect to encode time or size. In that sense, --subme 7 should be more in the top regard --subme 6 because 7 will produce better quality then 6. Please, see the clean version of the list
Quote:
Originally Posted by foxyshadis View Post
In fact some time ago, someone posted a comparison of ...
Very interested in it, but could not find it so far.
MarcioAB is offline   Reply With Quote
Old 30th July 2007, 02:00   #30  |  Link
MarcioAB
Registered User
 
MarcioAB's Avatar
 
Join Date: Nov 2005
Posts: 157
Quote:
Originally Posted by Dark Shikari View Post
Actually, an idea just struck me: add a new feature to x264 that does the following ...
If I understood correctly, in some sense, you addressed my 3rd question in the first post:

3) In multipass encode, I understand there is a kind of "intelligence" in the encoder to choose where to compress more and where to compress less. Is this "intelligence" free to the programmer to choose ? (example: could be possible to analyze luminance in each frame and if dark, compress much less ?)

The difference I was looking to encode based on luminance and you propose based on SSIM.

I still have a problem with SSIM or I am still trying to understand SSIM, but it sounds a great idea to me: give us some control of the "intelligence".
MarcioAB is offline   Reply With Quote
Old 30th July 2007, 02:15   #31  |  Link
MarcioAB
Registered User
 
MarcioAB's Avatar
 
Join Date: Nov 2005
Posts: 157
Quote:
Originally Posted by Sagittaire View Post
... for a same frame if the PSNR increases then generaly visual quality will increase too. You can't compare differents frames with PSNR...
Yes, I do not know, but please allow me to reply:
- "for the same frame ..."
- "you can not compare diff frames ..."
Ok, but in the end we will be comparing different frames because that is what video is: sequence of different frames.

Back in my example: If I have a sample with 2 frames and PSNRs are 35 and 45, and I apply a parm that give me now 39 and 39, what can I say ?

Let's assume for example, the first frame with 35 was visually bad and now with 39 became good and the 2nd frame with 45 was good and now with 39 it is still good (sure not as good as 45, but still visually good). I will say that parm I applied increased the quality despite the mean PSNR became reduced.
MarcioAB is offline   Reply With Quote
Old 30th July 2007, 02:22   #32  |  Link
Theliel
Registered User
 
Join Date: May 2006
Posts: 162
entropy encoding (cabac) only enhanced compression, not affect to IQ.

I think that is impossible determinate. You only can compare the same frame. Its posible that now the 2nd frame with 39 are so bad that the old 1st 35, or maybe 1st frame with 39 dont have enought IQ. Differents frames different IQ.

Last edited by Theliel; 30th July 2007 at 02:30.
Theliel is offline   Reply With Quote
Old 30th July 2007, 02:31   #33  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Quote:
Originally Posted by Theliel View Post
entropy encoding (cabac) only enhanced compression, not affect to IQ.
And because of that, it saves a ton on the bitrate (Now i'm sounding a bit like the slogan for the geico auto insurance). This's why I chosed it as the most important factor, but this's just my opinion. h.264 is meant for high compression wasn't it, or am i'm wrong in thinking that?
Terranigma is offline   Reply With Quote
Old 30th July 2007, 02:41   #34  |  Link
Theliel
Registered User
 
Join Date: May 2006
Posts: 162
of course

i said this because i belive that MarcioAB want search only the IQ parameters "Importance in Quality (no care about time or size)". of course, if cabac save up arround 30% in size, you always can increase the bitrate and increase the IQ
Theliel is offline   Reply With Quote
Old 30th July 2007, 02:48   #35  |  Link
MarcioAB
Registered User
 
MarcioAB's Avatar
 
Join Date: Nov 2005
Posts: 157
Quote:
Originally Posted by Theliel View Post
entropy encoding (cabac) only enhanced compression, not affect to IQ.
(assuming IQ = Image Quality = My personal judgment of Image Quality )

If I encode a source keeping the same bitrate (of filesize) and set CABAC in the 1st and not set CABAC in the 2nd, I guess IQ will be better in the 1st than the 2nd. Is that true ?

Maybe I should say the list is for "no care of time encode" but keeping the same bitrate.

EDIT: Read your 2nd post now. Correct: Definitively must adjust the context of the list.

Last edited by MarcioAB; 30th July 2007 at 02:50. Reason: in the body
MarcioAB is offline   Reply With Quote
Old 30th July 2007, 03:06   #36  |  Link
MarcioAB
Registered User
 
MarcioAB's Avatar
 
Join Date: Nov 2005
Posts: 157
Quote:
Originally Posted by Theliel View Post
I think that is impossible determinate. You only can compare the same frame. Its posible that now the 2nd frame with 39 are so bad that the old 1st 35, or maybe 1st frame with 39 dont have enought IQ. Differents frames different IQ.
(assuming IQ = Image Quality = My personal judgment of Image Quality )

Its possible that now the 2nd frame with 39 are so bad ...
Yes, but it is also possible that the large drop in the 2nd frame, from 45 to 35 may still generate a good visual quality to me (or IQ).

That is my problem with SSIM and PSNR. I know we need numbers to compare, personal opinion is too much subjective, check frame by frame is boring and that I just did it in 3 medium size samples, but all of them indicated me such discrepancies regard my concept of bad image quality versus SSIM and PSNR.
I can judge much more easily bad frames than the good ones.

Last edited by MarcioAB; 30th July 2007 at 03:09.
MarcioAB is offline   Reply With Quote
Old 30th July 2007, 09:13   #37  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Quote:
Let's assume for example, the first frame with 35 was visually bad and now with 39 became good and the 2nd frame with 45 was good and now with 39 it is still good (sure not as good as 45, but still visually good). I will say that parm I applied increased the quality despite the mean PSNR became reduced.
Yes I confirm that you don't know how work PSNR. The best way to compare quality video is Overall PSNR and not Average PSNR. Overall PSNR measure simply distortion between 3D matrix. In your example Overall PSNR could be better for 39,39 than for 45,35. But for me your example is typically a Rate Control tweak. In the reality if you use better ME/RDO search then 39db and 45db will generaly become 39.5 dB and 45.5 dB.

PSNR work good if you know how work PSNR. If you use CQM, AQ or other HVS setting then PSNR can't help. If you change only internal search for x264 (ME, RDO ... ect) then better OPSNR mean generaly better quality for eyes.
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9

Last edited by Sagittaire; 30th July 2007 at 09:20.
Sagittaire is offline   Reply With Quote
Old 30th July 2007, 20:43   #38  |  Link
DeathTheSheep
<The VFW Sheep of Death>
 
DeathTheSheep's Avatar
 
Join Date: Dec 2004
Location: Deathly pasture of VFW
Posts: 1,149
Quote:
3) In multipass encode, I understand there is a kind of "intelligence" in the encoder to choose where to compress more and where to compress less. Is this "intelligence" free to the programmer to choose ? (example: could be possible to analyze luminance in each frame and if dark, compress much less ?)
There is an underlying rate control algorithm you can tweak. It sticks more quality in better places, to put it simply, sacrificing some from highly complex scenes and sticking it in low-motion/complexity scenes in the attempt to deceive the eye into thinking the overall quality is the same high level. ...Well that's one funky way of putting it . qcomp, ratetol, etc....
__________________
Recommended all-in-one stop for x264/GCC needs on Windows: Komisar x264 builds!
DeathTheSheep is offline   Reply With Quote
Old 2nd August 2007, 02:08   #39  |  Link
MarcioAB
Registered User
 
MarcioAB's Avatar
 
Join Date: Nov 2005
Posts: 157
Quote:
Originally Posted by Sagittaire View Post
Yes I confirm that you don't know how work PSNR.
Ok.
Quote:
Originally Posted by Sagittaire View Post
The best way to compare quality video is Overall PSNR and not Average PSNR. Overall PSNR measure simply distortion between 3D matrix.
Ok ( quick question: Is this Overall PSNR the same as Global PSNR in x264 output ?)
If I understood well, OPSNR treat the entire video as a single picture. I wonder how a single number can be so meaningful for 200000 frames, but ok, let me respect that and use it as an auxiliary indicator.

After each PSNR "judgment", I tend to go to the "crime scene" and check. My perception (IMO) is that PSNR can see well "blurry" and "color shift" parts, but it is blind to "blocky".

To my taste, "blocky" is the worst part, followed by "blurry" and almost no care about "color shift".

Quote:
Originally Posted by Sagittaire View Post
In your example Overall PSNR could be better for 39,39 than for 45,35. But for me your example is typically a Rate Control tweak.
It is just an example to easy communication. I do not have such 2 frames.

Quote:
Originally Posted by Sagittaire View Post
In the reality if you use better ME/RDO search then 39db and 45db will generaly become 39.5 dB and 45.5 dB.
Correct. Tend to agree that PSNR/SSIM increase in both frames means the right move. The question is when one increase and the other decrease and/or when PSNR increase and SSIM decrease or vice-versa. Was that a good move. But ok, let us move on.

Quote:
Originally Posted by Sagittaire View Post
PSNR work good if you know how work PSNR. If you use CQM, AQ or other HVS setting then PSNR can't help. If you change only internal search for x264 (ME, RDO ... ect) then better OPSNR mean generaly better quality for eyes.
Thank you.
MarcioAB is offline   Reply With Quote
Old 2nd August 2007, 02:23   #40  |  Link
MarcioAB
Registered User
 
MarcioAB's Avatar
 
Join Date: Nov 2005
Posts: 157
Quote:
Originally Posted by DeathTheSheep View Post
There is an underlying rate control algorithm you can tweak.
qcomp, ratetol ? Could I have any comments on how these parms could work to improve the point you mention below ?

Quote:
Originally Posted by DeathTheSheep View Post
It sticks more quality in better places, to put it simply, sacrificing some from highly complex scenes and sticking it in low-motion/complexity scenes in the attempt to deceive the eye into thinking the overall quality is the same high level. ...Well that's one funky way of putting it . qcomp, ratetol, etc....
Nice. Like to move in this direction. Looking for something that could sacrifice some bits from highly clear (more light) areas in one frame and use them into more dark/low motion in another frame, even if those frames are 200000 frames apart.

Thank you
MarcioAB 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 18:58.


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