CN1741394A  Method for computing nonlinear function in inverse quantization formula  Google Patents
Method for computing nonlinear function in inverse quantization formula Download PDFInfo
 Publication number
 CN1741394A CN1741394A CNA2005101029807A CN200510102980A CN1741394A CN 1741394 A CN1741394 A CN 1741394A CN A2005101029807 A CNA2005101029807 A CN A2005101029807A CN 200510102980 A CN200510102980 A CN 200510102980A CN 1741394 A CN1741394 A CN 1741394A
 Authority
 CN
 China
 Prior art keywords
 value
 multinomial
 spectral coefficient
 nonlinear function
 scope
 Prior art date
Links
Abstract
Description
Technical field
The present invention relates to the audio compression algorithm field, particularly relate to a kind of method of calculating the nonlinear function in the inverse quantization formula.
Technical background
AAC (Advanced Audio Coding) is that ISO MPEG is organized in a new audio compression algorithm of formulating in the MPEG2 compression standard, in the MPEG4 standard this algorithm has been carried out further enhancing afterwards.AAC is not compatible with the MP3 algorithm, compares with the MP3 algorithm, and AAC has adopted some new coding toolses, and therefore under identical compression quality, AAC is higher than the compression ratio of MP3.When realizing the AAC decoder on hardware device, because power consumption and cost, equipment is only supported fixedpoint operation usually, does not support floatingpoint operation.Fig. 1 has provided the structure chart of AAC decoder, and when realizing decoder on pointing device, owing to relate to nonlinear function in the inverse quantization formula in the AAC decoder, pointing device is not supported these nonlinear functions, and therefore needing to seek fast, fixed point realizes.
Usually, the inverse quantization in the AAC decoder adopts a kind of nonlinear floatingpoint quantization strategy.Wherein, the quantitative formula in the AAC decoder is:
X _{quant}(k)＝sign(X(k)).int{(X(k)·2 ^{1/4·(scfglobalg?ain)}) ^{3/4}+MAGIC_NUMBER}??(1)
X wherein _{Quant}(k) spectral coefficient after expression quantizes;
Spectral coefficient before X (k) expression quantizes;
Scf and globalgain are respectively scale factor and global gain factor;
What MAGIC_NUMBER defined is constant 0.4054.
Inverse quantization formula in the AAC decoder is:
X _{inquant}(k)＝sign(X _{quant}(k))·X _{quant}(k) ^{4/3}·2 ^{1/4·(gloabalg?ainscf)}???????(2)
X wherein _{Inquant}(k) spectral coefficient of expression reconstruction;
X _{Inquant}(k) difference of same X (k) is referred to as quantization error.
By inverse quantization formula (2) as seen, relate to two nonlinear power operations here.One is  X _{Quant}(k)  ^{4/3}, wherein  X _{Quant} scope 0～8191; Another is 2 ^{1/4 (globalgainscf)}When needs are realized the AAC decoder on fixed DSP, because pointing device is not supported these nonlinear floatingpoint operations.We need adopt following several mode that abovementioned nonlinear power operation is handled usually:
(1) lookup table method (lookup table): with the functional value of in store these a mathematical functions f of table (x) at each discrete point.The shortcoming of the method is to consume too many internal memory.Advantage is to save amount of calculation.It is not very big situation that this method relatively is fit to the independent variable dynamic range.
(2) lookup table+interpolation method (interpolated LUT): with respect to method 1, preserve the functional value of a few discrete points,, then adopt the method for interpolation if the value of function argument drops between in the table 2 with a little table.The method is trading off between internal memory and amount of calculation, and shortcoming is that interpolation precision is relatively poor.
(3) polynomial approximation (Polynomial approximation): the approximate nonlinear function of power series that uses x.As:
F (x)=a _{0}+ a _{1}X+a _{2}X ^{2}+ a _{3}X ^{3}+ a _{4}X ^{4}+ ... (3) advantage of polynomial approximation is:
(1) is fit to parallel computation structure, is particularly suitable for supporting SIMD (single instruction multiple data) or MIMD (multiple instruction multiple data)
(2) very little memory cost.Only need to preserve multinomial coefficient.
(3) has theoretical foundation.The Weierstrass approximation theory:
If f:[a, b] → R is a continuous function that is defined in closed interval [a, b], then there is a polynomial function P in ε＞0 _{ε}(x), make  f (x)P _{ε}(x) ＜ε x ∈ [a, b] polynomial approximation shortcoming is: when polynomial exponent number was higher, computing cost was bigger.
Therefore, demand proposing the method for the nonlinear function in a kind of more excellent calculating inverse quantization formula urgently.
Summary of the invention
In view of this, the objective of the invention is to propose a kind ofly calculate nonlinear function in the inverse quantization formula in conjunction with lookup table method and two kinds of methods of polynomial approximation.
In order to achieve the above object, the invention provides a kind of method of calculating the nonlinear function in the inverse quantization formula, it comprises:
Step 1, in the statistics code stream, the distribution probability of the spectral coefficient of quantification;
Step 2: in [0, B] scope that the spectral coefficient probability of occurrence that quantizes is concentrated relatively, adopt lookup table to calculate to nonlinear function, wherein the B value of order can be according to user's requirement setting;
Step 3: in spectral coefficient probability of occurrence nonconcentrated relatively [B～8191] scope, nonlinear function is calculated by multinomial being similar to.
Preferably, described nonlinear function is P (x)=X ^{4/3}, the wherein spectral coefficient of X, and 0≤X 〉=8191 for quantizing.
Preferably, it is characterized by: described inverse quantization formula is the inverse quantization formula that uses in inverse quantization formula in the AAC decoder or the MP3 compression standard.
Further preferred, the factor that need consider when setting the value that B order comprise power function value Y accuracy, needs storage spectral coefficient X number and appear at the interior spectral coefficient X probability of [0, B] scope.
Further preferred, the scope of the value that B is ordered is defined as [13,17].
Further preferred, the value that B is ordered is 15.
Further preferred, in the step 3 nonlinear function calculated specifically by polynomial approximation and comprise:
A:, determine multinomial and polynomial exponent number and coefficient according to requirement to precision and amount of calculation;
B: the value that goes out nonlinear function according to the polynomial computation of determining.
Further preferred, adopt minimax polynomial method to obtain multinomial among the step a.
Further preferred, adopt the Remez algorithm to calculate P (x)=x ^{4/3}The minimax multinomial of function, when polynomial exponent number was 6, when the interval of X was chosen for [0.5,1], multinomial coefficient was
a[7]＝{0.014840828668，0.503176802784，0.879620120995，0.649533912857，
0.417397714480，0.164851058049，0.029031186561}
Corresponding multinomial is:
P(x)＝a[0]+a[1]·x+a[2]·x ^{2}+a[3]·x ^{3}+a[4]·x ^{4}+a[5]·x ^{5}+a[6]·x ^{6}。
Further preferred, step b can be divided into following a few step calculating:
B1. the fixedpoint number of polynomial coefficients by using Q31 is represented;
B2. the scope with independent variable X normalizes to [0.5,1] interval by [16,8191], obtains new variables X '; X '=X2 ^{N}
N be among the X except the sign bit of highest order, the number of remaining sign bit.The special instruction of the available fixed DSP of calculating of N value is finished.Multiplication can be finished with shifting function.The X ' that obtain this moment is the fixedpoint number of Q31;
B3. utilize multinomial P (x) to calculate P (X ');
B4. recover the power value X of X by the power value P (X ') of X ' ^{4/3}
The present invention proposes to calculate nonlinear function in the inverse quantization of AAC decoder in conjunction with lookup table method and polynomial approximation, can both guarantee amount of calculation seldom under the very little prerequisite of memory consumption, can guarantee very high precision again simultaneously.
Description of drawings
Fig. 1 is the structure chart of AAC decoder in the prior art.
Embodiment
Can know that by formula (2) relate to two nonlinear functions in the AAC inverse quantization formula, one is  X _{Quant}(k)  ^{4/3}, wherein  X _{Quant} scope 0～8191; Another is 2 ^{1/4 (globalg ainscf)}Wherein 2 ^{1/4*x}The calculating of function is fairly simple, can adopt following method to calculate:
Y＝2 ^{1/4*x}
The strategy that adopts floatingpoint to quantize is expressed as two parts with the result of Y: mantissa part Y _{Fract}( Y _{Fract}≤1, adopt binary fractional representation) and 2 exponential part Y _{Exp}(adopting binary integer representation), then
Usually we only need be with 2 ^{0/4}, 2 ^{1/4}, 2 ^{2/4}, 2 ^{3/4}These four exponential quantities are saved in table[4 in the table] (array index is since 0), when x adopts the complement of two's two's complement to represent, Y _{Fract}=table[x﹠amp; 0x3], Y _{Exp}=x＞＞2. for example:
2^(4/4)＝2^(1)*2^(0/4)
2^(5/4)＝2^(1)*2^(1/4)
Obvious this method realizes only needing to preserve four exponential quantities, and related amount of calculation is also very little, has only a table lookup operation, " position with " operation and 2 shifting functions.
At nonlinear x in the AAC inverse quantization formula ^{4/3}Function (x ∈ [0,8191] calculating integer), the present invention propose to calculate nonlinear function in the inverse quantization of AAC decoder in conjunction with lookup table method and polynomial approximation, can be under the very little prerequisite of memory consumption, both guarantee amount of calculation seldom, and can guarantee very high precision again simultaneously.In addition, because AAC and MP3 adopt similar quantization strategy, the method that the present invention proposes also is applicable to the calculating of nonlinear function in the inverse quantization of MP3 decoding device.
Below with nonlinear x in the AAC inverse quantization formula ^{4/3}Function is an example, illustrates that the present invention calculates the method for the nonlinear function in the inverse quantization formula, and it comprises the steps:
Step 1: in the statistics AAC code stream, the distribution probability of the spectral coefficient X of quantification and adopt the precision of 32 fixedpoint numbers (1 bit sign position) when preserving power function value Y, wherein Y=X ^{4/3}
Added up in the AAC code stream distribution probability of the spectral coefficient X of quantification and adopt the precision of 32 fixedpoint numbers (1 bit sign position) when preserving power function value Y in the following table.
Step 2: in [0, B] scope that the X probability of occurrence is concentrated relatively, to nonlinear x ^{4/3}Function adopts lookup table to calculate, and wherein the B value of order can be according to user's requirement setting.This step is specific as follows:
From table the distribution of spectral coefficient X as can be seen, therefore the spectral coefficient X major part after the quantification is distributed in [0～15] scope, is that B is 15 o'clock in spectral coefficient X [0～15] scope, to nonlinear x ^{4/3}Function adopts lookup table to calculate.At this moment, only need preserve the power value Y of 16 spectral coefficient X in table, because the power value of most spectral coefficient can obtain by tabling lookup, therefore this strategy is under the situation of a large amount of saving internal memories, amount of calculation does not have big increase yet, has simultaneously to guarantee very high precision.It should be noted that, since B be worth choosing the accuracy that can influence power function value Y, needs storage spectral coefficient X number and appear at [0, B] the interior spectral coefficient X probability of scope, so, at other is in the example, generally can near 15, choose the B value to the requirement of abovementioned factor, such as 13,14,16,17 etc. according to the user.
Step 3: in spectral coefficient X probability of occurrence nonconcentrated relatively [B～8191] scope, to nonlinear x ^{4/3}Function can calculate by multinomial being similar to.
Introduce how to calculate Y=X below by polynomial approximation ^{4/3}, B value 15 in the specific embodiment of step 1 is so this step X belongs to the integer on [16,8191] interval.
Step a:, determine polynomial exponent number and coefficient according to requirement to precision and amount of calculation.
From realizing the angle consideration, we wish that polynomial exponent number is the smaller the better on the one hand, so both can reduce the multinomial coefficient { a that needs preservation _{i}, also can save amount of calculation simultaneously; We wish that the precision of polynomial approximation is high more good more but then; Therefore we need seek one group of multinomial coefficient { a _{i}, wish under minimum exponent number, to keep maximum precision.In actual applications, we seek usually and satisfy the multinomial that has minimum exponent number under the given accuracy criterion (accuracy criterion).Usually the several accuracy criteria that adopt have:
(1) minimizes maximum absolute error (Minimize maximum absolute error)
(2) absolute error of minimized average (Minimize mean absolute error)
(3) minimize mean square error (Minimize mean squared error) and in actual applications, generally will consider the approximate error under the worst case, therefore adopt accuracy criteria 1 usually, promptly minimize maximum absolute error.Usually this method is obtained polynomial approximation and be referred to as the minimaxpolynomial method.
In a certain embodiments, adopt the Remez algorithm to calculate P (x)=x ^{4/3}The minimax multinomial of function.What the crosspoint initial value of Remez recursive algorithm was chosen is the crosspoint of Chebyshev polynomials (Chebyshev).When polynomial exponent number was 6, when the interval of X was chosen for [0.5,1], maximum absolute error was 2.6 * 10 ^{8}The multinomial coefficient of this moment is
a[7]＝{0.014840828668，0.503176802784，0.879620120995，0.649533912857，
0.417397714480，0.164851058049，0.029031186561}
Corresponding multinomial is:
P(x)＝a[0]+a[1]·x+a[2]·x ^{2}+a[3]·x ^{3}+a[4]·x ^{4}+a[5]·x ^{5}+a[6]·x ^{6}
Step b: go out nonlinear x according to the polynomial computation of determining ^{4/3}The value of function.
Can be divided into following a few step calculates ((suppose the integer employing complement of two's two's complement represent 32 of word lengths):
The polynomial coefficient in (1) 6 rank can adopt the fixedpoint number of Q31 to represent;
(2) scope with independent variable X normalizes to [0.5,1] interval by [16,8191], obtains new variables X ';
X′＝X·2 ^{N}
N be among the X except the sign bit of highest order, the number of remaining sign bit.The special instruction of the available fixed DSP of calculating of N value is finished.Multiplication can be finished with shifting function.The X ' that obtain this moment is the fixedpoint number of Q31.
(3) utilize multinomial P (x) to calculate P (X ').The fastest realization needs 6 multiply operations and 6 add operations.In actual applications, consider suitably to adjust polynomial exponent number according to computational accuracy and amount of calculation.Following table has been listed the amount of calculation of polynomial approximation and the memory space relation with the multinomial exponent number.
(4) recover the power value X of X by the power value P (X ') of X ' ^{4/3}
X ^{4/3}＝(X·2 ^{N31}·2 ^{31N}) ^{4/3}＝(X·2 ^{N31}) ^{4/3}·2 ^{(31N)·4/3}
Last corresponding fixedpoint number is exactly P (X '), and a back calculating can be adopted to table lookup and obtain.Because therefore 16≤X≤8191,18≤N≤26 only need to preserve table[i]=2 ^{(13i) 4/3}0≤i=N18≤8.During specific implementation,, adopt pseudofloatingpoint to preserve table[i usually in order to guarantee precision] value, table_frac[I] preserve Q31 form mantissa, table_exp[I] preserve corresponding index (is the end with 2).Therefore recover the power value X of X ^{4/3}, only need 1 multiplication and 1 shifting function and twice table lookup operation.In addition, need extra memory space 18word to preserve table_frac and table_exp.
By the aforementioned calculation process as seen, the employing polynomial approximation of this paper proposition is calculated x ^{4/3}Method when the multinomial exponent number is 6, at very little memory consumption (25 word), had both kept very high precision (2.6 * 10 ^{8}), have only amount of calculation (6 additions, 7 multiplication, 2 displacements, 2 table lookup operations, 1 DSP special instruction) seldom again.
This shows, at nonlinear x in the AAC inverse quantization formula ^{4/3}The calculating of function (integer of x ∈ [0,8191]), the present invention propose to calculate nonlinear function in the inverse quantization of AAC decoder in conjunction with lookup table method and polynomial approximation, specifically promptly in [0, B] scope that the X probability of occurrence is concentrated relatively to nonlinear x ^{4/3}Function adopt lookup table calculate, in spectral coefficient X probability of occurrence nonconcentrated relatively [B～8191] scope, to nonlinear x ^{4/3}Function calculates by multinomial being similar to, and can both guarantee amount of calculation seldom under the very little prerequisite of memory consumption, can guarantee very high precision again simultaneously.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement etc., all should be included within protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number  Priority Date  Filing Date  Title 

CNB2005101029807A CN100508402C (en)  20050916  20050916  Method for computing nonlinear function in inverse quantization formula 
Applications Claiming Priority (1)
Application Number  Priority Date  Filing Date  Title 

CNB2005101029807A CN100508402C (en)  20050916  20050916  Method for computing nonlinear function in inverse quantization formula 
Publications (2)
Publication Number  Publication Date 

CN1741394A true CN1741394A (en)  20060301 
CN100508402C CN100508402C (en)  20090701 
Family
ID=36093636
Family Applications (1)
Application Number  Title  Priority Date  Filing Date 

CNB2005101029807A CN100508402C (en)  20050916  20050916  Method for computing nonlinear function in inverse quantization formula 
Country Status (1)
Country  Link 

CN (1)  CN100508402C (en) 
Cited By (6)
Publication number  Priority date  Publication date  Assignee  Title 

CN102577133A (en) *  20091009  20120711  汤姆森特许公司  Method and device for arithmetic encoding or arithmetic decoding 
CN104598432A (en) *  20131030  20150506  德克萨斯仪器股份有限公司  Computer and methods for solving math functions 
CN107247992A (en) *  20141230  20171013  合肥工业大学  A kind of sigmoid Function Fitting hardware circuits based on row maze approximate algorithm 
WO2017181342A1 (en) *  20160419  20171026  北京中科寒武纪科技有限公司  Nonlinear function computing device and method 
CN107590105A (en) *  20170901  20180116  中国科学院计算技术研究所  Towards the computing device and method of nonlinear function 
CN107589935A (en) *  20170901  20180116  中国科学院计算技术研究所  A kind of nonlinear function computing device and method 

2005
 20050916 CN CNB2005101029807A patent/CN100508402C/en not_active IP Right Cessation
Cited By (26)
Publication number  Priority date  Publication date  Assignee  Title 

CN104993833B (en) *  20091009  20180727  杜比国际公司  Arithmetic coding equipment and arithmetic decoding apparatus 
CN104967454B (en) *  20091009  20180703  杜比国际公司  Arithmetic coding equipment and arithmetic decoding apparatus 
CN102577133B (en) *  20091009  20150826  汤姆森特许公司  The method and apparatus of arithmetic coding or arithmetic decoding 
CN104967454A (en) *  20091009  20151007  汤姆森特许公司  Method and device for arithmetic encoding or arithmetic decoding 
CN104993833A (en) *  20091009  20151021  汤姆森特许公司  Method and device for arithmetic encoding or arithmetic decoding 
CN105071815A (en) *  20091009  20151118  汤姆森特许公司  Method and device for arithmetic encoding or arithmetic decoding 
CN105099464A (en) *  20091009  20151125  汤姆森特许公司  Method and device for arithmetic encoding or arithmetic decoding 
CN105099463A (en) *  20091009  20151125  汤姆森特许公司  Method and device for arithmetic encoding or arithmetic decoding 
CN105119607A (en) *  20091009  20151202  汤姆森特许公司  Method and device for arithmetic encoding or arithmetic decoding 
CN105119606A (en) *  20091009  20151202  汤姆森特许公司  Method and device for arithmetic encoding or arithmetic decoding 
US9219498B2 (en)  20091009  20151222  Thomson Licensing  Method and device for arithmetic encoding or arithmetic decoding 
CN105119607B (en) *  20091009  20181019  杜比国际公司  Arithmetic coding equipment and arithmetic decoding apparatus 
CN105071815B (en) *  20091009  20181016  杜比国际公司  Arithmetic coding equipment and arithmetic decoding apparatus 
CN102577133A (en) *  20091009  20120711  汤姆森特许公司  Method and device for arithmetic encoding or arithmetic decoding 
CN105119606B (en) *  20091009  20180831  杜比国际公司  Arithmetic coding equipment and arithmetic decoding apparatus 
US9973208B2 (en)  20091009  20180515  Dolby Laboratories Licensing Corporation  Method and device for arithmetic encoding or arithmetic decoding 
CN105099464B (en) *  20091009  20180629  杜比国际公司  The method and apparatus of arithmetic coding or arithmetic decoding 
CN105099463B (en) *  20091009  20180710  杜比国际公司  Arithmetic coding equipment and arithmetic decoding apparatus 
CN104598432A (en) *  20131030  20150506  德克萨斯仪器股份有限公司  Computer and methods for solving math functions 
US10430494B2 (en)  20131030  20191001  Texas Instruments Incorporated  Computer and methods for solving math functions 
CN107247992A (en) *  20141230  20171013  合肥工业大学  A kind of sigmoid Function Fitting hardware circuits based on row maze approximate algorithm 
CN107247992B (en) *  20141230  20190830  合肥工业大学  A kind of sigmoid Function Fitting hardware circuit based on column maze approximate algorithm 
WO2017181342A1 (en) *  20160419  20171026  北京中科寒武纪科技有限公司  Nonlinear function computing device and method 
CN107589935A (en) *  20170901  20180116  中国科学院计算技术研究所  A kind of nonlinear function computing device and method 
CN107590105B (en) *  20170901  20190201  中国科学院计算技术研究所  Computing device and method towards nonlinear function 
CN107590105A (en) *  20170901  20180116  中国科学院计算技术研究所  Towards the computing device and method of nonlinear function 
Also Published As
Publication number  Publication date 

CN100508402C (en)  20090701 
Similar Documents
Publication  Publication Date  Title 

JP5661836B2 (en)  Reducing errors during computation of inverse discrete cosine transform  
US9317482B2 (en)  Universal FPGA/ASIC matrixvector multiplication architecture  
US20190332945A1 (en)  Apparatus and method for compression coding for artificial neural network  
US8874794B2 (en)  Block floating point compression with exponent difference and mantissa coding  
JP3800551B2 (en)  Data processing apparatus and method  
JP3693988B2 (en)  Communication management system and communication management method  
CN1229975C (en)  Method of pantography according to scale for digital image in embedded system  
KR100502609B1 (en)  Encoder using low density parity check code and encoding method thereof  
Malvar  Adaptive runlength/GolombRice encoding of quantized generalized Gaussian sources with unknown statistics  
TWI419481B (en)  Low density parity check codec and method of the same  
US20200082254A1 (en)  Sparse convolutional neural network accelerator  
Lee et al.  Energyefficient image compression for resourceconstrained platforms  
KR100965704B1 (en)  2d transforms for image and video coding  
Isenburg et al.  Lossless compression of predicted floatingpoint geometry  
US9204169B2 (en)  System and method for compressing images and video  
JP5052541B2 (en)  Method for compressing SAR data and apparatus for encoding SAR data  
US8736467B2 (en)  Adaptive binarization for arithmetic coding  
Chen et al.  A highaccuracy adaptive conditionalprobability estimator for fixedwidth Booth multipliers  
CN105491389B (en)  The equipment that 4X4 for implementing for media coding is converted  
Moon et al.  An efficient decoding of CAVLC in H. 264/AVC video coding standard  
US8553994B2 (en)  Compressive sampling for multimedia coding  
TWI221388B (en)  Improved block transform and quantization for image and video coding  
CN1290339C (en)  Compressed moving image decompression device and image display device using the same  
EP1514355B1 (en)  Method and system for multirate lattice vector quantization of a signal  
JP2010501128A (en)  Efficient fixedpoint approximation of forward and inverse discrete cosine transforms 
Legal Events
Date  Code  Title  Description 

PB01  Publication  
C06  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  
C41  Transfer of patent application or patent right or utility model  
TR01  Transfer of patent right 
Effective date of registration: 20151109 Address after: 519031 Guangdong city of Zhuhai province Hengqin Baohua Road No. 6, room 105 478 Patentee after: GUANGDONG ZHONGXING ELECTRONICS CO., LTD. Address before: 100083, Haidian District, Xueyuan Road, Beijing No. 35, Nanjing Ning building, 15 Floor Patentee before: Beijing Vimicro Corporation 

DD01  Delivery of document by public notice 
Addressee: GUANGDONG ZHONGXING ELECTRONICS CO., LTD. Document name: Notification to Pay the Fees 

DD01  Delivery of document by public notice 
Addressee: GUANGDONG ZHONGXING ELECTRONICS CO., LTD. Document name: Notification of Termination of Patent Right 

CF01  Termination of patent right due to nonpayment of annual fee 
Granted publication date: 20090701 Termination date: 20160916 

CF01  Termination of patent right due to nonpayment of annual fee 