Summary of the invention
The object of the invention is to consider from computation complexity and compressibility two angles, propose the Mixed Entropy Coding method that the scope of application is wider.
The mixing entropy decoding method analyzed based on computation complexity that the present invention proposes, according to sample frequency, channel number, quantization digit, pretreatment module, the computational complexity of prediction module selects arithmetic and Golomb-rice entropy encoding/decoding, make use of arithmetic and Golomb-rice entropy encoding/decoding advantage separately, realizes the encoding and decoding to multi-channel audio signal.
In order to realize object of the present invention, a kind of multichannel lossless audio mixed encoding and decoding method is proposed, described method is according to sample frequency, channel number, quantization digit, the computational complexity of pretreatment module and prediction module selects arithmetic and Golomb-rice entropy encoding/decoding, utilizes arithmetic and Golomb-rice entropy encoding/decoding advantage separately, realizes the mixed encoding and decoding of arithmetic to multi-channel audio signal and Golomb-rice.
The Mixed Entropy Coding method of described arithmetic and Golomb-rice comprises concrete steps:
Pre-service is carried out to original audio input signal, reduces the redundance between signal, improve compressibility;
Audio input signal is predicted, removes the correlativity of data before and after original signal;
According to audio data samples frequency, channel number, prediction module complexity parameter, pretreatment module complexity parameter, audio data characteristics parameter combinations information, arranges the threshold value selecting arithmetic entropy coding and Golomb-Rice entropy code;
The mixing entropy coding/decoding method of described arithmetic and Golomb-rice comprises concrete steps:
Carry out predicting inverse process;
Carry out the inverse process of pre-service;
Entropy code algorithm mark is read from code stream, to determine to call arithmetic or Golomb-rice entropy decoder, decoding current channel or frame data.
Described method allows arithmetic coding and Golomb-Rice entropy code independently to exist in a data frame or mixing exists, that is, in code stream, total data adopts total data in arithmetic coding method, code stream to adopt data acquisition arithmetic coding and Golomb-Rice in Golomb-Rice coding method or code stream to encode and the method for depositing.
Described according to computational complexity selection arithmetic and Golomb-rice entropy encoding/decoding, by being normalized each processing module in encoding and decoding technique, for each coding/decoding module setting complexity weight, according to computation complexity decision-making requirements, selected suitable processing module and grade, the dynamic adjustments realizing between compressibility and encoding and decoding speed.
Described pre-service has these forms following:
To the filtering integer process of original input signal, the conversion process to original input signal, the decorrelative transformation to original input signal, the Combined Treatment to original input signal and the restructuring process to original input signal.
Describedly prediction carried out to audio input signal there is following form:
Levinson-Durbin LPC linear prediction, LMS least mean-square error adaptive prediction, RLS Recursive Least Squares and LTP Long-term predict.
Described setting selects the threshold value of arithmetic entropy coding and Golomb-Rice entropy code to comprise;
1) the sample frequency threshold value calling arithmetic coding and Golomb-rice entropy code is set;
2) the channel number threshold value calling arithmetic coding and Golomb-rice entropy code is set;
3) the maximum order threshold value calling the predictive filter of arithmetic coding and Golomb-rice entropy code is set;
4) complexity threshold calling the prediction module of arithmetic coding and Golomb-rice entropy code is set.
The complexity threshold of described prediction module selects LPC prediction order as decision factor:
LPC>16, entropy code selects Golomb-Rice;
LPC<=16, entropy code selects arithmetic coding.
For realizing method of the present invention, also proposing a kind of multichannel lossless audio mixed encoding and decoding device, comprising hybrid coding device and hybrid decoding device,
Described hybrid coding device comprises:
Pretreatment module, carries out pre-service to original audio input signal, reduces the redundance between signal, improves compressibility;
Prediction module, removes the correlativity of data before and after original signal;
Complexity decision-making module, according to the sample frequency of signal, sound channel number, the exponent number of predictive filter and the computation complexity Selection and call arithmetic of prediction processing module or Golomb-rice entropy code module:
Entropy code module, comprises the Mixed Entropy Coding device of arithmetic coding and Golomb-Rice entropy code;
Described hybrid decoding device comprises:
The inverse processing module of prediction, the inverse process of corresponding prediction processing;
Pre-service against processing module, corresponding pretreated inverse process;
Entropy decoder module, comprises the mixing entropy demoder of arithmetic decoding and the decoding of Golomb-Rice entropy.
Described linear prediction module is the 128 rank prediction module based on LPC linear prediction.
Beneficial effect of the present invention:
1, because the present invention is considering the balance between entropy code complexity and encoding-decoding efficiency, provide a kind of Mixed Entropy Coding method being applicable to multichannel lossless audio data, this method is utilized to can be implemented in switching between encoding and decoding complexity and encoding and decoding speed, can according to the processor calculating ability difference of encoding device or decoding end equipment (such as: needing to realize high compression rate can choice for use arithmetic coding method, need to realize high decoding speed and can select Golomb-Rice coding method), select the encoding/decoding mode be suitable for, application demand widely can be met.
2, the present invention can realize the lossless audio coding of high-quality multichannel under limited process resource, effectively reduces hardware cost.
3, because improvement opportunity has simply, efficient feature, is easy to be applied to digital audio field, provides Lossless Audio Codec scheme.
4, as the improvement point of lossless audio technology, application can be obtained in the autonomous lossless audio standard of China.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly understand, below in conjunction with specific embodiment, the present invention is described in more detail.
Gordian technique of the present invention comprises:
(1) by using the Mixed Entropy Coding method of arithmetic coding and Golomb-Rice coding improve encoding and decoding speed and suitably improve compressibility, the present invention allows arithmetic coding and Golomb-Rice coding, and independent existence or mixing exist in a data frame, that is, in code stream, total data adopts total data in arithmetic coding method, code stream to adopt data acquisition arithmetic coding and Golomb-Rice in Golomb-Rice coding method or code stream to encode and the method for depositing;
(2) utilize computation complexity decision-making to expand the lossless audio coding scope of application, realize the support to more multichannel quantity and Geng Gao sample frequency; By being normalized each processing module in encoding and decoding technique, be each coding/decoding module setting complexity weight, according to computation complexity decision-making requirements, selected suitable processing module and grade.
(3) dynamic adjustments that simple computation complexity decision-making realizes between compressibility and encoding and decoding speed is utilized;
1, the hybrid coding method of arithmetic and Golomb-rice
1.1 hybrid coding core block diagrams
Fig. 1 is hybrid coding nucleus module structured flowchart of the present invention; As shown in the figure, the present invention allows independent existence or the mixing existence in a data frame of arithmetic coding and Golomb-Rice coding.
1.2 lossless audio coding block diagrams
Fig. 2 is lossless audio coding modular structure block diagram of the present invention; An embodiment of display lossless audio coding module, illustrates the design feature of modules below.
1.3 pretreatment module
Some special process are carried out to original audio input signal, reduces the redundance between signal, improve compressibility.These forms following may be had:
1) to the filtering process (as filtering integer) of original input signal.
2) to the conversion process (as wavelet transformation) of original input signal.
3) to the decorrelative transformation (as sound channel decorrelation) of original input signal.
4) to the Combined Treatment (as associating sound channel coding) of original input signal
5) to the restructuring process (intersection as channel data is recombinated) of original input signal
1.4 prediction module
Prediction module is with FIR (Finite impulse response filters), IIR (Infinite impulse response filters) wave filter technology removes the correlativity of data before and after original signal, may have these forms following:
1) LPC (Linear Prediction) linear prediction;
2) LMS (Least Mean Square) least mean-square error adaptive prediction;
3) RLS (recursiveleast Square) Recursive Least Squares;
4) LTP (long-term Prediction) Long-term predicts;
Above-named four kinds of Forecasting Methodologies be all FIR filter technology, the algorithm of realization all:wherein N is the exponent number of FIR filter, and w is the coefficient vector of FIR filter, and x is input vector, and y is output vector.
Difference is LPC is make cost function error sum of squaresminimum, LMS makes cost function square error minimumrLS is the error sum of squares making cost function exponential weightingminimum of computation goes out optimum filter coefficient, and removes the correlativity between data by filter prediction; And LTP is the correlativity by removing filter prediction and time delay between sound channel, compared with other three kinds, which increase the consideration to time delay, the delay sampling number different according to the different choice of sample frequency carries out decorrelative transformation to input data.Wherein M is the length (as frame length) of process unit, and λ is forgetting factor.
1.5 complexity decision-making modules
For certain specific entropy code algorithm, the computation complexity of system is mainly with the sample frequency of digital signal, sound channel number, the quantization digit of data, the exponent number of pre-processing filter, the complexity size of pretreatment module is relevant, along with the change from small to large of these parameters, can bring the increase of whole system computation complexity.Under condition consistent above, arithmetic coding often shows higher compressibility, and GolombRice shows good compression speed.
According to the sample frequency of signal, sound channel number, the quantization digit of data, the exponent number of predictive filter and the complexity of prediction processing module select arithmetic or Golomb-rice entropy coding method, by limiting the peak value operand of encoding and decoding, thus it is resource-constrained with not constrained environment that codec can be well applied to.The method of decision-making is as follows:
1) according to sample frequency FS selective entropy scrambler: arrange sample frequency threshold value FS according to the situation of processor resource in practical applicationlimen, when the sample frequency of input signal source is more than or equal to set threshold value FSlimentime, use Golomb-rice entropy encoding/decoding device; When the sample frequency of input signal is less than set threshold value FSlimentime, use arithmetic entropy encoding/decoding device.The unit of sample frequency is Hz, KHz etc.The span of sample frequency: 0Hz<FS<192000Hz (different according to application, sample frequency scope can adjust).As shown in Figure 3.
2) according to channel number CH selective entropy scrambler: arrange channel number threshold value CH according to the situation of processor resource in practical applicationlimen, when the channel number of input signal source is more than or equal to set threshold value CHlimentime, use Golomb-rice entropy encoding/decoding device; When the channel number of input signal is less than set threshold value FSlimentime, use arithmetic entropy encoding/decoding device, the unit of sound channel number is individual.Channel number span: 0<CH<x (x can be different according to application value, such as, for home entertaining, can value be 8, for theater entertainment, can value 32 or higher).As shown in Figure 4.
3) according to the quantization digit QBIT selective entropy scrambler of data: arrange quantization digit threshold value QBITLimen according to the situation of processor resource in practical application, when the quantization digit of data is more than or equal to set threshold value QBITLimen, with Golomb-rice entropy encoding/decoding device, when the quantization digit of data is less than set threshold value QBITLimen, with arithmetic entropy encoding/decoding device.The span 0<QBIT<32 (different according to the word length of processor, QBIT can change) of QBIT, as shown in Figure 5.
4) according to the exponent number ORD selective entropy scrambler of predictive filter: the exponent number threshold value ORD arranging predictive filter according to the situation of processor resource in practical applicationlimen, when the exponent number of predictive filter is more than or equal to set threshold value ORDlimentime, with Golomb-rice entropy encoding/decoding device; When the exponent number of predictive filter is less than set threshold value ORDlimentime, with arithmetic entropy encoding/decoding device.Exponent number ORD span 1<ORD<1024. as shown in Figure 6.
5) according to the complexity PRCCO selective entropy scrambler of prediction processing module: arrange the complexity threshold PRCCO of prediction processing module according to the situation of processor resource in practical applicationlimen, when the complexity of prediction processing module is more than or equal to set threshold value PRCCOlimentime, use Golomb-rice entropy encoding/decoding device; When the complexity of prediction processing module is less than set threshold value PRCCOlimentime, use arithmetic entropy encoding/decoding device, complexity unit can be CYCLE, MIPS (MHz) etc., span 0<PROCCO<x (setting suitable value, such as 5MIPS in the maximum throughput that x can allow according to application).As shown in Figure 7.
6), according to the combined information selective entropy scrambler of above decision factor: combined method has two kinds, and the first can adopt parallel combinations, when namely each factor meets simultaneously, certain entropy code algorithm is selected; Such as: as sampling frequency parameters FS>48KHz, and channel number parameter CH>2 sound channel, and during the quantization digit QBIT>16 of data, and prediction module complexity parameter ORD>14, and pretreatment module complexity parameter PROCC>5MIPS, use Golomb-Rice coding, otherwise use arithmetic coding.More than combination according to actual needs, can carry out combination condition restriction in certain several parameter.
The second is according to sampling frequency parameters, channel number parameter, the quantization digit parameter of data, prediction module complexity parameter, the combined value COMP selective entropy scramblers such as pretreatment module complexity parameter: combined threshold value COMPLimen is set according to the situation of processor resource in practical application.
Combined threshold value is by sample frequency FS, channel number CH, quantization digit threshold value, the exponent number ORD of predictive filter is converted to CYCLE, MIPS etc. are unit threshold value, ask weighted mean value to obtain with the complexity threshold of prediction processing module, and make it follow the processor resource in practical application to mate.
Combined threshold value computing formula:
COMPLimen=W0·FSLimen·A0+W1·CHLimen·A1+W2·QBITLimen·A2+W3·ORDLimen·A3++W4·PROCCLimen
The method asking combined threshold value same asks the combined value of input data, when the combined value inputting data is more than or equal to combined threshold value, with Golomb-rice entropy encoding/decoding device, when being less than combined threshold value when the combined value inputting data is greater than combined threshold value, with arithmetic entropy encoding/decoding device.
Combined value computing formula:
COMP=W0·FS·A0+W1·CH·A1+W2·QBIT·A2W3·ORD·A3++W4·PROCC
Wherein W0, W1, W2, W3, W4for sample frequency FS, channel number CH, the quantization digit QBIT of data, the exponent number ORD of predictive filter and the complexity PROCC of prediction processing module and the weighting coefficient of threshold value, A0, A1, A2, A3for sample frequency FS, channel number CH, the quantization digit QBIT of data, the exponent number ORD of predictive filter, and threshold transition is be the Product-factor of unit with CYCLE, MIPS etc.
The unit of combined value and combined threshold value is CYCLE, MIPS etc., as shown in Figure 8.
1.6 arithmetic entropy coding modules
The method of arithmetic entropy coding module is as follows:
1) source symbol sequence { a1, a2am, [0,1) be that present analysis is interval, by the probability sequence of source symbol by present analysis interval division be m interval, m interval and m source symbol map one by one:
Wherein Fxk () is the cumulative probability of a front k symbol
Wherein P (ai) be symbol aiprobability
2) retrieve source symbol sequence, find current information source symbol akinterval [F corresponding to present analysis intervalx(k-1), Fx(k)), this interval is interval as new present analysis.
3) according to the probability sequence of source symbol by present analysis interval division be m interval
(if self-adaptation or context-adaptive model, necessary update probability or conditional probability table), reads next information symbol as current sign, then repeats second and third step.Until source symbol sequence retrieval is complete.
4) any one number in last present analysis interval can as source symbol sequence { a1, a2ammark.
Arithmetic entropy decoding method is the inverse process of arithmetic entropy coding, and it reads the mark of source symbol sequence from code stream, and according to when proparea (between original area be [0,1)) calculate cumulative probability interval array { [Fx(0), Fx(1)), [Fx(1), Fx(2) ... [Fx(k-1), Fx(k)) } index i, decode thus and interval [Fx(i-1), Fx(i)) corresponding source symbol aiand it is interval according to the symbol sebolic addressing convergent-divergent of decoding, finally decode original source symbol sebolic addressing, to the arithmetic coding of non-self-adapting, probability tables immobilizes, and can not refresh probability tables after a symbol of encoding, and for adaptive arithmetic coding, probability tables is real-time change, and can refresh probability tables after a symbol of often encoding, next coded identification is encoded according to the probability tables after refreshing.
1.7Golomb-rice entropy code module
The method of Golomb-rice entropy code is as follows:
1) the choosing of m value, under theoretical case, optimum m value is as follows:
2) the round values n of segmentation symbol: the round values n of symbol is divided into prefixwith remainder r=n & (2m-1) two parts, adopt unitary code coding to prefix q, and remainder adopts m binary digit to encode.
3) read next source symbol, repeat second step, until source symbol sequential coding is complete.
To in the Golomb-rice coding of non-self-adapting, generally in units of symbolic blocks, choose m value, in block, the integer-valued mean value of all symbols is as input, and by formulae discovery m value above, in block, the round values of every symbol is all split with identical m.
And adaptive Golomb-rice is encoded, the m value selected of the round values of each symbol can not identical (and concrete adaptive method has multiple, no longer description here).
1.8 Bit stream formatting modules
Stylized facts information bit and entropy code export bit, the encoding code stream of output formatting.
2, the hybrid decoding method of arithmetic and Golomb-rice
Fig. 3 is hybrid decoding nucleus module structured flowchart of the present invention; Fig. 4 is lossless audio decoding modular structure block diagram of the present invention.Wherein in decoding block diagram, the inverse processing module of prediction and pre-service are the inverse process of the alignment processing in coding block diagram against processing module.
2.1 read entropy code algorithm mark
Entropy code algorithm mark is read, to determine to call arithmetic or Golomb-rice entropy decoder decoding current channel or frame data from code stream.
2.2 arithmetic entropy decoder modules
The method of arithmetic entropy decoder module is as follows:
1) initialization present analysis is interval, [0,1) be that present analysis is interval, by the probability sequence of source symbol by present analysis interval division be m interval, m interval and m source symbol map one by one:
Wherein Fxk () is the cumulative probability of a front k symbol
Wherein P (ai) be symbol aiprobability
And from code stream, read the current identification of source symbol sequence.
2) interval the array { [F of cumulative probability is calculated out according to present analysis district and current identificationx(0), Fx(1)), [Fx(1), Fx(2) ... [Fx(k-1), Fx(k)) } index i, decode thus and interval [Fx(i-1), Fx(i)) corresponding source symbol ai.
3) upgrading present analysis district according to the probability sequence of source symbol is [Fx(i-1), Fx(i)), and upgrade current sign (if self-adaptation or context-adaptive model, necessary update probability or conditional probability table).
4) second and third step is repeated, until decode source symbol sequence.
2.3Golomb-rice entropy decoder module
The method of Golomb-rice entropy decoder module is as follows:
1) read or adaptive polo placement m value from code stream
2) unitary decoding prefix q, reads m position two and is made as remainder, calculate source symbol value n=q*2 from code streamm| r.
3) first and second step is repeated, until decode source symbol sequence.
Embodiment
Illustrate implementation method of the present invention below by a concrete example, for based on lossless audio mixed encoding and decoding technology, specific implementation step is as follows:
1) realize lossless audio codec with reference to block diagram of the present invention, basic module is as follows:
Sound channel de-correlation modules
Linear prediction module (based on LPC linear prediction 128 rank)
Complexity decision-making module
Entropy code module (comprising arithmetic coding and Golomb-Rice coding hybrid coder)
2) complexity decision-making design (example)
With reference to the inventive method, LPC prediction order can be selected as decision factor:
LPC>16, entropy code selects Golomb-Rice
LPC<=16, entropy code selects arithmetic coding
Method of the present invention and pure arithmetic entropy encoding/decoding ratio, under the prerequisite that compression performance does not worsen, improve the speed of encoding and decoding, and with pure Golomb-rice entropy encoding/decoding ratio, improve compression performance.It is by the peak performance of restriction entropy encoding/decoding device, lossless audio codec in this way can be well applied to resource-constrained with not constrained environment.
Above-described specific embodiment; further detailed description has been carried out to object of the present invention, technical scheme and beneficial effect; be understood that; the foregoing is only specific embodiments of the invention; be not limited to the present invention; within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.