360 likes | 576 Vues
CS 414 – Multimedia Systems Design Lecture 6 – Digital Video and Introduction to Compression. Klara Nahrstedt Spring 2014. Administrative. MP1 is posted See Class website and compass MP1 lecture will be on February 7 (Friday) in class. Please, read the MP1 before attending the class.
E N D
CS 414 – Multimedia Systems DesignLecture 6 – Digital Video and Introduction to Compression Klara Nahrstedt Spring 2014 CS 414 - Spring 2014
Administrative • MP1 is posted • See Class website and compass • MP1 lecture will be on February 7 (Friday) in class. Please, read the MP1 before attending the class CS 414 - Spring 2014
Today Introduced Concepts • Analog and Digital Television • Need for compression and compression algorithms classification • Basic Coding Concepts • Fixed-length coding and variable-length coding • Compression Ratio • Entropy CS 414 - Spring 2014
Television History (Analog) • 1927, Hoover made a speech in Washington while viewers in NY could see, hear him • AT&T Bell Labs had the first “television” • 18 fps, 2 x 3 inch screen, 2500 pixels
Analog Television Concepts • Production (capture) • 2D • structured formats • Representation and Transmission • popular formats include NTSC, PAL, SECAM • Re-construction • scanning • display issues (refresh rates, temporal resolution) • relies on principles of human visual system CS 414 - Spring 2014
PAL video standard Y is luminance UV are chrominance YUV from RGB Y = .299R + .587G + .114BU = 0.492 (B - Y)V = 0.877 (R - Y) Color Space: YUV Y U-V plane at Y=0.5 U V CS 414 - Spring 2014 Source: wikipedia
YIQ (NTSC) • YIQ from RGB Y = .299R + .587G + .114B I = .74 (R - Y) - .27 (B - Y)Q = 0.48 (R - Y) + 0.41 (B - Y) YIQ with Y=0.5 CS 414 - Spring 2014 Source: wikipedia
Video Representations CS 414 - Spring 2014
TV History CS 414 - Spring 2014
HDTV (Digital) • Resolutions: • 1920x1080 (1080p) – Standard HD (HDTV) • 2160p, … • 4096x2304 (4096p) – 4K High HD • Frame rate: • HDTV - 50 or 60 frames per second • HDTV – 120 fps CS 414 - Spring 2014
HDTV • Interlaced (i) and/or progressive (p) formats • Conventional TVs – use interlaced formats • Computer displays (LCDs) – use progressive scanning • MPEG-2 compressed streams • In Europe (Germany) – MPEG-4 compressed streams CS 414 - Spring 2014
Aspect Ratio and Refresh Rate • Aspect ratio • Conventional TV is 4:3 (1.33) • HDTV is 16:9 (2.11) • Cinema uses 1.85:1 or 2.35:1 • Frame Rate • NTSC is 60Hz interlaced (actually 59.94Hz) • PAL/SECAM is 50Hz interlaced • Cinema is 24Hz non-interlaced CS 414 - Spring 2014 Source: wikipedia
Digital Video and TV • Bit rate: amount of information stored per unit time (second) of a recording • Color Coding: YCrCb • Subset of YUV that scales and shifts the chrominance values into range 0..1 Y = 0.299R + 0.587G + .114BCr = ((B-Y)/2) + 0.5Cb = ((R-Y)/1.6) + 0.5 Y Cr Cb CS 414 - Spring 2014
Digital Video and TV • Color space compression • YUV444 • 24 bits per pixel • YUV422 • 16 bits/pixel • YUV411 • 12 bits/pixel CS 414 - Spring 2014
Digital Video and TV • DVD video • Since 1997 • Resolution and frame rate • 704x480 at 29.97 fps • 704x576 at 25 fps • Bitrate: 9.8 Mbps CS 414 - Spring 2014
Digital Video and TV • Blu-ray video • since 2006 • Resolution and frame rate • 1920i (@59.94 fps) – interlaced • 1920p (@24 fps) – progressive • …. • Bitrate : 40 Mbps CS 414 - Spring 2014
3DTV Refresh rate no less than 120 Hz Synchronized shutter glasses to enable different views for different eyes CS 414 - Spring 2014
Today Introduced Concepts • Analog and Digital Television • Need for compression and compression algorithms classification • Basic Coding Concepts • Fixed-length coding and variable-length coding • Compression Ratio • Entropy CS 414 - Spring 2014
Reading • Media Coding and Content Processing, Steinmetz, Nahrstedt, Prentice Hall, 2002 • Data Compression – chapter 7 • Basic coding concepts – Sections 7.1-7.4 and lecture notes CS 414 - Spring 2014
Integrating Aspects of Multimedia Audio/Video Presentation Playback Image/Video Capture Audio/Video Perception/ Playback Image/Video Information Representation Transmission Transmission Compression Processing Audio Capture Media Server Storage Audio Information Representation A/V Playback CS 414 - Spring 2014
Uncompressed audio 8 KHz, 8 bit 8K per second 30M per hour 44.1 KHz, 16 bit 88.2K per second 317.5M per hour 100 Gbyte disk holds 315 hours of CD quality music Uncompressed video 640 x 480 resolution, 8 bit color, 24 fps 7.37 Mbytes per second 26.5 Gbytes per hour 640 x 480 resolution, 24 bit (3 bytes) color, 30 fps 27.6 Mbytes per second 99.5 Gbytes per hour 100 Gbyte disk holds 1 hour of high quality video Need for Compression CS 414 - Spring 2014
Broad Classification • Entropy Coding (statistical) • lossless; independent of data characteristics • e.g. RLE, Huffman, LZW, Arithmetic coding • Source Coding • lossy; may consider semantics of the data • depends on characteristics of the data • e.g. DCT, DPCM, ADPCM, color model transform • Hybrid Coding (used by most multimedia systems) • combine entropy with source encoding • e.g., JPEG-2000, H.264, MPEG-2, MPEG-4, MPEG-7 CS 414 - Spring 2014
Data Compression • Branch of information theory • minimize amount of information to be transmitted • Transform a sequence of characters into a new string of bits • same information content • length as short as possible CS 414 - Spring 2014
Concepts • Coding (the code) maps source messages from alphabet (A) into code words (B) • Source message (symbol) is basic unit into which a string is partitioned • can be a single letter or a string of letters • EXAMPLE: aa bbb cccc ddddd eeeeee fffffffgggggggg • A = {a, b, c, d, e, f, g, space} • B = {0, 1} CS 414 - Spring 2014
Today Introduced Concepts • Analog and Digital Television • Need for compression and compression algorithms classification • Basic Coding Concepts • Fixed-length coding and variable-length coding • Compression Ratio • Entropy CS 414 - Spring 2014
Taxonomy of Codes • Block-block • source msgs and code words of fixed length; e.g., ASCII • Block-variable • source message fixed, code words variable; e.g., Huffman coding • Variable-block • source variable, code word fixed; e.g., RLE • Variable-variable • source variable, code words variable; e.g., Arithmetic CS 414 - Spring 2014
Example of Block-Block • Coding “aa bbb cccc ddddd eeeeee fffffffgggggggg” • Requires 120 bits
Example of Variable-Variable • Coding “aa bbb cccc ddddd eeeeee fffffffgggggggg” • Requires 30 bits • don’t forget the spaces
Concepts (cont.) • A code is • distinct if each code word can be distinguished from every other (mapping is one-to-one) • uniquely decodableif every code word is identifiable when immersed in a sequence of code words • e.g., with previous table, message 11 could be defined as either ddddd or bbbbbb CS 414 - Spring 2014
Static Codes • Mapping is fixed before transmission • message represented by same codeword every time it appears in message (ensemble) • Huffman coding is an example • Better for independent sequences • probabilities of symbol occurrences must be known in advance; CS 414 - Spring 2014
Dynamic Codes • Mapping changes over time • also referred to as adaptive coding • Attempts to exploit locality of reference • periodic, frequent occurrences of messages • dynamic Huffman is an example • Hybrids? • build set of codes, select based on input CS 414 - Spring 2014
Traditional Evaluation Criteria • Algorithm complexity • running time • Amount of compression • redundancy • compression ratio • How to measure? CS 414 - Spring 2014
Measure of Information • Consider symbolssi and the probability of occurrence of each symbol p(si) • In case of fixed-length coding , smallest number of bits per symbol needed is • L ≥ log2(N) bits per symbol • Example: Message with 5 symbols need 3 bits (L ≥ log25) CS 414 - Spring 2014
Variable-Length Coding- Entropy • What is the minimum number of bits per symbol? • Answer: Shannon’s result – theoretical minimum average number of bits per code word is known as Entropy (H) CS 414 - Spring 2014
Entropy Example • Alphabet = {A, B} • p(A) = 0.4; p(B) = 0.6 • Compute Entropy (H) • -0.4*log2 0.4 + -0.6*log2 0.6 = .97 bits CS 414 - Spring 2014
Summary • Symmetric compression • requires same time for encoding and decoding • used for live mode applications (teleconference) • Asymmetric compression • performed once when enough time is available • decompression performed frequently, must be fast • used for retrieval mode applications (e.g., an interactive CD-ROM) CS 414 - Spring 2014