CN102136270A - Audio frequency decoding method and device - Google Patents

Audio frequency decoding method and device Download PDF

Info

Publication number
CN102136270A
CN102136270A CN2010106073243A CN201010607324A CN102136270A CN 102136270 A CN102136270 A CN 102136270A CN 2010106073243 A CN2010106073243 A CN 2010106073243A CN 201010607324 A CN201010607324 A CN 201010607324A CN 102136270 A CN102136270 A CN 102136270A
Authority
CN
China
Prior art keywords
hlen
value
data
bit
decoding table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2010106073243A
Other languages
Chinese (zh)
Other versions
CN102136270B (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.)
Huawei Technologies Co Ltd
Huawei Software Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN2010106073243A priority Critical patent/CN102136270B/en
Publication of CN102136270A publication Critical patent/CN102136270A/en
Application granted granted Critical
Publication of CN102136270B publication Critical patent/CN102136270B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an audio frequency decoding method. The embodiment of the invention also provides a corresponding device. In the technical scheme of the invention, 8-bit storage is adopted for Huffman decoding table of which the value is 1, 2, 3, 5 or 6; the value N of the data of a first byte of the Huffman decoding table is obtained firstly; N is equal to the maximum value of hlen in an original Huffman decoding table; when data to be decoded is obtained, N-bit data is obtained each time; the value of the N-bit data is M; and then M is used as an index to search the data in the Huffman decoding table, and decoding is implemented according to the data. In the method, the Huffman decoding table is stored by 8-bit compressing, so that the storage space is saved and the CPU cache hit rate for data reading during decoding is improved; meanwhile, searching of command number is not increased; therefore, the decoding performance is improved.

Description

