Method and apparatus for data encoding and data recording medium

Abstract: A data encoding method and apparatus in which the volume of arithmetic-logical operations for calculating the total number of bits required for encoding for adaptive bit allocation in the variable length encoding system for expediting the processing. In the data encoding apparatus for encoding and subsequently variable length encoding the input data, spectral data obtained on orthogonal transform coding are routed to a block floating circuit (403) for normalization and re-quantized in a quantization circuit (404) depending on the bit allocation number information from a bit allocation calculating circuit (406) so as to be then variable length encoded by an encoding circuit (407) and outputted at an output terminal (408). In the bit allocation calculation circuit (406), reference is had to a table for bit number calculation (409) in which re-quantized data domain is divided at boundary points corresponding to code length transitions in order to calculate the total number of bits required for encoding for use in adjusting the numbers of allocated bits with a smaller volume of the arithmetic-logical operations.

Description: BACKGROUND OF THE INVENTION This invention relates to a method and apparatus for encoding digital signal data obtained on digitizing speech or audio signals or video signals, and a data recording medium having encoded data recorded thereon. In compressing data at a pre-set bit rate (the number of bits per unit time) for recording or transmission, it is necessary to calculate the number of bits required for encoding before actually proceeding to encoding. The number of bits may be obtained by calculating the sum of the number of bits required for respective words. In general audio signal compression techniques, it is determined by which number of bits or steps the respective signal components of the input signal are to be quantized, and quantization is effectuated with the number of quantization bits thus determined or with the number of quantization steps thus determined in order to encode the quantized words. With fixed-length encoding, the number of bits required for encoding may be determined only with the number of bits or with the number of quantization steps, so that the number of bits required for encoding may be determined without effectuating the quantization. Conversely, with variable length encoding, the number of bits required for encoding is changed depending on the value of the quantized words, even if the word has been quantized with the same number of quantization bits or the same number of quantization steps. Thus the number of bits required for encoding cannot be known unless the quantization is effectuated. Fig.1 is a flow chart showing the process of calculating the sum of the numbers of bits in the variable length encoding. In Fig.1, the number of bits Allbits required for encoding an input data string Data[i] is calculated. The number of data in the data string is Mdata. The number of bits or the number of quantization steps are assumed to be pre-set. At step S10, the loop control variable i used for the series of operations and the variable Allbits indicating the total number of bits are initialized, that is set to zero. At the next step S11, the ith data Data[i] is normalized, using a normalizing coefficient, in order to calculate a normalized value D. The function Normalize() executes normalization in accordance with a pre-set normalization coefficient. At the next step S12, the normalized value is actually quantized. The function Quantize() effectuates quantization in accordance with the pre-set number of quantization bits or the pre-set number of quantization steps and returns the as-quantized values (integers). At the next step S13, the number of bits required for encoding the quantized value Q Length[i] is found. The function LenOfVal() is responsive to the as-quantized value to return the number of bits required for encoding. At the next step S14, the number of encoding bits Length[i] of the as-quantized value Q is cumulatively added to the variable Allbits indicating the total number of bits in order to calculate the sum of the numbers of bits required for encoding. At the next step S15, i is incremented for having reference to the next data. At the next step S16, it is determined whether or not processing has been completed for all of the data Data[i]. If the result is YES, the program is terminated. If otherwise, the program reverts to step S11 in order to process the next data. With the variable length encoding, since it becomes necessary to quantize the respective input data in order to calculate the total number of bits required for encoding, the quantity of the arithmetic/ logical operations becomes voluminous. A digital coding process in which acoustic signals can be transmitted and/or recorded without any subjective quality reduction of musical signals with a reduction of data rate by factors of 4 to 6 by calculating the total number of bits for variably length encoding is described in WO-A-88 01811. A transform encoder/decoder system which employs a discrete transform, adaptive transform coefficient quantization, and adaptive bit allocation to encode high-quality music at low bit rates is known from EP-A-0 511 692. Further, there is known from EP-A-0 570 131 a method for compression encoding digital speech signals in which the digital speech signals are divided at a predetermined time interval into plural frequency bands so as to be sub-divided along both the time scale and the frequency scale to form plural sub-blocks, and data encoding is performed using an allocation bit number of determined for each of said sub-blocks. SUMMARY OF THE INVENTION In view of the foregoing, it is an object of the present invention to provide a method and apparatus for encoding digital signal data whereby the total number of bits required for encoding may be calculated with a smaller volume of arithmetic-logical operations to contribute to speedup and cost reduction by process simplification. This object is achieved by an encoding apparatus and an encoding method according to the enclosed independent claims. Advantageous features of the present invention are defined in the corresponding subclaims. According to the present invention, the total number of bits may be calculated using the boundary values corresponding to code length transitions without performing word-based quantization for diminishing the volume of the arithmetic-logical operations. This may be advantageously employed for adjustment of bit allocation for adaptive bit allocation for controlling the encoding so that the total number of bits of the variably encoded data is within a pre-set number of bits. By reducing the number of the boundary points on the quantized data string corresponding to the code length transitions, it becomes possible to reduce the volume of the arithmetic-logical operations required for encoding. Also, by quantizing input data by quantization means with positive- negative symmetry at the final stage of encoding, variable length encoding the encoded values using code lengths with positive- negative symmetry and by calculating the total number of bits required for encoding by collectively handling the quantized data of the same magnitude, or by performing the calculation using quantized data domain division corresponding to the boundary points on the quantized data string corresponding to code length transitions for calculating the total number of bits required for encoding, it becomes possible to further reduce the volume of the arithmetic-logical operations required for encoding. BRIEF DESCRIPTION OF THE DRAWINGS Fig.1 is a flow chart for illustrating the process of calculating the total number of bits required for variable length encoding in the conventional practice. Fig.2 is a block circuit diagram showing an embodiment of a high efficiency audio data encoding device according to the present invention. Fig.3 illustrates a block size for orthogonal transform in the embodiment shown in Fig.2. Fig.4 is a block circuit diagram showing an embodiment of an adaptive bit allocation encoding circuit employed in the embodiment of Fig.2. Fig.5 is a flow chart for illustrating the processing executed by a bit allocation circuit shown in Fig.4. Fig.6 is a flow chart for illustrating an illustrative example of calculation of the total number of bits required for encoding at a step S2 of Fig.5. Fig.7 is a flow chart for illustrating part of the process for calculating the total number of bits for variable length encoding according to the conventional system. Fig.8 is a block circuit diagram for illustrating an embodiment of a decoding device for decoding the data encoded by the encoding device shown in Fig.2. Fig.9 i a block circuit diagram showing an embodiment of an adaptive bit allocation decoding circuit in the decoding device shown in Fig.8. Fig.10 is a flow chart for illustrating the process of calculating the total number of bits required for variable length encoding according to a modification of the present invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring to the drawings, preferred illustrative embodiments of the present invention will be explained in detail. Specifically, the technique of high efficiency encoding the input digital signal, such as an audio PCM signal, using sub-band coding (SBC), adaptive transform coding (ATC) and adaptive bit allocation, is explained by referring to Fig.1 ff. With the illustrative high efficiency coding device, shown in Fig.2, the input digital signal is divided into plural frequency bands, the bandwidths of which are selected so that the two lower most bands are of the same bandwidth and the bandwidth becomes wider with increase in the frequency. The input digital signal is orthogonally transformed for each of the frequency bands to produce spectral signals on the frequency axis. The resulting spectral data is encoded by adaptive bit allocation for each critical band for the low frequency range in order to take into account the psychoacoustic characteristics of the human auditory system as later explained and for sub-bands divided from the critical bands for the mid to high frequency range in order to take the block floating efficiency into account. With the embodiment shown herein, the orthogonal transform block size is adaptively changed in accordance with the input signal prior to proceeding to orthogonal transform. Referring to Fig.2, with the sampling frequency of, for example, 44.1 kHz, audio PCM signals of from 0 to 22 kHz are supplied to an input terminal 100. This input signal is divided by a frequency spectrum dividing filter 101, such as a QMF filter, into a band of 0 to 11 kHz and a band of 11 to 22 kHz. The signal of the band of 0 to 11 kHz is further divided by a frequency spectrum dividing filter 102, such as a QMF filter, into a band of 0 to 5.5 kHz (low range band) and a band of 5.5 to 11 kHz (mid range band). The QMF filter for dividing the input signal into plural frequency bands is discussed in, for example, R.E. Crochiere, Digital Coding of Speech in Sub-bands, 55 Bell Syst. Tech. J. No.8 (1976). The technique of dividing a frequency spectrum into equal-width frequency ranges is discussed in Joseph H. Rothweiler, Polyphase Quadrature Filters- A New Sub-band Coding Technique, ICASSP 83 Boston. The signals of the respective bands from the filters 101, 102 are routed to orthogonal transform circuits 103, 104 and 105. The outputs of the respective bands from the filters 101, 102 are routed to an orthogonal transform block size decision circuit 106 where the block size for each band is determined. The orthogonal block size information as determined by the orthogonal transform block size decision circuit 106 is routed to the orthogonal transform circuits 103, 104 and 105 where the filter outputs of the respective bands are blocked depending on the block sizes so as to be processed with orthogonal transform. In the orthogonal transform block size decision circuit 106, the block size length of 11.6 msec, which is the maximum block size, is used as a basic size. If the signal is temporally quasi-stationary, the frequency resolution is increased by selecting the maximum orthogonal transform block size of 11.6 msec. If the signal is not temporally non-stationary, the orthogonal transform block size is divided into four and eight for the band lower than 11 kHz and for the and higher than 11 kHz for increasing time resolution. Fig.3 shows orthogonal transform block sizes for one transform frame. Thus the block size of 11.6 msec (long mode) or the block size of 2.9 msec (short mode) is selected for the low to mid ranges and the block size of 11.6 msec (long mode) or the block size of 1.45 msec (short mode) is selected for the high range. The hatched portions in Fig.3 represent the block sizes of the short mode. Returning to Fig.2, the filter outputs are blocked and orthogonal-transformed by the orthogonal transform circuits 103, 104 and 105 depending on the block size information from the orthogonal transform block size decision circuit 106 for each transform frame so as to be routed to an adaptive bit allocation encoding circuit 108. The orthogonal transform block size information is also routed to the adaptive bit allocation encoding circuit 108. The encoded data from the adaptive bit allocation encoding circuit 108 is outputted at an output terminal 110. Among the known techniques for orthogonal transform, there is the technique of dividing the input audio signal into frames of a predetermined time duration, and processing the resulting frames using a fast Fourier transform (FFT), discrete cosine transform (DCT) or modified DCT (MDCT) to convert the signals from the time axis into the frequency axis. Discussion of a MDCT may be found in J.P. Princen and A.B. Bradley, Sub-band/Transform Coding Using Filter Bank Based on Time Domain Aliasing Cancellation, ICASSP 1987. Fig.4 shows, in a block circuit diagram, a schematic constitution of an illustrative example of the adaptive bit allocation encoding circuit 108 shown in Fig. 2. In Fig.4, frequency-domain spectral data from the orthogonal transform circuits 103, 104 and 105 or the MDCT coefficient data are supplied to a terminal 401, while the block size information from the orthogonal transform block size decision circuit 106 is routed to a terminal 402. The spectral data from the terminal 401 is routed to a block floating circuit 403, a scaling factor setting circuit 405 and to a bit allocation calculating circuit 406. In the scaling factor setting circuit 405, the floating information for block floating is set in accordance with the spectral data divided in consideration of the critical bands and the block floating. The floating information usually employed is approximately a peak value of the spectral data in each critical band and sub-bands divided from the critical bands in order to take into account the block floating. The floating information thus set is employed as the scaling factor for each critical band and sub-bands divided from the critical bands in order to take into account the block floating. In the bit allocation calculation circuit 406, the masking quantity for each critical band and sub-bands divided from the critical bands in order to take into account the block floating is found in order to take into account the so-called masking effect based upon the spectral data divided into the critical bands and for taking the block floating into account. The number of bits allocated to the respective bands are found on the basis of the masking quantity thus found and the energy or peak values of each critical band and sub-bands divided from the critical bands in order to take into account the block floating. Since there is a limit to the number of available bits, it is necessary to adjust the number of allocated bits at the same time as the total number of bit required for encoding is calculated so that the number of bits required for encoding will not exceed the total number of available bits. Reference is made to a table memory 409 for calculating the number of bits required for encoding. The processing in the bit allocation circuit 406 will be explained subsequently. The block floating circuit 403 processes the spectral data with block floating for each critical band and sub-bands divided from the critical bands in order to take into account the block floating on the basis of the scaling factor (floating information) as set by the scaling factor setting circuit 403. In the quantization circuit 404, the respective spectral data are re-quantized depending on the scaling factors as set by the scaling factor setting circuit 405 and the number of bits allocated for the bands by the bit allocation calculation circuit 406. The quantized spectral data outputted by the quantization circuit 404, the scaling factor data outputted by the scaling factor setting circuit 405, the information on the allocated bit numbers outputted by the bit allocation calculation circuit 406 and the orthogonal transform block size information supplied from the terminal 402, are routed to an encoding circuit 407 so as to be encoded in accordance with a variable length coding system and outputted at an output terminal 408. The processing by the bit allocation circuit 406 is now explained. Fig.5 shows, in a flow chart, the processing steps at the bit allocation circuit 406. Referring to Fig.5, the numbers of bits allocated to the respective bands are calculated at step S1. At the next step S2, the number of bits required for quantizing and encoding in accordance with the numbers of allocated bits is calculated. At the next step S3, the total number of bits for encoding is compared to the pre-set number of available bits. If the total number of bits required for encoding is smaller, the processing comes to a close. If the total number of bits required for encoding is larger, code overflow occurs, so that the number of allocated bit is decreased at step S4, after which the program reverts to step S2 in order to calculate the total number of bits required for encoding. The above processing is repeated until the total number of bits becomes less than the number of available bits. In Fig.6, there is shown a flow chart for calculating the total number of bits required for encoding data in accordance with the variable length encoding system, as an illustrative example of processing contents at step S2 of Fig.5. In Fig.6, the number of bits Allbits required for encoding the input data string Data[1] made up of Mdata input data. The spectral data or the MDCT coefficient data become the input data string Data[1]. At steps S20 and S21, the variables for arithmetic-logical operations are initialized. That is, at step S20, the loop control variable i and the variable Allbits indicating the total number of bits are both set to 0. At step S21, the variable j is set to zero. At the next step S22, the input data string Data[i] is normalized in accordance with pre-set normalization coefficients, in order to calculate normalized data D. The scaling factors are employed as the normalizing coefficients. At the next step S23, the normalized data D is compared to B[j] as later explained. If D is smaller than B[j], the program shifts to step S26 where Length[i] = L[j] is set. That is, L[j] as later explained is employed as the number of bits Length[i] required for encoding Data[i]. Discussion on B[j] and L[j] will be made subsequently. If the result of decision at step S23 is NO, that is if D is larger than or equal to B[j], the program shifts to step S24 to increment j . At the next step S25, it is judged whether j is smaller than Nbound. Decision at step S23 is repeated until j reaches Nbound. That is, the above process steps are repeated until the relation D < B[j] is met. At the next step S27, Length[i] is added to Allbits to calculate the total number of bits required for encoding. At the next step S28, i is incremented. At step S29, it is judged whether i is smaller than Ndata and, if the result is YES, the program reverts to step S21, in order to repeat the above process steps a number of times equal to the number of data (Ndata). Turning to B[j] and [L], B[j] represents the boundary values on D for which the variable length code transition takes place. The code length transition does not take place if D is within a range of B[j-1] to B[j]. That is, the input data D has the same code length within such range. The code length at this time is L[j]. If D is within a range of from B[j-1] to B[j], the input data Data[i] is encoded with a code having a length L[j]. For illustrating an example of the method for determining B[j], illustrative examples of an encoding table employed for variable length encoding in the encoding circuit 407 of Fig.3 is shown in Table 1, while an illustrative example of the contents of a table memory 409 employed for calculating the number of bits required for encoding in the bit allocation calculating circuit 406 is shown in Table 2. Nstep = 11 k QBound[k] Quant[k] Code[k] CodeLen[k] 0 -0.818 -5 11111 5 1 -0.636 -4 11101 5 2 -0.455 -3 1101 4 3 -0.273 -2 1011 4 4 -0.091 -1 1001 4 5 0.091 0 0 1 6 0.273 1 1000 4 7 0.455 2 1010 4 8 0.636 3 1100 4 9 0.818 4 11100 5 10 1.000 5 11110 5 Nbound = 5 j B[j] L[j] 0 -0.636 5 1 -0.091 4 2 0.091 1 3 0.636 4 4 1.000 5 Table 1 shows an example of variable length encoding for the number of quantization steps Nstep at the time of quantization of the input data equal to 11. In Table 1, QBound[k] denotes the boundary values of quantization. If the normalized data value is in a range of from QBound[k-1] to QBound[k], quantization is made at Quant[k] which depends on a particular quantizer employed. Code[k] is a code obtained on variable length encoding the quantization value Quant[k]. CodeLen[k] denotes the code length of Code[k]. In effect, Code[k] is recorded or transmitted by a length equal to CodeLen[k]. Based on Table 1, the point of transition of CodeLen[k], that is the point at which the value of CodeLen[k] differs from the value of the next CodeLen[k+1], is found in order to determine the boundary value B[j] and the code length L[j]. In the illustrative example, there are five regions, with such number of regions being Nbound mentioned above. This Table 2 is written in the table memory 409 of Fig.4 and is employed for calculating the number of bits for encoding by the bit allocation calculating circuit 406. Thus the number of bits required for encoding can be easily calculated by carrying out the steps S23 to S26 of Fig.6 based on Table 2 without the necessity of carrying out the quantization and encoding of each data based on Table 1. For comparison, the operation of calculating the number of bits required for encoding in the conventional practice employing Table 1 is explained by referring to Fig.7. In this figure, there is shown a processing corresponding to steps S12 and S13 of Fig.1. The step S11 of Fig.1 is followed by a step S12a of Fig.7, and a step S13a of Fig.7 is followed by a step S14 of Fig.1. That is, the variable k is initialized to 0 at step S12a of Fig.7. Then it is judged at step S12 whether or not the input data D is smaller than the boundary value QBound[k] for quantization. If the result is YES, k is a value corresponding to the quantization value. The program shifts to step S13a where Length[i] = CodeLen[k] is set. That is, CodeLen[k] in Table 1 is employed as the number of bits length[i] required for encoding the input data Data[i]. If the result of judgment at step S12b is NO, the program shifts to step S12c to increment the variable k . At the next step S12d, it is determined if k is smaller than the number of quantization steps Nstep. The decision at step S12b is repeated until k reaches Nstep. Thus the processing is continued until the relation D < QBound[k] is met. With the above-described conventional method, the process steps need to be repeated a number of times equal to a maximum value of Nstep in order to find the number of bits required for encoding. If the number of quantization steps Nstep assumes a value of 63 or more, the maximum number of times of repetition is significantly increased. In addition, the number of data Ndata is as large as e.g., 512. Furthermore, if the total number of bits is larger than the number of available bits, the number of allocated bits needs to be decreased in order to calculate the number of bits required for encoding. Since the processing steps can be repeated over an unpredictable number of times, the volume of the arithmetic -logical operations becomes voluminous. On the contrary, with the embodiment illustrated, the domain is divided into plural regions at boundary values corresponding to changes in the coding lengths, and the number of bits required for encoding is calculated on the region basis, so that the number of repetition is limited to the number of the regions Nbound at the maximum, thereby diminishing the volume of the arithmetic-logical operations. This leads not only to the merit of expediting the processing at the bit allocation calculation circuit 406 but to the merit of enabling real-time processing even with the use of an inexpensive constant-rate processing IC. Referring to Figs.8 and 9, an example of a decoding apparatus for decoding data encoded by a high efficiency encoding device explained in conjunction with Figs.1 to 4. In Fig.8, showing a schematic constitution of the decoding apparatus, encoded data from the output terminal 110 of Fig.2, encoded in accordance with the variable length encoding system, is supplied to an input terminal 210. The encoded data is routed to an adaptive bit allocation decoding circuit 208 for decoding so as to be restored to spectral data on the frequency axis. The orthogonal transform block size information is taken out by the decoding operation and transmitted to inverse orthogonal transform circuits 203, 204 and 205 for respective bands along with the spectral data on the frequency axis. In Fig.9, there is shown in a block diagram a schematic constitution of an illustrative example of the adaptive bit allocation decoding circuit 208 shown in Fig.8. The encoded data routed to a terminal 601 of Fig.9 is decoded by the decoding circuit 602 in accordance with the variable length decoding system so as to be restored to the spectral data information on the frequency axis, scaling factor information, allocated bit number information and the orthogonal bit number information. The orthogonal bit number information is outputted at an output terminal 607. The spectral data information and the bit allocation number information are routed to an inverse quantization circuit. The spectral data information is inverse quantized based on the allocated bit number information. The inverse quantized spectral data information from the inverse quantization circuit 603 and the scaling factor information from the decoding circuit 602 are fed to the inverse floating circuit 604. The spectral data information is processed with inverse floating based on the scaling factors for restoration to spectral data so as to be outputted at an output terminal 606. Returning to Fig.8, data in the bandwidth of 0 to 5.5 kHz, data in the bandwidth of 5.5 to 11 kHz and data in the bandwidth of 11 to 22 kHz, among the spectral data from the adaptive bit allocation decoding circuit 208, are routed to the inverse orthogonal transform circuits 203, 204 and 205, respectively, so as to be inverse orthogonal-transformed on the band basis in accordance with the orthogonal transform block size information. Outputs of the inverse orthogonal transform circuits 204, 205 are synthesized by a band synthesis circuit 202. Outputs of the inverse orthogonal transform circuit 203 and the band synthesis filter 202 are synthesized by the band synthesis filter 201 to generate a playback signal which is outputted at an output terminal 200. The quantizer employed in the above-described embodiment is the most commonplace quantizer. If a quantizer with positive-negative symmetry is employed, the volume of the arithmetic-logical operations may be diminished as compared to that achieved with the conventional system if the code lengths for the quantized values also exhibit positive- negative sign symmetry, that is, if the absolute values of two quantized values having positive and negative signs are the same, these quantized values are of the same code length. Table 3 shows an illustrative example of the code table in case of performing variable length encoding with positive- negative symmetry on the quantized values having positive- negative sign symmetry. Nstep = 6 k |QBound[k]| |Quant[k]| Code[k] CodeLen[k] 0 0.091 0 0 1 1 0.273 1 1000 4 1001 4 2 0.455 2 1010 4 1011 4 3 0.636 3 1100 4 1101 4 4 0.818 4 11100 5 11101 5 5 1.000 5 11110 5 11111 5 By representing QBound[k] and Quant[k] by corresponding absolute values |QBound[k]| and |Quant[k]|, the number of quantization steps Nstep may be diminished from 11 of Table 1 to 6 of Table 3, thereby correspondingly diminishing the volume of the arithmetic-logical operations. In addition, by dividing the domain of the quantized values at the boundaries of transition of the code length CodeLen[k], that is at the positions indicated by broken lines of Table 3, it becomes possible to obtain a table for calculating the number of bits for encoding, as shown in Table 4. Nbound = 3 j B[j] L[j] 0 0.091 1 1 0.636 4 2 1.000 5 In Table 4, the number of the boundary values B[j], corresponding to transitions of the code length of Table 3, is equal to 3. That is, the number of regions becomes three (Nbound = 3). By such variable length encoding with symmetry for positive- negative signs, that is variable length encoding in which the same code length is used for the same absolute value of quantized values different in sign, the number of transitions of the code length may be decreased, as shown in Table 4. That is, the smaller the number of the boundaries, the easier becomes the arithmetic-logical operations for finding the total number of bits, so that the number of values to be pre-set, namely B[j] and L[j], may be decreased. An example of the processing operations for calculating the total number of bits for encoding by using Table 4 is shown in the flow chart of Fig.10. In this figure, the steps the processing contents of which are the same as those of the steps of the flow chart of Fig.6 are denoted by the same reference numerals, and the corresponding description is not made. The example of Fig.10 differs from the example of Fig.5 only with respect to step S23a in which the absolute value |D| of the normalized data D is compared to the boundary value B[j] of Table 4 in distinction from the step S23 of Fig.6. However, the number of regions Nbound at step S25 in Fig.10 is 3 in place of Nbound = 5 in Fig.6, thus indicating that the volume of arithmetic-logical operations can be diminished further. Table 5 shows an example of a variable length coding in which the number of boundaries of code length transition is further diminished by further reducing the kinds of the code lengths employed for variable length coding. Nstep = 6 k |QBound[k]| |Quant[k]| Code[k] CodeLen[k] 0 0.091 0 00 2 1 0.273 1 0110 4 0111 4 2 0.455 2 1000 4 1001 4 3 0.636 3 1010 4 1011 4 4 0.818 4 1100 4 1101 4 5 1.000 5 1110 4 1111 4 In Table 5, there are only two kinds of code lengths CodeLen[k] of the variable length coding, that is 2 and 4, and the same code length 4 is employed except the code length 2 for the center value 0. The volume of the arithmetic-logical operations may be expected to be diminished by approximately the same value with the use of Table 5 as with the use of Table 3. In Table 5, the domain may be divided at boundary values corresponding to the points of code length transitions in order to prepare a table for calculating the number of bits for encoding (Table 6). Nbound = 2 j B[j] L[j] 0 0.091 1 1 1.000 4 The Table 6 is an example for calculating the number of bits for variable length encoding with the minimum number of transitions. Thus there are only two regions, that is a region centered around the center position 0 and the remaining regions. Thus the volume of the arithmetic-logical operations necessary for calculating the total umber of bits required for encoding can be reduced further. The present invention is not limited to the above-described embodiments, and may be applied not only to processing of audio or PCM signals, but also to processing of digital speech signal or digital video signal. There are also a wide variety of bit allocation techniques, such as the simple fixed bit allocation, bit allocation based on band-based signal energy or the bit allocation consisting in the combination of the fixed bit allocation and variable bit allocation. The orthogonal transform block size is not limited to the above example and may for example be 23.2 msec along the time axis. The signal frequency spectrum may also be divided into four bands and may 'be optionally set to 22.05 kHz or 20 kHz.

