Multimedia Compression John Hall SMDC Training June, 2006.
-
Upload
ambrose-may -
Category
Documents
-
view
219 -
download
2
Transcript of Multimedia Compression John Hall SMDC Training June, 2006.
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
• MPEG-2 Video Compression
• MPEG-4 Video Compression
• Containers: (MP4, MOV, AVI)
• Audio Compression (AAC, MP3)
Demos
• Exploring Compression Artifacts
• Exporting from QuickTime Pro
Lossless Compression
• Run Length Encoding (RLE):– aaaaaaabbbb
• 7a4b
– abababababa• 1a1b1a1b1a1b1a1b1a1b1a
– Lossless compression relies on input being non-random to achieve compression.
Lossy Compression
• Removes information
• Does so “intelligently”
• For media files, remove what is least noticeable by the senses.
Things Image/Video Compression Has Problems
With• Edges
• High Motion
• Transparency (Smoke, Shadow)
• Subtle gradations of color
• Small details
• Quick Cuts
• Fading In ./ Out
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
JPEG 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
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
MPEG-1
• Group of Pictures (GOP)– Pattern of I,P and B frames– Implications for editing– Implications for errors
I P B I
Things Image/Video Compression Has Problems
With• Edges
• High Motion
• Transparency (Smoke, Shadow)
• Subtle gradations of color
• Small details
• Quick Cuts
• Fading In ./ Out
MPEG-2
• Designed for DVD and Satellite TV
• Generally higher quality and larger than MPEG-1
• No free players
• Commecial disks are encrypted
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
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)
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
Container Formats
• Comparison of Container Formats
Example - Quicktime Pro
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
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
MP3 File Format
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
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