Home Page > > Details

ELEC 5306: Advanced Signal Processing

 ELEC 5306: Advanced Signal Processing: Video 

Compression
1. Objective 
To read and show the frame from a YUV420 file;
To investigate the uniform quantizers;
2. Video Formation 
YUV is a color space commonly used as part of a color image representation, which 
encodes a color frame taking human perception into account and allowing reduced bandwidth 
for chrominance components. Therefore, YUV formation typically enables transmission to be 
more efficiently masked by the human perception than using a direct RGB-representation.
YUV420 is a video format, which means that the Y, U, and V values are grouped together 
instead of interspersed. The reason is that by grouping the U and V values together, the video 
frame becomes much more compressible. In other words, when given an array of a frame in 
the YUV420p, all the Y values come first, followed by all the U values, followed finally by all the 
V values.
1: YUV420 example (4×6)
Fig. 1 shows an example of YUV420 format with the size 4×6 pixels. The U and V 
values correspond to each 2 by 2 block of the frame, meaning each U and V entry applies 
to four pixels. After the Y values, the next X/4 positions are the U values for each 2 by 2 
block, and the next X/4 positions after that are the V values that also apply to each 2 by 
2 block.
Input: a given YUV420 file called “Birds_part_420.yuv” (1024 x 768 pixels)
Output: Show the 5th frame in the matlab (it should be a color image!)
3. Uniform Quantization 
In image and video processing, since the quantization compresses the continuum of 
analog signal to a finite number of discrete values, it must introduces some distortions in the 
displayed analog image. This distortion is known as quantization error and might shown as 
patches, especially in flat region, which is also known as contouring artifacts.
Commonly, we define a scalar quantizer Q(·) to be a mapping of input values {dk; k =
1, … ,N} to output {rk; k = 1, … ,N}. Thus, we have:
Q(x) = 𝑟𝑘 (1)
We assume that the quantizer output levels maintain the following relationship:
r1 < r2 < ⋯ < rN (2)
The number of bits required to denote any one of the output levels is:
B = ⌈log2L⌉(bits) (3)
where ⌈x⌉ is the nearest integer equal to or larger than x.
The optimal MSE quantizer design amounts to determining the input decision intervals 
{dk} and corresponding reconstruction levels {rk} for given L levels such that the MSE is 
minimized:
From the above equation, we see that the interval between any two consecutive decision 
boundaries is the same and equal to the quantization step size Δ. Finally, we can find that the 
Δ of the uniform quantizer is related to the number of levels L or the number of bits B, as given 
Finally, the design of the optimal uniform quantizer is carried out as follows:
1. To determine the input range L and step size Δ, where d1 = 𝑥𝑚𝑖𝑛; 𝑑𝐿+1 = 𝑥𝑚𝑎𝑥
2. To find the L output levels from (9);
3. To quantize a sample x according to this equation Q(x) = rj
, if dj ≤ x ≤ dj+1
Input: the Y component (8bpp) in the first experiment.
Output: Display both the original and requantized (dequantized) images, observe the 
differences, calculate the PSNR. For display purpose, set B to be 4 and 6 bits. For experimental 
plotting, vary B from 1 to 7 bits.
where I(i; j) is the original data and R(i; j) is the reconstructed one; M and N is the width 
and height respectively; 𝑀𝑎𝑥𝐼
Contact Us - Email:99515681@qq.com    WeChat:codinghelp
Programming Assignment Help!