CN102545910B - A kind of jpeg huffman decoding circuit and coding/decoding method thereof - Google Patents

A kind of jpeg huffman decoding circuit and coding/decoding method thereof Download PDF

Info

Publication number
CN102545910B
CN102545910B CN201010618002.9A CN201010618002A CN102545910B CN 102545910 B CN102545910 B CN 102545910B CN 201010618002 A CN201010618002 A CN 201010618002A CN 102545910 B CN102545910 B CN 102545910B
Authority
CN
China
Prior art keywords
code word
huffman
length
minimum
input
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
Application number
CN201010618002.9A
Other languages
Chinese (zh)
Other versions
CN102545910A (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.)
CRM ICBG Wuxi Co Ltd
Original Assignee
Wuxi China Resources Semico 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 Wuxi China Resources Semico Co Ltd filed Critical Wuxi China Resources Semico Co Ltd
Priority to CN201010618002.9A priority Critical patent/CN102545910B/en
Publication of CN102545910A publication Critical patent/CN102545910A/en
Application granted granted Critical
Publication of CN102545910B publication Critical patent/CN102545910B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention discloses a kind of jpeg huffman decoding circuit and coding/decoding method thereof, and at jpeg file head Huffman mark decode phase, comprise the steps: that step 1. sets up Huffman minimum code word table according to the Huffman code word number under different length, in described minimum code word table, the bit wide of 16 code words is respectively 1,2,3,4,5,6,7,8,8,8,8,8,8,8,8,8; Step 2. sets up Huffman minimum code word address table according to the Huffman code word number under different length; Step 3. is according to 16 parallel comparative results being less than comparator, and calculate the length of current Huffman code word, and obtain Run-Length Coding value according to minimum code word address table and calculate decoded data, wherein 16 bit wides being less than comparator are 1 respectively, 2,3,4,5,6,7,8,8,8,8,8,8,8,8,8.<pb pnum="1" />

Description

