CN1852390A - Method for realizing hand-wirte short-message for mobile communication terminal and its terminal - Google Patents

Method for realizing hand-wirte short-message for mobile communication terminal and its terminal Download PDF

Info

Publication number
CN1852390A
CN1852390A CN 200510049638 CN200510049638A CN1852390A CN 1852390 A CN1852390 A CN 1852390A CN 200510049638 CN200510049638 CN 200510049638 CN 200510049638 A CN200510049638 A CN 200510049638A CN 1852390 A CN1852390 A CN 1852390A
Authority
CN
China
Prior art keywords
code
code table
grouping
swimming
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 200510049638
Other languages
Chinese (zh)
Inventor
薛全
赵建东
黄美成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BODAO SOFTWARE Co Ltd HANGZHOU
Original Assignee
BODAO SOFTWARE Co Ltd HANGZHOU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BODAO SOFTWARE Co Ltd HANGZHOU filed Critical BODAO SOFTWARE Co Ltd HANGZHOU
Priority to CN 200510049638 priority Critical patent/CN1852390A/en
Publication of CN1852390A publication Critical patent/CN1852390A/en
Pending legal-status Critical Current

Links

Images

Abstract

The method includes steps: (1) for handwritten graphics or character on touch screen of terminal, setting up run-code corresponding to number of continuous black pixels or white pixels in each row; (2) encoding black pixels or white pixels in each row according to Huffman code list so as to obtain data of code stream; the code list is corresponding to Huffman binary tree; the binary tree is full biased binary tree of possessing full sub trees; (3) through communication module to send out the data of stream; (4) through short message receiver to receive handwritten short message, decoding received data of code stream according to Huffman tree; (5) outputting the decoded run-codes and pixels to touch screen to display information of image. The invention also discloses terminal of possessing function of handwriting short message. Based on improved Huffman algorithm, the invention possesses features of high encoding efficiency, high compression ratio, and fast decoding.

Description

