Context-based adaptive arithmetic coding in time and frequency domain for the lossless compression of audio coding parameters at variable rate

This paper presents a novel lossless compression technique of the context-based adaptive arithmetic coding which can be used to further compress the quantized parameters in audio codec. The key feature of the new technique is the combination of the context model in time domain and frequency domain which is called time-frequency context model. It is used for the lossless compression of audio coding parameters such as the quantized modified discrete cosine transform (MDCT) coefficients and the frequency band gains in ITU-T G.719 audio codec. With the proposed adaptive arithmetic coding, a high degree of adaptation and redundancy reduction can be achieved. In addition, an efficient variable rate algorithm is employed, which is designed based on both the baseline entropy coding method of G.719 and the proposed adaptive arithmetic coding technique. Experiments show that the proposed technique is of higher efficiency compared with the conventional Huffman coding and the common adaptive arithmetic coding when used in the lossless compression of audio coding parameters. For a set of audio samples used in the G.719 application, the proposed technique achieves an average bit rate saving of 7.2% at low bit rate coding mode while producing audio quality equal to that of the original G.719.


Introduction
Natural digital audio signals require large bandwidth for transmission and enormous amounts of storage space. Developments in entropy coding, i.e., Huffman coding [1,2] and arithmetic coding [3,4], have made it practical to reduce these requirements without information loss. They employ non-stationary statistical behavior which exploits redundant information in the source signal. Compared with lossless compression methods, vector quantization methods and lossy compression methods are adopted in audio coding system to remove irrelevancy inaudible to humans and to improve the coding efficiency. Many audio codecs only use lossy compression methods to quantize and encode the audio parameters. In fact, when further combined with lossless entropy coding for the quantization and encoding procedure, audio codec can achieve better performance on the coding efficiency compared with using the lossy compression alone.
With the development of modern multimedia communication, high-quality full-band speech and audio coding becomes significant and is needed more at low bit rate. Besides the lossy compression through parametric and transform coding, many audio codecs introduce lossless coding algorithm to further compress the coding bits, such as Moving Picture Experts Group-4 advanced audio coding (MPEG-4 AAC) [5], MPEG unified speech and audio coding (USAC) [6], and ITU-T G.719 [7]. ITU-T G.719 is a low-complexity full-band (20 Hz to 20 kHz) audio codec for high-quality speech and audio, which operates from 32 to 128 kbps [7]. As with most of the transform audio coding, G.719 uses modified discrete cosine transform (MDCT) to realize the time-frequency transform and to avoid artifacts stemming from the block boundaries. In the MDCT domain [8], statistical and subjective redundancies of the signals can be better understood, exploited, and removed in most cases. After the lossy compression with vector quantization, removing irrelevancy inaudible to humans, the further compression performance is largely determined by the entropy coding efficiency of the quantized MDCT coefficients. In G.719, Huffman coding is applied, and the coding procedure has to be driven by an estimated probability distribution of the quantized MDCT coefficients along with the norms (frequency band gains).
Although Huffman coding removes some of the quantized MDCT coefficients' redundancy, it suffers from several shortcomings which limit further coding gains. For instance, in Huffman code, the distribution of MDCT coefficients is pre-defined from training statistics, and the adaptation mechanism is not flexible enough to combat the possible statistics mismatch, such as the techniques of switching between different codebooks and multidimensional codebooks which are exploited in AAC. Furthermore, if the symbols are not grouped into blocks, the symbols whose probabilities greater than 0.5 cannot be efficiently coded due to the intrinsic limit of 1 bit per symbol of Huffman code. Hence, the entropy coding schemes based on the adaptive arithmetic coding [9] are involved in the audio codec like MPEG USAC. The adaptive model measures the statistics of source symbols and is updated continuously with the encoding and decoding processes. In addition, the context from the point of view of the neighboring symbols is taken into account in order to further improve the coding efficiency.
For the context, it is firstly introduced in image and video coding. Here, context-based adaptive binary arithmetic coding (CABAC) in H.264/AVC [10] is taken as an example. CABAC is one of the two entropy coding methods of the new ITU-T/ISO/IEC standard for video coding, i.e., H.264/AVC, and plays a very important role in the efficiency improvement of the video coding. Through combining an adaptive binary arithmetic coding technique with context modeling of the neighboring symbols in binary bit stream and macro block, a high degree of adaptation and redundancy reduction is achieved. The encoding process of CABAC consists of three elementary steps: binarization, context model selecting, and adaptive binary arithmetic encoding. The last step consists of probability estimation and binary arithmetic encoder.
In the second step of CABAC [10], a context model is chosen, and a model probability distribution is assigned to the given symbols. In the subsequent coding stage, the binary arithmetic coding engine generates a sequence of bits that represent the symbols. The model determines the coding efficiency in the first place, so it is of paramount importance to design an adequate model that explores the statistical dependencies to a large degree. At the same time, this model needs to be continuously updated during encoding. Suppose one pre-defined set T of the past symbols, a so-called context template, and one related set C = {0,…,C-1} of the contexts are given, where the contexts are specified by a modeling function F:T → C operating on the template T. For each symbol x to be coded, a conditional probability p(x|F(z)) is estimated by switching between different probability models according to the already coded neighboring symbols z ∊ T. Generally speaking, the context model makes use of the information related to the encoded symbols and describes the mapping between a sequence of symbols and the assignment of the symbols' probability distribution.
Lately, arithmetic coding schemes based on bit-plane context are also involved in the field of audio coding such as USAC, like the applications in video coding. The spectral noiseless coding scheme is based on an arithmetic coding in conjunction with a dynamically adaptive context. The noiseless coding is fed by the quantized spectral values and uses context-dependent cumulative frequency tables derived from the two previously decoded neighboring two-tuple quantized spectral coefficients. The coding separately considers the sign, the two most significant bits (MSBs) and the remaining least significant bits. The context adaptation is applied only to the two MSBs of the unsigned spectral values. The sign and the least significant bits are assumed to be uniformly distributed.
By now, entropy coding schemes based on arithmetic coding are quite frequently involved in the field of none block-based video coding. The CABAC design is based on the key elements of binarization, context modeling, and binary arithmetic coding. Binarization enables efficient binary arithmetic coding via a unique mapping of non-binary syntax elements to a sequence of bits, which are called bins. Now, the arithmetic coding as a lossless data compression scheme also plays an essential role in the chain of processing of audio signal coding. The correlation in bit plane of the quantized MDCT coefficients is employed in the USAC [11]. However, the concept of context model for the adaptive arithmetic coding has been neither deeply investigated nor widely used in audio coding especially for the efficient compression by setting up context model from the point of view of the quantized audio parameters. When using the arithmetic coding to compress the coding parameters directly, the probability estimation based on the bitplane context model may not be suitable. In this situation, the correlation of audio coding parameters leading to lower information entropy could be considered both in time and frequency domain which can be deeply investigated in theory and carefully designed in practice. Thus, a novel time-frequency plane context model will be given in this paper, and the adaptive arithmetic coding will be used directly for the audio coding parameters. Furthermore, variable coding scheme is introduced to advance the efficiency.
In our work on arithmetic coding, the entropy coding method of an adaptive arithmetic coding technique with a time-frequency plane context model (both time and frequency domain are taken into account) was developed, which has led to the improvement of coding the quantized MDCT coefficients and the frequency band gains. The adaptive arithmetic coding will be applied to further compress the coding parameters in audio codec frame by frame and the probability estimation of which will make use of the inter-frame (time domain) correlation and the intra-frame (frequency domain) correlation of the coding parameters. In fact, most of alternative approaches to audio coding are on the basis of MDCT. One of its main distinguishing features is related to the time-frequency plane: Given a source of the quantized transform coefficients for instance, it was found to be useful to utilize the correlation in the time domain and frequency domain to increase the probability of the encoding symbol for arithmetic coding. The experiment on G.719 is carried out as an application of the proposed technique, in which the compatibility with the G.719 baseline is required. The good compression performance is achieved. Adopting this method, the allocated bits for coding the quantized parameters vary in consecutive analysis frames, while the quality of decoded audio remains constant. Therefore, the average bit rate is lower than that of the fixed bit rate codec while sustaining the same audio quality. Hence, a variable rate operation is introduced into the novel context-based adaptive arithmetic coding algorithm, which achieves better performance in terms of the coding efficiency. This paper is organized as follows. Section 2 outlines the novel adaptive arithmetic coding of the parameters produced in the audio encoding. Section 3 describes in detail the novel techniques and the underlying ideas of our entropy coding modules. Section 4 presents the experimental results and the performance comparison. Section 5 concludes this paper with a summary.

