Securing JPEG2000 (J2K) - The Next Generation Image Compression Standard
JPEG --Still Image Data Compression Standard · A standard image compression method is needed to...
Transcript of JPEG --Still Image Data Compression Standard · A standard image compression method is needed to...
JPEGStill Image Data Compression Standard
JPEG Introduction - The background
JPEG stands for Joint Photographic Expert GroupA standard image compression method is needed to enable interoperability of equipment from different manufacturerIt is the first international digital image compression standard for continuous-tone images (grayscale or color)Why compression is needed?
Ex) VGA(640x480) 640x480x8x3=7,372,800bitswith compression 200,000bits without any visual degradation
JPEG Introduction – what’s the objective?
“very good” or “excellent” compression rate, reconstructed image quality, transmission ratebe applicable to practically any kind of continuous-tone digital source imagegood complexityhave the following modes of operations:
sequential encodingProgressive encodinglossless encoding
JPEG Overview
encoderstatistical
model
entropyencoder
Encodermodel
Sourceimage data
compressedimage data
descriptors symbols
modeltables
entropycoding tables
The basic parts of an JPEG encoder
JPEG Baseline System
JPEG Baseline SystemJPEG Baseline system is composed of:
Sequential DCT-based modeHuffman coding
The basic architecture of JPEG Baseline system
Sourceimage data
quantizer entropyencoder
compressedimage data
tablespecification
tablespecification
8×8 blocks DCT-based encoder
statisticalmodel
FDCT
JPEG Baseline System– Why does it work?
Frequency sensitivity of Human Visual Systemfreq u en cy0
sen sitivity
Lossy encodingHVS is generally more sensitive to low frequenciesNatural images
The Baseline System – DCT
The mathematical representation of FDCT (2-D):
∑∑= =
++=7
0
7
0
)16/)1(2cos()16/)1(2cos(),()()(41),(
x y
vjuiyxfvCuCvuF ππ
Where
⎩⎨⎧ =
=otherwise
xxC1
02/1)(
f(x,y): 2-D sample valueF(u,v): 2-D DCT coefficient
The Discrete Cosine Transform (DCT) separates the frequencies contained in an image.The original data could be reconstructed by Inverse DCT.
Basis of DCT transform
∑∑= =
++=7
0
7
0)16/)1(2cos()16/)1(2cos(),()()(
41),(
x yvjuiyxfvCuCvuF ππ
The Baseline System-DCT (cont.)
(b)
-150
-100
-50
0
50
100
150
1 2 3 4 5 6 7 8
x
f(x)
(c)
-150
-100
-50
0
50
100
150
1 2 3 4 5 6 7 8
u
S(u)
-1
0
1
1 2 3 4 5 6 7 8
U=7
Am
plitu
de
-1
0
1
1 2 3 4 5 6 7 8
U=6
Am
plitu
de
-1
0
1
1 2 3 4 5 6 7 8
U=5
Am
plitu
de
-1
0
1
1 2 3 4 5 6 7 8
U=4
Am
plitu
de
-1
0
1
1 2 3 4 5 6 7 8
U=3
Am
plitu
de
-1
0
1
1 2 3 4 5 6 7 8
U=2
Am
plitu
de-1
0
1
1 2 3 4 5 6 7 8
U=1
Am
plitu
de
-1
0
1
1 2 3 4 5 6 7 8
U=0
Am
plitu
de
Before DCT (image data) After DCT (coefficients)
An example of 1-D DCT decomposition
The 8 basic functions for 1-D DCT
The Baseline System-DCT (cont.) DC coefficient
The DCT coefficient values can be regarded as the relative amounts of the 2-D spatial frequencies contained in the 8×8 block
the upper-left corner coefficient is called the DC coefficient, which is a measure of the average of the energy of the block
Other coefficients are called AC coefficients, coefficients correspond to high frequencies tend to be zero or near zero for most natural images
The Baseline System – Quantization
)),(),((),('
vuQvuFRoundvuF =
F(u,v): original DCT coefficientF’(u,v): DCT coefficient after quantizationQ(u,v): quantization value
Why quantization? .to achieve further compression by representing DCT coefficients with no greater precision than is necessary to achieve the desired image quality
Generally, the “high frequency coefficients” has larger quantization values Quantization makes most coefficients to be zero, it makes the compression system efficient, but it’s the main source that make the system “lossy”
The Baseline System-Quantization (cont.)
16 11 10 16 24 40 51 6112 12 14 19 26 58 60 5514 13 16 24 40 57 69 5614 17 22 29 51 87 80 6218 22 37 56 68 109 103 7724 35 55 64 81 104 113 9249 64 78 87 103 121 120 10172 92 95 98 112 100 103 99
JPEG Luminance quantization table
A simple example
O O O X X O O OO X X X X X X OX X X X X X X XX X X X X X X XX X X X X X X XX X X X X X X XO X X X X X X OO O O X X O O O
-10 -10 -10 10 10 -10 -10 -10-10 10 10 10 10 10 10 -1010 10 10 10 10 10 10 1010 10 10 10 10 10 10 1010 10 10 10 10 10 10 1010 10 10 10 10 10 10 10
-10 10 10 10 10 10 10 -10-10 -10 -10 10 10 -10 -10 -10
40 0 -26 0 0 0 -11 00 0 0 0 0 0 0 0
-45 0 -24 0 8 0 -10 00 0 0 0 0 0 0 0
-20 0 0 0 20 0 0 00 0 0 0 0 0 0 0
-3 0 10 0 18 0 4 00 0 0 0 0 0 0 0
Original image pattern
Digitized image After FDCT(DCT coefficients)
A simple example(cont.)
40 0 -26 0 0 0 -11 00 0 0 0 0 0 0 0
-45 0 -24 0 8 0 -10 00 0 0 0 0 0 0 0
-20 0 0 0 20 0 0 00 0 0 0 0 0 0 0
-3 0 10 0 18 0 4 00 0 0 0 0 0 0 0
16 11 10 16 24 40 51 6112 12 14 19 26 58 60 5514 13 16 24 40 57 69 5614 17 22 29 51 87 80 6218 22 37 56 68 109 103 7724 35 55 64 81 104 113 9249 64 78 87 103 121 120 10172 92 95 98 112 100 103 99
3 0 -3 0 0 0 0 00 0 0 0 0 0 0 0
-3 0 -2 0 0 0 0 00 0 0 0 0 0 0 0
-1 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 0
DCT coefficients Quantized coefficients
Baseline System - DC coefficient coding
Since most image samples have correlation and DC coefficient is a measure of the average value of a 8×8 block, we make use of the “correlation” of DC coefficients
DPCMquantized DCcoefficients
DC difference
Differential pulse code modulation
Baseline System - AC coefficient coding
AC coefficients are arranged into a zig-zag sequence:
0 1 5 6 14 15 27 28
2 4 7 13 16 26 29 42
3 8 12 17 25 30 41 43
9 11 18 24 31 40 44 53
10 19 23 32 39 45 52 54
20 22 33 38 46 51 55 60
21 34 37 47 50 56 59 61
35 36 49 48 57 58 62 63
Horizontal frequency
Ver
tical
freq
uenc
y
3 0 -3 0 0 0 0 00 0 0 0 0 0 0 0
-3 0 -2 0 0 0 0 00 0 0 0 0 0 0 0
-1 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 0
3 0 0 -3 0 -3 0 0 0 0-1 0 -2(EOB)
Baseline System - Statistical modeling
Statistical modeling translate the inputs to a sequence of “symbols” for Huffman coding to useStatistical modeling on DC coefficients:
symbol 1: different size (SSSS)symbol 2: amplitude of difference (additional bits)
Statistical modeling on AC coefficients:symbol 1: RUN-SIZE=16*RRRR+SSSSsymbol 2: amplitude of difference (additional bits)
Additional bits for sign and magnitude
Huffman AC statistical model run-length/amplitude combinations Huffman coding of AC coefficients
An examples of statistical modeling
+8 +9 +8 -6 -8 -3 +3 +30 +1 -1 -14 -2 +5 +6 00 1 1 4 2 3 3 0-- 1 0 0001 00 101 110 --Additional bits
Example 1: Huffman symbol assignment to DC descriptorsquantized DC valueDPCM differenceSSSS
1 2 3 4 5 6 7 8 9 … 630 0 0 0 -14 0 0 +1 0 … 0
4 1RUN-SIZE 68 33
0001 1
Example 2: Huffman symbol assignment to AC descriptors
AC descriptorRRRRSSSS
0
zigzag index
Additional bits
4 2 EOB0
--
Other Operation Modes:JPEG2000 ROI coding
JPEG 2000
Allow efficient lossy and lossless compression within a single unified coding frameworkProgressive transmission by quality, resolution, component, or spatial localityCompressed domain processingRegion of Interest codingJPEG2000 is NOT an extension of JPEG
Wavelet TransformAn extremely flexible bitstream structure
DCT Transform vs. Space-Scale Transform
JPEG2000 ROI coding
Bit plane shift Finer Quantization level used
Experiment
http://www.sfu.ca/~cjenning/toybox/hjpeg/index.html