concepts of multimedia processing and transmission it 481, lecture 5 dennis mccaughey, ph.d. 19...

Post on 12-Jan-2016

214 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Concepts of Multimedia Concepts of Multimedia Processing and TransmissionProcessing and Transmission

IT 481, Lecture 5Dennis McCaughey, Ph.D.

19 February, 2007

02/12/2007Dennis Mccaughey, IT 481, Spring 20072

GIF Compression Principles: Basic GIF Compression Principles: Basic Operational ModeOperational Mode

02/12/2007Dennis Mccaughey, IT 481, Spring 20073

GIF Compression Principles: Dynamic GIF Compression Principles: Dynamic Mode Using LZW EncodingMode Using LZW Encoding

02/12/2007Dennis Mccaughey, IT 481, Spring 20074

GIF interlaced mode

02/12/2007Dennis Mccaughey, IT 481, Spring 20075

ITU-T Facsimile StandardsITU-T Facsimile Standards

T2 (Group1) – no longer used T3 (Group 2) – no longer used T4 (Group 3)

– Intended for use with modems on analog PSTN lines

T6 (Group 4)– All digital for use with digital networks such as

ISDN Compression ratios of 10:1 are common

02/12/2007Dennis Mccaughey, IT 481, Spring 20076

Termination and Make-up CodesTermination and Make-up Codes

Termination Codes– White or black run-lengths from 0 to 63 pixels

Make-up Codes– For run lengths that are multiples of 64 pixels

Overscanning– All lines start with a minimum of one white pixel– Receiver knows the first codeword relates to white pixels

and the alternates between black and white Since two code tables are used they are denoted

Modified Huffman Codes Examples:

– Run-length of 12 black pixels is encoded 001000– A Run-length of 140 black pixels = 128 + 12 is encoded as

000011001000 + 0000111

02/12/2007Dennis Mccaughey, IT 481, Spring 20077

Group 3 (T4)Group 3 (T4)

Group 3 provides no error correction– If one or more pixels is corrupted, receiver will lose

synchronization– Each line is terminated with a known EOL code– If synch is lost receiver searches for the EOL code and if

not found within a preset number of lines, it aborts the reception process and informs the sending machine the sending machine to terminate

One dimensional process – Works well for documents contain significant areas of

black and white pixels such as letter documents– For documents containing half-tones it can result in a

negative compression ratio

02/12/2007Dennis Mccaughey, IT 481, Spring 20078

Group 4 (T6)Group 4 (T6)

T6 is an optional feature in Group 3, but is compulsory in Group 4

2-D scheme– Identified black and white run-lengths by

comparing adjacent scan lines– Known as Modified Relative Element Address

Designate (READ) (MMR) coding MMR encoding exploits the fact that most

scan lines differ from the previous ones by only a few pixels– Always assume the first reference line is an

imaginary “all white” line

02/12/2007Dennis Mccaughey, IT 481, Spring 20079

Modified READ Coding ProcedureModified READ Coding Procedure

02/12/2007Dennis Mccaughey, IT 481, Spring 200710

Two-Dimensional Code TableTwo-Dimensional Code Table

Additional Codes necessary to identify mode

Extension Mode– Aborts the encoding

prematurely before the end of the page

– Allows a portion of the page to e sent in its uncompressed form or with a different encoding scheme

Mode Run-Length Abbreviations Codeword

Pass b1b2 P 0001+b1b2

Horizontal a0a1,a1a2 H 001+a0a1+a1a2

Vertical

a1b1 = 0

a1b1 = -1

a1b1 = -2

a1b1 = -3

a1b1 = +1

a1b1 = +2

a1b1 = +3

V(0)

VR(1)

VR(2)

VR(3)

VL(1)

VL(2)

VL(3)

101100001100000110100000100000010

Extensions 0000001000

02/12/2007Dennis Mccaughey, IT 481, Spring 200711

Figure 3.11Figure 3.11

02/12/2007Dennis Mccaughey, IT 481, Spring 200712

Some example run-length possibilities: pass mode

•This is the case when the run-length in the reference line (b1,b2) is to the left of the next run-length in the coding line (a1,a2), that is b2 is to the left of a1.

•The run-length b1b2 is coded using the code words given in Figure 3.11

•If the next pixel on the coding line, a1, is directly below b2 this is not pass mode

02/12/2007Dennis Mccaughey, IT 481, Spring 200713

Some example run-length possibilities: vertical mode

•This is the case when the run-length in the reference line (b1,b2) overlaps the next run-length in the coding line (a1,a2) by a maximum of + 3 pixels that is b2 is to the left of a1.

•Two examples are shown, and for this mode just the difference run length a1b2 is coded

•Most codewords are in this category

02/12/2007Dennis Mccaughey, IT 481, Spring 200714

Some example run-length possibilities: horizontal mode

•This is the case when the run-length in the reference line (b1,b2) overlaps the next run-length in the coding line (a1,a2) by more than + 3 pixels that is b2 is to the left of a1.

•Two examples are shown, and for this mode the two run-lengths a0a1 and a1a2 are coded using the code words given in Figure 3.11

02/12/2007Dennis Mccaughey, IT 481, Spring 200715

JPEGJPEG

Joint Photographic Experts Group Standard- ISO/IEC10918 Lossy algorithm Focus attention on the Baseline Mode Five main stages

1. Image/Block Preparation