A kind of jpeg huffman decoding circuit and coding/decoding method thereof
Technical field
The present invention relates to a kind of jpeg huffman decoding circuit and coding/decoding method thereof.
Background technology
Huffman coding is a kind of conventional lossless compressiong based on probability statistics, it is encoded by the code word that longer bit is higher to probability of occurrence, the code word lower to probability of occurrence with shorter bit is encoded, thus reaches the compression ratio of closely theoretical limit.
Traditional Hofmann decoding is normally realized by successive appraximation, first the method needs to reconstruct huffman code table for decoding according to coded message, this code table needs to take larger memory space, and in Joint Photographic Experts Group, the typical code table length of example is about 4Kbit.Secondly, adopt the method for successive appraximation usually to need multiple clock cycle to decode a code word, this method greatly limit decode rate.
With the patent application that the immediate prior art of the present invention is publication number CN 101017574A, which disclose a kind of Hofmann decoding method being suitable for JPEG code stream, the method sets up minimum code word table and minimum code word address table according to the code word number in JPEG code stream, then in the Hofmann decoding stage, input code flow and minimum code word table are carried out parallel comparison, decode the address of current Huffman code word after obtaining code word size again according to minimum code word address table, finally obtain corresponding Huffman code word.
But because in JPEG code stream, Huffman code word length the longest is 16, minimum code word epi-position in said method is wide is 16, when input code flow and minimum code word table compare in addition, need to be respectively 1,2 by 16 length, 3, ..., the comparator of 15,16 just can decode current code word length, this will cause decoding speed to reduce, and increases the hardware cost of chip simultaneously.
In ASIC Design, decoding speed and chip cost are all the key factors that designer must consider, the Huffman decode algorithm of high speed low cost should be adopted to reduce the consumption of hardware resource.
The jpeg huffman coding/decoding method that prior art provides needs bit wide to be respectively 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, the Huffman minimum code word table of 16 and 16 bit wides are respectively 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, the data comparator of 16 could be decoded to current Huffman code word, and jpeg huffman decoding circuit provided by the present invention and coding/decoding method thereof only need bit wide to be respectively 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, the Huffman minimum code word table of 8 and 16 bit wides are respectively 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, the data comparator of 8 just can be decoded to current Huffman code word, minimum code word table register resource and comparator resource can be saved in a large number like this, the consumption of hardware resource is significantly reduced while high-speed decoding.
Summary of the invention
Because prior art exists the problems referred to above, the present invention proposes a kind of jpeg huffman decoding circuit and coding/decoding method thereof, and it can effectively solve prior art Problems existing.
To achieve these goals, the invention provides a kind of jpeg huffman coding/decoding method, at jpeg file head Huffman mark decode phase, comprise the steps:
Step 1. sets up Huffman minimum code word table according to the Huffman code word number under different length, and in described minimum code word table, the bit wide of 16 code words is respectively 1,2,3,4,5,6,7,8,8,8,8,8,8,8,8,8;
Step 2. sets up Huffman minimum code word address table according to the Huffman code word number under different length;
Step 3. is according to 16 parallel comparative results being less than comparator, and calculate the length of current Huffman code word, and obtain Run-Length Coding value according to minimum code word address table and calculate decoded data, wherein 16 bit wides being less than comparator are 1 respectively, 2,3,4,5,6,7,8,8,8,8,8,8,8,8,8.
Further, step 1 comprises the steps:
Step 1A, from the minimum code word that length is 1, if code word number corresponding under current length is 0, minimum code word value then under this length equals 0, if code word number corresponding under next length is 0, repeat process 1A, if code word number corresponding under next length is not 0, perform step 1B;
Step 1B, minimum code word value corresponding under going out current length by following formulae discovery:
Wherein, the minimum code word value that MinCode (i) is current length when being i, the code word number of Num (i) to be length be i;
If be all 0 to the code word number of length corresponding to 16 from next length, perform 1C, otherwise repeat process 1B.
Step 1C, the minimum code word being 16 to length from current length all equals 255, namely 8 complete 1.
Further, step 2 is by the Huffman minimum code word address table under following formulae discovery different length
Wherein, the Huffman minimum code word address table that MinAddr (i) is length when being i, the code word number of Num (i) to be length be i.
Further, step 3 comprises the steps:
Step 3A, be less than in comparator at first 8, effective input code flow is front n-bit data, minimum code word value when being n by effective input code flow valuve and current length compares, if effectively before input code flow, value is less than minimum code word value when current length is n, then comparator Output rusults is 0, otherwise comparator Output rusults is 1, wherein 1≤n≤8;
Step 3B, is less than in comparator at latter 8, first judges whether this code word may be long code word, and namely whether code word size is greater than 8, if present input code word certainly not long code word, comparator Output rusults is directly 0 according to input code flow; It is if possible long code word, effective input code flow is ensuing 8 bit data after giving up front n-8 position, 8 minimum code word values when being then n by 8 effective input code flow valuves and current length compare, if 8 effective input code flow valuves are less than 8 minimum code word values when current length is n, then comparator Output rusults is 0, otherwise comparator Output rusults is 1, wherein 9≤n≤16;
Step 3C, obtains final code word size CodeLen by following formula by all comparative result additions:
CodeLen = &Sigma; n = 1 16 Comp ( n ) 1≤n≤16, wherein Comp (n) is comparator Output rusults;
Step 3D, to be obtained minimum code word address min_adress:min_adress=MinAddr (CodeLen) under this length by following formulae discovery according to the current code word size decoded, the wherein Huffman minimum code word address of MinAddr (CodeLen) to be length be CodeLen
The minimum code word value min_code_value:min_code_value=MinCode (CodeLen) under this length is obtained by following formulae discovery, wherein the minimum code word value of MinCode (CodeLen) to be length be CodeLen according to the current code word size decoded;
The address value symbol_adress of current code word in huffman code table is gone out by following formulae discovery according to effective input code flow, minimum code word value and minimum code word address:
Symbol_adress=ValidData (CodeLen)+min_code_value-min_address, wherein ValidData (CodeLen) length is effective input code flow of CodeLen;
Finally searching Huffman code word table according to symbol_adress just can obtain Run-Length Coding value corresponding to current code word.
Wherein, judge whether in step 3B to comprise the steps: if the highest order of input code flow is 1 for long code word, then this input code flow may to be length be 9 long code word, if the highest 2 of input code flow is 1 entirely, then this input code flow may to be length be 10 long code word, by that analogy, if the most most-significant byte of input code flow is 1 entirely, then this input code flow may to be length be 16 long code word.
Meanwhile, the invention also discloses a kind of jpeg huffman decoding circuit, comprise the minimum code word table module setting up Huffman minimum code word table according to the Huffman code word number under different length; The minimum code word address table module of Huffman minimum code word address table is set up according to the Huffman code word number under different length; Store the Huffman code word table module of Huffman code word table; Comprise the comparator array module of multiple comparator; Wherein in comparator array module, the input of each comparator is connected with current minimum code word value with effective input code flow, and output is connected with the input of first adder respectively; The input of shift register is connected with input code flow and first adder output respectively, and output is connected with the input of second adder; The input of minimum code word table module is connected with the output of first adder, and output is connected with the input of subtracter; The input of minimum code word address table module is connected with the output of first adder, and output is connected with the input of subtracter; The output of subtracter is connected with the input of second adder; The output of second adder is connected with Huffman code word table module.
Further, comparator array module also comprises 8 and door, whether 8 may be connected for the long code word of length 9 to 16 with the output of the 9th to the 16 comparator and current effective input code flow successively respectively with the input of door, output is connected with the input of first adder, if wherein current effective input code flow is 1 to express possibility as long code word, if being 0 expression can not be long code word.
Accompanying drawing explanation
Fig. 1 is the circuit diagram of jpeg huffman of the present invention decoding;
Fig. 2 is minimum code word table calculation flow chart of the present invention;
Fig. 3 is minimum code word address table calculation flow chart of the present invention;
Fig. 4 is that code word size of the present invention calculates schematic diagram.
Embodiment
In order to enable above-mentioned purpose of the present invention, feature and advantage become apparent more, and below in conjunction with the drawings and specific embodiments, the present invention is described in further detail.
As shown in Figure 1, the invention discloses a kind of jpeg huffman decoding circuit.This circuit comprises the minimum code word table module setting up Huffman minimum code word table according to the Huffman code word number under different length; The minimum code word address table module of Huffman minimum code word address table is set up according to the Huffman code word number under different length; Store the Huffman code word table module of Huffman code word table; Comprise the comparator array module of multiple comparator.
Wherein, in comparator array module, the input of each comparator is connected with current minimum code word value with effective input code flow, and output is connected with the input of first adder respectively; The input of shift register is connected with input code flow and first adder output respectively, and output is connected with the input of second adder; The input of minimum code word table module is connected with the output of first adder, and output is connected with the input of subtracter; The input of minimum code word address table module is connected with the output of first adder, and output is connected with the input of subtracter; The output of subtracter is connected with the input of second adder; The output of second adder is connected with Huffman code word table module.
In addition, comparator array module also comprises 8 and door, whether 8 may be connected for the long code word (long_code_9 to long_code_15) of length 9 to 16 with the output of the 9th to the 16 comparator and current effective input code flow successively respectively with the input of door, output is connected with the input of first adder, if wherein current effective input code flow is 1 to express possibility as long code word, if being 0 expression can not be long code word.
As shown in Figure 1, the effective input data intercepted in code stream input data are input to one end of 16 comparators respectively simultaneously, compare with corresponding minimum code word, wherein, 9th comparator is only just effective when current effective input data may be long code word to the final Output rusults of the 16 comparator, this partial function by by comparator results and long code word mark phase with realize, the final Output rusults sum of 16 comparators is exactly the length of current Huffman code word, according to current code word length by the Huffman code word under the corresponding length in data shifter intercepting present input code flow data, from minimum code word table, find out the minimum code word under current length according to current code word length simultaneously, Huffman code word under the corresponding length intercepted from present input code flow data is subtracted each other with corresponding minimum code word and adds that current effective input code flow just can obtain the index address of Huffman code word table, Run-Length Coding value corresponding to current Huffman code word can be taken out according to this address value.
According to foregoing circuit design, the invention also discloses a kind of jpeg huffman coding/decoding method.
First, perform the Huffman minimum code word table that step 1. is set up according to the Huffman code word number under different length at jpeg file head Huffman mark decode phase, in this minimum code word table, the bit wide of front 8 code words is respectively 1,2,3,4,5,6,7,8, the bit wide of rear 8 code words is all 8;
Suppose that length in jpeg file head Huffman marker field be the code word number of i is Num (i), wherein 1≤i≤16.As shown in Figure 2, corresponding Huffman minimum code word table is by following process computation:
Step 1A, from the minimum code word that length is 1, if code word number corresponding under current length is 0, minimum code word value MinCode (1) then under this length equals 0, if code word number corresponding under next length is 0, repeat process 1A), if code word number corresponding under next length is not 0, then perform 1B);
Step 1B, minimum code word value corresponding under going out current length by following formulae discovery
If be all 0 to the code word number of length corresponding to 16 from next length, namely Num (i) to Num (16) is entirely 0 and performs 1C), otherwise repeat process 1B).Wherein, in formula, MinCode (1) equals 0 all the time and is determined by jpeg huffman coding properties;
Step 1C, from current length to length be 16 minimum code word and MinCode (i) to MinCode (16-i) all equal 255, namely 8 complete 1;
The bit wide of the MinCode (1) obtained in above-mentioned computational process ~ MinCode (16) is respectively 1,2,3,4,5,6,7,8,8,8,8,8,8,8,8,8.
It should be noted that, due to the characteristic of huffman coding in JPEG code stream, can prove when code word size is greater than 8, all bits higher than this code word the 8th are 1 entirely, so only need to preserve its least-significant byte when decoding compute codeword length is greater than the minimum code word of 8, briefly introduce the proof procedure of above-mentioned Huffman code word characteristic below:
Code word size is that the minimum code word of l can be calculated by following binary fraction formula:
&Sigma; i = 1 l - 1 n i &CenterDot; 2 - i (formula one)
Wherein n ithe code word number of to be code word size be i.
Equal code word size in this binary fraction least significant bit zero padding (if needed) with the figure place of the fractional part making this binary fraction, so the fractional part of this binary fraction is exactly Huffman code word string corresponding with it.The length of the Huffman code word used in JPEG compression standard is 1 ~ 16, and according to kraft inequality, the summation that can obtain whole binary Huffman code word tree equals 1:
&Sigma; i = 1 16 n i &CenterDot; 2 - i = &Sigma; i = 1 8 n i &CenterDot; 2 - i + &Sigma; i = 9 16 n i &CenterDot; 2 - i = 1
Wherein n ithe code word number of to be code word size be i.
Simultaneously again because
2 - 9 &Sigma; i = 9 16 n i > &Sigma; i = 9 16 n i &CenterDot; 2 - i
So
&Sigma; i = 1 8 n i &CenterDot; 2 - i + 2 - 9 &Sigma; i = 9 16 n i > &Sigma; i = 1 8 n i &CenterDot; 2 - i + &Sigma; i = 9 16 n i &CenterDot; 2 - i = 1
Namely
&Sigma; i = 1 8 n i &CenterDot; 2 - i > 1 - 2 - 9 &Sigma; i = 9 16 n i
For a huffman code table any in JPEG compression standard:
&Sigma; i = 9 16 n i < 256
So
2 - 9 &Sigma; i = 9 16 n i < 0.5
Namely
1 - 2 - 9 &Sigma; i = 9 16 n i > 0.5
So
&Sigma; i = 1 8 n i &CenterDot; 2 - i > 1 - 2 - 9 &Sigma; i = 9 16 n i > 0.5
In conjunction with formula one, under 9 bit lengths, the highest order of minimum code word is 1 certainly as can be seen from the above equation, for the code word that length is longer, can be proved out that higher than all bits of this code word the 8th be 1 entirely by identical method.
As shown in Figure 3, step 2. is then performed while calculating Huffman minimum code word table by the Huffman minimum code word address table under following formulae discovery different length;
Following table gives AC component code word number table in real JPEG code stream, give also the result of calculation of step 1 and step 2 in this specific embodiment simultaneously;
Code word size Code word number Minimum code word (binary system) Minimum code word address
1 0 0 0
2 2 00 0
3 1 100 2
4 3 1010 3
5 3 11010 6
6 2 111010 9
7 4 1111000 11
8 3 11111000 15
9 5 11110110 18
10 5 11110110 23
11 4 11110110 28
12 4 11110000 32
13 0 11110100 36
14 0 11100000 36
15 1 11000000 36
16 125 10000010 37
As shown in Figure 4, then step 3. is performed in the jpeg image Hofmann decoding stage according to 16 parallel comparative results being less than comparator, calculate the length of current Huffman code word, and obtain Run-Length Coding value (RUN/SIZE) according to minimum code word address table.
Suppose that in Hofmann decoding process, current 16 input code flows are 16 ' b1111111000111001, then concrete computational process is:
Suppose that the comparative result of 16 comparators is Comp (n), and be stated to be effective input code flow ValidData (n) by being less than the fan-in be connected with input code flow in comparator, wherein 1≤n≤16,
Step 3A, in front 8 comparators, ValidData (n) is n position before input code flow, ValidData (n) and MinCode (n) are compared, if ValidData (n) is less than MinCode (n), comparative result Comp (n)=0, otherwise export Comp (n)=1, wherein 1≤n≤8;
Step 3B, in rear 8 comparators, first judge whether this code word may be long code word (whether code word size is greater than 8) according to input code flow, if the highest order of input code flow is 1, then this input code flow may to be length be 9 long code word, if the highest 2 of input code flow is 1 entirely, then this input code flow may to be length be 10 long code word, by that analogy, if the most most-significant byte of input code flow is 1 entirely, then this input code flow may to be length be 16 long code word.
If present input code word is not long code word, comparator Output rusults is directly 0; If long code word, give up input code flow high (n-8) position, ValidData (n) is 8 bit data ensuing in input code flow, ValidData (n) and MinCode (n) are compared, if ValidData (n) is less than MinCode (n), comparative result Comp (n)=0, otherwise export Comp (n)=1, wherein 9≤n≤16, in this specific embodiment, following table gives result of calculation:
Step 3C, obtains final code word size CodeLen by following formula by all comparative result additions
CodeLen = &Sigma; n = 1 16 Comp ( n ) 1≤n≤16
As can be seen from the above table, CodeLen=10 in the present embodiment.
Step 3D, to obtain the minimum code word address min_adress under this length by following formulae discovery according to the current code word size decoded:
min_adress=MinAddr(CodeLen)=MinAddr(10)=23;
To be obtained the minimum code word value min_code_value under this length by following formulae discovery according to the current code word size decoded:
min_code_value=MinCode(CodeLen)=MinCode(10)=8′b11110110;
The address value symbol_adress of current code word in huffman code table is gone out by following formulae discovery according to effective input code flow, minimum code word value and minimum code word address:
symbol_adress=ValidData(CodeLen)+min_code_value-min_address
=8′b11111000-8′b11110110+23=25;
Finally searching Huffman code word table according to symbol_adress just can obtain Run-Length Coding value corresponding to current code word.
Although above-mentioned preferred embodiment particularly understands method of the present invention, it should be noted that, the invention is not restricted to preferred embodiment above.Those skilled in the art should recognize when the technical characteristic do not departed from given by technical solution of the present invention and scope, the increase done technical characteristic, with the replacement of some same contents of this area, all should belong to protection scope of the present invention.