A kind of audio-frequency decoding method and device
Technical field
The present invention relates to the audio decoder technical field, be specifically related to a kind of audio-frequency decoding method and device.
Background technology
At ISO/IEC 11172-3, in these 3 international standards of ISO/IEC 13818-3 and ISO/IEC 14496-3, (the MPEG of Motion Picture Experts Group, Moving Picture Experts Group) audio compress standard Layer III has a wide range of applications as one of them very important part.Use various mp3 audio files that Layer III compresses out worldwide very popularize and popular.The Huffman encoding and decoding are important component parts of the popular audio coding decoding of many kinds.Initial and the termination procedure of once concrete Hafman decoding depend on the syntactic structure definition of Huffmancodebits () in the 11172-3 agreement 2.4.1.7 joint and 2.4.2.7 save in to the semantic description of Huffmancodebits ().
At ISO/IEC 11172-3 appendix B.7, promptly in " Huffman codes for Layer III ", table Huffman code table for quadruples A and B and table Huffman code table 0 to 31 have been provided.Table 0 except having little significance among the Huffman code table, from table 1 to table 31, table 4 and table 14 do not exist, table 17 is to the shared table 16 of table 23, table 25 is to the shared table 24 of table 31.
The original Huffman code table of part that below is the B.7 original Huffman code of ISO/IEC 11172-3 appendix table 5 and Huffmancode table 10 is represented example:
Huffman?code?table?5
x y hlen hcod
0 0 1 1
0 1 3 010
0 2 6 000110
0 3 7 0000101
1 0 3 011
1 1 3 001
1 2 6 000100
1 3 7 0000100
2 0 6 000111
…… ……
3 3 8 00000000
Huffman?code?table?10
x y hlen hcod
0 0 1 1
0 1 3 010
0 2 6 001010
0 3 8 00010111
0 4 9 000100011
0 5 9 000011110
0 6 9 000001100
0 7 1 00000010001
…… ……
7 7 11 00000000000
In each original Huffman code table, list item x, y and hlen and hcod are arranged.In each original Huffman code table for quadruples, list item v, w, x, y and hlen and hcod are arranged.The input of hcod during as the output in when coding and decoding, (x, y) or (v, w, x, the output when input during y) as coding and decoding, hlen only is an aid illustration, its value is identical with the physical length of hcod.Because these original tables are to arrange by the ascending order of coding, when decoding inquiry, need look into according to hcod is counter, in fact very inconvenient, so generally can self-defined decoding table.The most basic form of these decoding tables is that original table is arranged by the hcod ascending order, simultaneously will (x, y, hlen) or (v, w, x, y hlen) carries out compression expression, during actual queries, with hcod as index, inquire corresponding decode value (x, y) or (v, w, x, y).
Because adopting the most basic above-mentioned mode to store, big table can waste very much internal memory, make that simultaneously the CPU cache CPU cache hit rate when loading internal memory is very low, cause carrying out the reduction of efficient, in order further to compress these decoding tables, particularly last several big tables, might need hcod is split into a plurality of parts, carry out the inquiry of multiple index mode.
Overall principle is not reduce the performance of decoding under acceptable situation simultaneously at the EMS memory occupation of maintenance table.
General decoding table is for to back table 13, and 15,16,24 need the consideration of complete 16 distribution, adopts 16 distribution to all tables are unified, perhaps also adopts multiple index to represent at the several tables that begin most.
In research and practice process to prior art, the present inventor finds:
1) if memory headroom has been wasted in 16 distribution of the unified employing of all tables, CPU cache hit rate is low;
2) if also adopt multiple index to represent at the several tables that begin most, just having saved a little memory headroom has still but increased many instruction numbers, has reduced performance;
So in the Hafman decoding of existing mpeg audio Layer III, the decoding table many performances of instruction too big or that decoding needs are low, do not reach the balance an of the best between the two.
Summary of the invention
The embodiment of the invention provides a kind of audio-frequency decoding method and device, the size of the Hafman decoding table that generates can be controlled at reasonable range, improve CPU cache hit rate, in conjunction with reducing the required instruction number of decoding inquiry, improved the efficient of Hafman decoding simultaneously.
A kind of audio-frequency decoding method according to resolving among the syntactic structure of table_select and the 2.4.2.7 specific descriptions of table_select being chosen corresponding Hafman decoding table in the 2.4.1.7 joint in the 11172-3 agreement, is characterized in that, comprising:
If the tabular value of the Hafman decoding table that parses is 1,2,3,5 or 6 o'clock:
Obtain first byte data in the described Hafman decoding table, the maximal value of hlen equates in the original Huffman code table of the value N of described data and 11172-3B.7, described Hafman decoding table adopts 8 storages, and begins from index 0 beginning sign successively from second byte of described Hafman decoding table;
When obtaining data to be decoded, obtain the N bit data, the value of described N bit data is M at every turn;
With described M as the data in the described Hafman decoding table of search index;
According to index is that the data decode of M goes out x, y and hlen.
A kind of audio decoding apparatus comprises:
First acquisition module, be used for when resolving according to the specific descriptions of table_select being chosen corresponding Hafman decoding table in to the syntactic structure of table_select and 2.4.2.7 in the 11172-3 agreement 2.4.1.7 joint, if the tabular value of the Hafman decoding table that parses is 1,2,3,5 or 6 o'clock, obtain first byte data in the described Hafman decoding table, the maximal value of hlen equates in the original Huffman code table of the value N of described data and 11172-3B.7, described Hafman decoding table adopts 8 storages, and remembers that index 0 begins to identify successively from second byte of described Hafman decoding table;
Second acquisition module when being used to obtain data to be decoded, according to described N, obtains the N bit data at every turn, and the value of described N bit data is M;
First enquiry module is used for according to described M, with described M as the data in the described Hafman decoding table of search index;
First parsing module, the data decode that is used for index according to enquiry module inquiry and is M goes out x, y and hlen.
The embodiment of the invention adopts in according to the 11172-3 agreement in the 2.4.1.7 joint resolves among the syntactic structure of table_select and the 2.4.2.7 specific descriptions of table_select being chosen corresponding Hafman decoding table, if the tabular value of the Hafman decoding table that parses is 1,2,3,5,6 o'clock, to tabular value is 1,2,3,5 or 6 Hafman decoding table adopts 8 storages, obtain earlier the Hafman decoding table the value N of first byte data, the maximal value of hlen in N and the original Huffman table equates, when obtaining data to be decoded, obtain the N bit data at every turn, the value of this N bit data is M, be the data in the search index Hafman decoding table again with M, and decode according to these data; This method with 8 compression storages, has been saved storage space to the Hafman decoding table, has improved the CPU cache hit rate of data read when decoding, does not increase the query statement number simultaneously, thereby improves decoding performance.
Description of drawings
Fig. 1 is the schematic flow sheet of embodiment of the invention audio-frequency decoding method;
Fig. 2 is the schematic flow sheet of embodiment of the invention audio-frequency decoding method;
Fig. 3 is the logical organization synoptic diagram of embodiment of the invention audio decoding apparatus;
Fig. 4 is the logical organization synoptic diagram of embodiment of the invention audio decoding apparatus.
Embodiment
The embodiment of the invention provides a kind of audio-frequency decoding method, and the embodiment of the invention also provides corresponding device thereof.Below be elaborated respectively.
See also Fig. 1, first embodiment of embodiment of the invention sound intermediate frequency coding/decoding method is concrete:
Initial and the termination procedure of once concrete Hafman decoding depend on the syntactic structure definition of function Huffmancodebits () in the 11172-3 agreement 2.4.1.7 joint and 2.4.2.7 save in to the semantic description of Huffmancodebits (), when utilizing the Hafman decoding table to decode, according to resolving among the syntactic structure of table_select and the 2.4.2.7 specific descriptions of table_select being chosen corresponding Hafman decoding table in the 2.4.1.7 joint in the 11172-3 agreement to mpeg audio Layer III;
101, obtain first byte data in the Hafman decoding table;
If the tabular value of the Hafman decoding table that parses is 1,2,3,5,6 o'clock, obtain first byte data in the Hafman decoding table, the maximal value of hlen equates in the original Huffman code table of the value N of these data and 11172-3B.7, wherein, the Hafman decoding table adopts 8 storages, and remembers that index 0 begins to identify successively from second byte of Hafman decoding table.
When 102, obtaining data to be decoded, obtain the N bit data at every turn;
When obtaining decoded data, obtain the N bit data at every turn, wherein, the value of N bit data is M.
103, with M as the data in the search index Hafman decoding table.
104, be that the data decode of M goes out x, y and hlen according to index.
Further, before data are decoded, need elder generation to generate the Hafman decoding table according to the original Huffman code table of 11172-3B.7, wherein, the Hafman decoding table of generation carries out ascending order by hcod to be arranged, and satisfies equation (1):
2 ^ xbits > x max 2 ^ ybits > y max 2 ^ hlenbits > hlen max xbits + ybits + hlenbits ≤ 8
Wherein, xbits represents that x represents with xbits bit, ybits represents that y represents with ybits bit, hlenbits represents that hlen represents with hlenbits bit, and xmax, ymax and hlenmax are respectively maximal value, the maximal value of y and the maximal value of hlen of x in the original code table of 11172-3B.7; For each row of the Huffman code table after the same ascending order arrangement, will store 2^ continuously according to each expression value of above-mentioned equation (1) calculating gained (hlenmax-hlen)Inferior.
In the present embodiment, in according to the 11172-3 agreement, resolve among the syntactic structure of table_select and the 2.4.2.7 specific descriptions of table_select being chosen corresponding Hafman decoding table in the 2.4.1.7 joint, if the tabular value of the Hafman decoding table that parses is 1,2,3,5,6 o'clock, to tabular value is that 1,2,3,5,6 Hafman decoding table compresses storage with 8, rather than 16, saved storage space, improved the CPU cache hit rate of data read, do not increase simultaneously the query statement number, thereby improve decoding performance.
See also Fig. 2, second embodiment of embodiment of the invention sound intermediate frequency coding/decoding method is concrete:
Initial and the termination procedure of once concrete Hafman decoding depend on the syntactic structure definition of Huffmancodebits () in the 11172-3 agreement 2.4.1.7 joint and 2.4.2.7 save in to the semantic description of Huffmancodebits (), when utilizing the Hafman decoding table to decode, according to resolving among the syntactic structure of table select and the 2.4.2.7 specific descriptions of table select being chosen corresponding Hafman decoding table in the 2.4.1.7 joint in the 11172-3 agreement to mpeg audio Layer III;
Step 201 to step 204 please refer to step 101 among the embodiment one to step 104;
205, get V position data to be decoded and in the zone one of Hafman decoding table, inquire about, from Query Result, obtain hlen as the one-level index;
If the tabular value of the Hafman decoding table that parses is 7,8,9,10,11 or 12 o'clock, get V position data to be decoded and in the zone one of Hafman decoding table, inquire about as the one-level index, from Query Result, obtain hlen; Wherein, and note index 0 begin to identify successively from first byte of described Hafman decoding table; V is a critical value of cutting apart hcod, each hcod in the original Huffman code table of 11172-3B.7 is divided into 2 parts, if hlen is greater than V, then first's length of hcod is V, second portion length is leftlen, and promptly hlen deducts the value of V, if hlen is smaller or equal to V, then first's length of hcod is hlen, and second portion length is 0; The Hafman decoding table adopts 16 and 8 to mix storage, each table is divided into two storage areas, first storage area is stored a V power value of 2 altogether, each value is with 16 storages, second storage area length tblbytes of storage list altogether deducts the difference value that 2 V adds 1 power, and each is worth with 8 storages;
206, judge whether the value of inquiring about the hlen that obtains is zeros;
In step 205, from Query Result, obtain the value of hlen, judge then whether the value of this hlen is 0, be that the value of 0 expression hlen is zeros, otherwise be not zeros that zeros is expressed as 0.
If the hlen of 207 Query Results is not zeros, then from Query Result, obtain x, y and hlen;
Be not zeros if in step 206, judge hlen, then from Query Result, can obtain x, y and hlen.
If the hlen of 208 Query Results is zeros, that then obtains the byte offset offset of start address of Hafman decoding table section two and secondary index district reads length l eftlenmax;
If judge hlen in step 206 is zeros, and that then obtains the byte offset offset of start address of Hafman decoding table section two and secondary index district reads length l eftlenmax; Wherein, leftlenmax be mutually on the same group in the maximal value of leftlen, so-calledly be meant the set of the row at identical all hcod places, V position before the hcod during greater than V mutually on the same group as hlen.
209, read leftlenmax position data to be decoded and inquire about in zone two according to offset, decode x according to Query Result, y and hlen as secondary index;
In step 208, obtain the byte offset offset of start address of Hafman decoding table section two and secondary index district read length l eftlenmax after, reading leftlenmax position data to be decoded again inquires about in the zone two of Hafman decoding table according to offset as secondary index, decode x according to Query Result, y and hlen, wherein, hlen=leftlen+V.
Further, before data are decoded, need elder generation to generate the Hafman decoding table according to the original Huffman code table of 11172-3B.7, wherein, this Hafman decoding table carries out ascending order according to hcod to be arranged, and the tabular value of generation is that 7,8,9,10,11 or 12 Hafman decoding table satisfies equation (2):
2 ^ xbits > x max 2 ^ ybits > y max 2 ^ hlenbits > V xbits + ybits + hlenbits ≤ 16
Wherein, xbits represents that x represents with xbits bit, ybits represents that y represents with ybits bit, and hlenbits represents that hlen represents with hlenbits bit, and xmax and ymax are respectively the maximal value of x in the original code table of 11172-3B.7 and the maximal value of y.
Further, the tabular value of generation is that 7,8,9,10,11 or 12 Hafman decoding table also satisfies equation (3):
2 ^ offsetbits ≥ tblbytes 2 ^ leftlen max bits > leftlen max zerosbits = hlenbits zeroslsbpos = hlenmsbpos zerosmsbpos = hlenmsbpos offsetbits + leftlen max bits + zerosbits ≤ 16
Wherein, offsetbits represents that offset represents with offsetbits bit, leftlenmaxbits represents that leftlenmax represents with leftlenmaxbits bit, zerosbits represents that zeros represents with zerosbits bit, zeroslsbpos represents the least significant bit (LSB) of zeros in storage area, zerosmsbpos represents the highest significant position of zeros in storage area, hlenlsbpos represents the least significant bit (LSB) of hlen in storage area, and hlenmsbpos represents the highest significant position of hlen in storage area.
Further, each row of the Huffman code table after arranging for same ascending order, if hlen smaller or equal to V, (x, y hlen) store 2^ continuously then will to calculate each expression value of gained according to equation (2) (V-hlen)Inferior in zone one; X wherein, y, the relative order of hlen is arbitrarily; If hlen contains mutually on the same group first hcod greater than V and this row, (offset, leftlenmax zeros) store in the zone one, and the value of offset is increased 2^ then will to calculate each expression value of gained according to equation (3) LeftlenmaxWherein, offset, leftlenmax, the relative order of zeros is arbitrarily; If hlen is greater than V, the storage representation in zone two be (leftlen), wherein, x is with the xbits bit representation for x, y, and y is with the ybits bit representation, and leftlen is with the leftlenbits bit representation, and xbits, ybits and leftlenbits satisfy equation (4):
2 ^ xbits > x max 2 ^ ybits > y max 2 ^ lefthlenbits > leftlen xbits + ybits + lefthlenbits ≤ 8
And, will calculate each expression value (x, y, leftlen) the continuous storage 2^ in zone two of gained according to equation (4) (leftlenmax-leftlen)Inferior.
In the present embodiment, in according to the 11172-3 agreement, resolve among the syntactic structure of table_select and the 2.4.2.7 specific descriptions of table_select being chosen corresponding Hafman decoding table in the 2.4.1.7 joint, different situations according to the original Huffman code table of 11172-3B.7 are taked different storage modes to different Hafman decoding tables, if the tabular value of the Hafman decoding table that parses is 1,2,3,5,6 o'clock, the Hafman decoding table is compressed storage with 8, rather than 16, both saved storage space, improved the CPU cache hit rate of data read, do not increase simultaneously the query statement number, thereby improve decoding performance; If the tabular value of the Hafman decoding table that parses is 7,8,9,10,11 or 12 o'clock, the Hafman decoding table is carried out the compressed mixed storage with 16 and 8, both taken into account the characteristic that most of data only need the one query table to finish, make that instruction number is less and CPU cache hit rate is higher, simultaneously under the situation that needs secondary to table look-up, saved data storage capacity, make for complete 16 storage, to have higher CPU cache hit rate, can not increase extra instruction number again simultaneously.
Below be application examples of the present invention, concrete:
With the B.7 original Huffman code of ISO/IEC 11172-3 appendix table 1 is example, below is the raw data of Huffman code table 1:
Huffman?code?table?1
x y hlen hcod
0 0 1 1
0 1 3 001
1 0 2 01
1 1 3 000
In the original Huffman code table of this 11172-3B.7, the maximal value hlenmax of hlen is 3, and hlenmax is stored in first byte of adjusted Hafman decoding table with 8 bit representations, is 0x03;
Original Huffman code table 1 is carried out ascending order according to hcod arrange, concrete:
Huffman?code?table?1
x y hlen hcod
1 1 3 000
0 1 3 001
1 0 2 01
0 0 1 1
Remember that the maximum x in the Huffman code table after same ascending order is arranged is xmax, maximum y is ymax, for each row in this Huffman code table, the storage and uniform of computational solution code value represent (x, y, hlen), x wherein, y, the relative order of hlen is arbitrarily, x is with the xbits bit representation, y is with the ybits bit representation, and hlen is with the hlenbits bit representation, and xbits, ybits, hlenbits satisfy following equation (1):
2 ^ xbits > x max 2 ^ ybits > y max 2 ^ hlenbits > hlen max xbits + ybits + hlenbits ≤ 8
Each value of this method for expressing is with 8 storages, for each row in the Huffman code table after the same ascending order arrangement, with (it is inferior hlen) to store 2^ (hlenmax-hlen) according to the value of equation (1) calculating gained continuously with 8 for x, y.
In order to decode conveniently, general xbits that can these tables are corresponding, ybits and hlenbits are arranged to the same, with xbits=2, ybits=2, hlenbits=4 are example, because the xmax=1 of Huffman code table 1, ymax=1, hlenmax=3 can set up so this is provided with, and, because Huffman code table 1,2,3,5,6 xmax=3, ymax=3, hlenmax≤8 are so this setting also can be set up.Be provided with down at this, the decoding table of final Huffman code table 1 to 6 can be represented with 9,65,65,257,129 bytes respectively.
(x, y, hlen) according to the value of equation (1) with 8 storage computation gained, as shown in the table:
Table 1
Figure BDA0000040923380000102
In this adjusted Hafman decoding table, first byte 0x03 is hlenmax, and effectively index is since second byte, and note is from index 0.
During actual the decoding, can finish by the method for once tabling look-up.For all values of this adjusted Hafman decoding table, it reads length and fixes, i.e. first byte hlenmax of each table.Read the hlenmax bit data at every turn, with its value as search index according to the data of equation (1) with 8 storage computation gained, according to actual xbits, the setting of ybits and hlenbits is decoded with the data found, then can draw actual x, the value of y and hlen.
For simplifying the description process of hcod decoding, idealized model below is set only constitutes by hcod, promptly suppose not decode linbitsx, signx, linbitsy, signy.Comprise linbitsx, signx, linbitsy, signy actual decode procedure can referring in the syntactic structure of Huffmancodebits () in the 11172-3 2.4.1.7 joint and the 2.4.2.7 joint to the semantic description of Huffmancodebits (), actual hcod decoding process is identical with the hcod decoding process in the idealized model.The order of representation of hcod is the bslbf of defined among the 11172-3, i.e. bit string, left bit first (Bit String of the bit priority that keeps left).Be initiated with example with data to be decoded under the idealized model from 00101011001, and establish decodable significant bit length more than or equal to 11, the circulation when promptly having decoded this string data among the Huffmancodebits () is limit or also not limit just, and is concrete:
Get first byte 0x03 in the adjusted Hafman decoding table, from data to be decoded the 0th begins to get 3 bit data then, promptly 001, again with 001 value, promptly 1 as index since 0, promptly since second byte, inquiry is according to the data of equation (1) with the storage of 8 storage computation gained, obtain data 0x13, with data 0x13 according to xbits=2, ybits=2, the setting of hlenbits=4 is decoded and is obtained x=00, y=01, hlen=0011, the actual effective length of this decoding is the value of hlen of decoding, promptly 3, the x=0 of decimal representation, y=1;
Get 3 bit data since the 3rd again, promptly 010, again with 010 value, promptly 2 as index since 0, promptly since second byte, inquiry is according to the data of equation (1) with the storage of 8 storage computation gained, obtain data 0x42, with data 0x42 according to xbits=2, ybits=2, the setting of hlenbits=4 is decoded and is obtained x=01, y=00, hlen=0010, the actual effective length of this decoding is the value of the hlen of decoding, promptly 2, the x=1 of decimal representation, y=0; Because the actual effective length of this decoding is 2, and actual 3 bit data of having got are decoded so last bit data of actual 3 bit data of getting need be left to next time;
Because last time, decoding stayed the one digit number certificate, so when fetching data, begin to get 3 bit data from this this bit data that stays, promptly get 3 bit data since the 5th, promptly 011, again with 011 value, promptly 3 as index since 0, promptly since second byte, inquiry is according to the data of equation (1) with the storage of 8 storage computation gained, obtain data 0x42, with data 0x42 according to xbits=2, ybits=2, the setting of hlenbits=4 is decoded and is obtained x=01, y=00, hlen=0010, the actual effective length of this decoding is the value of hlen of decoding, promptly 2, the x=1 of decimal representation, y=0; Because the actual effective length of this decoding is 2, and actual 3 bit data of having got are decoded so last bit data of actual 3 bit data of getting need be left to next time;
Because last time, decoding stayed the one digit number certificate, so when fetching data, begin to get 3 bit data from this this bit data that stays, promptly get 3 bit data since the 7th, promptly 100, again with 100 value, promptly 4 as index since 0, promptly since second byte, inquiry is according to the data of equation (1) with the storage of 8 storage computation gained, obtain data 0x01, with data 0x01 according to xbits=2, ybits=2, the setting of hlenbits=4 is decoded and is obtained x=00, y=00, hlen=0001, the actual effective length of this decoding is the value of hlen of decoding, promptly 1, the x=0 of decimal representation, y=0; Because the actual effective length of this decoding is 1, and actual 3 bit data of having got are decoded so inverse two bit data of actual 3 bit data of getting need be left to next time;
Because last time, decoding stayed two bit data, so when fetching data, begin to get 3 bit data from this first bit data that stays, promptly get 3 bit data since the 8th, promptly 001, again with 001 value, promptly 1 as index since 0, promptly since second byte, inquiry is according to the data of equation (1) with the storage of 8 storage computation gained, obtain data 0x13, with data 0x13 according to xbits=2, ybits=2, the setting of hlenbits=4 is decoded and is obtained x=00, y=01, hlen=0011, the actual effective length of this decoding is the value of hlen of decoding, promptly 3, the x=0 of decimal representation, y=1;
Data 00101011001 are finished decoding, in this example, with the B.7 original Huffman code of ISO/IEC 11172-3 appendix table 1 is that example is described, original Huffman code table 1 is compressed storage with 8, rather than 16, saved storage space, improved the CPU cache hit rate of data read, do not increase simultaneously the query statement number, thereby improve decoding performance.
Be example with the B.7 original Huffman code of ISO/IEC 11172-3 appendix table 7 again, original Huffman code table 7 carried out ascending order according to hcod arrange, concrete:
Huffman?code?table?7
x y hlen hcod
5 5 10 0000000000
4 5 10 0000000001
5 4 10 0000000010
5 3 10 0000000011
3 5 9 000000010
4 4 9 000000011
2 5 9 000000100
5 2 9 000000101
1 5 8 00000011
5 1 8 00000100
0 5 9 000001010
3 4 9 000001011
5 0 8 00000110
4 3 9 000001110
3 3 9 000001111
2 4 8 00001000
4 2 8 00001001
1 4 7 0000101
4 1 7 0000110
4 0 7 0000111
0 4 8 00010000
2 3 8 00010001
3 2 8 00010010
0 3 8 00010011
1 3 7 0001010
3 1 7 0001011
3 0 7 0001100
2 2 7 0001101
1 2 6 000111
2 1 5 00100
0 2 6 001010
2 0 6 001011
1 1 4 0011
0 1 3 010
1 0 3 011
0 0 1 1
Each hcod in this Huffman code table is divided into 2 parts, and establishing the critical value of cutting apart length is v, if i.e. hlen>V, then first's length is V, and second portion length is (hlen-V), is designated as leftlen, if hlen≤V, then first's length is hlen, and second portion length is 0.According to this division methods, adjusted Huffman code table is divided into 2 zones, 2^V value contained in zone one, and each value adopts 16 storages, the total individual byte of 2^ (V+1); The number of zone two intermediate values and total bytes can learn that each value adopts 8 storages behind all provisional capital codings of each table.
Each value in the adjusted Huffman code table can draw as follows:
Below " mutually on the same group " be meant the set of the row at all hcod places that when the hlen>V preceding V position of hcod is identical, for example, V=8 is with in descending, hcod has 10, preceding 8 identical, all be 0, so following 4 behaviors mutually on the same group, and the maximal value of leftlen is 2, note leftlenmax=2;
5 5 10 0000000000
4 5 10 0000000001
5 4 10 0000000010
5 3 10 0000000011
Remember that the maximum x in the Huffman code table after same ascending order is arranged is xmax, maximum y is ymax, and the least significant bit (LSB) of hlen in storage representation is the hlenlsbpos position, and the highest significant position of hlen in storage representation is the hlenmsbpos position.For each row in the Huffman code table after the same ascending order arrangement, if hlen≤V calculates storage representation (x, y, hlen), x wherein, y, the relative order of hlen is arbitrarily, and x is with the xbits bit representation, and y is with the vbits bit representation, hlen is with the hlenbits bit representation, and xbits, ybits, hlenbits satisfy following equation (2):
2 ^ xbits > x max 2 ^ ybits > y max 2 ^ hlenbits > V xbits + ybits + hlenbits ≤ 16
Each value of this method for expressing is with 16 storages.
Remember that adjusted Hafman decoding literary name joint length is tblbytes.And note offset represents the byte offset (the initial offset of each table is 2^ (V+1)) with respect to each table start address, leftlenmax represents mutually the maximal value of middle leftlen on the same group, zeros represents 0, the least significant bit (LSB) of zeros in storage representation is the zeroslsbpos position, and the highest significant position of zeros in storage representation is the zeromsbpos position.For each row in the Huffman code table after the same ascending order arrangement, if hlen>V, and this row contains phase first hcod on the same group, then calculate storage representation (offset, leftlenmax, zeros), offset wherein, leftlenmax, the relative order of zeros is arbitrarily, offset is with the offsetbits bit representation, leftlenmax is with the leftlenmaxbits bit representation, and zeros represents with zerosbits, and offsetbits, leftlenmaxbits, zerosbits satisfy following equation (3):
2 ^ offsetbits ≥ tblbytes 2 ^ leftlen max bits > leftlen max zerosbits = hlenbits zeroslsbpos = hlenmsbpos zerosmsbpos = hlenmsbpos offsetbits + leftlen max bits + zerosbits ≤ 16
Each value of this method for expressing is with 16 storages.
For each row in the Huffman code table after the same ascending order arrangement, if hlen≤V, with (it is inferior in zone one hlen) to store 2^ (V-hlen) according to the value of equation (2) calculating gained continuously with 16 for x, y.For each row in the Huffman code table after the same ascending order arrangement, if hlen>V and this row contain phase first hcod on the same group, with (offset, leftlenmax, zeros) value of calculating gained according to equation (3) stores zone one into and the value of offset is increased 2^leftlenmax with 16.If hlen>V, the calculating storage representation (leftlen), wherein x is with the xbits bit representation for x, y, and y is with the ybits bit representation, and leftlen is with the leftlenbits bit representation, and xbits, and ybits, leftlenbits satisfy following equation (4):
2 ^ xbits > x max 2 ^ ybits > y max 2 ^ leftlenbits > leftlen xbits + ybits + leftlenbits ≤ 8
The value in each zone two of this method for expressing is with 8 storages, and (leftlen) storage 2^ (leftlenmax-leftlen) is inferior in zone two continuously with 8 for x, y with each.
In order to decode conveniently, generally can be with the xbits of these table correspondences, ybits is arranged to the same with hlenbits, with V=8, xbits=4 in equation (2) and (3), ybits=4, hlenbits=4, offsetbits=10, leftlenmaxbits=2, zerosbits=4, and xbits=3 in the equation (4), ybits=3, leftlenbits=2 are example, because the xmax=5 of Huffman code table 7, ymax=5, leftlenmax=2, and the tblbytes of the decoding table of final adjusted Huffman code table 7 is 524 under this is provided with, the above formula of substitution can be set up in verification setting; And, because the xmax=7 of Huffman code table 7 to 12, ymax=7, leftlenmax=3, and the tblbytes of the decoding table of final Huffman code table 7 to 12 is respectively 524 under this is provided with, 530,516,562,542,528, the above formula of substitution can be set up in verification setting.
This compression storage representation method is represented with 2 grades of index stores, and is not adopted one-level index stores used among the Huffman code table1 to 6 to represent.Because if represent that with the one-level index stores data volume can be too big, can make the CPU cache hit rate of data read reduce simultaneously again, concrete:
Table 2
Figure BDA0000040923380000161
Figure BDA0000040923380000171
In last table, data subscript index is since 0 counting, and in zone one and zone two, all data are stored in small end syllable sequence mode, be that the internal memory low address is deposited low byte, the internal memory high address is deposited high byte, with 0x96B6 is example, and byte subscript index is that 512 data are 0xB6, and byte subscript index is that 513 data are 0x96.
During actual the decoding, read the V bit data earlier as the inquiry in zone one of one-level index, if the hlen of Query Result is not 0, then decodable code goes out actual x, y and hlen, if the hlen of Query Result is 0, that promptly represented is zeros, and what then can obtain corresponding offset and secondary index district reads length l eftlenmax, reading the leftlenmax bit data again inquires about according to skew in zone two as secondary index, then decodable code goes out actual x, y and hlen, this hlen=V+leftlen.
Describe for simplifying, set up the idealized model identical with precedent.Be initiated with example with data to be decoded under the idealized model from 1,010 0,010 1,111 1,000 0,001 01, and establish decodable significant bit length more than or equal to 22, circulation when promptly having decoded this string data among the Huffmancodebits () is limit or also not limit just, and is concrete:
If V=8, get 8 data to be decoded since the 0th, promptly 10100010 as the inquiry in zone one of one-level index, promptly with 10100010 value, and promptly 162, search the subscript index to the zone in one and be 162 data, be 0x0001, with data 0x0001 according to xbits=4, ybits=4, the setting of hlenbits=4 is decoded and is obtained x=0000, y=0000, hlen=0001, i.e. x=0, y=0, hlen=1, the actual effective length of this decoding is the value of hlen of decoding, promptly 1, the x=0 of decimal representation, y=0;
Because last time, decoding stayed seven bit data, so when fetching data, begin to get 8 bit data from this first bit data that stays, promptly get 8 data to be decoded since the 1st, promptly 01000101 as the inquiry in zone one of one-level index, promptly with 01000101 value, promptly 69, search the subscript index in the zone one and be 69 data, i.e. 0x0013, with data 0x0013 according to xbits=4, ybits=4, hlenbits=4, setting decode and obtain x=0000, y=0001, hlen=0011, the actual effective length of this decoding is the value of hlen of decoding, promptly 3, the x=0 of decimal representation, y=1;
Because last time, decoding stayed the four figures certificate, so when fetching data, begin to get 8 bit data from this first bit data that stays, promptly get 8 data to be decoded since the 4th, promptly 00101111 as the inquiry in zone one of one-level index, promptly with 00101111 value, promptly 47, search the subscript index in the zone one and be 47 data, i.e. 0x0206, with data 0x0206 according to xbits=4, ybits=4, hlenbits=4, setting decode and obtain x=0010, y=0000, hlen=0110, the actual effective length of this decoding is the value of hlen of decoding, promptly 6, the x=2 of decimal representation, y=0;
Because last time, decoding stayed two bit data, so when fetching data, begin to get 8 bit data from this first bit data that stays, promptly get 8 data to be decoded since the 10th, promptly 11100000 as the inquiry in zone one of one-level index, promptly with 11100000 value, promptly 224, search the subscript index in the zone one and be 224 data, i.e. 0x0001, with data 0x0001 according to xbits=4, ybits=4, hlenbits=4, setting decode and obtain x=0000, y=0000, hlen=0001, the actual effective length of this decoding is the value of hlen of decoding, promptly 1, the x=0 of decimal representation, y=0;
Because last time, decoding stayed seven bit data, so when fetching data, begin to get 8 bit data from this first bit data that stays, promptly get 8 data to be decoded since the 11st, promptly 11000000 as the inquiry in zone one of one-level index, promptly with 11000000 value, promptly 192, search the subscript index in the zone one and be 192 data, i.e. 0x0001, with data 0x0001 according to xbits=4, ybits=4, hlenbits=4, setting decode and obtain x=0000, y=0000, hlen=0001, the actual effective length of this decoding is the value of hlen of decoding, promptly 1, the x=0 of decimal representation, y=0;
Because last time, decoding stayed seven bit data, so when fetching data, begin to get 8 bit data from this first bit data that stays, promptly get 8 data to be decoded since the 12nd, promptly 10000001 as the inquiry in zone one of one-level index, promptly with 10000001 value, promptly 129, search the subscript index in the zone one and be 129 data, i.e. 0x0001, with data 0x0001 according to xbits=4, ybits=4, hlenbits=4, setting decode and obtain x=0000, y=0000, hlen=0001, the actual effective length of this decoding is the value of hlen of decoding, promptly 1, the x=0 of decimal representation, y=0;
Because last time, decoding stayed seven bit data, so when fetching data, begin to get 8 bit data from this first bit data that stays, promptly get 8 data to be decoded since the 13rd, promptly 00000010 as the inquiry in zone one of one-level index, promptly with 00000010 value, promptly 2, search the subscript index in the zone one and be 2 data, i.e. 0x8190, solving hlen is zeros, so need the inquiry to the secondary index district; Again with data 0x8190 according to offsetbits=10, the setting of leftlenmaxbits=2 is decoded and is obtained offset=1000000110, leftlenmax=01, be offset=518, leftlenmax=1, read leftlenmax position data to be decoded, promptly 1 data 1 to be decoded is inquired about to the secondary index district as secondary index, and 518 bytes of reference position of inquiry offset distance table are because secondary index is 1, so be 519 data at secondary index district inquiry subscript index, be 0xA9, again with data 0xA9 according to xbits=3, ybits=3, the setting of lefthlenbits=2 is decoded and is obtained x=101, y=010, lefthlen=01, the i.e. x=5 of decimal representation, y=2, hlen=lefthlen+V=9.
So far, data 1,010 0,010 1,111 1,000 0,001 01 are finished decoding, in this example, with the B.7 original Huffman code of ISO/IEC11172-3 appendix table 7 is that example is described, original Huffman codetable 7 is carried out the compressed mixed storage with 16 and 8, both taken into account the characteristic that most of data only need the one query table to finish, make that instruction number is less and CPU cache hit rate is higher, simultaneously under the situation that needs secondary to table look-up, saved data storage capacity, make for complete 16 storage, to have higher CPU cache hit rate, can not increase extra instruction number again simultaneously.
In above-mentioned application examples, with the actual conditions of Hafman decoding table according to each table, the Hafman decoding table is compressed storage with 8, perhaps carry out the compressed mixed storage with 16 and 8, make the size of Hafman decoding table be controlled at reasonable range, have high CPU cache hit rate, and the query statement number is less, thereby improves the efficient of decoding.
See also Fig. 3, embodiment of the invention sound intermediate frequency decoding device embodiment, concrete:
First acquisition module 301, be used for when resolving according to the specific descriptions of table select being chosen corresponding Hafman decoding table in to the syntactic structure of table_select and 2.4.2.7 in the 11172-3 agreement 2.4.1.7 joint, if the tabular value of the Hafman decoding table that parses is 1,2,3,5 or 6 o'clock, obtain first byte data in the Hafman decoding table, the maximal value of hlen equates in the original Huffman code table of the value N of these data and 11172-3B.7, the Hafman decoding table adopts 8 storages, and remembers that index 0 begins to identify successively from second byte of described Hafman decoding table;
Second acquisition module 302, when being used to obtain data to be decoded, the value N of the data of obtaining according to first acquisition module 301 obtains the N bit data at every turn, and wherein, the value of N bit data is M;
First enquiry module 303 is used for the value M of the data obtained according to second acquisition module 302, with M as the data in the search index Hafman decoding table;
First parsing module 304, the data decode that is used for index according to enquiry module inquiry and is M goes out x, y and hlen.
Further, see also Fig. 4, audio decoding apparatus also comprises:
Second enquiry module 305, be used for when resolving according to the specific descriptions of table select being chosen corresponding Hafman decoding table in to the syntactic structure of table select and 2.4.2.7 in the 11172-3 agreement 2.4.1.7 joint, if the tabular value of the Hafman decoding table that parses is 7,8,9,10,11 or 12 o'clock, get V position data to be decoded and in the zone one of Hafman decoding table, inquire about, from Query Result, obtain hlen as the one-level index; Wherein, and note index 0 begin to identify successively from first byte of described Hafman decoding table; V is a critical value of cutting apart hcod, each hcod in the original Huffman code table of 11172-3B.7 is divided into 2 parts, if hlen is greater than V, then first's length of hcod is V, second portion length is leftlen, and promptly hlen deducts the value of V, if hlen is smaller or equal to V, then first's length of hcod is hlen, and second portion length is 0; The Hafman decoding table adopts 16 and 8 to mix storage, each table is divided into two storage areas, first storage area is stored a V power value of 2 altogether, each value is with 16 storages, second storage area length tblbytes of storage list altogether deducts the difference value that 2 V adds 1 power, and each is worth with 8 storages;
Judge module 306 is used to judge whether the value that second enquiry module 305 is inquired about the hlen that obtains is zeros, and wherein, zeros represents 0;
Second decoder module 307 is used for then can obtaining x from the Query Result of second enquiry module, y and hlen when judge module 306 is judged hlen not for zeros;
The 3rd acquisition module 308, be used for when judge module 306 is judged hlen and is zeros, that then obtains the byte offset offset of start address of Hafman decoding table section two and secondary index district reads length l eftlenmax, wherein, leftlenmax be mutually on the same group in the maximal value of leftlen, refer to the set of the row at identical all hcod places, V position before the hcod during greater than V mutually on the same group as hlen;
The 3rd inquiry module 309 is used for the leftlenmax and the offset that obtain according to the 3rd acquisition module 308, reads leftlenmax position data to be decoded and inquires about in zone two according to offset as secondary index, obtains Query Result;
The 3rd decoder module 310 is used for decoding x according to the Query Result of the 3rd inquiry module 309, y and hlen, wherein, hlen=leftlen+V.
In the present embodiment, with the actual conditions of Hafman decoding table according to each table, the Hafman decoding table is compressed storage with 8, perhaps carry out the compressed mixed storage with 16 and 8, make the size of Hafman decoding table be controlled at reasonable range, have high CPU cache hit rate, and the query statement number is less, thereby improves the efficient of decoding.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to finish by program, this program can be stored in the computer-readable recording medium, storage medium can comprise: ROM (read-only memory) (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc.
More than to audio-frequency decoding method that the embodiment of the invention provided and device * be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (12)

1. audio-frequency decoding method according to resolving among the syntactic structure of table_select and the 2.4.2.7 specific descriptions of table_select being chosen corresponding Hafman decoding table in the 2.4.1.7 joint in the 11172-3 agreement, is characterized in that, comprising:
If the tabular value of the Hafman decoding table that parses is 1,2,3,5 or 6 o'clock:
Obtain first byte data in the described Hafman decoding table, the maximal value of hlen equates in the original Huffman code table of the value N of described data and 11172-3B.7, described Hafman decoding table adopts 8 storages, and begins from index 0 beginning sign successively from second byte of described Hafman decoding table;
When obtaining data to be decoded, obtain the N bit data, the value of described N bit data is M at every turn;
With described M as the data in the described Hafman decoding table of search index;
According to index is that the data decode of M goes out x, y and hlen.
2. method according to claim 1 is characterized in that, described method also comprises:
If the tabular value of the Hafman decoding table that parses is 7,8,9,10,11 or 12 o'clock:
Get V position data to be decoded and in the zone one of described Hafman decoding table, inquire about, from Query Result, obtain hlen as the one-level index; Wherein, and note index 0 begin to identify successively from first byte of described Hafman decoding table; Described V is a critical value of cutting apart hcod, each hcod in the original Huffman code table of 11172-3B.7 is divided into 2 parts, if hlen is greater than V, then first's length of hcod is V, second portion length is leftlen, and promptly hlen deducts the value of V, if hlen is smaller or equal to V, then first's length of hcod is hlen, and second portion length is 0; Described Hafman decoding table adopts 16 and 8 to mix storage, each table is divided into two storage areas, first storage area is stored a V power value of 2 altogether, each value is with 16 storages, second storage area length tblbytes of storage list altogether deducts the difference value that 2 V adds 1 power, and each is worth with 8 storages;
Whether the value of judging the hlen that inquiry obtains is zeros, and described zeros represents 0;
If the hlen of Query Result is not zeros, then from described Query Result, can obtain x, y and hlen;
If the hlen of Query Result is zeros, that then obtains the byte offset offset of start address of described Hafman decoding table section two and secondary index district reads length l eftlenmax, described leftlenmax be mutually on the same group in the maximal value of leftlen, described phase refers to the set of the row at identical all hcod places, V position before the hcod during greater than V as hlen on the same group;
Read leftlenmax position data to be decoded and inquire about in zone two according to offset, decode x according to Query Result as secondary index, y and hlen, the value of described hlen equals the value that leftlen adds V.
3. according to claim 1 or the described method of claim 2, it is characterized in that described method also comprises:
Described Hafman decoding table carries out ascending order by hcod and arranges.
4. method according to claim 1 is characterized in that, described method also comprises:
Described tabular value is that x represents that with xbits bit y represents that with ybits bit hlen represents that with hlenbits bit described xbits, ybits and hlenbits satisfy equation (1) in each Hafman decoding table of 1,2,3,5,6:
2 ^ xbits > x max 2 ^ ybits > y max 2 ^ hlenbits > hlen max xbits + ybits + hlenbits ≤ 8
Wherein, xmax, ymax and hlenmax are respectively maximal value, the maximal value of y and the maximal value of hlen of x in the original code table of 11172-3B.7.
5. method according to claim 4 is characterized in that, described method also comprises:
For each row of the Huffman code table after the same ascending order arrangement, will store 2^ continuously according to each expression value of described equation (1) calculating gained (hlenmax-hlen)Inferior.
6. method according to claim 2 is characterized in that, described method also comprises:
Described tabular value is in each Hafman decoding table of 7,8,9,10,11 or 12, x represents with xbits bit, y represents that with ybits bit hlen represents that with hlenbits bit described xbits, ybits and hlenbits satisfy equation (2):
2 ^ xbits > x max 2 ^ ybits > y max 2 ^ hlenbits > V xbits + ybits + hlenbits ≤ 16
Wherein, xmax and ymax are respectively the maximal value of x in the original code table of 11172-3B.7 and the maximal value of y.
7. method according to claim 6 is characterized in that, described method also comprises:
In the described Hafman decoding table, offset represents with offsetbits bit, leftlenmax represents that with leftlenmaxbits bit zeros represents that with zerosbits bit described offsetbits, leftlenmaxbits and zerosbits satisfy equation (3):
2 ^ offsetbits ≥ tblbytes 2 ^ leftlen max bits > leftlen max zerosbits = hlenbits zeroslsbpos = hlenmsbpos zerosmsbpos = hlenmsbpos offsetbits + leftlen max bits + zerosbits ≤ 16
Wherein, zeroslsbpos represents the least significant bit (LSB) of zeros in storage area, zerosmsbpos represents the highest significant position of zeros in storage area, hlenlsbpos represents the least significant bit (LSB) of hlen in storage area, and hlenmsbpos represents the highest significant position of hlen in storage area.
8. method according to claim 7 is characterized in that, described method also comprises:
Each row of Huffman code table after arranging for same ascending order, if hlen smaller or equal to V, (x, y hlen) store 2^ continuously then will to calculate each expression value of gained according to described equation (2) (V-hlen)Inferior in zone one; Wherein, x, y, the relative order of hlen is arbitrarily.
9. method according to claim 8 is characterized in that, described method also comprises:
Each row for the Huffman code table after the same ascending order arrangement, if hlen contains phase first hcod on the same group greater than V and this row, then will calculate each expression value (offset of gained according to described equation (3), leftlenmax, zeros) store in the zone one, and the value of described offset is increased 2^ LeftlenmaxWherein, offset, leftlenmax, the relative order of zeros is arbitrarily.
10. method according to claim 9 is characterized in that, described method also comprises:
Each row for the Huffman code table after the same ascending order arrangement, if hlen is greater than V, the storage representation in zone two is (x, y, leftlen), wherein, x is with the xbits bit representation, y is with the ybits bit representation, and leftlen is with the leftlenbits bit representation, and xbits, ybits and leftlenbits satisfy equation (4):
2 ^ xbits > x max 2 ^ ybits > y max 2 ^ lefthlenbits > leftlen xbits + ybits + lefthlenbits ≤ 8
And, will calculate each expression value (x, y, leftlen) the continuous storage 2^ in zone two of gained according to described equation (4) (leftlenmax-leftlen)Inferior.
11. an audio decoding apparatus is characterized in that, comprising:
First acquisition module, be used for when resolving according to the specific descriptions of table_select being chosen corresponding Hafman decoding table in to the syntactic structure of table_select and 2.4.2.7 in the 11172-3 agreement 2.4.1.7 joint, if the tabular value of the Hafman decoding table that parses is 1,2,3,5 or 6 o'clock, obtain first byte data in the described Hafman decoding table, the maximal value of hlen equates in the original Huffman code table of the value N of described data and 11172-3B.7, described Hafman decoding table adopts 8 storages, and remembers that index 0 begins to identify successively from second byte of described Hafman decoding table;
Second acquisition module when being used to obtain data to be decoded, according to described N, obtains the N bit data at every turn, and the value of described N bit data is M;
First enquiry module is used for according to described M, with described M as the data in the described Hafman decoding table of search index;
First parsing module, the data decode that is used for index according to enquiry module inquiry and is M goes out x, y and hlen.
12. device according to claim 11 is characterized in that, described device also comprises:
Second enquiry module, be used for when resolving according to the specific descriptions of table_select being chosen corresponding Hafman decoding table in to the syntactic structure of table_select and 2.4.2.7 in the 11172-3 agreement 2.4.1.7 joint, if the tabular value of the Hafman decoding table that parses is 7,8,9,10,11 or 12 o'clock, get V position data to be decoded and in the zone one of Hafman decoding table, inquire about, from Query Result, obtain hlen as the one-level index; Wherein, and remember that index 0 begins to identify successively from first byte of described Hafman decoding table, described V is a critical value of cutting apart hcod, each hcod in the original Huffman code table of 11172-3B.7 is divided into 2 parts, if hlen is greater than V, then first's length of hcod is V, second portion length is leftlen, and promptly hlen deducts the value of V, if hlen is smaller or equal to V, then first's length of hcod is hlen, and second portion length is 0; Described Hafman decoding table adopts 16 and 8 to mix storage, each table is divided into two storage areas, first storage area is stored a V power value of 2 altogether, each value is with 16 storages, second storage area length tblbytes of storage list altogether deducts the difference value that 2 V adds 1 power, and each is worth with 8 storages;
Judge module is used to judge whether the value of inquiring about the hlen that obtains is zeros, and described zeros represents 0;
Second decoder module is used for then can obtaining x from the Query Result of second enquiry module, y and hlen when judge module is judged hlen not for zeros;
The 3rd acquisition module, be used for when judge module is judged hlen and is zeros, that then obtains the byte offset offset of start address of described Hafman decoding table section two and secondary index district reads length l eftlenmax, described leftlenmax be mutually on the same group in the maximal value of leftlen, described phase refers to the set of the row at identical all hcod places, V position before the hcod during greater than V as hlen on the same group;
The 3rd inquiry module is used for the leftlenmax and the offset that obtain according to the 3rd acquisition module, reads leftlenmax position data to be decoded and inquires about in zone two according to offset as secondary index, obtains Query Result;
The 3rd decoder module is used for decoding x according to the Query Result of the 3rd inquiry module, y and hlen, and the value of described hlen equals the value that leftlen adds V.
CN2010106073243A 2010-12-27 2010-12-27 Audio frequency decoding method and device Expired - Fee Related CN102136270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010106073243A CN102136270B (en) 2010-12-27 2010-12-27 Audio frequency decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010106073243A CN102136270B (en) 2010-12-27 2010-12-27 Audio frequency decoding method and device

Publications (2)

Publication Number Publication Date
CN102136270A true CN102136270A (en) 2011-07-27
CN102136270B CN102136270B (en) 2012-08-08

Family

ID=44296032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010106073243A Expired - Fee Related CN102136270B (en) 2010-12-27 2010-12-27 Audio frequency decoding method and device

Country Status (1)

Country Link
CN (1) CN102136270B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253993A (en) * 2013-06-28 2014-12-31 炬力集成电路设计有限公司 Multimedia data processing method, circuit and device
WO2015058633A1 (en) * 2013-10-21 2015-04-30 International Business Machines Corporation Efficient one-pass cache-aware compression
CN104717499A (en) * 2015-03-31 2015-06-17 豪威科技(上海)有限公司 Hoffman table storage method and Hoffman decoding method for JPEG
CN108520763A (en) * 2018-04-13 2018-09-11 广州醇美电子有限公司 A kind of date storage method, device, equipment and storage medium
CN109949819A (en) * 2019-03-14 2019-06-28 建荣半导体(深圳)有限公司 Save the method, apparatus and electronic equipment of the program and data space of audio processing

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050099326A1 (en) * 2003-11-07 2005-05-12 Manoj Singhal Low memory and MIPS efficient technique for decoding Huffman codes using multi-stage, multi-bits lookup at different levels
US20070024472A1 (en) * 2005-08-01 2007-02-01 Pulsus Technologies Computing circuits and method for running an MPEG-2 AAC or MPEG-4 AAC audio decoding algorithm on programmable processors
CN101051846A (en) * 2007-05-09 2007-10-10 上海广电(集团)有限公司中央研究院 Quick Huffman decoding method based on context
CN101325418A (en) * 2008-08-05 2008-12-17 北京海尔集成电路设计有限公司 Haffman quick decoding method based on probability table look-up
CN101741392A (en) * 2008-11-27 2010-06-16 安凯(广州)软件技术有限公司 Huffman decoding method for fast resolving code length

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050099326A1 (en) * 2003-11-07 2005-05-12 Manoj Singhal Low memory and MIPS efficient technique for decoding Huffman codes using multi-stage, multi-bits lookup at different levels
US20070024472A1 (en) * 2005-08-01 2007-02-01 Pulsus Technologies Computing circuits and method for running an MPEG-2 AAC or MPEG-4 AAC audio decoding algorithm on programmable processors
CN101051846A (en) * 2007-05-09 2007-10-10 上海广电(集团)有限公司中央研究院 Quick Huffman decoding method based on context
CN101325418A (en) * 2008-08-05 2008-12-17 北京海尔集成电路设计有限公司 Haffman quick decoding method based on probability table look-up
CN101741392A (en) * 2008-11-27 2010-06-16 安凯(广州)软件技术有限公司 Huffman decoding method for fast resolving code length

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253993A (en) * 2013-06-28 2014-12-31 炬力集成电路设计有限公司 Multimedia data processing method, circuit and device
CN104253993B (en) * 2013-06-28 2018-01-12 炬芯(珠海)科技有限公司 A kind of multimedia data processing method, circuit and device
WO2015058633A1 (en) * 2013-10-21 2015-04-30 International Business Machines Corporation Efficient one-pass cache-aware compression
US9252807B2 (en) 2013-10-21 2016-02-02 Globalfoundries Inc. Efficient one-pass cache-aware compression
CN104717499A (en) * 2015-03-31 2015-06-17 豪威科技(上海)有限公司 Hoffman table storage method and Hoffman decoding method for JPEG
CN104717499B (en) * 2015-03-31 2018-06-05 豪威科技(上海)有限公司 A kind of storage method of huffman table and the Hofmann decoding method for JPEG
CN108520763A (en) * 2018-04-13 2018-09-11 广州醇美电子有限公司 A kind of date storage method, device, equipment and storage medium
CN108520763B (en) * 2018-04-13 2021-07-16 广州醇美电子有限公司 Data storage method, device, equipment and storage medium
CN109949819A (en) * 2019-03-14 2019-06-28 建荣半导体(深圳)有限公司 Save the method, apparatus and electronic equipment of the program and data space of audio processing

Also Published As

Publication number Publication date
CN102136270B (en) 2012-08-08

Similar Documents

Publication Publication Date Title
CN102136270B (en) Audio frequency decoding method and device
CN103067022B (en) A kind of integer data lossless compression method, decompression method and device
CN102122960B (en) Multi-character combination lossless data compression method for binary data
CA2940382C (en) Method and apparatus for pyramid vector quantization indexing and de-indexing of audio/video sample vectors
CN102368385B (en) Backward block adaptive Golomb-Rice coding and decoding method and apparatus thereof
US20120130965A1 (en) Data compression method
ZA200408780B (en) Method and system for multi-rate lattice vector quantization of a signal.
CN103858433A (en) Hierarchical entropy encoding and decoding
CN104025190A (en) Energy lossless-encoding method and apparatus, audio encoding method and apparatus, energy lossless-decoding method and apparatus, and audio decoding method and apparatus
CN101751440A (en) Data compression/decompression method and device thereof
CN103544957A (en) Method and device for bit distribution of sound signal
CN103546161A (en) Lossless compression method based on binary processing
CN101945286B (en) Compression coding method, decoding decompression method, device and communication system
CN113852379A (en) Data encoding method, system, equipment and computer readable storage medium
CN101266795B (en) An implementation method and device for grid vector quantification coding
CN104156990A (en) Lossless compressed encoding method and system supporting oversize data window
CN105337617B (en) A kind of FSN files high-efficiency compression method
CN1925331B (en) Devices and methods for data compression and decompression
CN102982807B (en) Method and system for multi-stage vector quantization of speech signal LPC coefficients
CN100568284C (en) Computer graphics data coding apparatus, decoding device, Code And Decode method
CN104751850A (en) Vector quantization coding and decoding methods and devices for audio signals
CN104221287B (en) Vector quantizer
KR101030726B1 (en) Memory efficient multimedia huffman decoding method and apparatus for adapting huffman table based on symbol from probability table
CN103210590A (en) Compression method and apparatus
CN112885364B (en) Audio encoding method and decoding method, audio encoding device and decoding device

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120808

Termination date: 20171227

CF01 Termination of patent right due to non-payment of annual fee