Date post: | 17-Jan-2016 |
Category: |
Documents |
Upload: | tamsin-harvey |
View: | 278 times |
Download: | 7 times |
Compression
Data files compression
Music compression
Image and video compression
File CompressionAsk not what your country can do for you -- ask what you can do for your country.
79 characters
Dictionnary
1. Ask2. What3. Your4. Country5. Can6. Do7. For8. you
Compressed sentence
1 not 2 3 4 5 6 7 8 -- 1 2 8 5 6 7 3 4
Dictionnary + Compressed sentence : 72 characters
File CompressionAsk not what your country can do for you -- ask what you can do for your country.
79 characters
Dictionnary
1. ask_2. what_3. you4. r_country5. _can_do_for_you
Compressed sentence
Dictionnary + Compressed sentence : 59 characters
1not__2345__--__12354
File Compression
Ask not what your country can do for you--
ask what you can do for your country.
John F. Kennedy - 1961
LZ adaptive dictionnary-based algorithm
Audio Compressing
Digital soundSound compression techniquesHuffman algorithmMP3
Digital Sound
Sampling– A song is a frequency– Shannon theorem
Exemple sampling rate
Sampling Rate Sound quality
44,100 Hz CD quality
22,000 Hz Radio quality
8000 Hz Phone quality
Digital sound
Example for a 1 minute long song• Sampling 44,100 Hz• Encoding 16 bits• Stereo song
– => (((44100*2o)*2)*60) ≈ 10Mo for CDA– 1 Mo for MP3
Sound compression techniques
Destroying compression– Frequencies located between 20 Hz 20 Khz– Human ear can hear between 2 and 5 KHz– Cut higher and lower frequencies
No destroying compression– Generally techniques of coding– Huffman algorithm
Huffman algorithm
letters occurencies
frenquency
coding
Space 4 2 00
A 3 2 01
E 2 3 100
N 2 3 101
C 1 4 1100
I 1 4 1101
M 1 4 1110
S 1 4 1111
total 120bits 42bits
Principle– The most frequent
information is coded with short symbols, the less frequent one with longs symbols
Example « I can see a man »
MP3
called MPEG Audio Layer-3
a compression system for audio
compress a CD-quality song by a factor of 10 to 14, without losing the CD sound quality
MP3
Procedure
– The mask effect– The reserve of bytes– The join stereo– Huffman algorithm
Picture coding
Coding-HSL :(Hue,Saturation,Luminance)-RGB :(Red,Green,Blue)
Pixel
…1001011…
Picture compression
Picture compression
RLE method (for BMP TIFF formats)
‘’BBBBBWWBBBBWWWWWWW ‘’ ‘’5B 2W 4B 7W’’ (Black and white)
‘’r1r2r3r4r5r6’’ ‘’ 1r1 1r2 1r3 1r4 1r5 1r6’’ (Colour gradation)
Bad effectiveness
Picture compressionJPEG Compression
-merging per packages of 2x2 pixels
-merging per packages of 8x8 packages
- calculation of the average color of packages
- allocation to each new package of the average color
- coding of each colour by HUFFMAN
5169 Bytes 1512 Bytes 369 Bytes
Video compression (MPEG)
Moving Pictures Expert Group-frame I compression
-picture by picture
-frame P compression
-what differs from the previous (and the following) picture is coded
-frame B compression
Video compression
MPEG-1: 1988
MPEG-2: used by DVD
MPEG-4: used by Divx—Xvid—VP3-—3ivX