Professional Documents
Culture Documents
UNIT-3
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹
Data Compression
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Data Compression Algorithms
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Lossy Data Compression
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Loseless Data Compression
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Dynmaic Huffman Coding
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Arithmetic Technique
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Arithmetic vs Huffman Coding
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
.
• For files that do not have many runs, RLE could increase the file
size.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Example - Run Length Coding
For example, if the input string is “wwwwaaadexxxxxx”, then the function
should return “w4a3d1e1x6”
4. Pick the next character and repeat steps 2, 3 and 4 if the end of the
string is NOT reached.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Lempel–Ziv–Welch (LZW) Algorithm
• This algorithm is typically used in GIF and optionally in PDF and TIFF.
• The algorithm is simple to implement and has the potential for very high
throughput in hardware implementations.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Lempel–Ziv–Welch (LZW) Algorithm
• It is the algorithm of the widely used Unix file compression utility
compress and is used in the GIF image format.
• Because the codes take up less space than the strings they replace, we
get compression.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Lempel–Ziv–Welch (LZW) Algorithm
Characteristic features of LZW includes:
• LZW compression uses a code table, with 4096 as a common choice for
the number of table entries.
• Codes 0-255 in the code table are always assigned to represent single
bytes from the input file.
• When encoding begins the code table contains only the first 256 entries,
with the remainder of the table being blanks. Compression is achieved
by using codes 256 through 4095 to represent sequences of bytes.
• As the encoding continues, LZW identifies repeated sequences in the
data and adds them to the code table.
• Decoding is achieved by taking each code from the compressed file and
translating it through the code table to find what character or characters
it represents.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Arithmetic Technique
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Transform Coding
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Transform Coding
• Transform methods are typically used in filtering, compression, and image
texture analysis.
• It exploits the fact that for typical images a large amount of signal energy is
concentrated in a small number of coefficients.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Transform Coding
In this coding, we consider compression techniques that are based on modifying
the transform of an image.
For most natural images, a significant number of the coefficients have small
magnitudes and can be coarsely quantized (or discarded entirely) with little image
distortion.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Transform Coding
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
• Image is divided into a set of images.
• Values of n is a power of 2.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Transform Coding
• The quantization stage then selectively eliminates or more coarsely quantizes the
coefficients that carry the least information.
• Any or all of the transform encoding steps can be adapted to local image content,
called adaptive transform coding, or fixed for all sub-images, called non-adaptive
transform coding.
• The decoder implements the inverse sequence of steps (with the exception of the
quantization function) of the encoder, which performs four relatively
straightforward operations: subimage decomposition, transformation,
quantization, and coding.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Pattern Substitution
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›
Pattern Substitution
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63,by Dr. Saumya U3.‹#›