CODECS AND COMPRESSION
An overview of main concepts and standards
Marco Venanzi @marcovena
marted 18 ottobre 2011
Run through most common compression standards and formats Images Audio Video Pros and cons of each format Clarication on some confusing terminologies
marted 18 ottobre 2011
Codecs vs File Formats
Image JPEG GIF PNG BMP TIFF File Formats .3gp .mov .mp4 .avi .mp3 .mpg
Audio WAV FLAC MP3 AAC AMR Vorbis MIDI
Video H.264 MPEG4 MPEG2 DivX VP8 WebM
marted 18 ottobre 2011
Loseless Lossy
marted 18 ottobre 2011
Images
marted 18 ottobre 2011
BMP, TIFF
Almost uncompressed formats Not used on the web, large dimensions Allow multiple edits Hi-quality processing .bmp, .tiff les
marted 18 ottobre 2011
JPEG
Most common lossy compression format for photography 10:1 compression with minimum degradation Not suitable for le editing, vector shapes and text drawing (artifacts) No transparency File Format: JPEG/Exif , .jpeg les
marted 18 ottobre 2011
GIF
Popular le format, especially for little images, logos, animations max 256 colors - dithering Limited transparency (only 1 color) Best replaced by PNG Still the most used format for simple animations
marted 18 ottobre 2011
PNG
Born as improvement on GIF Better compression for graphics and vectors Loseless format, 8-bit alpha blending Not fully supported by old browsers .png les
marted 18 ottobre 2011
full transparency
no transparency
Just 1 bit transparency
marted 18 ottobre 2011
10
Pixel Resolution dpi ppi
A lot of confusion
Monitors display pixels, and printers produce dots
PPI is the bridge between digital and physical world
Screen 72 ppi, Print 300 ppi Fine Art 600 ppi
marted 18 ottobre 2011
11
Pixel Resolution dpi ppi
I want a 30x40 cm print 12x16 inches at 300 ppi is 3600x4800
marted 18 ottobre 2011
12
Audio
marted 18 ottobre 2011
13
Loseless
Best Quality
Audiophile, Archive, Editing, Hi-Fi FLAC, WMA Loseless, Dolby TrueHD
Lossy
Psycoacoustics
Some info not perceived by the auditory system
High frequencies, tones covered by a louder sound (masking)
marted 18 ottobre 2011
14
AAC AAC+ E-AAC+
AMR-NB
MP3
AMR-WB AMR-WB+
WAV
Vorbis WMA
MIDI
File formats .3gp, .mp4, .m4a, .3ga, .mp3, .aac, .amr, .ogg
marted 18 ottobre 2011
15
marted 18 ottobre 2011
16
marted 18 ottobre 2011
16
Bitrate
320 kbps
Channels
Mono, Stereo, 5.1
Sampling Rate
44kHz
marted 18 ottobre 2011
17
MP3
Most common lossy compression format
128kbps(Radio Quality) 192kbps(CD) 320kbps(Hi-Quality)
Lots of songs in your pocket
File Format: only .mp3 les
marted 18 ottobre 2011
18
AAC
Default audio format for iTunes, iPod, PS3
Improvement on mp3 (~20% gain) especially at lower bitrates
from 8 to 96 kHz (MP3:16 to 48kHz) Up to 48 channels Lots of tools and conguration that dene different proles.
AAC 128kbps ~ MP3 160kbps
File Format: .mp4, .m4a, .3gp, .aac
marted 18 ottobre 2011
19
AAC+
Enhanced AAC+
Spectral Band Replication
creation of higher frequences by an approx. of lower armonies (psycoacoustics)
Parametric Stereo
Downmix of 2 stereo channels into a mono channel along with PS info
AAC 60kbps = AAC+ 48kbps
AAC+ 32kbps >> AAC 48kbps
Works at low bitrates (~24kbps) > 48kbps is transparent Backward compatible
marted 18 ottobre 2011
20
AMR-NB
Low quality for speech - Based on ACELP Sampling frequency 8kHz 8 source codecs with bit-rates range 4kbps~12kbps
Link adaptation
on low signal condition the codec switches to lower bitrate AMR utilizes Discontinuous Transmission (DTX), with Voice Activity Detection (VAD) and Comfort Noise Generation (CNG) to reduce bandwidth usage during silence periods
marted 18 ottobre 2011
21
AMR-WB
Sampling frequency 16kHz 9 congurations with bitrates 6~23kbps
File Format: .3gp, .amr
marted 18 ottobre 2011
22
Video
marted 18 ottobre 2011 23
Frame rate
25 fps
Bit Rate
Variable, Constant
Resolution
QVGA, VGA, 720p, 1080p
marted 18 ottobre 2011
24
RESOLUTION
marted 18 ottobre 2011 25
FRAME RATE
Number of still images in a time unit 10 fps is the minimum frame rate to achieve motion illusion.
marted 18 ottobre 2011
26
Deinterlace
Due to old TVs and technology limits Not possible to shoot uid full frame videos (max 25fps) Half the frame in two subsequent instants Progressive displays have to reconstruct the full frame but the result is not pleasant
DEINTERLACE ALGORITHMS
marted 18 ottobre 2011
27
Chroma Subsampling
Human eye is less sensitive to color than luminance Bandwidth can be optimized by storing more luminance detail than color detail (cones are two times rods)
marted 18 ottobre 2011
28
Common codecs
MJPEG Sequence of JPEG frames Easy to process MJPEG Highly inefcient .avi les MPEG4 MPEG2 Widespread codec for many years On DVD, DVB, Satellite Not suitable for low bitrates .mpg les H.263 developed by ITU-T in 1995 Low bit rate encoding
H.323 (RTP/IP video conf RTP/IP), H.320 (ISDN video conf), RTSP (Streaming) and SIP.
MPEG2 (used in DVD)
h.263 Improvements on MPEG2 Used in DivX, Quicktime .mp4, .m4v, .mov .divx .avi
marted 18 ottobre 2011
29
H.264
Blu-ray Discs Streaming (Vimeo, YouTube, and the iTunes Store) Web software (Adobe Flash Player, Microsoft Silverlight) Broadcast services for DVB Direct-broadcast, cable television services Real-time videoconferencing
marted 18 ottobre 2011
30
H.264
High efciency (50% compared to MPEG-2) Lot of tools and algorithms that can be combined in different proles and levels
Quality depends also on the encoder implementation. H264 denes the structure and the tools but the intrinsic algorithms are open for improvement.
marted 18 ottobre 2011
31
Other codecs
VC-1
Started by Microsoft as a proprietary protocol and released in 2006 as a SMTPE standard Used In HD-DVD, BlueRay, Silverlight, Windows Media (.wmv)
Theora
Open Codec Developed By Xiph.org OGG Container And Matroska (.mkv) Same Performance As MPEG4 Part 2 Codec
marted 18 ottobre 2011
32
The Future
marted 18 ottobre 2011
33
WebP
H.265 JpegMini
JpegXR
WebM
AMR-WB+
marted 18 ottobre 2011
34
marted 18 ottobre 2011
35
H.265
High Eciency Video Coding (HEVC)
50 percent increase in efciency and 3 times complexity
marted 18 ottobre 2011
36
H.265 - Timeline
2013: coding standard published
2012: draft version of the standard expected
3-5 years before commercial products
marted 18 ottobre 2011
37
Higher Resolutions
marted 18 ottobre 2011
38
Focus is not on encoding but on delivery
Dull scene for codecs lately Adaptive Bit Rate Streaming
HTTP Live Streaming
Apple
HTTP Dynamic Streaming
Adobe
marted 18 ottobre 2011
39
Questions?
marted 18 ottobre 2011
40