DC 6
DC 6
Vector quantization (VQ) is a block-coding technique that quantizes blocks of data instead
of single sample. VQ exploits relation existing between neighboring signal samples by
quantizing them together.
In general, a VQ scheme can be divided into two parts: the encoding procedure,
and the decoding procedure which is depicted in figure.
At, the encoder, input image is partitioned into a set of non- overlapping image
blocks. The closest code word in the code hook is then found for each image block.
Here, the closest code word for a given block is the one in the code book that has
the minimum squared Euclidean distance from the input block.
Next, the corresponding index for each searched closest code word is transmitted
to the decoder.
Compression is achieved because the Indices of the closest code words in the code
book are sent to the decoder instead of the image blocks themselves.
The goal of VQ code-book generation is to find an optimal code book that yields
the lowest possible distortion when compared with all other code books of the
same size.
VQ performance is directly proportional to the code-book size and the vector size.
Figure 36
LZW compression
LZW compression is a method to reduce the size of Tag Image File
Format (TIFF) or Graphics Interchange Format (GIF) files. It is a table-
based lookup algorithm to remove duplicate data and compress an original
file into a smaller file. LZW compression is also suitable
for compressing text and PDF files. The algorithm is loosely based on the
LZ78 algorithm that was developed by Abraham Lempel and Jacob Ziv in
1978.
Invented by Abraham Lempel, Jacob Ziv and Terry Welch in 1984, the LZW
compression algorithm is a type of lossless compression. Lossless
algorithms reduce bits in a file by removing statistical redundancy without
causing information loss. This makes LZW -- and other lossless algorithms,
like ZIP -- different from lossy compression algorithms that reduce file size
by removing less important or unnecessary information and cause
information loss.
As the input is read, any repetitive results are substituted with the shorter
code, effectively compressing the total amount of input. The shorter code
takes up less space than the string it replaces, resulting in a smaller file. As
the number of long, repetitive words increases in the input data, the
algorithm's efficiency also increases. Compression occurs when the output
is a single code instead of a longer string of characters. This code can be
of any length and always has more bits than a single character.
The LZW algorithm does not analyze the incoming text. It simply adds
every new string of characters it sees into a code table. Since it tries to
recognize increasingly longer and repetitive phrases and encode them,
LZW is referred to as a greedy algorithm
The LZW algorithm doesn't analyze incoming text. It reads a sequence of symbols,
groups those symbols into strings and then converts each string into codes in a table.
Code table in LZW compression
Unlike earlier approaches, such as LZ77 and LZ78, the LZW algorithm
includes a lookup table of codes as part of the compressed file. Typically,
the number of table entries is 4,096. In the code table, codes 0-255 are
assigned to represent single bytes from the input file. Before the algorithm
starts encoding, the table contains only the first 256 entries. The rest of the
table is blank. In other words, the first 256 codes are assigned to the
standard character set by default.
The decoding program that decompresses the file can build the table by
using the algorithm as it processes the encoded input. It takes each code
from the compressed file and translates it through the code table that's
being built to find the character that code represents.
Pointer get longer one byte from dictionary to dictionary and output are in
block of 8 bytes. Each pointer preceded by header of 255 bytes maximum
and terminates by bytes of 8 zeros. Pointer stores with LSB(Least
Significant Bit) on left. Last block contains of value which is 2^(b+1).
GIF compression is inefficient because GIF is in one dimensional while
image is in two dimensional. So, GIF is not used by today’s web browsers.