Title: DCT
1DCT
- By Naghmeh Karimi
- The material in this class presentation have been
collected from different published works of other
authors and are presented here for educational
purposes only. - Under supervision of
- Dr. Fakhraie
- University of Tehran
2Outline
- Introduction
- JPEG coding
- DCT technique
3Introduction
4JPEG Coding
5Lossless Compression
Source image data
Compressed image data
Predictor
Entropy Coder
Entropy_Table Specifications
6Lossy Compression
- Baseline sequential mode compression
- Progressive mode
- Hierarchical mode
7Baseline Sequential mode
- An image is partitioned into some 8 by 8
non-overlapping pixel blocks from left to right
and top to bottom. - Each block is coded individually.
8Progressive mode
- Start with a low quality image and successively
improve. - Spectral selection Send DC component and first
few AC coefficients first, then gradually some
more ACs. - 2. Successive approximation send DCT
coefficients MSB (most significant bit) to LSB
(least significant bit).
9Hierarchical mode
- Down-sample by factors of 2 in each dimension,
e.g., reduce 640 x 480 to 320 x 240 - 2. Code smaller image using another JPEG mode
(Progressive, Sequential, or Lossless) - 3. Decode and up-sample encoded image
- 4. Encode difference between the up-sampled and
the original using Progressive,Sequential, or
Lossless.
10Hierarchical mode
- An image is coded as a sequence of layers in a
pyramid. - Except for the top level of pyramid, for each
luminance and color component at the lower
levels, the difference between the source
components and the reference reconstructed image
is coded.
11Baseline JPEG Encoder(block diagram)
AC
Zigzag
VLC
Compressed image data
Q
Zero shift
DCT
VLC
Diff
DC
image
12Color Transformation
- The human visual systems is most sensitive to
changes in luminance and less to changes in
chrominance. - RGB must be converted to the other color systems
.
13YUV system
- Y 0.299R 0.587G 0.114B
- U B - Y
- V R - Y
14Zero Shift
- After transformation Y, U and V are in the range
of 0,255 - Zero shift changes this range to -128,127
15DCT
- The strength of transform coding in achieving
data compression is that the image energy of the
most natural scenes is mainly concentrated in the
low frequency region and hence into a few
transform coefficients.
16Quantization
- Quantization allows us to reduce the accuracy
with witch the DCT coefficients are represented
when converting the DCT to an integer
representation. - It tends to make many coefficients zero,
specially those for high spatial frequencies. - Two standard table are available for quantization.
17Zigzag Scan
- The zigzag pattern used in the JPEG algorithms
orders the basis functions from low to high
spatial frequencies . - It facilitate entropy coding by encountering the
most likely non-zero coefficient first.
18Run Length Coding
- For the JPEG standard, a symbol is structured in
2 parts - Symbol1 (VLC)
- Symbol2 binary representation of
amplitude
19Coding DC Coefficients
- The differential rules are categorized based on
the magnitude range called CAT. - The CAT is Variable Length Coded.
20Coding AC Coefficients
- For each non-zero AC coefficient in zigzag Scan
symbol1 is described as a 2dimentional event of (
Run, Cat ). - Cat category for the amplitude of a non-zero
coefficient. - Run the number of zeros preceding this non-zero
coefficient.
21Coding AC Coefficients(Cont.)
- If Run is greater than 15 then (Run, Cat) must be
broken to some (15,0) followed by a (Cat1, Run1). - Example
- (34,5) (15,0),(15,0),(2,5)
- The end of the block is represented by (0,0)
22Improving DCT Efficiency
- Using LUTs .
- Using FDCT Algorithms.
- Using Pipeline structures.
23Example
A
5 ? (3,3) ?111111110101101
242-DCT
25First_Technique
- 8-point DCT and IDCT
- DCT
- Input 8 bit
- Output10 bit
- IDCT
- Input 10 bit
- Output8 bit
268-point IDCT
278-point IDCT(Cont.)
28Rotator
29Rotator
- Another Architecture with 3 adder and 3
multiplier is possible.
308-point DCT
31Rotator
32Implementation Results
33Second_Technique
341-D IDCT Equation Coefficients
Original Coefficients
Simplified Coefficients
35Second_Technique
36Total_Implementation
37Wave-Forms
38Results
39Third_Technique(Pipeline)
40Pipeline stages
41Pipeline Structure
- Each 1-D DCT stage 8 clk cycle
- 1-D DCT architecture latency 48 clk cycle
- The transpose buffer latency 64 clk cycle
- Total160 clk cycle
42Fourth_Technique
43FDCT (cosine-factors)
44Data flow graph for 8 point FDCT
45Schematic of 2-D DCT
46Schematic of transposition memory
47Architecture and Operation of2-D DCT Circuit
Reset
Dout
Din
Clk
48Timing Diagram for External In/Out Port
(A) Serial to Parallel conversion for
input (B)1-D DCT operation (C) Parallel to
Serial conversion for output
49Functionality of internally generated control
signals
50Row 1-D DCT Operation
Timing Diagram of Row 1-D DCT
51Column 1-D DCT Operation
Timing Diagram between Row and Column 1-D DCT
52Column 1-D DCT Operation (Cont.)
Timing Diagram of the last part of Column 1-D DCT
53Fast_Multiplier
a
0
0
8a
2a
0
Multiplier
CSA
CSA
S
C
S
C
CSA
C
S
C
CSA
4
Sum
FF
4
Carry
54Verilog-result(4-bit precision)
55Matlab-result
56List of References 1. 2. 3.