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 6th August 2007, 23:41   #1  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
why is it not possible (To use Trellis with deadzone options)?

As the question states, why is it supposedly not possible to use trellis with the deadzone options? I added deadzone options for inter and intra in my commandline with trellis-1 and 2, and avinaptic shows my lowered deadzone setting and trellis being used.

Quote:
Originally Posted by project357user
Inter / Intra luma quantization deadzone: Also known as inter/intra deadzone. Specifies the level of detail to be discarded and not taken into account by the encoder. Lower values discard less information, and therefore hand the encoder a more complex stream. The main use of these settings is to set a detail threshold. Lower settings can help grain retention, while higher settings may reduce noise. Use of deadzone settings requires trellis to be turned off.
Terranigma is offline   Reply With Quote
Old 6th August 2007, 23:57   #2  |  Link
HeadBangeR77
Registered User
 
HeadBangeR77's Avatar
 
Join Date: Dec 2006
Location: Heidelberg (DE), Kraków (PL)
Posts: 519
I've been wondering as well, why it's not possible (not that I'm a big fan of trellis :P). I can understand the approach of using dead zones with e.g. M4G's MRM and HRM matrices, and not to use trellis, to preserve some fine small details and grain. However, why it's technically not possible, if at all, I've got no clue.

According to my beloved avinaptic the flat matrix uses 21,11 for dead zones, and trellis can be safely use. So is it not: "dont' mess with dead zones when using trellis!" instead of "both exclude each other"???
__________________
"Only two things are infinite: the universe and human stupidity, and I'm not sure about the former."
HeadBangeR77 is offline   Reply With Quote
Old 6th August 2007, 23:59   #3  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Here's a screenshot I took of me using trellis-1 and a lowered deadzone setting.


Terranigma is offline   Reply With Quote
Old 7th August 2007, 00:35   #4  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,392
There are two different quantization algorithms: deadzone and trellis. Any given dct of a given block can only use one of them. Because, well, if you had two different values for each coefficient, what would you do with them?
--deadzone-inter and --deadzone-intra tweak a parameter of the deadzone algorithm. (The parameter in question is "deadzone", that's where the algorithm got its name.) --trellis determines when to use the trellis algorithm (0=never, 1=sometimes, 2=almost always); any dcts that don't use trellis must use deadzone instead.
So, the fact that --deadzone* still has some minor effect when you enable trellis does not contradict the fact that deadzone and trellis are incompatible.
Don't do that. If you enable trellis, then deadzone is only used as a fast estimate of trellis, so a reduced value of --deadzone does not provide any grain retention, it just reduces the precision of that estimate and thus of the mode decision process. Sure I could make x264 ignore --deadzone* if --trellis is enabled, but that would contradict my policy of "give the luser enough rope to hang himself".

That said, it might be possible to tweak trellis in a way that has similar results to --deadzone*. In which case --deadzone* could apply to trellis too, despite the name.

BTW, just because an option is printed in the userdata sei doesn't mean it had any effect on the encode. I remove some of the extraneous options (e.g. most of ratecontrol when using cqp), but still some options may be printed even if they're overridden by some other option.

Last edited by akupenguin; 7th August 2007 at 00:38.
akupenguin is offline   Reply With Quote
Old 7th August 2007, 00:48   #5  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Quote:
Originally Posted by akupenguin View Post
it might be possible to tweak trellis in a way that has similar results to --deadzone*. In which case --deadzone* could apply to trellis too, despite the name.
I think that'd be awesome.
btw, thanks for clearing this up, it's been nagging at me for quite some time.
Terranigma is offline   Reply With Quote
Old 7th August 2007, 07:56   #6  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
Quote:
Originally Posted by HeadBangeR77 View Post
(not that I'm a big fan of trellis :P)
I rather like trellis, myself, but since it isn't possible to set a deadzone(like) parameter for it, it would take more bitrate using trellis to get the desired grain/detail retention in some situations, mostly at high bitrates.

This also seems like as good a place as any to ask about "Quantizer noise shaping" (from ffmpeg) which sounds a bit like trellis, whats the difference? I read somewhere that "qns" uses a special dct transform, which would indicate to me that it is different then trellis, which only uses a speciall method of dropping dct coeficients.
*.mp4 guy is offline   Reply With Quote
Old 7th August 2007, 16:42   #7  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,392
qns computes weighted ssd in the pixel domain, whereas trellis computes ssd in the dct domain. Without weights the two are the same (modulo idct rounding), but with weights qns can do more precise spatial complexity masking.
akupenguin is offline   Reply With Quote
Old 8th August 2007, 22:15   #8  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 787
If your using AQ with Trellis, which quantization method would take precedence?

Or would the quantization use Trellis first, then tweak the quantization values with AQ? Or am I just totally wrong here. (am I trying to compare apples to oranges?)

I'm attempting to learn how each of these works and I'm doing several test to see what I like best. Just wondering how it works.

Thanks.
TheRyuu is offline   Reply With Quote
Old 8th August 2007, 22:28   #9  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,392
AQ is not a quantization algorithm. AQ is more related to ratecontrol: it chooses QP, which is an input to quantization.
akupenguin is offline   Reply With Quote
Old 8th August 2007, 22:33   #10  |  Link
Sagekilla
x264aholic
 
Join Date: Jul 2007
Location: New York
Posts: 1,752
Quote:
Originally Posted by akupenguin View Post
AQ is not a quantization algorithm. AQ is more related to ratecontrol: it chooses QP, which is an input to quantization.
Hmm.. this piqued my interest a bit. If the OP doesn't mind me asking, would that mean the output of AQ would be used for Trellis input?
Sagekilla is offline   Reply With Quote
Old 8th August 2007, 23:07   #11  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,392
Quantization (no matter whether it's deadzone or trellis) takes some DCT coefficients and a qscale (qscale = 2^(QP/6)), and divides the coefficients by the qscale. Deadzone and trellis differ in how they round the result of the division.
Ratecontrol chooses QP for a whole frame. If AQ is enabled, then AQ modifies the QP for some macroblocks.

Last edited by akupenguin; 8th August 2007 at 23:25.
akupenguin 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:44.


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