compression algorithms robert buckley mcis681 online dr. smith nova southeastern university

19
Compression Algorithms Robert Buckley MCIS681 Online Dr. Smith Nova Southeastern University

Upload: brett-barber

Post on 26-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Compression Algorithms

Robert BuckleyMCIS681 OnlineDr. SmithNova Southeastern University

Lossless Compression Defined• Lossless Compression is an

information coding technique whereby information is coded to compress the size of the information stored or transmitted without loosing any original information content.

Example of Lossless Compression• Huffman Coding (Lossless Compression)

– Huffman coding is an entropy encoding algorithm used for lossless data compression.

– Huffman coding uses a specific method for choosing the representation for each symbol, resulting in a prefix-free code (that is, the bit string representing some particular symbol is never a prefix of the bit string representing any other symbol) that expresses the most common characters using shorter strings of bits than are used for less common source symbols. Huffman was able to design the most efficient compression method of this type: no other mapping of individual source symbols to unique strings of bits will produce a smaller average output size when the actual symbol frequencies agree with those used to create the code.

– Good Website: http://www.data-compression.com/lossless.html

Example Lossless Compression Continued• Huffman Coding Tree

Structure & Probability Diagram– Code the most frequently used

characters with the shortest binary code and the least used character set with the greatest binary code (see diagram).

1

0

0

00a

01b

1

0 1

0 110c110

d

111

e

Example of Lossless Compression Continued

• Huffman Coding & Probability Diagram– The probabilities with respect to the above

figure are as follows: – Length of Code [Denning Tables] E[l]=l(a)P[a}+l(b)P[b]+l(c)P[c]+l(d)P[d]+l(e)P[e]

– With probabilities of occurrence for a=0.25, b=0.25, c=0.25, d=0.125 and e=0.125, then symbol rate compression for the message of “aebbad” is as follows: 2(.25)+2(.25)+0(.25)+1(.125)+1(.125)=1.25 bits/ character instead of an uncompressed binary code of 3 bits/character.

Example of Lossless Compression Continued• Run Length Coding

– In contrast to Huffman coding, the Run Length Code uses repetitive patterns to project the levels of compression achievable and is depicted as follows:

• Original Data Stream: 17 8 54 0 0 0 97 5 16 0 45 23 0 0 0 0 0 3 67 0 0 8…..

• Run Length Coding: 17 8 54 3 0 97 5 16 0 1 45 0 5 3 67 0 2 8…..

• The compression ratio is 22/18 or 1.222:1.

Lossy Compression Defined

• Lossy Compression is a compression technique whereby information is coded such that human visual and auditory senses are mathematically modeled in order to allow certain spectral content to be ignored without losing significant fidelity or content.

Example of Lossy Compression• JPEG Coding

– Relies on human visual perception to code information such that although some information is decimated, the remaining coded information is perceived to maintain an acceptable level of fidelity.

Example of Lossy Compression Continued• JPEG Coding

– The (RGB) video image size can contain 1024 x 1024 pixel elements. Ultimately these pixel elements are then divided into multiple 16 x 16 RGB matrices and are then further divided into 4 (8x8) RGB matrices (4x64x3 bytes).

– JPEG Compression begins processing this RGB video into a 4 (8x8) Luminance matrix or 4x64x1 byte and a 2x64x1 byte Chrominance blue and Chrominance red matrix respectively. The chrominance columns are generated from the 2nd row & 2nd column of the RGB matrix while the Luminance is processed using the complete 4x64x3 bytes see next figure.

Example of Lossy Compression Continued• Example DCT Integral &

Matrix

Example of Lossy Compression Continued

• JPEG begins by executing a DCT algorithm which transforms time sampled video into a downshifted Hilbert Transformed frequency domain replica. Afterwards, a Huffman coding and further Run Length Coding algorithm is applied to further compress the image.

Example of Lossy Compression Continued• Compressions Achieved

with JPEG are as follows:

Example of Lossy Compression Continued• MPEG

– Relies on Human Audio and Visual Perception to provide lossy compression similar to JPEG with the exception that the MPEG encoder transmits only scene differences after the initial visual scene is established.

MPEG Examples

• MPEG Compressed Files– Audio Compression– Video Compression

Audio Compression Methods

• Audio Files, first track is original sampled audio at 44.1 KHz and then compressed to 8KHz, 8 bits or 44.1/8 compressed. Click Speaker 1 or Speaker 2 to hear recordings. Recording 2 is recorded at 11 KHz and replayed at 8 KHz, 8 bits or 22/8 compressed. See if you can hear any differences in fidelity?

Speaker 1 Speaker 2

Example of MPEG Time & Frequency Domain Spectra

• MPEG Compressed Files– Audio Files FFT of 44.1 KHz

sampled, 8 KHz at 8 Bit replayed and time sampled recording.

Complete Paper

To Review The Complete Research Paper for Compression Schemes, Please Click on PDF Icon Below.

White PaperPDF

MPEG Examples

• MPEG Compressed Files– Look at each video and see if

the compressed replica shows any audio or visual differences?

1Mb File 240x180 616kb 192x144

References• http://www.cs.cf.ac.uk/Dave/MM/BSC_MM_CALLER/node200.html• http://www.music.miami.edu/PROGRAMS/mue/mue2003/research/

klampert/chap3.html• http://bmrc.berkeley.edu/research/mpeg/faq/mpeg2-v38/faq_v38.html• http://www.cs.ubc.ca/~michael/MPEG_audio/MPEG_audio_tutorial_files/

frame.htm• http://www.iis.ee.ic.ac.uk/~frank/surp99/article2/twcy97/main.htm• http://www.utdallas.edu/~loizou/thesis/mukul_ms_thesis.pdf• Digital Technical Journal Vol. 5, No. 2, Spring 1993• Watkinson, John. (1999) MPEG-2. Focal Press, Boston, Mass. • Watkinson, John. (1994). An Introduction to Digital Audio. Focal Press,

Boston, Mass. • Miano, John. (1999). Compressed Image File Formats. Addison-Wesley,

New York, N.Y.• Jack, Keith. (1996). Video Demystified. High Text Publications, San

Diego, Ca.• Solari, Stephen J. (1997). Digital Video And Audio Compression, McGraw-

Hill, New York, N.Y.• Pohlman, Ken C. (1995). Principles of Digital Audio 3rd Edition, McGraw-

Hill, New York, N.Y.• http://www.essrl.wustl.edu/~jao/Talks/CSTTalks/Apr122004.pdf • http://dynamo.ecn.purdue.edu/~ace/jpeg-tut/jpgimag1.html • http://www.fho-emden.de/~hoffmann/jpeg131200.pdf • http://ei.cs.vt.edu/~mm/aus/aus.html• http://members.cox.net/jwhite658/video/Vid_comp.htm• http://www.screenbooks.net/download_screenbook_maker.html• http://www.data-compression.com/lossless.html