Download presentation
Presentation is loading. Please wait.
Published byRosalia Maes Modified over 5 years ago
1
GCSE COMPUTER SCIENCE Topic 3 - Data 3.9 Data Compression
2
Compression Compression is the process of reducing the size of a file
It has two main benefits: 1 It allows us to reduce the amount of storage space we use (Thus we can store more data) 2 It increases the transfer rate of files over networks (Thus we can send and receive data over a network faster) ACTIVITY Write this information in your book.
3
Compression Images JPG Audio MP3 Video MPEG Type Example Description
The most common file format used for images. Most images produced by digital cameras and smartphones are jpegs. These images are lower in quality than Bitmap or RAW images, however have much smaller file sizes. Audio MP3 The most common file format used for audio files. Most of the sounds downloaded from the Internet are mp3 files, for example, songs downloaded on iTunes. This audio is lower quality than wave (.wav) or FLAC files, again however have smaller file sizes. Video MPEG One of the many common video formats. Compresses the files size while still offering DVD quality video. However, tis would not offer true Ultra High Definition (UHD) or cinema quality pictures.
4
Compression There are two types of compression you need to understand: Lossless Reduces the size of a file while retaining all of the original information. Lossy Reduces the size of a file by permanently removing some of the data. ACTIVITY Write these two definitions in your book.
5
Activity Explain the advantages and disadvantages of lossy and lossless compression. Advantages Disadvantages Lossless Keeps all of the original data. Original can be reproduced exactly when the file is uncompressed. Reduces the file size but not by as much as lossy compression. Lossy Does not keep all of the original data. File can be compressed (smaller file size) much more than in lossless compression. Some data is permanently lost. Therefore the original cannot be reproduced when the file is uncompressed Animate for Answer Animate for Answer Animate for Answer Animate for Answer
6
Run Length Encoding Definition Run length encoding (RLE) is a simple form of lossless compression. Runs of data (sequences in which the same data value occurs consecutively) are stored as a single data value and count, rather than as the original run. Old uncompressed string AAAAABBBBCCCDDE 5A 4B 3C 2D 1E New compressed string 5A4B3C2D1E ACTIVITY Write this definition and example in your book.
7
Activity AAAABBBBBBBBBCADDDDEEFFFFFFFF ABCABCABCABCABC
Text string Answer AAAABBBBBBBBBCADDDDEEFFFFFFFF 4A9B1C1A4D2E8F ABCABCABCABCABC 1A1B1C1A1B1C1A1B1C1A1B1C1A1B1C BBGGYYAACCFFEEBBGGYYAACCFFEE 2B2G2Y2A2C2F2E2B2G2Y2A2C2F2E Which one compresses the most? The first text string. Why is this? Lots of repeated letters in the string that are in sequence. Animate for Answer Animate for Answer Animate for Answer Animate for Answer Animate for Answer
8
RLE When Applied to Letters
Activity RLE When Applied to Letters Letter E Letter C Before encoding After encoding Before encoding After encoding bbbbb 5b bbbbb 5b bwwww 1b4w bwwww 1b4w bwwww 1b4w bwwww 1b4w bwwww 1b4w bbbww 3b2w bwwww 1b4w bwwww 1b4w bwwww 1b4w bwwww 1b4w bbbbb 5b bbbbb 5b 35 bytes 24 bytes 35 bytes 24 bytes Letter J Letter P 5b bbbbb 5b bbbbb 1b3w wwbww 2b1b2w bwwww 2w1b2w bwwww 1b3w wwbww bwwww 5b wwbww 2w1b2w bwwww 1b4w wwbww 2w1b2w wwbww 2w1b2w bwwww 1b4w bbbbb 1b4w bbbww 3b2w 35 bytes 36 bytes 35 bytes 24 bytes
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.