Escolar Documentos
Profissional Documentos
Cultura Documentos
Observation 1: Useful image contents change relatively slowly across the image, i.e., it is unusual for intensity values to vary widely several times in a small area, for example, within an 8 8 image block. much of the information in an image is repeated, hence spatial redundancy.
YIQ or YUV
f (i, j)
DCT
F (u, v)
Quantization
F (u, v)
88
Quantiz. Tables
DPCM RLC
DC Zig Zag AC
Quantization
F (u, v) = round F (u, v) Q(u, v) (9.1)
F (u, v) represents a DCT coecient, Q(u, v) is a quantiza tion matrix entry, and F (u, v) represents the quantized DCT coecients which JPEG will use in the succeeding entropy coding.
The quantization step is the main source for loss in JPEG compression. The entries of Q(u, v) tend to have larger values towards the lower right corner. This aims to introduce more loss at the higher spatial frequencies a practice supported by Observations 1 and 2. Table 9.1 and 9.2 show the default Q(u, v) values obtained from psychophysical studies with the goal of maximizing the compression ratio while minimizing perceptual losses in JPEG images.
f (i, j)
32 -1 -1 -1 0 0 0 0
6 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 F (u, v) 191 196 202 204 202 199 199 200 186 182 192 188 200 195 203 198 201 196 197 192 195 190 194 190 f (i, j) 178 183 189 191 189 186 186 187 177 180 183 183 182 181 183 185 176 178 180 179 177 177 181 184
-5 -11 3 0 0 0 0 0
-4 9 -5 2 1 1 0 -5 -2 0 1 0 0 -1 -6 4 0 -3 -1 0 1 1 -1 0 1 0 0 0 0 -1 0 0 1 0 0 -1 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 F (u, v) 106 85 92 111 114 131 169 195 94 62 75 102 102 74 180 55 207 111 135 133 73 106 79 107 f (i, j) 103 127 98 70 89 92 101 147 146 93 89 106 84 85 149 210 176 144 167 145 90 162 224 153
-80 -44 90 -80 48 40 51 0 -132 -60 -28 0 26 0 0 -55 42 -78 64 0 -120 -57 0 56 0 17 -22 0 51 0 0 0 0 0 -37 0 0 109 0 0 0 -35 55 -64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 F (u, v) 0 0 2 4 -12 -3 5 6 10 -1 -14 16 13 0 -12 5 -16 4 27 -6 -11 -3 1 11 -18 12 21 0 2 14 14 -47 (i, j) = f (i, j) f (i, j) -6 11 24 -24 -27 16 6 -6 -24 4 -23 20 -7 -2 27 -9 25 -15 -4 24 -8 -20 -3 6 11 -31 29 -49 23 -1 -37 44
DPCM on DC coecients
The DC coecients are coded separately from the AC ones. Dierential Pulse Code Modulation (DPCM) is the coding method.
If the DC coecients for the rst 5 image blocks are 150, 155, 149, 152, 144, then the DPCM would produce 150, 5, -6, 3, -8, assuming di = DCi+1 DCi, and d0 = DC0.
15
Entropy Coding
The DC and AC coecients nally undergo an entropy coding step to gain a possible further compression. Use DC as an example: each DPCM coded DC coecient is represented by (SIZE, AMPLITUDE), where SIZE indicates how many bits are needed for representing the coecient, and AMPLITUDE contains the actual bits. In the example were using, codes 150, 5, 6, 3, 8 will be turned into (8, 10010110), (3, 101), (3, 001), (2, 11), (4, 0111) . SIZE is Human coded since smaller SIZEs occur much more often. AMPLITUDE is not Human coded, its value can change widely so Human coding has no appreciable benet. 16
Li & Drew c Prentice Hall 2003
SIZE 1 2 3 4 . . . 10
AMPLITUDE -1, 1 -3, -2, 2, 3 -7..-4, 4..7 -15..-8, 8..15 . . . -1023..-512, 512..1023
17
18
Progressive Mode
Progressive JPEG delivers low quality versions of the image quickly, followed by higher quality passes. 1. Spectral selection: Takes advantage of the spectral (spatial frequency spectrum) characteristics of the DCT coecients: higher AC components provide detail information. Scan 1: Encode DC and rst few AC components, e.g., AC1, AC2. Scan 2: Encode a few more AC components, e.g., AC3, AC4, AC5. . . Scan k: Encode the last few ACs, e.g., AC61, AC62, AC63. 19
Li & Drew c Prentice Hall 2003
20
Hierarchical Mode
The encoded image at the lowest resolution is basically a compressed low-pass ltered image, whereas the images at successively higher resolutions provide additional details (differences from the lower resolution images). Similar to Progressive JPEG, the Hierarchical JPEG images can be transmitted in multiple passes progressively improving quality.
21
f4
Encode Decode
f4
F4
Decode
f4
2
d2 D2 f2 = E(f4 ) + d2
2
2
d2 = f2 E(f4 )
f2
+ +
Encode Decode + 2
f2
Decode
d1 = f E(f2 )
Encode
D1
Decode
d1
f = E(f2 ) + d1
22
23
24
Start_of_image
Frame
End_of_image
Tables, etc.
Header
Scan
...
Scan
Tables, etc.
Header
Segment
Restart
Segment
Restart
...
Block
Block
Block
...
25
26
Low Bit-rate Compression: The current JPEG standard oers excellent rate-distortion performance in mid and high bit-rates. However, at bit-rates below 0.25 bpp, subjective distortion becomes unacceptable. This is important if we hope to receive images on our web-enabled ubiquitous devices, such as web-aware wristwatches and so on. large Images: The new standard will allow image resolutions greater than 64K by 64K without tiling. It can handle image size up to 232 1. Single Decompression Architecture: The current JPEG standard has 44 modes, many of which are application specic and not used by the majority of JPEG decoders.
27
Transmission in Noisy Environments: The new standard will provide improved error resilience for transmission in noisy environments such as wireless networks and the Internet. Progressive Transmission: The new standard provides seamless quality and resolution scalability from low to high bit-rate. The target bit-rate and reconstruction resolution need not be known at the time of compression. Region of Interest Coding: The new standard allows the specication of Regions of Interest (ROI) which can be coded with superior quality than the rest of the image. One might like to code the face of a speaker with more quality than the surrounding furniture.
28
Computer Generated Imagery: The current JPEG standard is optimized for natural imagery and does not perform well on computer generated imagery. Compound Documents: The new standard oers metadata mechanisms for incorporating additional non-image data as part of the le. This might be useful for including text along with imagery, as one important example. In addition, JPEG2000 is able to handle up to 256 channels of information whereas the current JPEG standard is only able to handle three color channels.
29
31
32
1.
Bitplane Coding
Uniform dead zone quantizers are used with successively smaller interval sizes. Equivalent to coding each block one bitplane at a time.
y 2 1 2 0 -3 -1 -2 -2 -1 0 1 2 3 x
Fig. 9.8:
33
Blocks are further divided into a sequence of 16 16 subblocks. The signicance of sub-blocks are encoded in a signicance map P where p(Bi [j]) denote the signicance of sub-block Bi [j] at bitplane P . A quad-tree structure is used to identify the signicance of sub-blocks one level at a time. The tree structure is constructed by identifying the sub0 blocks with leaf nodes, i.e., Bi [j] = Bi[j]. The higher levt1 t els are built using recursion: Bi [j] = z{0,1}2 Bi [2j + z], 0 t T.
34
z{1,1} i [k1 , k2 +z], with 0 vi [k] 2. z1 ,z2{1,1} i [k1 + z1, k2 + z2], with
35
Table 9.4 Context assignment for the zero coding primitive. LL, LH and HL subbands hi[k] vi[k] di[k] 0 0 0 0 0 1 0 0 >1 0 1 x 0 2 x 1 0 0 1 0 >0 1 >0 x 2 x x HH subband di[k] hi[k] + vi[k] 0 0 0 1 0 >1 1 0 1 1 1 >1 2 0 2 >0 >2 x
Label 0 1 2 3 4 5 6 7 8
36
Run-length coding: Code runs of 1-bit signicance values. Four conditions must be met: Four consecutive samples must be insignicant. The samples must have insignicant neighbors. The samples must be within the same sub-block. The horizontal index k1 of the rst sample must be even.
37
Sign coding: Invoked at most once when a coecients goes from being insignicant to signicant. The sign bits i[k] from adjacent samples contains substantial dependencies. The conditional distribution of i[k] is assumed to be the same as i[k]. i [k] be 0 if both horizontal neighbors are insignicant, 1 h if at least one horizontal neighbor is positive, or 1 if at least one horizontal neighbor is negative. i[k] dened similarly for vertical neighbors. v If i[k] is the sign prediction, the binary symbol coded using the relevant context is i[k] i[k]. 38
Li & Drew c Prentice Hall 2003
Table 9.5 Context assignment for the sign coding primitive Label i[k] 4 1 3 1 2 1 1 -1 0 1 1 1 2 -1 3 -1 4 -1 i[k] i[k] h v 1 1 0 1 -1 1 1 0 0 0 -1 0 1 -1 0 -1 -1 -1
39
Magnitude renement: Code the value of i [k] given that i [k] 2p+1. i [k] is changes from 0 to 1 after the magnitude rene ment primitive is rst applied to si[k]. vi [k] is coded with context 0 if [k] = hi[k] = vi[k] = 0, with context 1 if i [k] = 0 and hi[k] + vi[k] = 0, and with context 2 if i[k] = 1.
p
40
2.
Divides code block samples into smaller subsets having different statistics. Codes one subset at a time starting with the subset expecting to have the largest reduction in distortion. Ensures each code block has a nely embedded bitstream. Four dierent passes are used: forward signicance propap p gation pass (P1 ); reverse signicance propagation pass (P2 ); p p magnitude renement pass (P3 ); and normalization pass (P4 ).
41
42
p S i
max
p P i
4
max
P1
pi
max 1
p P i
2
max 1
p P i
3
max 1
pi
max 1
P4
pi
max 1
...
Fig. 9.9: Appearance of coding passes and quad tree codes in each blocks embedded bitstream.
44
Di i
(9.3)
45
The optimal selection of truncation points ni can be formulated into a minimization problem subject to the following constraint:
R=
i
Ri i Rmax
(9.5)
(D() + R()) =
i
(9.6)
46
Si k = is strictly decreasing.
Di k
j Ri k
(9.7)
This allows the optimization problem be solved by a simple selection through an enumeration j1 < j2 < of the set of feasible truncation points.
(9.8)
47
48
Empty
Empty Empty
Empty
Empty
Empty B0 B1 B2 B3 B4 B5 B6 B7
49
(a)
(b)
(c)
(d)
Fig. 9.11:
shaped ROI. (a) 0.4 bpp, (b) 0.5 bpp, (c) 0.6bpp, and (d) 0.7 bpp.
51
Fig. 9.12:
52
53
54
(a)
55
(b)
(c) Fig. 9.13 (Contd): Comparison of JPEG and JPEG2000. (b) JPEG (left) and JPEG2000 (right) images compressed at 0.75 bpp. (c) JPEG (left) and JPEG2000 (right) images compressed at 0.25 bpp.
56
The LOCO-I algorithm makes uses of context modelling. The idea of context modelling is to take advantage of the structure within the input source the conditional probabilities.
58
JPEG and JPEG2000 links, source code, etc. Original paper for the LOCO-I algorithm Introduction and source code for JPEG-LS, JBIG, JBIG2
60