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. |
|
|
Thread Tools | Search this Thread | Display Modes |
8th April 2006, 17:28 | #1 | Link |
Registered User
Join Date: Feb 2004
Posts: 1,348
|
How To Use Mpeg4 AVC Deblocking Effectively (Small FAQ)
In X264 there are two deblocking parameters, called Deblocking strength and Deblocking threshold. The strength parameter refers to Alpha Deblocking, while the Threshold Parameter refers to Beta Deblocking (Alpha and Beta Deblocking are the official names). When a deblock setting is written as X:X (for instance 0:0 or 2:-2) the first number is alpha deblocking, while the second is beta deblocking.
Alpha deblocking effects the overal amount of deblocking to be applied to the picture, higher values deblock more effectively, but also destroy more detail and cause the entire image to be softened. The default value of 0 is almost always sufficient to get rid of most blocking (especialy when using a cqm), but leaves the picture noticibly blurier. In general use this value should be no lower then -3 and no higher then 3. When using a cqm the authors recomended settings should be used as the default value, and shouldn't be altered by more then +/-2. Alpha Deblocking is the most important parameter in determining the overal sharpness of your encode. Beta Deblocking is a bit more tricky to use, Beta Deblocking determines whether something in a block is a detail or not when deblocking is aplied to it. Lower values of Beta Deblocking apply less deblocking to more flat blocks with details present (but more deblocking to blocks without details), while Higher values cause more deblocking to be applied to less flat blocks with details present. Generally Beta Deblocking shouldn't be altered unless you are haveing problems with the default setting. Raising Beta deblocking is a good way to help get rid of ringing artifacts by aplying more aggressive filtering to blocks that aren't very flat. Lowering beta Deblocking is a good way to reduce the amount of DCT blocks without bluring the entire picture. A high value of beta deblocking will cause nonflat blocks to be deblocked more aggressively, while a low value will cause the opposite. If you wan't to give your encodes a more detailed look and don't mind the occasional block try a setting of -2:-1. If you like a clean picture and don't mind a little bluriness try 1:2. A nice trick for anime is to use lower beta deblocking setting because it won't blur out lines as much that way. Last edited by *.mp4 guy; 9th April 2006 at 15:14. |
8th April 2006, 18:03 | #2 | Link |
Registered User
Join Date: Mar 2005
Location: Italy
Posts: 286
|
Thanks for the easy faq! In effect I was using in the wrong way the beta deblocking until now (I haven't ever used beta deblocking under 0 XD).
Thank you, I'll try them (the fact is that generally my AVC encodings are made at low bitrate, only occasionally I made DVD back-ups at full screen, generally are PSP videos at 200kbps max XD, so I use high values of alpha and beta deblocking). |
8th April 2006, 20:03 | #4 | Link | ||
brontosaurusrex
Join Date: Oct 2001
Posts: 2,392
|
Quote:
Quote:
|
||
8th April 2006, 20:54 | #7 | Link |
Registered User
Join Date: Feb 2004
Posts: 1,348
|
Thats a very hard question to answer. If you are using the standard matrix you are safest with the default settings. I would have to have more information about your source and the settings you are using to be able to give you a thorough answer. furthermore Deblocking is to a large extent personal preference.
|
8th April 2006, 21:24 | #8 | Link | ||
BluRay Maniac
Join Date: Dec 2005
Posts: 2,419
|
Yes i using standard matrix and currently this settings for movie "Just Friends", i am very happy with results but always must some scene looks very blockly so
Quote:
Quote:
|
||
8th April 2006, 22:59 | #10 | Link |
Registered User
Join Date: Feb 2004
Posts: 1,348
|
@Shon3i
Denoising should be avoided when you have problems with blocking, because it will only make things worse. I'm assuming you are having problems with blocks on gradients and flat areas as that is the most common problem. A setting of 2:-2 should get rid of most of the blocking without influencing detail to much. If your willing to use a cqm try this one It should reduce your blocking without introducing any other problems, If you want a sharper picture you could try -2:-2 with the cqm. @Sirber I don't encode anime much, but I've got some general ideas that might work for you, of coarse deblocking is quite subjective... Low- 0:3 Medium- 1:-1 High- 0:-3 Last edited by *.mp4 guy; 8th April 2006 at 23:08. |
8th April 2006, 23:34 | #12 | Link |
Registered User
Join Date: Feb 2004
Posts: 1,348
|
Setting a higher Beta level is most helpful when You have exessive ringing or line degredation, its also usefull in removing misquito noise. So If you have a significant amount of those artifacts setting beta higher could help. When aiming for complete transparency lowering beta helps retain all the available details.
|
9th April 2006, 11:41 | #13 | Link |
Registered User
Join Date: Nov 2003
Location: vancouver
Posts: 93
|
it might help some ppl to think in terms of XviD or ASP:
the alpha deblocking is kinda like your post-processing, with deblocking applied impartially over the whole frame. Then the beta deblocking is like the codec's own inbuilt smoothing algorithm which is used during compression. or am i way off?
__________________
Soulcake. Duck. Mmmm. Good. |
9th April 2006, 12:28 | #15 | Link | |
aka XaS
Join Date: Jun 2005
Location: France
Posts: 1,122
|
Thx *.mp4 guy for this FAQ
But I think this says it all, really : Quote:
The bigger the strength (alpha), the more details you lose on each processed macrobloc ... The bigger the threshold (beta), the more macroblocs get processed ... Note : -6:-6 is nearly identical to turning the inloop filter off. Negative values don't sharpen the picture more than it is, they just remove less detail than the default 0:0 But obviously, throwing "return avisource("yourclip.avi").Trim(500)" into x264 and testing ourselves is the way to go PS : if anyone wants to compare ALL the inloop settings, be prepared to do (6+1+6)² = 169 encodes. Havefun ^^
__________________
Q9300 OC @ 3.2ghz / Asus P5E3 / 4GB PC10600 / Geforce 8600 GTS Last edited by DarkZell666; 9th April 2006 at 12:37. |
|
9th April 2006, 12:41 | #16 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,562
|
No, I thought it worked like that once too, until manao chastized me. All macroblocks with quant > 15 are always processed.
Like, say if normally, a block with twice as many (high frequency) details was smoothed twice as hard as one with fewer details. By lowering beta you could make that be smoothed 1/4 as hard, or by raising it make it smoothed just as hard. So it changes the way the smoothing scales, which is already based on the detail present. This is what I get out of it, so far, anyway. |
9th April 2006, 12:48 | #17 | Link | |
aka XaS
Join Date: Jun 2005
Location: France
Posts: 1,122
|
Quote:
__________________
Q9300 OC @ 3.2ghz / Asus P5E3 / 4GB PC10600 / Geforce 8600 GTS |
|
9th April 2006, 15:09 | #18 | Link |
Registered User
Join Date: Feb 2004
Posts: 1,348
|
@DarkZell666
Something like that, its very hard to explain properly. Basically it determines whether something in a block is an artifact and should be smoothed or whether it is a detail and should be kept. lowering it causes only blocks with few details/artifacts to be smoothed more, while raising it causes blocks with more detail/artifacts to be smoothed more. @shon3i Yes it should work well in your bitrate range, but it shouldn't be used on anime. Last edited by *.mp4 guy; 9th April 2006 at 15:11. |
10th April 2006, 08:16 | #19 | Link | |
Registered User
Join Date: Jan 2002
Location: France
Posts: 2,856
|
Quote:
All macroblocks whose [quantizer + min(alpha,beta)] > 15 may be processed. And, in those macroblocks, some conditions can make the deblocking not to be applied ( for example, borders of skips with same motion vectors aren't deblocked ).
__________________
|
|
10th April 2006, 18:03 | #20 | Link | |
x264 developer
Join Date: Sep 2004
Posts: 2,392
|
Quote:
The real criterion is: there is a threshold based on [qp + 2*alpha] and another threshold based on [qp + 2*beta]. The texture/gradient/whatever must pass both thresholds before any filtering is applied. The thresholds are 0 when [qp + 2*(alpha or beta)] <= 15. But they are still small for only slightly above 15, so most pixels will fail the threshold then too. If a given pixel passes both thresholds, then it is filtered with strength dependent on [qp + 2*alpha]. Both thresholds and strength also depend on motion vectors and dct residuals. (This is what disqualifies Skip blocks with uniform motion.) Last edited by akupenguin; 10th April 2006 at 18:07. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|