Preliminary principle
The information entropy of a discrete memoryless source X which has different symbols (x 0 , ……, x I−1 ) is given by [12,13] where p(x i ) is the probability of the symbol x i . The entropy establishes the lower bound of the average bit rate achieved by source coding. However, when the source is correlated, this bound can be further lowered by taking into account a higher order of the entropy like the conditional entropy i¼0 p x i s j Þlog 2 p x i s j ÞÞ; ð2Þ À À À where s j , a so-called context, is a specific state of the source and J represents the total number of the considered states. For the application of the so-called context, the distribution of the symbols (x 0 , ……, x I−1 ) is more concentrated in the vicinity of the encoding symbol, which means the probability of the encoded symbol can be increased through establishing the context model. Consequently, a suitable context design considering the correlation of the source means the lower entropy. In the applications of audio coding, because of the similarity of the sequential frames as well as the adjacent frequency bands, some audio parameters like frequency band gains and frequency spectral values have the correlation in time, and frequency domain and the context model with the neighboring parameters can be designed to make the entropy of the coding source lower, thus the compression efficiency can be higher. In Sections 2.3 and 2.4, the proposed context model and the way to utilize it will be mentioned in theory. The practical behavior and design in the case of G.719 codec will be investigated in Section 3.

Integer arithmetic coding
The performance of arithmetic coding is optimal without the need for blocking of input data. It encourages a clear separation between the probability distribution model and the encoding of information. For example, the model may assign a predetermined probability to each symbol. These probabilities can be determined by counting frequencies of representative samples to be transmitted. Such a fixed model is communicated in advance for both encoder and decoder. Alternatively, the probabilities that an adaptive model assigns may change as each symbol is transmitted. The encoder's model changes as each symbol is transmitted and the decoder's model changes as each symbol is received. If the context is involved, the adaptive model is based on the context.
In the arithmetic coding, a message is represented by an interval of real numbers between 0 and 1. As the message becomes longer, the interval becomes smaller, and it is necessary for the decoder to know the final interval at the end of the arithmetic coding. However, the integer arithmetic coding [14][15][16] can be employed without knowing the final interval, i.e., the decoding algorithm can be carried out even if the encoding procedure has not been completed. Meanwhile, the interval required to represent the message can grow in the process of encoding. Integer arithmetic coding [14] is done by subdividing the current interval initialized to [0, N-1] according to the symbol probabilities, where N is the upper limit of the 32-bit integer in the computer. The probabilities in the model are represented as integer frequency counts [16], and the cumulative counts are stored in the array c(). When a symbol comes each time, we take its subinterval as current interval. To put it simply, the subinterval to be encoded is represented in the form [l, u], where l is called the base or starting point of the subinterval and u is the ending point of the subinterval. The subintervals in the arithmetic coding process are defined by the equations as follows: The properties of the intervals guarantee that 0 ≤ l i ≤ To have incremental output, i.e., coded word, during the encoding process and to resolve the need for high-precision computations, the algorithm is performed through three mappings as follows. 'Scale' is defined as an intermediate variable in the calculation process to count the number of the three mappings, which represents the bit following the previous output bit in steps I and II. The three mapping steps will be ended until the interval [l, u] meets with none of the above looping conditions. As the subinterval shortens, the number of loops increases which lead to more bits output. Thus, the larger the subinterval is, the smaller bits the coder output. Since the context model can be established to increase the probability of the encoded symbol, the subinterval representing the probability will correspond to be enlarged.

