250 likes | 601 Views
JPEG 개요 (Introduction to JPEG). 광운대학교 전자공학과 멀티미디어연구실 오 승 준 sjoh@media.kwangwoon.ac.kr. JPEG ( ISO/CCITT ) 표준 : 개요. JPEG : (Joint Photographic Experts Group) : ISO/IEC & CCITT Working Group.
E N D
JPEG 개요(Introduction to JPEG) 광운대학교 전자공학과 멀티미디어연구실 오 승 준 sjoh@media.kwangwoon.ac.kr
JPEG ( ISO/CCITT ) 표준: 개요 • JPEG: (Joint Photographic Experts Group) : ISO/IEC & CCITT Working Group. • JPEG 목적: To develop an IS for general-purpose, continuos-tone ( gray scale ir color, but not bi-level ), still-frame image compression. • JPEG algorithms: applicable to arbitrary images with precision from 4 to 16 bits per component sample. • Two Class of Compression Algorithms : 2-D DCT ( lossy ) and Spatial DPCM ( lossless ). • Two Modes of Operation : Sequential ( row by row ) and Progressive ( spectral selection, successive approximation ). • Baseline System : Sequential DCT Algorithm ( required ). • Extended Systems : Progressive Modes, Higher Precision, and Alternative Coding Techniques.
JPEG : Coding • Because adjacent blocks in the image are likely to have similar DC values, the quantized DC coefficients is encoded as the difference of the DC term of previous block in the encoding order. • Q coefficients are ordered into the zig-zag sequence, which help to facilitate entropy coding by placing low-frequency coefficients ( which are more likely to be non-zero ) before high-frequency coefficients. • Run-length coding is used to characterize the quantized DCT coefficients by the non-zero values and the number of zeros ( the run ) between these non-zero values ( the level ). • The combination of the run and level is entropy-coded using Huffman tables. • Separate Huffman coding tables are provided for both the DC and AC coefficients and for different image components.
JPEG : Standard Selection • Three major Candidate Algorithms ( June 1987 ) • Adaptive DCT ( ADCT ) by ESPRIT 563-PICA project • Adaptive Binary Arithmetic Coding ( ABAC ) by IBM • Block Separated Progressive Coding ( BSPC ) by NIS group • Subjective Testing Results Subjective Quality Rating
JPEG : Subjective Performance • ADCT outperformed at 0.75 - 2.25 bits/pixel. • For the color images of natural scenes with CCIR 601 format ( Y: Cb:Cr = 4:2:2, 720 pixels x 576 lines, 16 bits/pixel ) • 0.25 - 0.5 bits/pixel : moderate to good quality • 0.5 - 0.75 bits/pixel : good to very good quality • 0.75 - 1.5 bits/pixel : excellent quality • 1.5 - 2.0 bits/pixel : indistinguishable from the original
JPEG : ADCT • Main Components of ADCT • 8 x 8 Discrete Cosine Transform ( DCT ) • Differential Pulse Code Modulation ( DPCM ) • Run length Coding ( RLC ) • Variable Length Entropy Coding ( VLC, VLI ) • Arithmetic Coding produced 5-10% better compression than Huffman for any man images, but it is more complex than Huffman Coding for certain implementations.
JPEG Characteristics Summary • Baseline • DCT-based process • Source image : 8 bits/pixel • Sequential scan • Huffman coding : 2 AC and 2 DC • Extended DCT-based process • DCT-based process • Source image : 8 bits/pixel or 12 bits/pixel • Sequential or Progressive scan • Huffman coding : 4 AC and 4 DC
JPEG Characteristics Summary • Lossless • Predictive process • P bits/pixel (2 <= P <=16) • Sequential scan • Huffman coding or Arithmetic coding • Hierarchical • Extended DCT-based or lossless process
JPEG : Coding Algorithm Input Picture Output Picture Inverse Transform 8 x 8 2-D IDCT Forward Transform 8 x 8 2-D DCT Inverse Quantization Receive 4 Tables Uniform Quantization Up to 4 Quant. Tables 1-D DC Prediction 1-D DC Prediction Entropy Decoding Receive 2+2 Tables Entropy Coding 2 DC and AC Tables
ACs Offset Zig-Zag Run Input Data Compressed Data DCT Q - VLC DC DPCM Q Table H Table Offset ACs Zig-Zag Run Input Data Compressed Data IDCT Q-1 + VLD DC DPCM-1 Q Table H Table JPEG : Baseline System • Adaptive DCT Coding with DPCM, RLC, and VLC
u i v j Spatial Domain (8 x 8) JPEG : DCT Algorithm • Separable 2-D DCT of size 8 x 8 u v Transform Domain (8 x 8)
JPEG : Separable 2-D DCT • Row -Column Approach for 2-D DCT Timing Control 1-D N-Point Column DCT 1-D N-Point Row DCT 1-D N-Point Row DCT Out In
JPEG : Quantization • the Q step size in the JPEG: frequency & component dependent. • the high frequency coefficients are subjectively less important than the low frequency coefficients and can be quantized with a greater step size. • the chrominance components are of less psychological importance than the luminance components. • Store up to 4 different Q tables. G(u,v) = F(u,v) // Q(u,v) F’(u,v) = G(u,v) * Q(u,v)
JPEG : Quantization • Default Quantization Table for Luminance
JPEG : Quantization • Default Quantization Table for Chrominance
JPEG : Entropy Coding • DC coefficient: DPCM + VLC ( size ) + VLI ( amplitude ) • AC coefficients: RLC + VLC ( run-length, size ) + VLI ( amplitude ) VLC Table VLI Table Run-length
JPEG : Entropy Coding • DC differential은 (size, amplitude)로 표현 • Size : amplitude를 표현하는데 필요한 비트 수 • Amplitude : DC differential의 amplitude • Residual이 양수인 경우 • Amplitude는 이진수로 표현 • Residual이 음수인 경우 • Amplitude의 절대값에 대하여 일의 보수를 취함
JPEG : Sequential Coding Example • DC value coding • 이전 block의 DC value : 40 • DCi - DCi-1 = 2 • (size, amplitude) = (2, 2) • size = 2의 Huffman code가 011 • Coding된 DC value : 01110 • AC value coding • Zig-zag order : 42 16 -21 10 -15 0 0 0 3 -2 0 2 -3 0 0 0 0 0 2 -1 EOB • Huffman coding of AC coefficients
JPEG : Predictive Lossless Coding • Completely independent of the DCT processing • Typically producing around 2:1 compression Lossless Encoder Input Image Compressed Data Entropy Encoder Predictor H Table
JPEG : Progressive Coding Progressive Scan Example