0% found this document useful (0 votes)
14 views1 page

DCT Algorithm

The DCT algorithm involves loading an image, converting it to grayscale or YCbCr, and dividing it into 8×8 pixel blocks. Each block undergoes a 2D Discrete Cosine Transform, followed by quantization and encoding processes to compress the image data. The final steps include rearranging the quantized data into a 1D array and applying Run-Length Encoding and Huffman Encoding for further compression.

Uploaded by

muhsinaasharaf9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

DCT Algorithm

The DCT algorithm involves loading an image, converting it to grayscale or YCbCr, and dividing it into 8×8 pixel blocks. Each block undergoes a 2D Discrete Cosine Transform, followed by quantization and encoding processes to compress the image data. The final steps include rearranging the quantized data into a 1D array and applying Run-Length Encoding and Huffman Encoding for further compression.

Uploaded by

muhsinaasharaf9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DCT Algorithm Steps

 Load the image (grayscale or color).


 If color, convert to grayscale or YCbCr (for JPEG-style compression).
 Divide the image into non-overlapping 8×8 blocks of pixels.
 Each block will be processed independently.
 Shift pixel values from range [0, 255] to [-128, 127] by subtracting 128 from each
pixel.
 This helps center the data around zero, which improves DCT efficiency.
 Apply the 2D Discrete Cosine Transform to each 8×8 block.
 This transforms spatial data (pixels) to frequency domain.

 Divide each DCT coefficient by a quantization matrix and round to nearest integer.
 Quantization reduces precision, enabling compression.
 Separate quantization tables are used for luminance and chrominance.
 Rearrange the 8×8 quantized block into a 1D array using zig-zag ordering.
 Apply Run-Length Encoding (RLE) and Huffman Encoding to compress the 1D array.
 This removes further redundancy from the image data.

You might also like