Compression Flashcards
What is data compression?
The reduction in the file size to reduce download times and storage requirements, as well as the time taken to transfer files over the internet.
What is lossless compression?
Reduces the size of a file while retaining all of the original data.
Lossy compression?
Reduces the size of a file by permanently removing some of the data.
Superchannel compression?
A form of compression where special data is selected for a special reason. This data is separated from the rest, and the rest is thrown out.
What is compression ratio?
The ratio between an uncompressed file size and the compressed file size.
What is the compression ratio of a 10 MB file to a 2 MB file?
5:1 (calculated by 10/2=5)
Give 3 examples of lossy file types?
mp3 and mp4 files and large resolution images such as jpegs
Give 3 examples of lossless file types?
text files and image files such as bmp, gif and png
What is run length encoding?
RLE is a very simple form of data compression in which runs of data (sequences of the same value) are stored in a single value and count. The run value is the actual value in the run eg. the letter A and the run count is the number of times the run value is repeated.
What is rrrrttxxiieeee in RLE?
r4t2x2i2e4
Pros of RLE?
RLE reduces file size and extra space is gained. It works best for files with long runs of data eg. bitmaps and with a few colours.
Cons of RLE?
The computer has to expend more processing power to use the file and sometimes the extra space gained is just not worth it.
What are lookup tables?
Another form of compression. We assign repeated data with a number in a table.
Put the ‘Happy Birthday’ song into a look up table:
Happy birthday to you,
Happy birthday to you,
Happy birthday dear name,
Happy birthday to you.
Number Word in the song 0 Happy 1 birthday 2 to 3 you
We can write this out as:
0 1 2 3
0 1 2 3
0 1 dear name of person
0 1 2 3