Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

Compression and Decompression

The three classes of communications are, 1.Unsolicted or Unexpected communication affects the user only to extent ,that it prevents the user performing their normal tasks. 2.The next method of communication is where the user is actually waiting for the communication to be complete before performing the next task. 3.The third classes of communication is the task already in progress where the proper speed must be maintained until completion.

Types of compression
The compression & decompression techniques are used in no. of applications such as facsimile systems , printer systems ,document storage and retrieval system , video conferencing and electronic messaging system. Types: Lossless compression Lossy compression

Lossless compression
In loss less compression, data is not altered or lost in the procession of compression or decompression. In this decompression generates an exact replica of the original image. Audio and text compression is an example of lossless compression. Lossless compression is good for text data and repetitive data in image like binary images and gray scale images.

This method provide reduction in size in the range of 1/10 to 1/50 of the original uncompressed size without affect image quality. The lossless compression standards are,
Packbits encoding CCITT Group 3 1D CCITT Group 3 2D CCITT Group 4 LZW algorithm

Lossy compression
In lossy compression,the decompression provides in loss of some information and the key issues is the effect of this loss. For some types of data destined to be heard or visualized by human ear or eye,the natural tendency of human sense to bridge over discontinuities comes into play and human eye fills in the missing information.

The issue is how much information can be lost before the human eye or ear fails to bridge the gaps in information. Lossy compression is used for audio , gray or color scale images and video objects in which the absolute data accuracy is not essential. Its is used in application such as medical screening systems,video teleconferencing and multimedia electronic messaging system. Mechanisms are,
JPEG ,MPEG, Intel DVI,Fractals

Binary image compression scheme


Binary image compression are used for documents that do not contain any continuous tone information or where the continuous to be information can be captured is black and white mode to serve the desired purpose. The binary image includes official bussiness documents ,hand written text,line graphics ,engineering drawings etc..

Introduction to binary image


A binary image containing black and white pixels is generated when a document is scanned in the binary mode. A scan line is a complete line of pixels , of height equal to one pixel ,running across the page. It scans the first line of pixels ,the scans 2nd line and works its way to the bottom of the page ,ending with the last scanline.

Each scanline is scanned from the left of the page to the right of page generating black and white pixels for that scanline.The binary image compression methods are,
Packbits encoding CCITT Group 3 1D CCITT Group 3 2D CCITT Group 4 2D

Packbits Encoding It is the simplest data compression and is used for compressing back and white binary images

In this method , the consecutive repeated string of characters is replaced by two bytes. The first byte contains number representing the no. of time s character is repeated and second bytes contains the character itself. Disadvantage of packbits encoding This scheme does not span across multiple rows of scanlines and it is one dimensional scheme. In a busy image ,adjacent pixels or group of adjacent pixel change rapidly and these leads to shorter run lengths of black pixels or white pixels,so it takes more bits for code to represents the run length.

CCITT Group 3 1D compression


This scheme is based on run length encoding and scanlines has long runs of pixels of the same color. This was designed for black and white images only and not for gray scale or color images. Used in facsimile and become unworkable for serious document imaging systems. The modified version of run length encoding is huffman encoding and is variable length encoding.

Mathematical algorithm for huffman encoding


This huffman encoding is based on coding tree which is created based on the probability of occurrence of white or black pixels in the run length. For eg, the probability of occurrence of a bit stream of length Rn is P(Rn). Huffman encoding generates the shortest code for frequently occuring run length and longer code for less frequently occurring run length .

CCITT group 3 compression utilizes huffman coding generate as set of make up codes and set of terminating codes for a given bit stream. Make up codes are used to represent run length in multiples of 64 pixels and terminating codes are used to represents run length of less than 64 pixels The run length of 132 pixels is encoded by following two codes
Makeup codes -128 white pixels Terminating codes -4 white pixels

Advantages
Simple to implement in both hardware and software. Worldwide std for facsimile. Disadvantage: It is one dimension as it encodes each row or line separately. It assumes a reliable communication link and does not provide any error protection mechanism.

CCITT group 3 2D compression


It is also known as Modified Run length Encoding and used for document imaging systems and facsimile . This scheme uses k factor where the image is divided into several group of k lines . The first line of every group of k lines is encoded using CCITT group 3 1D method.

KFactor
When this scheme is used the algo embeds group 31D coding between every K groups of group 3 2D coding ,allowing the group 31 D coding to be synchronizing line in the event of transmission error. When a transmission error occurs due to a bad communication link ,the group 31 D coding can be used to synchronize and correct error.

Data formatting for CCITT group 3-2D


