lecture 14: signal compression - university of...
TRANSCRIPT
Lecture 14: Signal Compression (continued)
The Digital World of MultimediaProf. Mari Ostendorf
EE299 Lecture 148 Feb 2008
AnnouncementsHW 4 – writing assignment only due todayLabs:
By tomorrow:Get your Lab2&3 sounds in CollectIt so I can showcase themGet your Lab3 *DESCRIPTION* to get full credit for the lab
By Monday: submit Lab 4 exercise 1 to CollectItGuest speaker on Monday talking about audio coding
EE299 Lecture 148 Feb 2008
Goals for TodayEE299 Sound ShowcaseReview key idea of frequency in imagesCollaborative quizLossy compressionComparing types of image compression
EE299 Lecture 148 Feb 2008
Frequency Content of Images
Original image Full image DCT DCT on blocks
EE299 Lecture 148 Feb 2008
Another Example
EE299 Lecture 148 Feb 2008
Image vs. Spatial Frequency
LPF
low 2-D frequency
high 2-D frequency
EE299 Lecture 148 Feb 2008
Color version of block DCTOriginal image B&W version of block DCT
QUIZ
Image processingWhat did I do in the
image processing?
EE299 Lecture 148 Feb 2008
Tricks Used in Lossy CompressionTransform signal into a representation (basis functions) that is:
More efficient (can’t reconstruct approximate version by dropping low weight components)Compatible with human perception (throw out or more coarsely quantize things humans are less sensitive to)
Leverage redundancy by predicting the next sample and then quantizing the error (vs. the sample itself)
Works in transform domain as well
EE299 Lecture 148 Feb 2008
Revisiting the Rose
EE299 Lecture 148 Feb 2008
Example: JPEGEncoding/Compression
Transform:Divide the image into blocks of 8x8 pixelsPerform the discrete cosine transform (DCT) on each block
Quantize the coefficients in each block (lossy step)Lossless compression
Reorder according to increasing spatial frequencyUse entropy (or arithmentic) coding on the resulting values
Decoding/DecompressionUndo lossless coding & reorderingReconstruct the signal
Perform inverse DCT on quantized coefficients for each blocksPut the blocks back together
Encode DecodeStorage
orComm.
EE299 Lecture 148 Feb 2008
Leverage Human PerceptionTranslate signal to a domain that matches perception (e.g. frequency)Image coding
Small color changes are less well perceived than small changes in brightnessProminent objects distract viewer from small detailsWe’re more sensitive to edges than background
Audio coding (Orsak et al. pp. 326-328, more on Monday)We can’t hear frequencies <20Hz and >20kHzOur “quiet threshold” is higher for low and high frequencies With simultaneous sounds close in frequency, a loud one can “mask” a soft one (i.e. we can’t hear the soft one)
EE299 Lecture 148 Feb 2008
Back to Image Coding -- Optionsbmp – bit map, no compressionLossless compression:
png (true color), gif (256 colors indexed), lossless jpgTypical compression factor around 2
Different quality factors for jpg can give compression factors ranging from 5-100
EE299 Lecture 148 Feb 2008
JPG: JPEG “lossy” compressed
File size = 76 KBQuality = 90
EE299 Lecture 148 Feb 2008
JPEG “lossy” compressed
File size = 28 KBQuality = 50
EE299 Lecture 148 Feb 2008
JPEG “lossy” compressed
File size = 14 KBQuality = 15
EE299 Lecture 148 Feb 2008
JPEG “lossy” compressed
Q=75, 41 KBQ=15, 14 KB
3x enlarged crop
EE299 Lecture 148 Feb 2008
Bitmap vs JPEG “lossy”
Q=90, 76 KB1,153 KB
EE299 Lecture 148 Feb 2008
GIF “lossless” but only 256 colors
279 KB
EE299 Lecture 148 Feb 2008
GIF 256 color vs PNG “true color”
688 KB279 KB
EE299 Lecture 148 Feb 2008
GIF 256 color “lossless” vs JPEG “lossy”
Q=98, 246 KB256 color, 279 KB
EE299 Lecture 148 Feb 2008
GIF 256 color “lossless” vs JPEG “lossy”
Q=80, 77 KB256 color, 279 KB
EE299 Lecture 148 Feb 2008
GIF 256 color “lossless”
256 color, 9 KB
EE299 Lecture 148 Feb 2008
GIF 256 color “lossless” vs JPEG “lossy”
Q=10, 14 KB256 color, 9 KB
EE299 Lecture 148 Feb 2008
GIF 256 color vs PNG “true color”
24bit color, 7 KB256 color, 9 KB
EE299 Lecture 148 Feb 2008
Lossy vs. Lossless Compression?Lossy: (jpg)
Good for signals that humans perceiveGood for natural images
Lossless: (gif, png)Good for signal involving machine analysisGood for written/numeric documents, graphs, etc.
Of course, often you use both! (as in mp3 & jpeg)
What about medical signals, biometric signals, or other signals used for decision making?
Engineering and political considerationsChanges in technology could change the choice of what to keep