Time-frequency context model
Generally, in the current applications, the context consists of neighbors of the current symbol to be encoded. In the application of CABAC, the context models the neighboring symbols of the binary bit, and in the application of USAC, the adaptive arithmetic coding is established based on the bit plane. In this paper, it deals with the correlation of neighboring parameters in the transform audio coding and some basic rules are designed to help with selecting the proper context model for the adaptive arithmetic coding. The time-frequency context associated with the current coded element is shown in Figure 1 which is different from the bit-plane context used in CABAC and USAC. In the proposed model, the time-frequency context-based arithmetic coding only makes use of the neighboring parameters in the past frames when considering the time domain, so there is no extra algorithmic delay when the arithmetic coder accesses to the time-frequency plane, shown in Figure 1.
A family of contexts is defined by means of the function T(m). The parameter m represents the number of symbols lying in the vicinity of the present coded symbol with 0 ≤ m ≤ 2. For each symbol C to be coded, the conditional probability p(C|T(m)) is estimated by switching between different probability models according to the already coded neighboring symbols. In Figure 1, T(0) represents no context, T(1) = A or B, and T(2) = A or B. A represents the context in the frequency domain, while B represents the context in the time domain, and they correspond with the quantized parameters in the transform audio codec. Their conditional probabilities are estimated by different methods which will be introduced in the following sections.

