CN102237878B - A kind of Hofmann decoding method - Google Patents
A kind of Hofmann decoding method Download PDFInfo
- Publication number
- CN102237878B CN102237878B CN201010151333.6A CN201010151333A CN102237878B CN 102237878 B CN102237878 B CN 102237878B CN 201010151333 A CN201010151333 A CN 201010151333A CN 102237878 B CN102237878 B CN 102237878B
- Authority
- CN
- China
- Prior art keywords
- code word
- comparisons
- group
- coding book
- auxiliary table
- 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.)
- Active
Links
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The present invention relates to a kind of method being used for carrying out the coded data in a transport stream Hofmann decoding, it includes: process to produce at least one auxiliary table of comparisons to the code word in a coding book, and each produced auxiliary table of comparisons is stored in a storage device, wherein this coding book is by a predetermined coding book or captured in this transport stream; And according to this coding book and at least this auxiliary table of comparisons of being stored in this storage device, to hunt out the corresponding decode value of a target code word in this coded data.By using the auxiliary table of comparisons to decode, can accelerate search speed and only need less storage space, therefore, Hofmann decoding method of the present invention can be efficiently used in most embedded systems.
Description
Technical field
The present invention relates to Hofmann decoding method, more particularly, relate to and a kind ofly there is higher search speed to use the Hofmann decoding method of less memory resource.
Background technology
Huffman code is a kind of compress technique being generally used in various standard, the advanced message coding of such as dynamic image expert group (Moving Picture Experts Group Advanced Audio Coding, and associating image expert group (Joint Photographic Experts Group MPEGAAC), and the size of message or video media transport stream can be reduced significantly JPEG).But because for message and video decoded device, Huffman code is one of the most intensive algorithm of current amount of calculation, and therefore, Huffman code is to encoder, and especially decoder can cause the very large burden in amount of calculation.In addition, although many embedded systems have dedicated decoders, but spendable resource and clock rate are but very limited, therefore, these embedded systems must use these limited resources (such as limited storage space) to process Huffman code.
Some different Hofmann decoding methods are suggested in the past, and these existing Hofmann decoding technology can be divided into two classes haply: single bit method and multidigit unit method.Single bit method is used among Hofman tree (Huffman tree) search method and associating image expert group standard; In addition, use the method for searching of an a bit then bit (bit by bit) compared to single bit method, multidigit unit method uses the table of comparisons or other search technique to search Huffman code usually.
Because single bit method uses the method for searching of an a bit then bit (bit by bit), therefore very slow search speed can be had, in addition, because the image of the audio stream at present handled by embedded system or associating image expert group all has high bit transmission rate (bit rate) and resolution, adding most embedded systems only uses the clock signal of low rate to reduce power consumption usually, therefore, as mentioned above, because single bit method search speed is excessively slow, cannot these audio streams of efficient process or image, and be not suitable in most embedded system therefore.
In addition, multidigit unit method develops to accelerate Hofmann decoding speed, and most multidigit first method, particularly table of comparisons approximatioss, the speed of decoding is fast very more than single bit method.But multidigit unit method needs more storage space, therefore, multidigit unit method is also imperfect for embedded system because most embedded system is in order to reduce chip area, designed by the memory size that goes out very limited.
Summary of the invention
The technical problem to be solved in the present invention is, for the above-mentioned defect of prior art, provide a kind of Hofmann decoding method, it has search speed and less storage space use amount faster, and can be used in efficiently in most embedded system, to solve the above problems.
The technical solution adopted for the present invention to solve the technical problems is: construct a kind of method being used for carrying out the coded data in a transport stream Hofmann decoding, it includes: process to produce at least one auxiliary table of comparisons to the code word in a coding book, and each produced auxiliary table of comparisons is stored in a storage device, wherein this coding book is by a predetermined coding book or captured in this transport stream; And according to this coding book and at least this auxiliary table of comparisons of being stored in this storage device, to hunt out the corresponding decode value of a target code word in this coded data.
Method of the present invention, wherein includes the step that the code word in this coding book processes:
Code word in this coding book is divided into multiple code word group, and define a coboundary and a lower boundary of each code word group, wherein the plurality of code word group corresponds to multiple different bit form (bit pattern) respectively, and the code word in same code word group all has the identical bit form of a part; And
Set up this auxiliary table of comparisons, wherein a coboundary of this auxiliary each code word group of table of comparisons record and a lower boundary.
Method of the present invention, the step wherein hunting out this corresponding decode value of this target code word includes:
According to this coded data to select a specific coboundary and a specific lower boundary in this auxiliary table of comparisons;
With reference to this specific coboundary and this specific lower boundary to hunt out this target code word in one or more code word in this coding book; And
Export and correspond to this target code word and this decode value be recorded on this coding book.
Method of the present invention, wherein includes with the step hunting out this target code word in one or more code word in this coding book with reference to this specific coboundary and this specific lower boundary:
When only there is a certain code word between this specific coboundary and this specific lower boundary, using this certain code word in this coding book as this target code word.
Method of the present invention, wherein includes with the step hunting out this target code word in one or more code word in this coding book with reference to this specific coboundary and this specific lower boundary:
When there is multiple certain code word between this specific coboundary and this specific lower boundary, binary search is carried out to find out this target code word to the plurality of certain code word.
Method of the present invention, is wherein divided into the plurality of code word group by the code word in this coding book, and the step of a coboundary and a lower boundary of defining each code word group includes:
For each code word in this coding book, calculate be positioned at a mark bit after and there is the continuous bit number of identical value to obtain one first count value with this mark bit, the code word wherein in same code word group has the first identical count value; And
Multiple first count values according to the code word in this coding book decide coboundary and the lower boundary of each code word group; And
Include with the step selecting this specific coboundary and this specific lower boundary in this auxiliary table of comparisons according to this coded data:
To calculate in this coded data after being positioned at a mark bit and to there is the continuous bit number of identical value to obtain one second count value with this mark bit; And
This specific coboundary corresponding to this second count value and this specific lower boundary is selected in this auxiliary table of comparisons.
Method of the present invention, is wherein divided into the plurality of code word group by the code word in this coding book, and the step of a coboundary and a lower boundary of defining each code word group includes:
For each code word in this coding book, calculate be positioned at a mark bit after and there is the continuous bit number of identical value to obtain one first count value with this mark bit, the code word wherein in same code word group has the first identical count value; And
Multiple first count values according to the code word in this coding book decide coboundary and the lower boundary of each code word group.
Method of the present invention, wherein includes the step that the code word in this coding book processes:
Process to obtain the one first auxiliary table of comparisons to the code word in this coding book, and process to obtain the one second auxiliary table of comparisons to the code word in this coding book and this first auxiliary table of comparisons; And
The step hunting out this corresponding decode value of this target code word in this coded data includes:
According to this coding book and this first, second auxiliary table of comparisons of being stored in this storage device to hunt out this decode value corresponding to this target code word in this coded data.
Method of the present invention, wherein includes the step that the code word in this coding book processes to obtain this first auxiliary table of comparisons:
Code word in this coding book is processed that the code word in coding book is divided into multiple first code word group, wherein the plurality of first code word group corresponds to multiple different code word size (codewordlength) respectively, and the code word in same first code word group all has identical code word size;
Set up this first auxiliary table of comparisons, one sequence number of the first code word group wherein in this first auxiliary this coding book of table of comparisons record belonging to each code word, separately record an initial code word of each the first code word group, the index value of each initial code word in coding book and the code word size of each the first code word group, the code word wherein in same first code word group all has identical sequence number.
Method of the present invention, wherein includes the code word in this coding book and this first step of assisting the table of comparisons to process to obtain this second auxiliary table of comparisons:
With reference to this first auxiliary table of comparisons, code word in this coding book is divided into multiple second code sub-block group, and define the up-and-down boundary of each second code sub-block group, wherein the up-and-down boundary of each second code sub-block group is respectively the up-and-down boundary of the sequence number of one or more the first code word group, and this one or more the first code word group has at least one identical code word with this second code sub-block group; The plurality of second code sub-block group corresponds to multiple different bit form (bit pattern) respectively, and the code word in same code word group all has the identical bit form of a part; And
Set up this second auxiliary table of comparisons, wherein a coboundary of this second auxiliary each second code sub-block group of table of comparisons record and a lower boundary.
Method of the present invention, wherein includes corresponding to the step of this decode value of this target code word in this coded data to hunt out according to this coding book and this first, second the auxiliary table of comparisons be stored in this storage device:
According to this coded data to select a specific coboundary and a specific lower boundary in this second auxiliary table of comparisons;
With reference to this specific coboundary and this specific lower boundary to hunt out the initial code word of a target in one or more initial code word in this first auxiliary table of comparisons; And
This target code word is corresponded to and this decode value be recorded on this coding book to export according to the initial code word of this target.
Method of the present invention, wherein corresponds to this target code word and the step being recorded in this decode value on this coding book includes according to the initial code word of this target to export:
According to the gap between this coded data and the initial code word of this target to obtain a deviant; And
According to an index value of the initial code word of this target and this deviant to search coding book, to obtain a Huffman value.
Method of the present invention, wherein with reference to this specific coboundary and this specific lower boundary to hunt out an initial code word to include as the step of the initial code word of this target in one or more initial code word in this first auxiliary table of comparisons:
When only there is a specified start code word between this specific coboundary and this specific lower boundary, using this specified start code word in this first auxiliary table of comparisons as the initial code word of this target.
Method of the present invention, wherein with reference to this specific coboundary and this specific lower boundary to hunt out an initial code word to include as the step of the initial code word of this target in one or more initial code word in this first auxiliary table of comparisons:
When there is this first auxiliary multiple specified start code word stored by the table of comparisons between this specific coboundary and this specific lower boundary, binary search is carried out to find out the initial code word of this target to the plurality of specified start code word.
Method of the present invention, wherein with reference to this first auxiliary table of comparisons, the code word in this coding book is divided into multiple second code sub-block group, and the step defining the up-and-down boundary of each second code sub-block group includes:
For each code word in this coding book, calculate be positioned at a mark bit after and there is the continuous bit number of identical value to obtain one first count value with this mark bit, the code word wherein in same second code sub-block group has the first identical count value; And
According to the sequence number of the first code word group belonging to multiple first count value of the code word in this coding book and each code word, to determine coboundary and the lower boundary of each second code sub-block group; And
Include with the step selecting this specific coboundary and this specific lower boundary in this second auxiliary table of comparisons according to this coded data:
To calculate in this coded data after being positioned at a mark bit and to there is the continuous bit number of identical value to obtain one second count value with this mark bit; And
This specific coboundary corresponding to this second count value and this specific lower boundary is selected in this second auxiliary table of comparisons.
Method of the present invention, wherein with reference to this first auxiliary table of comparisons, the code word in this coding book is divided into multiple second code sub-block group, and the step defining the up-and-down boundary of each second code sub-block group includes:
For each code word in this coding book, calculate be positioned at a mark bit after and there is the continuous bit number of identical value to obtain one first count value with this mark bit, the code word wherein in same second code sub-block group has the first identical count value; And
According to the sequence number of the first code word group belonging to multiple first count value of the code word in this coding book and each code word, to determine coboundary and the lower boundary of each second code sub-block group.
Method of the present invention, wherein this transport stream meets the advanced message coding of dynamic image expert group (Moving Picture Experts Group Advanced Audio Coding, MPEG AAC) or the specification of associating image expert group (Joint Photographic Experts Group, JPEG).
Implement Hofmann decoding method of the present invention, there is following beneficial effect: by using the auxiliary table of comparisons to decode, can search speed be accelerated and only need less storage space, therefore, Hofmann decoding method of the present invention can be efficiently used in most embedded systems.
Accompanying drawing explanation
Below in conjunction with drawings and Examples, the invention will be further described, in accompanying drawing:
Fig. 1 is the schematic diagram of the advanced message coding decoder according to one embodiment of the invention;
Fig. 2 is the schematic diagram of the associating image expert group decoder according to another embodiment of the present invention;
Fig. 3 is the Hofmann decoding method according to the present invention one first embodiment, and wherein this Hofmann decoding method is used for decoding to the coded data in a crossfire;
Fig. 4 is the schematic diagram according to comparison list in the Hofmann decoding method shown in Fig. 3;
Fig. 5 A, Fig. 5 B are for producing the detail flowchart of the auxiliary table of comparisons in the flow process shown in Fig. 3;
The auxiliary table of comparisons that Fig. 6 produces for the above-mentioned Fig. 5 A of use, Fig. 5 B is to search the detail flowchart of Huffman value;
Fig. 7 is the Hofmann decoding method according to the present invention one second embodiment, and wherein this Hofmann decoding method is used for decoding to the coded data in a crossfire;
Fig. 8 is the schematic diagram according to comparison list in the Hofmann decoding method shown in Fig. 7;
Fig. 9 is the detail flowchart setting up the first auxiliary table of comparisons, and this first auxiliary table of comparisons includes an Intermediate control table MI and three the sub-table of comparisons MC, BA, ML;
Figure 10 A, Figure 10 B are the detail flowchart that the table of comparisons is assisted in generation second.
[primary clustering symbol description]
Embodiment
Fig. 1 is the schematic diagram of advanced message coding (Advanced Audio Code, the AAC) decoder 100 according to one embodiment of the invention, and wherein decoder 100 can use hardware or software realizes.Decoder 100 includes the anti-format converter of a crossfire (stream deformattor) 101, Hofmann decoding module 102, variate-value group and calculates and inverse quantization (tuple calculation anddequantization) module 104, stereo processing module 106 and an inverse filtering module (inversefiltering) 108, wherein Hofmann decoding module 102 according to the Huffman table of comparisons 112 be stored in a storage device 110 and an auxiliary table of comparisons 114 to carry out decode operation.In the operation of decoder 100, after the anti-format converter of crossfire 101 obtains required bit in an advanced message coding crossfire, acquired bit is sent to message advanced in this and encodes the directly related decoder module (such as Hofmann decoding module 102, stereo processing module 106 and inverse filtering module 108) of crossfire.In addition, the Huffman table of comparisons 112 includes 11 predetermined sequence encodes books (codebook) and a scaling factor coding book, and the auxiliary table of comparisons 114 content derived by least one coding book in the Huffman table of comparisons 112.In addition, in Hofmann decoding module 102, many traditional coding/decoding methods, such as tree-shaped Mobile Method (tree traverse), can be used for decoding Huffman symbol; Calculate in variate-value group and in inverse quantization module 104, use decoded Huffman symbol to produce two or four variate-value groups, again inverse quantization operation is carried out to produced variate-value group afterwards; Then, stereo processing module 106 uses the single channel inverse quantization result that variate-value group calculates and inverse quantization module 104 produces to export to set up a binary channels; Finally, this double-channel exports and is converted to a time domain message output by inverse filtering module 108, and the output of this time domain message can be sent to a speaker system to play.
Fig. 2 is the schematic diagram of associating image expert group decoder 200 according to another embodiment of the present invention, and wherein decoder 200 can use hardware or software realizes.Decoder 200 includes the reception of the anti-format converter of a crossfire (stream deformattor) 201, Hofmann decoding module 202, and changes (inverse discrete cosine transform) module 208 with extension module 204, inverse quantization (dequantization) module 206 and an anti-discrete cosine, and wherein Hofmann decoding module 202 assists the table of comparisons 214 to carry out decode operation according to the Huffman table of comparisons 212 and be stored in a storage device 210.The function of the anti-format converter of crossfire 201 and Hofmann decoding module 202 is identical with the function of the anti-format converter of the crossfire shown in Fig. 1 101 and Hofmann decoding module 102, in addition, because the coding book of associating image expert group is not pre-set but is loaded in a transport stream, therefore the Huffman table of comparisons 212 is set up by a setting module (not illustrating).Using under the method described in associating image expert group standard, the coding book of associating image expert group has identical feature with the coding writing materials that advanced message is encoded, therefore, to encode these two kinds of specifications for associating image expert group and advanced message, Hofmann decoding module 202 can use identical coding/decoding method.Afterwards, the Huffman symbol that reception and extension module 204 use Hofmann decoding module 202 to decode to obtain multiple quantized value in JPEG crossfire, in addition, be similar to the Huffman table of comparisons and huffman coding book, JPEG quantizes the table of comparisons and is also loaded on JPEG crossfire, and needs to use setting module to analyze foundation out.Afterwards, the output of inverse quantization module 206 to reception and extension module 204 processes and produces frequency domain image block (frequency-domain image block), finally, frequency domain image block is converted to time domain image block (time-domain image block) by anti-discrete cosine modular converter 208.
Please refer to Fig. 3, Fig. 3 is the Hofmann decoding method according to the present invention one first embodiment, and the coded data that wherein this Hofmann decoding method is used in the crossfire that provides the anti-format converter 101,201 of crossfire is decoded.First, the Huffman table of comparisons 112 or 212 including at least one coding book is captured in this crossfire, and be stored in storage device 110 or 210, should be noted, in the present embodiment, all code words in the coding book of the Huffman table of comparisons 112 or 212 are 16 bits, and according to highest order unit (the Most-Significant Bit of those code words as shown in first three hurdle of Fig. 4, MSB) sort, and the code word after sequence is stored in the comparison list CW in storage device 110 or 210.Coding school bag shown in Fig. 4 contains the information such as Huffman value HV (Huffman value), code word size CL (code length), code word CW, mark bit (sign bit) and the first count value, should be noted, coding book shown in Fig. 4 is only an example and illustrates, and not as restriction of the present invention.Decoding process of the present invention is as described below:
In step 300, decoding task starts.Then, in step 302, code word in this coding book is divided into multiple code word group, and define the up-and-down boundary of each code word group, wherein the plurality of code word group corresponds to multiple different bit form (bit pattern) respectively, and the code word in same code word group all has the identical bit form of a part as shown in Figure 4.For example, code word in code word group 2 shown in Fig. 4 code word code word had in the identical bit form " 10 " of a part and code word group 6 had in the identical bit form " 001 " of a part, code word group 4 has the identical bit form " 1110 " of a part ... etc., therefore, the code word that each code word group comprises is comprise its up-and-down boundary and all code words between this up-and-down boundary.In addition, in the present embodiment, the highest order unit (MSB) of each code word in this coding book is regarded as a mark bit, and be calculated using as one first count value with the continuous bit number that this mark bit has an identical value after being positioned at this mark bit, and this first count value is used for identifying different bit forms, in other words, each code word in same code word group all has the first identical count value.For example, the first count value of the code word " 00110 " in code word group 2 is " 1 ", and the first count value of code word " 11101111 " in code word group 6 is " 2 ".
Then, in step 304, set up the auxiliary table of comparisons 114 or 214, and a coboundary of auxiliary each code word group of table of comparisons record and a lower boundary, in addition, in the present embodiment, the up-and-down boundary of each code word group decides according to the mark bit of code word in this coding book and the first count value.For example, for code word group 2, the auxiliary table of comparisons stores the information of a coboundary (corresponding to CW=0010) and a lower boundary (corresponding to CW=00111); And for code word group 4, the auxiliary table of comparisons stores the information of a coboundary (corresponding to CW=100000) and a lower boundary (corresponding to CW=101111).
In step 306, according to a coded data, a specific coboundary and a specific lower boundary are selected in the auxiliary table of comparisons.Specifically, Hofmann decoding module 102 or 202 receives this coded data from the anti-format converter 101 or 201 of crossfire, and determine which code word group is this coded data belong to, in addition, in the present embodiment, the highest order unit (MSB) of this coded data is regarded as a mark bit by Hofmann decoding module 102 or 202, and calculate be positioned at this mark bit after and the continuous bit number that there is identical value with this mark bit using as one second count value; Then, Hofmann decoding module 102 or 202 according to this second count value of this coded data and this mark bit of this coded data to determine which code word group is this coded data belong to.For example, if the second count value of this coded data is " 1 ", and mark bit is greater than " 0 ", then this coded data belongs to code word group 2, and the up-and-down boundary of code word group 2 is respectively as this specific coboundary and this specific lower boundary; If the second count value of this coded data is " 2 ", and mark bit is less than " 0 ", then this coded data belongs to code word group 6, and the up-and-down boundary of code word group 6 is respectively as this specific coboundary and this specific lower boundary.
Afterwards, in step 308, by reference to this specific coboundary and this specific lower boundary, search one or more code word in this coding book and go out to determine a target code word corresponding to this coded data.Especially, in the present embodiment, if only have a certain code word (the code word group 1 such as shown in Fig. 4) between this specific coboundary and this specific lower boundary, then this certain code word is namely as this target code word; If there is multiple certain code word (the code word group 2 ~ 7 such as shown in Fig. 4) between this specific coboundary and this specific lower boundary, binary search (binary search) then can be utilized to find out a certain code word using as this target code word in the plurality of certain code word, that is, via comparing in this coded data and this coding Shu Zhongyige code word group one or more certain code word to determine this target code word.
Finally, in the step 310, export to be recorded in this coding book and the Huffman value corresponding to this target code word using as a decoded data.For example, when this target code word is " 100000 ", then Huffman value " 12 " is exported; This target code word is " 11110000 ", then export Huffman value " 53 " using as decoded data.
Hofmann decoding method shown in Fig. 3, Fig. 4 has following advantage: when the Huffman value corresponding to this coded data needs to be obtained by searching, only need to search the single codeword group shown in Fig. 4, and pass through the second count value of this coded data, this coded data can be determined very efficiently and be positioned at which code word group.With all code word groups shown in known use Fig. 4 using compared with search area ground Hofmann decoding method, Hofmann decoding method of the present invention can save storage space, and accelerates the speed hunting out Huffman value.
Please refer to Fig. 5 A, Fig. 5 B, Fig. 5 A, Fig. 5 B is the detail flowchart producing auxiliary table of comparisons HT in the step 304 of Fig. 3.As shown in Fig. 5 A, Fig. 5 B, in step 500, operation starts.Afterwards, in the initialization procedure of step 501, a codewords indexes k and variable pl is reset to " 0 ", one function ' sc ' be used for calculating one encode be positioned at a mark bit in each code word in book after and with this mark bit, there is the continuous bit number of identical value, and produce one first count value according to this, and first count value of foundation one first code word CW [0] is to determine a variable ps, that is ps=sc (CW [0]), should be noted, in many flush bonding processors, function ' sc ' can utilize a single instruction to carry out implementation.In addition, a coding book length, that is the quantity of code word in this coding book, being stored is a n value, and a variable pff is set to " 1 ".
Above-mentioned flow process will process to produce auxiliary table of comparisons HT to each code word in this coding book, for each code word, in step 502, function ' sc ' first can carry out computing to produce one first count value s to this code word, afterwards, in step 503, check the mark bit (that is highest order unit of code word CW [k]) of code word, if code word CW [k] >=0, then flow process enters step 504 to judge the relation between ps and s, if ps equals s, (that is step 510 that the numerical value of this codewords indexes increases by 1, and judge whether at present handled code word is last code word (step 518) in this coding book k=k+1), if code word handled is not at present last code word in this coding book, flow process gets back to step 502 to obtain the first count value of next code word, if ps is not equal to s, an index value i of auxiliary table of comparisons HT is initialized to i=s+1 (step 505).Afterwards, in step 506 ~ 508, the value HT [2*i] in the auxiliary table of comparisons and HT [2*i+1] is set to pl and k respectively until index value i==ps; As index value i > ps, flow process enters step 509 and variable pl and ps is updated to pl=k and ps=s respectively.Then, increase the numerical value of codewords indexes k and judge whether code word handled is at present last code word (step 510 and 518) in this coding book.
If code word CW [k] < 0, whether judgment variable ppf equals 1 (step 511), if variable ppf equals 1, then the value of parameter ppf is eliminated, and index value i is initialized to s (step 514).Similar above-mentioned steps 506 ~ 508, the value HT [2*i] in auxiliary table of comparisons HT and HT [2*i+1] is set to pl and k respectively, and index value i increases until i==ps (step 515 ~ 517) in the circulating cycle gradually.After the circulation of index value i terminates (that is i > ps), the value of variable pl and ps is updated, and the value of codewords indexes k increases by 1 and judges whether k is less than n (step 510 and 518); Get back to step 511, if variable ppf is not equal to 1, whether judgment variable ps equals s (step 512), if variable ps is not equal to s, value HT=[2*ps+32] then in the auxiliary table of comparisons and HT [2*ps+33] is set to pl and k (step 513) respectively, then, the value of variable pl and ps is set to k and s (step 509) respectively, and the value of codewords indexes k increases by 1 and judges whether k is less than n (step 510 and 518).If variable ps equals s, then flow process enters step 510 increases by 1 by the value of codewords indexes k, and judges whether k is less than n (step 518).
After code words all in this coding book had carried out above-mentioned flow process all (that is codewords indexes k==n), index value i can be reset to ps (step 519).If index value i >=16, then enter the flow process that step 523 terminates to produce auxiliary table of comparisons HT; If index value i < 16, then continuing carry out step 520 ~ circulation of 522 is until index value i==16, in addition, in this circulation, the value HT=[2*i+32] in the auxiliary table of comparisons and HT [2*i+33] is set to pl and (pi+1) (step 521) respectively.
Please refer to Fig. 6, Fig. 6 is the detail flowchart searching Huffman value in step 306 ~ 310 of Fig. 3, wherein searches in the step of Huffman value and uses above-mentioned Fig. 5 A, auxiliary table of comparisons HT that Fig. 5 B produces.As shown in Figure 6, in step 600, operation starts.In step 601, the coded data of one 16 bits captures out in AAC or JPEG crossfire when not moving reading pointer, and the coded data of this 16 bit is set to an integer value x; Then, in step 602, the coded data of this 16 bit is considered as a signed integer (signed integer number), and have the continuous bit number of identical value to produce one second count value with this mark bit after using function ' sc ' to calculate in this 16 bit coded data to be positioned at a mark bit, and this second count value is stored in a variable s.Afterwards, in step 603, judge whether this 16 bit coded data x is less than 0: if this 16 bit coded data x is less than 0, then parameter (that is second count value) s needs to be updated to (s+16) (step 604), and the variable s after upgrading is at the index value of step afterwards as auxiliary table of comparisons HT; If 16 bit coded data x are not less than 0, then parameter (that is second count value) s is directly as the index value of auxiliary table of comparisons HT.Afterwards, in step 605, the value HT=[2*s] in auxiliary table of comparisons HT and HT [2*s+1] is captured and is stored respectively as variable bl and bh.
Afterwards, in step 606, an index value i is calculated according to formula i=(bh+bl) > > 1, wherein " > > " is a bit bit movement operator (bit shift operator), and above-mentioned formula is by the integer of bh and bl with to right translation 1 bit.This index value i is used as the index value of three necessary Hofmann decoding tables of comparisons, and these three Hofmann decoding tables of comparisons are respectively: code word table of comparisons CW, be used for storage one and encode the Huffman value table of comparisons HV shown in first three hurdle of the code word size table of comparisons CL and Fig. 4 of the bit number of all code words in book.Afterwards, in step 607, made comparisons in the difference (that is (bh-bl)) of variable bh and bl and " 1 ": if the difference of parameter bh and bl is greater than 1, then 16 bit coded data x and code word CW [i] are made comparisons (step 608), about step 608,16 bit coded data x and code word CW [i] now should be regarded as signless integer (unsigned integer number), if and x > CW [i], parameter bl is updated to bl=i (step 609); If x < CW [i], is updated to bh=i (step 611) by parameter bh, after more new variables bl or bh, decoding process is back to step 606; If x==CW [i], that is, find the codewords indexes that can be used for capturing Hofmann decoding result, therefore, flow process enters step 612 to obtain a code word size CL [i], afterwards in step 613, mobile index also returns a Huffman value HV [i] using as final decoded result.In addition, get back to describing of connection with step 607, if the difference of variable bh and bl is not more than 1, then current index value i is also found final index value, therefore, flow process can enter final step, that is step 612 ~ 613 are to obtain code word size CL [i], and mobile index return Huffman value HV [i].
Please refer to Fig. 7, Fig. 7 is the Hofmann decoding method according to the present invention one second embodiment, and the coded data that wherein this Hofmann decoding method is used in the crossfire that provides the anti-format converter 101,201 of crossfire is decoded.First, the Huffman table of comparisons 112 or 212 including at least one coding book is captured in this crossfire, and be stored in storage device 110 or 210, should be noted, in the present embodiment, all code words in the coding book of the Huffman table of comparisons 112 or 212 are 16 bits, and according to highest order unit (the Most-Significant Bit of those code words as shown in first three hurdle of Fig. 8, MSB) sort, the code word after sequence is stored in the comparison list CW in storage device 110 or 210.Coding school bag shown in Fig. 8 contains the information such as Huffman value HV (Huffman value), code word size CL (code length), code word CW, mark bit (sign bit) and the first count value, should be noted, coding book shown in Fig. 8 is only an example and illustrates, and not as restriction of the present invention.Decoding process of the present invention is as described below:
In step 700, decoding task starts.Afterwards, in step 702, the code word in this coding book is divided into multiple first code word group, wherein each first code word group corresponds to different code word sizes, and the code word in same first code word group all has identical code word size as shown in Figure 8.For example, as shown in Figure 8, the first code word group 3 includes multiple code words that code word size is 5, and the first code word group 4 includes multiple code words that code word size is 6.
Then, in step 704, set up the one first auxiliary table of comparisons, the wherein sequence number of this first auxiliary the first code word group belonging to each code word of table of comparisons record, wherein, code word in same first code word group all has identical sequence number, and in addition, this first auxiliary table of comparisons separately records an initial code word of each the first code word group, the index value of this initial code word in this coding book and the code word size of this first code word group.For example, the initial code word in the first code word group 3 is " 00110 ", and sequence number is 2.
Then, in step 706, with reference to this first auxiliary table of comparisons, code word in this coding book is divided into multiple second code sub-block group, and define the up-and-down boundary of each second code sub-block group, wherein the up-and-down boundary of each second code sub-block group is respectively the up-and-down boundary of the sequence number of one or more the first code word group, wherein, the plurality of second code sub-block group corresponds to multiple different bit form (bit pattern) respectively, and the code word in same code word group all has the identical bit form of a part as shown in Figure 8.For example, the code word code word had in the identical bit form " 01 " of a part and code word group 5 had in the identical bit form " 001 " of a part, code word group 3 of the code word in the code word group 2 shown in Fig. 8 has the identical bit form " 110 " of a part ... etc.In addition, in the present embodiment, the highest order unit (MSB) of each code word in coding book is regarded as a mark bit, and be calculated using as one first count value with the continuous bit number that this mark bit has an identical value after being positioned at this mark bit, and this first count value is used for identifying different bit forms, in other words, each code word in same second code sub-block group all has the first identical count value.
Then, in step 708, set up the one second auxiliary table of comparisons, and a coboundary of this second auxiliary each second code sub-block group of table of comparisons record and a lower boundary, in addition, in the present embodiment, the up-and-down boundary of each second code sub-block group decides according to the first count value of code word in this coding book.In addition, which the first code word group is the code word in this second auxiliary each second code sub-block group of table of comparisons record be positioned at, and for example, code word " 01000 " ~ " 01100 " is positioned at second code sub-block group 3, and is also positioned at the first code word group 3; Code word " 011010 " ~ " 011111 " is positioned at second code sub-block group 3, and is also positioned at the first code word group 4.Therefore, this second auxiliary table of comparisons record second code sub-block group 3 is associated with the first code word group 3 and 4, and this second auxiliary table of comparisons also records the initial code word (that is, the initial code word " 00110 " of the first code word group 3 and the initial code word " 011010 " of the first code word group 4) of the first code word group be associated.On the implementation, this second auxiliary table of comparisons record second code sub-block group 3 is associated with the first code word group sequence number 2 and 3 (corresponding respectively to the first code word group 3 and 4), in other words, in the present embodiment, because the up-and-down boundary of each second code sub-block group is respectively the up-and-down boundary of the sequence number of one or more the first code word group, therefore, the coboundary of second code sub-block group 3 is the sequence number 2 (having initial code word " 00110 ") of the first code word group 3, and lower boundary is the sequence number 3 (having initial code word " 011010 ") of the first code word group 4.
In step 710, according to a coded data, in this second auxiliary table of comparisons, select a specific coboundary and a specific lower boundary.Specifically, Hofmann decoding module 102 or 202 receives this coded data from the anti-format converter 101 or 201 of crossfire, and determine which second code sub-block group is this coded data belong to, in addition, in the present embodiment, the highest order unit (MSB) of this coded data is regarded as a mark bit by Hofmann decoding module 102 or 202, and calculate be positioned at this mark bit after and the continuous bit number that there is identical value with this mark bit using as one second count value, then, Hofmann decoding module 102 or 202 according to this second count value of this coded data and this mark bit of this coded data to determine which second code sub-block group is this coded data belong to, and in this second auxiliary table of comparisons, select a specific coboundary and a specific lower boundary according to this.The detailed class of operation of step 710 is similar to step 306, therefore, illustrates in this omission.
Then, in step 712, by reference to this specific coboundary and this specific lower boundary, one or more initial code word is searched in this first auxiliary table of comparisons to determine the initial code word of a target.Especially, in the present embodiment, if only have a specified start code word (the second code sub-block group 1 such as shown in Fig. 8) between this specific coboundary and this specific lower boundary, then this specified start code word is namely as the initial code word of this target; If there is multiple specified start code word (the second code sub-block group 3 ~ 5 such as shown in Fig. 8) between this specific coboundary and this specific lower boundary, binary search (binary search) then can be utilized to find out a specified start code word using as the initial code word of this target in the plurality of specified start code word, in the present embodiment, because the specified start code number of words of comparison needed for this coded data is little, therefore binary search institute's time spent significantly can be shortened.For example, as shown in Figure 8, suppose that the up-and-down boundary of second code sub-block group 3 is respectively as this specific coboundary and this specific lower boundary, then because this specific coboundary and this specific lower boundary be respectively two initial code words in the first auxiliary table of comparisons (that is, the initial code word CW=00110 of the first code word group 3 and initial code word CW=011010 of the first code word group 4), then after, these two initial code word searches are determined which initial code word is for the initial code word of target.For example, suppose that this coded data is for " 011111 ", the initial code word of the target gone out to be then necessary in the multiple initial code word of this first auxiliary table of comparisons closest to this coded data and to be less than the initial code word (that is, the initial code word CW=011010 of the first code word group 4) of this coded data; Lift another example, suppose that this coded data is for " 01100 ", then the initial code word of the target gone out selected by is the initial code word CW=00110 of the first code word group 3.
Afterwards, in step 714, according to the gap between this coded data and the initial code word of this target to obtain a deviant (offset value), the step wherein obtaining this deviant can in describing in detail afterwards.Finally, in step 716, according to an index value of the initial code word of this target and this deviant to search coding book, to obtain a Huffman value.
Please refer to Fig. 9, Fig. 9 is the detail flowchart setting up the first auxiliary table of comparisons.This first auxiliary table of comparisons includes an Intermediate control table MI and three the sub-table of comparisons MC, BA, ML, MI [i] is its corresponding sequence number to one first code word group of code word in a coding book, MC [i] is an initial code word of the first code word group, BA [i] is the index value of initial code word in coding book, and ML [i] is the code word size of the first code word group.As shown in Figure 9, in step 900, operation starts.Afterwards, in step 901, first variable k, i, pl are initialized to " 0 ", and the coding book length quantity of code word (that is in this coding book) to be stored be a n value.Then, in step 902, whether judgment variable k (now as codewords indexes) is less than coding book length n, if variable k is not less than coding book length n, then flow process enters step 910 and terminates to set up the step of this first auxiliary table of comparisons; If variable k is less than coding book length n, then enters step 903 to determine code word size CL [k], and CL [k] is saved as a m value.Then, in step 904, comparison code word length m and variable pl, if variable pl equals code word size m, then flow process enters step 908 to be set to (i-1) by MI [k]; If variable pl is not equal to code word size m, then flow process enters step 905 to upgrade three sub-tables of comparisons (MC [i]=CW [k], BA [i]=k, ML [i]=CL [k]) respectively.Afterwards, in step 906 and 907, variable pl is set as code word size m, and index value i is updated to (i+1).After the content of updated variable and the sub-table of comparisons (step 905 ~ 907), flow process enters step 908 to be set to (i-1) by MI [k].Finally, in step 909, the value of variable k is increased " 1 " (that is k=k+1), and flow process gets back to step 902 afterwards.
Please refer to Figure 10 A, Figure 10 B, Figure 10 A, Figure 10 B is the detail flowchart that table of comparisons HT is assisted in generation second.Flow process in flow process in Figure 10 A, Figure 10 B and Fig. 5 A, Fig. 5 B is similar, and the essential difference of Fig. 5 and Figure 10 is: the Intermediate control table MI produced in the flow process shown in Fig. 9 is used to set the second auxiliary table of comparisons HT that the flow process shown in Figure 10 produces.In step 1000, operation starts.Then, in step 1001, variable pl and codewords indexes k is initialized to " 0 ", and variable ppf is set to " 1 ", in addition, variable ps is initialized to one first count value of code word CW [0], and the coding book length quantity of code word (that is in this coding book) to be stored be a n value, wherein first count value of code word CW [0] be positioned at a mark bit in code word CW [0] after and with this mark bit, there is the continuous bit number of identical value.
In step 1002, utilize function ' sc ' to calculate the first count value of each code word, and the first calculated count value is stored in a variable s.Then, in step 1003, judge code word CW [k] (now, code word CW [k] is regarded as one 16 bit signed integers (signed integernumber)) whether be less than 0, if CW [k] >=0 and ps==s (step 1004), then the numerical value of codewords indexes k increases " 1 " (that is step 1010, k=k+1) and judges whether all processed (step 1018); If CW [k] >=0 and ps unequal to s, flow process enters step 2005 a variable i to be initialized to (s+1).Afterwards, in step 1006, the value HT [2*i] in the second auxiliary table of comparisons and HT [2*i+1] is set to MI [pl] and MI [k]+1 respectively.Then, in step 1007 and 1008, the numerical value of variable i increases by 1 and whether judgment variable i is less than or equal to variable ps, if I is <=ps, flow process gets back to step 1006; If i > is ps, then flow process enters step 1009 so that variable pl and ps is set as k and s respectively.
Then, if CW [k] < 0 and ppf==1 (step 1011), then flow process enters step 1014 variable ppf is set as 0 and variable i is set as s.Then, in step 1015, the value HT [2*i] in the second auxiliary table of comparisons and HT [2*i+1] is set to MI [pl] and MI [k]+1 respectively.Then, in step 1016 and 1017, the numerical value of variable i increases by 1, and variable i and variable ps is made comparisons, if i is <=ps, then flow process gets back to step 1015; If i > is ps, then flow process enters step 1009 so that variable pl and ps is set as k and s respectively.In addition, if CW [k] < 0 and ppf unequal to 1, then flow process enters step 1012 and whether is not equal to variable s with judgment variable ps, if ps is not equal to s, then flow process enters step 1013 and 1009 so that the value HT [2*ps+32] in the second auxiliary table of comparisons and HT [2*ps+33] is set to MI [pl] and MI [k]+1 respectively, and variable pl and ps is set as k and s respectively.If judge that ps equals s in step 1012, then flow process enters step 1010 so that the numerical value of codewords indexes k is increased by 1.
Afterwards, flow process enters step 1018 to judge whether that all code words are all processed, if not flow process gets back to step 1002; Otherwise if all code words are all processed, then flow process enters step 1019 variable i to be set as the value of variable ps.Then, in step 1020, whether judgment variable i is less than 16, if variable i is not less than 16, then enters step 1023 to terminate the flow process that this sets up the second auxiliary table of comparisons; If variable i is less than 16, then flow process enters step 1021 so that the value HT [2*i+32] in the second auxiliary table of comparisons and HT [2*i+33] is set to MI [pl] and MI [pl]+1 respectively.Afterwards, in step 1022, the numerical value of variable i is increased by 1, and flow process gets back to step 1020.That the flow process shown in Figure 10 exports is the second auxiliary table of comparisons HT, and the second auxiliary table of comparisons HT is used for decoding Huffman value together with three the sub-table of comparisons MC, BA, ML in this first auxiliary table of comparisons.
Below the detailed process searching Huffman value in step 710 ~ 716 of Fig. 7 is set forth, wherein search three the sub-table of comparisons MC, BA, ML in the first auxiliary table of comparisons using above-mentioned Fig. 9 to produce in the step of Huffman value, and the second auxiliary table of comparisons that Figure 10 A, Figure 10 B produce.Idiographic flow is as follows:
First decoding task starts.
Then, the coded data of one 16 bits captures out in AAC or JPEG crossfire when not moving reading pointer, and the coded data of this 16 bit is set to an integer value x.
Then, the coded data of this 16 bit is considered as a signed integer (signed integernumber), and have the continuous bit number of identical value to produce one second count value with this mark bit after using function ' sc ' to calculate in this 16 bit coded data to be positioned at a mark bit, and this second count value is stored in a variable s.
Then, judge whether x is less than 0: if x is less than 0, then parameter s is updated to (s+16), and auxiliary second assists the value HT [2*s] in the table of comparisons and HT [2*s+1] captured and be stored respectively as variable bl and bh.
Then, calculate an index value i according to formula i=(bh+bl) > > 1, wherein " > > " is a bit bit movement operator (bit shift operator).
Then, the difference (that is (bh-bl)) and 1 of variable bh and bl is made comparisons, there are two kinds of situations:
The first, if the difference of variable bh and bl is greater than 1, comparison variable x and code word MC [i], the signless integer (unsigned integer number) produced in the flow process that wherein MC [i] is Fig. 9, if x > MC [i], be then set to i by variable bl; If x is not more than MC [i], then judges whether x equals MC [i], if x is not equal to MC [i], then variable bh is set to i.After having upgraded variable bl or bh, flow process has been back to above-mentioned " calculating an index value i according to formula i=(bh+bl) > > 1 ".In addition, if x==MX [i], then by (x-MC [i]) to the right bit move (16-ML [i]) bit to produce a variable off, wherein MC [i] is a code word, and the code word size that ML [i] is this code word MC [i], in other words, that is calculate a binary difference (binary difference) of this coded data and the initial code word of this target, and by this binary difference (that is (x-MC [i])) to the right bit move (16-ML [i]) bit to produce variable off.Then, according to formula ii=BA [i]+off to calculate an index value ii, the index value of the initial code word produced in the flow process that wherein BA [i] is Fig. 9 in coding book.Finally, index bit moved ML [i] and obtain a Huffman value HV [ii] using as decoded result, terminating decoding process afterwards.
The second, if the difference of variable bh and bl is not more than 1, identical with the flow process performed time x==MX [i], namely, by (x-MC [i]) to the right bit move (16-ML [i]) bit to produce a variable off, wherein MC [i] is a code word, and the code word size that ML [i] is this code word MC [i], in other words, that is calculate a binary difference (binary difference) of this coded data and the initial code word of this target, and by this binary difference (that is (x-MC [i])) to the right bit move (16-ML [i]) bit to produce variable off.Then, according to formula ii=BA [i]+off to calculate an index value ii, the index value of the initial code word produced in the flow process that wherein BA [i] is Fig. 9 in coding book.Finally, index bit moved ML [i] and obtain a Huffman value HV [ii] using as decoded result, terminating decoding process afterwards.
In addition, in the jpeg decoder 200 shown in the AAC decoder 100 shown in Fig. 1 and Fig. 2, the Huffman table of comparisons 112,212 and the auxiliary table of comparisons 114,214 are stored in identical storage device 110,210, but, in other embodiments of the invention, the Huffman table of comparisons and the auxiliary table of comparisons can build in different storage devices respectively, and the change in this design should be under the jurisdiction of category of the present invention.
Should be noted, Hofmann decoding method shown in Fig. 3 and Fig. 7 is applied in the AAC decoder 100 shown in Fig. 1 and the jpeg decoder shown in Fig. 2 200, but, in other embodiments of the invention, Hofmann decoding method of the present invention also can be applicable to other needs to use in the decoding device of Hofmann decoding.
Brief summary the present invention, the method being used for carrying out the coded data in a transport stream Hofmann decoding of the present invention includes: process to produce at least one auxiliary table of comparisons to the code word in a coding book, and each produced auxiliary table of comparisons is stored in a storage device, wherein this coding book taken out in this transport stream; And according to this coding book and at least this auxiliary table of comparisons of being stored in this storage device, to hunt out the corresponding decode value of a target code word in this coded data.By using the auxiliary table of comparisons to decode, can accelerate search speed and only need less storage space, therefore, Hofmann decoding method of the present invention can be efficiently used in most embedded systems.
The foregoing is only preferred embodiment of the present invention, all equalizations done according to the present patent application the scope of the claims change and modify, and all should belong to covering scope of the present invention.
Claims (13)
1. be used for carrying out the coded data in a transport stream method for Hofmann decoding, it is characterized in that, include:
Process to produce at least one auxiliary table of comparisons to the code word in a coding book, and be stored in a storage device by each produced auxiliary table of comparisons, wherein this coding book is by a predetermined coding book or taken out in this transport stream; And
According to this coding book and at least this auxiliary table of comparisons of being stored in this storage device, to hunt out a corresponding decode value of a target code word in this coded data;
Wherein the step that the code word in this coding book processes is included:
Code word in this coding book is divided into multiple code word group, and define a coboundary and a lower boundary of each code word group, wherein the plurality of code word group corresponds to multiple different bit form respectively, and the code word in same code word group all has the identical bit form of a part; And
Set up this auxiliary table of comparisons, wherein a coboundary of this auxiliary each code word group of table of comparisons record and a lower boundary;
The step wherein hunting out this corresponding decode value of this target code word includes:
According to this coded data to select a specific coboundary and a specific lower boundary in this auxiliary table of comparisons;
With reference to this specific coboundary and this specific lower boundary to hunt out this target code word in one or more code word in this coding book; And
Export and correspond to this target code word and this decode value be recorded on this coding book;
Wherein the code word in this coding book is divided into the plurality of code word group, and the step of a coboundary and a lower boundary of defining each code word group includes:
For each code word in this coding book, calculate be positioned at a mark bit after and there is the continuous bit number of identical value to obtain one first count value with this mark bit, the code word wherein in same code word group has the first identical count value; And
Multiple first count values according to the code word in this coding book decide coboundary and the lower boundary of each code word group; And
Include with the step selecting this specific coboundary and this specific lower boundary in this auxiliary table of comparisons according to this coded data:
To calculate in this coded data after being positioned at a mark bit and to there is the continuous bit number of identical value to obtain one second count value with this mark bit; And
This specific coboundary corresponding to this second count value and this specific lower boundary is selected in this auxiliary table of comparisons.
2. method according to claim 1, is characterized in that, wherein includes with the step hunting out this target code word in one or more code word in this coding book with reference to this specific coboundary and this specific lower boundary:
When only there is a certain code word between this specific coboundary and this specific lower boundary, using this certain code word in this coding book as this target code word.
3. method according to claim 1, is characterized in that, wherein includes with the step hunting out this target code word in one or more code word in this coding book with reference to this specific coboundary and this specific lower boundary:
When there is multiple certain code word between this specific coboundary and this specific lower boundary, binary search is carried out to find out this target code word to the plurality of certain code word.
4. method according to claim 1, is characterized in that, wherein includes the step that the code word in this coding book processes:
Process to obtain the one first auxiliary table of comparisons to the code word in this coding book, and process to obtain the one second auxiliary table of comparisons to the code word in this coding book and this first auxiliary table of comparisons; And
The step hunting out this corresponding decode value of this target code word in this coded data includes:
According to this coding book and this first, second auxiliary table of comparisons of being stored in this storage device to hunt out this decode value corresponding to this target code word in this coded data.
5. method according to claim 4, is characterized in that, wherein includes the step that the code word in this coding book processes to obtain this first auxiliary table of comparisons:
Code word in this coding book is processed that the code word in coding book is divided into multiple first code word group, wherein the plurality of first code word group corresponds to multiple different code word size respectively, and the code word in same first code word group all has identical code word size;
Set up this first auxiliary table of comparisons, one sequence number of the first code word group wherein in this first auxiliary this coding book of table of comparisons record belonging to each code word, separately record an initial code word of each the first code word group, the index value of each initial code word in coding book and the code word size of each the first code word group, the code word wherein in same first code word group all has identical sequence number.
6. method according to claim 5, is characterized in that, wherein includes the code word in this coding book and this first step of assisting the table of comparisons to process to obtain this second auxiliary table of comparisons:
With reference to this first auxiliary table of comparisons, code word in this coding book is divided into multiple second code sub-block group, and define the up-and-down boundary of each second code sub-block group, wherein the up-and-down boundary of each second code sub-block group is respectively the up-and-down boundary of the sequence number of one or more the first code word group, and this one or more the first code word group has at least one identical code word with this second code sub-block group; The plurality of second code sub-block group corresponds to multiple different bit form respectively, and the code word in same code word group all has the identical bit form of a part; And
Set up this second auxiliary table of comparisons, wherein a coboundary of this second auxiliary each second code sub-block group of table of comparisons record and a lower boundary.
7. method according to claim 6, is characterized in that, wherein includes corresponding to the step of this decode value of this target code word in this coded data to hunt out according to this coding book and this first, second the auxiliary table of comparisons be stored in this storage device:
According to this coded data to select a specific coboundary and a specific lower boundary in this second auxiliary table of comparisons;
With reference to this specific coboundary and this specific lower boundary to hunt out the initial code word of a target in one or more initial code word in this first auxiliary table of comparisons; And
This target code word is corresponded to and this decode value be recorded on this coding book to export according to the initial code word of this target.
8. method according to claim 7, is characterized in that, wherein corresponds to this target code word and the step being recorded in this decode value on this coding book includes according to the initial code word of this target to export:
According to the gap between this coded data and the initial code word of this target to obtain a deviant; And
According to an index value of the initial code word of this target and this deviant to search coding book, to obtain a Huffman value.
9. method according to claim 8, it is characterized in that, wherein with reference to this specific coboundary and this specific lower boundary to hunt out an initial code word to include as the step of the initial code word of this target in one or more initial code word in this first auxiliary table of comparisons:
When only there is a specified start code word between this specific coboundary and this specific lower boundary, using this specified start code word in this first auxiliary table of comparisons as the initial code word of this target.
10. method according to claim 7, it is characterized in that, wherein with reference to this specific coboundary and this specific lower boundary to hunt out an initial code word to include as the step of the initial code word of this target in one or more initial code word in this first auxiliary table of comparisons:
When there is this first auxiliary multiple specified start code word stored by the table of comparisons between this specific coboundary and this specific lower boundary, binary search is carried out to find out the initial code word of this target to the plurality of specified start code word.
11. methods according to claim 7, is characterized in that, wherein with reference to this first auxiliary table of comparisons, the code word in this coding book is divided into multiple second code sub-block group, and the step defining the up-and-down boundary of each second code sub-block group include:
For each code word in this coding book, calculate be positioned at a mark bit after and there is the continuous bit number of identical value to obtain one first count value with this mark bit, the code word wherein in same second code sub-block group has the first identical count value; And
According to the sequence number of the first code word group belonging to multiple first count value of the code word in this coding book and each code word, to determine coboundary and the lower boundary of each second code sub-block group; And
Include with the step selecting this specific coboundary and this specific lower boundary in this second auxiliary table of comparisons according to this coded data:
To calculate in this coded data after being positioned at a mark bit and to there is the continuous bit number of identical value to obtain one second count value with this mark bit; And
This specific coboundary corresponding to this second count value and this specific lower boundary is selected in this second auxiliary table of comparisons.
12. methods according to claim 6, is characterized in that, wherein with reference to this first auxiliary table of comparisons, the code word in this coding book is divided into multiple second code sub-block group, and the step defining the up-and-down boundary of each second code sub-block group include:
For each code word in this coding book, calculate be positioned at a mark bit after and there is the continuous bit number of identical value to obtain one first count value with this mark bit, the code word wherein in same second code sub-block group has the first identical count value; And
According to the sequence number of the first code word group belonging to multiple first count value of the code word in this coding book and each code word, to determine coboundary and the lower boundary of each second code sub-block group.
13. methods according to claim 1, is characterized in that, wherein this transport stream meets the advanced message coding of dynamic image expert group or the specification of associating image expert group.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010151333.6A CN102237878B (en) | 2010-04-20 | 2010-04-20 | A kind of Hofmann decoding method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010151333.6A CN102237878B (en) | 2010-04-20 | 2010-04-20 | A kind of Hofmann decoding method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102237878A CN102237878A (en) | 2011-11-09 |
CN102237878B true CN102237878B (en) | 2015-09-02 |
Family
ID=44888174
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010151333.6A Active CN102237878B (en) | 2010-04-20 | 2010-04-20 | A kind of Hofmann decoding method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102237878B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU7024694A (en) * | 1994-08-12 | 1996-02-22 | Canon Kabushiki Kaisha | Data encoding and decoding apparatus and method |
CN1547805A (en) * | 2000-10-31 | 2004-11-17 | ض� | Method of performing huffman decoding |
CN1613188A (en) * | 2001-10-19 | 2005-05-04 | 诺基亚公司 | Huffman coding |
CN101325418A (en) * | 2008-08-05 | 2008-12-17 | 北京海尔集成电路设计有限公司 | Haffman quick decoding method based on probability table look-up |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6891976B2 (en) * | 2002-03-12 | 2005-05-10 | Intel Corporation | Method to decode variable length codes with regular bit pattern prefixes |
-
2010
- 2010-04-20 CN CN201010151333.6A patent/CN102237878B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU7024694A (en) * | 1994-08-12 | 1996-02-22 | Canon Kabushiki Kaisha | Data encoding and decoding apparatus and method |
CN1547805A (en) * | 2000-10-31 | 2004-11-17 | ض� | Method of performing huffman decoding |
CN1613188A (en) * | 2001-10-19 | 2005-05-04 | 诺基亚公司 | Huffman coding |
CN101325418A (en) * | 2008-08-05 | 2008-12-17 | 北京海尔集成电路设计有限公司 | Haffman quick decoding method based on probability table look-up |
Also Published As
Publication number | Publication date |
---|---|
CN102237878A (en) | 2011-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103067022B (en) | A kind of integer data lossless compression method, decompression method and device | |
US9729169B2 (en) | Methods and devices for source-coding and decoding of data involving symbol compression | |
TWI431948B (en) | Efficient coding and decoding of transform blocks | |
CN101599768B (en) | Cabac encoder and cabac encoding method | |
CN105379283A (en) | Data encoding and decoding | |
CN103782597A (en) | Method and apparatus for coding video and method and apparatus for decoding video accompanied with arithmetic coding | |
TW201545485A (en) | Method and apparatus for pyramid vector quantization indexing and de-indexing of audio/video sample vectors | |
CN102668560B (en) | Embedded graphics coding: reordered bitstream for parallel decoding | |
CN104125475B (en) | Multi-dimensional quantum data compressing and uncompressing method and apparatus | |
TWI429205B (en) | Huffman decoding method | |
CN113271467B (en) | Ultra-high-definition video layered coding and decoding method supporting efficient editing | |
CN1452397A (en) | Frame compression using radix approximation or differential code and escape code | |
CN102238376B (en) | Image processing system and method | |
WO2019018030A1 (en) | Structured record compression and retrieval | |
US9948928B2 (en) | Method and apparatus for encoding an image | |
CN102237878B (en) | A kind of Hofmann decoding method | |
CN103139566A (en) | Method for efficient decoding of variable length codes | |
CN100551066C (en) | The implementation method of encoder and adaptive arithmetic code and device | |
CN1681326A (en) | High-speed image compression apparatus using last non-zero detection circuit | |
CN112885364B (en) | Audio encoding method and decoding method, audio encoding device and decoding device | |
CN101064844A (en) | Method for performing matching compression to image using rotary compressed codebook | |
CN111008301B (en) | Method for searching video by using graph | |
Chang et al. | Very efficient variable-length codes for the lossless compression of VQ indices | |
Mohamed | Wireless Communication Systems: Compression and Decompression Algorithms | |
CN102572425A (en) | Huffman decoding method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |