24 - 1 embedded block coding with optimized truncation - an image compression algorithm notes by...

21
24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu http:// www.sfu.ca/~vswu

Post on 22-Dec-2015

219 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 1

Embedded Block Coding with Optimized Truncation

- An Image Compression Algorithm

Notes by Shufang Wu http://www.sfu.ca/~vswu

Page 2: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 2

Agenda

• Overview ( 1 slide )

• Highly Scalable Compression ( 2 slides )

• Optimal Truncation ( 3 slides )

• Embedded Block Coding ( 6 slides )

• Abstract Quality Layers ( 1 slide )

• Conclusion

• References

• Q & A

Page 3: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 3

Overview (1-1)

• What is Embedded Block Coding with Optimized Truncation (EBCOT) ?– Highly scalable bit-stream – Independent embedded blocks– Post-compression rate-distortion (PCRD) optimization– Layered bit-stream organization

• Input of EBCOT– Subband samples generated using a wavelet transform,

like EZW and SPIHT

Subband samples for 3 wavelet decomposition levels

Division of subbands into code-blocks with the same sizeqewraAbstract Quality Layersqewra

Scalability: A key requirement driving the JPEG2000 standardization process.

qewra

Page 4: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 4

Agenda

• Overview ( 1 slide )

• Highly Scalable Compression ( 2 slides )

• Optimal Truncation ( 3 slides )

• Embedded Block Coding ( 6 slides )

• Abstract Quality Layers ( 3 slides )

• Conclusion

• References

• Q & A

Page 5: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 5

A Highly Scalable Bit-stream: One that may be decompressed in many different ways with different results, depending on what information has been discarded.

Highly Scalable Compression (2-1)

• A Scalable Bit-stream

• A Highly Scalable Bit-stream

• Highly Scalable Compression

A Scalable Bit-stream: One that may be partially discarded to obtain an efficient representation or a lower resolution version of the original image at a different bit-rate.

– Refers to the generation of a highly scalable bit-stream

Page 6: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 6

Highly Scalable Compression (2-2)

• A Resolution Scalable Bit-stream

• A Distortion Scalable Bit-stream

• A Spatial Scalable Bit-stream (random access)

Resolution Scalable: Containing distinct subsets representing successive resolution levels.

Distortion Scalable: Containing distinct subsets successively augmenting the quality (reducing the distortion).

Random Access: Identifying the region within each subband and hence the code-blocks which are required to correctly reconstruct the region of interest. (Not in detail)

Wavelet transform is an important tool in the construction of resolution scalable bit-streams.

Embedded quantization is central to the construction of distortion scalable bit-streams.

Elements of a distortion & resolution scalable bit-stream

Quality Progression Resolution Progression

Page 7: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 7

Agenda

• Overview ( 1 slide )

• Highly Scalable Compression ( 2 slides )

• Optimal Truncation ( 3 slides )

• Embedded Block Coding ( 6 slides )

• Abstract Quality Layers ( 3 slides )

• Conclusion

• References

• Q & A

Page 8: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 8

Optimal Truncation (3-1)

• Post-Compression Rate-Distortion (PCRD) Optimization– Rate distortion (R-D) optimization

– PCRD

• Problem Description

Truncate each code-block bit-stream in an optimal way so as to minimize distortion subject to the bit-rate constraint.

The rate-distortion algorithm is applied after all the subband samples have been compressed.

Optimal selection of the truncation points, { ni }, so as to

minimize overall distortion, D, subject to an overall length constraint, Lmax . D = Di

ni, Lmax L = Li

ni

Select ni truncated to Li

ni with distortion Di

ni for code-block Bi

Page 9: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 9

Optimal Truncation (3-2)

• Optimal Selection of Truncation Points

• Simple Algorithm to Find ni in Each Code-block for Given

{ ni }, which minimizes (D() + L()) for some is

optimal.(*)D cannot be reduced without also increasing L and vice-versa. s.t. (*) and L() = Lmax, then { ni

} must be an optimal solution. Discrete, in practice the smallest s.t. L() Lmax.

