JPEG and H.26x Standards
JPEG and H.26x Standards
JPEG and H.26x Standards
time
Fn
= bits/sec
bps
One Frame =
3 pictures (YCrCb)
F2
F1
1920x1080
0.19
11.20
671.85
671,846.40
1280x720
0.08
4.98
298.60
298,598.40
640x480
0.03
1.66
99.53
99,532.80
320x240
0.01
0.41
24.88
24,883.20
160x120
0.00
0.10
6.22
6,220.80
1280x720 (1.77)
640x480 (1.33)
320x240
160x120
Effects of Compression
storage for 1 hour of compressed video in megabytes
Compression
ration
1:1
3:1
6:1
25:1
100:1
1920x1080
671,846
223,949
111,974
26,874
6,718
1280x720
298,598
99,533
49,766
11,944
2,986
640x480
99,533
33,178
16,589
3,981
995
320x240
24,883
8,294
4,147
995
249
160x120
6,221
2,074
1,037
249
62
3 bytes/pixel, 30 frames/sec
Coding Overview
Digitize
640x480
Subsample to reduce data
Compression algorithms exploit:
Spatial redundancy - correlation between neighboring pixels
320x240
Intra-frame compression
remove redundancy within frame
Inter-frames
Symbol Coding
Efficient coding of sequence of symbols
Intra-frame
Transform Coding
N x M image
F(u,v)
Transform
Function
nxn
blocks
YCrCb
Fq(u,v)
u
Quantizer
q(u,v)
Quanti. Table
v
6
n2
n-1 n-1
f(j,k) cos
(2j+1)up
2n
j=0 k=0
where
C(w) =
2
1
0.7
1
0.9
0.8
0.7
0.6
0.4
0.2
cos
(2k+1)vp
2n
for w=0
for w=1,2,,n-1
0.7 0.7 0.7 0.7 0.7 0.7 0.7
0.8 0.6 0.2 -0.2 -0.6 0.8
-1
0.4 -0.4 -0.9 -0.9 -0.4 0.4 0.9
-0.2
-1 -0.6 0.6
1 0.2 -0.8
-0.7 -0.7 0.7 0.7 -0.7 -0.7 0.7
-1 0.2 0.8 -0.8 -0.2
1 -0.6
-0.9 0.9 -0.4 -0.4 0.9 -0.9 7 0.4
-0.6 0.8
-1
1 -0.8 0.6 -0.2
Quantization
Purpose of quantization
Achieve high compression by representing DCT coefficients with no
greater precision than necessary
Discard information which is not visually significant
After output from the FDCT, each of the 64 DCT coefficients is quantized
Many-to-one-mapping => fundamentally lossy process
Fq[u,v] = Round ( F[u,v] / q[u,v])
Example: F[u,v] =101101 = 45 (6 bits).
If q[u,v] = 4, truncate to 4 bits, Fq[u,v] =1011
Example:
2x2 block
F[u,v] =
45
8
12
3
Q[u,v] =
4
6
6
8
Fq[u,v] =
11
1
2
0
Fq
F -1
f -1
10
.jpeg file
11
Zig-zag ordering
Quantize
011010001011101...
Run-length
Code
Huffman
Code
12
Quantize Table
15 10 10 16
10 16 12 16
10 8 16 16
144
151
155
161
149
153
160
162
153
156
163
160
DCT
1260 -1 -12
-23 -17 -6
-11 -9 -2
-7
-2
0
-5
-3
2
1
16 12 16 32
Quantize
original image
AC components
79 0 -2 -1 -1 -1 0 0 -1 0 0 0 0 0 0 0
run-length
code
0
1
0
0
0
2
0
79
-2
-1
-1
-1
-1
0
Huffman
code
zigzag
79
-2
-1
0
0
-1
-1
0
-1
0
0
0
10011011100011...
0
0
0
0
Result of Coding/Decoding
139
144
150
159
144
151
155
161
149
153
160
162
144
156
155
160
153
156
163
160
146
150
156
161
149
152
157
161
152
154
158
162
reconstructed block
original block
-5
-4
-5
-1
-2
1
-1
0
0
1
3
1
1
2
5
-2
Small Loss
Neglect-able
errors
14
Examples
Uncompressed
(262 KB)
Compressed (50)
(22 KB, 12:1)
Compressed (1)
(6 KB, 43:1)
8 bits/pixel
0.67 bit/pixel
0.17 bit/pixel
15
Intra-frame
Inter-frames
17
Difference Coding
Compare pixels with previous frame
Only pixels that have been changed are updated
A fraction of the number of pixel values will be recorded
20
motion vector
21
Overview of H.261
Developed by CCITT (Consultative Committee for
International Telephone and Telegraph) in 1988-1990
Designed for videoconferencing, video-telephone
applications over ISDN telephone lines.
Bit-rate is p x 64 Kbps, where p ranges from 1 to 30
(2048 kbps)
Supports CCIR 601 CIF (352 x 288) and QCIF (176 x
144) images with 4:2:0 subsampling.
Significant influence on H.263, MPEG 1-4, etc.
23
24
Intra-frame Coding
Macroblock:
16 x 16 pixel areas
on Y plane of original
image.
Usually consists of 4
Y blocks, 1 Cr block,
and 1 Cb block
(4:2:0 or 4:1:1)
Quantization is by
constant value for all
DCT coefficients (i.e., no
quantization table as in
JPEG).
25
Inter-frame Coding
26
MAE (i, j )
1
N 1
N 1
C ( x k , y l ) R( x i k , y j l )
2 k 0 l 0
N
The goal is to find a vector (u, v) such that
the mean Absolute Error, MAE(u, v)
is minimum:
1. Full Search Method
2. Two-dimensional Logarithmic Search
3. Hierarchical Motion Estimation
27
Encoder
28