The Video Data Type: COMP 249 Advanced Distributed Systems
The Video Data Type: COMP 249 Advanced Distributed Systems
Multimedia Networking
Kevin Jeffay
Department of Computer Science
University of North Carolina at Chapel Hill
[email protected]
September 7, 1999
http://www.cs.unc.edu/~jeffay/courses/comp249f99
! Digital Video
» Coding
! Compression basics
» Simple compression
» Interpolation-based techniques
» Predictive techniques
» Transforms
» Statistical techniques
2
Video Basics
The components of video
R-value
G-value
B-value
Video Basics
The components of video transmission
time
4
Video Basics
Video as a 1-dimensional signal
(R, G, B)11, (R, G, B)12, (R, G, B)13, ..., (R, G, B)row, col
Video Basics
Resolution
! Television broadcast
standards
» NTSC — 525 lines Videophone
» PAL — 625 lines (128x112)
Video Basics
Color spaces
U = 0 Plane
R R
Y=1
White V=0
Plane
R=G=B
(gray values) G G
B B
! Storage/transmission requirements
» NTSC — 440 x 480 x 30 x 24 = 152x106 bits/sec
(19 MB/s or 24 bits/pixel (bpp))
9
! Digital Video
» Coding
! Compression basics
» Simple compression
» Interpolation-based techniques
» Predictive techniques
» Transforms
» Statistical techniques
10
Digital Video
Compression Techniques
! Eliminating redundancy
» Spatial redundancy
» Temporal redundancy
Digital Video
Compression Techniques
Simple Interpolative Predictive Transform Statistical
Truncation
Truncation DPCM
DPCM Discrete
Discrete Huffman
Huffman&&
CLUT
CLUT Sub-sampling
Sub-sampling Motion
Motion Cosine
Cosine Arithmetic
Arithmetic
Run-length
Run-length Compensation
Compensation Transform
Transform coding
coding
Fixed Adaptive
Video
Input Video
Color
Color
Video
Compression Bit
Bit
Components
Components Compression Assignment
Algorithm Assignment
Algorithm
Compressed
(PCM Signals)
Bit-Stream
Adapted from Buford p.147 12
Video Compression
Issues
! Example
» Go from RGB at 8 bits/component sample (8:8:8) to 5 bits
(5:5:5)
❖ Go from 24 bpp to 15 bpp
❖ This gives “acceptable results”
» Go from YUV at 8 bits/component sample 6:5:5 (16 bpp)
! Advantage — simple!
14
Simple Compression Schemes
Color-table lookup (CLUT)
...
! Example:
» 8-bit indices (256 colors) gives
(440 x 480) x 8 + (24 x 256) = 1.7x106 bits/sec
15
17 23 54 54 54 54 54 54 54 22 11
RLE
17 23 (54, 7) 22 11
18
Interpolative Compression Schemes
Color sub-sampling
(0,0) (1,0)
! Bi-linear interpolation: ...
U(1,
U(1,1)
1)==U(0,0)x0.75
U(0,0)x0.75++U(1,0)x0.25
U(1,0)x0.25++
U(0,1)x0.75
U(0,1)x0.75++U(1,1)x0.25
U(1,1)x0.25 (0,1) (1,1)
...
...
...
Sub-sampled
U or V component
19
21
Transform-Based Compression
Exploiting redundancy in other domains
A B
A B–A C–A D–A
C D
! Storage savings
» Original array: 4 pixels x 8 bpp = 32 bits
» Transformed array: 8 bits + (3 pixels x 4 bpp) = 20 bits
22
Transform-Based Compression
The Discrete Cosine Transform (DCT)
! A transformation into the frequency domain
! Example: 8 adjacent pixel values (e.g., luminance)
255 127
128 0
0 -128
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
Sample values Level-shifted values
Transform-Based Compression
The Discrete Cosine Transform (DCT)
0 0 0 0
0 0 0 0
24
Transform-Based Compression
The Discrete Cosine Transform (DCT)
1.0
1.0
0.5
0
0.0
-0.5 -1.0
25
Σ
127 7 150
0 = 0 X i
i =0
-128 -150
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 i
0 0 0 0
0 0 0 0
27
Transform-Based Compression
The Discrete Cosine Transform (DCT)
-150
DCT Coefficients
29
Statistical Compression
Huffman coding
30
Statistical Compression
Huffman coding
P(ACBD)
P(ACBD)==11
Symbol Probability Code
A 0.75 1
1 0
B 0.125 01 P(BCD)
P(BCD) == 0.25
0.25
C 0.0625 001
D 0.0625 000
1 0
P(CD)
P(CD) == 0.125
0.125
1 0
P(A)
P(A) == 0.75
0.75 P(B)
P(B) == 0.125
0.125 P(C)
P(C) == 0.062
0.062 P(D)
P(D) == 0.062
0.062