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. VideoFormation
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. UniformQuantization
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) = 𝑟 𝑘
We assume that the quantizer output levels maintain the following relationship:
(1)
r1