Compression methods

Run-length Encoding (RLE)

  • Purpose: Compresses sequences of repeated data.

  • Method: Replaces consecutive identical elements with a single value and a count.

  • Best Use Case: Effective for data with long runs of repeated values, such as simple graphics or monochrome images.

  • Advantages: Simple and fast.

  • Disadvantages: Ineffective for data without many repeated sequences.

Huffman Encoding

  • Purpose: Provides efficient, variable-length coding based on frequency of data elements.

  • Method: Creates a binary tree where more frequent elements have shorter codes.

  • Best Use Case: General-purpose text and data compression.

  • Advantages: Optimal for prefix codes; no wasted bits.

  • Disadvantages: Requires two passes over data (one to build the tree, one to encode).

Delta Encoding

  • Purpose: Stores differences between sequential data points rather than absolute values.

  • Method: Records the difference between each element and its predecessor.

  • Best Use Case: Time series data or any data with small changes between consecutive elements.

  • Advantages: Effective when changes between data points are small.

  • Disadvantages: Less effective if data changes drastically.

LZW Compression

  • Purpose: Uses a dictionary-based approach to encode sequences of data.

  • Method: Builds a dictionary of data sequences and replaces repeated sequences with references to the dictionary.

  • Best Use Case: Text files and images (e.g., GIF format).

  • Advantages: No need to transmit the dictionary; efficient for repetitive data.

  • Disadvantages: Can be less effective on small datasets or highly varied data.

Summary

  • RLE is best for data with lots of repetition.

  • Huffman is ideal for data with varying element frequencies.

  • Delta is suited for sequential data with small variations.

  • LZW is effective for compressing data with repeated sequences and patterns.

 

JPEG Compression

it specifically targets image data and uses a combination of techniques tailored for reducing the size of photographic images.

  1. Lossy Compression:

    • JPEG uses lossy compression, meaning some image data is permanently discarded to reduce file size.

This is different from RLE, Huffman, Delta, and LZW, which can be lossless.

  1. Transforms and Quantization:

    • JPEG employs the Discrete Cosine Transform (DCT) to convert spatial image data into frequency components.

This allows it to focus on important visual information and discard less important details.

  • Quantization is applied to reduce precision of less visually significant frequencies, which greatly reduces file size but also causes loss of detail.

This allows more efficient compression, as the human eye is less sensitive to color detail than brightness.

  1. Entropy Coding:

    • JPEG often uses Huffman encoding as part of its compression process for the final step of encoding the quantized DCT coefficients, but

it's only one component of the overall method.

  1. Block-based Processing:

    • JPEG processes images in 8x8 pixel blocks, which can lead to blockiness or artifacts at high compression levels,

MPEG Standard

• Intra Frames (I-Frames)

• Predicted Frames (P-Frames)

• Bidirectional Frames (B-Frames)

• These three types of pictures are combined to form a

group of pictures (GOP).

Intra Pictures

• I-Pictures are coded using only information present in the

picture itself, and provides potential random access points

into the compressed video data.

• It usesonly transform coding and provide moderate

compression.

• Typically it uses about two bits per coded pixel.

Predicted Pictures

• Forward prediction: P-pictures are coded with respect to

the nearest previous I- or P-pictures.

• Like I-pictures, P-pictures also can serve as a

prediction reference for B-pictures and future P

pictures.

• Moreover, P-pictures use motion compensation to

provide more compression than is possible with I

pictures.

• AP-picture is coded with reference to a previous

image (reference image) which is an I- or P-pictures.

Bidirectional Pictures

• Bidirectional prediction: B-pictures use both a past

and future picture as a reference.

• B-pictures provide the most compression since it use

the past and future picture as a reference.

• However, the computation time is the largest.

Summary for Different Types of Pictures

I-frame

• Intraframe coded

• No motion compensation

P-frame

• Interframe coded

• Motion compensation

• Based on past frames only

B-frame

• Interframe coded

• Motion compensation

• Based on past and future frames

Motion Compensation

• Due to frames are closely related, it is possible to

accurately represent or "predict" the data of one frame

based on the data of a reference image.

• In P-Frames, each 16x16 sized macro-block is predicted

from a macro-block of a previously encoded I picture.

• A search is conducted in the I-frame to find the macro-block

which closely matches the macro-block under consideration

in the P frame.

• The displacements in the horizontal and vertical

directions of the best match macro- block from the co-sited macro-block are called motion vectors.

• Finally, it uses the run-length encoding and Huffman

encoding to encode the vectors.

Perceptual audio coding techniques (e.g., MPEG Layer-3 or MPEG-2 AAC)

exploit the properties of the human ear (the perception of sound) to achieve a size reduction with little or no perceptible loss of quality.

Solutions for Multimedia Streaming:

Multimedia Streaming

 • Streaming breaks data into many packets. When the client

 has received enough packets, the user software will start

 playing packets. The user can begin listening/watching

 almost immediately without having to download the entire

 media file.

 • Multimedia over Internet: Running multimedia

applications over packet-switched networks like the

Internet is very attractive.

 • The infrastructure often is already in place =>

save expensive software development.

 • LAN and WAN technologies provide a relatively

 inexpensive, plentiful, but shared bandwidth over

 bigger and bigger networks.

4 protocols have been designed to work together to provide real-time

service.

 • Resource Reservation protocol (RSVP);

 • Work together with

 Real-Time Transport Protocol (RTP),

 Real-Time Transport Control Protocol (RTCP),

 Real Time Streaming Protocol (RTSP);

 • It is a comprehensive approach to provide applications with the type of service the people need in the quality they choose.