Chapter 9 - Image Compression Standards
Chapter 9 - Image Compression Standards
Image Compression
Standards
9.1 The JPEG Standard
9.2 The JPEG2000 Standard
9.3 The JPEG-LS Standard
9.4 Bi-level Image Compression
Standards
9.5 Further Exploration
Ze-Nian Li & Mark Drew, Fundamentals 1of Multimedia, Prentice Hall, 2003Li & Drew
Li & Drew
Li & Drew
Li & Drew
Li & Drew
Li & Drew
Li & Drew
Quantization
F (u , v)
F (u, v) round
Q(u , v)
(9.1)
Fentry,
(u , v) and
The quantization
compression.
step
is
the
main
source
for
loss
in
JPEG
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.
8
Li & Drew
11
12
13
17
22
35
64
92
10
14
16
22
37
55
78
95
16 24 40
19 26 58
24 40 57
29 51 87
56 68 109
64 81 104
87 103 121
98 112 100
51
61
60 55
69
56
80
62
103
77
113
92
120 101
103
99
99 99
99 99
99 99
99 99
99 99
Li & Drew
99 99
200
175
200
178
203
185
200
187
200
187
200
187
205
202
175
203
175
200
175
200
187
205
175
200
175
200
515
-16
-12
-8
0
0
3
-2
65
3
6
3
-2
-3
-2
5
-12 4 1 2
2 0 0 -11
11 -1 3 0
-4 2 -2 -3
7 -5 4 0
-1 0 4 1
-3 3 3 -1
-2 4 -2 2
F(u, v)
-8 5
-2 3
1 -2
-5 -2
-1 -4
-1 0
-1 3
-3 0
Fig. 9.2:
JPEG
compression for a smooth image block.
200 200
200
190
10
Li & Drew
Li & Drew
Li & Drew
Li & Drew
To make it most likely to hit a long run of zeros: a zig-zag scan is used to turn the 88
Fmatrix
(u , v )
into a 64-vector.
14
Li & Drew
DPCM on DC coefficients
The DC coefficients are coded separately from
the
AC
ones.
Differential
Pulse
Code
Li & Drew
Entropy Coding
The DC and AC coefficients finally undergo an entropy coding step to gain a
possible further compression.
Use DC as an example: each DPCM coded DC coefficient is represented by (SIZE,
AMPLITUDE), where SIZE indicates how many bits are needed for representing
the coefficient, 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 Huffman coded since smaller SIZEs occur much more often.
AMPLITUDE is
not Huffman coded, its value can change widely so Huffman coding has no
appreciable benefit.
16
Li & Drew
sizeAMPLITUDE
category.
-1, 1
-3, -2, 2, 3
-7..-4, 4..7
-15..-8, 8..15
10
-1023..-512, 512..1023
17
Li & Drew
Li & Drew
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
coefficients: higher AC components provide detail information.
Scan 1: Encode DC and first 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
2.
Progressive Mode
(Contd)
Successive
approximation:
Instead
of
Li & Drew
Hierarchical Mode
The encoded image at the lowest resolution is
basically a compressed low-pass filtered image,
whereas the images at successively higher
resolutions
provide
additional
details
Li & Drew
Li & Drew
Reduce resolution of the input image f (e.g., 512512) by a factor of 2 in each dimension to obtain f2 (e.g., 256
256). Repeat this to obtain f4 (e.g., 128 128).
).
f
4
d 2 f 2 E ( f 4 )
f
4
f
4
d2 ; add it to E(f 4
) to get
f E ( f ) d
2
4
2
and decompression.
(b) Encode difference
D 1.
d1 f E ( f 2 )
23
Li & Drew
encoder tof 4
f
2. Restore image
2
UseE ( f 4 ) d2
f
3. Restore image
Use E ( f 2 ) d1
obtain
f2
to obtain
.
Li & Drew
Li & Drew
Li & Drew
Li & Drew
28
Li & Drew
channels
of
information
whereas
the
Li & Drew
Li & Drew
Embedded
Block
coding
and
bitstream
generation.
Post
compression
rate
distortion
(PCRD)
optimization.
Li & Drew
32
Li & Drew
1. Bitplane Coding
Uniform dead zone quantizers are used with successively smaller
interval sizes. Equivalent to coding each block one bitplane at a time.
Fig. 9.8: Dead zone quantizer. The length of the dead zone is 2. Values
inside the dead zone are quantized to 0.
33
Li & Drew
Bi0 [ j] Bi [ j]
The
by identifying the sub-blocks
B t [ jtree
] structure
B t 1[2is
j constructed
z]
i
z{0,1}2
using recursion:
34
Li & Drew
Bitplane Coding
Primitives
Four different primitive coding methods that employ context based
arithmetic coding are used:
Zero Coding: Used to code coefficients on each bitplane that are
not yet significant.
hi [k ]
Horizontal:
Vertical:
vi [k ]
di [k ]
Diagonal:
i [k1 z, k2 ], with 0 hi [k ] 2.
i [k1 , k2 z ], with 0 vi [k ] 2.
z{1, 1}
z{1, 1}
z1 , z2 {1, 1}
i [k1 z1 , k2 z2 ], with 0 d i [k ] 4.
35
Li & Drew
HH subband
Label
hi[k]
vi[k]
di[k]
di[k]
hi[k]+vi[k]
>1
>1
>1
>0
>0
>0
>2
36
Li & Drew
be met:
Four consecutive samples must be insignificant.
The samples must have insignificant neighbors.
The samples must be within the same subblock.
The horizontal index k1 of the first sample must
be even.
37
Li & Drew
If i [k ]
is the sign prediction, the binary symbol coded
using the relevant
.
[context
k ] [k is
]
i
38
Li & Drew
i [k ]
vi [k ]
hi [k ]
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
39
Li & Drew
1
i
40
Li & Drew
2. Fractional Bitplane
Coding
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 finely embedded bitstream.
(P1 p )
Four different passes are used: forward significance propagation
p
(P2 )
pass
; reverse significance propagation
pass
(P3 p )
(P4 p ) normalization pass
refinement
pass
; and
41
; magnitude
.
Li & Drew
Forward Significance
Propagation Pass
Sub-block samples are visited in scan-line order and
insignificant samples and samples that do not satisfy the
neighborhood requirement are skipped.
For the LH, HL, and LL subbands, the neighborhood
requirement is that at least one of the horizontal
neighbors has to be significant.
For the HH subband, the neighborhood requirement is that
at least one of the four diagonal neighbors is significant.
42
Li & Drew
P1
[k ]
p
are coded i using the sign coding and run-length coding primitives as appropriate. If a
sample is found to be significant, its sign is immediately coded using the sign coding
primitive.
43
Li & Drew
Fig. 9.9: Appearance of coding passes and quad tree codes in each blocks
embedded bitstream.
44
Li & Drew
truncation
Dini
point ni,
with distortion
the
overall
distortion
and
of
the
D Dini
i
45
(9.3)
Li & Drew
R R R
ni
i
max
(9.5)
{ni }
D ( ) R ( ) D
ni
i
ni
i
that
(9.6)
Li & Drew
Si jk
Di jk
jk
Ri
(9.5)
is strictly decreasing.
This allows the optimization problem be solved by a simple
selection through an enumeration j1 < j2 < ... of the set of
feasible truncation points.
ni max jk N i | Si jk
47
(9.6)
Li & Drew
R
The quality layer Q1 contains the initial
q
q 1
block
Lq RBni i and
R ni the
0 other layers Qq contain the incremental
i
contribution
Li & Drew
49
Li & Drew
Goal:
Li & Drew
Li & Drew
Li & Drew
Li & Drew
Li & Drew
(a)
Fig. 9.13: Comparison of JPEG and JPEG2000. (a) Original image.
55
Li & Drew
(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
Li & Drew
Li & Drew
Li & Drew
Li & Drew