17.13. COMPRESSION (2.44) – RUN LENGTH ENCODING
最后更新于:2022-04-01 04:43:53
This is a guide for students attempting compression (one of the three encoding subtopics) in digital technologies achievement standard 2.44 (AS91371).
Remember that you only need to do one of the three encoding topics (Compression, Encryption, and Error Control Coding) to the excellence level. The other two only need to be done to the achieved level. This guide is suitable for both doing compression to the excellence level, but can also be used for the achieved level for compression.
In order to fully cover the standard, you will also need to have done projects covering the topics of encryption and error control coding to at least the achieved level, and projects covering the topics of representing data using bits and human computer interaction, and include these in your report.
## 17.13.1\. OVERVIEW
Encoding has the following bullet points in achievement standard 2.44 which this guide covers.
**Achieved**: “describing the concept of encoding information using compression coding, error control coding, and encryption; and typical uses of encoded information”
**Merit**: “discussing how a widely used technology is enabled by one or more of compression coding, error control coding, and encryption”
**Excellence**: “evaluating a widely used system for compression coding, error control coding, or encryption”
As with all externally assessed reports, you should base your explanations around personalised examples.
## 17.13.2\. READING FROM THE COMPUTER SCIENCE FIELD GUIDE
You should read and work through the interactives in the following sections of the CS Field Guide in order to prepare yourself for the assessed project.
Read all of these sections, as they give the necessary introduction of the topics
7.1 - What’s the Big Picture?
7.2 - Run Length Encoding
## 17.13.3\. PROJECT
For the achieved criteria you will show how run length encoding works to compress a simple image. For the merit and excellence criteria you will investigate how and why run length encoding is used by fax machines, and then evaluate how effective it is for this purpose. *If you have chosen to focus on error control coding or encryption for merit and excellence, then you only need to meet the achieved criteria for this project.*
### 17.13.3.1\. WRITING YOUR REPORT
**Achieved**
Make a grid of squares (any size is fine, but it should be at least 6x6) and draw a picture by filling some of the squares with black and leave others white. Underneath (or alongside each row), show how a computer could represent your image using run length encoding. You should not worry about how it is represented at the bit level. It is fine to just use normal numbers which are comma separated
Count how many characters are needed to represent your image in its original form (i.e. how many squares does it contain?). Count how many characters were used in your run length encoding representation. Don’t forget to include the commas! How well did run length encoding compress your image?
Explain why you would want to use run length encoding on an image. Think about a more typical image, such as a scan of a page of writing - what sort of runs of black and white pixels will that have? What is the purpose of compression?
**Merit/ Excellence**
As discussed in the field guide, fax machines use run length encoding. What advantages does this provide to fax machines sending and receiving faxes?
Is run length encoding guaranteed to always make the amount of data needed to represent the image smaller? Try and come up with an example (to include in your report) where the amount of space required to store your image with run length encoding is more than the original representation. What about an example where it is a very small amount of data? You can use the following interactive (written by Hannah Taylor, a digital technologies teacher) to help you experiment and to quickly generate examples.
[http://taylormade.io/run-length-encoding.html](http://taylormade.io/run-length-encoding.html)
You should have found that in some cases the compression is really good, and in others it makes things worse! You might remember from the book that it is impossible to design a lossless text compression method that makes every possible input smaller. What matters though is how good the compression is for its intended application. What would you expect a typical fax message to look like? (You might like to include an example, although shrink the image down so that it is less than ¼ of the page tall.)
## 17.13.4\. HINTS FOR SUCCESS
* When you make your image for the achieved level, make it a real image rather than a grid containing random black and white squares.
* Put compression in its own section (your report should have suitable headings and subheadings for each topic to make it clear for the marker) and ensure that you briefly introduce the topic. It is important that your report clearly demonstrates that you know the difference between encryption, error control coding, and compression, and what their different purposes are.
* If you did compression only to the achieved level, half to one page should be enough. If you did merit and excellence, a couple of pages should be enough (shrink down the examples as much as is reasonable, particularly if you included a lot of them)
* While you could potentially go into the details of how the computer represents the compressed image at the bit level, this is not necessary. The purpose of the encoding topic in 2.44 is for you to investigate the general ideas of how encoding works rather than the precise details of the representation with bits (simpler representations with bits are already covered in the first bullet point of the standard).