281 likes | 1.12k Views
JPEG-LS -- The new standard of lossless image compression. School of Computer Science, University of Central Florida, VLSI and M-5 Research Group. Predictive encoding. Q: why prediction? A: to produce a more “skewed” set of sequence for entropy encoder. Prediction example.
E N D
JPEG-LS-- The new standard of lossless image compression School of Computer Science, University of Central Florida, VLSI and M-5 Research Group
Predictive encoding • Q: why prediction? • A: to produce a more “skewed” set of sequence for entropy encoder Prediction example
Predictive encoding • Lossless JPEG • JPEG-LS • CALIC • ……
C B A X What’s wrong with Lossless JPEG ? • Lossless JPEG uses “static” predictor. The prediction model is determined before the compression starts
JPEG-LS is better because… • “Dynamic” predictor. The predictor is determined dynamically • Simple edge detection algorithm is introduced to determine the predictor. • Prediction refinement
c b d a X JPEG-LS: initial prediction Prediction algorithm: • Xis the pixel being encoded • a,b and c used for initial prediction If c max(a, b) X^ = min(a, b) Else { If c min(a, b) X^ = max(a, b) Else X^= a + b- c }
103 99 100 100 d d 102 102 X X JPEG-LS: initial prediction example • X is predicted as 100 since a vertical edge is detected • X is predicted as 102 since a horizontal edge is detected
JPEG-LS: refine the prediction • JPEG-LS maintains 365 contexts. it is used to describe the local “characteristics” of pixels. • Context of X is computed from a, b and d • Each context maintains a bias, which can be considered as an evaluation of the predictor’s performance for that particular context. • The bias is used for refinement of the initial prediction • X’’ = X’ – B[q] • where X’ is the initial prediction, X’’ is the refined prediction, q is the context of X and B is the bias
103 100 d 102 X JPEG-LS: prediction refinement example • X’ = 100 • Suppose X is in context q and B[q] = -1, then X’’ = 100 – (-1) = 101
JPEG-LS: compute the prediction error, update the bias • Compute the prediction error as: • Prediction Error = X – X’’ • Update the context-dependent bias
JPEG-LS: Re-mapping example • If the pixel value is in range [0, 255], the prediction error is in range [-255, 255] • A larger range means more bits to represent the prediction error • We need to re-map the prediction errors to [0, 255], is it possible? • Yes. Since the prediction error always in range [-x”, 255-x’’]
JPEG-LS: Re-map residuals The following example assumes pixel value is in [0, 7] Mistake in David Salomon’s book? X’’’ = 2x’’ if x’’>=0 X’’’ = 2|x’’|-1 otherwise
JPEG-LS: entropy encoding • Finally entropy encoder is applied.
Summary of the basic steps of JPEG-LS • Find the initial prediction X^ • Refine prediction by considering the bias of the context • Compute the prediction error (residual) and update the bias of that context • Re-map residuals • Encode residuals using Golomb-Rice coder