Title: C
1Código de Huffman
2Código de Huffman
3Código aritmético
4Run-Length Encoding (RLE)
5Codificação preditiva
Predictive Coding transmit the difference
between estimate of future sample
the sample itself.
- Delta modulation - DPCM - Adaptive predictive
coding - Differential frame coding
6Differential Pulse Code Modulation (DPCM)
7Delta Modulation
8Delta modulation
9Codificação de planos de bit
10Codificação por transformação
11Padrão JPEG
- "Joint Photographic Expert Group". Voted as
international standard in 1992. - Works with color and grayscale images, e.g.,
satellite, medical, ... - Lossy and lossless
12JPEG (intraframe)
- First generation JPEG uses DCTRun length Huffman
entropy coding. - Second generation JPEG (JPEG2000) uses wavelet
transform bit plane coding Arithmetic entropy
coding.
13Visão geral JPEG
DCT (Discrete Cosine Transformation) Quantization
zigzag Scan DPCM on DC component RLE on AC
Components Entropy Coding
14Porquê DCT e não DFT
- DCT is similar to DFT, but can provide a better
approximation with fewer coefficients
- The coefficients of DCT are real valued instead
of complex valued in DFT. - DCT reduces Gibbs effect between sub-image
boundaries.
15Porquê DCT e não DFT
16DCT
Transformada discreta de cosseno
Inversa
17Funções base DCT de 8x8
- Each 8x8 block can be looked at as a weighted
sum of these basis functions. - The process of 2D DCT is also the process of
finding those weights.
18DCT
19Quantização
- F'u, v round ( Fu, v / qu, v ). Why? --
To reduce number of bits per sample - Example 101101 45 (6 bits). qu, v 4 --gt
Truncate to 4 bits 1011 11. - Quantization error is the main source of the
Lossy Compression.
20Tabelas de quantização
Luminância
Cromaticidades
Um fator de qualidade multiplica a matriz de
quantização.
21Varredura Zig-Zag
- Why? -- To group low frequency coefficients in
top of vector. - Maps 8 x 8 to a 1 x 64 vector.
22Codifica DC com DPCM
- DC component is large and varied, but often close
to previous value. - Encode the difference from previous 8 x 8 blocks
-- DPCM
23Codifica AC com RLE
- 1 x 64 vector has lots of zeros in it
- Keeps skip and value, where skip is the number of
zeros and value is the next non-zero component. - Send (0,0) as end-of-block sentinel value.
24Codificação entrópica
- Categorize DC values into SIZE (number of bits
needed to represent) and actual bits. - Example if DC value is 4, 3 bits are needed.
- Send off SIZE as Huffman symbol, followed by
actual 3 bits. - For AC components two symbols are used Symbol_1
(skip, SIZE), Symbol_2 actual bits. Symbol_1
(skip, SIZE) is encoded using the Huffman coding,
Symbol_2 is not encoded. - Huffman Tables can be custom (sent in header) or
default.
25Categorias de codificação
Size Amplitude
-1.1
2 -3..-2,2..3
3 -7..-4,4..7
4 -15..-8,8..15
5 -31..-16,16..31
6 -63..-32,32..63
7 -127..-64,64..127
8 -255..-128,128..255
9 -511..-256,256..511
10 -1023..512,512..1023
26Código de luminância
Categoria Tamanho Code
0 5 00
1 3 010
2 4 011
3 5 100
4 7 101
5 8 110
6 10 1110
7 12 11110
8 14 111110
9 16 1111110
10 18 11111110
11 20 111111110
27Exemplo
28JPEG 2000
29Exemplos
Original
30Exemplos
JPEG 271
31Exemplos
JPEG2000 271