2. Forward DCT

3. Quantization

4. Entropy Encoding

5. Frame Building

02/12/2007Dennis Mccaughey, IT 481, Spring 200716

JPEG Encoder Schematic

5

21

4

3

02/12/2007Dennis Mccaughey, IT 481, Spring 200717

1. Image/block preparation: image preparation

Block Image planes into 8x8

BlocksCan use either:

R,G,B orY,Cb,Cr

02/12/2007Dennis Mccaughey, IT 481, Spring 200718

1. Image/block preparation: block preparation

02/12/2007Dennis Mccaughey, IT 481, Spring 200719

2. Forward DCT2. Forward DCT

7 7

0 0

2 1 2 11, , cos cos

4 16 16

1 2 , 0

1,

x y

x i y jF i j C i C j P x y

i jC i C j

otherwise

02/12/2007Dennis Mccaughey, IT 481, Spring 200720

DCT Computation FeaturesDCT Computation Features

02/12/2007Dennis Mccaughey, IT 481, Spring 200721

3. Quantization3. Quantization

Eye responds primarily to the DC and lower frequency components– If the magnitude of the higher frequency components is

less than a certain threshold the eye will not perceive it– Within the quantization process frequencies below a

threshold are zeroed Quantization process reduces the magnitude of the

DC and the AC coefficients so that less bandwidth is required for transmission

This is achieved by dividing the coefficients by a normalization matrix which will zero the smaller coefficients

02/12/2007Dennis Mccaughey, IT 481, Spring 200722

Example computation of a set of quantized DCT coefficients

02/12/2007Dennis Mccaughey, IT 481, Spring 200723

ObservationsObservations

The computation of the quantized coefficients involves divideing the coefficients by a normalization factor and rounding the coefficients to the nearest integer value

The normalization values used, in general, increase in magnitude with increasing spatial frequency

The DC coefficient in the matrix is the largest Many of the higher frequency coefficients are

zero

02/12/2007Dennis Mccaughey, IT 481, Spring 200724

Example 3.4Example 3.4

4. Entropy Coding4. Entropy Coding

02/12/2007Dennis Mccaughey, IT 481, Spring 200726

Vectoring Using a Zigzag Scan: (a) Principle; (b) for previous example

AC ={(0,6) (0,7) (0,3) (0,3) (0,3) (0,2) (0,2) (0,2) (0,2) (0,0)}

02/12/2007Dennis Mccaughey, IT 481, Spring 200727

AC Coefficient EncodingAC Coefficient Encoding

AC coefficients are encoded within a block using run-length coding

Most coefficients are zeros due to normalization

Codes indicate the length of the zero run-length and the coefficient value terminating it. i.e.– (Skip, Value)

(Skip, Value) are mapped to (SSS, Value)– SSS is Huffman Encoded, Value is encoded in

1’s complement binary code words of length specified by SSS

02/12/2007Dennis Mccaughey, IT 481, Spring 200728

SSS vs. ValueSSS vs. Value

Null0,1

00,01,10,11000,001,010,011,100,101,110,111

.

.

.

.

.

.

.

.

0123456789

1011

0-1,1

-3,2,2,3-7..-4,4..7

-15…-8,8…15-31…,-16,16….31

-63.….-32,32…..63-127……-64,64……127

-255…....-128,128…….255-511……...-256,256………511

-1023….…..-512,512………1023-2047.….....,-1023,1023…..…..2047

Encoded ValueSSSDifference Value

02/12/2007Dennis Mccaughey, IT 481, Spring 200729

ProcessProcess

(Skip,Value)(Skip,SSS)Table 3.2

Codeword||Value

(Skip,Value) (Skip,SSS) Codeword

(0,6) (0,3) 100||110

(0,7) (0,3) 100||111

(0,3) (0,2) 01||11

(0,3) (0,2) 01||11

(0,3) (0,2) 01||11

(0,2) (0,2) 01||10

(0,2) (0,2) 01||10

(0,2) (0,2) 01||10

(0,2) (0,2) 01||10

(0,0) (0,0) 1010 (EOB)

02/12/2007Dennis Mccaughey, IT 481, Spring 200730

Default Huffman Code Words for SSS (DC Coefficients)

02/12/2007Dennis Mccaughey, IT 481, Spring 200731

DC CoefficientsDC Coefficients

DC coefficients are differentially encoded across the blocks– Takes advantage of the local correlation in the

average value among local blocks– {12,13,11,11,10} -> {12,1,-2,0,-1}

(Value) Delta (SSS) Huffman Value Codeword

12 12 4 101 1100 101||1100

13 1 1 011 1 011||1

11 -2 2 100 01 100||01

11 0 0 010 Null 010||

10 -1 1 011 0 011||0

02/12/2007Dennis Mccaughey, IT 481, Spring 200732

5. Frame Building5. Frame Building

Frame Header

– Overall width and height of the image in pixels– The number and type of components that are

used to represent the image (CLUT, RGB, YCbCr)

– Digitization format used: (4:2:2,4;2;0, etc) Scan Header

– Identity of the components (RGB etc)– The number of bits used to digitize each

component;– The quantizatio table of values used to encode

each component

02/12/2007Dennis Mccaughey, IT 481, Spring 200733

5. JPEG Encoder Output Bit Stream Format

02/12/2007Dennis Mccaughey, IT 481, Spring 200734

JPEG decoder schematic

top related