Context model in the frequency domain
When the neighboring elements satisfy the following equations where x represents the symbols and s represents the context. Then, the context dependence in the frequency domain is given a primary consideration. This guarantees a larger subinterval, which we explain as follows: In the case of Equation 7, the result u1 − l1 > u2 − l2 can be obtained. Since the subinterval calculated by the conditional probability is larger, smaller bits are obtained. The conditional entropy can be smaller than the entropy.
The length of the context-based sequence is defined as the order of the context model. A key issue in context modeling for the input symbol sequence is to balance the usage of the model order and the model cost. Higher order means higher cost of the computation. To solve this problem, one order context model [17] can be chosen in the frequency domain regarding its good compression and low complexity in the audio coding application.

Context model in the time domain
When the neighboring elements are correlated and the current symbol C distributes around the encoded symbol B, i.e., C ∊ (B − δ, B + δ), where δ represents the rescaling parameter, the model probability distribution is reassigned to the current symbol C.
For the m-ary (m is the number of symbols) adaptive arithmetic coding, the encoded symbol B is taken as the center; 2δ symbols, which are located in the vicinity of B, would be chosen to add a large number λ on the basis of the original frequency, leading to rearrange the distribution of the model. λ is the cumulative counts of all symbols which can change the subinterval adaptively.
That is, where f(x i ) is the original frequency counts of the symbol and f ′ (x i ) represents the final frequency counts distribution assigned to drive the arithmetic coder. The subinterval is changed to (l ′ 1, u ′ 1) can be obtained.
The subinterval u′1 − l ′ 1 is then larger than u2 − l2 under the above condition. Consequently, the higher the encoding symbol's frequency counts value is, the better the designed coding scheme performs with the larger subinterval of the encoding symbol.
As to the context model in time domain, we only consider one state context which models the past symbol B close to the current symbol C because the state before B has a weaker correlation with C while more states mean higher complexity.
3. Scheme of the novel context adaptive arithmetic coding in G.719

State-of-the-art techniques of G.719
ITU-T G.719 codec [7] makes use of the transform coding technique for low-complexity full-band conversational speech and audio, operating from 32 up to 128 kbps. The input signal sampled at 48 kHz is firstly processed through a transient detector based on the energy ratio between the short-term energy and the long-term energy. An adaptive window switching technique is used depending on the detection of transient and stationary signal. Then, time domain aliasing and MDCT techniques are designed to process the different kind of input signal. The transformed spectral coefficients are grouped into subbands of unequal lengths. The gain of each band (i.e., norm) is estimated, and the resulting spectral envelope consisting of the norms of all bands is quantized and encoded. The quantized norms are further adjusted based on adaptive spectral weighting and used as the input for bit allocation. The spectral coefficients are normalized by the quantized norms, and the normalized MDCT coefficients are then lattice vector quantized and encoded based on the allocated bits for each frequency band. In the process of bit allocation, Huffman coding is applied to encode the indices of both the encoded spectral coefficients and the encoded norms. The saved bits by Huffman coding are used for the following bit allocation and the noise adjustment in order to generate better audio quality. Finally, the fixed bit stream is obtained and transmitted to the decoder.