A kind of implementation method of hand-wirte short-message for mobile communication terminal and terminal thereof
(1) technical field
The present invention relates to a kind of coding-decoding method of hand-wirte short-message of mobile communication terminal, and the terminal with this hand-wirte short-message function.
(2) background technology
The encoding-decoding process of hand-wirte short-message mainly is made up of two parts of Code And Decode as shown in Figure 1.The method of existing compression black and white image data, its process is to utilize the Huffman encoding of standard to compress processing for the image that hand-wirte short-message obtains, its system coding efficient is low, the ASCII stream file ASCII that forms is excessive, and be not suitable for sending with the form of short message, therefore need to adopt more efficient methods, just can be more suitable for application in hand-wirte short-message.
Popular multimedia message at present mainly is to send existing picture colored or black and white, and its shortcoming is to send figure or the handwriting of oneself drawing.Equally, if when hand-wirte short-message sent by common picture format, also because the byte space that picture takies is big, therefore the expense that produces in the process that sends by wireless network is higher.
If the mode of hand-wirte short-message by short message or extending message breath (ems) sent, just necessarily requiring that the compression efficiency of picture is high just can be both economical, and must undistortedly as much as possible could guarantee reception can see the sender clearly figure that write or drawn or literal.Simultaneously also require this mode to be suitable for the processing speed and the disposal ability of mobile phone, also require the speed of Code And Decode fast.
(3) summary of the invention
The present invention aims to provide a kind of high efficiency of the hand-written black and white note based on improved Huffman algorithm, the coding method of high compression rate, coding/decoding method that can fast decoding; And mobile communication terminal with this hand-wirte short-message function.
The technical solution adopted for the present invention to solve the technical problems is:
A kind of implementation method of hand-wirte short-message for mobile communication terminal, described method comprises:
(1), for handwritten patterns on the touch-screen of described terminal or literal, the number of setting in every row continuously black picture element or white pixel is corresponding distance of swimming value;
(2), black picture element, white pixel of each row are encoded successively according to its distance of swimming value, obtain bit stream data, the corresponding Huffman binary tree of this code table, this binary tree are the non-complete binary tree of biasing fully with complete subtree according to the Huffman code table;
(3), this bit stream data is sent through communication module;
(4), receive hand-wirte short-message, the bit stream data that receives is decoded, this decoding step is through the note receiving system:
(4.1), determine fixed length code word N, N is the number of plies of integer and N 〉=code table;
(4.2), from the Huffman code table, be divided into the grouping code table that is no less than 2 groups according to the code value size of coding, and set the code length comparison value of respective packets code table correspondence;
(4.3), with fixed length code word N readout code flow data: the preceding N bit word of readout code flow data, the code value and the code length comparison value of this code word are compared, judge to obtain the grouping code table corresponding that read the distance of swimming and the pixel of described code word correspondence from the grouping code table, described code word is the Ki position with this code word;
(4.4), judge whether to read the last position of bit stream data;
(4.5), if not, this is decoded remaining N-Ki data and the Ki bit data that is right after is combined into the data of N position in bit stream data, repeat (4.3)-(4.4); If finish whole decode procedure;
(5), the distance of swimming that decodes and corresponding pixel are shown on touch-screen, obtain image information.Further, in described (2), Methods for Coding is:
To the distance of swimming is 1-2 nBlack picture element, white pixel encode 2 N-1<columns<2 n:, obtain the distance of swimming from 1-2 nBlack picture element, white pixel standard code table.
Further again, in described (2), the setting number of plies of code table is 12 layers; In described (4.1), the fixed length code word is 16.
Further, in described (4.2), the method that the Huffman code table is corresponded to four component group code tables is: according to the figure place of code word, code word is 12 is divided into the first grouping code table; With the second grouping code table that is divided into that is encoded to 10; To be encoded to 8 and be divided into the 3rd grouping code table; Bits of coded 3-7 position is divided into the 4th grouping code table; The method that obtains the code length comparison value is: described code word figure place is added to 16, obtain maximum according to encoded binary value size, promptly obtain code length comparison value: L1, L2, L3, L4, the corresponding first grouping code table of L1, the corresponding second grouping code table of L2, corresponding the 3rd grouping code table of L3, corresponding the 4th grouping code table of L4, L1<L2<L3<L4;
In described (4.3), be: (4.3.1), whether judge the N bit code value that reads less than L1, if then in the first grouping code table, read the corresponding distance of swimming and the pixel of described coding with the method for fixed length code word N readout code flow data; Otherwise enter next step;
(4.3.2), whether judge the N bit code value that reads less than L2, if then in the second grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter next step;
(4.3.3), whether judge the N bit code value that reads less than L3, if then in the 3rd grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter next step;
(4.3.4), whether judge the N bit code value that reads less than L4, if then in the 4th grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter (4.4).
A kind of mobile communication terminal with described hand-wirte short-message function, comprise main control module, communication module, man-machine interaction unit, described main control module comprises the short message module, described man-machine interaction unit comprises touch display screen, input keyboard, earphone and microphone, described short message module comprises: huffman encoder, be used for handwritten patterns on the touch-screen of described terminal or literal, the number of setting in every row continuously black picture element or white pixel is corresponding distance of swimming value, according to the black picture element of Huffman code table to each row, white pixel is encoded successively, obtain bit stream data, the corresponding Huffman binary tree of this code table, this binary tree are the non-complete binary tree of biasing fully with complete subtree;
The output and the communication module of described encoder communicate to connect; Described communication module is connected with the input communication of Hafman decoding device, and the output of described decoder connects touch display screen; The Hafman decoding device is used for the bit stream data that receives is decoded; Described decoder comprises: grouping code table setup unit, be used for determining fixed length code word N, N is the number of plies of integer and N 〉=code table, from the Huffman code table, be divided into the grouping code table that is no less than 2 groups according to the code value size, and set the code length comparison value of corresponding grouping code table correspondence; The bit stream data reading unit is used for judging according to N bit code value that reads and code length comparison value which grouping code table is this code word belong to, and reads the distance of swimming and the pixel of described code word correspondence, and described code word is the Ki position; Judging unit is finished in decoding, be used to judge whether to read the last position of bit stream data, if not, this is decoded remaining N-Ki data and the Ki bit data that is right after is combined into the data of N position in bit stream data, this N bit data is sent into the bit stream data reading unit; If finish whole decode procedure.
Further, described Huffman code table is for being 1-2 to the distance of swimming nBlack picture element, white pixel encode 2 N-1<line width<2 n
Further again, the number of plies of described Huffman code table is 12 layers, and the fixed length code word of described grouping code table setup unit is 16.
Further, described grouping code table is four groups, and it is the first grouping code table that code word is 12; It is the second grouping code table that code word is 10; It is the 3rd grouping code table that code word is 8; Code word is the 4th grouping code table for the 3-7 position; The code length comparison value comprises L1, L2, L3, L4, the corresponding first grouping code table of L1, the corresponding second grouping code table of code length comparison value L2, corresponding the 3rd grouping code table of code length comparison value L3, corresponding the 4th grouping code table of code length comparison value L4, L1<L2<L3<L4;
Described bit stream data reading unit comprises: the first grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L1, if then read the corresponding distance of swimming and the pixel of described coding in the first grouping code table; The second grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L2, if then read the corresponding distance of swimming and the pixel of described coding in the second grouping code table; The 3rd grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L3, if then read the corresponding distance of swimming and the pixel of described coding in the 3rd grouping code table; The 4th grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L4, if then read the corresponding distance of swimming and the pixel of described coding in the 4th grouping code table.
Basic thought of the present invention is: based on the statistical law of various patterns appearance in the hand-wirte short-message image, by constructing a dangerous binary tree that form is special, proposed to be exclusively used in the optimization data compression method of hand-wirte short-message image encoding, biasing fully according to the structure binary tree has provided a kind of fast decoding algorithm.This method has the high and fireballing characteristics of decoding of code efficiency.
The present invention proposes a kind of method of effective compression black and white image data, in order to be applicable to and to promote the application of hand-wirte short-message.Original the Huffman encoding method of standard is applied to the compressed encoding of hand-wirte short-message, its system coding efficient is low, and the ASCII stream file ASCII of formation is excessive, and is not suitable for sending with the form of short message, therefore needs to adopt more efficient methods.
The characteristics of Huffman tree of the present invention are: (1), whole tree are the non-complete binary trees with complete subtree, the level of tree is few, leaf is many, the distribution of leaf has the height asymmetry, does not use EOL mark simultaneously, avoids the appearance of special leafy node in the conventional coding.(2), compression ratio height.Utilize above-mentioned binary tree, fully adopted the frequency of occurrences high more in the cataloged procedure, the characteristics that code word is short are not more used the appearance of long code word and special code word simultaneously, can make the compression efficiency that realizes at hand-wirte short-message higher.Utilize this method that the hand-wirte short-message of 1~8 word is encoded respectively, the data compression scope all can be controlled in the 0.75K.(3), decoding speed is fast.Utilize the offset nature of structure coding code table binary tree, can effectively avoid the full search procedure of binary tree in the decode procedure, therefore can be easy to realize fast grouping Hafman decoding in real time.(4), method is simple, it is convenient to realize.Whole algorithm only adopts integer to calculate, and has avoided floating-point operation, is a kind of simple and effective entropy coding method, can transplant on the development platform of a plurality of different editions easily.
Huffman encoding is a kind of harmless entropy coding method, by the information source distribution character is added up,, define corresponding code table at the feature of different coefficients, the bit number of the code assignment that probability of occurrence is high is few as far as possible, and the bit number of the code assignment that probability of occurrence is low is many.Simultaneously, Huffman encoding is the best non-distortion entropy coding of integer algorithm, and this is because can not find the variable-length encoding of other integer length, can produce littler mean code length.Behind limited symbol and the probability thereof, Huffman encoding can produce best integer prefix code in obtaining information source.In prefix code, the neither one code word is the prefix of another code word, therefore can only translate with a kind of method for a given binary string, and such code word is the unisolvent sign indicating number.
Data file after the compression is decoded then must be by means of Huffman tree T, the process of general solution code calculation is: read in the binary code of file successively, from the root node of Huffman tree, if currently read people 0, then walk left child's (lobus sinister), otherwise walk to the right child's (lobus dexter).In case just translate corresponding meaning when arriving a certain leaf.Again continue decoding from root then, until the end of file.Its search deterministic process of fast decoding algorithm of the present invention mainly is divided into three steps: at first read in buffer memory one segment encode word with the maximum length code word, select corresponding code table according to content model then, the size that last basis is read in the value of code word judges which group code table is this code word belong to, and determines just can define the explanation results that obtain code word at once according to code table behind the decoding code table.Because the symbol that each grouping comprises is less, so can after having removed grouping information, from remaining information bit, directly obtain the position of symbol correspondence in table.
Beneficial effect of the present invention mainly shows: 1, by means of improved Huffman algorithm, realized hand-wirte short-message Code And Decode method, realized hand-written black and white SMS; 2, used coding is unique, has guaranteed the completeness of code word, promptly to any string of code, all can only translate same figure (code stream), can not produce ambiguity; 3, used fast decoding algorithm can guarantee that decoding can have fast speeds; 4, hand-wirte short-message is extremely personnalit handwritten content, can transmit special emotion for the user.
(4) description of drawings
Fig. 1 is the schematic diagram of hand-wirte short-message compressibility.
Fig. 2 is the schematic diagram of the Huffman binary tree that diverted via of the present invention.
Fig. 3 is the example of the cataloged procedure delegation pixel of embodiment 1.
Fig. 4 is the example of another row pixel of cataloged procedure of embodiment 1.
Fig. 5 finishes the once algorithm flow chart of decoding.
Fig. 6 is the flow chart to group code flow data decoding.
Fig. 7 is the structured flowchart of terminal of the present invention.
(5) embodiment
Below in conjunction with accompanying drawing the present invention is further described.
Embodiment 1
With reference to Fig. 2, Fig. 3, the binary tree of adopting in the hand-wirte short-message coding: by the test of a large amount of experimental results and the analysis of statistics, when taking into full account efficiency of data compression, and the requirement of combination grouping Hafman decoding, this paper has provided the binary tree of a kind excellent performance.
Coding method of the present invention is: for handwritten patterns on the touch-screen of described terminal or literal, the number of setting in every row continuously black picture element or white pixel is corresponding distance of swimming value, according to the Huffman code table black picture element, the white pixel of each row are encoded successively according to its distance of swimming value, obtain bit stream data, the corresponding Huffman binary tree of this code table, this binary tree are the non-complete binary tree of biasing fully with complete subtree.To the distance of swimming is 1-2 nBlack picture element, white pixel encode 2 N-1<line width<2 n: setting the number of plies is 12, obtains the distance of swimming from 1-2 nBlack picture element, white pixel standard code table.
As shown in Figure 2, its corresponding Huffman code table data are provided by table 1.Each end among Fig. 2 in the branch all is called a leaf.With reference to table 1,
Word length (distance of swimming) Black In vain
1 ?011 ?0100
2 ?0101 ?00101
3 ?00111 ?000110
4 ?00110 ?0000110
5 ?000111 ?0000100
6 ?000101 ?00100110
7 ?000100 ?00100001
8 ?0000111 ?00100101
9 ?0000101 ?00100100
10 ?00100111 ?00100010
11 ?00100011 ?0000001010
12 ?00100000 ?0000001100
13 ?0000001110 ?0000001011
14 ?0000001101 ?0000001111
15 ?0000001000 ?0000001001
16 000000011110 000000011101
32 000000010101 000000011000
48 000000010001 000000010011
64 000000011111 000000010000
80 000000011010 000000011011
96 000000011001 000000010100
112 000000010111 000000011100
128 000000010110 000000010010
Table 1
For the arbitrfary point in any delegation in the coded image all may be white point or stain, as shown in Figure 3, delegation's pixel (selecting the code table maximum run is 128) for every behavior 120 (hypothesis), the white box representative is current to be white pixel, having the representative of pitching line flag current is black picture element, can be deceived like this, the distance of swimming value of white pixel, the characteristics of this row have demonstrated fully the distribution situation of black and white pixel in the hand-wirte short-message image, promptly black pixel distribute and the thickness of style all inhomogeneous.The binary-tree coding tree of adopting this paper to propose can be realized coding, and beginning most among Fig. 3 is two white pixel.Then tabling look-up 1 obtains 2 white pixel corresponding codes positions 00101, and ensuing is 3 black picture elements, table look-up equally 1 to obtain being encoded to 00111, and the like, obtain the coding of this all row.Intermediate object program is provided by table 2, referring to table 2:
Color Stroke Coding Code length
In vain ? 2 ? 00101 5 ?
Black ? 3 ? 00111 5 ?
In vain ? 7 ? 00100001 8 ?
Black ? 1 ? 011 3 ?
In vain ? 2 ? 00101 5 ?
Black ? 2 ? 0101 4 ?
In vain 93(80+ ? 13) ? 000000011011+0000001011 ? 22 ? ?
Black ? 6 ? 0000101 ? 7
In vain ? 4 ? 0000110 ? 7
Table 2
Obtain the code stream of Fig. 3, promptly last result is 0,010 1,001 1,100 1,000 0,101 10,010,101 0,100 0,000 0,110 1,100 0,000 1,011 0,000 1,010 0,001 10.
In like manner shown in Figure 4, the characteristics of this row are relatively simple for structure, and this type of situation often appears at the upper and lower of hand-wirte short-message image.The binary-tree coding tree of adopting this paper to propose is promptly realized coding, and intermediate object program is provided by table 3, referring to table 3:
Color Stroke Coding Code length
In vain ? 12 ? 0000001100 10 ?
Black ? 3 ? 00111 5 ?
In vain ? 96 ? 000000010100 12 ?
Black ? 5 ? 000111 6 ?
In vain ? 4 ? 0000110 7 ?
Table 3
Obtain the code stream of Fig. 3, promptly last result is 0,000 0,011 0,000 1,110 0,000 00,101,000 0,011 1,000 0110.
For two examples enumerating in the cataloged procedure, the process of its quick Huffman machine decoding is: with reference to Fig. 5, Fig. 6, receive hand-wirte short-message through the note receiving system, the bit stream data that receives is decoded, this decoding step is:
The first step, determine fixed length code word N, N=16;
Second step, from the i.e. table 1 of Huffman code table, according to the quadripartite grouping code table of code value size, and set the code length comparison value of corresponding grouping code table correspondence;
The first grouping code table is referring to table 4:
Word length (distance of swimming) Color (1 is white, and 0 for black) Code length
?64 ?1 ?12
?48 ?0 ?12
?128 ?1 ?12
?48 ?1 ?12
?96 ?1 ?12
?32 ?0 ?12
?128 ?0 ?12
?112 ?0 ?12
?32 ?1 ?12
?96 ?0 ?12
?80 ?0 ?12
?80 ?1 ?12
?112 ?1 ?12
?16 ?1 ?12
?16 ?0 ?12
?64 ?0 ?12
Table 4
The second grouping code table is referring to table 5:
Word length (distance of swimming) Color (1 is white, and 0 for black) Code length
15 ?0 ?10
15 ?1 ?10
11 ?1 ?10
13 ?1 ?10
12 ?1 ?10
?14 ?0 ?10
?13 ?0 ?10
?14 ?1 ?10
Table 5
The 3rd grouping code table is referring to table 6:
Word length (distance of swimming) Color (1 is white, and 0 for black) Code length
120 ?0 ?6
120 ?0 ?6
120 ?0 ?6
120 ?0 ?6
5 ?1 ?7
5 ?1 ?7
5 ?0 ?7
5 ?0 ?7
4 ?1 ?7
4 ?1 ?7
8 ?0 ?7
8 ?0 ?7
7 ?0 ?6
7 ?0 ?6
7 ?0 ?6
7 ?0 ?6
6 ?0 ?6
6 ?0 ?6
?6 ?0 ?6
?6 ?0 ?6
?3 ?1 ?6
?3 ?1 ?6
?3 ?1 ?6
?3 ?1 ?6
?5 ?0 ?6
?5 ?0 ?6
?5 ?0 ?6
?5 ?0 ?6
?12 ?0 ?8
?10 ?1 ?8
?11 ?0 ?8
?7 ?0 ?6
?9 ?1 ?8
?8 ?1 ?8
?6 ?1 ?8
?10 ?0 ?8
?2 ?1 ?5
?2 ?1 ?5
?2 ?1 ?5
?2 ?1 ?5
?2 ?1 ?5
?2 ?1 ?5
?2 ?1 ?5
?2 ?1 ?5
?4 ?0 ?5
?4 ?0 ?5
?4 ?0 ?5
?4 ?0 ?5
?4 ?0 ?5
?4 ?0 ?5
?4 ?0 ?5
?4 ?0 ?5
?3 ?0 ?5
?3 ?0 ?5
?3 ?0 ?5
?3 ?0 ?5
?3 ?0 ?5
?3 ?0 ?5
?3 ?0 ?5
?3 ?0 ?5
Table 6
The 4th grouping code table is referring to table 7:
Word length (distance of swimming) Color (1 is white, and 0 for black) Code length
1 ?1 4 (annotating 1)
2 ?0 ?4
1 ?0 ?3
1 0 3
120 (annotating 2) 1 2
120 1 2
120 1 2
120 1 2
Table 7
Determine code length comparison value L1, L2, L3, the value of L4: owing among Fig. 5, Fig. 6 " with fixed length code word readout code flow data ", in the present embodiment, get 2 bytes, i.e. 16bit (position).In the code table 1 each coding code length is all smaller or equal to 12, and read 16 of numerical digits, numeric ratio is based on 16 in Fig. 5,6, so should determine L1, L2, L3, L4.
Determine L1: the code length in the table 4 (the first grouping code table) is 12, promptly 12 as can be seen.And code length (position bit) is in 16 sign indicating numbers of 12, and maximum one of its value is 00,000,001 1111, sees Table in 1 the distance of swimming 64 and deceives pairing code values.Again because any general sign indicating number in the table 4 all begins with zero.So, add to 16 after, will be with the value of 16 bit data of any one yard beginning in the table 4 smaller or equal to 0,000 0,001 1,111 1111 B (binary system), i.e. 01FFH, (hexadecimal), i.e. 511D (decimal system).Therefore determine that L1 is an integer 512.(to be on the safe side, bigger by 1 than maximum, down together)
Determine L2: same, the code length of table 5 (the second grouping code table) is 10.A code value of its maximum is 0000001111, and promptly the distance of swimming in the table 1 14 is white.Therefore, add to 16 after, will be with the value of 16 bit data of any one yard beginning in the table 5 smaller or equal to 0,000 0,011 1,111 1111 B, i.e. 3FFH, i.e. 1023D.Therefore determine that L2 is an integer 1024.
Determine L3: same, the code length in the table 6 (the 3rd grouping code table) is 5~8, and maximum number is 00111 in 5, promptly in the table 1 distance of swimming be 3 black.Therefore, add to 16 after, will be with the value of 16 bit data of any one yard beginning in the table 6 smaller or equal to 0,011 11,111,111 1111 B, i.e. 3FFFH, i.e. 4095D.Therefore determine that L3 is an integer 4096.
Determine L4: in like manner, the code length in the table 7 (the 4th grouping code table) is 3,4.Value maximum in 3 is 011, i.e. first number in the table 1.Therefore, add to 16 after, will be with the value of 16 bit data of any one yard beginning in the table 7 smaller or equal to 0,111 11,111,111 1111 B, i.e. 7FFFH, promptly therefore 8191D determines that L4 is an integer 8192.
With fixed length code word N (N=16) readout code flow data: the preceding N bit word of readout code flow data, the code value and the code length comparison value of this code word are compared, judge which grouping code table is this code word belong to, and reads the distance of swimming and the pixel of described code word correspondence from the grouping code table, and described code word is the Ki position:
Whether judge the N bit code value that reads less than L1, if then in the first grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter next step;
Whether judge the N bit code value that reads less than L2, if then in the second grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter next step;
Whether judge the N bit code value that reads less than L3, if then in the 3rd grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter next step;
Whether judge the N bit code value that reads less than L4, if then in the 4th grouping code table, read the corresponding distance of swimming and the pixel of described coding;
Judge whether to read the last position of bit stream data? if not, this is decoded remaining N-Ki data and the Ki bit data that is right after is combined into the data of N position in bit stream data, return and repeat above-mentioned single decode procedure; If finish whole decode procedure; The distance of swimming of will decoding and pixel displays image information on touch-screen.
The above-mentioned last position that judges whether to read bit stream data, processing method is as follows:
(1) if remaining data bits is less than described Ki value in the bit stream data described in the epimere, then insufficient section adds to 16 bit data with several " 1 ".
(2) whether the first place of judging 16 current fixed length code words is " 1 ".
(I) if 1, then the description code flow data has arrived last position, finishes decode procedure.(because each code word all is initial with " 0 " in the code table one, if " 1 " illustrates that then this is follow-up additional, does not belong to the numerical digit of original bit stream data.)
(II) if " 0 " then enters next step.
(3) be back to judgement code value part in the single decode procedure, continue circulation.
With reference to table 8, be the decode procedure schematic table of the bit stream data of coding shown in Figure 3:
Code stream Code character Code word Color Form
0010?1001?1100?1000?0101 1001?0101?0100?0000?0110 1100?0000?1011?0000?1010 0001?10 The 2nd group 00101 ? ? ? In vain 2 ? ? ?
?0011?1001?0000?1011?0010 ?1010?1000?0000?1101?1000 ?0001?0110?0001 0100 ?0011?0 The 2nd group 00111 ? ? ? Black 3 ? ? ?
?0010?0001?0110?0101?0101 ?0000?0001?1011?0000?0010 ?1100?0010?1000?0110 The 2nd group 00100001 ? ? In vain 7 ? ?
?0110?0101?0101?0000?0001 ?1011?0000?0010?1100?0010 ?1000?0110 The 1st group 011 ? ? Black 1 ? ?
?0010?1010?1000?0000?1101 ?1000?0001?0110?0001?0100 ?0011?0 The 2nd group 00101 ? ? In vain 2 ? ?
?0101?0000?0001?1011?0000 ?0010?1100?0010?1000?0110 The 1st group 0101 ? Black 2 ?
?0000?0001?1011?0000?0010 ?1100?0010?1000?0110 The 4th group 000000011011 ? In vain 80 ?
?0000?0010?1100?0010?1000 ?0110 The 3rd group 0000001011 ? In vain 13 ?
?0000?1010?0001?10 The 2nd group 0000101 Black 6
?000?0110 The 2nd group 0000110 In vain 4
Table 8
With reference to table 9, be the decode procedure schematic table of the bit stream data of coding shown in Figure 4:
Code stream Code character Code word Color Form
0000?0011?0000?1110?0000 0010?1000?0011?1000?0110 The 3rd group 0000001100 ? In vain 12 ?
0011?1000?0000?1010?0000 1110?0001?10 The 2nd group 00111 ? Black 3 ?
0000?0001?0100?0001?1100 0011?0 The 4th group 000000010100 ? In vain 96 ?
0001?1100?0011?0 000111 Black 5
0000?110 0000110 In vain 4
Table 9
Embodiment 2
With reference to Fig. 7, a kind of mobile communication terminal with hand-wirte short-message function, comprise main control module 1, communication module 2, man-machine interaction unit 3, described main control module 1 comprises short message module 4, described man-machine interaction unit 3 comprises touch display screen 5, input keyboard 6, earphone and microphone 7, described short message module 4 comprises: huffman encoder 8, handwritten patterns on the touch-screen of described terminal or literal are resolved into pixel according to line number, the columns set, and the number of setting in every row continuously black picture element or white pixel is corresponding distance of swimming value; According to the Huffman code table black picture element, the white pixel of each row are encoded successively according to its distance of swimming value, obtain bit stream data, the corresponding Huffman binary tree of this code table, this binary tree are the non-complete binary tree of biasing fully with complete subtree; The output of described encoder 8 and communication module 2 communicate to connect; Described communication module 2 is connected with the input communication of Hafman decoding device 9, and the output of described decoder 9 connects touch display screen 5; Hafman decoding device 9 is used for the bit stream data that receives is decoded; Described decoder 9 comprises: grouping code table setup unit 10, be used for determining fixed length code word N, N is the integer more than or equal to the Huffman binary tree number of plies, and be generally 8 multiple, from the Huffman code table, be divided into the grouping code table that is no less than 2 groups according to the code value size, and set the code length comparison value of corresponding grouping code table correspondence; Bit stream data reading unit 11 is used for judging according to N bit code value that reads and code length comparison value which grouping code table is this code word belong to, and reads the distance of swimming and the pixel of described code word correspondence, and described code word is the Ki position; Judging unit 12 is finished in decoding, be used to judge whether to read the last position of bit stream data, if not, this is decoded remaining N-Ki data and the Ki bit data that is right after is combined into the data of N position in bit stream data, this N bit data is sent into bit stream data reading unit 11; If finish whole decode procedure.
Described Huffman code table is for being 1-2 to the distance of swimming nBlack picture element, white pixel encode 2 N-1<line width<2 n, the setting number of plies is 12 code table.The fixed length code word of described grouping code table setup unit is 16.Described grouping code table is four groups, and it is the first grouping code table that code word is 12; It is the second grouping code table that code word is 10; It is the 3rd grouping code table that code word is 8; Code word is the 4th grouping code table for the 3-7 position; The code length comparison value comprises L1, L2, L3, L4, the corresponding first grouping code table of L1, the corresponding second grouping code table of code length comparison value L2, corresponding the 3rd grouping code table of code length comparison value L3, corresponding the 4th grouping code table of code length comparison value L4, L1<L2<L3<L4.Described bit stream data reading unit 11 comprises: the first grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L1, if then read the corresponding distance of swimming and the pixel of described coding in the first grouping code table; The second grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L2, if then read the corresponding distance of swimming and the pixel of described coding in the second grouping code table; The 3rd grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L3, if then read the corresponding distance of swimming and the pixel of described coding in the 3rd grouping code table; The 4th grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L4, if then read the corresponding distance of swimming and the pixel of described coding in the 4th grouping code table.
The cataloged procedure of the hand-wirte short-message of present embodiment and decode procedure are referring to Fig. 1, Fig. 2, Fig. 3, Fig. 4, Fig. 5, Fig. 6 and table 1, table 2, table 3, table 4, table 5, table 6, table 7, table 8, table 9, identical with embodiment 1.

