CN201054155Y - A Huffman decoding device suitable for JPEG - Google Patents

A Huffman decoding device suitable for JPEG Download PDF

Info

Publication number
CN201054155Y
CN201054155Y CN 200720067428 CN200720067428U CN201054155Y CN 201054155 Y CN201054155 Y CN 201054155Y CN 200720067428 CN200720067428 CN 200720067428 CN 200720067428 U CN200720067428 U CN 200720067428U CN 201054155 Y CN201054155 Y CN 201054155Y
Authority
CN
China
Prior art keywords
module
minimum
numeral
register
address
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.)
Expired - Fee Related
Application number
CN 200720067428
Other languages
Chinese (zh)
Inventor
吴彪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHANGHAI SUPER VALUE ACTION GROUP CO Ltd
Original Assignee
SHANGHAI SUPER VALUE ACTION GROUP 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 SHANGHAI SUPER VALUE ACTION GROUP CO Ltd filed Critical SHANGHAI SUPER VALUE ACTION GROUP CO Ltd
Priority to CN 200720067428 priority Critical patent/CN201054155Y/en
Application granted granted Critical
Publication of CN201054155Y publication Critical patent/CN201054155Y/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The utility model provides a Huffman coding device suitable for a JPEG code stream, which comprises a minimum code generating module used for generating a minimum code table, a minimum code register connected to the output terminal of the minimum code generating module, a minimum code address module for generating a minimum code address, a minimum code address register connected to the minimum code address module, a comparer array module comprising a plurality of comparers, an exclusive or module connected to the comparer array module, a subtracter connected to the exclusive or module, a summator connected to the subtracter, a primus bit judge module, and a reverse module connected to the primus bit judge module. Compared with the prior art, the utility model is provided with the minimum code register and the minimum code address register which can construct the different length of code, thereby decreasing the occupancy of register array resources, and adopting fewer resource to rapidly realize the Huffman coding of the JPEG code stream.

Description

