7 - digital video
TRANSCRIPT
-
8/13/2019 7 - Digital Video
1/32
Digital Video
Multimedia
-
8/13/2019 7 - Digital Video
2/32
Digital Video A digital camera samples the imaged scene as
discrete frames Each frame consists of sample values that are
discrete both horizontally and vertically. Let m and n be the integer indices in the horizontal
and vertical directions and let k be the frame number. The actual spatial and temporal locations are
x =m x , y =m y , and k =m t . We may use (m , n , k ) to describe a digital video.
25/11/2013 Multimedia Coding and Processing 2
-
8/13/2019 7 - Digital Video
3/32
-
8/13/2019 7 - Digital Video
4/32
Digital Video
Each pixel is render as a rectangular region with aconstant colour for the pixel.
The ratio of the width to the height of this area isknown as Pixel Aspect Ratio (PAR). PAR relates to the Image Aspect Ratio by
The display device should conform to this PAR toavoid distortions.
, ,/ .
s y s x PAR IAR f f
25/11/2013 Multimedia Coding and Processing 4
-
8/13/2019 7 - Digital Video
5/32
Digital Video
ITU-R developed the BT.601 to standardize thedigital TV format.
To convert a raster scan to a digital video signal,one need only sample the 1D waveform.
If a total number of f s, x samples are taken per line,the equivalent sampling rate is
, , , , . s s x s y s t s x l f f f f f f
25/11/2013 Multimedia Coding and Processing 5
-
8/13/2019 7 - Digital Video
6/32
Digital Video The sampling rate in BT.601 standard is chosen to
satisfy two constraints: The horizontal sampling resolution should match the
vertical sampling resolution as close as possible. That is,
x y . The same sampling rate should be used for NTSC andPAL/SECAM and it should be a multiple of respectiveline rates. Thus,
f s, x IAR* f s,y .
Using f s = f s, x * f l and f l = f s,t * f s,y , we have f s IAR* f 2s,y * f l .
25/11/2013 Multimedia Coding and Processing 6
-
8/13/2019 7 - Digital Video
7/32
Digital Video
f s 11 and 13 MHz for NTSC and PAL/SECAM. A number that is closest to both numbers and
satisfies the second criterion is then chosen. We
have f s = 858* f l (NTSC) = 864* f l (PAL/SECAM) =13.5 MHz.
This gives the 525/60 and 625/60 signals.
25/11/2013 Multimedia Coding and Processing 7
-
8/13/2019 7 - Digital Video
8/32
Digital Video
25/11/2013 Multimedia Coding and Processing 8
ActiveArea
720 pels
858 pels
122pels
16pels
480lines
525lines Active
Area
720 pels
864 pels
132pels
12pels
576lines
625lines
NTSC PAL/SECAM
-
8/13/2019 7 - Digital Video
9/32
Digital Video
Note that both formats have the samenumber (720) of active pixels/line.
Note that the pixel width-to-height ratio is not1.
PAR= x /y = IAR* f 's,y / f 's, x PARNTSC= (4/3)*480/720 = 8/9 PARPAL = (4/3)*576/720 = 16/15
25/11/2013 Multimedia Coding and Processing 9
-
8/13/2019 7 - Digital Video
10/32
Digital Video - BT.601
BT.601 also uses the YCbCr representation. The YCbCr values (0-255) are related to the RGB
values (0-255) by
0.257 0.504 0.098 16
0.148 0.291 0.439 128
0.439 0.368 0.071 128b
r
Y R
C G
C B
25/11/2013 Multimedia Coding and Processing 10
-
8/13/2019 7 - Digital Video
11/32
Digital Video - BT.601
The inverse relation is
1.164 0.000 1.596 16
1.164 0.392 0.813 128
1.164 2.017 0.000 128
b
r
R Y
G C
B C
25/11/2013 Multimedia Coding and Processing 11
-
8/13/2019 7 - Digital Video
12/32
Spatial Sampling Rate
Human eyes are less sensitive to colour differenc thanbrightness. Chrominance values are sampled at lower frequency than
the luminance value. 4:2:2 format. Each chrominance component, Cb and Cr,
are usually sampled at half of the sampling rate of theluminance component.
4:1:1 format. Each chrominance component is sampled at of the sampling rate of the luminance component.
4:2:0 format. Each chrominance component is sampled at of the sampling rate both horizontally and vertically.
4:4:4 format. The chrominance values are sampled at thesame rate as the luminance values.
25/11/2013 Multimedia Coding and Processing 12
-
8/13/2019 7 - Digital Video
13/32
Chrominance Subsampling
25/11/2013 Multimedia Coding and Processing 13
4:2:2 format
Each 2 2 Y pixels2Cb & 2Cr pixels(horizontal subsampling)
4:1:1 format
Each 2 2 Y pixels1Cb & 1Cr pixels(4:1 horizontal subsampling)
Y
Cb
Cr
-
8/13/2019 7 - Digital Video
14/32
Chrominance Subsampling
25/11/2013 Multimedia Coding and Processing 14
4:4:4 format
Each 2 2 Y pixels4Cb & 4Cr pixels(no subsampling)
4:2:0 format
Each 2 2 Y pixels1Cb & 1Cr pixels(2:1 subsampling bothhorizontally and vertically)
Y
Cb
Cr
-
8/13/2019 7 - Digital Video
15/32
-
8/13/2019 7 - Digital Video
16/32
Computer Video Formats
CGA Colour Graphics Adapter Resolutions: 320 200 pixels with 4 colours (2 bits) (320x200) pixels 2 bits/pixel = 15.625 KB/image
EGA Enhanced Graphics Adapter Resolutions: 640 350 pixels with 16 colours (4 bits) (640x350) pixels 4 bits/pixel = 109.375 KB/image
25/11/2013 Multimedia Coding and Processing 16
-
8/13/2019 7 - Digital Video
17/32
Computer Video Formats VGA Video Graphics Array
Resolution: 640 x 480 pixels with 256 colours (8 bits) (640x480) pixels x 8 bits/pixel = 300 KB/image
XGA Extended Graphics Array Resolution: 640 x 480 pixels with 65,536 colours (16 bits) or 1024
x 768 pixels with 256 colours (640x480) pixels x 16 bits/pixel = 600 KB/image (1024x768) pixels x 8 bits/pixel = 768 KB/image
SVGA Super VGA Resolution: 800 x 600 pixels with 16,777,216 colours (24 bits) or
1024 x 768 pixels with 65,536 colours (16 bits) (800x600) pixels x 24 bits/pixel = 1.37 MB/image (1024x768) pixels x 16 bits/pixel = 1.5 MB/image
25/11/2013 Multimedia Coding and Processing 17
-
8/13/2019 7 - Digital Video
18/32
Sampling
Digitization of an analog waveform Take samples at different temporal
locations Frequency of taking samples: sampling rate Amplitude of taken samples: quantization Objective : To maintain the information of
the original analog waveform
25/11/2013 Multimedia Coding and Processing 18
-
8/13/2019 7 - Digital Video
19/32
Sampling Rate Sampling rate is the no. of samples taken per unit time Affects whether the no. of samples are enough to reproduce
the waveform.
25/11/2013 Multimedia Coding and Processing 19
time0 1 2 3 4 5 6 7 8 9 10 11 12
E.g. if only 1 sample per periodReproduced waveform= a straight line
-
8/13/2019 7 - Digital Video
20/32
Nyquist Sampling Theorem For lossless digitization, the sampling rate must be at
least twice of the maximum frequency That is, at least 2 samples must be obtained within
each cycle. Otherwise, either the maximum or theminimum amplitude in a period is gone; leading toloss of information in the digitization process.
25/11/2013 Multimedia Coding and Processing 20
time0 1 2 3 4 5 6 7 8 9 10 11 12
-
8/13/2019 7 - Digital Video
21/32
Sampling & Compression
When the sampling rate is reduced, Fewer samples are accessed per unit time Lower temporal resolution Object size is reduced The information of the higher frequency
waveforms is also lost
25/11/2013 Multimedia Coding and Processing 21
-
8/13/2019 7 - Digital Video
22/32
Quantization Consider using a decimal number to describe a value. Each digit
has ten different values. One digit specifies 10 different values (0-9) Two digits specifies 100 different values (0-99)
Three digits specifies 1000 different values (0-999). Each additional digit increases the range by 10 times.
Consider using a binary number to describe a sample value. Each additional digit(bit) doubles the range of values.
25/11/2013 Multimedia Coding and Processing 22
-
8/13/2019 7 - Digital Video
23/32
Quantization
Quantization of a sample the mapping ofvalues to integral values in describing asample value. Mathematically,
No. of bits, Nb = log2(no. of integral values)
25/11/2013 Multimedia Coding and Processing 23
),(sgn/),(),( y xU y xU y xV
-
8/13/2019 7 - Digital Video
24/32
Quantization
Analog: A continuousslope
Digital: steps in thestairs
25/11/2013 Multimedia Coding and Processing 24
Step size
-
8/13/2019 7 - Digital Video
25/32
More bits better resolution
More values(v) need more bits(b): v 2b 8 bits: 256 values 16 bits: 65,536 values 24 bits: 16,777,216 values
Affects the step size in the reproducedwaveform
More bits smaller step size bettersample quality
25/11/2013 Multimedia Coding and Processing 25
-
8/13/2019 7 - Digital Video
26/32
-
8/13/2019 7 - Digital Video
27/32
No. of Bits Affects Quality Values in 7-bit quantization are
0.101101, 1.000, 0.101101, 0.000, -0.101101, -1.000, -0.101101,0.000,
Quantized value in decimal becomes0.703125, 1, 0.703125, 0, -0.703125, -1, - 0.703125, 0,
25/11/2013 Multimedia Coding and Processing 27
time0 1 2 3 4 5 6 7 8 9 10 11 12
-
8/13/2019 7 - Digital Video
28/32
No. of Bits Affects Quality
Values in 4-bit quantization are0.101, 1.000, 0.101, 0.000, -0.101, -1.000, - 0.101, 0.000,
Quantized value in decimal becomes0.625, 1, 0.625, 0, -0.625, -1, - 0.625, 0,
25/11/2013 Multimedia Coding and Processing 28
time0 1 2 3 4 5 6 7 8 9 10 11 12
-
8/13/2019 7 - Digital Video
29/32
Quantization and Compression
When the no. of integral values to represent asample is reduced,
The number of bits per sample is reduced Lower sample resolution Object size is reduced The quality of each sample value is also reduced
25/11/2013 Multimedia Coding and Processing 29
-
8/13/2019 7 - Digital Video
30/32
Summary to Sampling andQuantization
Digitization of the analog waveform involvessampling and quantization.
Sampling rate must be at least twice of the
highest frequency to avoid loss of information No. of bits in quantization affects the quality of
each sample value Object size are reduced with loss of information
by lowering the sampling rate and number ofsample values.
25/11/2013 Multimedia Coding and Processing 30
-
8/13/2019 7 - Digital Video
31/32
Data Representations Summary Computer graphics are represented using the coordinates on
the screen. Computer animations are done by updating changes to the
frame buffers and these changes are drawn on the display
Images are represented as 2D pixels. Each pixel can berepresented using RGB, YUV, YCbCr, or CMYK.
A/D converters digitize an analog wave by taking samples ofamplitudes at fixed time intervals.
A video is represented as an array of frames. 24 to 30 framesshould be displayed per second to show full motions.
25/11/2013 Multimedia Coding and Processing 31
-
8/13/2019 7 - Digital Video
32/32
Exercise A sine curve of maximum amplitude of 16 is sampled
at 6 times per cycle and the sample values arequantized using 8 bits. Alternatively, the sine curvemay be sampled at 8 times per cycle and the samplevalues are quantized using 6 bits.
Find the Mean Absolute Difference of each quantizedcurves with the original sine curve.
Find the Mean Square Errors of the two quantizedcurves.
Compare the PSNR of the two quantized curves.
25/11/2013 Multimedia Coding and Processing 32