Claims (8)

1, a kind of implementation method of hand-wirte short-message for mobile communication terminal is characterized in that: described method may further comprise the steps:
(1), for handwritten patterns on the touch-screen of described terminal or literal, the number of setting in every row continuously black picture element or white pixel is corresponding distance of swimming value;
(2), black picture element, white pixel of each row are encoded successively according to its distance of swimming value, obtain bit stream data, the corresponding Huffman binary tree of this code table, this binary tree are the non-complete binary tree of biasing fully with complete subtree according to the Huffman code table;
(3), this bit stream data is sent through communication module;
(4), receive hand-wirte short-message, the bit stream data that receives is decoded, decode procedure is according to above-mentioned Huffman code table, and this decoding step is through the note receiving system:
(4.1), determine fixed length code word N, N is the number of plies of integer and N 〉=code table;
(4.2), from the Huffman code table, be divided into the grouping code table that is no less than 2 groups according to the code value size of coding, and set the code length comparison value of respective packets code table correspondence;
(4.3), with fixed length code word N readout code flow data: the preceding N bit word of readout code flow data, the code value and the code length comparison value of this code word are compared, judge to obtain the grouping code table corresponding that read the distance of swimming and the pixel of described code word correspondence from the grouping code table, described code word is the Ki position with this code word;
(4.4), judge whether to read the last position of bit stream data:
(4.5), if not, this is decoded remaining N-Ki data and the Ki bit data that is right after is combined into the data of N position in bit stream data, repeat (4.3)-(4.4); If finish whole decode procedure;
(5), the distance of swimming that decodes and corresponding pixel are shown on touch-screen, obtain image information.
2, the implementation method of a kind of hand-wirte short-message for mobile communication terminal as claimed in claim 1 is characterized in that: in described (2), Methods for Coding is:
To the distance of swimming is 1-2 nBlack picture element, white pixel encode 2 N-1<columns<2 n: obtain the distance of swimming from 1-2 nBlack picture element, the code table of white pixel.
3, the implementation method of a kind of hand-wirte short-message for mobile communication terminal as claimed in claim 2 is characterized in that: in described (2), the number of plies of setting code table is 12; In described (4.1), the fixed length code word is 16.
4, the implementation method of a kind of hand-wirte short-message for mobile communication terminal as claimed in claim 3 is characterized in that: in described (4.2), the method that the Huffman code table is corresponded to four component group code tables is:
According to the figure place of code word, code word is 12 is divided into the first grouping code table; With the second grouping code table that is divided into that is encoded to 10; To be encoded to 8 and be divided into the 3rd grouping code table; Bits of coded 3-7 position is divided into the 4th grouping code table;
The method that obtains the code length comparison value is: described code word figure place is added to 16, obtain maximum according to encoded binary value size, promptly obtain code length comparison value: L1, L2, L3, L4, the corresponding first grouping code table of L1, the corresponding second grouping code table of L2, corresponding the 3rd grouping code table of L3, corresponding the 4th grouping code table of L4, L1<L2<L3<L4;
In described (4.3), be with the method for fixed length code word N readout code flow data:
(4.3.1), whether judge the N bit code value that reads less than L1, if then in the first grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter next step;
(4.3.2), whether judge the N bit code value that reads less than L2, if then in the second grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter next step;
(4.3.3), whether judge the N bit code value that reads less than L3, if then in the 3rd grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter next step;
(4.3.4), whether judge the N bit code value that reads less than L4, if then in the 4th grouping code table, read the corresponding distance of swimming and the pixel of described coding; Otherwise enter (4.4).
5, a kind of mobile communication terminal with hand-wirte short-message function as claimed in claim 1, comprise main control module, communication module, man-machine interaction unit, described main control module comprises the short message module, described man-machine interaction unit comprises touch display screen, input keyboard, earphone and microphone, it is characterized in that: described short message module comprises:
Huffman encoder, be used for handwritten patterns on the touch-screen of described terminal or literal, the number of setting in every row continuously black picture element or white pixel is corresponding distance of swimming value, according to the Huffman code table black picture element, the white pixel of each row are encoded successively, the corresponding Huffman binary tree of this code table, this binary tree is the non-complete binary tree of biasing fully with complete subtree, obtains bit stream data;
The output and the communication module of described encoder communicate to connect;
Described communication module is connected with the input communication of Hafman decoding device, and the output of described decoder connects touch display screen;
The Hafman decoding device is used for the bit stream data that receives is decoded;
Described decoder comprises:
Grouping code table setup unit is used for determining fixed length code word N that N is the number of plies of integer and N 〉=code table, from the Huffman code table, is divided into the grouping code table that is no less than 2 groups according to the code value size, and sets the code length comparison value of corresponding grouping code table correspondence;
The bit stream data reading unit is used for judging according to N bit code value that reads and code length comparison value which grouping code table is this code word belong to, and reads the distance of swimming and the pixel of described code word correspondence, and described code word is the Ki position;
Judging unit is finished in decoding, be used to judge whether to read the last position of bit stream data, if not, this is decoded remaining N-Ki data and the Ki bit data that is right after is combined into the data of N position in bit stream data, this N bit data is sent into the bit stream data reading unit; If finish decode procedure.
6, a kind of mobile communication terminal with hand-wirte short-message function as claimed in claim 5 is characterized in that: described Huffman code table is for being 1-2 to the distance of swimming nBlack picture element, white pixel encode 2 N-1<columns<2 n
7, a kind of mobile communication terminal as claimed in claim 6 with hand-wirte short-message function, it is characterized in that: the number of plies of described Huffman code table is 12 layers, the fixed length code word of described grouping code table setup unit is 16.
8, a kind of mobile communication terminal as claimed in claim 7 with hand-wirte short-message function, it is characterized in that: described grouping code table is four groups, it is the first grouping code table that code word is 12; It is the second grouping code table that code word is 10; It is the 3rd grouping code table that code word is 8; Code word is the 4th grouping code table for the 3-7 position; The code length comparison value comprises L1, L2, L3, L4, the corresponding first grouping code table of L1, the corresponding second grouping code table of code length comparison value L2, corresponding the 3rd grouping code table of code length comparison value L3, corresponding the 4th grouping code table of code length comparison value L4, L1<L2<L3<L4; Described bit stream data reading unit comprises:
The first grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L1, if then read the corresponding distance of swimming and the pixel of described coding in the first grouping code table;
The second grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L2, if then read the corresponding distance of swimming and the pixel of described coding in the second grouping code table;
The 3rd grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L3, if then read the corresponding distance of swimming and the pixel of described coding in the 3rd grouping code table;
The 4th grouping code table is judged reading unit, whether is used to judge the N bit code value that reads less than L4, if then read the corresponding distance of swimming and the pixel of described coding in the 4th grouping code table.
CN 200510049638 2005-04-22 2005-04-22 Method for realizing hand-wirte short-message for mobile communication terminal and its terminal Pending CN1852390A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200510049638 CN1852390A (en) 2005-04-22 2005-04-22 Method for realizing hand-wirte short-message for mobile communication terminal and its terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200510049638 CN1852390A (en) 2005-04-22 2005-04-22 Method for realizing hand-wirte short-message for mobile communication terminal and its terminal