A kind of Hafman decoding device that is suitable for the JPEG code stream
Technical field
The utility model belongs to digital image processing field, is a kind of device that can realize JPEG code stream Hafman decoding with less resource fast.
Background technology
Huffman (Hufferman) coding is mainly used in the compressed encoding of Streaming Media, it is a kind of Run-Length Coding of variable length, its guiding theory is that probability of occurrence is adopted less bits of encoded than higher run-length data, and the little run-length data of probability of occurrence is adopted long bits of encoded, thereby reach the purpose of compression data file.
Software decode for Huffman; traditional method is the code table information in the code stream of recovering earlier; this code table information is that coding side produces according to statistical information; thereby in different code streams; its Huffman code table content all is different with length; code table can take sizable memory headroom usually; T.81 the typical code table length overall of listing in such as Joint Photographic Experts Group is about 4kbit; for PC; this is very little internal memory occupancy volume; but for embedded system or ASIC design, this will be no small resource occupation.
In addition, during the judgement of numeral, traditional implementation method is the lookup method that adopts based on binary tree in carrying out code stream, be serial by the bit decision method, the numeral of decoding usually will need the more clock period.
Therefore, when realizing Hafman decoding, just should consider the speed issue that takies and decode of register array resource in embedded system or with ASIC.
The utility model content
The purpose of this utility model is to provide a kind of device of the JPEG of being suitable for code stream Hafman decoding, and it can adopt less resource to realize JPEG code stream Hafman decoding fast.
For achieving the above object, the utility model provides a kind of Hafman decoding device of the JPEG of being suitable for code stream, wherein, this device comprises the minimum numeral generation module that is used to generate minimum numeral table, be connected to the minimum numeral register of minimum numeral generation module output terminal, generate the minimum numeral address module of minimum numeral address, be connected to the minimum numeral address register of minimum numeral address module, the comparator array module that comprises a plurality of comparers, be connected to the XOR module of comparator array module, be connected to the subtracter of XOR module, be connected to the totalizer of subtracter, be connected to the first bit decision module of totalizer, and the reverse module that is connected to the first bit decision module.
Compared with prior art, the utlity model has the minimum numeral register and the minimum numeral address register that can make up different numeral length, reduce taking of register array resource; Judge by parallel Huffman numeral, reduce numeral and judge the needed time, improve the hardware decoding speed; SIZE value in the RUN/SIZE symbol that obtains according to decoding obtains the actual value of these data fast.
Description of drawings
To the description of the utility model one embodiment, can further understand its practical novel purpose, specific structural features and advantage by following in conjunction with its accompanying drawing.Wherein, accompanying drawing is:
Fig. 1 is the structural representation of the JPEG of being suitable for code stream Hafman decoding device of the present utility model.
Embodiment
The utility model device comprises the minimum numeral generation module 2 that is used to generate minimum numeral table, be connected to the minimum numeral register 3 of minimum numeral generation module 2 output terminals, generate the minimum numeral address module 4 of minimum numeral address, be connected to the minimum numeral address register 5 of minimum numeral address module 4, the comparator array module 6 that comprises a plurality of comparers, be connected to the XOR module 7 of comparator array module 6, be connected to the subtracter 8 of XOR module 7, be connected to the totalizer 9 of subtracter 8, be connected to the first bit decision module 10 of totalizer 9, and the reverse module 11 that is connected to the first bit decision module.The input end of comparator array module 6 is connected to minimum numeral register 3.
This device also further includes a judge module 1, this module 1 judges whether its JPEG code stream that receives is the Huffman code stream, the output terminal of this judge module 1 is connected respectively to minimum numeral generation module 2, comparator array module 6, minimum numeral address generation module 4, subtracter 8 and the first bit decision module 10.
Minimum numeral register 3 is used to deposit minimum numeral table, and minimum numeral address register 5 is used to deposit minimum numeral address table.Comprise 17 comparers in the comparator array module 6, comprise 16 XOR devices in the XOR module 7.The output terminal of the output terminal of first comparer and second comparer is connected to first XOR device in the XOR module 7; The output terminal of the output terminal of second comparer and the 3rd comparer is connected to second XOR device in the XOR module 7; The rest may be inferred, and the output terminal of n-1 comparer and the output terminal of n comparer are connected to m the XOR device (m, n is integer, m-n=1,0<n<18,0<m<17) in the XOR module 7.
A) minimum numeral generation module 2 and register 3 thereof and minimum numeral address generation module 4 and register 5 thereof
Huffman code table in the JPEG code stream is divided into two parts.The number of 16 byte correspondence 1 to 16 bit code of first; The RUN/SIZE symbol that second portion is corresponding concrete, its number is preceding 16 byte sums, can obtain minimum numeral table C (n) (0<n<17, n round numbers) and minimum numeral address table A (n) (0<n<17, n round numbers) by preceding 16 bytes.
Suppose that L (n) characteristic length is n (0<n<17, the n round numbers) numeral number, according to the Huffman encoding characteristics, length is that the minimum numeral C (n) of n and the relation of the minimum numeral C (n+1) that length is n+1 are explained by formula one, minimum numeral generation module 2 obtains minimum numeral table C (n) (0<n<17 according to operational formula one, the n round numbers), this minimum numeral table deposits in the minimum numeral register 3.
C (n+1)=[C (n)+L (n)] * 2 formula one
Then, suppose that length is n (0<n<17, the n round numbers) code word address is A (n), formula two has characterized the relation of A (n) and L (n), A (1)=0, L (x) is the number of different length numeral, and minimum numeral address generation module 4 can obtain minimum numeral address table A (n) according to formula two, and this address table deposits minimum numeral address register 5 in.
A ( n ) = &Sigma; x - 1 n - 1 L ( x ) , ( 1 < n < 17 ) Formula two
Minimum numeral register 3 and minimum numeral address register 5 are not with all C (n) when carrying out resources allocation, and A (n) distributes identical resource, but according to the variation of n, distribute corresponding bit wide, avoid the register 2 and 3 wastings of resources.
B) the comparator array module 6 and the XOR module 7 of judgement numeral length
The input end of comparator array module 6 is connected respectively to judge module 1 and minimum numeral register 3.Comparator array module 6 comprises 17 comparers, an input end of preceding 16 comparers is respectively 1 to 16 bit S (n) (0<n<17 of the code stream of judge module 1 output, the n round numbers), another input end is respectively the minimum numeral table C (n) in the minimum numeral register 3; An input end of the 17th comparer is 16 bits of code stream, and another input end is one 16 a binary number: 1111111111111110.
R (n) (0<n<18, n round numbers) characterizes the output of comparer.When S (n) more than or equal to C (n), comparer output R (n) is 1; Otherwise comparer output R (n) is 0.When minimum numeral table C (n) this length code period of the day from 11 p.m. to 1 a.m not, according to the length polishing comparer of comparer: employing completion " 0 " method of front, employing completion " 1 " method of back.
Have only one 0 and 1 separation among the R (n), with R (n) and R (n+1) (0<n<17, n round numbers) input XOR module 7, carry out xor operation and obtain X (n) (0<n<17, n round numbers), calculate numeral length, promptly X (n) is that 1 n value is numeral length.
C) subtracter 8 of calculating offset address
Take out S (n) (0<n<17 according to numeral length n value, the n round numbers), and with S (n) with exist minimum numeral table C (n) in the minimum numeral register 3, S (n) and C (n) are carried out the offset address B (n) that subtraction obtains Huffman numeral and the minimum numeral of this length according to formula three as the input end of subtracter 8.
B (n)=S (n)-C (n) formula three
D) totalizer 9 of calculating specific address
See also Fig. 4, according to formula four, to be deposited with the address A (n) of the minimum numeral in the minimum numeral address register module 5 and offset address B (n) input end as totalizer 9, obtain the specific address AB (n) of corresponding RUN/SIZE table, tabling look-up obtains the RUN/SIZE value.
AB (n)=A (n)+B (n) formula four
E) the first bit decision module 10 and reverser 11
The first bit decision module 10 is extracted SIZE position bit according to the size value in the RUN/SIZE value of totalizer 9 outputs from code stream, judge the first bit, if 1, with result's character position is 0 (positive number), and SIZE position bit as the absolute value assignment, is obtained decoded data; If 0, be 1 (negative) with result's character position, with size position bit by reverser 11 backs as the absolute value assignment, obtain decoded data.

