Predictie Coding Predictie coding is a compression tecnique based on te difference between te original and predicted alues. It is also called DPCM Differential Pulse Code Modulation Lossy or lossless Feedforward or feedback Intraframe or interframe Fied or Adaptie
Histogram of a Digital Image and DPCM Errors Histogram of a digital image Histogram of DPCM errors
Lossless Predictie Coding Source Image data - Entropy Encoder Compressed Image data Predictor Compressed Image data Entropy Decoder Reconstructed Image data Predictor
Lossy Predictie Coding Feedforward m Predictor - e m ˆ m Q ê m Entropy Encoder ê m ê m Entropy Decoder ê m m ' ˆm' Predictor Predictor is based on input before Q. Any error introduced in Q can t be recoered.
Lossy Predictie Coding Feedback m e m ˆ m - Q ê m Entropy Encoder ê m Predictor m ' Feedback loop contains decoder. ê m ê m m ' Entropy Decoder ˆm' Predictor Predictor is based on input after Q. Any effect on quantization error is fed back to te input for adjustment. Hence preents te dc drift and accumulation of errors.
Comparison of Feedforward and Feedback Eample: Predictor: Use preious element for prediction. Quantizer: Use - at discontinuities. 5-2 - 2-5 Input Feedforward Feedback m m ˆm e m ê m ˆm' m ' ˆm e m ê m ˆm' m ' 0 00 00 00 02 2 20 3 20 4 20 5 8 6 8
Intraframe Prediction Coded piels ˆm m i 0 α i i ˆm Global prediction: fied for all images α i α i Local prediction: may ary from image to image α i Adaptie prediction: may ary witin an image
Predictor Optimization We need to minimize te epected alue of te squared prediction error. 2 2 0 e m i i i m E σ α 0 2 j e α σ, j0,,,m- 0 0 j m i i i m E α, j 0,,,m-
Predictor Optimization (continued) Assuming a gien image model (say Marko) wit auto-correlation function R k l, E [ k l ] 2 σ 2 k l were mean, σ 2 ariance, and are ertical and orizontal correlation coefficients respectiely, and k and l are ertical and orizontal displacements, we can determine accordingly. α i
Optimal Predictor Eample 0, 2, 2 σ m [ ], l k l k l k E R Ten [ ] [ ] 0,, 2 0 j E E j i i j i α α α 0 Tus ( ) ( ) 2 2 2 2 2 2 0, α α If, ten 2 0 α α ˆ 2 0
Optimal Predictor Eample 2 0, 3, 2 σ m [ ], l k l k l k E R Ten [ ] [ ] 2 0,,, 3 2 0 j E E j i i j i α α α α 2 0 Tus α α α 2 0,, 2 ˆ 3 0
B A C ˆm Typical Predictors ˆ m 0. 97 A, st order /-D ˆ m 0.50 A 0. 50C, 2 nd order /2-D ˆ m 0.90 A 0.8B 0. 90C, 3 rd order / 2-D
Types of DPCM Noise
Adaptie DPCM (ADPCM) Adaptie prediction Adaptie quantization Switcing of predictors or quantizers Adjustment of a parameter adaptiely
Block Diagram for Adaptie DPCM using Switced Quantization X n - - - - Quantizer Predictor Quantizer 2 Predictor Quantizer 3 Predictor Quantizer 4 Predictor - - - - Coder Error Coder 2 Error 2 Coder 3 Error 3 Coder 4 Error 4 Block Select Logic Coder Output Oeread
Lossy Predictie Coding Eamples DPCM Predictor: -D, ˆ m 0.97A; 2-D, ˆ m 0.75A-0.5B0.75C Quantizer: ADPCM Predictor: Lloyd-Ma (Laplacian, ariance matced wit differential inputs) wit, 2, and 3 bits Same as DPCM Quantizer: Same as DPCM wit 4 scaling factors of 0.5,.0,. 75, and 2.5 Switc among 4 quantizers oer a block of 0 piels Oeread bits 2 bits/0 piels 0.2 bpp
Lossy Predictie Coding Eamples (continued) LENA Tecnique Bit rate bits/piel RMSE (0-255) SNR (db) -D DPCM.00 8.67 22.7 -D DPCM 2.00 9.44 28.63 -D DPCM 3.00 5. 33.96 2-D DPCM.00 4.58 27.74 2-D DPCM 2.00 6.93 3.32 2-D DPCM 3.00 3.7 36.74 -D ADPCM.20 0.9 27.37 -D ADPCM 2.20 4.37 35.32 -D ADPCM 3.20 2.6 4.44 2-D ADPCM.20 7.84 30.24 2-D ADPCM 2.20 2.87 38.97 2-D ADPCM 3.20.37 45.40
DPCM at.00 bit/piel
DPCM at 2.00 bits/piel
DPCM at 2.00 bits/piel (magnified) Original Encoded
DPCM at 3.00 bits/piel
ADPCM at.20 bits/piel
ADPCM at 2.20 bits/piel
ADPCM at 3.20 bits/piel
2-D ADPCM Hardware Compleity Encoder 4 ( 3 multiplications 5 additions P comparisons )/piel Were P, 2, or 3 assuming binary tree operation for te quantizer. Decoder ( 3 multiplication 3 additions )/piel Applying tis algoritm to CIF ( 30 fps ) requires approimately ( assuming P 2 on aerage ) 4 0 288 352.5 30 82 MIPS for a real-time encoding
Intraframe Transform/Predictie Coding u i -D DCT i e i ˆi - Q e i Entropy Encoder ê i Predictor Line Memory i ' ê i Entropy Decoder e i i ' -D IDCT u i ' ˆi Predictor Line Memory
Formulation i Cu i e i i ˆi u ij strip k L pels wide i ' ˆi e i Use preious row as predictor ˆi i u i ' C T i ' Use Lloyd-Ma quantizer, fied or adaptie
Head Scene
Coding performance L32, for adaptie case, te MSV s of te differential alues in eac strip were measured and used to design L loyd-ma quantizers.
Obserations PSNR increases as bpp increases Adaptie sceme works for Head but not for Scene Rate of improement in PSNR decrease after bpp for te case of Head -D DCT/DPCM is comparable to 2-D DCT Oter forms and combinations are possible
Additional Reference A. N. Netraali and B. G. Haskell, Digital Pictures Representation and Compression, Plenum Press, 988, pp. 449-452