Publications (1)

Publication Number Publication Date
CN1852390A true CN1852390A (en) 2006-10-25

Family

ID=37133856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200510049638 Pending CN1852390A (en) 2005-04-22 2005-04-22 Method for realizing hand-wirte short-message for mobile communication terminal and its terminal

Country Status (1)

Country Link
CN (1) CN1852390A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102427578A (en) * 2011-11-15 2012-04-25 宇龙计算机通信科技(深圳)有限公司 Method and terminal for transmitting and receiving a short message
CN105630755A (en) * 2016-01-22 2016-06-01 上海普适导航科技股份有限公司 Source encoding and decoding methods and devices for expanding information quantity transmission of Beidou-satellite short message

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102427578A (en) * 2011-11-15 2012-04-25 宇龙计算机通信科技(深圳)有限公司 Method and terminal for transmitting and receiving a short message
CN105630755A (en) * 2016-01-22 2016-06-01 上海普适导航科技股份有限公司 Source encoding and decoding methods and devices for expanding information quantity transmission of Beidou-satellite short message
CN105630755B (en) * 2016-01-22 2018-08-14 上海普适导航科技股份有限公司 Big-dipper satellite short message expands the source encoding and decoding method and device of information content transmission

Similar Documents

Publication Publication Date Title
CN1119868C (en) Compact source coding tables for encoder/decoder system
US7903873B2 (en) Textual image coding
CN103858433B (en) Layered entropy encoding and decoding
CN1185795C (en) Device and method for entropy encoding of information words and device and method for decoding entropy-encoded information words
CN101185083B (en) Hybrid variable length coding method and device for video compression
CN1710929A (en) Data communication system and method of hand-held apparatus
CN1571508A (en) A method for implementing multi-frame
CN1625893A (en) Compression of palettized color images with variable length color codes
CN101036392A (en) Parameter set and picture header in video coding
CN102438145A (en) Image lossless compression method on basis of Huffman code
CN101039374A (en) Image lossless compression and image decompressing method
US8311124B2 (en) Decoding method and apparatus
CN101017574A (en) Huffman decoding method suitable for JPEG code stream
CN1741616A (en) Adaptive entropy coding/decoding method based on context
CN1928850A (en) Method and apparatus for compressing data based on digital dictionary picture-representing data
CN1163686A (en) Method and system for encoding and decoding method and system
CN101060338A (en) A convolutional code rate matching method and device
CN1181662C (en) Hand written character input method for mobile telephone and mobile phone with said function
CN1826732A (en) Huffman coding and decoding
CN1252187A (en) Method and device for coding data sequences
CN1852390A (en) Method for realizing hand-wirte short-message for mobile communication terminal and its terminal
CN102404571A (en) Binary method and device for video image coding and decoding
CN116708845A (en) Gastrointestinal medical image communication transmission method based on 5G technology
CN103999490A (en) Terminable spatial tree-based position coding and decoding
CN1115782C (en) Compression method suitable for wide character set document

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned
C20 Patent right or utility model deemed to be abandoned or is abandoned