Claims (6)

1. a jpeg huffman coding/decoding method, is characterized in that, at jpeg file head Huffman mark decode phase, comprises the steps:
Step 1. sets up Huffman minimum code word table according to the Huffman code word number under different length, and in described minimum code word table, the bit wide of 16 code words is respectively 1,2,3,4,5,6,7,8,8,8,8,8,8,8,8,8;
Step 2. sets up Huffman minimum code word address table according to the Huffman code word number under different length;
Step 3. is according to 16 parallel comparative results being less than comparator, and calculate the length of current Huffman code word, and obtain Run-Length Coding value according to minimum code word address table and calculate decoded data, wherein 16 bit wides being less than comparator are 1 respectively, 2,3,4,5,6,7,8,8,8,8,8,8,8,8,8;
Step 3 comprises the steps:
Step 3A, be less than in comparator at first 8, effective input code flow is front n-bit data, minimum code word value when being n by effective input code flow valuve and current length compares, if effectively before input code flow, value is less than minimum code word value when current length is n, then comparator Output rusults is 0, otherwise comparator Output rusults is 1, wherein 1≤n≤8;
Step 3B, is less than in comparator at latter 8, first judges whether this code word is long code word, and namely whether code word size is greater than 8 according to input code flow, if present input code word is not long code word, comparator Output rusults is directly 0; If long code word, effective input code flow is ensuing 8 bit data after giving up front n-8 position, 8 minimum code word values when being then n by 8 effective input code flow valuves and current length compare, if 8 effective input code flow valuves are less than 8 minimum code word values when current length is n, then comparator Output rusults is 0, otherwise comparator Output rusults is 1, wherein 9≤n≤16;
Step 3C, obtains final code word size CodeLen by following formula by all comparative result additions:
1≤n≤16, wherein Comp (n) is comparator Output rusults;
Step 3D, to be obtained minimum code word address min_adress:min_adress=MinAddr (CodeLen) under this length by following formulae discovery according to the current code word size decoded, the wherein Huffman minimum code word address of MinAddr (CodeLen) to be length be CodeLen
The minimum code word value min_code_value:min_code_value=MinCode (CodeLen) under this length is obtained by following formulae discovery, wherein the minimum code word value of MinCode (CodeLen) to be length be CodeLen according to the current code word size decoded;
The address value symbol_adress of current code word in huffman code table is gone out by following formulae discovery according to effective input code flow, minimum code word value and minimum code word address:
Symbol_adress=ValidData (CodeLen)+min_code_value-min_address, wherein ValidData (CodeLen) length is effective input code flow of CodeLen;
Finally searching Huffman code word table according to symbol_adress just can obtain Run-Length Coding value corresponding to current code word.
2. jpeg huffman coding/decoding method according to claim 1, it is characterized in that, step 1 comprises the steps:
Step 1A, from the minimum code word that length is 1, if code word number corresponding under current length is 0, minimum code word value then under this length equals 0, if code word number corresponding under next length is 0, repeat process 1A, if code word number corresponding under next length is not 0, perform step 1B;
Step 1B, minimum code word value corresponding under going out current length by following formulae discovery:
Wherein, the minimum code word value that MinCode (i) is current length when being i, the code word number of Num (i) to be length be i;
If be all 0 to the code word number of length corresponding to 16 from next length, perform 1C, otherwise repeat process 1B.
Step 1C, the minimum code word being 16 to length from current length all equals 255, namely 8 complete 1.
3. jpeg huffman coding/decoding method according to claim 1, is characterized in that, step 2 is by the Huffman minimum code word address table under following formulae discovery different length
Wherein, the Huffman minimum code word address table that MinAddr (i) is length when being i, the code word number of Num (i) to be length be i.
4. jpeg huffman coding/decoding method according to claim 1, it is characterized in that, determine whether in step 3B that long code word comprises the steps: if the highest order of input code flow is 1, then this input code flow to be length be 9 long code word, if the highest 2 of input code flow is 1 entirely, then this input code flow to be length be 10 long code word, by that analogy, if the most most-significant byte of input code flow is 1 entirely, then this input code flow to be length be 16 long code word.
5. a jpeg huffman decoding circuit, is characterized in that: comprise
Set up the minimum code word table module of Huffman minimum code word table according to the Huffman code word number under different length, in described minimum code word table, the bit wide of 16 code words is respectively 1,2,3,4,5,6,7,8,8,8,8,8,8,8,8,8;
The minimum code word address table module of Huffman minimum code word address table is set up according to the Huffman code word number under different length;
Store the Huffman code word table module of Huffman code word table;
Comprise the comparator array module of 16 comparators; Wherein
In comparator array module, the input of each comparator is connected with current minimum code word value with effective input code flow, and output is connected with the input of first adder respectively, and this first adder is used for the output of each comparator to be added the length obtaining current Huffman code word, and wherein the bit wide of 16 comparators is 1 respectively, 2,3,4,5,6,7,8,8,8,8,8,8,8,8,8;
The input of shift register is connected with input code flow and first adder output respectively, and output is connected with the input of second adder, and this shift register is for exporting effective input code flow;
The input of minimum code word table module is connected with the output of first adder, and output is connected with the input of subtracter, and this minimum code word table module is for obtaining Huffman minimum code word value corresponding to described length;
The input of minimum code word address table module is connected with the output of first adder, and output is connected with the input of subtracter, and this minimum code word address table module is for obtaining Huffman minimum code word address corresponding to described length;
The output of subtracter is connected with the input of second adder;
The output of second adder is connected with Huffman code word table module;
Wherein, subtracter is for calculating the difference of minimum code word value and Huffman minimum code word address, the difference that second adder is used for subtracter to calculate is added with effective input code flow and obtains the address value of current Huffman code word in huffman code table, and Huffman code word table module is used for taking out Run-Length Coding value corresponding to current Huffman code word according to the address value of current Huffman code word in huffman code table.
6. jpeg huffman decoding circuit according to claim 5, it is characterized in that, comparator array module also comprises 8 and door, whether 8 be length 9 to 16 with the output of the 9th to the 16 comparator and current effective input code flow with the input of door long code word is connected successively respectively, output is connected with the input of first adder, if wherein current effective input code flow is 1 be expressed as long code word, if being 0 expression is not long code word.
CN201010618002.9A 2010-12-30 2010-12-30 A kind of jpeg huffman decoding circuit and coding/decoding method thereof Active CN102545910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010618002.9A CN102545910B (en) 2010-12-30 2010-12-30 A kind of jpeg huffman decoding circuit and coding/decoding method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010618002.9A CN102545910B (en) 2010-12-30 2010-12-30 A kind of jpeg huffman decoding circuit and coding/decoding method thereof

