• Save SPACE on storage media Data Compression • To save TIME sending data over communication lines

CODEC CODECs

• CODEC (Compression/Decompression) is the • Is data lost during a CODEC process? particular method used to compress and • A CODEC is called decompress data. • LOSSY • Symmetric – Data is lost during compression – compression time = decompression time • LOSSLESS • Asymmetric – Data is not loss during compression – compression time NOT = decompression time

CODEC Methods CODECs

• Syntactic • Syntactic CODEC methods = • Semantic • Pays no attention to the kind of data • Hybrid • Attempts to reduce the stream of data bits to something smaller – PKZIP, WINZIP compresses any type of file – usually looks for some kind of data repetition

1 CODECs CODECs

• Semantic CODEC methods • Hybrid • Depends on what kind of data is being compressed • combination of syntactic and semantic – Image, , audio, text • A movie file may remove every third frame using the syntactic method and then the semantic method to compress each remaining frame

RLE CODEC LZW CODEC (lossless/syntactic) (lossless/syntactic) • Run Length Encoding • developed by Lempel-Ziv-Welch) also treats a • Based on the assumption that a file has a great deal of redundancy. data file as a stream of characters, but looks for Data is considered just a string of symbols. No meaning is attached. patterns in the the sequence of characters. • 22 characters 14 characters • ABBCCDDDDDDDDDEEFGGGGG -> ABBCCD#9EEFG#5 • the other one is the oldest • 8/22 = 36 % reduction • RLE is useful in FAXes and Fixed length database files • Firstname Lastname The o [1,3] r[4,2] n[3,2]is [4,1][1,5]ld[3,1][13,1][16,1][1,1] • CharlesBBBBBBBBMasseyBBBBBBBBB -> CharlesB#8MasseyB#9 the other one is the oldest

Decompression Huffman CODEC • the other one is the oldest (lossless/symantic/asymmetric) • the o[1,3]r[4,2]n[3,2]is[4,1][1,5]ld[3,1][16,1][1,1] • the other[4,2]n[3,2]is[4,1][1,5]ld[3,1][16,1][1,1] • Named for David Huffman • the other on[3,2]is[4,1][1,5]ld[3,1][16,1][1,1] • For text files, uses a dictionary of • the other one is[4,1][1,5]ld[3,1][16,1][1,1] common words with two byte • the other one is [1,5]ld[3,1][16,1][1,1] • the other one is the old[3,1][16,1][1,1] (65,535 words) • the other one is the olde[16,1][1,1] • the other one is the oldes[1,1] • the other one is the oldest

2 Coded Dictionary Adaptive Huffman CODEC (lossless/syntactic/asymmetric) • Named for David Huffman • Uses statistics of a particular file to create a coding table. • Creates a statistical table on first pass • then uses the table compressing and decompressing.

Image Compression

• GIF (Graphic Interchange Format) • TIFF Tagged Image File Format • uses LZW CODEC • uses LZW CODEC • therefore lossless • therefore lossless • 8bit color , therefore only 256 colors or shades of • Used extensively in Publishing Industry gray • Developed by CompuServe • Developed by Aldus (PageMaker DTP)

Image Compression Image Compression

• JPEG: Joint Photographic Experts Group • PNG: Portable Network Graphics • Lossy, 24bit color • Lossy or Lossless, 8bit, 24bit or 30 bit color • User determines the compression rate • Compression or no compression • Large compression rates, produce higher loss • New to Internet • After the image has been filtered and quantized it uses a form of Huffman tables • Example

3 Image Compression Video Compression

• PCD: Kodak Photo Compact Disk • Both Temporal and Spatial • Compression is Lossy ?? Lossless ?? • QuickTime by Apple • High resolution • AVI (Audio Video Interleaved) by MS • Thumbnail to 7 x 10 prints • DVI Digital Video Interactive by Intel • Motion-JPEG, must have hardware • MPEG Moving Picture Experts Group

Intraframe Compression Audio Compression • Key frame has little compression Succeeding frames discard anything that • MP3: MPEG Layer III has not changed • Highest quality of audio compression • The JPEG of audio files

Audio Compression

• ADPCM: Adaptive Differential Pulse • Stores first sample, then remaining as differences from Previous similar to Video • Then divides the sample numbers by a number to make numbers smaller

4