The first line of each K group is encoded using the CCITT group 3 1D as the reference line for the rest of lines in the group of k lines. The 2 D scheme uses a combination of additional codes called vertical code ,pass code and horizontal code to encode every line in the group of k lines. Advantage of Group 3 2D scheme The implementation of k factor allows error free transmission

It is worldwide facsimile std , also accepted for document imaging application. Since its 2D ,the compression ratios achieved with this scheme Disadvantage: It does not provide as dense a compression and it is complex and difficult to implement in software. CCITT Group 4 2D compression: It is used for facsimile machines and low end s/w based document imaging systems.

This is the 2D coding scheme without k factor and in this , the first reference line is an white line. The first group of pixel is encoded utilizing the imaginary white line as the reference white line. The new coded line becomes the reference line for next scan line Disadvantage: Since there are no reference line ,single error can result in the rest of the page being skewed.

COLOR,GRAY SCALE AND VIDEO IMAGE COMPRESSION


Color adds depth to images , enhance images and helps to set the object apart from back ground. The visible light is a form of electromagnetic radiation or radiant energy and is measured in terms of wavelength or frequency. Color characteristics: Luminance Hue Saturation

JPEG
Used for still color images and gray scale images and has 2 parts.
Part 1-specifies mode of operation Part 2-determines compliance test Requirement of JPEG: Design should address image quality Should be applicable to any continuous tone digital source image. Scalable & provide sequential encoding Provide progressive encoding Provide hierarchical encoding

JPEG standards
Three levels are , Baseline system Extended system Special lossless function. JPEG components: Baseline sequential code DCT progressive mode Predictive lossless encoding Hierarchical mode Quantization /Dequantization Entrophy encoder/decoder

Jpeg methodology
This scheme is lossy and utilizes fwd DCT , a uniform quantizer and entropy encoding and this DCT function removes data redundancy by transforming data from spatial domain to frequency domain. Discrete cosine tranform: The signal requires lot of data points to represent time in x axis & amplitude in y axis. It is optimal tranform for large classes of images.

DCT is an orthogonal transform and generates coefficients that are easily quantized. It can be computed effectively and symmetrical. Zigzag ordering is designed to facilitate the entropy by placing low frequency coefficients. Before DC coefficient are compressed , the DC prediction is processed first. AC coefficient is encoded by 2 symbols.

Video image compression


It is important for multimedia applications Able to support variety of storage media and technologies. Requirements of full motion video: MPEG standards: Symmetric Asymmetric Requirements are , Random Access

VCR paradigm Audio and video synchronization Multiplexing multiple compressed audio and video bit stream. Editability Playback device flexibility CCITT H.261 video coding algorithm: The CCITT adopted CIF and QCIF as video format for visual telephony. CIF and QCIF use hierarchical block structure for encoding data and these includes pictures,GOBS, and macro blocks.

MPEG
MPEG std consists of mpeg2 video,mpeg2 audio,mpeg2 systems and has various system levels called profiles. MPEG audio std is defined in 3 layers
Layers 1 & 2 called musician Layer 3 based on aspect ,an AT and T.

MPEG coding methodology


Mpeg access information randomly by frame requires coding confined to specific frame called as intra frame coding . It has 2 scheme,
Discrete transform based compression Block based motion compensation

Moving pictures types


Intra pictures Unidirectionally predicted pictures Bidirectionally predicted pictures. Macroblocks: Each picture frame is divided into 16 x16 block each macroblocks is composed of four 8x8 (y) luminance blocks and two 8x8 chrominance block This set of six blocks is called a macroblocks.

Motion compensation
Motion compensation assumes that the current pictures is some translation of a previous picture. Picture coding method : In mpeg ,picture coding method differs from H261 such that the motion compensation is applied hierarchy. Mpeg encoder: The mpeg encoder has DCT,quantizer,huffamn coder and motion compensation and they are the key modules in mpeg encoder. To have the sequence of events of mpeg .the initial stages of DCT compression,both the full motion mpeg and still image are identitical.

MPEG-2
Its supports,
Video coding Audio coding Multiplexing Vector quantization: DCT provides 2D scalar quantization of imaging data, vector quantization provides multi dimensional representation of information stored in look up tables. Decoding vector quantization coded information involves looking up appropriate values in a code block created during the encoding process .

Audio compression
Audio provides natural way of communication and can be used as both input or output and the input can be voice command or tones and output can be speech or music. Audio consists of analog signals of varying levels of frequencies and they are converted to digital form and then processed for transmission. ADPCM: It is used for sound compression.

It provides a form of compression by encoding and storing in the data stream with values of differences between the successive samples. FRACTALS: A fractal is a multi dimensional object with an irregular shape that has approximately the same shape or body irrespective of size .

You might also like