Introduction to Multimedia1 Introduction yCoding Requirements yEntropy Encoding xContent Dependent Coding Run-length Coding Diatomic Coding xStatistical.

Slides:



Advertisements
Similar presentations
T.Sharon-A.Frank 1 Multimedia Compression Basics.
Advertisements

15 Data Compression Foundations of Computer Science ã Cengage Learning.
Data Compression CS 147 Minh Nguyen.
Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
Chapter 7 End-to-End Data
SWE 423: Multimedia Systems
School of Computing Science Simon Fraser University
Spring 2003CS 4611 Multimedia Outline Compression RTP Scheduling.
SWE 423: Multimedia Systems
Department of Computer Engineering University of California at Santa Cruz Data Compression (1) Hai Tao.
SWE 423: Multimedia Systems Chapter 7: Data Compression (1)
CSCI 3 Chapter 1.8 Data Compression. Chapter 1.8 Data Compression  For the purpose of storing or transferring data, it is often helpful to reduce the.
Spatial and Temporal Data Mining
Compression JPG compression, Source: Original 10:1 Compression 45:1 Compression.
T.Sharon-A.Frank 1 Multimedia Size of Data Frame.
Computer Science 335 Data Compression.
SWE 423: Multimedia Systems
Data Compression Basics
Klara Nahrstedt Spring 2014
Fundamentals of Multimedia Chapter 7 Lossless Compression Algorithms Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Lossless Compression in Multimedia Data Representation Hao Jiang Computer Science Department Sept. 20, 2007.
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
Data dan Teknologi Multimedia Sesi 08 Nofriyadi Nurdam.
Image and Video Compression
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Compression Algorithms Robert Buckley MCIS681 Online Dr. Smith Nova Southeastern University.
8. Compression. 2 Video and Audio Compression Video and Audio files are very large. Unless we develop and maintain very high bandwidth networks (Gigabytes.
Chapter 2 Source Coding (part 2)
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
 Coding efficiency/Compression ratio:  The loss of information or distortion measure:
1 Image Compression. 2 GIF: Graphics Interchange Format Basic mode Dynamic mode A LZW method.
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 7 – Basics of Compression (Part 2) Klara Nahrstedt Spring 2011.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 6 – Basics of Compression (Part 1) Klara Nahrstedt Spring 2010.
Multimedia Specification Design and Production 2012 / Semester 1 / L3 Lecturer: Dr. Nikos Gazepidis
JPEG. The JPEG Standard JPEG is an image compression standard which was accepted as an international standard in  Developed by the Joint Photographic.
Image Processing and Computer Vision: 91. Image and Video Coding Compressing data to a smaller volume without losing (too much) information.
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
22-Oct-15CPSC558: Advanced Computer Networks Chapter 7 End-to-End Data –Data Manipulating Functions (Affecting Throughputs) How to encode the message into.
Image Compression (Chapter 8) CSC 446 Lecturer: Nada ALZaben.
Image Compression Supervised By: Mr.Nael Alian Student: Anwaar Ahmed Abu-AlQomboz ID: IT College “Multimedia”
1 Classification of Compression Methods. 2 Data Compression  A means of reducing the size of blocks of data by removing  Unused material: e.g.) silence.
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
COMPRESSION. Compression in General: Why Compress? So Many Bits, So Little Time (Space) CD audio rate: 2 * 2 * 8 * = 1,411,200 bps CD audio storage:
An introduction to audio/video compression Dr. Malcolm Wilson.
Spring 2000CS 4611 Multimedia Outline Compression RTP Scheduling.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 6 – Basics of Compression (Part 1) Klara Nahrstedt Spring 2011.
Lecture 4: Lossless Compression(1) Hongli Luo Fall 2011.
CS654: Digital Image Analysis Lecture 34: Different Coding Techniques.
JPEG.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Multi-media Data compression
Chapter 7 Lossless Compression Algorithms 7.1 Introduction 7.2 Basics of Information Theory 7.3 Run-Length Coding 7.4 Variable-Length Coding (VLC) 7.5.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 7 – Basics of Compression (Part 2) Klara Nahrstedt Spring 2012.
1 Multimedia Outline Compression RTP Scheduling. 2 Compression Overview Encoding and Compression –Huffman codes Lossless –data received = data sent –used.
An introduction to audio/video compression Prepared by :: Bhatt shivani ( )
Submitted To-: Submitted By-: Mrs.Sushma Rani (HOD) Aashish Kr. Goyal (IT-7th) Deepak Soni (IT-8 th )
JPEG Compression What is JPEG? Motivation
IMAGE COMPRESSION.
Data Compression I.
Data Compression.
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
JPEG.
Data Compression.
Data Compression CS 147 Minh Nguyen.
UNIT IV.
Judith Molka-Danielsen, Oct. 02, 2000
15 Data Compression Foundations of Computer Science ã Cengage Learning.
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Presentation transcript:

Introduction to Multimedia1 Introduction yCoding Requirements yEntropy Encoding xContent Dependent Coding Run-length Coding Diatomic Coding xStatistical Encoding Huffman Coding Arithmetic Coding ySource Encoding xPredictive Coding Differential Pulse Code Modulation Delta Modulation yAdaptive Encoding

Introduction to Multimedia2 Coding Requirements yStorage Requirements xUncompressed audio: 8Khz, 8-bit quantization implies 64 Kbits to store per second xCD quality audio: 44.1Khz, 16-bit quantization implies storing 705.6Kbits/sec xPAL video format: 640X480 pixels, 24 bit quantization, 25 fps, implies storing 184,320,000 bits/sec = 23,040,000 bytes/sec yBandwidth Requirements xuncompressed audio: 64Kbps xCD quality audio: 705.6Kbps xPAL video format: 184,320,000 bits/sec zCOMPRESSION IS REQUIRED!!!!!!!

Introduction to Multimedia3 Coding Format Examples yJPEG for still images yH.261/H.263 for video conferencing, music and speech (dialog mode applications) yMPEG-1, MPEG-2, MPEG-4 for audio/video playback, VOD (retrieval mode applications) yDVI for still and continuous video applications (two modes of compression) Presentation Level Video (PLV) - high quality compression, but very slow. Suitable for applications distributed on CD-ROMs Real-time Video (RTV) - lower quality compression, but fast. Used in video conferencing applications.

Introduction to Multimedia4 Coding Requirements yDialog mode applications xEnd-to-end Delay (EED) should not exceed ms xFace-to-face application needs EED of 50ms (including compression and decompression). yRetrieval mode applications xFast-forward and rewind data retrieval with simultaneous display (e.g. fast search for information in a multimedia database). xRandom access to single images and audio frames, access time should be less than 0.5sec xDecompression of images, video, audio - should not be linked to other data units - allows random access and editing

Introduction to Multimedia5 Coding Requirements yRequirements for both dialog and retrieval mode applications xSupport for scalable video in different systems. xSupport for various audio and video rates. xSynchronization of audio-video streams (lip synchronization) xEconomy of solutions Compression in software implies cheaper, slower and low quality solution. Compression in hardware implies expensive, faster and high quality solution. xCompatibility e.g. tutoring systems available on CD should run on different platforms.

Introduction to Multimedia6 Classification of Compression Techniques xEntropy Coding lossless encoding used regardless of media’s specific characteristics data taken as a simple digital sequence decompression process regenerates data completely e.g. run-length coding, Huffman coding, Arithmetic coding xSource Coding lossy encoding takes into account the semantics of the data degree of compression depends on data content. E.g. content prediction technique - DPCM, delta modulation xHybrid Coding (used by most multimedia systems) combine entropy with source encoding E.g. JPEG, H.263, DVI (RTV & PLV), MPEG-1, MPEG-2, MPEG-4

Introduction to Multimedia7 Steps in Compression yPicture preparation analog-to-digital conversion generation of appropriate digital representation image division into 8X8 blocks fix the number of bits per pixel yPicture processing (compression algorithm) transformation from time to frequency domain, e.g. DCT motion vector computation for digital video. yQuantization Mapping real numbers to integers (reduction in precision). E.g. U-law encoding - 12bits for real values, 8 bits for integer values yEntropy coding compress a sequential digital stream without loss.

Introduction to Multimedia8 Compression Steps Picture Preparation Picture Processing Quantization Entropy Coding Compressed Picture Uncompressed Picture Adaptive Feedback Loop

Introduction to Multimedia9 Types of compression zSymmetric Compression Same time needed for decoding and encoding phases Used for dialog mode applications zAsymmetric Compression Compression process is performed once and enough time is available, hence compression can take longer. Decompression is performed frequently and must be done fast. Used for retrieval mode applications

Introduction to Multimedia10 Entropy Coding - Run-length Encoding (RLE) yContent dependent coding yRLE replaces the sequence of same consecutive bytes with the number of occurrences. The number of occurrences is indicated by a special flag - “!” yRLE Algorithm: If the same byte occurred at least 4 times then count the number of occurrences Write compressed data in the following format: “the counted byte!number of occurrences” yExample Uncompressed sequence - ABCCCCCCCCCDEFFFFGGG Compressed sequence - ABC!9DEF!4GGG (from 20 to 13 bytes)

Introduction to Multimedia11 Variations of Run-length coding (Zero suppression) yAssumes that only one symbol appears very often - blank. yAlgorithm: single blanks are ignored Starting with a sequence of 3 blanks, they are replaced by an M-byte and a byte with the number of blanks in the sequence. E.g zero bytes can be reduced to 2 bytes. xSubsitution depends on relative position. xExtended definitions are possible If M4 == 8 zero blanks, M5==16 zero bytes, M4M5 == 24 zero bytes.