Publications (2)

Publication Number Publication Date
CN102545910A CN102545910A (en) 2012-07-04
CN102545910B true CN102545910B (en) 2015-10-28

Family

ID=46351980

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010618002.9A Active CN102545910B (en) 2010-12-30 2010-12-30 A kind of jpeg huffman decoding circuit and coding/decoding method thereof

Country Status (1)

Country Link
CN (1) CN102545910B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547906B (en) * 2017-08-29 2020-02-21 郑州云海信息技术有限公司 JPEG image decoding method and device
CN113965207B (en) * 2021-12-17 2022-03-15 苏州浪潮智能科技有限公司 Deflate Huffman coding-based dynamic code table generation device and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5208593A (en) * 1991-07-30 1993-05-04 Lsi Logic Corporation Method and structure for decoding Huffman codes using leading ones detection
CN101017574A (en) * 2007-02-16 2007-08-15 上海广电集成电路有限公司 Huffman decoding method suitable for JPEG code stream
CN101147325A (en) * 2004-12-31 2008-03-19 英特尔公司 Fast compact decoder for Huffman codes
CN101394564A (en) * 2007-09-17 2009-03-25 辉达公司 Decoding variable lenght codes in jpeg applications

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5208593A (en) * 1991-07-30 1993-05-04 Lsi Logic Corporation Method and structure for decoding Huffman codes using leading ones detection
CN101147325A (en) * 2004-12-31 2008-03-19 英特尔公司 Fast compact decoder for Huffman codes
CN101017574A (en) * 2007-02-16 2007-08-15 上海广电集成电路有限公司 Huffman decoding method suitable for JPEG code stream
CN101394564A (en) * 2007-09-17 2009-03-25 辉达公司 Decoding variable lenght codes in jpeg applications

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种快速霍夫曼解码算法及其软硬件实现;董培良 等;《复旦学报(自然科学版)》;20020430;第41卷(第2期);165-169 *

