Databases Reference
In-Depth Information
b 1
b 2
a 0
a 1
a 2
F I GU R E 7 . 8
Two rows of an image. The transition pixels are marked with a dot.
If b 1 and b 2 lie between a 0 and a 1 , we call the coding mode used the pass mode .The
transmitter informs the receiver about the situation by sending the code 0001. Upon receipt of
this code, the receiver knows that from the location of a 0 to the pixel right below b 2 , all pixels
are of the same color. If this had not been true, we would have encountered a transition pixel.
As the first transition pixel to the right of a 0 is a 1 and as b 2 occurs before a 1 , no transitions
have occurred, and all pixels from a 0 to right below b 2 are the same color. At this time, the
last pixel known to both the transmitter and r e ceiver is the pixel below b 2 . Therefore, this now
becomes the new a 0 , and we find the new positions of b 1 and b 2 by examining the row above
the one being encoded and continue with the encoding process.
If a 1 is detected before b 2 by the encoder, we do one of two things. If the distance between
a 1 and b 1 (the number of pixels from a 1 to right under b 1 ) is less than or equal to three, then
we send the location of a 1 with respect to b 1 , move a 0 to a 1 , and continue with the coding
process. This coding mode is called the vertical mode . If the distance between a 1 and b 1 is
large, the coding mode is called the horizontal mode . In his mode, we essentially revert to the
one-dimensional technique and send the distances between a 0 and a 1 and a 1 and a 2 ,usingthe
modified Huffman code. Let us look at exactly how this is accomplished.
In the vertical mode, if the distance between a 1 and b 1 is zero (that is, a 1 is exactly under
b 1 ), we send the code 1. If a 1 is to the right of b 1 by one pixel (as in Figure 7.9 ), we send
the code 011. If a 1 is to the right of b 1 by two or three pixels, we send the code 000011 or
0000011, respectively. If a 1 is to the left of b 1 by one, two, or three pixels, we send the code
010, 000010, or 0000010, respectively.
In the horizontal mode, we first send the code 001 to inform the receiver about the mode,
and we then send the modified Huffman codewords corresponding to the run length from a 0
to a 1 , and a 1 to a 2 .
b 1
b 2
a 0
a 1
a 2
F I GU R E 7 . 9
Two rows of an image. The transition pixels are marked with a dot.
 
Search WWH ::




Custom Search