The novel structure of G.719
In this section, the novel context-based adaptive arithmetic coding is introduced to improve the coding scheme in G.719, and the probability statistic of the entropy coding is established for the transient and the stationary audio separately. The key elements will be discussed in the next section. Figure 2 shows the basic structure of the proposed method. The input signals (sampled at 48 kHz) are firstly processed through a transient detector [7] to be classified into transient and stationary signals, which are assigned with different statistical models for the adaptive arithmetic coding. After the modified discrete cosine transform, the obtained spectral coefficients are firstly grouped into subbands of unequal lengths. Then, the norm of each band, i.e., the frequency band gain, is estimated and the resulting spectral envelope, consisting of the norms of all bands, is quantized and encoded. Regarding the good correlation of the quantized norms of neighbor bands, we apply the timefrequency context-based adaptive arithmetic coding. The time-frequency context aims to remove the redundancies in the frequency domain and in the time domain.
When the coding procedure of the quantized norms is over, the coefficients are normalized by the quantized norms, and then, the normalized spectral coefficients are lattice vector quantized according to the bit allocation which leads to different dynamic range in subbands. For the so-called bit allocation, the maximum number of bits assigned to each normalized transform coefficient is set to  Figure 2 The basic structure of the proposed method.
R max = 9 in G.719 by default. Thus, nine statistical models for the adaptive arithmetic coding to be updated are employed, and all bands will be rearranged in order from low band to high band for the arithmetic coding so that the quantized coefficients in the subbands with the same allocated bits are encoded continuously. Considering that the 1-bit subband, the 2-to 4-bit subband, and the 5-to 9-bit subband have different correlations in the time domain and in the frequency domain, we use different context models when the bit allocation is different. The subbands of 5 to 9 bits are designed to exploit the correlation in the time domain for compression, while the subbands of 2 to 4 bits make good use of the correlation in frequency domain. Finally, the subband of 1 bit uses the normal adaptive arithmetic coding.

Time-frequency context model in G.719
Through a large number of experiments, we have found that the quantized norms and the quantized MDCT coefficients with 2 to 4 bits have the context statistical characteristic in the frequency domain, while the quantized norms and the quantized MDCT coefficients with 5 to 9 bits have the characteristic in the time domain, as is discussed in Section 2.3.
In the frequency domain, if the spectral parameters have the correlation, the conditional probability of the current encoding symbol will be larger than its probability. For the 2-to 4-bit subbands of the quantized MDCT coefficients, Figure 3 describes an example of the probability p(C) (C∈{0,…15}) and the conditional probability p(C|A) (A = 0 is the neighboring encoded symbol) of the current encoding symbol C, i.e., the code indexes of the quantized MDCT coefficients. The solid line represents the conditional probability p(C|A), and the dotted line describes the probability p(C). It can be found in Figure 3 that the conditional probability distribution p(C|A) is more concentrated in the vicinity of the current encoding index 0 than the probability p(C), and the relationship of the two kinds of probability (shown by dotted line and solid line) satisfies the Equation 7.
Thus, for the 2-to 4-bit subbands, the context in the frequency domain is defined as the encoded symbol A before the input one C, as is shown in Figure 1. Then, the conditional cumulative counts c(C|A) can be obtained. Let c(C|A) be the estimated conditional cumulative counts to drive the integer arithmetic coder.
In the time domain, γ j (n) is defined as the correlation coefficient in the previous adjacent subbands with the same bit allocation where D t ð Þ i;j represents subband index with 1 ≤ j ≤ 44 and j means the number of the subbands. The subbands have different sizes n = 8, 16, 24, 32 that increase with the increasing frequency. The character b represents the bits allocated for the current frame and 2 b is just the number of symbols for the m-ary (m symbols) adaptive arithmetic coding, i.e., m = 2 b .
If γ j (n) ≥ 0.5, then the context in the time domain is employed in the present adjacent subbands with the same bit allocation. By statistical analysis, we have found that the audio coding parameters for music signal have higher correlation than the speech signal in time domain. As to the quantized norms in G.719, a large percentage, 98.9%, of all the frames have the correlation (i.e., the correlation coefficient is higher than 0.5) between the adjacent frames which enables larger compression.
Given the encoded symbol in the previous frame, referred to as B, there is a large possibility of the input symbol C distributing around B. In G.719, for the m-ary (m symbols) adaptive arithmetic coding, the encoded symbol B is the center; m/2 symbols, which are located in the range of B and m − B (provided by − B to avoid negative symbol), would be chosen to add λ ¼ ∑ m i¼1 f i ð Þ on the basis of the original frequency, and δ = m/8, which can guarantee that the probability of half of all symbols is increased.
That is, As is depicted in Figure 4 which gives the behavior of MDCT parameters with 5 to 9 bits, the dotted line describes the original frequency counts (f(i)in formula (23)) of all symbols, while the solid line presents the final frequency counts (f ′ (i)in formula (23)) of all symbols. It is shown that the solid line is higher than the dotted line which indicates that the subinterval for i = B − m/8 + 1, … , B, … , B + m/8 will be larger resulting from their higher final frequency counts. After the operation of encoding, the model frequency distribution returns to the original probability distribution, then its updating takes place.

