Documente Academic
Documente Profesional
Documente Cultură
7.1 Introduction Since the mid-1980s, the ITU and ISO had been working together to develop a joint international standard for the compression of still images. JPEG became an international standard in 1992. Officially, JPEG [jpeg] is the ISO/IEC international standard 10918-1: digital compression and coding of continuous-tone still images, or the ITU-T Recommendation T.81.
1
JPEG includes two classes of encoding and decoding processes: Lossy process DCT-based sufficient for many applications Lossless process Prediction-based JPEG includes four modes of operation Sequential DCT-based mode Progressive DCT-based mode Lossless mode Hierarchical mode.
v Sequential DCT-based mode an image first partitioned into blocks of 8x8 pixels then the blocks processed from left to right, top to bottom.
2
8x8 2-D forward DCT is applied to each block 8x8 DCT coefficients then quantized quantized DCT coefficients entropy encoded and output v Progressive DCT-based mode Similar to sequential DCT-based mode Quantized DCT coefficients, however, first stored in buffer. DCT coefficients in buffer then encoded by a multiple scanning process In each scan, quantized DCT coefficients partially encoded either by spectral selection or successive approximation. In spectral selection, quantized DCT coefficients divided into multiple spectral bands according to the zigzag order.
3
In successive approximation, a specified number of most significant bits of quantized coefficients first encoded. In subsequent scans, less significant bits are encoded.
(b) Progressive coding: quality-by-quality Figure 7.1 Difference between sequential coding and progressive coding
4
This sequence of frames encoded by predictive coding. Except for the first frame, the encoding process is applied to the differential frames.
Hierarchical coding mode progressive presentation progressive DCT-based mode in the applications, which resolution requirements.
Hierarchical mode also provides the capability of progressive coding to a final lossless stage.
7.2 Sequential DCT-based encoding algorithm Baseline algorithm (heart) of JPEG coding standard.
6
Input Image
Image Partitioning
Forward DCT
Quantization
Entropy Encoding
S00
S07
S70
S77
Squv = round(
Suv ) Quv
Squv : quantized value of the DCT coefficient, Suv, Quv : quantization step obtained from the quantization table. Four quantization tables, which may be used by encoder No default quantization tables specified in the specification.
16 12 14 14 18 24 49 72
11 12 13 17 22 35 64 92
10 14 16 22 37 55 78 95
16 19 24 29 56 64 87 98
24 26 40 51 68 81 103 112
61 55 56 62 77 92 101 99
17 18 24 47 99 99 99 99
18 21 26 66 99 99 99 99
24 26 56 99 99 99 99 99
47 66 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99
dequantization
(7.3)
is
DCT
The DC coefficient, Sq00, treated separately from other 63 AC coefficients. DC coefficients: coded by predictive coding.
9
(7.4)
block Diff is coded by Huffman coding. Quantized AC coefficients Arranged in a zig-zag order:
DC
(7.5)
RLC and Huffman coding Each non-zero AC coeff. is represented by an 8-bit composite codeword 'RRRRSSSS'
4 most significant bits 'RRRR': the runlength of zeros from the previous nonzero coeff. 4 least significant bits 'SSSS': the value of the non-zero coefficient which ends the zerorun (10 categories). Category k : ( 2k 1,2k 1) or (- 2k +1,- 2k 1) 'RRRRSSSS'=11110000: a run-length of 16 zero coefficients Run-length exceeding 16 needs multiple symbols. 'RRRRSSSS' = '00000000': the end-of-block (EOB) [remaining coefficients in the block are zero].
11
Composite values
Figure 7.6 Two-dimensional value array for Huffman coding Table: AC coefficient grouping
A total number of 162 codewords: (16 runlength 10 categories+ 2 special) The composite value, RRRRSSSS, is then Huffman coded.
12
Each Huffman code is followed by additional bits, which specify the sign and exact amplitude of the coefficients. Huffman code tables developed from the average statistics of a large set of images with 8-bit precision.
An adaptive arithmetic coding procedure can be also used for entropy coding.
f(j,k)
13
F(u,v)
Quantization table
14
F*(u,v)
Zigzag scanned quantized coeff. sequence: 79, 0, -2, -1, -1, -1, 0, 0, -1, EOB Bit stream (cascaded codewrods): DC difference Huffman codeword, 11100101, 000, 000, 000, 110110, 1010 Resulting bit rate: 35 bits/64 pixel= 0.55 bit/pixel
15
F (u,v) = F *(u,v)Q(u,v)
IDCT
f^(j,k)
16
Reconstruction error
e(j,k)
17
Quantizized DCT-coefficients: encoded with multiple scans. At each scan, a portion of the DCT coefficient data is encoded. This partial encoded data can be reconstructed to obtain a full image size with lower picture quality. The coded data of each additional scan will enhance the reconstructed image quality until the full quality has been achieved at the completion of all scans.
18
Spectral selection DCT coefficients re-ordered as zig-zag sequence divided into several bands A frequency band: specifying the starting and ending indices The band containing DC coefficient is encoded at the first scan. Successive approximation Significant bits of DCT coefficient encoded in the first scan each succeeding scan improves the precision of the coefficients by one bit, until full precision is reached.
19
8x8
Sending
8x8
Sending
Figure 7.6 Progressive coding with spectral selection and successive approximation
In lossless coding mode, coding method is spatial domain based instead of DCT-based. The coding method is extended from the method for coding the DC coefficients in the sequential DCT-based coding mode. Predictive coding. The predicted value is obtained from one of three 1-D or one of 2-D predictors.
c a b x
Figure 7.7 Spatial relation between the pixel to be coded and three decoded neighbors
x is the pixel to be coded a, b, and c are three decoded neighbors. The predictive value of x, Px, is obtained from a, b and c via one of seven ways as listed in the following table.
21
7.5 Hierarchical coding mode An input image frame first decomposed to a sequence of frames such as a pyramid. First frame encoded as non-differential frame. Following frames encoded as differential frames, which are encoded by using the previous coded frame as reference.
22
Non-differential frame can be encoded by methods of sequential DCT-based coding, spectral selection method of progressive coding,
Up-sampling
Frame Memory
Up-sampling filter increases spatial resolution by a factor of two in both horizontal and vertical directions by using bi-linear interpolation of two neighboring pixels.
23
Up-sampling with bi-linear interpolation is consistent with the down-sampling filter which
References
[jpeg] Digital compression and coding of continuous-tone still images - Requirements and Guidelines, ISO-/IEC International Standard 10918-1, CCITT T.81, September, 1992. [pennebaker 1993] W. B. Pennebaker and J. L. Mitchell, JPEG Still Image Data Compression Standard, New York: Van Nostrand Reinhold, 1993. [rabbani 1991] M. Rabbani and P. W. Jones, Digital Image Compression Techniques, Bellingham, WA: SPIE Optical Engineering Press, 1991.
24