Multimedia Compression

24
Multimedia Compression John Hall SMDC Training June, 2006

description

Multimedia Compression. John Hall SMDC Training June, 2006. Concepts. Lossy vs. Lossless Compression Container Format vs. Compression Format Constant vs. Variable Bit Rate Exposure to different compression and container formats. Examples. JPEG Image Compression MPEG-1 Video Compression - PowerPoint PPT Presentation

Transcript of Multimedia Compression

Page 1: Multimedia Compression

Multimedia Compression

John Hall

SMDC Training

June, 2006

Page 2: Multimedia Compression

Concepts

• Lossy vs. Lossless Compression

• Container Format vs. Compression Format

• Constant vs. Variable Bit Rate

• Exposure to different compression and container formats

Page 3: Multimedia Compression

Examples

• JPEG Image Compression

• MPEG-1 Video Compression

• MPEG-2 Video Compression

• MPEG-4 Video Compression

• Containers: (MP4, MOV, AVI)

• Audio Compression (AAC, MP3)

Page 4: Multimedia Compression

Demos

• Exploring Compression Artifacts

• Exporting from QuickTime Pro

Page 5: Multimedia Compression

Lossless Compression

• Run Length Encoding (RLE):– aaaaaaabbbb

• 7a4b

– abababababa• 1a1b1a1b1a1b1a1b1a1b1a

– Lossless compression relies on input being non-random to achieve compression.

Page 6: Multimedia Compression

Lossy Compression

• Removes information

• Does so “intelligently”

• For media files, remove what is least noticeable by the senses.

Page 7: Multimedia Compression

Things Image/Video Compression Has Problems

With• Edges

• High Motion

• Transparency (Smoke, Shadow)

• Subtle gradations of color

• Small details

• Quick Cuts

• Fading In ./ Out

Page 8: Multimedia Compression

JPEG Compression

• Lossy (JPEG-2000 can be lossless)• JFIF file format and JPEG compression• 8x8 blocks matched to

combinations of 64 basic patterns

• ‘Quality’ determineshow hard it tries to match

Page 9: Multimedia Compression

JPEG Compression

Page 10: Multimedia Compression

Video Compression

• Series of compressed images (JPEG)

• But can make smaller by compressing what’s common between frames

• Only save the information that’s changed between frames

• Match macroblocks to previous and possibly next frames

Page 11: Multimedia Compression

MPEG-1

• 3 frame types:– I frame - Independent, full image frame– P frame - depends on previous frame– B frame - depends on last and next frame

I P B I

Page 12: Multimedia Compression

MPEG-1

• Group of Pictures (GOP)– Pattern of I,P and B frames– Implications for editing– Implications for errors

I P B I

Page 13: Multimedia Compression

Things Image/Video Compression Has Problems

With• Edges

• High Motion

• Transparency (Smoke, Shadow)

• Subtle gradations of color

• Small details

• Quick Cuts

• Fading In ./ Out

Page 14: Multimedia Compression

MPEG-2

• Designed for DVD and Satellite TV

• Generally higher quality and larger than MPEG-1

• No free players

• Commecial disks are encrypted

Page 15: Multimedia Compression

MPEG-4

• Video compression is Part 2 of standard

• Used in podcasts

• Scalable - great for web at low quality

• Many parts to standard aren’t used

• Container / File is Part 10 of standard

Page 16: Multimedia Compression

When to use Which?

• MPEG2 - Must use for Video-DVD

• MPEG1 - If distributing on CD for older computers

• MPEG4 - For web downloading

• Real - For streaming (contact UMS)

Page 17: Multimedia Compression

Containers / Files• MP4, AVI and MOV are container & file

formats• They can contain a variety of audio and video

and specify the codecs to decode them• For instance:

– A MOV file can contain MPEG-4 video with AAC audio

• OR

– A MOV file can contain Sorenson video with MPEG-3 audio

• OR…

– MP4 (M4V) is MPEG-4 Part 14

Page 18: Multimedia Compression

Container Formats

• Comparison of Container Formats

Page 19: Multimedia Compression

Example - Quicktime Pro

Page 20: Multimedia Compression

Audio Compression

• Uncompressed audio is usually contained in a .wav or .aiff file

• MP3 and AAC are compressed

• MP3 is MPEG-1 Layer 3 audio, not MPEG-3

• AAC is MPEG-4 audio, better sounding for same size but not yet as universal

Page 21: Multimedia Compression

Bit Rate

• How much information is decoded per second

• MP3 typically 128Kbps - 192Kbps

• MPEG-4 Video: 64Kbps, 256Kbps…

• Quality depends on bit rate AND encoder quality

• Variable bit rate

Page 22: Multimedia Compression

MP3 File Format

Page 23: Multimedia Compression

For More Information• Image Compression

– JPEG: http://www.faqs.org/faqs/jpeg-faq/part1/– JPEG: http://en.wikipedia.org/wiki/JPEG

• Video Compression– MPEG-4 pt. 2: http://en.wikipedia.org/wiki/MPEG-4_Part_2– MPEG-4 pt. 10/H.264/AVC: http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC

• File Formats– General info: http://en.wikipedia.org/wiki/File_format– Containers: http://en.wikipedia.org/wiki/Container_format– MPEG-4 pt. 14: http://en.wikipedia.org/wiki/.m4a– Codec list: http://www.fourcc.org/

• Audio– MP3: http://en.wikipedia.org/wiki/MP3

Page 24: Multimedia Compression

Sources and Attribution• DCT Basis Function Image: http://en.wikipedia.org/wiki/Image:Dctjpeg.png, GNU licensed• JPEG Example Image: http://en.wikipedia.org/wiki/Image:Phalaenopsis_JPEG.jpg , by Ilmari Karonon at

Wikipedia, Creative Commons Attribution-ShareAlike 2.5 License• MP3 File Image: http://en.wikipedia.org/wiki/Image:Mp3filestructure.jpg