Variable rate in G.719
Variable rate coding methods [18][19][20] are important for source compression, and they have been studied for many years especially in speech codec. This paper introduces an efficient variable rate algorithm for G.719 based on the proposed adaptive arithmetic coding together with the original Huffman coding module. Figure 5 shows the block diagram of the variable rate scheme.
The bit rate is determined through three steps. The module of Huffman coding is kept to calculate the saving bits and prepare for the bit allocation. Let Sum be the total bits at a fixed bit rate. Firstly, the norms are coded by both the original Huffman coding consuming h1 bits and the context-based adaptive arithmetic coding consuming a1 bits simultaneously. Compared to the Huffman coding, the context-based adaptive arithmetic coding can save bits L1 = h1 − a1. The remaining bits num1 = Sum − h1 are used for bit allocation of the quantized MDCT coefficients. In the second step, the subbands with different bits assigned by the bit allocation are encoded by the proposed adaptive arithmetic coding. The quantized MDCT coefficients are also encoded by Huffman coding consuming h2 bits to calculate the remaining bits num2 = Sum − h1 − h2 used for the noise level adjustment. Compared to the Huffman coding, the number of bits used for coding the quantized MDCT coefficients with the context-based adaptive arithmetic coding is a2, which can save bits L2 = h2 − a2. Finally, the noise level is adjusted according to num2. The total bits and the bits used for the bit allocation and noise level adjustment in the improved encoder remain the same as those in the primary fixed rate G.719; hence, the saving bits L1 + L2 (provided by the contextbased adaptive arithmetic coding compared to the original Huffman coding) lead to the variable rate of G.719. To ensure the correct decoding, the header in G.719 [7] which specifies the number of bits used for encoding is changed to indicate variable bits instead of fixed bits.

Bit rate comparison
In this section, the performance of the variable rate coder, which employs the novel context-based adaptive arithmetic coding, is evaluated from the point of view of the average bit rate. The samples used in the bit rate measurement are ten speech and 29 music, including three classical music, ten mixed music (music and speech), three orchestras, one folk, one guitar, two harps, two percussions, one pop, three saxophones, and three trumpets. Each sample is sampled at the rate of 48 kHz and lasts 10 s. Table 1 summarizes the average bit rates of the improved variable rate G.719 at low bit rate mode compared with those of the fixed rate G.719 at 32 kb/s. As is shown in Table 1, our scheme achieves an average bit rate from 29.4817 to 29.9606 kb/s at low bit rate coding mode, compared with the fixed rate 32 kb/s. The coding gains of the three types of signal have a range from 6.4% to 7.9%, and it shows a coding gain on average 7.2% for all the test samples. Particularly, the bit rate saving for music signal is the largest compared with the mixed music signal and speech signal because of its good correlation in time domain and frequency domain. Table 2 shows the coding modes in G.719, and we carried out experiments at all coding modes. As the bit rate increases, the context-based adaptive arithmetic coding scheme achieves a better coding gain compared with the original Huffman coding especially for the highest bit rate coding mode. The test shows an average coding gain of 9.1% at the highest bit rate (coding mode 7 in Table 2). Specifically, music processing shows an average coding gain of 10.9% at the highest bit rate, which indicates the good statistical characteristic for pure music.
In order to have a good knowledge of the performance of the proposed adaptive arithmetic coding, we also carried out experiments to compare the different improved coders. Figure 6 presents the bit rate of G.719 fixed rate coder with Huffman coding, G.719 variable rate coder with the adaptive arithmetic coding and the context-based adaptive arithmetic coding at different coding modes, as is shown in Table 2. Compared with the adaptive arithmetic coding, the context-based adaptive arithmetic coding has a better performance. The lower the bit rate is, the higher the average coding gain is achieved when the contextbased adaptive arithmetic coding is compared with the common adaptive arithmetic coding. The test shows a gain of 2.3% with the context-based adaptive arithmetic coding at the lowest bit rate (coding mode 1 in Table 2).

