02 Motion Compensation
02 Motion Compensation
Motion-compensated prediction
Motion-compensated hybrid coding
Motion estimation by block-matching
Motion estimation with sub-pixel accuracy
Power spectral density of the motion-compensated
prediction error
Rate-distortion analysis
Loop filter
Motion compensated coding with sub-pixel accuracy
Rate-constrained motion estimation
⎛ dx ⎞
„Displacement vector“ ⎜ ⎟ shifted
⎝ dy ⎠ object
Prediction for the luminance signal S(x,y,t) within the moving object:
T Q T T Q
- -
−1 −1
T T
T
PT T −1 PTS T
T −1 T −1
PT PS
Coder
Control Control
Data
Intra-frame
DCT
DCT Coder
- Coefficients
Decoder Intra-frame
Decoder
0
Motion-
Compensated
Intra/Inter Predictor
Motion
Data
Motion
Estimator
Control
Data
DCT
Coefficients
Decoder Intra-frame
Decoder
0
Motion-
Compensated
Intra/Inter Predictor
Motion
Data
∑
2
SSD(d x , d y ) = ⎡⎣ S k ( x, y ) − Sk −1 ( x + d x , y + d y ) ⎤⎦
x,y∈Block
Horizontal Vertical
shift shift
30 44 45 45 45 42 30 21 26 27 18
54 53 52 49 31 21
35 54 54 54
53 53
52
54 52
49
53
54 49
31
52
53 31
21
49
52 21
28
31
49 24
21
31 15
21
62 63 59 60 44 33
40 63 62 62
63 63
59
62 59
60
63
62 60
44
59
63 44
33
60
59 33
35
44
60 31
33
44 26
33
77 71 73 75 63 52
50 78 77 77
71 71
73
77 73
75
71
77 75
63
73
71 63
52
75
73 52
47
63
75 46
52
63 29
52
22 37 37 37 39 40 40 41 41 38 25
1.6
SSD1.4
1.2
0.8
0.6
0.4
Estimated
Estimateddisplacement
displacement
0.2
Integer-pixel
Integer-pixelaccuracy
accuracy
0
0 14
12
5 10
10 8
6
Vertica 15 2 4
hift d x
l shift d n t al s
y Horizo
SSD Sub-pixel
Accurate Fit parabola
Minimum through
3>3points
points
exactly
approximately
Horizontal shift dx
Paraboloid
SSD
Perfect fit through 6 points
Ve
rtic
a ls
hif hi ft dx
td n t als
iz o
y
H or
dx
∑ Sk − Sk −1 ≥ ∑ Sk − Sk −1 = ∑ Sk − ∑ Sk −1
block block block block
2 2
1⎛ ⎞ 1⎛ ⎞
∑ ( Sk − Sk −1 ) ∑ k k −1 ⎟⎠ N ⎜⎝ block
∑ k block
∑ k −1 ⎟⎠
2
≥ − = −
N ⎜⎝ block
S S S S
block
Block
matching
current frame
previous frame
Filtering
and
Block subsampling
matching
Filtering
and
Block subsampling
matching
Block
matching
Displacement
vector field with Interpolation
integer-pel
accuracy
Block
matching
current frame
previousframe
Filtering
and
Block subsampling
matching
Filtering
and
Block subsampling
matching
brightness
Interpolated
Pixel Value
I(x’,y’)
intraframe
decoder
e‘
motion s‘
compensated
predictor
displacement estimate
⎛ dx ⎞ ⎛ Δ x ⎞
true displacement ⎜d ⎟ + ⎜Δ ⎟ displacement error
⎝ y⎠ ⎝ y⎠
Bernd Girod: EE398B Image Communication II Motion Compensated Coding no. 26
Analysis of the motion-compensated prediction error
Motion-compensated signal
c ( x) = s ( x − Δx ) − n ( x)
Prediction error
Previous e ( x) = s ( x) − c ( x)
frame = s ( x) − s ( x − Δx ) + n ( x)
x
c(x) s(x)
Current
frame
Displacement dx Displacement error Δx
e( x) = s ( x) − c( x) = s ( x) − s ( x −Δx ) + n( x) = (δ ( x) −δ ( x −Δx ) ) ∗ s ( x) + n( x)
Power spectrum of prediction error, assuming constant displacement
error Δ x, statistical independence of s and n
( )( )
Φ ee (ω ) = Φ ss (ω ) 1 − e − jωΔ x 1 − e jωΔ x + Φ nn (ω )
( {
= 2Φ ss (ω ) 1 − Re e − jωΔ x }) + Φ nn (ω )
= 2Φ ss (ω ) (1 − Re { E {e }}) + Φ (ω )
− jωΔ x
nn
= 2Φ ss (ω ) (1 − Re { P (ω )}) + Φ (ω ) nn
What is P(ω)? {
P ( ω ) = E e − jω Δ x }
∞
= ∫ { }
p Δ x ( Δ ) e − jω Δ d Δ = F p Δ x ( Δ x )
−∞
( )
Φ ee (ω x , ω y ) = 2Φ ss (ω x , ω y ) 1 − Re { P(ω x , ω y )} + Φ nn (ω x , ω y )
π
0
frequency ω x
Bernd Girod: EE398B Image Communication II Motion Compensated Coding no. 30
R-D function for MCP with integer-pixel accuracy
Minimum bit-rate for given SNR
(Δ x , Δ y ) assumed
T
uniformly distributed
between
1
Δ x = ± pel
2
1
Δ y = ± line ~0.7 bpp
2
Gaussian signal model 3
2 −
⎛ ωx +ω y ⎞ 2
2
Φ ss (ω x , ω y ) = A⎜ 1 +
⎝ ω 02 ⎟⎠
Typical parameters for CIF
resolution (352 x 288
pixels)
p(Δ x , Δ y ) isotropic
Gaussian pdf with variance σ
2
3
−
⎛ ω +ω ⎞
2 2
2
Φss (ω x , ω y ) = A⎜1+
x y
ω02 ⎟⎠
⎝
Typical parameters for CIF
resolution (352 x 288 pixels)
Minimum bit-rate for
SNR = 30 dB
intraframe
decoder
spatial
filter
F
motion
compensated
predictor
displacement estimate
⎛ dx ⎞ ⎛ Δ x ⎞
true displacement ⎜d ⎟ + ⎜Δ ⎟ displacement error
⎝ y⎠ ⎝ y⎠
Bernd Girod: EE398B Image Communication II Motion Compensated Coding no. 33
Motion-compensated prediction error with loop filter
x
c(x) s(x)
Current
frame
Displacement dx Displacement error Δx
Φee (Λ) = Φss (Λ) (1+ | F(Λ)|2 −2Re{ F(Λ)P(Λ)} ) +Φnn (Λ)| F(Λ)|2
∗ Φ ss (Λ )
Fopt (Λ ) = P (Λ ) ⋅
123 Φ (Λ ) + Φ (Λ )
1442443
ss nn
⎛ Φ ss (Λ ) ⎞
Φ ee (Λ ) = Φ ss (Λ ) ⎜1− | P(Λ ) |2
⎟
⎝ Φ ss (Λ ) + Φ nn (Λ ) ⎠
~0.8 bpp
∗ Φ ss (Λ )
Fopt (Λ ) = P (Λ ) ⋅
123 Φ (Λ ) + Φ (Λ )
1442443
ss nn
Zoom Voiture
500
Bit Rate [kbps]
400
Intra mode
300 only
Integer-pel
accuracy
200
1/2-pel
100 accuracy
0
24 30 36
Simulation details: PSNR [dB]
Foreman, QCIF, SKIP=2
Q=4,5,7,10,15,25
motion vector D
bit-rate R rate Rm
prediction error
rate Re
∂D ∂D
optimum trade-off: =
∂Rm ∂Re
min(D + λRm )
34
TMN-10, 10
32 w/o rate-constrained
motion estimation (TMN-9) TMN-10,
30 w/o rate-constrained
5 motion estimation (TMN-9)
28
26 0
0 50 100 150 200 0 50 100 150 200
Bit Rate [kbps] Bit Rate [kbps]
Simulation details:
Foreman, QCIF, SKIP=2
Q=4,5,7,10,15,25
Annexes D+F
Video Decoder
z Quantizer step size Intraframe
Decoder
z Suppression of DCT coefficients
Solution
z Embed rate-constrained motion 0
estimation into mode decision Motion-
Compensated
with Lagrangian cost function Predictor
Intra/Inter
z Couple Lagrange multiplier to
quantizer step size Motion
Difficulties Data
Complexity
• Intraframe coding: only spatial correlation exploited
Î DCT [Ahmed, Natarajan, Rao 1974], JPEG [1992] increases
• Conditional replenishment
Î H.120 [1984] (DPCM, scalar quantization)
• Frame difference coding
Î H.120 Version 2 [1988]
• Motion compensation: integer-pel accurate displacements
Î H.261 [1991]
• Half-pel accurate motion compensation
Î MPEG-1 [1993], MPEG-2/H.262 [1994]
• Variable block-size motion compensation
Î H.263 [1996], MPEG-4 [1999]
PSNR Variable
[dB] block size
motion Conditional Mother & Daughter
42 compensation Replenishment
10 Hz, QCIF
(H.263 1996) (H.120)
40 100 frames encoded
38
36
34 Intraframe
DCT coding
32 (JPEG)
60 %
30
Bit-Rate [kbps]
28
0 100 200 300 400
PSNR
[dB]
40 Mobile & Calendar
Variable
38 block size 10 Hz, QCIF
motion 35 % 100 frames encoded
36 compensation 40 %
34 (H.263 1996)
32
30
Intraframe
28 DCT coding
Integer-pel (JPEG)
26 motion
compensation
24 (H.261 1991)
Bit-Rate [kbps]
22
0 500 1000 1500