1 / 22

Introduction to Discrete Cosine Transform and Quantization

Introduction to Discrete Cosine Transform and Quantization. DSP TA: Wei-Nien Chen 2007/05/09. Typical Transform coding scheme. Discrete cosine transform. Any signal= Σ cosine of various frequencise. Decompose signals into combinations of DCT basis vectors. 1-D DCT. 2-D DCT (8x8). Why DCT.

apollo
Download Presentation

Introduction to Discrete Cosine Transform and Quantization

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. Introduction to Discrete Cosine Transform and Quantization DSPTA: Wei-Nien Chen 2007/05/09

  2. Typical Transform coding scheme

  3. Discrete cosine transform • Any signal=Σcosine of various frequencise. • Decompose signals into combinations of DCT basis vectors

  4. 1-D DCT

  5. 2-D DCT (8x8)

  6. Why DCT • Energy compaction. (for further quantization)

  7. Example: Lena

  8. original 1 coef. 3coef. 5 coef. 10 coef. 30coef.

  9. Quantization • Represent coefficients using less steps(fewer bits) to obtain compression.

  10. Weighted Quantization • Quantization Table: Each DCT coefficients uses different quantization step size obtained from psychophysical studies.

  11. Formula Quantization Inverse Quantization

  12. Adapted from W. J. Tsai, DTV chap2 classnote

  13. Optimization Tips DSPTA: Wei-Nien Chen 2007/05/09

  14. Source Efficiency Coding Effort C source File 50-80% Low Compiler Optimizer Linear Assembly 90-100% Med Assembly Optimizer Assembly 100% High Hand Optimizer Code Efficiency vs. Coding Effort

  15. Software Development Tool (CCS) • Code Composer Studio (CCS) • Software pipeline is very important • Build option setting • Optimization level : File level (-o3) • Configurations • Release mode is faster than Debug mode (profile)

  16. Floating Point vs. Fixed Point • Fixed Point Operation • Fixed point:char, short, int, long • Floating point:float, double • Computation cycles with different data types

  17. SIMD 32 bits A1 (short) A2 (short) int + short short B1 (short) B2 (short) = char char char char A1+B1 A2+B2 Intrinsic Functions • Use Intrinsic Function (spru198i) • Packet Data Processing • Change int type to char, short type • Put 2 “16-bit” data or 4 “8-bit” data in a 32-bit space • Single instruction multiple data (SIMD) (intrinsic)

  18. Loop Unrolling/Loop order • Loop unrolling • Break the branch barrier • Trade off between performance and code size • #pragma MUST_ITERATE(min, max, multiple), • #pragma UNROLL(n) • Loop order #pragma MUST_ITERATE(10) For (i=0;i<N;i++) { …….. } Faster Slower

  19. Intrinsic Library • TI has provided several optimized function for programmer’s, such as FIR, IIR, FFT, DCT, etc. (spru023b) • Include libraries and use it!! • Be ware of data type!! • Library location: \CCStudio3\c6400\dsplib\lib\dsp64x.lib \CCStudio3\c6400\imglib\lib\img64x.lib

  20. Memory Bottle Neck • Memory Management is important • Designer’s Responsibility • Memory Load/Store is critical • 80% time for load/store • Linker Command File (*.cmd) • Allocate memory

  21. Command File MEMORY { ISRAM: o = 0x00000000 l = 0x00040000 SDRAM: o = 0x80000000 l = 0x08000000 } SECTIONS { .text > ISRAM //Code .cinit > ISRAM //Initial values for global/static variables .stack > ISRAM //Stack (local variables) .const > ISRAM //Global and static string literals .switch > ISRAM //Tables for switch instructions .cio > ISRAM //Buffers for studio functions .bss > ISRAM //Global and static variables .far > ISRAM //Global and static declared far .sysmem > SDRAM //Memory for malloc functions (heap) .mycode > ISRAM .mydata > ISRAM } -stack 0x1F74 -heap 0x500000 #pragma CODE_SECTION(function_name,”mycode”) #pragma DATA_SECTION(array_name,”mydata”)

  22. Easier said than done • Enhanced Direct Memory Access (EDMA) • DSP/BIOS • Cache • Tools that help you: Compiler consultant Optimization tools: cache tune/code size tune

More Related