CN106533628A - Huffman parallel decoding method and apparatus thereof - Google Patents

Huffman parallel decoding method and apparatus thereof Download PDF

Info

Publication number
CN106533628A
CN106533628A CN201611082839.XA CN201611082839A CN106533628A CN 106533628 A CN106533628 A CN 106533628A CN 201611082839 A CN201611082839 A CN 201611082839A CN 106533628 A CN106533628 A CN 106533628A
Authority
CN
China
Prior art keywords
decoded
code
binary
bit stream
character
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.)
Granted
Application number
CN201611082839.XA
Other languages
Chinese (zh)
Other versions
CN106533628B (en
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201611082839.XA priority Critical patent/CN106533628B/en
Publication of CN106533628A publication Critical patent/CN106533628A/en
Application granted granted Critical
Publication of CN106533628B publication Critical patent/CN106533628B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/24Testing correct operation
    • H04L1/245Testing correct operation by using the properties of transmission codes
    • H04L1/246Testing correct operation by using the properties of transmission codes two-level transmission codes, e.g. binary

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention discloses a Huffman parallel decoding method and an apparatus thereof. The Huffman parallel decoding method includes the steps of sequentially reading a plurality of binary code groups from bit stream to be decoded, respectively conducting Huffman decoding for each set of binary code groups to obtained decoded result corresponding to binary codes on the bit stream to be decoded, wherein the decoded result including decoding characters and decoding length which is number of binary codes corresponding to the decoding characters in a preset Huffman code list, filtering ineffective matching positions on the bit stream to be decoded according to preset rules and the corresponding decoding length of each binary code on the bit stream to be decoded to obtain effective matching positions, and sequentially reading the decoding characters on each effective matching position to obtain the final decoding result. The read efficiency is high, ineffective matching positions can be filtered, and the merging efficiency is high. The decoding efficiency can be improved, and the decoding speed is rapid.

Description

A kind of Huffman parallel decoding method and its device
Technical field
The present invention relates to coding and decoding technical field, more particularly to a kind of Huffman parallel decoding method and its device.
Background technology
Currently, as the Internet, Internet of Things are developed rapidly, data file scale is increasing.For saving carrying cost, Each data center is compressed out to data.Substantial amounts of data compression takes higher cpu resource, not only reduces service Device performance, and server energy consumption is improved, increased energy cost.
At present, frequently with Hafman decoding method in data compression.Huffman (Huffman) coding is that a kind of concordance is compiled Code method (also known as " entropy code method "), for the lossless compression of data.It is set up according to the probability that each character occurs Coding schedule, the high character of probability of occurrence use shorter coding, on the contrary probability of occurrence it is low then use longer coding so that compile The average expectation length of the character string after code is reduced, so as to reach the purpose of lossless compress data.As Huffman encoding is one Kind of variable-length encoding, each character code indefinite length, therefore during Hafman decoding can only serial perform, it is impossible to it is enough in advance by ratio to be decoded The binary system sequence that special stream is divided into length-specific in advance is processed again, and in decoding process, is first to read a binary system Code, after comparing with Huffman code table, then reads next binary code, until the match is successful with Huffman code table, efficiency is low, solution Code speed is slow.
Therefore, how to provide a kind of high Huffman parallel decoding method of decoding efficiency and its device is people in the art Member needs the problem for solving at present.
The content of the invention
It is an object of the invention to provide a kind of Huffman parallel decoding method and its device, reading efficiency height, can unify Invalid matched position is filtered, combined efficiency is high, and then can improve decoding efficiency, and decoding speed is fast.
For solving above-mentioned technical problem, the invention provides a kind of Huffman parallel decoding method, including:
Some groups of binary system code characters are successively read from bit stream to be decoded;
Hafman decoding is carried out to every group of binary system code character successively respectively, the binary system on the bit stream to be decoded is obtained The corresponding decoded result of code, the decoded result include decoding character and decoded length, and the decoded length is the decoded word Accord with the number of the corresponding binary code in default Huffman code table;
According to the corresponding decoded length of each binary code on the bit stream to be decoded, filter described according to preset rules Invalid matched position on bit stream to be decoded, obtains being effectively matched position;
It is successively read described in each and is effectively matched corresponding decoding character at position, obtains final decoded result.
Preferably, the process for being successively read some groups of binary system code characters from bit stream to be decoded is specially:
Some groups of binary system code characters are successively read from the bit stream to be decoded, and in addition to last group, per group includes L Binary code, L >=m+n-1;Numbers of the m for decoder, n is the most long codes length of the Huffman code table;Make the reading M positions are moved after original position, as new reading original position, repeat read operation;
Accordingly, it is described that Hafman decoding is carried out to every group of binary system code character successively respectively, obtain the bit to be decoded The process of the corresponding decoded result of binary code on stream is specially:
The m decoder carries out Hafman decoding to binary system code character per group described respectively successively;Wherein, i-th institute State decoder and Hafman decoding is proceeded by from the i-th bit of the binary system code character, obtain at the i-th bit of the binary system code character Decoded result;1≤i≤m and i are positive integer.
Preferably, the process for being successively read some groups of binary system code characters from bit stream to be decoded is specially:
Each binary code on the bit stream to be decoded is successively read into n positions two as original position is read respectively Ary codes, obtain some groups of binary code single groups, successively by the continuous binary code of the predetermined number corresponding binary code Single group constitutes a binary system code character.
Preferably, it is described that Hafman decoding is carried out to every group of binary system code character successively respectively, obtain the bit to be decoded The process of the corresponding decoded result of binary code on stream is specially:
The first binary code from binary code single group each described proceeds by Hafman decoding respectively, obtains per group of institute State in binary system code character, the corresponding decoded result of the first binary code of each binary code single group.
Preferably, the Huffman code table is normal form Huffman code table, described successively every group of binary system code character to be entered respectively Row Hafman decoding, the process for obtaining the corresponding decoded result of binary code on the bit stream to be decoded are specially:
To zero padding on the right side of the binary system code character less than n positions, n positions binary system code character is extended for;
By zero padding on the right side of the corresponding coding of each character in the Huffman code table, n positions coding is extended for
The numerical value encoded after calculating each expansion, and the coding of several codings of original coding length identical is recorded respectively Minima in numerical value, obtains k minima as threshold value, k≤n;
Calculate the numerical value D of per group of binary system code character;By D respectively according to order from small to large and the k threshold value It is compared, if D is less than the threshold value for currently comparing, record comparative result is 0, conversely, record comparative result is 1, and will be compared Relatively result is ranked up from left to right according to the priority of comparative sequence, obtains k bitmasks;If k<N, then adjust according to preset rules For n bitmasks;
Make the binary system code character carry out and operation with n bitmasks step-by-step, obtain n positions result code, calculate the n positions The numerical value I of result code;The corresponding decoded result of the first binary code of the binary system code character is obtained according to I.
Preferably, it is described according to the corresponding decoded length of each binary code on the bit stream to be decoded, according to default Invalid matched position on bit stream to be decoded described in rule-based filtering, the process for obtaining being effectively matched position are specially:
Obtain on the bit stream to be decoded after the corresponding decoded result of whole binary code, by the bit stream to be decoded Second as matched position;
Judge that the previous position binary code corresponding decoded length L [i-1] of the matched position, whether more than 1, if so, makes Matched position corresponding decoded length L [i]=L [i-1] -1, and using the next bit of current matching position as new matching Position;The above-mentioned judgement operation of repetition;Until the corresponding decoded length of whole binary codes on the bit stream to be decoded is adjusted It is whole to finish;
The corresponding decoded length of each binary code in addition to first on the bit stream to be decoded is judged respectively Whether less than the corresponding decoded length of itself previous position binary code, if being less than, itself corresponding decoded length is made to be 0;Until The corresponding decoded length of whole binary codes on the bit stream to be decoded is adjusted and is finished;Wherein, the bit to be decoded On stream corresponding decoded length for 0 binary code for being effectively matched position.
Preferably, it is described according to the corresponding decoded length of each binary code on the bit stream to be decoded, according to default Invalid matched position on bit stream to be decoded described in rule-based filtering, the process for obtaining being effectively matched position are specially:
Step s1031:After obtaining the decoded result of one group of binary system code character on the bit stream to be decoded, by described two In system code character, position is set to 0 less than the corresponding matching length of binary code of Current standards position;
Step s1032:Using the binary code at the Current standards position as matched position, the matching is judged Whether the previous position binary code corresponding decoded length L [i-1] of position is more than 1, if so, makes the corresponding solution of the matched position Code length L [i]=L [i-1] -1, and using the next bit of current matching position as new matched position;The above-mentioned judgement behaviour of repetition Make;Up in the binary system code character, corresponding decoded length is adjusted and is finished;
Step s1033:Matching from the binary system code character has in the binary code of decoded result, is judged except first respectively The corresponding decoded length of each binary code beyond position whether less than the corresponding decoded length of itself previous position binary code, If being less than, itself corresponding decoded length is made to be 0;Up in the binary system code character, corresponding decoded length is adjusted and is finished; Wherein, in the binary system code character corresponding decoded length for 0 binary code for being effectively matched position;
Step s1034:Matching in the binary system code character is made to have last effective in the binary code of decoded result After with position decoded length summation corresponding with itself, deducting matching in the binary system code character has the binary code of decoded result Total number, obtain the Current standards position of next group of binary system code character, return to step s1031, until obtain described to be decoded The whole of bit stream is effectively matched position.
For solving above-mentioned technical problem, present invention also offers a kind of Huffman apparatus for parallel decoding, including:
Read module, for being successively read some groups of binary system code characters from bit stream to be decoded;
Decoder module, for carrying out Hafman decoding to every group of binary system code character successively respectively, obtains the ratio to be decoded The corresponding decoded result of binary code on special stream, the decoded result include decoding character and decoded length, the solution code length Spend the number for decoding character corresponding binary code in the default Huffman code table;
Invalid filtering module, for according to the corresponding decoded length of each binary code on the bit stream to be decoded, pressing The invalid matched position on the bit stream to be decoded is filtered according to preset rules, obtains being effectively matched position;
Merging module, is effectively matched corresponding decoding character at position for being successively read described in each, obtains last solution Code result.
The invention provides a kind of Huffman parallel decoding method and its device, read one every time from bit stream to be decoded Group binary system code character, after decoding to each group Huffman code character, obtains corresponding with the binary code on bit stream to be decoded Decoded result, removes the invalid matched position on bit stream to be decoded, i.e., at these positions, corresponding decoded result is invalid, and then The decoded result being effectively matched at position is merged and obtains final decoded result.I.e. the present invention adopts when reading and with group is Unit is read out, rather than only reads a binary code every time, and reading efficiency is high, also, the present invention is to obtain part It is after the corresponding decoded result of binary code, unified to filter invalid matched position so that finally carry out decoded word meet and when, adopt Be the mode that merges parallel, i.e., directly can read each decoding character being effectively matched at position parallel, combined efficiency is high.Can See, the present invention improves decoding efficiency, decoding speed is fast.
Description of the drawings
For the technical scheme being illustrated more clearly that in the embodiment of the present invention, below will be to institute in prior art and embodiment The accompanying drawing that needs are used is briefly described, it should be apparent that, drawings in the following description are only some enforcements of the present invention Example, for those of ordinary skill in the art, on the premise of not paying creative work, can be being obtained according to these accompanying drawings Obtain other accompanying drawings.
A kind of flow chart of the process of Huffman parallel decoding method that Fig. 1 is provided for the present invention;
The flow chart of the process of another kind of Huffman parallel decoding method that Fig. 2 is provided for the present invention;
The flow chart of the process of another kind of Huffman parallel decoding method that Fig. 3 is provided for the present invention;
A kind of structural representation of Huffman apparatus for parallel decoding that Fig. 4 is provided for the present invention.
Specific embodiment
The core of the present invention is to provide a kind of Huffman parallel decoding method and its device, and reading efficiency is high, can unify Invalid matched position is filtered, combined efficiency is high, and then can improve decoding efficiency, and decoding speed is fast.
For making purpose, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is The a part of embodiment of the present invention, rather than the embodiment of whole.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Embodiment one
The invention provides a kind of Huffman parallel decoding method, shown in Figure 1, one kind that Fig. 1 is provided for the present invention The flow chart of the process of Huffman parallel decoding method;The method includes:
Step s101:Some groups of binary system code characters are successively read from bit stream to be decoded;
Step s102:Hafman decoding is carried out to every group of binary system code character successively respectively, is obtained on bit stream to be decoded The corresponding decoded result of binary code, decoded result include decoding character and decoded length, and decoded length is decoding character pre- If Huffman code table in corresponding binary code number;
Step s103:According to the corresponding decoded length of each binary code on bit stream to be decoded, according to preset rules mistake The invalid matched position on bit stream to be decoded is filtered, obtains being effectively matched position;
Step s104:It is successively read each and is effectively matched corresponding decoding character at position, obtains final decoded result.
The invention provides a kind of Huffman parallel decoding method, one group of binary system is read every time from bit stream to be decoded Code character, after decoding to each group Huffman code character, obtains decoded result corresponding with the binary code on bit stream to be decoded, Remove corresponding decoded result at the invalid matched position on bit stream to be decoded, i.e. these positions invalid, and then by effective Merge with the decoded result at position and obtain final decoded result.I.e. the present invention is adopted when reading and is carried out in units of group Read, rather than only read a binary code every time, reading efficiency is high, also, the present invention is to obtain partial binary code It is after corresponding decoded result, unified to filter invalid matched position so that finally carry out decoded word meet and when, use parallel Merging mode, i.e., directly can read each decoding character being effectively matched at position parallel, and combined efficiency is high.It can be seen that, this Bright to improve decoding efficiency, decoding speed is fast.
Embodiment two
On the basis of embodiment one, present invention also offers another kind of Huffman parallel decoding method.
Wherein, the process of step s101 is specially:
Some groups of binary system code characters are successively read from bit stream to be decoded, and in addition to last group, per group is entered including L two Code processed, L >=m+n-1;Numbers of the m for decoder, most long codes length of the n for Huffman code table;Make the reading original position M positions are moved afterwards, as new reading original position, repeat read operation;
Accordingly, the process of step s102 is specially:
M decoder carries out Hafman decoding to every group of binary system code character respectively successively;Wherein, i-th decoder is from two The i-th bit of system code character proceeds by Hafman decoding, obtains the decoded result at the i-th bit of binary system code character;1≤i≤m and I is positive integer.
It is understood that due to the characteristics of Hafman decoding serial is decoded, needing every time first to complete decoding, just can determine that The next one starts the position for decoding, therefore can only carry out decoding speed every time to a character slowly, and efficiency is low;By m decoder Respectively from every group of binary system code character before m positions binary code decoded, can obtain on bit stream to be decoded with each two Then ary codes remove wherein invalid decoding knot by step s103 again as the decoded result obtained after original position decoding Really, you can obtain final decoding character.That is the present embodiment, can every time to m binary code by the way of parallel decoding Decoded, obtain multiple decoding characters, substantially increase decoding speed and efficiency.
Also, binary system code character is successively read from bit stream to be decoded during the reading process of the present embodiment, i.e., often read Continue to read next group after complete one group;And be successively each group binary system code character to be decoded in decoding process respectively, then Operation is merged according to decoded result, final decoded result is obtained.It can be seen that, realize line production, reading process and decoding Process is non-interference, can carry out side by side simultaneously, compares the serial behaviour for being read next time after the completion of being only capable of at present decoding again Make, decoding speed is greatly improved.
Further, since m decoder need respectively from every group of binary system code character before m positions binary code decoded, therefore In order to ensure last decoder also can normal work, therefore every group of binary system code character can not only include m positions, but will add n- 1 because the most long codes length needed for decoding is n, therefore plus last decoder to decoding original position Binary code, last decoder can have n positions binary code to carry out decoding operate for which.Wherein, m should be not less than 1, m and n Size be determined on a case-by-case basis.
Certainly, the present invention does not limit the concrete number of m and n, can be set according to actual needs.
In addition, can be carrying out the nothing of step s103 after often obtaining the decoded result of a binary system code character in step s102 Effect filter operation, it is also possible to carry out step s103 after obtaining whole decoded results again, the present invention is not construed as limiting to this.
Embodiment three
On the basis of embodiment one, present invention also offers another kind of Huffman parallel decoding method.
Wherein, the process of step s101 is specially:
Each binary code on bit stream to be decoded is successively read into n positions binary system as original position is read respectively Code, obtains some groups of binary code single groups, constitutes the continuous binary code of predetermined number corresponding binary code single group successively One binary system code character.
Wherein, predetermined number here is generally higher than 1, now includes multiple binary code single groups in binary system code character, can Respectively each binary code single group is decoded by the decoder of predetermined number, obtain the decoding knot of each binary code single group Really, so as to realize the purpose of parallel decoding, improve decoding speed.
Certainly, predetermined number can also be 1, and now every time a binary code single group is decoded.
Which kind of specifically it is not especially limited using the mode present invention.
In addition, when treating decoding bit stream and being read out, a binary system code character can be read every time, it is also possible to direct one After secondary property obtains whole binary system code characters, step s102 is entered back into, is specifically not construed as limiting using which kind of mode present invention.
Further, can be carrying out step s103 after often obtaining the decoded result of a binary system code character in step s102 Invalid filter operation, it is also possible to carry out step s103 after obtaining whole decoded results again, the present invention is not construed as limiting to this.
Accordingly, the process of step s102 is specially:
Hafman decoding is proceeded by from the first binary code of each binary code single group respectively, every group of binary system is obtained In code character, the corresponding decoded result of the first binary code of each binary code single group.
In addition, if Huffman code table is normal form Huffman code table, the process of step s102 is specially:
Step s1021:To zero padding on the right side of the binary system code character less than n positions, n positions binary system code character is extended for;
Step s1022:By zero padding on the right side of the corresponding coding of each character in Huffman code table, n positions coding is extended for;
Step s1023:Calculate the numerical value that encodes after each expansion, and record respectively original coding length identical several Minima in the encoding value of coding, obtains k minima as threshold value, k≤n;
Step s1024:Calculate the numerical value D of every group of binary system code character;By D respectively according to order from small to large and k threshold Value is compared, if D is less than the threshold value for currently comparing, record comparative result is 0, conversely, record comparative result is 1, and will Comparative result is ranked up from left to right according to the priority of comparative sequence, obtains k bitmasks;If k<N, then adjust according to preset rules It is whole for n bitmasks;
Step s1025:Make binary system code character carry out and operation with the step-by-step of n bitmasks, obtain n positions result code, calculate n positions knot The numerical value I of fruit code;The corresponding decoded result of the first binary code of binary system code character is obtained according to I.
Wherein, a kind of instantiation is these are only, the priority between step s1021 and step s1022 and step s1023 is suitable Sequence is the present invention be not construed as limiting.
In addition, the present invention does not limit step s102, and specifically using more than, which kind of embodiment is realized.
Example IV
On the basis of embodiment two or three, present invention also offers another kind of Huffman parallel decoding method.
Wherein, the process of step s103 is specially:
Step s1031:Obtain on bit stream to be decoded after the corresponding decoded result of whole binary code, by bit to be decoded The second of stream is used as matched position;
Because first corresponding decoded result of bit stream to be decoded necessarily will not when it is invalid, therefore from the beginning of second Judge.
Step s1032:Whether the previous position binary code corresponding decoded length L [i-1] of matched position is judged more than 1, If so, make matched position corresponding decoded length L [i]=L [i-1] -1, and using the next bit of current matching position as new Matched position;The above-mentioned judgement operation of repetition;Until the corresponding decoded length of whole binary codes on bit stream to be decoded is adjusted It is whole to finish;
For example, the decoded length of the previous position of matched position is 4, then the purpose of aforesaid operations, is by correspondence decoded length 3/2/1 is adjusted to for the corresponding decoded length of triad code after 4 binary code.
Step s1033:The corresponding solution of each binary code in addition to first on bit stream to be decoded is judged respectively Whether code length makes itself corresponding decoded length be less than the corresponding decoded length of itself previous position binary code if being less than 0;Until the corresponding decoded length of whole binary codes on bit stream to be decoded is adjusted and is finished;Wherein, bit stream to be decoded It is to be effectively matched position that upper corresponding decoded length is not 0 binary code.
For example, decoded length is adjusted to the tetrad code after 4/3/2/1, by it is above-mentioned compare adjustment after, be changed into 4/ 0/0/0, so when correspondence decoded length be 4 binary code effectively, and triad code thereafter is invalid.
It is understood that decoded length is 4 solutions for showing that the binary code is obtained after decoding as decoding original position Code character is corresponding to be encoded to 4, therefore corresponds to binary code and triad code thereafter that decoded length is 4, common group Into the coding of the corresponding decoding character of binary code that correspondence decoded length is 4, therefore the decoded result of triad code thereafter Should not read.
It is shown in Figure 2, the flow chart of the process of another kind of Huffman parallel decoding method that Fig. 2 is provided for the present invention.
Embodiment five
On the basis of embodiment two or three, present invention also offers another kind of Huffman parallel decoding method.
Wherein, the process of step s103 is specially:
Step s1031:After obtaining the decoded result of one group of binary system code character on bit stream to be decoded, by binary system code character Interior position is set to 0 less than the corresponding matching length of binary code of Current standards position;
When step s103 is carried out after the decoded result for often obtaining one group of binary system code character, need to arrange Current standards position Put.It should be noted that the decoded result of one group of binary system code character now can not only include a decoded result.
Step s1032:Using the binary code at Current standards position as matched position, before judging matched position Whether one binary code corresponding decoded length L [i-1] is more than 1, if so, make matched position corresponding decoded length L [i]= L [i-1] -1, and using the next bit of current matching position as new matched position;The above-mentioned judgement operation of repetition;Until binary system In code character, corresponding decoded length is adjusted and is finished;
Step s1033:Matching from binary system code character has in the binary code of decoded result, respectively judge except first with The corresponding decoded length of each outer binary code whether less than the corresponding decoded length of itself previous position binary code, if little In, make itself corresponding decoded length be 0;Up in binary system code character, corresponding decoded length is adjusted and is finished;Wherein, two enter In code character processed corresponding decoded length for 0 binary code for being effectively matched position;
Wherein, under the operation of embodiment two, the binary code that matching has decoded result in binary system code character is only front m Position;Under the operation of embodiment three, the binary code that matching has decoded result in binary system code character is each binary code single group First place.
Step s1034:In making the interior matching of binary system code character have the binary code of decoded result, last is effectively matched position After putting decoded length summation corresponding with itself, deducting matching in binary system code character has total of binary code of decoded result Number, obtains the Current standards position of next group of binary system code character, return to step s1031, until obtaining the complete of bit stream to be decoded Portion is effectively matched position.
For example, it is 8 that last is effectively matched position, and the decoded length on the position is 4, then be 12 after suing for peace, if often The total number that matching has the binary code of decoded result in individual binary system code character is 8, then Current standards position is 4, due to each Binary system code character order be successively read, therefore show in this case first 3 in the binary system code character of next group of reading with Binary code on the 8th in upper one group of binary system code character constitutes a decoding and encodes, therefore this 3 nothings in this binary system code character Effect, matched position should be from the beginning of the 4th.Therefore need position in binary system code character is less than the binary code pair of Current standards position The matching length answered is set to 0.
It is shown in Figure 3, the flow chart of the process of another kind of Huffman parallel decoding method that Fig. 3 is provided for the present invention.
Present invention also offers a kind of Huffman apparatus for parallel decoding, shown in Figure 3, Fig. 4 provide for the present invention one Plant the structural representation of Huffman apparatus for parallel decoding.The device includes:
Read module 1, for being successively read some groups of binary system code characters from bit stream to be decoded;
Decoder module 2, for carrying out Hafman decoding to every group of binary system code character successively respectively, obtains bit stream to be decoded On the corresponding decoded result of binary code, decoded result includes decoding character and decoded length, and decoded length is decoding character The number of corresponding binary code in the default Huffman code table;
Invalid filtering module 3, for according to the corresponding decoded length of each binary code on bit stream to be decoded, according to pre- If the invalid matched position on rule-based filtering bit stream to be decoded, obtains being effectively matched position;
Merging module 4, is effectively matched corresponding decoding character at position for being successively read each, obtains final decoding knot Really.
The invention provides a kind of Huffman apparatus for parallel decoding, one group of binary system is read every time from bit stream to be decoded Code character, after decoding to each group Huffman code character, obtains decoded result corresponding with the binary code on bit stream to be decoded, Remove corresponding decoded result at the invalid matched position on bit stream to be decoded, i.e. these positions invalid, and then by effective Merge with the decoded result at position and obtain final decoded result.I.e. the present invention is adopted when reading and is carried out in units of group Read, rather than only read a binary code every time, reading efficiency is high, also, the present invention is to obtain partial binary code It is after corresponding decoded result, unified to filter invalid matched position so that finally carry out decoded word meet and when, use parallel Merging mode, i.e., directly can read each decoding character being effectively matched at position parallel, and combined efficiency is high.It can be seen that, this Bright to improve decoding efficiency, decoding speed is fast.
In this specification, each embodiment is described by the way of progressive, and what each embodiment was stressed is and other The difference of embodiment, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment For, as which corresponds to the method disclosed in Example, so description is fairly simple, related part is said referring to method part It is bright.
Also, it should be noted that in this manual, such as first and second or the like relational terms be used merely to by One entity or operation are made a distinction with another entity or operation, and are not necessarily required or implied these entities or operation Between there is any this actual relation or order.And, term " including ", "comprising" or its any other variant are anticipated Covering including for nonexcludability, so that a series of process, method, article or equipment including key elements not only includes that A little key elements, but also including other key elements being not expressly set out, or also include for this process, method, article or The intrinsic key element of equipment.In the absence of more restrictions, the key element for being limited by sentence "including a ...", does not arrange Except also there is other identical element in including the process of the key element, method, article or equipment.
The foregoing description of the disclosed embodiments, enables professional and technical personnel in the field to realize or using the present invention. Various modifications to these embodiments will be apparent for those skilled in the art, as defined herein General Principle can be realized without departing from the spirit or scope of the present invention in other embodiments.Therefore, the present invention The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one The most wide scope for causing.

Claims (8)

1. a kind of Huffman parallel decoding method, it is characterised in that include:
Some groups of binary system code characters are successively read from bit stream to be decoded;
Hafman decoding is carried out to every group of binary system code character successively respectively, the binary code pair on the bit stream to be decoded is obtained The decoded result answered, the decoded result include decoding character and decoded length, and the decoded length exists for the decoding character The number of corresponding binary code in default Huffman code table;
According to the corresponding decoded length of each binary code on the bit stream to be decoded, according to preset rules filter described in wait to solve Invalid matched position on code bit stream, obtains being effectively matched position;
It is successively read described in each and is effectively matched corresponding decoding character at position, obtains final decoded result.
2. method according to claim 1, it is characterised in that described to be successively read some groups two from bit stream to be decoded The process of system code character is specially:
Some groups of binary system code characters are successively read from the bit stream to be decoded, and in addition to last group, per group is entered including L two Code processed, L >=m+n-1;Numbers of the m for decoder, n is the most long codes length of the Huffman code table;Make the reading starting M positions are moved behind position, as new reading original position, repeat read operation;
Accordingly, it is described that Hafman decoding is carried out to every group of binary system code character successively respectively, obtain on the bit stream to be decoded The process of the corresponding decoded result of binary code be specially:
The m decoder carries out Hafman decoding to binary system code character per group described respectively successively;Wherein, solve described in i-th Code device proceeds by Hafman decoding from the i-th bit of the binary system code character, obtains the solution at the i-th bit of the binary system code character Code result;1≤i≤m and i are positive integer.
3. method according to claim 1, it is characterised in that described to be successively read some groups two from bit stream to be decoded The process of system code character is specially:
Each binary code on the bit stream to be decoded is successively read into n positions binary system as original position is read respectively Code, obtains some groups of binary code single groups, successively by the continuous binary code of the predetermined number corresponding binary code single group One binary system code character of composition.
4. method according to claim 3, it is characterised in that described that Hough is carried out to every group of binary system code character successively respectively Graceful decoding, the process for obtaining the corresponding decoded result of binary code on the bit stream to be decoded are specially:
The first binary code from binary code single group each described proceeds by Hafman decoding respectively, obtains per group described two In system code character, the corresponding decoded result of the first binary code of each binary code single group.
5. method according to claim 3, it is characterised in that the Huffman code table is normal form Huffman code table, described Hafman decoding is carried out to every group of binary system code character successively respectively, the binary code obtained on the bit stream to be decoded is corresponding The process of decoded result is specially:
To zero padding on the right side of the binary system code character less than n positions, n positions binary system code character is extended for;
By zero padding on the right side of the corresponding coding of each character in the Huffman code table, n positions coding is extended for
The numerical value encoded after calculating each expansion, and the encoding value of several codings of original coding length identical is recorded respectively In minima, obtain k minima as threshold value, k≤n;
Calculate the numerical value D of per group of binary system code character;D is carried out with the k threshold value according to order from small to large respectively Relatively, if D is less than the threshold value for currently comparing, record comparative result is 0, conversely, record comparative result is 1, and will compare knot Fruit is ranked up from left to right according to the priority of comparative sequence, obtains k bitmasks;If k<N, then be adjusted to n according to preset rules Bitmask;
Make the binary system code character carry out and operation with n bitmasks step-by-step, obtain n positions result code, calculate n positions result The numerical value I of code;The corresponding decoded result of the first binary code of the binary system code character is obtained according to I.
6. the method according to any one of claim 2-5, it is characterised in that described according to each on the bit stream to be decoded The corresponding decoded length of individual binary code, filters the invalid matched position on the bit stream to be decoded according to preset rules, obtains It is specially to the process for being effectively matched position:
After obtaining on the bit stream to be decoded the corresponding decoded result of whole binary codes, by the of the bit stream to be decoded Two used as matched position;
Judge that the previous position binary code corresponding decoded length L [i-1] of the matched position makes described whether more than 1, if so, Matched position corresponding decoded length L [i]=L [i-1] -1, and using the next bit of current matching position as new match bit Put;The above-mentioned judgement operation of repetition;Until the corresponding decoded length of whole binary codes on the bit stream to be decoded is adjusted Finish;
Judge the corresponding decoded length of each binary code on the bit stream to be decoded in addition to first whether respectively Less than the corresponding decoded length of itself previous position binary code, if being less than, itself corresponding decoded length is made to be 0;Until described The corresponding decoded length of whole binary codes on bit stream to be decoded is adjusted and is finished;Wherein, on the bit stream to be decoded It is to be effectively matched position that corresponding decoded length is not 0 binary code.
7. the method according to any one of claim 2-5, it is characterised in that described according to each on the bit stream to be decoded The corresponding decoded length of individual binary code, filters the invalid matched position on the bit stream to be decoded according to preset rules, obtains It is specially to the process for being effectively matched position:
Step s1031:After obtaining the decoded result of one group of binary system code character on the bit stream to be decoded, by the binary system In code character, position is set to 0 less than the corresponding matching length of binary code of Current standards position;
Step s1032:Using the binary code at the Current standards position as matched position, the matched position is judged Previous position binary code corresponding decoded length L [i-1] whether be more than 1, if so, make the corresponding solution code length of the matched position Degree L [i]=L [i-1] -1, and using the next bit of current matching position as new matched position;The above-mentioned judgement operation of repetition;Directly To the binary system code character, corresponding decoded length is adjusted and is finished;
Step s1033:Matching from the binary system code character has in the binary code of decoded result, respectively judge except first with The corresponding decoded length of each outer binary code whether less than the corresponding decoded length of itself previous position binary code, if little In, make itself corresponding decoded length be 0;Up in the binary system code character, corresponding decoded length is adjusted and is finished;Wherein, In the binary system code character corresponding decoded length for 0 binary code for being effectively matched position;
Step s1034:In making the interior matching of the binary system code character have the binary code of decoded result, last is effectively matched position After putting the summation of corresponding with itself decoded length, deduct matching in the binary system code character have decoded result binary code it is total Number, obtains the Current standards position of next group of binary system code character, return to step s1031, until obtaining the bit to be decoded The whole of stream is effectively matched position.
8. a kind of Huffman apparatus for parallel decoding, it is characterised in that include:
Read module, for being successively read some groups of binary system code characters from bit stream to be decoded;
Decoder module, for carrying out Hafman decoding to every group of binary system code character successively respectively, obtains the bit stream to be decoded On the corresponding decoded result of binary code, the decoded result includes decoding character and decoded length, and the decoded length is The number of decoding character corresponding binary code in the default Huffman code table;
Invalid filtering module, for according to the corresponding decoded length of each binary code on the bit stream to be decoded, according to pre- If the invalid matched position on bit stream to be decoded described in rule-based filtering, obtains being effectively matched position;
Merging module, is effectively matched corresponding decoding character at position for being successively read described in each, obtains final decoding knot Really.
CN201611082839.XA 2016-11-30 2016-11-30 A kind of Huffman parallel decoding method and device thereof Active CN106533628B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611082839.XA CN106533628B (en) 2016-11-30 2016-11-30 A kind of Huffman parallel decoding method and device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611082839.XA CN106533628B (en) 2016-11-30 2016-11-30 A kind of Huffman parallel decoding method and device thereof

Publications (2)

Publication Number Publication Date
CN106533628A true CN106533628A (en) 2017-03-22
CN106533628B CN106533628B (en) 2019-10-18

Family

ID=58355284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611082839.XA Active CN106533628B (en) 2016-11-30 2016-11-30 A kind of Huffman parallel decoding method and device thereof

Country Status (1)

Country Link
CN (1) CN106533628B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970007A (en) * 2020-08-13 2020-11-20 山东云海国创云计算装备产业创新中心有限公司 Decoding method, decoder, device and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0812496B1 (en) * 1995-12-28 2001-10-17 Koninklijke Philips Electronics N.V. Variable length decoder
US20040190635A1 (en) * 2003-03-28 2004-09-30 Ruehle Michael D. Parallelized dynamic Huffman decoder
CN1889366A (en) * 2006-07-13 2007-01-03 浙江大学 Hafman decoding method
CN102244518A (en) * 2010-05-10 2011-11-16 百度在线网络技术(北京)有限公司 System and method for realizing parallel decompression of hardware
US20140375482A1 (en) * 2013-06-20 2014-12-25 International Business Machines Corporation High throughput decoding of variable length data symbols
CN104980161A (en) * 2015-04-02 2015-10-14 深圳市腾讯计算机系统有限公司 Huffman decoding method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0812496B1 (en) * 1995-12-28 2001-10-17 Koninklijke Philips Electronics N.V. Variable length decoder
US20040190635A1 (en) * 2003-03-28 2004-09-30 Ruehle Michael D. Parallelized dynamic Huffman decoder
CN1889366A (en) * 2006-07-13 2007-01-03 浙江大学 Hafman decoding method
CN102244518A (en) * 2010-05-10 2011-11-16 百度在线网络技术(北京)有限公司 System and method for realizing parallel decompression of hardware
US20140375482A1 (en) * 2013-06-20 2014-12-25 International Business Machines Corporation High throughput decoding of variable length data symbols
CN104980161A (en) * 2015-04-02 2015-10-14 深圳市腾讯计算机系统有限公司 Huffman decoding method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970007A (en) * 2020-08-13 2020-11-20 山东云海国创云计算装备产业创新中心有限公司 Decoding method, decoder, device and medium
CN111970007B (en) * 2020-08-13 2022-03-22 山东云海国创云计算装备产业创新中心有限公司 Decoding method, decoder, device and medium

Also Published As

Publication number Publication date
CN106533628B (en) 2019-10-18

Similar Documents

Publication Publication Date Title
CN100525450C (en) Method and device for realizing Hoffman decodeng
CN116303374B (en) Multi-dimensional report data optimization compression method based on SQL database
CN103067022A (en) Nondestructive compressing method, uncompressing method, compressing device and uncompressing device for integer data
CN116016606B (en) Sewage treatment operation and maintenance data efficient management system based on intelligent cloud
US20170331492A1 (en) Data Processing Method and Device
CN101017574A (en) Huffman decoding method suitable for JPEG code stream
CN110518917A (en) LZW data compression method and system based on Huffman coding
CN115269526A (en) Method and system for processing semiconductor production data
CN113630125A (en) Data compression method, data encoding method, data decompression method, data encoding device, data decompression device, electronic equipment and storage medium
JP5913748B2 (en) Secure and lossless data compression
CN107565974A (en) A kind of parallel full coding implementation method of static Huffman
CN106533628A (en) Huffman parallel decoding method and apparatus thereof
CN104052749B (en) A kind of method of link layer protocol data type identification
CN110073604A (en) For the multiple-symbol of hardware decompression engine, multi-format, paralleled code element decoder
CN115865099B (en) Huffman coding-based multi-type data segment compression method and system
CN103746704A (en) Chip testing data transmission method based on dual-run-length alternative coding
CN100581258C (en) Hoffman decoding method and Hoffman decoding device
CN103024380B (en) A kind of entropy coding method of data and device
CN106559085A (en) A kind of normal form Hafman decoding method and its device
CN105844214B (en) A kind of information fingerprint extracting method of the multipath depth coding based on bit space
CN108829930A (en) The light weight method of three-dimensional digital technological design MBD model
CN106788451A (en) A kind of Hafman decoding method and its device
CN114759929A (en) Compression method and device for time sequence data of Internet of vehicles and electronic equipment
CN113839678A (en) Huffman decoding system, method, equipment and computer readable storage medium
CN105099571B (en) A kind of audio communication method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant