Computer Science : S1 : L10 : Data Storage and Compression

A Bit = 1

A Nibble = 4

A Byte = 8



Name

Number of Byte

Denary Value

Bit

-

1 bit

Nibble

-

4 bit

Byte

-

8

Kibibyte(KiB)

2^10

1024

Mebibyte(MiB)

2^20

1048576

Gibibyte(GiB)

2^30

1073741825

Tebibyte(TiB)

2^40

1099511627776

Pebibyte(PiB)

2^50

1125899906842624

Exbibyte(EiB)

2^60

115291504606846976


Image size : 

  1. Find total number of pixels 

  2. Times the past number by colour depth

  3. Divide by 8 to convert to byte

  4. Convert everything into byte

  5. Find Storage capacity and convert to byte

  6. Divide memory stick size by file size


Sound File : 

Sample size  = Sample rate(Hz) x Sample resolution x Length of sample


  1. Find the size of the sample

  2. Multiply by two (Depends on no. of channel)

  3. Divide by 8 to find the number of bytes

  4. Find Storage Capacity and convert to byte

  5. Divide Bytes by Files Size(Storage)


Data Compression 

  • Save Storage Space

  • Reduce time taken to stream

  • Reduce time to upload

  • Reduce File Size


Lossy File Compression : 

It eliminates unnecessary data but the original file can never be reconstructed and that data has been lost forever


Lossless File Compression : 

The data can be lost but it can be reconstructed


Run-Length Encoding is a lossless compression method. This is used when data is redundant so the programmes it into a single data value. The cons to this are you cannot see the original data after the method has been performed and you have to decode it yet it is retrievable. Its useful in black and white images as there are alot of redundant sections but it is not very helpful with full colour images with alot of colour depth as there won’t be many redundant sections


  1. Explain what is meant by the term bandwidth

Bandwidth is the maximum capacity of data that can be transferred across a certain path

  1. Why do compressed files use less bandwidth?

Compressed Files use less bandwidth as there is less data being transferred so less bandwidth is needed

  1. Explain how lossy file compression works with MP3 and MP4 files

Lossy file compression can work with MP3 and MP4 files by reducing the quality and removing useless sound waves.

  1. Explain how lossy file compression works with JPEG files

An algorithm scans image files and reduces their size by discarding information considered less important or undetectable to the human eye.

  1. A camera has an array of 2048 by 2048 pixels and uses a colour depth of 16. Find the size of an image taken by this camera in MiB?


Run-Length Encoding

Run-Length Encoding is a lossless compression method. This is used when data is redundant so the programmes it into a single data value. The cons to this are you cannot see the original data after the method has been performed and you have to decode it yet it is retrievable. Its useful in black and white images as there are alot of redundant sections but it is not very helpful with full colour images with alot of colour depth as there won’t be many redundant sections