1.3 Compression Flashcards
Why is compression needed?
- Data files can be very large.
- It would take too long to send an uncompressed file.
- The compressed file will download faster.
Lossy compression
Lossy compression removes data from the file, resulting in loss of detail.
Lossless compression
Lossless compression reduces file size without losing any original detail. Allowing the original file to be perfectly reconstructed.
A program written in a high-level language.
Use Lossy or Lossless?
Lossless
1) All the data is needed
2) If data is lost, the program will not run.
A photograph emailed to a friend?
Lossy or Lossless?
Lossy
1) Not all the data is required.
2) Number of colours can be reduced without the user noticing.
3) Email requires a smaller file size.
Uploading a video to a website?
Lossy or Lossless?
Lossy
1) Some loss of quality will not be noticed.
2) A more significant reduction may be needed.
3) Takes a shorter time to upload.
How can a text file be compressed?
Huffman compression, repeated sequences can be represented with a variable to lower file sizes.
How can a Bitmap image be compressed?
Run-length encoding, storing the number of times each color occurs.
How can a sound file be compressed?
Lossy compression, sample resolution can be reduced so fewer bits will be used to to each sample so less data stored.
What is meant by Run-length encoding?
- lossless form of compression.
- reduces the physical size of a string of adjacent pixels
- the repeating string is encoded into the frequency: notation form.
Explain how temporal redundancy compresses
a video.
- Identifies pixels that do not change between frames.
- Records only the differences between the frames.
- Makes file size smaller.