Background of the Invention
The present invention relates to an audio coder using entropy coding, i.e., Huffman coding capable of reduction of the amount of calculations in the encoders.
FIG. 2 shows a conventional audio coder having a Huffman coding. In the coding operation, a quantization step width predictor 4 first predicts a quantization step width from input data, and according to this quantization step width a quantizer 1 performs a quantization process. Based on the quantization data calculated in the quantizer 1, a Huffman table is selected, and Huffman coding is performed according to the selected table data in a Huffman coder 2. Then, the number of bits per unit time, for example per second, of the data obtained as a result of the Huffman coding are counted for comparison with a predetermined value B of the bit rate information which is the number of bits per unit time, for example, per second. If the counted bit number is not in excess of the predetermined value B, a process for one frame is completed. If the counted bit number (amount of codes generated) from the Huffman coder 2 is in excess of the predetermined value, the quantization is performed in the quantizer 1 with the quantization step width increased by one step. The above series of counted processes are repeatedly executed until the counted bit number is less than the predetermined value B.
In Japanese Patent Laid-Open Publication No. Hei 3-171828, there is disclosed a reduction technique of the amount of the calculations by using vector quantization. In this technique, provided is a codebook comprising codevectors classified into groups according to the property of the input data. The property of the input data is judged by the property judging means. The codevector in groups corresponding to the judged result is retrieved. According to this technique, the number of vectors to be retrieved is decreased and the amount of calculations required for the optimum vector determination.
In the above method, the calculation amount may be reduced when the series of processes of the quantization, Huffman coding and bit number calculation are completed in one time, or the number of the repeated calculations is small. However, if the step width of the first quantization is greatly different from the appropriate one for the bit rate information, it is necessary to repeat the processes of the quantization, Huffman coding and bit number calculation for a considerable number of times, whereby the amount of calculations is increased.
Summary of the Invention
An object of the present invention is therefore to provide an audio coder using entropy coding capable of reduction of the amount of calculations in the encoders.
According to the present invention, there is provided an audio coder comprising: quantizing means for quantizing input audio signal data with a quantizing step width, first predicting means for predicting the quantization step width to be supplied to the quantizing means on the basis of the input audio signal and a number of bits of quantized data, second predicting means for predicting the quantization step width on the basis of the input audio signal and a number of bits of quantized data, coding means for performing Huffman coding on the quantized data by the quantizing means, calculating means for calculating the number of bits per unit time of the coded sequence signal obtained through coding in the Huffman coding means, and selecting means for selecting either one of the first and second predicting means on the basis of the input audio signal and a number of bits of quantized data, the first predicting means predicting another wider quantizing step width by a predetermined step width when the number of bits calculated by the calculating means is exceeded a predetermined value, and the selecting means selecting said first predicting means when the number of bits calculated by the calculating means is exceeded a predetermined value but is not exceeded a threshold value and selecting the second predicting means when the number of bits calculated by the calculating means is exceeded the predetermined value and the threshold value.
Other objects and features will be clarified from the following description with reference to attached drawings.
Brief Description of the Drawings
FIG. 1 shows a block diagram of an audio coder according to an embodiment of the present invention;
FIG. 2 shows a conventional audio coder having a Huffman coding; and
FIG. 3 shows a flowchart of an operation of the audio coder shown in FIG. 1 .
Detailed Description of the Embodiment
Now, the embodiment of the present invention will be described. FIG. 1 is a block diagram showing an embodiment of the present invention. Referring to FIG. 1, the embodiment comprises a quantizer 1 for quantizing input audio signal data, quantization step width predictors 14 and 15 for predicting the quantization step width from the supplied input audio signal, a predictor/selector 16 for selecting one of the two quantization step width predictors 14 and 15, a Huffman coder 2 for Huffman coding quantized data from the quantizer 1, and a bit number calculator/multiplexer 3 for calculating the bit number of coded sequence signal obtained from the Huffman coder 2 and for multiplexing the code sequence signal from the Huffman coder 2.
The operation of the audio coder shown in FIG. 1 will now be described with reference to the flow chart of FIG. 3. In the first step, the input data is supplied to the quantization step width predictor 14 (Step 1) for predicting and calculating a quantization step width q1 which is determined on the basis of the input data (Step S2). The quantizer 1 executes first quantization for a certain frame by using the data of the quantization step width q1 to produce quantized data which is to be supplied to the Huffman coder 2 (Step S3). The Huffman coder 2 executes Huffman coding to produce the coded sequence signal which is to be supplied to the bit number calculator/multiplexer 3 (Step S4).
The bit number calculator/mutiplexer 3 calculates the number (n) of the bits per second of the coded sequence signal obtained through the Huffman coding (Step S5), and compares the calculated bit number (n) with the predetermined value B of the bit rate information (Step S6). If the number (n) not exceed the predetermined value B, the bit number calculator/multiplexer 3 multiplexes the coded data together with an applied header data (Step S7) and produces a bit stream (Step S8). If the number (n) produced from the Huffman coder 2 is exceeded by the predetermined value B of the bit rate information, the coded bit number n is supplied to the predictor/selector 16 for comparison with a threshold value N (Step S9). If the bit number n exceeds the threshold value N, the quantization step width predictor 15 predicts and calculates another quantization step width q2 (Step S10) based on the bit rate information and the input data. In the Step S10, the quantization step width q2 is determined such as to reduce the amount of the coded data having been obtained using the appropriate Huffman table for coding. The quantizer 1 executes quantization again by using the quantization step width q2 predicted in the quantization step width predictor 15. If the quantized bit number n does not exceed the threshold value N, the quantization step width q1 predicted in the quantization step width predictor 14 is updated by one step to q1' and the quantization in the quantizer 1 is performed based on the quantization step q1'. This repetitive process is carried out until the coded bit number is less than the predetermined value of the bit rate information. Subsequently, the bit number calculator/multiplexer 3 multiplexes the coded data together with the applied header data to produce a bit stream.
It is easily understandable that the present invention may be applied to a coder or coding method of sound signals including speech signal, audio sound signal and other sound signals.
As has been described in the foregoing, according to the present invention it is possible to reduce the amount of the calculations in the entropy coding such as Huffman coding without deterioration in the quality of coding even when there is a great difference between the predetermined bit rate information and the information of number of bits coded data.
Changes in construction will occur to those skilled in the art and various apparently different modifications and embodiments may be made without departing from the scope of the invention. The matter set forth in the foregoing description and accompanying drawings is offered by way of illustration only. It is therefore intended that the foregoing description be regarded as illustrative rather than limiting.