Digital Video
Digital Video
March 5, 2024
Digital Video
I Recall
−1
KP −1
KP
1
BPP(I) = NM HI (k)B(k) = pI (k)B(k)
k=0 k=0
−1
KP
E[I] = − pI (k)log2 (pI (k))
k=0
I Comparing equations, if B(k) = −log2 (pI (k)), optimum code
found - lower bound attained!
The Huffman Code
Symbol a e i o u
Range [0, 0.25) [0.25, 0.5) [0.5, 0.7) [0.7, 0.9) [0.9, 1)
I Initialize h = 1, l = 0
I Loop over all source symbols
I r =h−l
I h = l + r ∗ hs
I l = l + r ∗ ls
I Final output is any real number in the interval [h, l)
Arithmetic Decoding Algorithm
I Example on board . . .
Lossy Coding – Goals
I Goal: Find the block with the minimum error with respect
to the original block:
FIND:min(d1 ,d2 ) ||B I(i, j, k) − B I(i + d1 , j + d2 , k + 1)||
where ||.|| is an error metric such as (assume P × Q blocks):
MSE(d 1 ,P
d2 ) =
1 P
PQ [I (i −m, j −n, k)−I (i −m +d1 , j −n +d2 , k +1)]2
(m,n)∈B
MAD(d 1 ,P
d2 ) =
1 P
PQ |I (i − m, j − n, k) − I (i − m + d1 , j − n + d2 , k + 1)|
(m,n)∈B
I MAD is commonly used in practice - no computation of
squares:
(d1∗ , d2∗ ) = arg min(d1 ,d2 ) MAD(d1 , d2 )
Block Searching
I Step 2: Localize the search near the best match from Step 1:
Three-Step Search
I Step 3: Localize the search near the best match from Step 2:
Aspect ratio: The ratio of the width of a video frame to its height
I Specifies the order in which Intra (I) and Inter (P, B) frames
are arranged in a video sequence
I Standardized in 2003
I A large, complex video standard
I High-level overview here
I Good reference: “The H.264 Advanced Video Compression
Standard” by Iain E. Richardson, Wiley, 2010
H.264 - The Highlights
I The initial estimates u (0) (i, j), v (0) (i, j) might be taken from
some independent estimate of u, v or simply by taking
u (0) (i, j) = v (0) (i, j) = 0 which gives
I t Ix
u (1) (i, j) = −λ 1+λ(I 2 +I 2 )
x y
I I
v (1) (i, j) = −λ 1+λ(It 2y+I 2 )
x y
Iteration Limit