Initialization: ni = 0;

Loop: For j = 1,2, , Zi; (Zi is the last truncation point)

Set L = Lij Li

ni and D = Di

ni Di

j ; IF D/L > , THEN ni

= j.The amount by which the length is increased.

The amount by which the distortion is decreased.Guarantees that:

Dini

+ Li

ni

Diz + Li

z for all z

j.

Page 10: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 10

• Set of Feasible Truncation Points, Pi , for code-block, Bi

– Distortion-rate slope of a truncation point

– Property of the slopes

• Reduced Algorithm

• Convex Hull Interpretation

An enumeration of points in Pi, 0 = hi0 < hi

1 < < hi|Pi-1|.

i(hin) = (Di

hin-1

Di hi

n)/(Li

hin Li

hin-1

), n 1.

i(hi0) > i(hi

1) > i(hi2) > > i(hi

|Pi-1|). (Strictly decreasing.)

ni = max{ hi

k Pi | i(hik) >

}.

Truncation Points

Feasible Truncation

Points

Optimal Truncation (3-3)

Length

Distortion

Page 11: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 11

Agenda

• Overview ( 1 slide )

• Highly Scalable Compression ( 2 slides )

• Optimal Truncation ( 3 slides )

• Embedded Block Coding ( 6 slides )

• Abstract Quality Layers ( 3 slides )

• Conclusion

• References

• Q & A

Page 12: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 12

Embedded Block Coding (6-1)

• Basics– Classical context adaptive arithmetic coding (18)– Bit-plane coding– Fractional bit-plane coding (Passes) – Sub-blocks with explicit sub-block significance coding

Purpose: Ensure a sufficiently fine embedding.

Assumption: Significant samples tend to be clustered.

Encode first the most significant bits for all samples.

Page 13: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 13

Embedded Block Coding (6-2)

• Quantization– Scalar quantizer (SQ)– Deadzone uniform scalar quantizer– Embedded deadzone quantizers

• Significance of A Sample– A state variable, initialized to 0, transitioned to 1

when its first nonzero bit-plane is encoded

A function that maps each element in a subset of the real line to a particular value in that subset.

1 x0 0.5 1.5-1 -0.5-1.5qewra

SQ with the interval about 0 widened ( twice as large ).

Family of embedded deadzone quantizersqewra

qewra

Page 14: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 14

Embedded Block Coding (6-3)

• Sub-Block Significance Coding ( 16 16 )– For each bit-plane, first encode information to identify those

sub-blocks that contain one or more significant samples– One way to encode is quad-tree coding

• Bit-Plane Coding Primitives– 4 primitives: Zero coding (ZC), Run-length coding (RLC),

Sign coding (SC) and Magnitude refinement (MR)– How to use these primitives ?– In every case, the symbol must be coded using arithmetic

coder with 18 probability modelsqewra

qewra

Embedded Quad-tree Structure

IdentifyingSignificance

ConstructingTree

Entire Code-block

IF the sample is not yet significant, ZC or RLC is used; IF it is significant, SC is used; ELSE (the sample is already significant) MR is used.

18 Probability Models: 9 for ZC; 1 for RLC; 5 for SC; 3 for MR.

Page 15: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 15

Embedded Block Coding (6-4)

• Zero Coding (ZC) 9

– To code pth bit of the quantized magnitude M, given that the sample is not yet significant ( M < 2p+1 )

– Dependency ( empirical studies )• Run-Length Coding (RLC) 1

– To reduce the number of symbols which must be coded– Invoked in ZC when sample and its neighbors are all

insignificant– A group of four samples satisfying 4 conditions is encoded

as a single symbol to identify whether any is significantqewra

1) Four consecutive samples must all be insignificant; 2) Their neighbors must all be insignificant; 3) They must reside within the same sub-block;4) The horizontal index of the first sample must be even.

Formation of Significance Coding Contexts

horizontal

diagonal

vertical

Note: Neighbors outside the code-block are insignificant.

Page 16: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 16

Embedded Block Coding (6-5)

• Sign Coding (SC) 5 (concerning the signs of 4 neighbors)– Used at most once when found significant in ZC or RLC– Redundancy exploited ( 2 symmetry properties )

• Magnitude Refinement (MR) 3– To code pth bit of the quantized magnitude M, given

that M 2p+1

– Dependency ( empirical studies )

0: Both neighbors are insignificant or significant with different signs;1: At least one neighbor is positive; -1: At least one neighbor is negative. qewra

Context 0: S = 0 and 4 neighbors are insignificant;Context 1: S = 0 and at least one neighbor is significant; Context 2: S = 1. (S is a state variable that transitions from 0 to 1 after MR is first applied to the sample.)

Page 17: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 17

Embedded Block Coding (6-6)

• Fractional Bit-Planes (4)– For each bit-plane, the coding proceeds in some passes

and each sample appears in exactly one of the passes

• Forward Significance Propagation Pass ( 1p for bit-plane p )

– Skipping over all samples either insignificant or that do not have a preferred neighborhood(PN)

• Reverse Significance Propagation Pass ( 2p )

– Identical to 1p except two points

• Magnitude Refinement Pass ( 3p )

– Already significant and no information has been coded

• Normalization Pass ( 4p ) all sample not considered before

LL & LH: At least one horizontal neighbor is significant;HL: At least one vertical neighbor is significant;HH: At least one diagonal neighbor is significant.

1) Samples are visited in the reverse order; 2) PN is expanded: At least one of 8 neighbors is significant.

qewra

qewra

Appearance of coding passes and quad-tree codes in each block’s embedded bit-stream

qewra

Page 18: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 18

Agenda

• Overview ( 1 slide )

• Highly Scalable Compression ( 2 slides )

• Optimal Truncation ( 3 slides )

• Embedded Block Coding ( 6 slides )

• Abstract Quality Layers ( 3 slides )

• Conclusion

• References

• Q & A

Page 19: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 19

Abstract Quality Layers (1-1)

• Second Tier of Two-tiered Coding Structure• Abstract Quality Layers• Information Must Be Explicitly Identified

qewra

Tier 1Embedded block coding

Operates on block samples

Tier 2Coding of block contributions

to each quality layerOperates on block summary

information

Code-block samples

Compressed image

Embedded block bit-streams

– Length of the segment– Number of new coding passes– pi

max, most significant bit-plane of code-block, Bi

– qi , index of first layer Bi makes nonempty contribution

Substantial inter-block redundancy

Page 20: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 20

Conclusion

• State-of-the-art Compression Performance• Embedded Block Coding• High Scalability (3)

– Resolution scalability– Distortion/SNR/quality/rate scalability– Spatial scalability (Random access capability)

• Enabling – Use of Post-Compression Rate-Distortion Optimization

• Introducing – the Concept of Abstract Quality Layers

Page 21: 24 - 1 Embedded Block Coding with Optimized Truncation - An Image Compression Algorithm Notes by Shufang Wu vswuvswu

24 - 21

References

1. D. S. Taubman, “High performance scalable image compression with EBCOT,” IEEE Trans. Image Proc., vol. 9, pp. 1158-1170, July 2000

2. D. S. Taubman and M. W. Marcellin, JPEG2000: Image Compression Fundamentals, Standards and Practice, Kluwer Academic Publishers, 2002

3. J. M. Shapiro, “Embedded image coding using zerotrees of wavelet coefficients,” IEEE Trans. Signal Processing., vol. 41, pp. 3445-3462, December 1993

4. A. Said and W. Pearlman, “A new, fast and efficient image codec based on set partitioning in hierarchical trees,” IEEE Trans. Circuits Syst. Video Technol., vol. 6, pp. 243-250, June 1996

5. S. Wu, “Embedded zerotree wavelet: an image coding algorithm”, http://www.sfu.ca/~vswu/courses/CMPT820/presentations/1/present1.ppt, June 2002