NCHU1 The LOCO-I Lossless image Compression Algorithm: Principles and Standardization into JPEG-LS Authors: M. J. Weinberger, G. Seroussi, G. Sapiro Source : IEEE Transactions on Image Processing, Vol. 9, No. 8, August 2000, Speaker: Chia-Chun Wu ( 吳佳駿 ) Date : 2004/10/20
NCHU2 Outline 1. IntroductionIntroduction 2. ExampleExample 3. ModelerModeler 4. Regular modeRegular mode 5. Run modeRun mode 6. Coded dataCoded data 7. ResultResult 8. ConclusionConclusion 9. CommentsComments
NCHU3 1. Introduction (1/2) LOCO-I (LOw COmplexity LOssless COmpression for Image) is the standard for lossless and near-lossless compression of continuous-tone images, such as JPEG-LS.
NCHU4 1. Introduction (2/2) Fig.1 JPEG-LS : Block diagram …
NCHU5 2. Example Fig.2 4 x 4 Example image data Inde x 補 0補 0 RcRbRd RaIx
NCHU6 3. Modeler 3.1 Compute local gradientsCompute local gradients 3.2 Local gradient quantizationLocal gradient quantization 3.3 Quantized gradient mergingQuantized gradient merging 3.4 Select the modeSelect the mode
NCHU7 3.1 Compute local gradients Ix is the value of current sample in the image. Three gradients g 1, g 2, g 3. g 1 = Rd – Rb g 2 = Rb – Rc g 3 = Rc – Ra Example 1 Example 2 RcRbRd RaIx (g1,g2,g3)=( 0,81,-36) (g1,g2,g3)=( 0, 0, 0)
NCHU8 3.2 Local gradient quantization Q1, Q2, Q3 are region numbers of quantized local gradients. Example 1 Example 2 g i ( i = 1 to 3 ) Q i ( i = 1 to 3 ) {0} 0 ± {1,2} ± 1 ± {3,4,5,6} ± 2 ± {7,8,...,20} ± 3 ± { ≧ 21} ± 4 (g 1,g 2,g 3 ) ⇒ (Q 1,Q 2,Q 3 ) (g 1, g 2, g 3 )=( 0,81,-36) ⇒ (Q 1,Q 2,Q 3 )=( 0, 4, -4) (g 1, g 2, g 3 )=( 0, 0, 0) ⇒ (Q 1,Q 2,Q 3 )=( 0, 0, 0)
NCHU9 3.3 Quantized gradient merging If the first non-zero element of vector (Q 1,Q 2,Q 3 ) is negative, then (Q 1,Q 2,Q 3 ) ⇒ (-Q 1,-Q 2,-Q 3 ) and SIGN set to – 1, otherwise it set to +1. Example 1 Example 2 Q1Q1 Q2Q2 Q3Q Q1Q1 Q2Q2 Q3Q3 SIGN (Q 1, Q 2, Q 3 )=( 0, 4, -4) ⇒ SIGN = +1 (Q 1, Q 2, Q 3 )=( 0, 0, 0) ⇒ SIGN = +1
NCHU Select the mode If quantized local gradients are not all zero, choose the regular mode.regular mode If Q 1 =Q 2 =Q 3 =0, go to the run mode.run mode Example 1 Example 2 (Q 1, Q 2, Q 3 )=( 0, 4, -4) ⇒ Reqular mode (Q 1, Q 2, Q 3 )=( 0, 0, 0) ⇒ Run mode
NCHU11 4. Regular model 4.1 Compute the fixed predictionCompute the fixed prediction 4.2 Adaptive correctionAdaptive correction 4.3 Compute the prediction errorCompute the prediction error 4.4 Modulo reduction of the errorModulo reduction of the error 4.5 Error mappingError mapping 4.6 Compute the Golomb coding parameter k Compute the Golomb coding parameter k 4.7 Golomb CodeGolomb Code 4.8 Mapped-error encodingMapped-error encoding 4.9 Update the variablesUpdate the variables
NCHU Compute the fixed prediction Ra, Rb, Rc used to predict Ix. Px is predicted value for the sample Ix. Example 1 min(Ra,Rb), if Rc ≧ max(Ra,Rb). max(Ra,Rb), if Rc ≦ min(Ra,Rb). Ra+Rb–Rc, otherwise. { Px = Rc=64Rb=145Rd=145 Ra=100Ix=145 Rc = 64 ≦ min(100,145) ≦ 100 ⇒ Px = max(100,145) = 145
NCHU Adaptive correction C =, C is the prediction of correction value. Example 1 B = -1, N = 2 ⇒ C = = -1 Px + C, if SIGN = +1. Px ─ C, if SIGN = ─1. { Px = [ ] 2 [ ] B N To P23 Px = 145, SIGN = +1 ⇒ Px = Px + C = (-1) = 144
NCHU Compute the prediction error Errval is the prediction error. Example 1 1. Errval = Ix – Px. 2. Errval = ─ Errval, if SIGN = ─1. ⇒ Errval = Ix - Px = 145 ─ 144 = 1 Ix = 145 Px = 144 SIGN = +1
NCHU Modulo reduction of the error The prediction error will be reduced to the range relevant for coding,-127~+128. Example 1 1. Errval = Errval + 256, if Errval < Errval = Errval ─ 256, if Errval ≧ 128. Errval = 1 (1 > 0 and 1 ≦ 128) ⇒ Errval = 1
NCHU Error mapping (1/2) The prediction error, Errval will be mapped to a non-negative value. MErrval is the Errval mapped to non-negative integers in regular mode. Example 1 2*Errval, if Errval ≧ 0. ─2*Errval-1, if Errval < 0. { MErrval = Errval = 1 (1 ≧ 0) ⇒ MErrval = 2 * 1 = 2
NCHU Error mapping (2/2) Prediction error … ↓ ↓ ↓ ↓ ↓↓ ↓ ↓ ↓ … Mapped value
NCHU Compute the Golomb coding parameter k K is the Golomb coding parameter for regular mode. k = min {k ’ |2 k ’ * N ≧ A} Example 1 N = 2, A = 64 ⇒ 2 k ’ * 2 ≧ 64 ⇒ 2 k ’ ≧ 32 ⇒ k = 5
NCHU Golomb Code (1/3) A formula : MErrval = q * m + r A parameter : m (m = 2 k ) Two parts : unary code (q) and modified binary code (r) Example : MErrval = 13, k = 2 ⇒ m = 2 2 = 4 ⇒ 13 = 3 x ⇒ q = 3, r = 1 ⇒ unary code=3, modified binary code=1 ⇒ unary code=000, modified binary code=01 ⇒
NCHU Golomb Code (2/3) nqrCodewordnqr Table. Ⅰ Golomb code for m = 4 (k=2).
NCHU Golomb Code (3/3) Properties - n↓ ⇒ code length↓ - one pass encoding - without to store the code tables - Golomb code are optimal for one sided geometric distributions of nonnegative integers 255 0
NCHU Mapped-error encoding Example 1 k = 5 ⇒ m = 2 k = 2 5 = 32 MErrval = 2 ⇒ 2 = q * m + r = 0 * ⇒ q = 0, r = 2 ⇒ unary code= 0, modified binary code=2 ⇒ unary code= null, modified binary code=00010 ⇒
NCHU Update the variables (1/2) The variables A, B and N are updated according to the current prediction error. A, B are counters for the accumulated prediction error. N is counter for frequency of occurrence of the context.{ A = A + | Errval | B = B + Errval N = N + 1
NCHU Update the variables (2/2) The variables before encoding are : A = 64, B = -1, N = 2. The variables after updating are : Example 1: Errval = 1 ⇒ A = A + | Errval | = = 65. B = B + Errval = = 0. N = N + 1 = = 3. To P13
NCHU25 5. Run model 5.1 Run scanningRun scanning 5.2 Run-length codingRun-length coding
NCHU Run scanning RUNval is the value of repetitived sample. RUNcnt is the value of repetitived sample count for run mode. Example 2 RUNval = Ra = 145 Ix = 145 = RUNval ⇒ RUNcnt = { RUNval = Ra; while (Ix == RUNval) { RUNcnt = RUNcnt + 1; }
NCHU Run-length coding RUNcnt is the value represents the run- length. Example 2 RUNcnt = 2 ⇒ 11 { while (RUNcnt >0) { Append 1 to bit stream; RUNcnt = RUNcnt ─ 1; }
NCHU28 6. Coded data BinaryHexadecimal C C E C E E BC D Table. Ⅱ Coded segment. PS:The last five bits in the above table are padding with 0.
NCHU29 7. Results (1/2) ImageLOCO-IJPEG-LS Balloon Barb Barb Board Boats3.34 Girl Gold Hotel Zelda3.35 Average Table Ⅲ Compression Results On ISO/IEC Image Test Set (In Bits/Sample)
NCHU30 7. Results (2/2) ImageLOCO-IJPEG-LS Lossless JPEG Huffman Lossless JPEG arithm CALIC arithm LOCO-A (arithm) bike cafe woman tools bike cats water finger us chart chart_s compound compound aerial Faxballs Gold hotel Average Table Ⅳ Compression Results On New Image Test Set (In Bits/Sample)
NCHU31 8. Conclusion LOCO-I/JPEG-LS significantly outperforms other schemes of comparable complexity (e.g.,JPEG-Huffman), and it attains compression rations similar or superior to those of higher complexity schemes based on arithmetic coding (e.g.,JPEG-Arithm, CALIC Arithm). LOCO-I performed within a few percentage points of the best available compression ratios (given, in practice, by CALIC), at a much lower complexity level.
NCHU32 9. Comments 找出一個方法去修改 JPEG-LS 的壓縮演算法, 使其具有資訊隱藏的功能。
NCHU33 The end Thank you!!