Also Published As

Publication number Publication date
CN102545910A (en) 2012-07-04

Similar Documents

Publication Publication Date Title
CN100477532C (en) Huffman coding method and equipment
CN100525450C (en) Method and device for realizing Hoffman decodeng
WO2021027487A1 (en) Encoding method and related device
CN105515590A (en) Successive cancellation list polarization code decoding algorithm with effective low complexity based on random binary data flows and decoding structural frame thereof
CN112953550A (en) Data compression method, electronic device and storage medium
CN101902228A (en) Rapid cyclic redundancy check encoding method and device
US6778109B1 (en) Method for efficient data encoding and decoding
CN101595645A (en) The method and system of transmission/reception serial data and serial communication system thereof in the serial communication system
CN102545910B (en) A kind of jpeg huffman decoding circuit and coding/decoding method thereof
CN106533452A (en) Multi-ary LDPC coding method and coder
CN103092559B (en) For the multiplier architecture of DCT/IDCT circuit under HEVC standard
CN116033034B (en) Data processing system for wireless receiving and transmitting platform
CN201966895U (en) JPEG Hoffman decoding circuit
CN103428502B (en) Decoding method and decoding system
WO2021143634A1 (en) Arithmetic coder, method for implementing arithmetic coding, and image coding method
CN102651795B (en) Run-length reduced binary sequence compressed encoding method
CN108566210B (en) LDPC (Low Density parity check) coding system and method compatible with IEEE (institute of Electrical and electronics Engineers) 802.11n standard and LDPC coder
CN100542047C (en) A kind of coding method of index Golomb coding and device
CN113157247A (en) Reconfigurable integer-floating point multiplier
CN108540258B (en) Cyclic redundancy code checking method and device
CN105049057A (en) CRC (Cyclic Redundancy Check)-32 checking circuit facing 128-bit parallel input
CN110752893B (en) Approximate decoding method and device for belief propagation of polarization code
CN111082810B (en) FPGA-based low-overhead parallel cyclic redundancy check method and application
CN108449092A (en) A kind of Turbo code interpretation method and its device based on cycle compression
CN201054155Y (en) A Huffman decoding device suitable for JPEG

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 214135 -6, Linghu Avenue, Wuxi Taihu international science and Technology Park, Wuxi, Jiangsu, China, 180

Patentee after: China Resources micro integrated circuit (Wuxi) Co., Ltd

Address before: 214061 Jiangsu city of Wuxi province Liangxi Road No. 14

Patentee before: WUXI CHINA RESOURCES SEMICO Co.,Ltd.