1 / 56

The Embedded Block Coding with Optimized Truncation in JPEG2000

The Embedded Block Coding with Optimized Truncation in JPEG2000. 蘇文鈺 Prepared By 黃文彬 成大資訊. Forward Wavelet Transform. Coefficient bit modeling. Source Image Data. Arithmetic encoding. Compressed Image Data. Quantization. (a) encoder. Coefficient bit modeling. Inverse Wavelet

ally
Download Presentation

The Embedded Block Coding with Optimized Truncation in JPEG2000

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Embedded Block Coding with Optimized Truncationin JPEG2000 蘇文鈺 Prepared By 黃文彬 成大資訊

  2. Forward Wavelet Transform Coefficient bit modeling Source Image Data Arithmetic encoding Compressed Image Data Quantization (a) encoder Coefficient bit modeling Inverse Wavelet Transform Compressed Image Data Arithmetic decoding De- Quantization Reconstructed Image Data (b) decoder JPEG2000 Codec

  3. 3 1 -16 9 10 0 … 0 5 3 3 0 0 1 … -0 6 -2 18 0 0 0 … 0 8 1 1 0 0 5 … -0 3 12 0 0 0 0 … 0 …… …… 0 0 0 -0 -0 0 … 0 Wavelet Compression Level 2 Wavelet Image Wavelet Image Original Image Quantization 9283 5721 -986 49 40 19 … 0 8785 3061 2083 29 -38 61 … -3 456 -440 108 23 37 31 … 1 148 621 51 29 -36 45 … -2 103 70 22 20 12 -19 … 4 …… …… 10 2 0 -3 -7 11 … 0 120 128 130 105 78 23 ... 129 150 10 218 89 12 45 ... 110 98 104 38 204 239 89 ... 98 78 198 19 178 192 37 … 123 109 45 23 106 76 12 … 67 ….. ….. 28 120 238 129 109 37 … 203 ... DWT DWT Pixel Representation Wavelet Coefficients

  4. SPIHT Algorithm For Wavelet Compression Zero-treeEncoding File Structure Header Rough Image Rough Image Sequence of Zero-trees A Zero-tree

  5. The JPEG2000 Encoder T2 Coding of block contributions To each quality layer Operates on block summary info T1 Embedded Block Coding Operates on block samples Full-featured bit-stream Block of sub-band samples Embedded block bit-streams The part of EBCOT

  6. Quantization • The quantization operation is defined by the step size parameter, ,through • Here, denotes the samples of sub-band , while denotes their quantization indices. • The step size for each sub-band is specified in terms of an exponent, , and a mantissa, , where

  7. From “Sub band” to “code block” to “bit stream”

  8. EBCOT Layered Formation

  9. The Concept of EBCOT • Sub-Block Significance Coding • Bit-Plan Coding Primitives • Zero Coding • Run Length Coding • Sign Coding • Magnitude Refinement Coding • Fractional Bit-Planes and Scanning Order • Significance Propagation Pass • Magnitude Refinement Pass • Cleanup Pass • Layer Formation and Representation • Packet Header Coding • Packet Body Coding

  10. Sub-bank and Code Block and sub-block • Generally, Code Block size is 64*64 or 32*32 and sub-code block size is 16*16. • The scanning order of the sub block to be used. • Each code block is coded independently. Code Block Code Sub-Block

  11. Significant • Significance:當一個係數bit-plane 的值,第一次由0變為1,則此 時這個係數將變為Significance。 • Refinement:當一個係數已經是Significance,則這個係數接下來的 bit皆稱之為Refinement。 • Sign:即係數的符號值。

  12. The Bit Plan Coding Primitives

  13. Scan coding sign Bit plan 1 Bit plan 2 Bit plan 3 Bit plan 4 Bit plan 5 Bit plan 6 q = -2 11 0 -23 49 3 -10

  14. Four Types of Coding Operation for Bit Plan Coding • Zero Coding • Used to code new significance. • Run Length Coding • Reduce the average number of symbols needed to be coded. • Sign Coding • Used to code the sign right after a coefficient is identified significant. • Magnitude Refinement Coding • 3 context depending on the significance of its neighbors and whether it is the first time for refinement.

  15. Stripe Oriented Scanning Pattern Followed Within Each Coding Pass

  16. Zero Coding • The objective here is to code , given that

  17. Run Length Coding • Specifically, each of the following conditions must hold: • 1) Four consecutive samples must all be insignificant, i.e., • 2) The samples must have insignificant neighbors, i.e., • 3) The samples must reside within the same sub-block • 4) The horizontal index of the first sample, , must be even.

  18. Example for RLC

  19. Sign Coding • 當symbol由insignificance 變為significance,此時必須將送出該symbol 的sign值,而sign 值是由垂直及水平鄰近點的sign 值和significance 來查表決定context states。

  20. Magnitude Refinement Coding • Specifically, is coded with context 0 if , with context 1 if and and with context 2 if

  21. Three Coding Pass The JPEG2000 standard other three pass • Significance Propagation Pass • Magnitude Refinement Pass • Cleanup Pass

  22. Significance Propagation Pass • The coding pass for each bit plane is the significance pass. • This pass is used to convey significance and (as necessary) sign information for samplesthat have not yet been found to be significant and are predicted to become significant during the processing of the current bit plane.

  23. Magnitude Refinement Pass • During this pass we skip over all samples except those which are already significant, and for which no information has been coded in the previous two passes. • These samples are processed with the MR primitive.

  24. Cleanup Pass • Here we code the least significant bit, of all samples not considered in the previous two coding passes, using the SC and RLC primitives as appropriate • if a sample is found to be significant in this process, its sign is coded immediately using the SC primitive.

  25. Cleanup Pass Algorithm(cont.)

  26. The EBCOT encoding procedures • Algorithm for encoder Initialize the MQ encoder Initialize the context states according to each coding table Set For each Initialize all the variable For If Perform Encoder-Pass0 (Significance propagation pass) Perform Encoder-Pass1 (Magnitude refinement pass) Perform Encoder-Pass2 (Cleanup pass)

  27. A Simple Example For Bit Plan Coding Example : 10 = +1010 1 = +0001 3 = +0011 -7 = -0111 bit plane1 bit plane2 bit plane3 bit plane4

  28. Block diagram of the embedded block coder

  29. EBCOT Decoder • Algorithm for decoder Initialize the context states according to each coding table For each Initialize all the variable For If Perform De-Significance propagation pass Perform De-Magnitude refinement pass Perform De-Cleanup pass

  30. Redefine JPEG2000 Table Context label in RLC: RLC(0),UNIFORM(18/0x1D)

  31. Example 1 For JPEG2000 Encoder(Only Cleanup Pass)

  32. Example 1 For JPEG2000 Decoder (Only Cleanup Pass) • 第一個讀入的值為context label即coding的方式,查表可知00為Run-length coding. • 第二個讀入的值為symbol即本身的二進位值,此例為1

  33. Example 2 For JPEG2000- Two Bit Plane

  34. Example 2 For JPEG2000 – Bit Plane 1 Cleanup Pass (1)

  35. Example 2 For JPEG2000 – Bit Plane 1 Cleanup Pass (2)

  36. Example 2 For JPEG2000 – Bit Plane 2 Significance Pass (1)

  37. Example 2 For JPEG2000 – Bit Plane 2 Significance Pass (2)

  38. Example 2 For JPEG2000 – Bit Plane 2 Magnitude Refinement Pass

  39. Example 2 For JPEG2000 – Bit Plane 2 Cleanup Pass (1)

  40. Arithmetic Coding - MQ Coder • Before talking about MQ coder, we must understand the Arithmetic coding. • Because the MQ coder is almost the same as a binary arithmetic coding. • Just only one difference between them. • Where is the probability of the zero or one from? • For binary arithmetic coding, the probability of zero or one is driven by the pre-processing. • In other words, before arithmetic coding, the probability of zero or one have been already known, and it’s through the statistic of all data. • In MQ coder, the probability of zero or one is by the dynamic decision.

  41. Arithmetic Coding - MQ Coder • In JPEG2000 standard, there is a table for MQ coder. • The table provides the new probability of zero or one. • The table is shown in the next page. • In the beginning, the probability of zero or one is 0.5, and it is the start of table. • And the next probability of zero or one depends on the input context that is zero or one. • If the input context is zero, the new probability of zero becomes larger in the table. Otherwise, it becomes smaller.

  42. Arithmetic Coding - MQ Coder

  43. Arithmetic Coding - MQ Coder

  44. Arithmetic Coding - MQ Coder

  45. Arithmetic Coding - MQ Coder

  46. Arithmetic Coding – Binary Arithmetic Coding Algorithm Initialize , , , For each Set If If Propagate carry While Renormalize Set

  47. Arithmetic Coding – Binary Arithmetic Coding Algorithm Renormalize Increment Shift Shift If if , emit-bit(1) else increment Else if emit-bit(0) execute times,emit-bit(1) Set Propagate carry Emit-bit(1) If , execute times, emit-bit(0) Set Else Set

  48. Initialize , For each and If If (encode an MPS) else (encode an LPS) If If (The symbol was a real MPS) else (The symbol was a real LPS) While renormalization Arithmetic Coding - MQ Coder algorithm

  49. Arithmetic Coding - MQ Coder Example • We want to encode 1101 and the coding pass is always in context 1 • (1) • Initial • A = 0x8000 , C = 0x0000 , k = 0 , B = 0 , ct = 12 , Sn = 0 • Encode 1 • X = 1 , Sn = 0 , k = 0 • P = 5601 , A = A – P = 29ff • A(29ff) < P(5601) => S = 1 – Sn = 1 • X = S => C = C + P = 5601 • A(29ff) < 0x8000 and X != Sn => Sn = 1 and k = 1 • A = a7fc , C = 15804 , ct = 10 While A < 0x8000 A = 2A , C = 2C , ct = ct -1 if ct = 0 Transfer-Byte

  50. Arithmetic Coding - MQ Coder Example • Encode 1 • X = 1 , Sn = 1 , k = 1 • P = 3401 , A = A – P = 73fb • A(73fb) > P(3401) • X = S => C = C + P = 15804 + 3401 = 18c05 • A(73fb) < 0x8000 and X = Sn => k = 2 • A = e7f6 , C = 3180A , ct = 9 • Encode 0 • X = 0 , Sn = 1 , k = 2 • P = 1801 , A = A – P = cff5 • A(cff5) > P(1801) • X != S => A = 1801 • A(1801) < 0x8000 and X != Sn => Sn = 1 and k = 9 • A = c008 , C = 18c050 , ct = 6

More Related