Investigation of the short-term coding efficiency
The bit rate comparison in Section 4.1 shows the overall bit rate reduction that reflecting the long-term average of coding efficiency performance. In order to investigate the short-term coding efficiency of the proposed variable rate arithmetic coding, the bit allocation is evaluated frame by frame, and the performance is shown in Table 3.
As it can be seen from Table 3, the minimum bits of each frame in the variable rate G.719 are less than that in the fixed rate G.719, and the maximum bits of each frame Huffman coding(h1 bits)

Noise level adjustment
Adaptive arithmetic coding based on context(a1 bits)

Remaining bits num1=Sum-h1
Bit-allocation for the quantized MDCT coefficients

M UX
Total Bits Sum Figure 5 The basic structure of the variable rate encoder with introducing the context-based adaptive arithmetic coding.  in the variable rate G.719 are more than that in the fixed rate G.719 only because the context model tends to be stable after the first several input frames. Through statistical analysis, there is an extraordinarily large percentage, 99.1%, of all the frames needing less than the fixed 640 bits, which guarantees the short-term coding efficiency of the proposed variable rate arithmetic coding.
Since the good correlation in the time domain and in the frequency domain, the minimum bits in the variable rate G.719 for music signal have the best performance.

The performance comparison of different entropy coding
A comparative study of different entropy coding schemes will be presented in this section, which includes Huffman coding, the adaptive arithmetic coding, and the contextbased adaptive arithmetic coding, respectively. Table 4 shows the average number of bits to code the quantized norms using different coding schemes under different coding modes, while Table 5 presents the average number of bits to code the quantized MDCT coefficients using different coding schemes under different coding modes.
As it can be seen from the two tables, the coding bits required for the quantized norms and the quantized MDCT coefficients are the least using the proposed context-based adaptive arithmetic coding. Since the energy of all subbands will not change at different coding mode, the coding bits of the quantized norms remain the same along the different modes.
In order to further understand the compression degree between the adaptive arithmetic coding and Huffman coding, and the compression degree between the contextbased adaptive arithmetic coding and Huffman coding, the compression percentage can be calculated according to the following formulas: where h_bits represents the bits for encoding the audio parameters by Huffman coding, a_bits represents the bits for encoding parameters by the adaptive arithmetic coding, and ca_bits represents the bits for encoding parameters by the proposed context-based adaptive arithmetic coding. Tables 6 and 7 present the compression percentage of the quantized norms and the quantized MDCT coefficients which are calculated by Equations 24 and 25. As it can be seen from Tables 6 and 7, the compression percentage of the quantized norms is higher than that of the quantized MDCT coefficients. Since the variation of the quantized norms is less than that of the quantized MDCT coefficients, the conditional probability of the encoding symbol of the quantized norms is bigger than that of the quantized MDCT coefficients. Moreover, the  Figure 6 Average bit rate at different coding modes. The x-axis represents the coding modes (1 to 7), and the y-axis represents the average bit rate (kb/s). The solid line represents the fixed bit rate of G.719 using Huffman coding, the dotted line represents the variable bit rate of G.719 using the adaptive arithmetic coding, and the dash line represents the variable bit rate of G.719 using the context-based adaptive arithmetic coding.   correlation in the time domain of the quantized norms is higher than that of the quantized MDCT coefficients because of the less variation of norms. As a result, the scheme of the context-based adaptive arithmetic coding used for the quantized norms has a better performance than that used for the quantized MDCT coefficients. Figure 7 presents the compression percentage of all kinds of the parameters with different entropy coding. The solid line presents the compression percentage of the quantized norms coded by the context-based adaptive arithmetic coding compared to Huffman coding. The dashed line presents the compression percentage of the quantized norms coded by the adaptive arithmetic coding compared to Huffman coding. The dotted line presents the compression percentage of the quantized MDCT coefficients coded by the context-based adaptive arithmetic coding compared to Huffman coding. The dash dotted line presents the compression percentage of the quantized MDCT coefficients coded by the adaptive arithmetic coding compared to Huffman coding. It can be seen that the proposed context-based adaptive arithmetic coding performs better than the adaptive arithmetic coding when coding both norms and MDCT coefficients, especially when the frequency band gains are coded.

