Lossy Compresson Compromse accuracy of reconstructon for ncreased compresson. The reconstructon s usually vsbly ndstngushable from the orgnal mage. Typcally, one can get up to 0:1 compresson wth almost (vsually) ndstngushable error. The man dfference between the lossless and lossy compresson methods s the presence of the quantzer. f ( m, + e ( m, e( m, Input Image Σ fˆ ( m, Predctor Quantzer f ( m, Σ + + Symbol Encoder Compressed Image Source Encoder Notce that the predcton s based on the quantzed nput pxel values and not on the orgnal nput pxel values. Ths prevents accumulaton of predcton error n the reconstructed mage and has a stablzng effect.
Compressed Image Symbol Decoder e ( m, + + fˆ ( m, Σ Predctor f ( m, Decompressed Image Source Decoder
Lossy Compresson: Delta Modulaton The desgn of a lossy predctve codng scheme nvolves two man steps: (a) Predctor and (b) Quantzer. Delta Modulaton s a very smple scheme n whch (we look at a 1-D case for smplcty): Predctor: f ˆ( = αf ( Quantzer (1-bt): e ( = + ς for e( > 0 ς otherwse Note that the quantzed errors can be represented by a sngle bt. Naturally, the symbol encoder can use a smple 1-bt fxed length code. Example: Consder an nput sequence of pxels: f ( = {14,15,14,15,13,15,14,0,6,7,8,7,7,9,37,47,6,75,77, 78,79,80,81,81,8,8} wth α = 1 and ς = 6. 5. The frst pxel s transmtted error-free. Therefore, f ( 0) = f (0) = 14. The remanng outputs are sequentally computed usng the above predctor and quantzer expressons: = f ( e( = e( = f ( 6.5 6.5 for f ( = e( + e( > 0 otherwse
Input Encoder Decoder Error n f fˆ e e f fˆ f f f 0 14 - - - 14-14 0 1 15 14 1 6.5 0.5 14 0.5-5.5 14 0.5-6.5-6.5 14 0.5 14 0 3 15 14 1 6.5 0.5 14 0.5-5.5 14 9 0.5 8.5 6.5 7 0.5 7 15 37 7 10 6.5 33.5 7 33.5 3.5 16 47 33.5 13.5 6.5 40 33.5 40 7 17 6 40 6.5 46.5 40 46.5 15.5 18 75 46.5 8.5 6.5 53 46.5 53 19 77 53 4 6.5 59.6 53 59.6 17.5
Desgn of Lossy Compresson schemes In rapdly changng mage regons, the value of ς = 6. 5 s too small to represent the changes n pxel value and ths leads to a dstorton known as slope overload. In very slowly changng mage regons, the value of ς = 6. 5 s too large to represent the smooth changes n pxel value and ths leads to a dstorton known as granular nose. These phenomena lead to blurred object edges and grany or nosy surfaces. The nteracton between the predctor and quantzer (.e., the effect of one on the other) s qute complex. Ideally, they must be desgned together, takng ths nteracton nto account. However, n most cases, the predctor and quantzer are desgned ndependently of each other. Optmal Predctor: DPCM The dfferental pulse code modulator (DPCM) s a specfc predcton scheme (1-D case s llustrated for smplcty): Predctor s chosen to optmze (mnmze) the mean-squared E e ( = E f (. { } error (of the predctor): { } [ ] Quantzaton error s assumed neglgble: e( e(. The form of the predctor s a lnear combnaton of the m past nput pxel values: m f ˆ ( = α f ( n ). = 1
The actual choce of the parameters { α } obtaned by mnmzng the MSE would depend on the mage statstcs. Some common choces that are used n practce are: m, = 0.97 f ( m, m, = 0.5 f ( m, + 0.5 f ( m 1, m, = 0.75 f ( m, + 0.75 f ( m 1, 0.5 f ( m 1, 0.97 f ( m, m, = 0.97 f ( m 1, f h y otherwse where h = f ( m 1, f ( m 1,, and v = f ( m, f ( m 1,, denote the horzontal and vertcal gradents at pont (m,. Example: Orgnal Image (Lenna)
σ = 0.06 σ = 0.046 σ = 0.046 σ = 0.048 Predcton error mages e(m, and ther standard devatons for the four dfferent predctors.
. Optmal Quantzaton: Lloyd-Max quantzer A quantzer s a starcase functon t = q(s) that maps contnuous nput values nto a dscrete and fnte set of out values. We consder quantzers that are odd functons;.e., q ( s) = q( s). An L-level quantzer s completely descrbed by the L 1 decson levels s 1, s,, s L 1 and the reconstructon levels t t, t 1,, L
If the nput values s are not unformly dstrbuted, the unform quantzer wth equally spaced quantzaton levels s not a good choce. By the odd symmetry, we have s = s and t = t. By conventon, the nput value s s mapped to the output value t, f s les n the half-open nterval s, ]. ( s + 1 The quantzer desgn problem s to select the best s and t for a partcular optmzaton crteron and nput probablty dstrbuton p(s). Note that the nput n our case s the predcton error pxel values, snce we are quantzng the predcton error. For mage quantzaton, the nput would be mage pxel values. Based on a mean-squared quantzaton error crteron;.e., E[ ( s t ) ] and assumng that the probablty densty functon p(s) s an even functon, the condtons for mnmal error are gven by: s s 1 ( s t ) p( s) ds = 0, = 1,, L, Reconstructon levels t are centrods of area under p(s) over specfed decson regons s s = t = s 0 + t = 0 L = 1,,, 1 L = and t = t + 1 Decson levels s are located mdway between reconstructon levels t and t + 1 Decson levels s and reconstructon levels t are symmetrc about 0.
The set of values s, t that satsfy the above condtons gve the optmal quantzer --- called the Lloyd-Max quantzer. These equatons for s and t are coupled and cannot be solved analytcally. Tables of numercal solutons for dfferent probablty dstrbutons p(s), and quantzaton levels L are avalable. See Table 8.10 n text for L =,4, 8 level quantzers. The values n the table correspond to a unt varance ( σ = 1) Laplacan densty functon: p( s) = 1 exp σ If the (quantzato error varance s not equal to one, the values n the table should be multpled by the approprate error standard devaton σ. s Example: 4-level Lloyd-Max quantzaton table for a Laplacan densty wth σ = 0. 06 (usng Table 8.10 n text): σ s t (, 0.068] 0. 11 ( 0.068,0] 0. 04 ( 0,0.068] 0. 04 ( 0.068, ] 0. 11 The output of the Lloyd-Max quantzer (quantzed errors) are encoded by a fxed-length code.
Example: Normalzed RMS Error for lossy DPCM usng Lloyd-Max quantzer Quantzer/ -level 4-level 8-level Predctor 1 0.076 0.038 0.01 0.067 0.034 0.019 3 0.054 0.09 0.018 4 0.100 0.034 0.019 Compresson 8:1 4:1.7:1
Reconstructed Image Error Image 1-bt quantzer -bt quantzer 3-bt quantzer Reconstructed and Error Images for lossy DPCM usng Predctor 3