Personal View site logo

User Tools

Site Tools


avchd-resource-wip:avchd:deblocking

Deblocking

Definition: Deblocking Filtering - Deblocking Filtering plays an important role in conjunction with Quantization. Basically deblocking compensates for Quantization artifacts that appear from macroblock to macroblock. Deblocking filters have two parameters - alpha and beta. Beta determines a threshold before filtering is applied, alpha determines how much filtering to apply. Valid ranges for both parameters range from -6 to +6. A value of -6 is the least filtering, and +6 is the most. If both parameters are -6 then deblocking is essentially turned off.

Practical use of deblocking filter in GH2 by cbrandin

You will notice that with the Panasonic default Quantization Scaling Matrices the QP scaling for I frames tends to be lower (higher quality) than for P and B frames. Consequently, the deblocking filtering has to be more aggressive for P and B frames than for I frames to compensate - which if you look at the Panasonic default deblocking tables is indeed the case.

If I frames are quantized and/or scaled to a lower value than the P and B frames then more deblocking filtering needs to be applied to P and B frames. If the same Scaling Tables are applied to all frame types (or close to that), then the deblocking tables would need to be the same for all frame types.

Information about deblocking tables, and worksheets to create new ones can be found in the “Scaling Matrix Builder” spreadsheet (which is attached to media manager under the development section).

The above section was written & updated by — Chris Brandin 2012/01/14.


The InLoop Deblocking Filter Definition by vladnik (needs integrating with above)

Definition: This setting controls one of the codec's' most important features: the Inloop Deblocking filter. In contrast to MPEG-4 ASP (DivX, Xvid, etc.) the Inloop Deblocking is a mandatory feature of the H.264 standard. So the encoder, The GH2 in this case, can rely on the decoder to perform a proper deblocking. Furthermore all P and B Frames in H.264 streams refer to the deblocked frames instead of the unprocessed ones, which improves the compressibility.

There is absolutely no reason the completely disable the Inloop Deblocking, so it's highly recommended to keep it enabled in all cases. There are two settings available to configure the Inloop Deblocking filter: Strength: This setting is also called “Alpha Deblocking”. It controls how much the Deblocking filter will smooth the video, so it has an important effect on the overall sharpness of your video. The default value is 0 and should be enough to smooth out all the blocks from your video, especially in Quantizer Modes (QP or CRF). Negative values will give a more sharp video, but they will also increases the danger of visible block artifacts! In contrast positive values will result in a smoother video, but they will also remove more details. Threshold: This setting is also called “Beta Deblocking” and it's more difficult to handle than Alpha Deblocking. It controls the threshold for block detection. The default value is 0 and should be enough to detect all blocks in your video. Negative values will “save” more details, but more blocks might slip through (especially in flat areas). In contrast positive values will remove more details and catch more blocks. Remarks: Generally there is no need to change the default setting of 0:0 for Strength:Threshold, as it gives very good results for a wide range of videos. Nevertheless you can try out different settings to find the optimal settings for your eyes. If you like a more sharp video and don't mind a few blocks here and there, then you might be happy with -2:-1. This might also be worth a try for MPEG-4 ASP (DivX, Xvid, etc.) users! If you like a smooth and clean image or encode a lot of Anime stuff, then you can try something like 1:2. Nevertheless you should not leave the range between -3 and +2 for both settins!

Now we have high bitrates so we need Ptool option to disable loop filter and get beter detalis and sharpness.

The above section was lifted from a quote by — vladnik 2011/08/30 (http://www.personal-view.com/talks/discussion/comment/11873#Comment_11873)


GH2 Stock Settings Deblocking:

  • Table Flag1i = 00 to 24: -3,-6 (0x4DA) & 25 to 51: -2,-5 (0x4EB)
  • Table Flag1P = 00 to 24: -2,-5 (0x4EB) & 25 to 51: -1,-4 (0x4FC)
  • Table Flag1B = 00 to 24: 0,-3 (0x40D) & 25 to 51: 1,-1 (0x41F)
  • Table High I = 00 to 51: -2,-4 (0x4EC)
  • Table High P = 00 to 24: -1,-3 (0x4FD) & 25 to 51: 0,-2 (0x40E)
  • Table High B = 00 to 51: 1,-1 (0x41F)

Interesting links referring to deblocking;-

  1. Compression Technology Recent Trends http://www.nabanet.com/wbuarea/library/docs/isog/presentations/2011/2.2.3%20PLauzon.pdf by Pierre Lauzon (May 19, 2011).
avchd-resource-wip/avchd/deblocking.txt · Last modified: 2012/03/14 18:51 by driftwood