Claims: An encoding method for variably length encoding quantized data derived from quantizing a signal corresponding to an input signal, the method comprising a step of total bit calculating (S2;S20-S29) for calculating the number of bits required for variably length encoding, wherein said total bit calculating step comprises: a normalizing step (322) for normalizing the input data D[i] in accordance with preset normalization coefficients in order to calculate normalized data D, a bit number calculation step (S23-S25) for deriving the number of bits for encoding a value of said normalized data D from only both of boundary values B[j] and the corresponding code length L[j] in a table, the boundary values being the values of normalized data [D] for which the variable length code transition takes place, said table only including boundary values B[j] for consecutive quantized values with the same code length and the corresponding code length L[j], and a summing step (S27) for summing the code length L[j] determined in said bit number calculation step for each normalized data D. The encoding method as claimed in claim 1 wherein said quantized data are quantized by quantization means (404) with positive-negative sign symmetry at the final stage of encoding, the encoded values are variable length encoded (407) using code lengths with positive-negative sign symmetry and wherein, when calculating (406) the total number of bits required for encoding, the total number of bits required for encoding is calculated by collectively handling the quantized data of the same magnitude having opposite signs. The encoding method as claimed in claims 1 or 2 wherein the encoding is adaptive transform encoding (108) and a adaptive bit allocation and wherein the number of bit allocation is variably controlled depending on the calculated total number of bits required for encoding. The encoding method as claimed in any one of claims 1 to 3 wherein the technique of blocking the input data and transforming the blocks into spectral signals, dividing the spectral data into plural units and normalizing and re-quantizing the resulting units is used as the encoding technique, and wherein the number of bit allocation for re-quantization is variably controlled depending on the total number of bits required for encoding. An encoding apparatus for variably length encoding quantized data derived from quantizing a signal corresponding to an input signal, the apparatus comprising a total bit calculating means (406) for calculating the number of bits required for variably length encoding, wherein said total bit calculating means (406) comprises: a normalizing means for normalizing the input data D[i] in accordance with preset normalization coefficients in order to calculate normalized data D, a bit number calculation means for deriving the number of bits for encoding a value of said normalized data D from only both of boundary values B[j] and the corresponding code length L[j] in a table, the boundary values being the values of normalized data [D] for which the variable length code transition takes place, said table only including boundary values B[j] for consecutive quantized values with the same code length and the corresponding code length L[j], and a summing means for summing the code length L[j] determined in said bit number calculation means for each normalized data D. The encoding apparatus as claimed in claim 5 wherein quantization means (404) with positive-negative sign symmetry is employed at the final stage of encoding (407), variable length encoded employing code lengths with positive-negative sign symmetry is employed for variable length encoding of quantized values, and wherein the total number of bits required for encoding is calculated (406) by collectively handling the quantized data of the same magnitude having opposite signs.

Inventors: SHIMOYOSHI OSAMU, SONOHARA MITO, TSUTSUI KYOYA, SHIMOYOSHI, OSAMU, SONOHARA, MITO, TSUTSUI, KYOYA, SHIMOYOSHI, OSAMU, C/O SONY CORP., SONOHARA, MITO, C/O SONY CORP., TSUTSUI, KYOYA, C/O SONY CORP.
Applicants: SONY CORP, SONY CORPORATION
Application year: 1995
Main classification: G11B20
IPC codes: H04B1, G11B20, H03M7, G10L19