Digital Signal Processing Reference
In-Depth Information
fun = @dct2;
DCT_ImageFIFO = blkproc(ImageFIFO,[BLK_SZ BLK_SZ],fun);
figure, imshow(DCT_ImageFIFO);
title('DCT Image');
QuanFIFO = blkproc(DCT_FIFO, [BLK_SZ BLK_SZ], 'round(x./P1)', Q);
figure, imshow(QuanFIFO);
fun = @zigzag_runlength;
zigzagRLFIFO = blkproc(QuanFIFO, [BLK_SZ BLK_SZ], fun);
% Variable length coding using Huffman tables
JPEGoutFIFO = VLC_huffman(zigzagRLFIFO, Huffman_dict);
This MATLAB code can be easily mapped as a KPN. A graphical illustration of this KPN
mapping is shown in Figure 4.8. To conserve FIFO sizes for hardware implementation, the
processing is performed on a block-by-block basis.
4.4.2.2 Example: MPEG Encoding
This section gives a top-level design of a hardware implementation of theMPEG video compression
algorithm. Steps in the algorithm are given in Figure 4.9.
Successive video frames are coded as I and P frames. The coding of an I frame closely follows
JPEG implementation, but instead of using a quantization table the DCT coefficients are quantized
by a single value. This coded I frame is also decoded following the inverse processes of quantization
and DCT. The decoded frame is stored in motion video (MV) memory.
For coding a P frame, first the frame is divided into macro blocks. Each block (called a target
block) is searched in the previously decoded and saved frame in MV memory. The block that
matches best with the target block is taken as a reference block and a difference of target and
DCT_ImageFIFO
ImageFIFO
DCT
Zig_zagRLFIFO
Quat_ImageFIFO
Zi-zag
& R u n Length
Coding
Quantize
JPEG_outFIFO
011 010001011101...
Variable
Length
Coding
Figure 4.8 Graphical illustration of a KPN implementing the JPEG algorithm on block by block basis
 
Search WWH ::




Custom Search