1 / 14

Chapter 18 Discrete Cosine Transform

Chapter 18 Discrete Cosine Transform. Learning Objectives. Introduction to the DCT and IDCT. Decomposition of a 2-D DCT to two 1-D DCTs. Implementation of a 2-D DCT using a 1-D DCT. Introduction.

Download Presentation

Chapter 18 Discrete Cosine Transform

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 18 Discrete Cosine Transform

  2. Learning Objectives • Introduction to the DCT and IDCT. • Decomposition of a 2-D DCT to two 1-D DCTs. • Implementation of a 2-D DCT using a 1-D DCT.

  3. Introduction • To perform the JPEG coding, an image (in colour or grey scales) is first subdivided into blocks of 8x8 pixels. • The Discrete Cosine Transform (DCT) is then performed on each block. • This generates 64 coefficients which are then quantised to reduce their magnitude.

  4. Introduction • The coefficients are then reordered into a one-dimensional array in a zigzag manner before further entropy encoding. • The compression is achieved in two stages; the first is during quantisation and the second during the entropy coding process. • JPEG decoding is the reverse process of coding.

  5. Implementation of the DCT • DCT-based codecs use a two-dimensional version of the transform. • The 2-D DCT and its inverse (IDCT) of an N x N block are shown below: • 2-D DCT: • 2-D IDCT: • Note: The DCT is similar to the DFT since it decomposes a signal into a series of harmonic cosine functions.

  6. 2-D DCT using a 1-D DCT Pair • One of the properties of the 2-D DCT is that it is separable meaning that it can be separated into a pair of 1-D DCTs. • To obtain the 2-D DCT of a block a 1-D DCT is first performed on the rows of the block then a 1-D DCT is performed on the columns of the resulting block. • The same applies to the IDCT. • This process is illustrated on the following slide.

  7. 2-D DCT using a 1-D DCT Pair

  8. 2-D DCT using a 1-D DCT Pair • 1-D DCT: • 1-D IDCT:

  9. Implementation Issues • Precalculate the DCT coefficients and scale them (see \Links\DCT Coeffs.pdf).

  10. Block-based DCT and IDCT in C • The most straightforward way of implementing a DCT and an IDCT is to use the 1-D DCT and IDCT. • The following C code shows how to translate the 1-D equations for the DCT and IDCT into C code. • The program also takes into account the numerical issues associated with fixed-point processors.

  11. Implementation Issues (1) The program runs on the DSK with the C6711 and does not use any communication with the host. (2) The scenary.h file is quite large (256x256 8-bit pixels or 65536 bytes) and therefore needs to be located in a specific memory location in the DSK. By using the #pragma DATA_SECTION (…) directive the picture can be located in the DRAM (origin address 0x0800 0000). (3) For example, #pragma DATA_SECTION (image_in, “ext_sdram”) allows the image_in data array to be loaded into the section called “ext_sdram” which is defined in the command file. The same applies to image_out. (4) The directory: ..\ Chapter 18 - Discrete Cosine transform\DCT_C_Fixed contains the entire source and executable files required. The program can be loaded into the DSK and by using the display feature of the CCS as shown below the contents of image_in and image_out can be displayed and compared.

  12. Implementation Issues Graph properties for image_in image_in Graph properties for image_out image_out

  13. DCT Code and Links • Code location: • …\Chapter 18 - Discrete Cosine transform\DCT_C_Fixed • Projects: • Fixed Point in C language: dct_c_fixed.pjt • Links: • \Links\Imaging Kit.pdf

  14. Chapter 18 Discrete Cosine Transform - End -

More Related