Audio quality
The proposed context-based arithmetic coding is performed directly on the quantized audio parameters, and the technique is lossless, so the decoded parameters using the proposed arithmetic coding method should have no distortion. In the quality tests to evaluate the arithmetic coding, objective comparison tests would be firstly used to verify the lossless coding. By the objective comparison, i.e., PEAQ [21] over a large number of speech and music samples, all samples generated by the proposed variable rate G.719 appear the same as those of the fixed rate G.719. Secondly, we carry out the preferable listening tests to verify that the proposed scheme does not introduce any kind of undesirable effects although there is no need to use subjective listening tests if the sample values are not changed. It is thus verified that the proposed variable rate coder has the same audio quality as the original G.719 under the different coding modes. Besides, we use the audio comparing tool 'CompAudio' [22] to check if all the sample values are equal before and after the arithmetic coding.    Through careful audio quality evaluation and the value comparison, the proposed context-based adaptive arithmetic coding actually leads to lossless compression used for the quantized audio parameters. It is verified that the proposed technique is lossless and the detailed test results need not to be reported. As to the audio qualities of the full codec (e.g., ITU-T G.719), the formal test results can be found in [23,24].

Complexity test
The computational complexity obtained per frame can be specified in terms of the weighted million operations per second (WMOPS) and can be evaluated by the average running time. The coding rate is set to 32 kbps. The processor of the computer is the Intel Core 2 Duo processor (Intel, Santa Clara, CA, USA). The basic frequency is 1.8 GHz. Each frame has a length of 960 samples. Table 8 shows the average complexity of the original fixed rate G.719, the proposed variable rate G.719, and the proposed adaptive arithmetic coding modules based on context. The encoder and decoder complexities are computed separately.
In fact, the proposed adaptive arithmetic coding itself results in the increase of the complexity in the new scheme. The additive complexity of the proposed entropy coding modules can be acceptable in some applications because of the intrinsic low complexity of G.719 codec. However, almost 50% increase in total complexity should be considered to be optimized if very low complexity is actually needed.

Conclusions
The novel context-based adaptive arithmetic coding technique proposed in this paper behaves promising and significant for the lossless compression when both the time and frequency plane of the audio coding parameters are considered. The proposed technique has been introduced to compress the quantized MDCT coefficients and the quantized norms in G.719. Variable rate coding structure has also been investigated and adopted to obtain high coding efficiency compared with the original fixed rate G.719. Experiments have shown that the new technique achieves a coding gain of 6% to 10% at all coding modes for different types of signals, appearing to be advantageous over the conventional Huffman coding. To evaluate the performance of the proposed algorithm, objective and subjective quality tests have been done for a variety of speech and audio samples. The average bit rates and computation complexity have also been computed at different coding modes. It is verified that the proposed variable rate coder with the adaptive arithmetic coding based on the timefrequency context produces the same audio quality as the original G.719 coder while achieving a high coding gain. The proposed method in this paper can be easily used in other audio codecs which need to lower the coding bit rate by means of entropy coding.