Audio coding method and audio coding apparatus

Abstract: There is provided an audio coding method which is capable of creating coded data of high-quality with no discontinuity in real time without being affected by processing ability of a CPU (14) on a personal computer (1) and by how much another application occupies processing resources of the CPU, in a scheme in which a digital audio signal is divided into plural frequency bands and a coding process is performed for each subband. In order to generate bit allocation information for each of plural frequency subbands into which a digital audio signal is divided, it is employed a process for performing bit allocation with high efficiency using a relationship of a signal to a mask based on a predetermined psychoacoustic model and a process for performing bit allocation with a lower load. According to processing amount information of the CPU which is occupied by a coding process, bit allocation means to-be-used are changed.

Description: FIELD OF THE INVENTION: The present invention relates to an audio coding method, an audio coding apparatus, and a data storage medium. More particularly, the present invention relates to an audio coding method and an audio coding apparatus using a subband coding scheme according to an MPEG (Motion Picture Experts Group) standard, and a data storage medium which contains a program for implementing the audio coding method. BACKGROUND OF THE INVENTION: In recent years, with spread of a multimedia personal computer or internet, it becomes possible to reproduce a moving picture or audio according to MPEG standard by software on the personal computer (PC), and coded data according to MPEG standard has been widely used. As an encoder for creating coded data, expensive hardware is commonly used. While the coded data is sometimes created by software, since this coding process requires processing time several times as much as real time necessary for playing back a moving picture or audio, a plenty of time and troubles become necessary, and therefore, this has not been widely spread. In order to make it possible for a PC user to create coded data at a low cost and with ease, it is required that coded data be created in real time by software processing. Hereinafter, a description will be given of an example of a conventional audio coding method. Figure 11 is a block diagram showing an MPEG audio encoder standardized by ISO/IEC11172-3 as a format of coded audio data. Turning to figure 11, subband analysis means 202 divides an input digital audio signal into 32 frequency components, and scale factor calculation means 203 calculates scale factors for respective subband signals and makes dynamic ranges for the respective subband signals uniform. The input digital audio signal is also subjected to an FFT (Fast Fourier Transform) process by FFT means 204. Based on this result, psychoacoustic analysis means 205 derives a relationship model of an SMR (Signal to Mask Ratio) based on a psychoacoustic model utilizing a characteristic of men's auditory sense. Then, using this model, the bit allocation means 206 determines the number of bits to be allocated to each subband signal. According to the number of bits allocated to each subband signal, quantization/encoding means 207 quantizes/encodes each subband signal. Bit stream creating means 209 creates a bit stream comprising quantized/encoded data from the quantization/encoding means 207 and header information and auxiliary information which have been encoded by auxiliary information encoding means 208, and outputs the bit stream. In this conventional audio coding method, a coding process is performed for each subband by utilizing the fact that band power is distributed nonuniformly. Therefore, audio quality is determined by bit distribution for each subband signal using the psychoacoustic model. In addition, since the audio coding method has been standardized for the purpose of using a storage medium, it is well suitable for creating high-quality coded data, but is less suitable for a coding process in real time. The psychoacoustic model which determines audio quality requires a large amount of operation. EP 0 803 989 A1 discloses an audio coding apparatus comprising bit allocation means having a plurality of psychoacoustic models, and selecting means for selecting for each subband a psychoacoustic model according to control information input externally by a user. The conventional audio coding method and audio coding apparatus are so constructed, and are well suitable for creating high-quality coded data for the storage medium, but are less suitable for processing in real time on the PC by software in view of current CPU's processing ability, because use of the psychoacoustic model requires high processing ability. When operation is performed on the PC on which a high-performance CPU which has capability of real-time processing is mounted, if another application occupies a large part of processing by the CPU, processing cannot be performed in real time. As a consequence, discontinuity of audio might occur. SUMMARY OF THE INVENTION: It is an object of the present invention, as defined by the appended independent claims, to provide an audio coding method and an audio coding apparatus, which are capable of creating coded data of high quality and with no discontinuity without being affected by processing ability of a CPU on a personal computer and how much another application occupies processing on the CPU, and a data storage medium which contains a program for implementing this coding process. Other objects and advantages of the invention will become apparent from the detailed description that follows. The detailed description and specific embodiments described are provided only for illustration since various additions and modifications within the spirit and scope of the invention will be apparent to those skill in the art from the detailed description. BRIEF DESCRIPTION OF THE DRAWINGS: Figure 1 is a block diagram showing a system using a personal computer as an implementation of an audio coding apparatus using an audio coding method according to a first embodiment of the present invention. Figure 2 is a block diagram showing a structure of an encoder of the audio coding apparatus of the first embodiment. Figure 3 is a block diagram showing a detailed structure of high-band encoding means included in the encoder. Figure 4 is a block diagram showing a detailed structure of the encoder of the audio coding apparatus of the first embodiment. Figure 5 is a diagram showing an example of a bit allocation process for each group, which is included in the audio coding method of the first embodiment. Figure 6 is a diagram showing another example of a bit allocation process for each group, which is included in the audio coding method of the first embodiment. Figure 7 is a diagram showing flow for explaining coding operation of the encoder of the coding apparatus of the first embodiment. Figure 8 is a diagram showing an example of a bit allocation process for each group using a threshold, which is included in the audio coding method of the first embodiment. Figure 9 is a block diagram showing a detailed structure of modification of the encoder of the coding apparatus of the first embodiment. Figure 10 is a block diagram showing a data storage medium and construction of an audio coding apparatus using the data storage medium according to a second embodiment of the present invention. Figure 11 is a block diagram showing an encoder of a conventional audio coding apparatus. Figure 12 is a diagram showing a detailed structure of low-band encoding means included in an audio coding apparatus according to a third embodiment of the present invention. Figure 13 is a diagram for explaining a psychoacoustic model for each frame in a low-band coding process performed by the audio coding apparatus of the third embodiment. Figure 14 is a diagram showing a detailed structure of low-band encoding means included in an audio coding apparatus according to a fourth embodiment of the present invention. Figure 15 is a diagram showing an example of a bit allocation process by the audio coding apparatus of the fourth embodiment. Figure 16 is a block diagram showing a structure of an encoder of an audio coding apparatus according to a fifth embodiment of the present invention. Figure 17 is a block diagram showing a structure of an encoder which handles an audio signal and a video signal. Figure 18 is a block diagram showing a case where the present invention is applied to a coding process performed by a coding apparatus which performs a coding process according to time/frequency transformation. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS: Now, a description will be given of an audio coding method and an audio coding apparatus according to preferred embodiments of the present invention with reference to figures. Embodiment 1. Hereinafter, a description will be given of a coding method in which an input signal is divided into a plurality of frequency components and a coding process is performed for each subband by utilizing the fact that band power is distributed nonuniformly. Figure 1 is a conceptual diagram showing the whole system in which a personal computer (PC) is used as an audio coding apparatus according to the coding method. In figure 1, reference numeral 1 denotes a multimedia PC into which data is input from external equipment such as a camera 17 and a microphone 19, and comprises a hard disc drive (HDD) 11 as a fixed storage medium which has a large storage capacity for storing various data and programs, a PD drive 12a and an FD drive 12b as detachable storage media which have relatively small storage capacities, for performing I/O operations of programs or data between the HDD11 and the same. The program stored in the HDD 11 is suitably read on a memory 13 constituted by an RAM (random access memory) or the like, according to an instruction from a CPU (central processing unit) 14, and executed. To capture video and audio in the camera 17 and the microphone 19, a video capture card 16 and a sound card 18 are built in the PC, respectively. In so constructed PC 1, respective components are connected by means of an internal bus 15. Figure 2 is a block diagram showing an encoder 20 of an audio coding apparatus for implementing an audio coding process performed by the PC 1 shown in figure 1, and is actually implemented by the program read on the memory 13 from the HD 11. In figure 2, reference numeral 21 denotes CPU load monitor information with which a load status of the CPU 14 is monitored, and reference numeral 22 denotes means (control means) for controlling encoding means which controls operation of low-band encoding means 23 and high-band encoding means 24 according to the CPU load monitor information 21. Reference numeral 25 denotes bit stream creating means for creating a stream signal from outputs of the encoding means 23 and 24. Reference numeral 26 denotes a coding mode specifying signal which is input to the control means 22 by a user. As construction of the low-band encoding means 23 shown in figure 2, for example, construction shown in figure 11 may be employed. As construction of the high-band encoding means 24, for example, like the conventional example shown in figure 11, as shown in figure 3, employed is a coding scheme for performing a coding process for each subband by utilizing the fact that band power is distributed nonuniformly, although bit allocation for each subband signal using the psychoacoustic model is not performed, but instead, there is provided band output adaptive bit allocation means 304, for weighting scale factors of subband signals based on characteristics of auditory sense of men. This construction aims at low-load processing rather than high-quality audio processing. In addition, in order to avoid concentration of bit allocation to a specified subband, the weighting is adjusted for each subband per bit allocation. Figure 4 is a block diagram showing a detailed structure of the encoder 20 shown in figure 2. In figure 2, reference numeral 101 denotes an encoder, which comprises subband analysis means 102, scale factor calculation means 103, FFT means 104, psychoacoustic analysis means 105, quantization/encoding means 106, auxiliary information encoding means 107, bit stream creating means 108, band output adaptive bit allocation means 109, psychoacoustic model bit allocation means 110, grouping means 111, bit allocation process control means 112, and allocatable bit calculation means 113. The subband analysis means 102 divides an input digital audio signal into 32 frequency components. The scale factor calculation means 103 calculates scale factors for respective subband signals and makes dynamic ranges for respective subbands uniform. The grouping means 111 separates the 32 frequency components into groups of the number specified by processing amount control information 121 as control information externally input. In this first embodiment, as shown in figure 5, the number of groups is set to "3". Subband signals in each of the groups are continuous in a frequency-axis direction. Three groups are a low-band group A composed of subbands 0-15, a high-band group B composed of subbands 16-29, and an insignificant group C composed of subbands 30 and 31 for which bit allocation is not performed. Suppose that the processing amount control information 121 includes the CPU load monitor information 21 and the coding mode specifying signal 26. In this first embodiment, as bit allocation means for allocating bits to bands in respective groups, the psychoacoustic model bit allocation means 110 and the band output adaptive bit allocation means 109 are used. The psychoacoustic model bit allocation means 110 performs bit allocation for the low band to which men's ears are highly sensitive, with high efficiency, by using a relationship of the SMR based on the psychoacoustic model specified according to MPEG standard. The band output adaptive bit allocation means 109 performs bit allocation for the high band to which men' s ears are less sensitive, with a load lower than the psychoacoustic model bit allocation, by using addition of scale factor information from the scale factor calculation means 103 and the preset minimum audible limit value for each subband. The bit allocation process control means 112 controls the FFT means 104 so that the FFT means 104 subjects the input digital audio signal to the FFT process before psychoacoustic analysis of the low band group A composed of 0-15 subbands to be subjected to the psychoacoustic model bit allocation. From this transformation result, the psychoacoustic analysis means 105 derives the relationship model of the SMR value based on the psychoacoustic model using characteristics of men's auditory sense. The allocatable bit calculation means 113 calculates the number of bits allocatable to the groups determined by sampling frequencies or coding bit rates in such a way that it calculates the number of allocatable bits for the bit allocation means for each group, by using the ratio of each group to which bits are to be allocated to all groups, which has been weighted based on characteristics of respective subbands in each group. In this first embodiment, taking scale factor index values and a ratio of the low band/high band, and based on the number of bits to be allocated to all groups, the number of bits to be allocated to each of the psychoacoustic model bit allocation means 110 and the band output adaptive bit allocation means 113 is determined. Actually, from respective scale factor index values scf_index [i] calculated by the scale factor calculation means 103, according to the following expressions (1) and (2), addition values Vpsy and Vnon of the scf_index [i] for respective groups are calculated. where psy_end =16 is the number of subbands to which psychoacoustic model bit allocation is to be performed, and subband-end=30 is the number of subbands to which bit allocation is to be performed. Then, in order to allocate more bits to the low band to which men's ears are highly sensitive, the Vspy is weighted as follows: Vpsy = Vpsy * 0.75 To find the number of bits allocatable to the psychoacoustic model bit allocation "psy_num", and the number of bits allocatable to the band output adaptive bit allocation "non_num", the following expressions are adopted: Vnon=Vnon*psy-ratio psy_num=all_alloc_num*Vnon/(Vpsy + Vnon) non_num=all_alloc_num-psy_num, where all_alloc_num is the number of bits to be allocated to all groups, and psy_ratio is psy_end/(subband_end-psy_end). Within a range of bits allocatable to each group (psy_num, non_num), the psychoacoustic model bit allocation means 110 allocates bits to the subbands 0-15 in the low-band group A by using the relationship model of the SMR value from the psychoacostic analysis process means 105, while the band output adaptive bit allocation means 109 allocates bits to the subbands 16-29 in the high-band group B. For the subbands 30 and 31 in the insignificant group C, since they are assumed to be insignificant subbands, bit allocation will not be performed. According to the number of bits to be allocated to respective subband signals which is determined by these bit allocation means, the quantization/encoding means 106 quantizes/encodes respective subband signals, and then the bit stream creating means 108 creates a bit stream based on the resulting quantized/encoded subband signals and header information and auxiliary information which have been encoded by the auxiliary information encoding means 107. When the processing amount control information 121 is, for instance, information for reducing an encoding amount, as shown in figure 6, a bandwidth for the low-band group A composed of the subbands 0-15 to which the psychoacoustic model bit allocation means 110 allocates bits is reduced to a low band group A' composed of subbands 0-7, while a bandwidth for the high band group B composed of subbands 16-29 to which the band output adaptive bit allocation means 109 allocates bits is increased to a high-band group B' composed of subbands 8-29. Furthermore, to realize the least encoding amount, the band output adaptive bit allocation means 109 is adapted to allocate bits to subbands 0-29. In this case, the psychoacoustic model bit allocation means 110 does not operate substantially, and therefore the FFT means 104 and the psychoacoustic analysis means 105 do not operate, either. On the other hand, when the processing amount control information unit 121 is, for instance, information for improving quality of coded audio data, the bandwidth of subbands to which the psychoacoustic model bit allocation means 110 which is capable of highly efficient bit allocation to realize high-quality audio data, should allocate bits, is increased. Furthermore, in order to realize the highest possible quality, the psychoacoustic model bit allocation means 110 is adapted to allocate bits to the subbands 0-29. In this embodiment, increase/decrease in the subbands or change of the bit allocation means is carried out frame by frame corresponding to a minimum unit which is decodable into an audio signal, thereby controlling the encoding amount in real time. Subsequently, flow of operation of the audio coding apparatus of the first embodiment will be described with reference to figure 7. Initially, construction shown in figure 7(a) is used. In order to recognize a processing load placed on each of the encoders, dummy data during a predetermined time period is encoded in each mode of each encoder (according to change of the bandwidth of subbands to which bit allocation is to be performed), and thereby a CPU load monitoring unit 700 stores a CPU load value in each mode in a data table 701. When sample (data) is input, in step S70 shown in figure 7(b), subband analysis of the sample data is conducted and the sample data is divided into 32 frequency components. Then in step S71, scale factors of respective subbands are calculated. Then, in step S72, it is decided whether or not a CPU load has been detected. Since operation just starts, the CPU load is not detected, and hence advance is made to step S74, where normal grouping is conducted so that the highest-quality audio is reproduced. Then, in step S75, the psychoacoustic model bit allocation process is performed. In step S76, a quantization/encoding process is performed. Finally, in step S79, the bit stream is created, whereby a series of processing is completed. At the completion of this processing, time required for coding a predetermined number of samples is posted to the CPU load monitoring unit 700, and thereby a current load on the CPU is detected. So, in subsequent processing, in step S72, it is decided that the CPU load has been detected. In step S73, when decided that the detected CPU load cannot be encoded in real time, in step S77, an optimum mode (grouping) is selected with reference to the data table 701. Then, step S78 (band output adaptive bit allocation process) and step S75 (psychoacoustic model bit allocation process) are respectively performed at a predetermined rate. Then, in step S76, the quantization/encoding process is performed. Finally, in step S79, the resulting coded data is created into the bit stream. While in the first embodiment, the allocatable bit calculation means 113 calculates the number of bits to be allocated to the bit allocation means for each group, taking the scale factor index values and the ratio of the low band to the high band into account, the scale factor index values may be replaced by spectrum signal levels of respective groups from the FFT means 104 or the minimum audible limit values preset for respective subbands. In addition, while the encoder 101 includes the CPU load monitoring means 700 for monitoring a processing amount of the CPU to control a processing amount of the encoder 101 so that the encoder 101 operates within the CPU's processing ability, this information may be control information externally input by a user. The user input enables an encoding process resulting in a audio quality and an image quality according to preference of the user. Further, as bit allocation means of the encoder 101 used on a fixed basis in the first embodiment, employed are the psychoacoustic model bit allocation means 110 which performs bit allocation to the low band to which men's ears are highly sensitive, with higher efficiency, and the band output adaptive bit allocation means 109 which performs bit allocation to the high band to which men's ears are less sensitive, with the lower load placed on the CPU. When decided that levels of subband signals in each group are below preset thresholds for respective subbands, based on the signal from the scale factor calculation means 103, that is, as shown in figure 8, significant coded data in the low band is less than that in the high band, the bit allocation means need not be used on a fixed basis according to the respective bands. Instead, the psychoacoustic model bit allocation means 110 may be used for the high band. Moreover, instead of comparison between the levels of subband signals in each group and the thresholds based on the signal from the scale factor calculation means 103, as shown in figure 9, a signal from the FFT means 104, which has a frequency higher than the signal from the scale factor calculation means 103, may be input to the bit allocation process control means 112, and thereby comparison may be made between the levels of the subband signals in each group and the preset thresholds. Embodiment 2. A description will be given of a data storage medium according to a second embodiment of the present invention. When a coding program for realizing construction of the audio coding apparatus or the coding method of the first embodiment is stored in a data storage medium such as a floppy disk, processing described in the first embodiment can be easily implemented in an independent computer system. Figures 10(a)-10(c) are diagrams for explaining the case where the coding process of the first embodiment is executed by a computer system, using a floppy disk which contains the image coding program. Figure 10(a) shows a front view of a floppy disk FD, a cross-sectional view thereof, and a floppy disk body D. Figure 10 (b) shows an example of a physical format of the floppy disk body D. The floppy disk FD has the configuration in which a floppy disk case FC contains the floppy disk body D. On the surface of the floppy disk body D, a plurality of tracks Tr are formed concentrically from the outer circumference of the disk toward the inner circumference. Each track Tr is divided into 16 sectors (Se) in the angular direction. Therefore, in the floppy disk FD having the above-mentioned program, data of the program is stored in the assigned sectors on the floppy disk body D. Figure 10(c) illustrates the construction for storing the program in the floppy disk FD and performing the image processing using the program stored in the floppy disk FD. To be specific, when the program is stored in the floppy disk FD, data of the program is written in the floppy disk FD from the computer system Cs through the floppy disk drive FDD. When the above-described audio coding apparatus is constructed in the computer system Cs by the program recorded in the floppy disk FD, the program is read from the floppy disk FD by the floppy disk drive FDD and then loaded to the computer system Cs. While in the above description the floppy disk is employed as the data storage medium, an optical disk may be employed to perform an audio coding process by software like the floppy disc. Further, the data storage medium is not restricted to the floppy disc and the optical disc. Any medium may be employed as long as it can contain the program, for example, an IC card, ROM cassette, etc. In this case, also, the audio coding process by software can be performed in a like manner as the case of using the floppy disk. Embodiment 3. A description will be given of an audio coding method and an audio coding apparatus according to a third embodiment of the present invention with reference to figures. As the construction of the high-band encoding means 24 shown in figure 2, for example, construction shown in figure 3 is employed. As the construction of the low-band encoding means 23, a coding scheme in which a coding process is performed for each subband utilizing the fact that band power is distributed nonuniformly, like the case shown in figure 11, is employed, although bit allocation to each subband signal by using only the predetermined psychoacoustic analysis means is not performed. Instead, as shown in figure 12, there is provided a simplified psychoacoustic model unit 4062 for performing less amount of processing, whereby a bit allocation process is performed according to bit allocation information generated based on a masking threshold for a previous frame output from the psychoacoustic model unit 4601 and subband signals of a current frame. Figure 12 is a block diagram showing a detailed structure of the low-band encoding means 23 shown in figure 2. In figure 12, reference numeral 401 denotes an encoder, comprises subband analysis means 402, scale factor calculation means 403, bit allocation process control means 404, FFT process means 405, psychoacoustic analysis means 406, psychoacoustic model bit allocation means 407, quantization/encoding means 408, auxiliary information encoding means 409, and bit stream creating means 410. Subsequently, operation will be described. The subband analysis means 402 divides an input digital audio signal into 32 frequency components. The scale factor calculation means 403 calculates scale factors of respective subband signals, and makes respective subband dynamic ranges uniform. The FFT process means 405 subjects the input digital audio signal to an FFT process. The psychoacoustic analysis means 406 is constituted by a normal psychoacoustic model unit 4061 specified according to MPEG standard and the simplified psychoacoustic model unit 4062 which performs processing less than the normal psychoacoustic model unit 4061, each of which calculates the SMR. The normal psychacoustic model unit 4061 calculates the SMR of each subband signal according to the following expression (3), while the simplified psychoacoustic model unit 4062 does not calculate the minimum masking level of each subband in the current frame, but calculates the SMR based on the minimum masking level of the previous (most recent) frame calculated by the normal psychoacoustic model unit 4061 and a sound pressure based on a scale factor value of the current frame calculated by the scale factor calculation means 403. SMR sb ( n ) = L sb ( n ) - LT min ( n ) d b where Lsb(n) is a sound pressure of each subband, and LT min (n) is the minimum masking level of each subband. SMR sb ( n ) = L sb ( n ) - LT mun ( n ) d b where Lsb(n) = 20 • log (scf max (n) • 32768-10) db, scf max (n) is a scale factor value of each subband in the current frame, and LT min (n) is a most recent minimum masking level of each subband calculated by the normal psychoacoustic model unit 4061. The bit allocation process control means 404, according to the processing amount control information unit 121 and assuming that "N" = 3 as shown in figure 13, controls processing of the simplified psychoacoustic model unit 4062 which realizes low-load processing and the normal psychoacoustic model unit 405 which outputs optimum bit allocation information with which higher-quality audio is realized, that is, decides the ratio of usage of these units in terms of frames, and controls the FFT process by the FFT process means 405,that is, decides whether or not the FFT process should be performed by the FFT process means 405. For instance, in the example shown in figure 13, when the processing amount control information 121 which reduces a ratio of the coding process to the CPU processing, is posted to the bit allocation process control means 404, the value of "N" is increased in order to increase usage of the simplified psychoacoustic model unit 4062 which performs less amount of processing. Conversely, when the information which increases the ratio of the coding process to the CPU processing, is posted to the bit allocation process control means 404, the value of "N" is reduced in order to increase usage of the normal psychoacoustic model unit 4061 which realizes high-quality audio. The processing amount can be thus controlled. The psychoacoustic model bit allocation means 407 allocates bits to each of the subband signals divided by the subband analysis means 402, according to the relationship of the SMR as the information from the psychoacoustic analysis means 406. The quantization/encoding means 408 quantizes and encodes respective subband signals. The bit stream creating means 410 creates the resulting quantized/encoded signals and auxiliary data from the auxiliary information encoding means 409 into the bit stream. Thus, in accordance with the third embodiment, since bit allocation is performed every N frames, the load placed on the CPU in time axis direction can be reduced. While in this embodiment, the low-band encoding means shown in figure 2 is used as the encoder 401, the encoder 401 may encodes all subband signals as well as the low-band signals. Embodiment 4. A description will be given of an audio coding method and an audio coding apparatus with reference to figures. A coding apparatus shown in figure 14, like the coding apparatus shown in figure 11, employs the coding scheme in which the coding process is performed for each subband by utilizing the fact that band power is distributed nonuniformly, and difference between them is that the apparatus shown in figure 14 has a capability of adding external data other than audio data to a bit stream to be output. As the external data, image data or text data may be used. Turning to figure 14, an encoder 501 comprises subband analysis means 502, scale factor calculation means 503, FFT process means 504, psychoacoustic analysis means 505, bit allocation means 506, quantization/encoding means 507, auxiliary information encoding means 508, bit stream creating means 509, bit allocation process control means 510, and means for encoding data to-be-added 511. Operation will be described. The subband analysis means 502 divides an input digital audio signal into 32 frequency components. The scale factor calculation means 503 calculates scale factors of respective subbands and makes respective subband dynamic ranges uniform. The FFT process means 504 subjects the input digital audio signal to the FFT process. The psychoacoustic analysis means 505 computes the SMR based on the psychoacoustic model specified according to MPEG standard. The bit allocation process control means 510 monitors a buffer 512 for temporarily storing data to be added into the bit stream to be output, and specifies a range of bit allocation by the bit allocation means 506, according to allocation range control information 513 generated according to decision on whether or not there is data to-be-added in the buffer 512 or decision on whether or not the data to-be-added overflows in the buffer 512. For instance, when there is no data in the buffer 512, as shown in figure 15, bits are allocated to subbands 0-29. In this case, among 100bits to be allocated for all the subbands, 80 bits are allocated to subbands 0-15 and 20 bits are allocated to subbands 16-29. Data is written externally into the buffer 512, and thereby when decided that there is data to-be-added in the buffer 512, the allocation range control information 513 for insertion of data to-be-added is posted to the bit allocation process control means 510. In this fourth embodiment, according to the information 513, 80 bits are allocated to subbands 0-15, and bits are not allocated to subbands 16-29 to which bit allocation is to be originally performed but the remaining 20 bits are allocated to the data to-be-added. For the subbands subsequent to the subband 15, the FFT process and the psychoacoustic analysis process need not be performed in order to reduce the processing amount. Thereafter, the quantization/encoding means 507 quantizes/encodes bit-allocated subbands, and then the bit stream creating means 509 creates a bit stream based on quantized/encoded subband signals and auxiliary data from the auxiliary information encoding means 508, for example, ancillary data according to MPEG standard, and outputs the bit stream. Thus, in accordance with the fourth embodiment, when making transmission at a given bit rate, according to the amount of data to-be-added other than the audio data, the range of bit allocation in the coding process is controlled and the amount of audio data to-be-coded is made variable, whereby the data to-be-added is inserted into the coded data stream. As a result, effective use of a band is realized by using various data for surplus subbands. The range of bit allocation performed by the bit allocation process control means 510 is performed frame by frame, and is made variable according to the amount of data in the buffer 512. These processing enables control of the amount of data to-be-inserted in real time without degrading audio quality within the range of bit allocation when inserting the data to-be-added. Embodiment 5. A description will be given of an audio coding method and an audio coding apparatus according to a fifth embodiment of the present invention with reference to figures. Figure 16 is a block diagram showing a structure of an encoder of the audio coding apparatus using the audio coding method of the fifth embodiment. In the figure, the same reference numerals as those shown in figure 2 denote the same or the corresponding parts. Reference numerals 160-162 denote encoding means A-C which are independently operable, 163 denotes a processing load value storage buffer for storing processing load value information of the respective encoding means A-C, and reference numeral 164 denotes a sample data buffer for supplying sample data to the respective encoding means A-C. Operation will be described. Prior to the coding process, at initialization, predetermined sample data stored in the sample data buffer 164 is supplied to the respective encoding means A-C, and the resulting processing load values of the encoding means A-C or the psychoacoustic models are stored in the buffer 163. The processing load values are output in ascending or descending order, and thereby encoding means adapted to performance of the CPU used in the apparatus is selected quickly, whereby the coding process is carried out by the selected encoding means. How the coding process is performed is the same as shown in the first embodiment, and therefore will not be discussed. Thus, in accordance with the fifth embodiment, at initialization prior to the coding process, the respective encoding means operate according to the sample data, whereby the load values at that point of time are obtained, and according to the load values, the encoding means adapted to the processing ability of the CPU is selected. Thereby, an optimum coding process is carried out. While in each of the above embodiments, the audio coding apparatus is implemented by the use of the PC, a VTR camera, a DVD encoder, and the like, which are built in equipment, may be employed. In addition, while in each of the above embodiments, only audio is handled, both audio and video are processed in the following way. Turning to figure 17, the low-band encoding means and the high-band encoding means 23 and 24 in the construction shown in figure 2 are replaced by video encoding means 170 and audio encoding means 171, which receive a video signal and an audio signal, respectively, and the bit stream creating means 25 in the construction shown in figure 2 is replaced by system stream processing means 172. With this construction, the operation amount of the audio coding process is changed, or switching among plural coding schemes of different operation amounts is performed, according to control information externally input and by the methods described in the above embodiments, whereby the total operation amount of the CPU can be controlled. Further, according to the amount of audio signals to be coded, the amount of video signals to be coded may be changed. Moreover, when using coding schemes according to MPEG2 standard for time-frequency transformation, AAC, Dolby AC-3, ATRAC (MD), instead of the subband coding scheme according to MPEG1, as shown in figure 18, respective means for the coding process are replaced by first and second quantization information calculation means 181 and 182 of different operation amounts, one of which is selected by means for controlling quantization means 180, and is used for handling quantization information rather than coding information.

