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 25th August 2009, 15:26   #1  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 354
H264 CRF/CQ modes - size as settings testing parameter ?

In X264 2pass fixed size mode, there is known trade off of settings speed versus quality.
Also parameter usage description is aimed usually toward 2pass result.

In CQ mode, for parameter testing purposes,
I suppose there is trade off speed versus smaller size by more efficient encoding, with quality given by Q.
Or are there settings, causing changing of quality, that would be be misevaluated comparing speed and size ?


What about CRF ?
there is said some settings make better quality for same size, other smaller size for same quality, some even both.
Does make sense here comparing settings by time and final size ?

Can be gain/price (size/speed] results from CQ testing be used in CRF encoding ?

PS: BTW, I agree 2pass would give better results for size=final size of CRF.
but if exact size doesnot matter and if I use saved time for slower, more efficient settings....
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]

Last edited by Poutnik; 25th August 2009 at 15:33.
Poutnik is offline   Reply With Quote
Old 25th August 2009, 15:34   #2  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 959
2-pass and crf are (nearly) equivalent in quality at the same bitrate. You can use the same settings for both the second pass and crf. Nobody should use constant quantiser for anything but testing.

[EDIT] Altering the encoding settings does affect the quality crf produces so you cannot say that changing setting X results in Y loss of compression.

Also, to clarify, neither 2-pass or crf are better than the other because they both have benefits. 2-pass has the benefit of better direct prediction but crf has the benefit of using the lookahead MV predictors.
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.

Last edited by J_Darnley; 25th August 2009 at 15:49.
J_Darnley is offline   Reply With Quote
Old 25th August 2009, 16:32   #3  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,393
Just do your tradeoff testing in 2pass, and the same conclusions will apply to CRF too. CQP will not be identical, because CRF predictably raises QP on some frames and lowers it on others, which will be correlated with the frame contents, which in turn affect which features are important.
Caveats: slicetype and mbtree spend their cputime on the 1st pass, whereas all other options should be measured by 2nd pass speed, if you want to predict their effect on CRF speed. Measurements of threading efficiency also depend on what's done when, so those can't be generalized from 2 to 1 pass.
Otoh, speed depends on bitrate (though less so than in a decoder), so even though CRF's quality isn't sufficiently constant to measure just size, you might get more accuracy by measuring CRF's speed and 2pass's quality on each option set.
akupenguin is offline   Reply With Quote
Old 26th August 2009, 19:46   #4  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 354
Hmm, nice, I had no idea how dynamic CRF is.
I could find 16-35 in the same frame, and 20-30 is typical.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 28th August 2009, 17:42   #5  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 354
Quote:
Originally Posted by akupenguin View Post
Just do your tradeoff testing in 2pass, and the same conclusions will apply to CRF too. CQP will not be identical, because CRF predictably raises QP on some frames and lowers it on others, which will be correlated with the frame contents, which in turn affect which features are important.
Caveats: slicetype and mbtree spend their cputime on the 1st pass, whereas all other options should be measured by 2nd pass speed, if you want to predict their effect on CRF speed. Measurements of threading efficiency also depend on what's done when, so those can't be generalized from 2 to 1 pass.
Otoh, speed depends on bitrate (though less so than in a decoder), so even though CRF's quality isn't sufficiently constant to measure just size, you might get more accuracy by measuring CRF's speed and 2pass's quality on each option set.
It seems to me results of settings tweak tests
for CQ cannot easily be applied to CRF as CRF changes quality,
for 2pass cannot easily be applied to CRF as CRF changes size.

I would say one can choose his favorite fast, balanced and HQ settings on 2pass,
and then for these settings balance CRF-Q to produce roughly same size.
E.g. my slow settings for CRFQ25 produce for same source about same size as CRFQ26 wit default settings. ( well, it is source dependent ).
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]

Last edited by Poutnik; 28th August 2009 at 17:49.
Poutnik is offline   Reply With Quote
Old 28th August 2009, 17:52   #6  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,393
Quote:
Originally Posted by Poutnik View Post
It seems to me results of settings tweak tests
for CQ cannot easily be applied to CRF as CRF changes quality,
for 2pass cannot easily be applied to CRF as CRF changes size.
So? Speed-vs-compression settings have the same speed-vs-compression effects, regardless of what ratecontrol mode you use.
akupenguin is offline   Reply With Quote
Old 29th August 2009, 03:17   #7  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 354
Nothing against your conclusion.
I may be wrong, but I think it is not mutually excluding with my post.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 29th August 2009, 03:28   #8  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,564
Poutnik, what's meant is that when you test settings in 2-pass mode, if you set a crf with those settings to end up with the same size, you'll get the same quality. Each set of settings would be a different crf, in this case - use it once you're happy with quality or you'll go mad finding the magic numbers. Your method works, it's just unnecessarily tedious and wasteful attempting to find it the values in reverse.
foxyshadis is offline   Reply With Quote
Old 29th August 2009, 05:44   #9  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 354
Thanky you, foxyshadis, for your comment. I think the same.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Reply

Tags
settings, testing, 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 15:05.


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