Claims (6)

1. Hafman decoding device that is suitable for the JPEG code stream, it is characterized in that: this device comprises the minimum numeral generation module that is used to generate minimum numeral table, be connected to the minimum numeral register of minimum numeral generation module output terminal, generate the minimum numeral address module of minimum numeral address, be connected to the minimum numeral address register of minimum numeral address module, the comparator array module that comprises a plurality of comparers, be connected to the XOR module of comparator array module, be connected to the subtracter of XOR module, be connected to the totalizer of subtracter, be connected to the first bit decision module of totalizer, and the reverse module that is connected to the first bit decision module.
2. the Hafman decoding device that is suitable for the JPEG code stream as claimed in claim 1, it is characterized in that: this device also further includes a judge module, this module judges whether its JPEG code stream that receives is the Huffman code stream, the output terminal of this judge module is connected respectively to minimum numeral generation module, the comparator array module, minimum numeral address generation module, subtracter and the first bit decision module.
3. the Hafman decoding device that is suitable for the JPEG code stream as claimed in claim 2 is characterized in that: the input end of comparator array module is connected respectively to judge module and minimum numeral register.
4. the Hafman decoding device that is suitable for the JPEG code stream as claimed in claim 1 is characterized in that: comprise a plurality of XOR devices in the XOR module, those XOR devices comparer corresponding respectively and in the comparator array module links to each other.
5. the Hafman decoding device that is suitable for the JPEG code stream as claimed in claim 4, it is characterized in that: the output terminal of n-1 comparer and the output terminal of n comparer are connected to m XOR device in the XOR module, m wherein, n is integer, and m-n=1.
6. the Hafman decoding device that is suitable for the JPEG code stream as claimed in claim 1 is characterized in that: the input end of totalizer links to each other with lowest address register output terminal with the output terminal of subtracter respectively.
CN 200720067428 2007-02-16 2007-02-16 A Huffman decoding device suitable for JPEG Expired - Fee Related CN201054155Y (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200720067428 CN201054155Y (en) 2007-02-16 2007-02-16 A Huffman decoding device suitable for JPEG

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200720067428 CN201054155Y (en) 2007-02-16 2007-02-16 A Huffman decoding device suitable for JPEG

Publications (1)

Publication Number Publication Date
CN201054155Y true CN201054155Y (en) 2008-04-30

Family

ID=39393817

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200720067428 Expired - Fee Related CN201054155Y (en) 2007-02-16 2007-02-16 A Huffman decoding device suitable for JPEG

Country Status (1)

Country Link
CN (1) CN201054155Y (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101998122A (en) * 2010-12-13 2011-03-30 山东大学 Method and device for decoding normal form Hoffman hardware in JPEG (Joint Photographic Expert Group) image

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101998122A (en) * 2010-12-13 2011-03-30 山东大学 Method and device for decoding normal form Hoffman hardware in JPEG (Joint Photographic Expert Group) image
CN101998122B (en) * 2010-12-13 2012-05-02 山东大学 Method and device for decoding normal form Hoffman hardware in JPEG (Joint Photographic Expert Group) image

Similar Documents

Publication Publication Date Title
CN101017574A (en) Huffman decoding method suitable for JPEG code stream
CN101847997B (en) 9B/10B coder-decoder and realization method thereof
CN101771879B (en) Parallel normalized coding realization circuit based on CABAC and coding method
CN101595645B (en) Method and system for transmitting/receiving serial data in serial communication system and serial communication system for the same
JPH04227337A (en) Adaptive coding device using carry control and method therefor
CN106170922A (en) The source code of data and the equipment of decoding and method
CN102438145A (en) Image lossless compression method on basis of Huffman code
WO2009009602A1 (en) Data coding/decoding for electrical computers and digital data processing systems
WO2001063772A1 (en) Method and apparatus for optimized lossless compression using a plurality of coders
EP2055007A2 (en) Data encoder
CN201054155Y (en) A Huffman decoding device suitable for JPEG
CN116033034B (en) Data processing system for wireless receiving and transmitting platform
CN110021368B (en) Comparison type gene sequencing data compression method, system and computer readable medium
CN110191341B (en) Depth data coding method and decoding method
WO2021143634A1 (en) Arithmetic coder, method for implementing arithmetic coding, and image coding method
KR100636370B1 (en) Apparatus and method for coding using bit-precision, and apparatus and method for decoding according to the same
KR20230050256A (en) Data encoding method, encoder, and data decoding method
CN102388538A (en) Method and device for encoding an input bit sequence and corresponding decoding method and device
CN104113394B (en) The compression of communication modulation signal and decompressing method
CN102545910B (en) A kind of jpeg huffman decoding circuit and coding/decoding method thereof
CN103138769A (en) Encoding method provided with unequal error protection
JPS6352812B2 (en)
CN201966895U (en) JPEG Hoffman decoding circuit
KR100625670B1 (en) Method, system and recording-medium for coding of image data
CN112865804B (en) Compression calculation unit for sparsity weight of three-value neural network

Legal Events

Date Code Title Description
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080430