Patent ID: 7496141

Claim:
A method for reducing a blocking artifact in a video stream, the method comprising: calculating an activity value representing the local activity around a block boundary between a plurality of adjacent blocks in the video stream; determining a region mode for the block boundary according to the activity value; adaptively determining a plurality of thresholds according to at least differences in the values of quantization parameters (QPs) of the adjacent blocks; filtering a plurality of pixels around the block boundary to reduce the blocking artifact according to the region mode and the plurality of thresholds; adaptively determining a first threshold TH 0 _INTRA, a third threshold TH 0 _INTER, a fourth threshold TH 1 _INTRA, a fifth threshold TH 2 _INTRA, a sixth threshold TH 1 _INTER, and a seventh threshold TH 2 _INTER; wherein when determining the first, third, fourth, fifth, sixth, and seventh thresholds, at least taking into account differences in QPs of the adjacent blocks; and taking into account a user defined offset (UDO) allowing the first, third fourth, fifth, sixth, and seventh threshold levels to be adjusted according to the UDO value; wherein: the first threshold TH 0 _INTRA is calculated as: TH 0 _INTRA=−2+(QP 1 +QP 2 )+·UDO; the third threshold TH 0 _INTER is calculated as: TH 0 _INTER=−2+(QP 1 +QP 2 )−2·MVI −2 ·BFlag+2·UDO; the fourth threshold TH 1 _INTRA is calculated as: TH1_INTRA = - 1 + 1 2 · ( QP ⁢ ⁢ 1 + QP ⁢ ⁢ 2 ) + 1 2 ·  QP ⁢ ⁢ 1 - QP ⁢ ⁢ 2  + UDO ; the fifth threshold TH 2 _INTRA is calculated as: TH 2 _INTRA=−2+(QP 1 =QP 2 )+|QP 1 −QP 2 |+2·UDO; the sixth threshold TH 1 _INTER is calculated as: TH1_INTER = a + 1 2 · ( QP ⁢ ⁢ 1 + QP ⁢ ⁢ 2 ) + 1 2 ·  QP ⁢ ⁢ 1 - QP ⁢ ⁢ 2  + 2 · MVI - 2 · BFlag + UDO ; the seventh threshold TH 2 _INTER is calculated as: TH2_INTER = a + ( QP ⁢ ⁢ 1 + QP ⁢ ⁢ 2 ) + 1 2 ·  QP ⁢ ⁢ 1 - QP ⁢ ⁢ 2  - 2 · MVI - 2 · BFlag + 2 · UDO ; MVI represents the motion vector indicator; if the picture is B-picture, BFlag is set to 1, otherwise, BFlag is set to 0; and if the 8×8 block boundary is also a macroblock (MB) boundary, a is set to −1, otherwise, a is set to −3.