Adaptive Deblocking Filter

Download Report

Transcript Adaptive Deblocking Filter

Course Project:
Adaptive Deblocking
Filter in H.264
Ehsan Maani
Goal
example of the square error distribution
over a 4x4 block.
122
107
106
111
103
102
101
112
106
100
98
110
121
105
101
123
Block Sources
• Block-based discrete cosine transform
(DCTs) and coarse quantization of the
transform coefficients.
• Motion compensated blocks. (blocks copied
from different locations of the reference
frames.)
Different problem approaches
• Post Filter: Operates at the display buffer
outside of the coding loop.
• Loop Filter: Operates inside coding loop,
i.e. filtered frames are used as reference
frames for motion compensation.
Loop filter vs. Post filter
• Encoder performs the deblocking; thus,
content providers can safely assume that
their material is processed by proper
deblocking filter.
• There is no need for an extra buffer at the
decoder .
• Loop filters achieve higher quality by
preventing propagation of blocking artifacts
due to motion compensation.
Filter Adaptivity
• On the slice level, the global filtering strength can
be adjusted to the individual characteristics of the
sequence.
• On the block-edge level, filter strength depends
on the parameters of the participating blocks.
• On the sample level, sample values and
quantizer-dependent thresholds can turn the filter off
for each individual sample
Edge-Level Adaptivity
• To every edge between two 4x4 luminance samples,
a Boundary-Strength (Bs) is assigned an integer
value between 0 to 4.
16 pix
A macroblock
16 pix
Block modes and conditions
Bs
One of the blocks is Intra and the edge
is a macroblock edge.
4
One of the blocks is Intra
3
One of the blocks has coded residues
2
Difference of block motion >1 luma
sample
1
Motion compensation from different
reference frames
1
Else
0
Sample-Level Adaptivity
|p0-q0| < a (IndexA)
|p1-p0| < b (IndexB)
|q1-q0| < b (IndexB)
p3
250
200
150
100
50
IndexA and IndexB
linearly depend on QP
and offset parameters
p2
p1
p0
q0
q1
q2
1-D visualization of a block edge
Value
• Filtering on a line of
samples takes place
only if:
0
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
1
50
42
48
54
63
69
78
90
99
114
126
144
159
180
204
228
11
255
10
11
11
12
12
a 13
b
13
14
14
15
15
16
16
17
17
21
31
18
index
41
Pre-defined arrays a and b
q3
Filtering with Bs<4
• Let
 0i  (4(q 0  p 0 )  (( p 1 q 1)  4)  3
p3
p2
p1
p0
q0
q1
q2
q3
1-D visualization of a block edge
30
then, edge pixel values
are calculated as
p 0  p 0  0
q 0  q 0  0
Threshold
25
Bs=1
20
Bs=2
Bs=3
21
31
15
10
5
0
1
11
Index
41
51
Filtering with Bs<4
• Furthermore, if
p 2  p 0  b ( Index B )
q 2  q 0  b ( Index B )
Then

p1i
 ( p 2 (( p 0 q 0 1)  1)  2 p 1)  1
and
p 1  p 1  p1
q 1  q 1  p1
p3
p2
p1
p0
q0
q1
q2
q3
Filtering with Bs=4
• In nearly uniform image areas very small differences
in intensity values are perceived as abrupt steps;
thus, if
p 0  q 0  (a  2)  2
then, a very strong 4- and 5-tap filter is used that
modifies the edge and two interior luma samples.
Otherwise a weaker 3-tap filter is used.
Results
PSNR=29.3374
SSIM=0.8043
PSNR=29.7730
SSIM=0.8500
Results
PSNR=30.1537
SSIM=0.7902
PSNR=30.4492
SSIM=0.8115