Case Study ARM Platformbased JPEG Codec HWSW Codesign
Case Study ARM Platform-based JPEG Codec HW/SW Co-design Teaching Assistant : Yu-Ju Cho Advisor : Prof. An-Yeu Wu So. C Design Laboratory SOC Consortium Course Material
Outline q Introduction to JPEG Codec q Lab ─ Case study q Reference Real-time OS So. C Design Laboratory SOC Consortium Course Material 2
ISO/IEC 10918 -1 JPEG q JPEG: Joint Photographic Experts Group q JPEG voted as international standard in 1994 q JPEG standard has four compression method Real-time OS – Baseline sequential DCT-based coding – Progressive DCT-based coding – Lossless coding method • Sampling and Quantization are not considered at loss-less coding scheme – Hierarchical coding method So. C Design Laboratory SOC Consortium Course Material 3
Baseline sequential V. S. Progressive DCT-based coding Real-time OS TISO 0730 -93/d 009 So. C Design Laboratory SOC Consortium Course Material 4
Color Model in Video ─ YCr. Cb q YCb. Cr color mode is used in JPEG and MPEG q CCIR-601 transformula Real-time OS q The chrominance values in YCb. Cr are always in the range of 0 to 1 q Color space transform is loss-less So. C Design Laboratory SOC Consortium Course Material 5
Chroma Sub-sampling Real-time OS q 4: 1: 1 and 4: 2: 0 are mostly used in JPEG and MPEG So. C Design Laboratory SOC Consortium Course Material 6
Block Diagram of JPEG Encoder Real-time OS 01001011101… So. C Design Laboratory SOC Consortium Course Material 7
Block Diagram of JPEG Decoder Real-time OS 01001011101… So. C Design Laboratory SOC Consortium Course Material 8
2 -D DCT (Discrete Cosine Transform) Real-time OS So. C Design Laboratory SOC Consortium Course Material 9
Basis Image of 2 -D DCT Real-time OS So. C Design Laboratory SOC Consortium Course Material 10
Frequency Distribution of 2 -D DCT Real-time OS So. C Design Laboratory SOC Consortium Course Material 11
8 point 1 -D DCT Algorithm (1/2) Real-time OS So. C Design Laboratory SOC Consortium Course Material 12
8 point 1 -D DCT Algorithm (2/2) Real-time OS So. C Design Laboratory SOC Consortium Course Material 13
Implementation 2 -D DCT Example: row-column decomposition q Separable, row-column decomposition Real-time OS X 1 D DCT Unit Y=AX So. C Design Laboratory Transport Memory (Y) 1 D DCT Unit Z Z=YAT SOC Consortium Course Material 14
Quantization Table for Luminance Real-time OS So. C Design Laboratory 16 11 10 16 24 40 51 61 12 12 14 19 26 58 60 55 14 13 16 24 40 67 69 56 14 17 22 29 51 87 80 62 18 22 37 56 68 109 103 77 24 35 55 64 81 104 113 92 49 64 78 87 103 121 120 101 72 92 95 98 112 100 103 99 SOC Consortium Course Material 15
Quantization Table for Chrominance Real-time OS So. C Design Laboratory 17 18 24 47 99 99 18 21 26 66 99 99 24 26 56 99 99 99 47 66 99 99 99 99 99 99 99 99 99 99 SOC Consortium Course Material 16
Predictive Coding of DC Coefficients Real-time OS So. C Design Laboratory SOC Consortium Course Material 17
Zig-zag Scan (AC Coefficients) Real-time OS So. C Design Laboratory SOC Consortium Course Material 18
Run-Length Coding DC Real-time OS (R, L) => (0, -3)(0, -2)(0, -1)(2, -1)(EOB) So. C Design Laboratory SOC Consortium Course Material 19
Huffman Coding for DC Coefficient Real-time OS So. C Design Laboratory Category AC Coefficient Range 1 -1, 1 2 -3, -2, 2, 3 3 -7, …, -4, 4, …, 7 4 -15, …, -8, 8, …, 15 5 -31, …, -16, …, 31 6 -63, …, -32, …, 63 7 -127, …, -64, …, 127 8 -255, …, -128, …, 255 9 -511, …, -256, …, 511 10 -1023, …, -512, …, 1023 11 -2047, …, -1024, …, 2047 SOC Consortium Course Material 20
An Example of Baseline DCT-based Coding -128 FDCT Q Real-time OS (6)(61), (0, 2)(-3), (0, 3)(4), (0, 1)(-1), (110)(111101)(00)(100) Huffman (0, 3)(-4), (0, 2)(2), (100)(0)(100)(001)(01) (1, 2)(2), (0, 2)(-2), (10)(11011)(10)(01)(01)(11111110111)(10)(111010) Run-length (0, 2)(-2), (5, 2)(2), (3, 1)(1), (6, 1)(-1), (1)(1111011)(0)(11100)(0) (2, 1)(-1), (4, 1)((111011)(0)(11111010)(0)(1010) 1), (7, 1)(-1), (0, 0) Zig-Zag total 98 bits Q Table So. C Design Laboratory SOC Consortium Course Material 21
JPEG Bitstream Real-time OS So. C Design Laboratory SOC Consortium Course Material 22
Outline q Introduction to JPEG Codec q Lab ─ Case study q Reference Real-time OS So. C Design Laboratory SOC Consortium Course Material 23
File Structure Real-time OS So. C Design Laboratory SOC Consortium Course Material 24
Read & Write Address Real-time OS So. C Design Laboratory Write_head 0 xcc 000000 0 xcc 000040 0 xcc 000004 0 xcc 000044 0 xcc 000008 0 xcc 000048 0 xcc 00000 c 0 xcc 00004 c 0 xcc 000010 0 xcc 000050 0 xcc 000014 0 xcc 000054 0 xcc 000018 0 xcc 000058 0 xcc 00001 c 0 xcc 00005 c FDCT IDCT Read_head 0 xcc 000020 0 xcc 000060 0 xcc 000024 0 xcc 000064 0 xcc 000028 0 xcc 000068 0 xcc 00002 c 0 xcc 00006 c 0 xcc 000030 0 xcc 000070 0 xcc 000034 0 xcc 000074 0 xcc 000038 0 xcc 000078 0 xcc 00003 c 0 xcc 00007 c SOC Consortium Course Material 25
Result for SW Simulation Real-time OS Original Encoder So. C Design Laboratory SOC Consortium Course Material Decoder 26
Result for HW Simulation Real-time OS Original Encoder So. C Design Laboratory SOC Consortium Course Material Decoder 27
Profiling Result of SW Simulation Real-time OS So. C Design Laboratory SOC Consortium Course Material 28
Lab ─ Case Study q Goal – Implement the JPEG codec system using ARM platform q Principles Real-time OS – Implement the ARM platform-based JPEG codec HW/SW co-design q Requirement – Analysis the profiling of pure software simulation – Explain how to partition the HW/SW of JPEG codec – Implement the JPEG codec with HW/SW co-design q Discussion – Explain where is the stack and heap ? And who initialize them So. C Design Laboratory SOC Consortium Course Material 29
Outline q Introduction to JPEG Codec q Lab ─ Case study q Reference Real-time OS So. C Design Laboratory SOC Consortium Course Material 30
Reference q Wen-Hsiung Chen, C. Harrison Smith, and S. C. Fralick, "A Fast Computational Algorithm for the Discrete Cosine Transform, " IEEE Trans. Commun. , vol. COM-25, pp. 1004 -1009, Sept 1977. q JPEG: Still Image Data Compression Standard by William B. Pennebaker and Joan L. Mitchell, Kluwer Academic Publishers, ISBN: 0442012721 Real-time OS So. C Design Laboratory SOC Consortium Course Material 31
- Slides: 31