lecture 14: signal compression - university of...

25
Lecture 14: Signal Compression (continued) The Digital World of Multimedia Prof. Mari Ostendorf

Upload: others

Post on 21-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

Lecture 14: Signal Compression (continued)

The Digital World of MultimediaProf. Mari Ostendorf

Page 2: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

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

Page 3: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

Goals for TodayEE299 Sound ShowcaseReview key idea of frequency in imagesCollaborative quizLossy compressionComparing types of image compression

Page 4: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

Frequency Content of Images

Original image Full image DCT DCT on blocks

Page 5: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

Another Example

Page 6: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

Image vs. Spatial Frequency

LPF

low 2-D frequency

high 2-D frequency

Page 7: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

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?

Page 8: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

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

Page 9: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

Revisiting the Rose

Page 10: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

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.

Page 11: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

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)

Page 12: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

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

Page 13: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

JPG: JPEG “lossy” compressed

File size = 76 KBQuality = 90

Page 14: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

JPEG “lossy” compressed

File size = 28 KBQuality = 50

Page 15: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

JPEG “lossy” compressed

File size = 14 KBQuality = 15

Page 16: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

JPEG “lossy” compressed

Q=75, 41 KBQ=15, 14 KB

3x enlarged crop

Page 17: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

Bitmap vs JPEG “lossy”

Q=90, 76 KB1,153 KB

Page 18: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

GIF “lossless” but only 256 colors

279 KB

Page 19: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

GIF 256 color vs PNG “true color”

688 KB279 KB

Page 20: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

GIF 256 color “lossless” vs JPEG “lossy”

Q=98, 246 KB256 color, 279 KB

Page 21: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

GIF 256 color “lossless” vs JPEG “lossy”

Q=80, 77 KB256 color, 279 KB

Page 22: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

GIF 256 color “lossless”

256 color, 9 KB

Page 23: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

GIF 256 color “lossless” vs JPEG “lossy”

Q=10, 14 KB256 color, 9 KB

Page 24: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

EE299 Lecture 148 Feb 2008

GIF 256 color vs PNG “true color”

24bit color, 7 KB256 color, 9 KB

Page 25: Lecture 14: Signal Compression - University of Washingtonssli.ee.washington.edu/courses/ee299/notes/lecture14.pdf · 8 Feb 2008 EE299 Lecture 14 Announcements HW 4 – writing assignment

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