Comp Slides4 B
Comp Slides4 B
Comp Slides4 B
GC BC BC 1
Examples
1) Value =127:
Binary code BC: 0111 1111
2) Value = 128
Binary code BC: 1000 0000
4
3
0
JPEG: Joint Photographic Experts Group
ALTERNATIVE PREDICTORS:
NW N
W x
RESIDUAL CODING:
x x
DECODER:
x x
ENTROPY CODING:
HUFFMAN CODING
ARITHMETIC CODING (QM-CODER)
Huffman coding
0
{0}
1
{1}
2
{ 2, 3 }
::
3
{ 4, . ,7 }
7 8
{ 63, ..,127 } { 128, ..,255 }
Lossless JPEG: example
PREDICTION MODEL:
b
a x
L=min{a,b}, H=max{a,b}.
probability
below in above
range range range
L H intensity
CODE TABLE:
Pixel position: Codeword:
Below range 10 + Rice(L-P-1)
In range 0 + Adj.Binary(P-L)
Above range 11 + Rice(P-H-1)
ADJUSTED BINARY CODING:
Let =H-L. There are +1 possible values in the
range.
If +1 is a power of two, a binary code with
log2(+1) bits is used.
Otherwise log 1 are used for middle values and
2
RICE CODING:
M o d e le r c o n te x t
F ix e d p r e d ic te d
G ra d ie n ts v a lu e s
p re d ic to r
+
F lat A d ap tive
re g io n ? c o rre c tio n
m ode r e g u la r
im a g e r u n le n g th s ,
s a m p le s run
s ta tis tic s
im a g e R u n c o u n te r
s a m p le s
COMPONENTS OF THE MODEL:
1. Prediction
2. Determination of context.
3. Probability model for the prediction
errors.
PREDICTOR:
min a, b if c max(a, b)
x max a, b if c min(a, b)
ˆ
c b d abc
otherwise
e ax
Examples:
20 12
10 10
1) c=20 > max(10,12) predictor =
min(10,12)=10
10 20
18 20
2) c=10 < max(18,20) predictor =
max(18,20)=20
12 20
10 18
2) 10<12<20 predictor = 20+10-12=18
RESIDUAL CODING:
x x
DECODER:
x x
JPEG-LS context model
The distributoin of prediction residuals in
continuous tone images can be approximated
by a Laplacian distribution, i.e. a two-sided
exponential decay centered at zero.
CONTEXT QUANTIZATION:
gi qi
{0}
{1,2}
{3,4,5,6}
{7,8,...,20}
{e20}
C
2T 1 3
1
2
CODING OF RESIDUALS:
Golomb-Rice coding with parameter 2k
Coding of run-lengths:
Golomb-Rice coding with parameter 2k.
JPEG-LS: Part 2
Difference from Part-1
1. No run mode
2. 4 5 reference points
3. Modified prediction for images with
sparse histograms
4. Binarization and its arithmetic coding
Part-1:
Context modeling Prediction or Run mode
Golomb Coding
Part-2:
Context modeling Prediction Binarization
Arithemtic Coding
Comparison of lossless methods
Source: http://www.hpl.hp.com/research/itc/csl/vcd/infotheory/loco.html