This is a U.S. national stage under 35 USC 371 of application No. PCT/FR2007/050781, filed on Feb. 13, 2007.
This application claims the priority of French patent application no. 06/50638 filed Feb. 24, 2006, the content of which is hereby incorporated by reference.
The invention relates to a method of binary coding quantization indices defining a signal envelope. It also relates to a binary coding module for implementing the method. It further relates to a method and a module for decoding an envelope coded by the binary coding method and the binary coding module of the invention.
The invention finds a particularly advantageous application to transmitting and staring digital signals, such as audio-frequency speech, music, etc. signals. The coding method and the coding module of the invention are more specifically adapted to transform coding of audio-frequency signals.
There are various techniques for digitizing and compressing audio-frequency speech, music, etc. signals. The methods most widely used are:
These classic techniques for coding audio-frequency signals are described in W. B. Kleijn and K. K. Paliwal, Editors, “Speech Coding and Synthesis”, Elsevier, 1995.
As indicated above, the invention is essentially concerned with transform coding techniques.
ITU-T Recommendation G.722.1, “Coding at 24 kbit/s and 32 kbit/s for hands-free operation in systems with low frame loss”, September 1999, describes a transform coder for compressing speech or music audio signals in a pass-band from 50 hertz ′Hz) to 7000 Hz, referred to as the wide band, at a sampling frequency of 16 kilohertz (kHz) and at a bit rate of 24 kilobits per second (kbit/s) or 32 kbit/s.
As this figure shows, the G.722.1 coder is based on the modulated lapped transform (MLT) The frame length is 20 milliseconds (ms) and the frame contains N=320 samples.
The MLT transform, modulated transform with Malvar overlap, is a variant of the MDCT (modified discrete cosine transform).
The MDCT transform X(m) of a signal x(n) of length L=2N comprising samples of the current frame and the future frame is defined as follows, where m=0, . . . , N−1:
In the above formula, the sine term corresponds to the windowing shown in
To calculate the spectral envelope of the transform, the values X(0), . . . , X(N−1) derived by MDCT are grouped into 16 sub-bands of 20 coefficients. Only the first 14 sub-bands (14×20=280 coefficients) are quantized and coded, corresponding to the frequency band 0-7000 Hz, the 7000-8000 band (40 coefficients) being ignored.
The value of the spectral envelope for the jth sub-band is defined in the logarithmic domain as follows, where j=0, . . . , 13, the term E serving to avoid log2(0):
This envelope therefore corresponds to the root mean square value per sub-band.
The spectral envelope is then quantized in the following manner:
The quantization step is therefore 20×log10 (20.5)=3.0103 . . . dB. The values obtained are bounded:
3≦rms_index(0)≦33(dynamic range 31×3.01=93.31 dB) for j=0; and
−6≦rms_index(j)≦33(dynamic range 40×3.01=120.4 dB) for j=1, . . . , 13.
The rms_index values for the last 13 bands are then transformed into differential indices by calculating the difference between the rms values of the spectral envelope of one sub-band and the preceding sub-band:
diff—rms_index(j)=rms_index(j)−rms_index(j−1) for j=1, . . . , 13
These differential indices are also bounded:
−12.≦diff—rms_index(j)≦11; for j=1, . . . , 13
Below the expression “range of quantization indices” refers to the range of indices that can be represented by binary coding. In the G.722.1 coder, the range of differential indices is limited to the range [−11, 12]. Thus the range of the G.722.1 coder is said to be “sufficient” for coding the differences between rms_index(j) and rms_index(j−1) if
−12≦rms_index(j)−rms_index(j−1)≦11
Otherwise, the range of the G.722.1 coder is said to be “insufficient”. Thus spectral envelope coding reaches saturation as soon as the rms difference between two sub-bands exceeds 12×3.01=36.12 decibels (dB).
The quantization index rms_index(0) is transmitted in the G.722.1 coder on 5 bits. The differential quantizing indices diff_rms_index(j) (j=1, . . . , 13) are coded by Huffman coding, each variable having its own Huffman table. This coding is therefore entropic coding of variable length, the principle of which is to assign a code that is short in terms of bits to the most probable differential index values, the least probable differential quantization index values having a longer code. This type of coding is very efficient in terms of mean bit rate, bearing in mind that the total number of bits used to code the spectral envelope in G.722.1 is around 50 bits on average. However, as becomes clear below, the worst case scenario is out of control.
The
With these code length values, it is seen that in the best case encoding the spectral envelope requires 39 bits (1.95 kbit/s) and that the theoretical worst case is 190 bits (9.5 kbit/s).
In the G.722.1 coder, the bits remaining after coding the quantization indices of the spectral envelope are then distributed to code the MDCT coefficients normalized by the quantized envelope. Assignment of bits in the sub-bands is effected by a categorization process that is not related to the present invention and is not described in detail here. The remainder of the G.722.1 process is not described in detail for the same reason.
Coding the MDCT spectral envelope in the G.722.1 coder has a number of drawbacks.
As indicated above, variable length coding can lead to using a very large number of bits for coding the spectral envelope in the worst case. Also, it is also pointed out above that the risk of saturation for some signals of high spectral disparity, for example isolated sinusoids, differential coding does not work because the range ±36.12 dB cannot represent all of the dynamic range of the differences between the rms values.
One object of the present invention is to provide a method of binary coding quantization indices defining a signal envelope that includes a variable length coding step and would minimize the coding length to a limited number of bits, even in the worst case.
Moreover, another problem to be solved by the invention concerns managing the risk of saturation for signals having high rms value, such as sinusoids.
These and other objects are attained in accordance with one aspect of the present invention directed to a method of binary coding quantization indices defining a signal envelope, comprising a variable length first coding mode, wherein the first coding mode incorporates envelope saturation detection and said method also includes a second coding mode, executed in parallel with the first coding mode and selection of one of the two coding modes as a function of a code length criterion and the result of detecting envelope saturation in the first coding mode.
Such a method is based on the concurrence of two coding modes, one or each of which is of variable length, so as to be able to choose the mode yielding the lower number of coding bits, in particular in the worst case, i.e. for the least probable rms values.
Moreover, if one of the coding modes leads to saturation of the rms value of a sub-band, the other mode is “forced” and assumes priority, even if it leads to a greater coding length.
In a preferred implementation, the second coding mode is selected if one or more of the following conditions is satisfied:
Another aspect of the present invention is directed to a module for binary coding of a signal envelope, comprising a module for coding a variable length first mode, noteworthy in that said coding module of a first mode incorporates an envelope saturation detector and said coding module also includes a second module for coding a second mode, in parallel with the module for coding the first mode, and a mode selector for retaining one of the two coding modes as a function of a code length criterion and the result from the envelope saturation detector.
In addition to selecting the most appropriate code, the mode selector is able to generate a retained coding mode indicator in order to indicate to the downstream decoder, which decoding mode it must apply.
Another aspect of the invention is directed to a method of decoding a signal envelope, said envelope being coded by the binary coding method of the invention, noteworthy in that said decoding method includes a step of detecting said selected coding mode indicator and a decoding step in accordance with the selected coding mode.
Another aspect of the invention is directed to a module for decoding a signal envelope, said envelope being coded by the binary coding module of the invention, said decoding module comprising a decoding module for decoding a variable length first mode, noteworthy in that said decoding module also includes a second decoding module for decoding a second mode in parallel with said decoding module for decoding the variable length first mode and a mode detector adapted to detect said coding mode indicator and to activate the decoding module corresponding to the detected indicator.
Another aspect of the invention is directed to a program comprising instructions stored on a computer-readable medium for executing the steps of the method of the invention.
The invention is described in the context of a particular type of hierarchical audio coder operating at 8 kbit/s to 32 kbit/s. However, it must be clearly understood that the methods and modules according to the invention for binary coding and decoding of spectral envelopes are not limited to this type of coder and can be applied to any form of spectral envelope binary coding defining the energy in sub-bands of a signal.
As shown in
The low band is pre-processed by a high-pass filter 304 eliminating components below 50 Hz before CELP coding 305 in the narrow band (50 Hz to 4000 Hz). The high-pass filtering takes account of the fact that the wide band is defined as the 50 Hz to 7000 Hz band. In the embodiment described, the form of narrow band CELP coding 305 used corresponds to cascade CELP coding comprising as a first stage modified G.729 coding (ITU-T G.729 Recommendation, “Coding of Speech at 8 kbit/s using Conjugate Structure Algebraic Code Excited Linear Prediction (CS-ACELP)”, March 1996) with no pre-processing filter, and as a second stage a additional fixed dictionary. The CELP coding error signal is calculated by the subtractor 306 and then weighted perceptually by a WNB(z) filter 307 to obtain the signal xlo. That signal is analyzed by a modified discrete cosine transform (MDCT) 308 to obtain the discrete transformed spectrum Xlo.
Aliasing in the high band is first cancelled 309 to compensate aliasing caused by the H QMF filter 302, after which the high band is pre-processed by a low-pass filter 310 eliminating components in the range 7000 Hz to 8000 Hz in the original signal. The resulting signal Xhi is subjected to an MDCT transform 311 to obtain the discrete transformed spectrum Xhi. Band expansion 31 is effected on the basis of xhi and Xhi.
As explained already with reference to
The low-band and high-band MDCT spectra Xlo and Xhi are coded in the transform coding module 313. The invention relates more specifically to this coder.
The bit streams generated by the coding modules 305, 312 and 313 are multiplexed and structured into a hierarchical bit stream in the multiplexer 314. Coding is effected by 20 ms blocks of samples (frames), i.e. blocks of 320 samples. The coding bit rate is 8 kbit/s, 12 kbit/s, 14 kbit/s to 32 kbit/s in 2 kbit/s steps.
The MDCT coder 313 is described in detail with reference to
The low-band and high-band MDCT transforms are first combined in the merging block 400. The coefficients
Xlo={Xlo(0)Xlo(1) . . . Xlo(N−1)} and
Xhi={Xhi(0)Xhi(1) . . . Xhi(N−1)}
are therefore grouped into a single vector to form a full band discrete transformed spectrum:
X={X(m)}m=0 . . . L-1={Xlo(0)Xlo(1) . . . Xlo(N−1)Xhi(0)Xhi(1) . . . Xhi (N−1)}
The MDCT coefficients X(0), . . . , X(L−1) of X are grouped into K sub-bands. The division into sub-bands can be described by a table tabis={tabis(0) tabis(1) . . . tabis(K)} of K+1 elements defining the frontiers of the sub-bands. The first sub-band then includes the coefficients X(tabis(0)) to X(tabis(1)−1), the second sub-band includes the coefficients X(tabis(1)) to X(tabis(2)−1), etc.
In a preferred embodiment, K=18; the associated division is specified in table (a) in
The spectral envelope of amplitude log_rms describing the energy distribution per sub-band is calculated 401 and then coded 402 by the spectral envelope coder to obtain the indices rms_index. The bits are assigned 403 to each sub-band and spherical vector quantization 404 is applied to the spectrum X. In a preferred embodiment, the assignment of the bits corresponds to the method disclosed in the paper by Y. Mahieux, J. P. Petit, “Transform coding of audio signals at 64 kbit/s”, IEEE GLOBECOM, vol. 1, pp. 518-522, 1990, and spherical vector quantizing is effected as described in the International Application PCT/FR04/00219.
The bits resulting from coding the spectral envelope and vector quantization of the MDCT coefficients are processed by the multiplexer 314.
The spectral envelope calculation and coding are more particularly described below.
The spectral envelope log_rms in the logarithmic domain is defined for the jth sub-band as follows:
where j=0, . . . , K−1 and nb_coeff(j)=tabis(j+1)−tabis(j) is the number of coefficients in the jth sub-band. The term ε serves to avoid log2(0). The spectral envelope corresponds to the rms value in dB of the jth sub-band; it is therefore an amplitude envelope.
The size nb_coeff(j) of the sub-bands in a preferred embodiment is given in table (b) in
The coding of the spectral envelope by the coder 402 is shown in
The envelope log_rms in the logarithmic domain is first rounded to rms_index={rms_index(0) rms_index(1) . . . rms_index(K−1)} by uniform quantization 500. That quantization is simply given by:
rms_index(j)=rounded to nearest integer of log_rms(j)×0.5
if rms_index(j)<−11, rms_index(j)=−11
if rms_index(j)>+20, rms_index(j)=+20
The spectral envelope is then coded with uniform logarithmic steps of 20×log10(20.5)=3.0103, . . . dB. The resulting vector rms_index contains integer indices from −11 to +20 (i.e. 32 possible values). The spectral envelope is therefore represented with a dynamic range of the order of 32×3.01=96.31 dB.
The quantized envelope rms_index is then divided into two sub-vectors by the block 501: one sub-vector rms_index bb={rms_index(0) rms_index(1) . . . rms_index(K_BB−1)} for the low-band envelope and the other vector rms_index bh={rms_index(K_BB) . . . rms_index(K−1)} for the high band envelope. In a preferred embodiment, K=18 and K_BB=10; in other words, the first 10 sub-bands are in the low band (0 to 4000 Hz) and the last 8 are in the high band (4000 Hz to 7000 Hz).
The low band envelope rms_index_bb is binarized by two coding modules 502 and 503 operating in competition, namely a variable length differential coding module 502 and a fixed length (“equiprobable”) coding module 503. In a preferred embodiment, the module 502 is a differential Huffman coding module and the module 503 is a natural binary coding module.
The differential Huffman coding module 502 includes two coding steps described in detail below:
calculation of differential indices.
The differential quantization indices diff_index(1) diff_index(2) . . . diff_index(K_BB−1) are given by:
satur_bb=0
diff_index(j)=rms_index(j)−rms_index(j−1)
if (diff_index(j)<−12) or (diff_index(j)>+12), then satur_bb=1
The binary indicator satur_bb is used to detect situations in which diff_index(j) is not in the range [−12, +12]. If satur_bb=0, all the elements are in that range and the differential Huffman coding index range is sufficient; otherwise, one of these elements is less than −12 or greater than +12 and said range of indices is then insufficient. The indicator satur_bb is therefore used to detect spectral envelope saturation by differential Huffman coding in the low band. If saturation is detected, the coding mode is changed to the fixed length (equiprobable) coding mode. By design, the range of indices of the equiprobable mode is always sufficient.
binary conversion of first index and Huffman coding of differential indices:
The equiprobable coding module 503 converts directly to natural binary form the elements rms_index(0) rms_index(1) . . . rms_index(K_BB−1). These range from −11 to +20 and are therefore each coded on 5 bits. The number of bits necessary for equiprobable coding is therefore simply: bit_cnt2_bb=5×K_BB bits. In a preferred embodiment, K_BB=10, thus bit_cnt2_bb=50 bits.
The mode selector 504 selects which of the two modules 502 or 503 (differential Huffman coding or equiprobable coding) generates the lower number of bits. As the differential Huffman mode saturates the differential indices at +/−12, the equiprobable mode is chosen as soon as saturation is detected in the calculation of the differential quantization indices. This method avoids spectral envelope saturation as soon as the difference between the rms values of two adjacent bands exceeds 12×3.01=36.12 dB. Mode selection is explained below:
The mode selector 504 generates a bit that indicates which of the differential Huffman or equiprobable modes has been selected, using the following convention: 0 for the differential Huffman mode, 1 for the equiprobable mode. This bit is multiplexed with the other bits generated by coding the spectral envelope in the multiplexer 510. Also, the mode selector 504 triggers a bistable 505 that multiplexes the bits of the selected coding mode in the multiplexer 314.
The high band envelope rms_index_bh is processed in exactly the same way as rms_index_bb: uniform coding of the first index log_rms(0) on 5 bits by the equiprobable coding module 507 and Huffman coding of the differential indices by the coding module 506. The Huffman table used in the module 506 is identical to that used in the module 502. Similarly, the equiprobable coding 507 is identical to the coding 503 in the low band. The mode selector 508 generates a bit that indicates which mode (differential Huffman mode or equiprobable mode) has been selected, and that bit is multiplexed with the bits from the bistable 509 in the multiplexer 314. The number of bits necessary for equiprobable coding in the high band is bit_cnt2_bh=(K−K_BB)×5; in the preferred embodiment, K−K_BB=8 thus bit_cnt2_bh=40 bits.
It is important to note that in the preferred embodiment the bits associated with the envelope of the high band are multiplexed before the bits associated with the envelope of the low band. In this way, if only part of the coded spectral envelope is received by the decoder, the envelope of the high band can be decoded before that of the low band.
The hierarchical audio decoder associated with the coder that has just been described is shown in
The bit stream of the layers at 8 and 12 kbit/s is used by the CELP decoder 601 to generate a first narrow band (0 to 4000 Hz) synthesis. The portion of the bit stream associated with the 14 kbit/s layer is decoded by the band expansion module 602. The signal obtained in the high band (4000 Hz to 7000 Hz) is transformed into a transform signal {tilde over (X)}hi by applying the MDCT transform 603. The MDCT decoding 604 is shown in
The wide band output signal sampled at 16 kHz is obtained by means of the synthesis QMF filter bank including oversampling 610 and 612, low-pass and high-pass filtering 611 and 613, and summation 614.
The MDCT decoder 604 is described below with reference to
The bits associated with this module are demultiplexed in the demultiplexer 600. The spectral envelope is first decoded 701 to obtain the indices rms_index and the linear scale reconstructed spectral envelope rms_q. The decoding module 701 is shown in
Sub-bands that have not been received or not coded, because of having too little energy, are replaced by those from the spectrum {tilde over (X)}hi in the substitution module 704. Finally, the module 705 applies the amplitude envelope per sub-band to the coefficients supplied at the output of the module 704, and the reconstructed spectrum {tilde over (X)} is separated 706 into a reconstructed spectrum {tilde over (X)}lo in the low band (0 to 4000 Hz) and a reconstructed spectrum {tilde over (X)}hi in the high band (4000 Hz to 7000 Hz).
In the preferred embodiment, the bits associated with the spectral envelope of the high band are transmitted before those of the low band. Thus decoding begins with reading in the mode selector 801 the value of the mode selection bit received from the coder (differential Huffman mode or equiprobable mode). The selector 801 conforms to the same convention as on coding, namely: 0 for the differential Huffman mode, 1 for the equiprobable mode. The value of this bit drives the bistables 802 and 805.
If the mode selection bit is at 0, differential Huffman decoding is effected by the variable length decoding module 803: the absolute value rms_index(K_BB) from −11 to +20 and represented on 5 bits is decoded first, followed by the Huffman codes associated with the differential quantization indices diff_index(j) for j=K_BB·K−1 are then decoded. The integer indices rms_index(j) are then reconstructed using the following expression, for j=K_BB·K−1:
rms_index(j)=rms_index(j−1)+diff_index(j)
If the mode selection bit is at 1, the values of rms_index(j) from −11 to +20 and represented on 5 bits for j=K_BB·K−1 are decoded successively by the fixed length decoding module 804.
If no Huffman code has been found in mode 0 or if the number of bits received is insufficient to decode the high band completely, the decoding process indicates to the MDCT decoder that an error has occurred.
The bits associated with the low band are decoded in the same way as those associated with the high band. This decoding portion therefore includes the mode selector 806, the bistables 807 and 810, and the decoding modules 808 and 809.
The low-band reconstructed spectral envelope includes the integer indices rms_index(j) for j=K_BB·K−1. That reconstructed in the low band includes the integer indices rms_index(j) for j=0 . . . K_BB−1. These indices are grouped into a single vector rms_index={rms_index(0) rms_index(1) . . . rms_index(K−1)} in the merging block 811. The vector rms_index represents the reconstructed spectral envelope on a base 2 logarithmic scale; the spectral envelope is converted to a linear scale by the conversion module 812, which performs the following operation, where j=0, . . . , K−1:
rms—q(j)=2rms
It is obvious that the invention is not limited to the embodiment that has just been described. In particular, it should be noted that the envelope as coded by the invention can correspond to the time envelope defining the rms value per sub-frame of a signal rather than a spectral envelope defining the rms value per sub-frame.
Moreover, the fixed length coding step in competition with differential Huffman coding can be replaced by a variable length coding step, for example Huffman coding of the quantization indices instead of Huffman coding of the differential indices. Huffman coding can also be replaced by any other lossless coding, such as arithmetic coding, Tunstall coding, etc.
Number | Date | Country | Kind |
---|---|---|---|
06 50638 | Feb 2006 | FR | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/FR2007/050781 | 2/13/2007 | WO | 00 | 8/25/2008 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2007/096551 | 8/30/2007 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
4815068 | Dolby et al. | Mar 1989 | A |
5115469 | Taniguchi et al. | May 1992 | A |
6484142 | Miyasaka et al. | Nov 2002 | B1 |
6625226 | Gersho et al. | Sep 2003 | B1 |
6845360 | Jensen et al. | Jan 2005 | B2 |
6940900 | Takamizawa | Sep 2005 | B2 |
7260540 | Miyasaka et al. | Aug 2007 | B2 |
7788090 | Van De Par et al. | Aug 2010 | B2 |
20030083886 | Den Brinker et al. | May 2003 | A1 |
20040015766 | Toyama et al. | Jan 2004 | A1 |
20040202375 | Kalevo | Oct 2004 | A1 |
20050256701 | Makinen | Nov 2005 | A1 |
20050261900 | Ojala et al. | Nov 2005 | A1 |
20060069550 | Todd et al. | Mar 2006 | A1 |
Number | Date | Country |
---|---|---|
0 361 384 | Apr 1990 | EP |
1 345 331 | Sep 2003 | EP |
WO 9815945 | Apr 1998 | WO |
Number | Date | Country | |
---|---|---|---|
20090030678 A1 | Jan 2009 | US |