3.1.1
Compression
Types of Compression
Types of Compression
Representing audio, images, and especially video take up a lot of secondary storage space. Compression helps to reduce the size of these files so that we can store more data.
Lossy compression
Lossy compression
- An algorithm is applied to remove unnecessary detail from the original file.
- Some data is permanently lost, but enough remains so that the file is still useful and there is barely a noticeable difference.
- Lossy compression results in dramatic file size reduction.
Lossless compression
Lossless compression
- None of the original data is lost.
- An algorithm can be used to perfectly restore the original file when needed.
- This is especially useful for executable files, where all of the data is necessary.
- Lossless compression causes file size to reduce moderately.
Run Length Encoding
Run Length Encoding
One compression algorithm you need to learn is run length encoding (RLE).
Run length encoding
Run length encoding
- Run length encoding (RLE) is a form of lossless compression that replaces repeating sequences of 0s and 1s with more efficient representations.
- Each repeating string will be replaced by a code which represents the character and the amount of times it is to be repeated.
In images
In images
- In images, adjacent pixels are likely to be similar colours but slightly different.
- Image compression algorithms often group these pixels together, and give them an 'average' colour.
- The RLE algorithm can then run on the new image.
- This technique then becomes lossy.
Dictionary Coding
Dictionary Coding
Dictionary coding is used to store text in a lossless format.
Dictionary coding
Dictionary coding
- The coder scans through a body of text.
- Each word is replaced by the binary number of the word in a dictionary.
- Each time it finds a new word which is not in its dictionary, it will add it to the dictionary and give it a binary number.
- The word in the actual text is replaced with the binary number.
Benefits of dictionary coding
Benefits of dictionary coding
- Dictionary coding is a type of compression. It takes less bits to store a 2 digit binary number than we can a 10 letter word.
- No data is lost, so the coding is lossless.
- The encoder may not always build its own dictionary. A pre-existing dictionary may be used to encode the text.
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
Jump to other topics
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
Unlock your full potential with GoStudent tutoring
Affordable 1:1 tutoring from the comfort of your home
Tutors are matched to your specific learning needs
30+ school subjects covered