Transcript Document
Multimedia Data Compression Lecturer Dr. Aree Ali Mohammed 2012-2013 [email protected] 18-Jul-15 School of Science \ Computer Science Dept. 1 Overview Definition Why Compression Motivation for Compression Goals of Compression Coding Requirements Compression Types Text Compression Image Compression Audio Compression Video Compression 18-Jul-15 School of Science \ Computer Science Dept. 2 Definition Compression: the process of coding that will effectively reduce the total number of bits needed to represent certain information. 18-Jul-15 School of Science \ Computer Science Dept. 3 Definition How is compression possible? Redundancy in digital audio, image, and video data Properties of human perception Digital audio is a series of sample values; image is a rectangular array of pixel values; video is a sequence of images played out at a certain rate Neighboring sample values are correlated 18-Jul-15 School of Science \ Computer Science Dept. 4 Redundancy Adjacent audio samples are similar (predictive encoding); samples corresponding to silence (silence removal) In digital image, neighboring samples on a scanning line are normally similar (spatial redundancy) In digital video, in addition to spatial redundancy, neighboring images in a video sequence may be similar (temporal redundancy) 18-Jul-15 School of Science \ Computer Science Dept. 5 Human Perception Factors Compressed version of digital audio, image, video need not represent the original information exactly Perception sensitivities are different for different signal patterns Human eye is less sensitive to the higher spatial frequency components than the lower frequencies (transform coding) 18-Jul-15 School of Science \ Computer Science Dept. 6 Definition (contd.) If the compression and decompression processes induce no information loss, then the compression scheme is lossless; otherwise it is lossy. 18-Jul-15 School of Science \ Computer Science Dept. 7 Why Compression? Video and audio have much higher storage requirements than text Data transmission rates (in terms of bandwidth requirements) for sending continuous media are considerably higher than text Efficient compression of audio and video data, including some compression standards, will be considered in this lesson 18-Jul-15 School of Science \ Computer Science Dept. 8 Motivation for Compression: Discrete Data Text Assuming 2 bytes are used for every 8 x 8 pixel character, Character per screen page = ... Storage required per screen page = ... Vector Image Assuming that a typical image consists of 500 lines, each of which is defined by its coordinates in the x direction and the y direction, and an 8-bit attribute field Coordinates in the x direction require ... Coordinates in the y direction require ... Bits per line = ... Storage required per screen page Bitmap Image Assuming using 256 colors requiring a single byte per pixel Storage required per screen page = ... 18-Jul-15 School of Science \ Computer Science Dept. 9 Motivation for Compression: Continuous Data Uncompressed speech of telephone quality Assuming being sampled at 8 kHz and quantized using 8 bit per sample yielding a data stream of 64 Kbit/second Storage space required per second = ... Uncompressed stereo audio signal of CD quality Assuming being sampled at 44.1 kHz and quantized using 16 bits Data rate = ... Storage space required per second = ... 18-Jul-15 School of Science \ Computer Science Dept. 10 Motivation for Compression: Continuous Data Video sequence Assuming 25 full frames per second, luminance and chrominance of each pixel are coded using 3 bytes, luminance sampled at 13.5 MHz while chrominance (R-Y and B-Y) is sampled at 6.75 MHz, each, and samples are uniformly coded using 8 bits. Bandwidth = ... Data Rate = ... Storage space required per second = ... 18-Jul-15 School of Science \ Computer Science Dept. 11 Can Multimedia Data be Significantly Compressed? Redundancy can be exploited to do compression Spatial redundancy correlation between neighboring pixels in image/video Spectral redundancy correlation among colors Psycho-visual redundancy Perceptual properties of human visual system 18-Jul-15 School of Science \ Computer Science Dept. 12 History of Bandwidth in Computer Networks 18-Jul-15 School of Science \ Computer Science Dept. 13 Goals of Compression 18-Jul-15 School of Science \ Computer Science Dept. 14 Architecture of a Multimedia PC 18-Jul-15 School of Science \ Computer Science Dept. 15 What Makes “Good” Compression Quality of compressed and decompressed data should be as good as possible Compression/decompression process should be as simple as possible Decompression time must not exceed certain thresholds [De]/Compression requirements can be divided into Dialogue mode (video conferencing) Retrieval mode (digital libraries) Both 18-Jul-15 School of Science \ Computer Science Dept. 16 Coding Requirements: Dialogue Mode End-to-end delay does not exceed 150 ms for compression and decompression alone. Ideally, compression and decompression should not exceed 50ms in order to ensure natural dialogue. In addition delay in the network, communications protocol processing in the end system, data transfer to and from the respective input and output devices. 18-Jul-15 School of Science \ Computer Science Dept. 17 Coding Requirements: Retrieval Mode Fast forward and fast rewind with simultaneous display (or playback) of the data should be possible Random access to single images or audio passages in a data stream should be possible in less than 0.5 s. Maintains interaction aspects in retrieval systems Decompression of images, video or audio passages should be possible without interpreting all preceding data. Allows random access and editing 18-Jul-15 School of Science \ Computer Science Dept. 18 Coding Requirements: Both Modes Support display of the same data in different systems Formats have to be independent of frame size and video frame rate Audio and video compression should support different data rates at different qualities Precisely synchronize audio and video Support for economical solution Software Few VLSI chips Enable cooperation of different systems Data generated on a multimedia system can be reproduced on another system (e.g. course materials). 18-Jul-15 School of Science \ Computer Science Dept. 19 Compression Types Physical versus logical Compression Physical Performed on data regardless of what information it contains Translates a series of bits to another series of bits Logical Knowledge-based e.g. United Kingdom to UK Spatial Compression – 2D or single image Temporal Compression – 3D or video Codec – Compression / Decompression Color / intensity … same thing 18-Jul-15 School of Science \ Computer Science Dept. 20 Compression Types Symmetric Compression and decompression roughly use the same techniques and take just as long Data transmission which requires compression and decompression on-thefly will require these types of algorithms Asymmetric Most common is where compression takes a lot more time than decompression In an image database, each image will be compressed once and decompressed many times Less common is where decompression takes a lot more time than compression Creating many backup files which will hardly ever be read 18-Jul-15 School of Science \ Computer Science Dept. 21 Compression Types Non-adaptive Contain a static dictionary of predefined substrings to encode which are known to occur with high frequency Adaptive Dictionary is built from scratch 18-Jul-15 School of Science \ Computer Science Dept. 22 Compression Types Lossless decompress(compress(data)) = data Used for computer data, medical images, etc. 18-Jul-15 School of Science \ Computer Science Dept. 23 Compression Types Lossy decompress(compress(data)) data Some distortion A small change in pixel values may be invisible Suited for audio and video 18-Jul-15 School of Science \ Computer Science Dept. 24 Text Compression Lossless Algorithms Run Length Encoding Huffman Coding Lempel-Ziv Coding 18-Jul-15 School of Science \ Computer Science Dept. 25 Image Compression Lossy Compression 18-Jul-15 School of Science \ Computer Science Dept. 26 Image Compression Lossy Compression 18-Jul-15 School of Science \ Computer Science Dept. 27 Audio Compression Original (64000 bps) This is the original speech signal sampled at 8000 samples/second and u-law quantized at 8 bits/sample. Approximately 4 seconds of speech. ADPCM (32000 bps) This is speech compressed using the Adaptive Differential Pulse Coded Modulation (ADPCM) scheme. The bit rate is 4 bits/sample (compression ratio of 2:1). LD-CELP (16000 bps) This is speech compressed using the Low-Delay Code Excited Linear Prediction (LD-CELP) scheme. The bit rate is 2 bits/sample (compression ratio of 4:1). S-ACELP (8000 bps) This is speech compressed using the ConjugateStructured Algebraic Code Excited Linear Prediction (CS-ACELP) scheme. The bit rate is 1 bit/sample (compression ratio of 8:1). CELP (4800 bps) This is speech compressed using the Code Excited Linear Prediction (CELP) scheme. The bit rate is 0.6 bits/sample (compression ratio of 13.3:1). LPC10 (2400 bps) This is speech compressed using the Linear Predictive Coding (LPC10) scheme. The bit rate is 0.3 bits/sample (compression ratio of 26.6:1). 18-Jul-15 School of Science \ Computer Science Dept. 28 Video Compression Lossy Compression (MPEG) MPEG1 MPEG2 MPEG4 MPEG7 MPEG21 …… 18-Jul-15 School of Science \ Computer Science Dept. 29 Group Discussion 18-Jul-15 School of Science \ Computer Science Dept. 30