Introduction to Multimedia12 Variations of run-length coding - Text compression yPatterns that occur frequently can be substituted by single bytes. yE.g. “Begin”, “end”, “if”… yAlgorithm: xUse an ESC byte to indicate that an encoded pattern will follow. xThe next byte is an index reference to one of 256 words (patterns). yCan be applied to still images, audio, video. yNot easy to identify small sets.

Introduction to Multimedia13 Variation of Run-length coding: Zero Compression yUsed to encode long binary bit strings containing mostly zeros. yEach k-bit symbol tells how many 0’s occurred between consecutive 1’s. ye.g zeros to be encoded. x (3 bit symbol) ye.g (using 3 bit symbol) x ( zeros between 1s)

Introduction to Multimedia14 Variation of run-length coding - Diatomic Coding yDetermined frequently occuring pairs of bytes ye.g. an analysis of the English language yielded frequently used pairs - “th”, “in”, “he” etc.. yReplace these pairs by single bytes that do not occur anywhere in the text (e.g. X)… ycan achieve reduction of more than 10%

Introduction to Multimedia15 Statistical Encoding (Frequency Dependent) yFixed length coding Use equal number of bits to represent each symbol - message of N symbols requires L >= log_2(N) bits per symbol. Good encoding for symbols with equal probability of occurrence. Not efficient if probability of each symbol is not equal. yVariable length encoding frequently occurring characters represented with shorter strings than seldom occurring characters. Statistical encoding is dependant on the frequency of occurrence of a character or a sequence of data bytes. You are given a sequence of symbols: S1, S2, S3 and the probability of occurrence of each symbol P(Si) = Pi.

Introduction to Multimedia16 Huffman Encoding (Statistical encoding technique) yCharacters are stored with their probabilities xNumber of bits of the coded characters differs. Shortest code is assigned to most frequently occurring character. xTo determine Huffman code, we construct a binary tree. Leaves are characters to be encoded Nodes contain occurrence probabilities of the characters belonging to the subtree. 0 and 1 are assigned to the branches of the tree arbitrarily - therefore different Huffman codes are possible for the same data. Huffman table is generated. xHuffman tables must be transmitted with compressed data

Introduction to Multimedia17 Example of Huffman Encoding P(A) = 0.16 P(B) = 0.51 P(C) = 0.09 P(D) = 0.13 P(E) = 0.11 P(A) = 0.16 P(B) = 0.51 P(C) = 0.09P(D) = 0.13P(E) = 0.11 P(CE) = 0.20P(DA) = 0.29 P(CEDA) = 0.49 P(CEDAB) = w(A) = 011 w(B) = 1 w(C) = 000 w(D) = 010 w(E) = 001

Introduction to Multimedia18 Arithmetic Encoding yEach symbol is coded by considering prior data xencoded sequence must be read from beginning; no random access possible. xEach symbol is a portion of a real number between 0 and 1. yArithmetic vs. Huffman xArithmetic encoding does not encode each symbol separately; Huffman encoding does. xArithmetic encoding transmits only length of encoded string; Huffman encoding transmits the Huffman table. xCompression ratios of both are similar.

Introduction to Multimedia19 Source Encoding - Differential Encoding yCoding is lossy. yConsider sequences of symbols S1, S2, S3 etc. where values are not zeros but do not vary very much. xWe calculate difference from previous value -- S1, S2-S1, S3-S2 etc. yE.g. Still image Calculate difference between nearby pixels or pixel groups. Edges characterized by large values, areas with similar luminance and chrominance are characterized by small values. Zeros can be compressed by run-length encoding and nearby pixels with large values can be encoded as differences.

Introduction to Multimedia20 Differential Encoding example Compressed sequence: M5, 0, 255, -5, 3, -2, 0, 255, -4, 3, 1

Introduction to Multimedia21 Differential Encoding (cont.) zVideo applications xIn a newscast or video phone, the background does not change often, hence we can use run-length encoding to compress the background. xIn movies, the background changes - use motion compensation. Compare blocks of 8X8 or 16x16 in subsequent pictures. Find areas that are similar, but shifted to the left or right. Encode motion using a “motion vector”.

Introduction to Multimedia22 Differential Encoding for Audio yDifferential Pulse Code Modulation(DPCM) When we use PCM, we get a sequence of PCM coded samples. Represent first PCM sample as a whole and all the following samples as differences from the previous one. Previous Sample Difference Sample + + Previous Sample difference + - DPCM Encoder DPCM Decoder

Introduction to Multimedia23 DPCM Example y y y y Samples Digital Code Difference Need only 2 bits to encode difference

Introduction to Multimedia24 Delta Modulation yModification of DPCM yUses only 1 bit to encode difference. xSets 1 if the difference increases xSets 0 if the difference decreases yLeads to inaccurate coding