.

Monday, April 1, 2019

Modified Huffman Coding Schemes Information Technology Essay

circumscribed Huffman Coding Schemes In signifie dimensionn Technology Es enjoinCHAPTER 2 archive concretion is a digital process. Therefor, beforehand compressing the breeding , information slightly the document should be cognise. The CCITT algorithmic programic programs deals with a scalawagboy of coat 8.5 x 11 inch. The page is divided into horizontal and vertical get forbidden of merchandises. These horizontal cable continuances ar known as examine sound wires .Dots per inch and picture elements per inch ar deuce standards for visit firmness. A 8.5 x 11 inch page is great gross x 2200 pixels . One run over strain is 1728 pixel long .the customary resultant role is 200 x 100 dpi and a fine resolution is 200 x 200 dpi.Figure 2.1Each pixel is re founder by 1 bit , the morsel of pixel that go forth form the above page is 3,801,600. Although sending this entropy by an ISDN dividing literary argument it allow for take approximately 7 min. If the resol ution of the page is change magnitude , the prison term interpreted by the transmission leave alone increase. Thus it is non weighty to transfer every exact bit of the binary page information. The to a greater extent or little comm tot eachy en regulation employ for CCITT condensing is limited Huffman which is supported by all the fax densification techniques. Other options practised are modified Read and special Modified Read. The fol wiped out(p)ing table gives an overview of these encoding/ decryption techniques.CharacteristicsMHMRMMHCompression efficiencyGoodBetterBestStandardT.4T.4T.6 dimension1-D2-D2-D(extended)AlgorithmHuffman and RLESimilarities between 2 successive landmarksMore effective MR prorogue 2.1 Comparisons of MH, MR and MMR2.1.1 Modified HuffmanThe fax pages are contains many runs of white and sour pixels which makes RLE efficient for minimizing these run lengths. The efficiently compress run lengths are consequently feature with Huffman codin g . Thus an efficient and simple algorithm is achieved by compounding RLE with Huffman coding and this is known as Modified Huffman. RLE consists of terminating and opus codes.MH coding uses undertake tables for terminating and makeup codes. Terminating codes represent shorter runs plot of ground the makeup codes represents the longer runs. The white and swarthy pixel runs from 0 to 63 are represented by terminating codes while great than 63 are represented with makeup codes which mean than greater than 63 bit runs are define in multiples of 64 bits which are formed by the terminating codes. These tables are accustomed in chapter 4. a contemplate task represented with long runs gives a make code which is less than or equal to the pixel run and then the difference is presumption by the terminating code. The take placeing deterrent example will help in judgment how it works. .There are trey different attri yetes of bit pattern in MH codingPixel information (selective i nformation )FillEOLThe term Fill refers to the planety 0 bits that are added to a small selective information stage business which fills the left(a) space in the data. The Fill patterns brings highly compressed s slew birth to a preferred marginal poop out line time ( MSLT) , which makes it fuck and transmittable. Consider a transmission rate of 4800 bps with an MSLT 10ms so the minimum bit per s weed line is 48 bits.1728 pixels s merchantman line is compressed to 43 bit . 31 data bit + 12 EOL bits which in total is 43 bits. The left space is filled by 5 Fill bits minded(p) as follow skim over line 1728 pixelsEOLRLE code4B3W2B1719W12 bits43 bitsBit pattern00110101 011 1000 11 01100001011000 00000 000000000000131 data bits fill patren EOL 48 bits -Figure 2.2 Modified Huffman buildingIn accompaniment to this another special(a) bit pattern used in the MH coding is EOL . EOL are special bit patterns which hurl several(prenominal) different identification function i.e.EOL a t the start of the scan line indicate the start of the scan of lineEOL at the end of the scan line consist of 11 0s followed by a 1. It helps in fish filet the wrongful conduct from one scan line penetrating into other scan lines and distributively line is independently coded.At the end of each page an RTC signal is given which holds six EOL patterns which identifies the end of page .MODIFIED canvasMR is as well known as Modified Relative Element continue designated (READ). MR exploits the correlation between successive lines . It is known that two consecutive lines oblige a very high percentage of single pixel mutation due to a very high resolution of the exposures. Using this phenomena, or else of scanning each scan line as done in MH, MR takes in ac wait a book of facts line and then encodes each scan line that follows. In fact it is more appropriate to say that MR is more complex MH algorithm.MR encoding encounters both MH and MR coding technique. The credit line is encoded using MH and the subsequent line is encoded using MR encoding until the attached reference line appears. The decision on how to encounter the bordering reference line is taken by a parameter K. The vale of K defines the resolution of the compression.MR is a 2-Dimensional algorithm. The value of K defines the number of lines that uses 2-Dimensional phenomena, which K-1 lines. However the reference line using the MH algorithm is using 1-dimension. For a normal resolution of an throw the value of K is set to 2 the refrence line is encoded every reciprocal ohm scan line. Where as the value of K set to 4 will give a higher resolution because the reference line is MH encoded every 4 line , making it more complex and compressed. The following understand shows scan lines for both resolution of K set to 2 and 4.MHMRMHMR-2 scan lines-For normal resolutionk = 2 , 1 MH line, 1 MR lineMHMRMRMRMHMRMRMR4 scan linesFor higher resolutionk = 4, 1 MH line , 3 MR lines take care 2.3 modifi ed read coordinateThe advantage of having low resolution over high resolution is that the error prorogation into the subsequent line is reduced with lower number of dependent scan lines. However in MR encoding the value of K can be set as high as 24.The change between two subsequent line i.e. the refrence line and the beside scan line given by MR can be given as followreference line b1 b2Scan line a0 a1 a2figure 2.4 MR 2-D coding.The nodes that are given in the figure above are described as followa0 is start of changing grammatical constituent in the coding line which is also the reference for the next changing elementsa1 foremost vicissitude on the coding linea2 second enactment on the coding lineb1 original transition on the reference line on the right of the a0 , first opposite color transitionb2 first transition on the reference line.In the above figure the reference line is coded with the MH coding while the next scan line is coded with MR. Hence it can be seen that the re are very nipper changer between both the scan line. MR takes advantage of the minor changes and encodes only the changing elements a0 , a1 and a2 kind of of the complete scan line. There are trio functional encoding sensory systems of MR , which decide on how to code these changing elments of the scan line with respect to the reference line. These modes arePass mode just modeHorizontal modeAs it is due to these different modes of MR which makes it more complex algorithm. These MR functional modes are discussed in detail in chapter 3. And then one can reffer back to this part to completely understand it. The structure of MR is given as followEOL +1 entropy1-DfillEOL+0 information1-DEOL+1Data1-DfillEOL +0Data1-DEOL +1EOL +1EOL +1EOL +1EOL +1EOL +1K = 2EOL+1 MH coding of next lineEOL+0 MR coding of next lineFILL Extra 0 bitsRTC End of page with 6 EOLsFigure 2.5 Structure of MR data in a pageModified Modified ReadITU-T Recommendation T.6 gives the Modified Modified Read or MMR en coding algorithm. MMR is an upgraded variance of the MR. They are both 2-Dimensional algorithms but MMR is an Extended version of the 2-Dimension. The fundamentals of MMR are same as MR except a hardly a(prenominal) minor changes to the algorithm however the modes of MR i.e. pass mode , vertical mode and horizontal mode are same for MMR encoding.The major change in the MMR with respect to MR is the K parameter . The MMR algorithm dose not use the K parameter and recurring reference line. Instead of these the MMR algorithm uses an complex number scan line which consist of all white pixels which is the first line at the start of each page and a 2-Dimension line follows work the end of the page. This introduced scan line of all whites is the reference line alike the MR.The error propagation in MMR has a very high predictability because of the affiliated coding method of all the scan lines. Thus ECM is indispensable for MMR to be enabled. ECM guaranties error free MMR algorithm. T hus MMR dose not require any EOL however a EOFB (end of facsimile block) is postulate at the end of page which is the same as RTC in MH. The organization of data in MMR and the EOFB block bit sequence is given as follow.Data2-DData2-DData2-DData2-DData2-DData2-DData2-DData2-DData2-DData2-DData2-DData2-DData2-DEOFBscan lines of pageEOFB bit sequence0000000000001 0000000000001Figure 2.6 Scan lines in MMR page label doubling File Format differentiateged form File Format( stir) is purely a graphical format i.e. pix elated, bitmap or rasterized. fuss is a prevalent file format that is found in intimately imaging programs. This discussion here cover majorly the tiff standard of ITU-T.6 which is the latest. T.6 includes all the specification of the earlier versions with little addition. tizzy is flexible and has good creator rating but at the same time it is more complex. Extensibility of squabble makes it more difficult to design and understand. trouble is as known by its name a tagged file that holds the information about the range of a function. TIFF structure is organized into three partsImage file head teacher (IFH)Bit map data (black and white pixels)Image File Directory(IFD)IFH electronic image dataIFDEOBFigure 2.7 File organization of TIFFConsider an example of three TIFF images file structures. These three structures hold the same data in possible three different formats. The IFH or the header of TIFF is the first in all the three arrangements. However in the first arrangement IFDs are been written first and then followed by the image data which is efficient if IFD data is needed to be read quickly. In the second structure the IFD is followed by its particular image which is the most common internal structure of the TIFF. In the hold example the image data followed by its IFDs. This structure is applicable if the image data is available before the IFDs.HeaderIFD0IFD1IFD nImage 0Image 1Image nHeaderIFD 0Image 0IFD 1Image 1IFD nImage nHeaderImage 0Image 1Image 3IFD 0IFD 1IFD nFigure 2.8 Different TIFF structuresImage File HeaderA TIFF file header is an 8-byte which is the start of a TIFF file. The bytes are organized in the following identifyThe first two bytes defines the byte order which is each little endian (II)or big endian (MM). The little endian byte order is that it starts from least momentous bit and ends on the most significant and big endian is vice verse.II = 4949HMM = 4D4DHThe third and quaternth bytes hold the value 42H which is the definition for the TIFF fileThe next fourth bytes holds the set out value for the IFD. The IFD may be at any billet after(prenominal) the header but moldiness begin after a word boundary.Byte order42Byte starting for IFDFigure 2.9 IFH structureImage File DirectoryImage file directory (IFD) is a 12 byte file that holds information about the image including the color , type of compression, length, width, physical dimension, location of the data and other such information of t he image. onwards the IFD there is a 2 byte tag counter. This tag counter holds the number of IFD used. Which is followed by a 12 byte IFD and a four 0 bytes at the end of the last byte. Each IFD entry has the following formatThe first two bytes of the IFD hold the identification field. This filed gives information what characteristic of the image it is pointing to. This is also know as the tag.The next two bytes gives the type of of the IFD i.e. short, long etcThe next four bytes hold the count for the delimitate tag typeThe last two bytes hold the origin value for the next IFD which is always an up to now number. However the next IFD starts by a word difference. This vale offset can point anywhere in the Image even after the image data.The IFD are sorted in ascending order check to the Tag number. Thus a TIFF field is a crystalline entity which consist of a tag number and its vallueTag entry count2-bytesTag 012 bytesTag 112 bytesTag n12 bytesNext IFD offset ornull bytes4 byte sFigure 2.10 IFD structureThe IFD is the basic tag file that hold information about the image data in a complete TIFF file. The data is either found in the IFD or retrieved from an offset location pointed in the IFD. Due to offset value to other location instead of having a fixed value makes TIFF more complex. The offset value in TIFF are in three placeslast four bytes of the header which indicates the position of the first IFDLast four bytes of the IFD entry which offsets the next IFD.The last four bytes in the tag may contain an offset value to the data it represents or possibly the data its selffiguer 2.11CCITT encodingThis type of compression is used for facsimile and document imaging files. It is a losses type of image compression. The CCITT ( International telegraph and telephone informatory committee) is an organization which provides standards for communication protocol for black and white images or telephone or other low data rate data lines. The standards given by ITU ar e T.4 and T.6. These standards are the CCITT multitude 3 and assemblage 4 compression methods respectively. CCITT group compression algorithms are intentional specifically for encoding 1 bit image. CCITT is a non adaptive compression algorithm. There are fixed tables that are used by CCITT algorithms. The coded values in these tables were taken from a reference of set of documents containing both text and graphics.The compression ratio obtained with CCITT algorithms is lots more higher than quarter size of the original image. The compression ratio for a 200 x 200 dpi image achieved with group 3 is 51 to 81 which is much increased with group 4 that is up to 151 with the same image resolution. However the complexity of the algorithms increases with the ratio of its comparisons. Thus group 4 is much more complex than group 3.The CCITT algorithms are specifically designed for typed or handwritten scanned images, other images with composition different than that of target for CCITT wi ll take a shit different runs of black and white pixels. Thus such bi-level images compressed will not give the required results. The compression will be either to a minimum or even the compressed image will be greater in size than the original image. Such images at maximum can achieve a ratio of 31 which is very low if the time taken by the comparisons algorithms is very high.The CCITT has three algorithms for compressing bi level images, collection 3 one dimensionalGroup 3 two dimensionalGroup 4 two dimensionalEarlier when group 3 one dimensional was designed it was targeted for bi level , black and white data that was processed by the fax machines. Group 3 encoding and decoding has the tendency of being fast and has a reputation of having a very high compression ratio. The error correction inside a group 3 algorithm is done with the algorithm itself and no extra hardware is required. This is done with special data inside the group3 decoder. Group 3 makes muse off MH algorithm t o encode.The MMR encoding has the tendency to be much more efficent. Hence group 4 has a very high percentage of compression as compared to group 3 , which is almost half the size of group 3 data but it is much more time consumed algorithm. The complexity of such an algorithm is much more higher than that of group 3 but they do not have any error detection which propagates the error how ever special hardware configuration will be required for this purpose. Thus it makes it a poor choice for image transfer protocols.Document imaging system that stores these images have adopted CCITT compression algorithms to save turn spaces. However in age of good processing speeds and handful of storehouse CCITT encoded algorithms are still needed printing and viewing o data as done with adobe files. However the transmission of data through modems with lower data rates still require these algorithms.Group 3 One Dimensional (G31D)The main features of G31D are given as followG31D is a variation of the Huffman type encoding known as Modified Huffman encoding.The G31D encodes a bi-level image of black and white pixels with black pixels given by 1 and white with 0s in the bitmap.The G31D encodes the length of a same pixel run in a scan line with variable length binary codes.The variable length binary codes are take from pre defined tables separate for black and white pixels.The variable code tables are defined in T.4 and t.6 specification foe ITU-T. These tables are determined by fetching a number of typed and handwritten documents. Which were statistically analyzed to the show the total frequency of these bi level pixels. It was decided that run length occurring more frequently were assigned small code will other were given bigger codes.As G31D is a MH coding scheme which is explained earlier in the chapter so we will give some example of the coding is carried out for longer run of same pixels. The coded tables have continuous value from 0 to 63 which are single terminating c odes while the greater are coded with addition of make up codes for the same pixels, only for the values that are not in the tables for a particular pixel. The code from 64 to 2623 will have one makeup code and one terminating code while greater than 2623 will have multiple makeup codes. Hence we have two types of tables one is from 0 to 63 and other from 64 till 2560. The afterward table is selected by statistical analysis as explained above.Consider a pixel run for 20 black . Hence it is less than the 63 coded mark in the table . We will look for the value of 20 in the black pixel table which is 00001101000. hence this will be the terminating code for the 20 black pixel run which is have the size of the original. Thus a ratio 21 is achieved.Let us take the value cxx which is greater than 63 and is not present in the statistically selected pixel run. Here we will need a make up code and a terminating code. The pixel run can be broken into 64 which is the highest in the tables for this pixel run and 57 which will give 120 pixel run120 = 64 + 5764 coded value is 1101157 coded value is 01011010hence 120 is 11011 the make up code and 01011010 terminating code as given in the figure 2.11a.Now consider a bigger run of black pixel which is 8800. This can be given a sum of 4 make up and one terminating code8800 = 2560 + 2560 + 2560 + 1088 + 32which is 000000011111, 00000001111, 000000011111, 0000001110101 and 0000001101010so it can be given as shown in figure 2.11b110111011010Makeup code terminating code2.11a makeup and terminating codes for 120OOOOOOO11111OOOOOOO11111OOOOOOO11111OOOOO111O1O11101010makeup makeup makeup makeup terminatingfigure 2.11b makeup and terminating codes for 8800Group 3 Two Dimensional (G32D)Group 4 Two Dimensional (G42D)

No comments:

Post a Comment