Escolar Documentos
Profissional Documentos
Cultura Documentos
Feb.28,2011
Losslesscompression L l i
Lossy compression
MSE,SNR,PSNR Ratedistortiontheory R t di t ti th
Quantization Chapter7&Chapter8
Lecture06:Lossy Compression 2
2DDiscreteCosineTransform
Lecture06:Lossy Compression
2DDiscreteCosineTransform
Lecture06:Lossy Compression
Quantization
Quantizationistheheartofanylosscompression Q i i i h h f l i scheme Reducethenumberofdistinctoutputvaluestoamuch Reduce the number of distinct output values to a much smallerset
Original:{0,1,2,64128192255} Original: { 0,1,2, 64 128 192 255 } Smallerset:{0, 64, 128, 192} Partitionthedomainofinputvaluesintoequally(unequally) spacedintervals Uniformscalarquantization U if l ti ti Nonuniform scalarquantization
Lecture06:Lossy Compression 5
Twodifferentformsofquantization q
Originaldata O i i ld
{d1,d2,d64 } {0,1,15} {0 1 15 }
Y={1.55.59.513.5}
01* 23/45* 67/ 89*1011/ 1213*1415
Exampleinimagecompression
DividetheRGBcubeintoequalslidesineachdimension R:3bit;G:3bit;B:2bit;
Lecture06:Lossy Compression 7
2DDiscreteCosineTransform
Lecture06:Lossy Compression
Nonuniformscalarquantization N if l ti ti
TrytominimizeMSE y
CompresseddataY:
{y1,y2,y3,y4}
bj
yj
y j 1 y j 2
bj b j 1 bj
xf ( x)dx f ( x)dx
b j 1
Lecture06:Lossy Compression
10
ExampleofLloydMax Quantization
Uniformscalarquantization f l
Y={1.55.59.513.5}
01* 23/45* 67/ 89*1011/ 1213*1415
Y0 B0 Y1 B1 Y2 B2 0.67 2.3 0.9 2.7 4 7.85 1.5 3.5 4.5 7.75 5.5 7.5 9.5 11.5 11 12.5 11.7 14.8 13.25 14 13.5
0 1 2 / 3 4 5 6 7 / 8 9 10 11 12 13 / 14 15
Lecture06:Lossy Compression 11
2DDiscreteCosineTransform
Lecture06:Lossy Compression
12
Exampleoftransformcoding E l ft f di
OriginaldataX:{100100100100100100100100} TransformcodingT:didii1andd0 =0; a s o cod g d d 1 a d d 0; TransformedvectorY:{1000000000} YistheresultofalineartransformToftheinputvectorXin suchawaythatthecomponentsofYaremuchlesscorrelated Ifmostinformationisaccuratelydescribedbythefirstfew componentsofatransformedvector,thentheremaining componentscanbecoarselyquantized components can be coarsely quantized Y:{100}
Transformcoding
Lecture06:Lossy Compression
13
Signalscanbedecomposedintoasumofsinusoids Si l b d di f i id
Lecture06:Lossy Compression
14
ExampleofRecoveryofAnalog SignalsusingSumofSinusoids
Fundamental frequency 1 0.5 0 -0.5 -1 1 0.5 0 -0.5 -1 Current signal 1 0.5 0 -0.5 -1 Fundamental frequency 2 1 0 -1 -2 Current signal 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0.5*2*fundamental 0.5 2 1 0 0 -1 1 -0.5 -2 Complex signal 0.4 0.2 0 -0.2 02 -0.4 0.33*3*fundamental 2 1 0 -1 1 -2 Complex signal
Fundamental frequency 2 1 0 -1 -2
Current signal
0.5*5*fundamental 2 1 0 0 -1 -0.5 -2
Complex signal
Lecture06:Lossy Compression
15
2DDiscreteCosineTransform
Lecture06:Lossy Compression
16
i;u=0,1M1; TheconstantsC(u)aredeterminedby
Lecture06:Lossy Compression
17
Consideradatasequencewith8numbers 1DDCT
1DIDCT
TheconstantsC(u)aredeterminedby
Lecture06:Lossy Compression
18
DiscreteCosineTransform(DCT) Di t C i T f (DCT)
Exampleoftransformcoding
f 1DDCT
TransformcodingT:
TransformedvectorY:
{2820000000}
Lecture06:Lossy Compression 19
InputvectorX I t t X
f F
{100100100100100100100100} {2820000000}
OutputdataX p
{100100100100100100100100}
Lecture06:Lossy Compression
20
ExampleofCompressionScheme for1DDCT
40
40
40
30
30
30
20
20
20
10
10
10
50
50
50
40
40
40
30
30
30
20
20
20
10
10
10
Lecture06:Lossy Compression
21
2DDiscreteCosineTransform
Lecture06:Lossy Compression
22
Givenaninputfunctionf(i;j)overtwointegervariablesiandj,the Gi en an inp t f nction f(i j) o er t o integer ariables i and j the 2DDCTtransformsitintoanewfunctionF(u;v),withintegeruand vrunningoverthesamerangeasiandj.Thegeneraldefinitionof thetransformis: the transform is:
Lecture06:Lossy Compression
23
Consideranimageof(8*8) 2DDCT
2DIDCT
Lecture06:Lossy Compression
24
Exampleof2DDCTwith8*8 Numbers
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7
8 1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
1 2
1 2
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
3 4 5 6 7 8 1 2 3 4 5 6 7 8
3 4 5 6 7 8
Lecture06:Lossy Compression
25
CompressionSchemeof2DDCT forImageData
Spatialfrequency
Indicateshowmanytimespixelvalueschangeacrossan imageblock i bl k Withameasureofhowmuchtheimagecontentschangein Wi h fh h h i h i correspondencetothenumberofcyclesofacosinewaveper block Use u Usefulimagecontentschangerelativelyslowly age co te ts c a ge e at ve y s o y DCTcanconcentratetheinformationwithinfirstseveral components
Lecture06:Lossy Compression 26
TheDCTformalizesspatialfrequency
Spatialredundancyoftheimage