Claims: An audio coding (101) apparatus which divides an input digital audio signal into a plurality of frequency subbands and performs a coding process for each subband, comprising bit allocation means having plural types of calculation processes (109, 110) which use different computational loads and algorithms as processes of calculating the number of bits which are allocated to the respective divided subbands; selecting means (112) for selecting for each subband a calculation process which is to be executed by said bit allocation means from said plural types of calculation processes according to external control information (121), wherein the external control information is a load value indicating a processing amount of a central processing unit which can be occupied by the coding process; and coding means (106) for performing quantization and coding for each subband within a range of the number of bits which are allocated to the respective subbands calculated by said bit allocation means. The audio coding apparatus of claim 1, wherein the digital audio signal includes plural audio frames in a time axis direction; and said selecting means selects the calculation processes for each audio frame. The audio coding apparatus claim 1, wherein said selecting means selects the calculation processes for subbands that form part of a high frequency subband group and for subbands that form part of a low frequency subband group. The audio coding apparatus of claim 1, further comprising analysis means for dynamically calculating a relationship model of the digital audio signal-to-mask ratio on the basis of characteristics obtained by subjecting the digital audio signal to Fourier transformation and auditory characteristics; and wherein at least one of the calculation processes of the bit allocation means is a calculation process for calculating the number of bits which are allocated to each subband on the basis of the dynamically calculated relationship model. The audio coding apparatus of claim 4, wherein the dynamically calculated relationship model is statically stored in said apparatus after calculation, and at least one of the calculation processes of said bit allocation means is a calculation process for calculating the number of bits which are allocated to each subband on the basis of the held static relationship model. The audio coding apparatus of claim 5, wherein at least one of the calculation processes of said bit allocation means is a calculation process for calculating the number of bits which are allocated to each subband on the basis of a signal level of each subband as well as the held static relationship model. The audio coding apparatus of claim 5, wherein the digital audio signal includes plural audio frames in a time axis direction; and said selecting means selects between a calculation process based on the dynamic relationship model and a calculation process based on the static relationship model with a predetermined audio frame cycle. An audio coding method in which an input digital audio signal is divided into a plurality of frequency subbands and a coding process is performed for each subband, comprising a bit allocation step having plural types of calculation processes which have different computational loads and algorithms as processes for calculating the number of bits which are allocated to the respective divided subbands; a selecting step of selecting a calculation process which is to be executed during the bit allocation step from said plural types of calculation processes according to external control information wherein a load value indicating a processing amount of a central processing unit which can be occupied by the coding process is used as the external control information; and a coding step of performing quantization and coding for each subband within a range of the number of bits which are allocated to the respective subbands calculated by the bit allocation step. The audio coding apparatus of claim 1, wherein the load value is processing amount control information from monitoring means for monitoring processing amount of the central processing unit which can be occupied by the coding process. The audio coding method of claim 8, wherein processing amount control information from monitoring means for monitoring a processing amount of the central processing unit which can be occupied by the coding process is used as the load value.

Inventors: KAWAHARA EIJI, KAWAHARA, EIJI
Applicants: MATSUSHITA ELECTRIC IND CO LTD, MATSUSHITA ELECTRIC INDUSTRIAL CO., LTD.
Application year: 1999
Main classification: G10L19
IPC codes: H04B1, H03M7