Advanced JPEG
description
Transcript of Advanced JPEG
Advanced JPEGDinesh Ganotra
Organizations InvolvedJoint Photographic Experts GroupISO International Organization for StandardsCCITT International Telegraph and Telephone
Consultative Committee IEC International Electro-technical Commission
Contrast Sensitivity of the Eye◦ At a 1 meter viewing
distance an ideal digital image 40cm wide should have about 4,000 pixels.
◦ The contrast sensitivity curve for luminance is different from chrominance.
QUANTIZATION TABLE
Luminance Quantization Table Chrominance Quantization Table
ZERO SHIFT
The 8-bit image data is zero-shifted by subtracting 128 from the data before the DCT is calculated. For 12-bit data the zero shift is accomplished by subtracting 2048. This reduces the internal precision requirement for DCT calculation.
DCT One multiplication and nine additions per coefficient
× + + +
+++
+ + +
Entropy
Series10
100200300400500600 PC
M
DPCMHuffman Coding
Arithmatic Coding
0 00 1 1 0 1 1 10 0 10 1
DPCM lossless
lossyDCT
Sequential
Progressive
Hierarchical
Huffman Arithmetic
Huffman
Computationally Simpler
Requires code tables to be known
Arithmetic
Higher Performance ( 10%)
code book adapts dynamically to the data being coded.
Sequential
codes the image in a single scan or passes through the data.
The decoder necessarily follows the same order in decoding the data
Progressive
encodes the image in two or more scans or passes through the data, first coding an approximation of the entire image with each succeeding scan. decoder follows the same order in decoding, first reconstructing the
approximating of the image, and then adding finer detail with each
succeeding scan
0
1
2
mag
nitu
de b
it pl
ane
AC band 4
AC band 2 AC band 3AC band 1
AC band 5
AC band 6
DC b
and
1
DC band 4
Progressive
Hierarchical
progressive coding with increasing spatial resolution between progressive stages
Data UnitY1 Y2 Y3 Y4
Y5 Y6 Y7 Y8
Cb1 Cb2
Cb3 Cb4
Cr1 Cr2
Cr3 Cr4
Vertically interleaved data units
Y1 Y2
Y5 Y6
Y3 Y4
Y7 Y8
Cb1 Cb2
Cb3 Cb4
Cr1 Cr2
Cr3 Cr4
Horizontally interleaved data units
Non interleaved, horizontal , and vertical interleaved
Scan1 : Y1 , Y2 , Y3 , Y4 , Y5 , Y6 , Y7 , Y8 Scan2 : Cb1 , Cb2 , Cb3 , Cb4 Scan3 : Cr1 , Cr2 , Cr3 , Cr4
Scan1 : Y1 , Y2 , Cb1 , Cr1, Y3 , Y4 , Cb2 , Cr2, Y5 , Y6 , Cb3 , Cr3 , Y7 , Y8 , Cb4 , Cr4
Scan1 : Y1 , Y3 , Cb1 , Cr1, , Y2 , Y4 , Y5 , Y7 , Cb3 , Cr3 , Y6 , Y8 , Y7 , Y8 , Cb4 , Cr4
ExampleFFD8FFC9 00 11 08 00 80 00 80 03 01 11 00 02 11 00 03 11 00FFCC 00 06 00 10 10 05FFDA 00 08 01 01 01 00 00 3F 00 …FFCC 00 06 01 10 11 05FFDA 00 08 01 02 11 00 3F 00 …FFDA 00 08 01 03 11 00 3F 00 …FFD9
MarkersCode Name CategoryFF01 TEM For temporary use in arithmetic codingFF02-FFBF RES ReservedFFC0 SOF0 Nondifferential Huffman –coding frames Baseline DCTFFC1 SOF1 Nondifferential Huffman –coding frames Extended sequential DCTFFC2 SOF2 Nondifferential Huffman –coding frames Progressive DCTFFC3 SOF3 Nondifferential Huffman –coding frames Lossless sequentialFFC4 DHT Define Huffman Table(s)FFC5 SOF5 Differential Huffman –coding frames differential sequential DCTFFC6 SOF6 Differential Huffman –coding frames differential progressive DCTFFC7 SOF7 Differential Huffman –coding frames differential losslessFFC8 JPG Reserved for JPEG extensionFFC9 SOF9 Nondifferential arithmetic–coding frames Extended sequential DCTFFCA SOF10 Nondifferential arithmetic–coding frames Progressive DCTFFCB SOF11 Nondifferential arithmetic–coding frames Lossless sequential
Markers Cont..FFCC DAC Define Arithmatic CodingFFCD SOF13 Differential arithmetic- coding frames differential sequential FFCE SOF14 Differential arithmetic- coding frames differential progressiveFFCF SOF15 Differential arithmetic- coding frames differential losslessFFD0-FFD7 RSTm Restart with modulo 8 counter mFFD8 SOI Start of imageFFD9 EOI End of ImageFFDA SOS Start of Scan FFDB DQT Define quantization tableFFDC DNL Define number of linesFFDD DRI Define restart intervalFFDE DHP Define Hierarchical progressionFFDF EXP Expand reference imagesFFE0-FFEF APPn Reserved for application use (two different applications may have conflicting usage of APPn)FFF0-FFFD JPGn Reserved for JPEG extensionFFFE COM Comment
Frames and ScansFrame Header SOFn
Parameter Symbol SizeMarker ( FFC0-3, 5-7, 9-B,D-F) SOFn 16Frame header length Lf 16Sample precision P 8Number of lines Y 16Number of samples per line X
16Number of components in frame Nf 8Frame component specification
Component identifier Ci 8Horizontal sampling factor Hi4Vertical sampling factor Vi 4
Quantization table destination selector Tqi
8Nf C1 H1 V1 Tq C2 H2 V2 Tq2 C3 H3 V3 Tq303 00 2 1 00 01 11 01 02 02 1 1 01
The above example shows a three component system. YCrCb with identical sampling for all components in the vertical direction and twice as many Y samples as Cr or Cb samples in the horizontal direction. Let the first component use quantization table 0 and the rest use quantization table 1. If Y, Cr and Cb are numbered 0, 1, and 2 respectively, the components specification is as given above.
Other Header Structures
Scan HeaderDHT Marker SegmentDAC Marker SegmentDQT Marker SegmentRestart Segment
References
JPEG still image data compression standard, William B Pennebaker, JL Mitchell, VNR , International Thomson Publishing Inc.