Multi-channel audio signal encoding method and apparatus

By determining the number of bits of the channel pair based on the energy/amplitude of the channel and the number of available bits in the multi-channel audio signal encoding, and encoding it, the problem of insufficient channel frame encoding bits in the prior art is solved, and the quality of the audio signal is improved.

CN113948097BActive Publication Date: 2025-06-13HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010699775.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-17
Publication Date
2025-06-13
Estimated Expiration
2040-07-17

AI Technical Summary

Technical Problem

The existing multi-channel audio encoding technology will cause insufficient encoding bits of channel frames during the energy equalization process, resulting in a decrease in audio signal quality, especially at low bit rates.

Method used

By obtaining the audio signals of P channels of the current frame of the multi-channel audio signal, the number of bits of the K channel pairs is determined according to the energy/amplitude of each channel and the number of available bits, and encoded to obtain the encoded code stream. This method takes into account the energy/amplitude difference of the channel pair, and ensures that channel frames with larger energy/amplitudes can obtain sufficient coded bits through energy/amplitude equalization and bit allocation.

Benefits of technology

The number of bits of each channel pair is reasonably allocated in multi-channel audio signal encoding, and the quality of the decoding terminal reconstruction audio signal is improved, especially in the case of low bit rate, the problem of channel frame quality is effectively avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113948097B_ABST
    Figure CN113948097B_ABST
Patent Text Reader

Abstract

The present application provides a multi-channel audio signal encoding method and apparatus. Embodiments of the present application can obtain audio signals of P channels of the current frame of the multi-channel audio signal, where P is a positive integer greater than 1; determine the respective number of bits for K channels according to the energy / amplitude of the audio signals of the P channels and the available number of bits; and encode the audio signals of the P channels according to the respective number of bits for the K channels to obtain an encoded bitstream, so as to improve the encoding quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to audio encoding and decoding technologies, and particularly to a multi-channel audio signal encoding method and apparatus. Background Art

[0002] With the continuous development of multimedia technologies, audio has been widely applied in fields such as multimedia communication, consumer electronics, virtual reality, and human-computer interaction. Audio encoding is one of the key technologies of multimedia technologies. Audio encoding realizes data volume compression by removing redundant information in the original audio signal to facilitate storage or transmission.

[0003] Multi-channel audio encoding is encoding of two or more channels. Common ones include 5.1 channels, 7.1 channels, 7.1.4 channels, 22.2 channels, etc. By performing screening, pairing, stereo processing, multi-channel side information generation, quantization processing, entropy encoding processing, and bitstream multiplexing on multiple original audio signals, a serial bitstream (encoded bitstream) is formed to facilitate transmission in a channel or storage in a digital medium. Among them, since the energy difference between multi-channels is relatively large, it is necessary to perform energy equalization on the multi-channels before stereo processing to increase the benefit of stereo processing, thereby improving the encoding efficiency.

[0004] For energy equalization, usually the method of taking the average value of the energies of all channels is adopted. This method will affect the quality of the encoded audio signal. For example, for the case where the energy difference between channels is relatively large, the above energy equalization method will cause the encoding bits of the channel frames with large energy / amplitude to be insufficient in quality and become worse, and the encoding bits of the channel frames with small energy are redundant and waste resources. In the case of low bitrates, the total available bits are tight, resulting in a significant decline in the quality of the channel frames with large energy / amplitude. Summary of the Invention

[0005] This application provides a multi-channel audio signal encoding method and apparatus, which is beneficial to improving the quality of the encoded audio signal.

[0006] In a first aspect, an embodiment of this application provides a multi-channel audio signal encoding method, which may include: obtaining audio signals of P channels of the current frame of the multi-channel audio signal, where P is a positive integer greater than 1, and the audio signals of the P channels include audio signals of K channel pairs, and K is a positive integer. Obtaining the energy / amplitude of each of the audio signals of the P channels. Determining the number of bits of each of the K channel pairs according to the energy / amplitude of each of the audio signals of the P channels and the available number of bits. Encoding the audio signals of the P channels according to the number of bits of each of the K channel pairs to obtain an encoded bitstream.

[0007] Among them, the energy / amplitude of the audio signal of one of the P channels includes at least one of the energy / amplitude of the audio signal of this one channel in the time domain, the energy / amplitude of the audio signal of this one channel after time-frequency transformation, the energy / amplitude of the audio signal of this one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of this one channel after energy / amplitude equalization, or the energy / amplitude of the audio signal of this one channel after stereo processing.

[0008] In this implementation manner, by performing bit allocation for the channel pairs according to at least one of the energy / amplitude of the audio signals of the P channels in the time domain, the energy / amplitude after time-frequency transformation and whitening, the energy / amplitude after energy / amplitude equalization, or the energy / amplitude after stereo processing, the number of bits of each of the K channel pairs is determined, so as to realize reasonable allocation of the number of bits of each channel pair in the multi-channel signal coding, and ensure the quality of the audio signal reconstructed at the decoding end.

[0009] In a possible design, the K channel pairs include the current channel pair, and the method may further include: performing energy / amplitude equalization on the audio signals of the two channels of the current channel pair among the K channel pairs, so as to obtain the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization respectively.

[0010] In this implementation manner, by performing energy / amplitude equalization on the audio signals of the two channels within a single channel pair, it is realized that for the channel pairs with large energy / amplitude differences, after energy / amplitude equalization, a large energy / amplitude difference can still be maintained. Thus, when performing bit allocation based on the energy / amplitude after energy / amplitude equalization, more bits can be allocated to the channel pair with larger energy / amplitude, so as to ensure that the encoding bits of the channel pair with larger energy / amplitude meet its encoding requirements, and further improve the quality of the audio signal reconstructed at the decoding end.

[0011] In a possible design, the K channel pairs include the current channel pair. According to the number of bits of each of the K channel pairs, encoding the audio signals of the P channels may include: determining the number of bits of each of the two channels in the current channel pair according to the number of bits of the current channel pair and the energy / amplitude of the audio signals of the two channels in the current channel pair after stereo processing respectively. Encoding the audio signals of the two channels respectively according to the number of bits of each of the two channels in the current channel pair.

[0012] In this implementation manner, after obtaining the number of bits of each of the K channel pairs, bit allocation within the channel pairs can be performed based on the number of bits of each of the K channel pairs, so as to realize reasonable allocation of the number of bits of each channel in the multi-channel signal coding, and ensure the quality of the audio signal reconstructed at the decoding end.

[0013] In a possible design, determining the respective number of bits for the K channels based on the energy / amplitude of the audio signals of the P channels and the available number of bits may include: determining the sum of the energy / amplitude of the current frame based on the energy / amplitude of the audio signals of the P channels; determining the respective bit coefficients for the K channels based on the energy / amplitude of the audio signals of the K channels and the sum of the energy / amplitude of the current frame; and determining the respective number of bits for the K channels based on the respective bit coefficients for the K channels and the available number of bits.

[0014] In a possible design, determining the sum of the energy / amplitude of the current frame based on the energy / amplitude of the audio signals of the P channels may include: determining the sum of the energy / amplitude of the current frame based on the energy / amplitude of the audio signals of the P channels after stereo processing.

[0015] In this implementation, energy / amplitude equalization can be performed on the two channels within a single channel pair, so that for channel pairs with large energy / amplitude differences, after energy / amplitude equalization, a large energy / amplitude difference can still be maintained. As a result, when performing bit allocation based on the energy / amplitude after energy / amplitude equalization, more bits can be allocated to the channel pair with a larger energy / amplitude to ensure that the encoded bits of the channel pair with a larger energy / amplitude meet its encoding requirements, thereby improving the quality of the reconstructed audio signal at the decoding end.

[0016] In a possible design, determining the sum of the energy / amplitude of the current frame based on the energy / amplitude of the audio signals of the P channels after stereo processing may include: calculating the sum of the energy / amplitude of the current frame sum_E according to the formula post .

[0017] Wherein,

[0018] where ch represents the channel index, E post (ch) represents the energy / amplitude of the audio signal of the channel with the channel index ch after stereo processing, sampleCoef post (ch,i) represents the i-th coefficient of the current frame of the ch-th channel after stereo processing, N represents the number of coefficients of the current frame, and N takes a positive integer greater than 1.

[0019] ​In a possible design, determining the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the P-channel audio signals may include: determining the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the P-channel audio signals before energy / amplitude equalization. The energy / amplitude of the audio signal of one channel among the P channels before energy / amplitude equalization includes the energy / amplitude of the audio signal of the one channel in the time domain, or the energy / amplitude of the audio signal of the one channel after time-frequency transformation, or the energy / amplitude of the audio signal of the one channel after time-frequency transformation and whitening.

[0020] In this implementation manner, by using the energy / amplitude of each of the P-channel audio signals of the current frame before energy / amplitude equalization to determine the sum of the energy / amplitude of the current frame, and performing bit allocation based on the sum of the energy / amplitude of the current frame, that is, using the energy / amplitude before energy / amplitude equalization for bit allocation, it is possible to reasonably allocate the number of bits of each channel in the multi-channel signal coding to ensure the quality of the reconstructed audio signal at the decoding end. This implementation manner can solve the problem of insufficient coding bits for the channel signal with large energy / amplitude to ensure the quality of the reconstructed audio signal at the decoding end.

[0021] Using the energy / amplitude before energy / amplitude equalization for bit allocation can, compared with using the energy / amplitude after energy / amplitude equalization for bit allocation, reasonably allocate the number of bits of each channel in the multi-channel signal coding, and decouple the bit allocation process from the energy / amplitude equalization process. That is, the bit allocation process is not affected by the energy / amplitude equalization process. For example, even if the method of taking the average value of the energy / amplitude of all channels is adopted in the energy / amplitude equalization process, this implementation manner using the energy / amplitude before energy / amplitude equalization for bit allocation can still reasonably allocate the number of bits of each channel in the multi-channel signal coding, so that more coding bits are allocated to the channel signal with large energy / amplitude to ensure the quality of the reconstructed audio signal at the decoding end.

[0022] In a possible design, determining the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the P-channel audio signals before energy / amplitude equalization may include:

[0023] According to the formula Calculate the sum of the energy / amplitude of the current frame sum_E pre , where ch represents the channel index, and E pre (ch) represents the energy / amplitude of the audio signal of the channel with the channel index ch before energy / amplitude equalization.

[0024] In a possible design, determining the energy / magnitude sum of the current frame according to the energy / magnitude of each of the P audio signals of the channels may include: determining the energy / magnitude sum of the current frame according to the energy / magnitude before energy / magnitude equalization of each of the P audio signals of the channels and the weighting coefficient of each of the P channels, where the weighting coefficient is less than or equal to 1.

[0025] In this implementation, through the weighting coefficient, the number of bits of each channel in multi-channel signal encoding can be adjusted to achieve a reasonable distribution of the number of bits of each channel in multi-channel signal encoding.

[0026] In a possible design, determining the energy / magnitude sum according to the energy / magnitude before energy / magnitude equalization of each of the P audio signals of the channels and the weighting coefficient of each of the P channels may include:

[0027] According to the formula Calculate the energy / magnitude sum sum_E of the current frame pre ;

[0028] where ch represents the channel index, E pre (ch) is the energy / magnitude of the audio signal of the ch-th channel before energy / magnitude equalization, α(ch) is the weighting coefficient of the ch-th channel, the weighting coefficients of the two channels of a channel pair are the same, and the magnitude of the weighting coefficients of the two channels of the channel pair is inversely proportional to the normalized correlation value between the two channels of the channel pair.

[0029] In this implementation, by adjusting the number of bits of each channel in multi-channel signal encoding through the weighting coefficient, the magnitude of the weighting coefficients of the two channels of a channel pair is inversely proportional to the normalized correlation value between the two channels of the channel pair, that is, the number of bits of the channel pair with low correlation can be increased through the weighting coefficient, thereby improving the encoding effect to ensure the quality of the reconstructed audio signal at the decoding end.

[0030] In a possible design, the P audio signals of the channels further include Q unpaired mono audio signals, P = 2*K + Q, and Q is a positive integer. Determining the number of bits of each of the K channel pairs according to the energy / magnitude of each of the P audio signals of the channels and the available number of bits may include: determining the number of bits of each of the K channel pairs and the number of bits of each of the Q mono channels according to the energy / magnitude of each of the P audio signals of the channels and the available number of bits. Encoding the P audio signals of the channels according to the number of bits of each of the K channel pairs may include: encoding the audio signals of the K channel pairs according to the number of bits of each of the K channel pairs respectively, and encoding the audio signals of the Q mono channels according to the number of bits of each of the Q mono channels respectively.

[0031] In a possible design, determining the number of bits for each of the K channel pairs and the number of bits for each of the Q mono channels according to the energy / amplitude of the audio signals of the P channels respectively and the available number of bits may include: determining the sum of the energy / amplitude of the current frame according to the energy / amplitude of the audio signals of the P channels respectively; determining the bit coefficient for each of the K channel pairs according to the energy / amplitude of the audio signals of the K channel pairs respectively and the sum of the energy / amplitude of the current frame; determining the bit coefficient for each of the Q mono channels according to the energy / amplitude of the audio signals of the Q mono channels respectively and the sum of the energy / amplitude of the current frame; determining the number of bits for each of the K channel pairs according to the bit coefficients for each of the K channel pairs and the available number of bits; and determining the number of bits for each of the Q mono channels according to the bit coefficients for each of the Q mono channels and the available number of bits.

[0032] In a possible design, encoding the audio signals of the P channels according to the number of bits for each of the K channel pairs may include: encoding the audio signals of the P channels after energy / amplitude equalization according to the number of bits for each of the K channel pairs.

[0033] In this implementation manner, the audio signals of the P channels after energy / amplitude equalization can be encoded. The audio signals of the P channels after energy / amplitude equalization can be obtained by performing energy / amplitude equalization on the audio signals of the P channels. The encoding may include stereo processing, entropy encoding, etc., which can improve the encoding efficiency and encoding effect.

[0034] In a second aspect, an embodiment of the present application provides a multi-channel audio signal encoding device. The multi-channel audio signal encoding device may be an audio encoder, or a chip or system-on-chip of an audio encoding device, or may also be a functional module in an audio encoder for implementing the method according to the first aspect or any possible design of the first aspect above. The multi-channel audio signal encoding device can implement the functions performed in the first aspect or each possible design of the first aspect above. The functions can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. For example, in a possible design, the multi-channel audio signal encoding device may include: an acquisition module, configured to acquire the audio signals of the P channels of the current frame of the multi-channel audio signal and the energy / amplitude of the audio signals of the P channels respectively, where P is a positive integer greater than 1, and the audio signals of the P channels include the audio signals of K channel pairs, and K is a positive integer; a bit allocation module, configured to determine the number of bits for each of the K channel pairs according to the energy / amplitude of the audio signals of the P channels respectively and the available number of bits; and an encoding module, configured to encode the audio signals of the P channels according to the number of bits for each of the K channel pairs to obtain an encoded bit stream.

[0035] Among them, the energy / amplitude of the audio signal of one of the P channels includes at least one of the energy / amplitude of the audio signal of this one channel in the time domain, the energy / amplitude of the audio signal of this one channel after time-frequency transformation, the energy / amplitude of the audio signal of this one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of this one channel after energy / amplitude equalization, or the energy / amplitude of the audio signal of this one channel after stereo processing.

[0036] In a possible design, the K channel pairs include the current channel pair, and the encoding module is configured to: determine the respective bit numbers of the two channels in the current channel pair according to the number of bits of the current channel pair and the energy / amplitude of the audio signals of the two channels in the current channel pair after stereo processing respectively. Encode the audio signals of the two channels according to the respective bit numbers of the two channels in the current channel pair.

[0037] In a possible design, the bit allocation module is configured to: determine the sum of the energy / amplitude of the current frame according to the energy / amplitude of the audio signals of the P channels respectively. Determine the respective bit coefficients of the K channel pairs according to the energy / amplitude of the audio signals of the K channel pairs respectively and the sum of the energy / amplitude of the current frame. Determine the respective bit numbers of the K channel pairs according to the respective bit coefficients of the K channel pairs and the available number of bits.

[0038] In a possible design, the bit allocation module is configured to: determine the sum of the energy / amplitude of the current frame according to the energy / amplitude of the audio signals of the P channels after stereo processing respectively.

[0039] In a possible design, the bit allocation module is configured to: according to the formula calculate the sum of the energy / amplitude of the current frame sum_E post 。

[0040] Among them,

[0041] Among them, ch represents the channel index, and E post (ch) represents the energy / amplitude of the audio signal of the channel with the channel index ch after stereo processing, and sampleCoef post (ch,i) represents the i-th coefficient of the current frame of the ch-th channel after stereo processing, N represents the number of coefficients in the current frame, and N takes a positive integer greater than 1.

[0042] In a possible design, the bit allocation module is configured to: determine the energy / magnitude sum of the current frame according to the energy / magnitude of each of the audio signals of the P channels before energy / magnitude equalization, where the energy / magnitude of the audio signal of one of the P channels before energy / magnitude equalization includes the energy / magnitude of the audio signal of the one channel in the time domain, or the energy / magnitude of the audio signal of the one channel after time-frequency transformation, or the energy / magnitude of the audio signal of the one channel after time-frequency transformation and whitening.

[0043] In a possible design, the bit allocation module is configured to: according to the formula calculate the energy / magnitude sum sum_E of the current frame pre , where ch represents the channel index, and E pre (ch) represents the energy / magnitude of the audio signal of the channel with the channel index ch before energy / magnitude equalization.

[0044] In a possible design, the bit allocation module is configured to: determine the energy / magnitude sum of the current frame according to the energy / magnitude of each of the audio signals of the P channels before energy / magnitude equalization and the respective weighting coefficients of the P channels, where the weighting coefficient is less than or equal to 1.

[0045] In a possible design, the bit allocation module is configured to:

[0046] According to the formula calculate the energy / magnitude sum sum_E of the current frame pre ;

[0047] where ch represents the channel index, E pre (ch) is the energy / magnitude of the audio signal of the ch-th channel before energy / magnitude equalization, α(ch) is the weighting coefficient of the ch-th channel, the weighting coefficients of the two channels of a channel pair are the same, and the magnitudes of the weighting coefficients of the two channels of the one channel pair are inversely proportional to the normalized correlation value between the two channels of the one channel pair.

[0048] In a possible design, the audio signals of the P channels further include Q unpaired mono audio signals, P = 2*K + Q, K is a positive integer, and Q is a positive integer. The bit allocation module is configured to: determine the respective number of bits of the K channel pairs and the respective number of bits of the Q mono channels according to the energy / magnitude of each of the audio signals of the P channels and the available number of bits. The encoding module is configured to encode the audio signals of the K channel pairs according to the respective number of bits of the K channel pairs, and encode the audio signals of the Q mono channels according to the respective number of bits of the Q mono channels.

[0049] In a possible design, the bit allocation module is configured to: determine the sum of the energies / amplitudes of the current frame according to the energies / amplitudes of the audio signals of the P channels respectively. Determine the bit coefficients of the K channel pairs respectively according to the energies / amplitudes of the audio signals of the K channel pairs and the sum of the energies / amplitudes of the current frame. Determine the bit coefficients of the Q mono channels respectively according to the energies / amplitudes of the audio signals of the Q mono channels and the sum of the energies / amplitudes of the current frame. Determine the number of bits of the K channel pairs respectively according to the bit coefficients of the K channel pairs and the available number of bits. Determine the number of bits of the Q mono channels respectively according to the bit coefficients of the Q mono channels and the available number of bits.

[0050] In a possible design, the encoding module is configured to encode the audio signals of the P channels after energy / amplitude equalization according to the number of bits of the K channel pairs respectively.

[0051] In one embodiment, the apparatus may further include: an energy / amplitude equalization module. The energy / amplitude equalization module is configured to obtain the audio signals of the P channels after energy / amplitude equalization according to the audio signals of the P channels.

[0052] In a third aspect, an embodiment of the present application provides a multi-channel audio signal encoding method, which may include: obtaining the audio signals of P channels of the current frame of the multi-channel audio signal, where P is a positive integer greater than 1, and the audio signals of the P channels include the audio signals of K channel pairs, and K is a positive integer. Equalize the energies / amplitudes of the audio signals of the two channels of the current channel pair among the K channel pairs according to the energies / amplitudes of the audio signals of the two channels of the current channel pair, so as to obtain the energies / amplitudes of the audio signals of the two channels of the current channel pair after energy / amplitude equalization. Determine the number of bits of the two channels of the current channel pair respectively according to the energies / amplitudes of the audio signals of the two channels of the current channel pair after energy / amplitude equalization and the available number of bits. Encode the audio signals of the two channels respectively according to the number of bits of the two channels of the current channel pair to obtain an encoded bit stream.

[0053] In this implementation, by equalizing the energies / amplitudes of the two channels within a single channel pair, it is possible to ensure that for channel pairs with large energy / amplitude differences, after energy / amplitude equalization, a large energy / amplitude difference can still be maintained. Therefore, when performing bit allocation based on the energies / amplitudes after energy / amplitude equalization, more bits can be allocated to the channel pairs with larger energies / amplitudes to ensure that the encoding bits of the channel pairs with larger energies / amplitudes meet their encoding requirements, thereby improving the quality of the reconstructed audio signal at the decoding end.

[0054] In a possible design, P = 2*K, where K is a positive integer. Based on the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization and the available number of bits, determining the number of bits for each of the two channels of the current channel pair may include: determining the sum of the energy / amplitude of the current frame based on the energy / amplitude of the audio signals of P channels after energy / amplitude equalization. Based on the sum of the energy / amplitude of the current frame, the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization, and the available number of bits, determining the number of bits for each of the two channels of the current channel pair.

[0055] In a possible design, the audio signals of the P channels further include Q unpaired mono audio signals, P = 2*K + Q, where K is a positive integer and Q is a positive integer. Based on the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization and the available number of bits, determining the number of bits for each of the two channels of the current channel pair may include: determining the sum of the energy / amplitude of the current frame based on the energy / amplitude of the audio signals of the two channels of each of the K channel pairs after energy / amplitude equalization and the energy / amplitude of the Q mono audio signals after energy / amplitude equalization. Based on the sum of the energy / amplitude of the current frame, the energy / amplitude of the audio signals of the two channels of the current channel pair, and the available number of bits, determining the number of bits for each of the two channels of the current channel pair. Based on the sum of the energy / amplitude of the current frame, the energy / amplitude of the Q mono audio signals after energy / amplitude equalization, and the available number of bits, determining the number of bits for each of the Q mono channels. Encoding the audio signals of the two channels of the current channel pair according to the number of bits for each of the two channels respectively to obtain an encoded bitstream may include: encoding the audio signals of the K channel pairs according to the number of bits for each of the K channel pairs respectively, and encoding the audio signals of the Q mono channels according to the number of bits for each of the Q mono channels respectively to obtain an encoded bitstream.

[0056] Fourthly, an embodiment of the present application provides a multi-channel audio signal encoding device. The multi-channel audio signal encoding device may be an audio encoder, or a chip or system-on-chip of an audio encoding device, or may also be a functional module in the audio encoder for implementing the method of the third aspect or any possible design of the third aspect. The multi-channel audio signal encoding device can implement the functions performed in the third aspect or each possible design of the third aspect. The functions can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. For example, in a possible design, the multi-channel audio signal encoding device may include: an acquisition module, configured to acquire audio signals of P channels of the current frame of the multi-channel audio signal, where P is a positive integer greater than 1, and the audio signals of the P channels include audio signals of K channel pairs, and K is a positive integer. An energy / amplitude equalization module, configured to perform energy / amplitude equalization on the audio signals of the two channels of the current channel pair according to the energy / amplitude of the audio signals of the two channels of the current channel pair among the K channel pairs, so as to obtain the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization. A bit allocation module, configured to determine the number of bits of the two channels of the current channel pair according to the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization and the available number of bits. An encoding module, configured to encode the audio signals of the two channels according to the number of bits of the two channels of the current channel pair respectively, so as to obtain an encoded bit stream.

[0057] In a possible design, P = 2*K, where K is a positive integer, and the bit allocation module is configured to: determine the sum of the energy / amplitude of the current frame according to the energy / amplitude of the audio signals of the P channels after energy / amplitude equalization; and determine the number of bits of the two channels of the current channel pair according to the sum of the energy / amplitude of the current frame, the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization, and the available number of bits.

[0058] In a possible design, the audio signals of the P channels further include Q unpaired mono audio signals, where P = 2*K + Q, K is a positive integer, and Q is a positive integer. The bit allocation module is configured to: determine the sum of energies / amplitudes of the current frame based on the energies / amplitudes of the audio signals of the two channels of each of the K channel pairs after energy / amplitude equalization, and the energies / amplitudes of the Q mono audio signals after energy / amplitude equalization; determine the number of bits for each of the two channels of the current channel pair based on the sum of energies / amplitudes of the current frame, the energies / amplitudes of the audio signals of the two channels of the current channel pair, and the available number of bits; determine the number of bits for each of the Q mono channels based on the sum of energies / amplitudes of the current frame, the energies / amplitudes of the Q mono audio signals after energy / amplitude equalization, and the available number of bits. The encoding module is configured to: encode the audio signals of the K channel pairs according to the number of bits of each of the K channel pairs, and encode the audio signals of the Q mono channels according to the number of bits of each of the Q mono channels to obtain an encoded bit stream.

[0059] In a fifth aspect, an embodiment of the present application provides an audio signal encoding apparatus, including: a non-volatile memory and a processor coupled to each other, where the processor calls program code stored in the memory to execute the method described in any one of the first aspects above, or to execute the method described in any one of the third aspects above.

[0060] In a sixth aspect, an embodiment of the present application provides an audio signal encoding device, including: an encoder, where the encoder is configured to execute the method described in any one of the first aspects above, or execute the method described in any one of the third aspects above.

[0061] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, including a computer program, where when the computer program is executed on a computer, the computer is caused to execute the method described in any one of the first aspects above, or execute the method described in any one of the third aspects above.

[0062] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, including an encoded bit stream obtained according to the method described in any one of the first aspects above, or an encoded bit stream obtained according to the method described in any one of the third aspects above.

[0063] In a ninth aspect, the present application provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a computer, it is used to execute the method described in any one of the first aspects above, or execute the method described in any one of the third aspects above.

[0064] Tenth aspect, the present application provides a chip, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method described in any one of the above first aspects, or to execute the method described in any one of the above third aspects.

[0065] For the multi-channel audio signal encoding method and device of the embodiments of the present application, obtain the audio signals of P channels in the current frame of the multi-channel audio signal. The audio signals of the P channels include the audio signals of K channel pairs. Determine the number of bits of each of the K channel pairs according to the energy / amplitude of each of the audio signals of the P channels and the available number of bits. Encode the audio signals of the P channels according to the number of bits of each of the K channel pairs to obtain an encoded bit stream. Among them, the energy / amplitude of the audio signal of one of the P channels includes at least one of the energy / amplitude of the audio signal of this one channel in the time domain, the energy / amplitude of the audio signal of this one channel after time-frequency transformation, the energy / amplitude of the audio signal of this one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of this one channel after energy / amplitude equalization, or the energy / amplitude of the audio signal of this one channel after stereo processing. By performing bit allocation for channel pairs according to at least one of the energy / amplitude of each of the audio signals of the P channels in the time domain, the energy / amplitude after time-frequency transformation, the energy / amplitude after time-frequency transformation and whitening, the energy / amplitude after energy / amplitude equalization, or the energy / amplitude after stereo processing, and determining the number of bits of each of the K channel pairs, the number of bits of each channel pair in the multi-channel signal encoding is reasonably allocated, so as to ensure the quality of the reconstructed audio signal at the decoding end. For example, for the case where the energy / amplitude difference between channel pairs is large, through the method of the embodiments of the present application, the problem of insufficient encoding bits for the channel pair with large energy / amplitude can be solved to ensure the quality of the reconstructed audio signal at the decoding end. Description of the Drawings

[0066] Figure 1 It is a schematic diagram of an audio encoding and decoding system example in the embodiments of the present application;

[0067] Figure 2 It is a flowchart of a multi-channel audio signal encoding method in the embodiments of the present application;

[0068] Figure 3 It is a flowchart of a multi-channel audio signal encoding method in the embodiments of the present application;

[0069] Figure 4 It is a flowchart of a bit allocation method for channel pairs in the embodiments of the present application;

[0070] Figure 5Schematic diagram of the processing procedure of the encoding end in the embodiments of the present application;

[0071] Figure 6 Schematic diagram of the processing procedure of the channel encoding unit in the embodiments of the present application;

[0072] Figure 7 Schematic diagram of the processing procedure of the channel encoding unit in the embodiments of the present application;

[0073] Figure 8 Flow chart of another multi-channel audio signal encoding method in the embodiments of the present application;

[0074] Figure 9 Schematic structural diagram of an audio signal encoding device in the embodiments of the present application;

[0075] Figure 10 Schematic structural diagram of an audio signal encoding device in the embodiments of the present application. Detailed implementation manners

[0076] The terms "first", "second", etc. involved in the embodiments of the present application are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, including a series of steps or units. A method, system, product or device does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0077] It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expression means any combination of these items, including any combination of single item (one) or plural items (ones). For example, at least one (one) of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single respectively, or can be multiple respectively, or can be partially single and partially multiple.

[0078] The following describes the system architecture applied in the embodiments of the present application. Refer to Figure 1 , Figure 1FIG. 0 schematically shows a block diagram of an audio encoding and decoding system 10 to which embodiments of the present application are applied. As Figure 1 shown, the audio encoding and decoding system 10 may include a source device 12 and a destination device 14. The source device 12 generates encoded audio data. Therefore, the source device 12 may be referred to as an audio encoding device. The destination device 14 may decode the encoded audio data generated by the source device 12. Therefore, the destination device 14 may be referred to as an audio decoding device. Various embodiments of the source device 12, the destination device 14, or both may include one or more processors and a memory coupled to the one or more processors. The memory may include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other medium that can be used to store the desired program code in the form of computer-accessible instructions or data structures, as described herein. The source device 12 and the destination device 14 may include various devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, televisions, speakers, digital media players, video game consoles, in-vehicle computers, any wearable device, virtual reality (VR) devices, servers providing VR services, augmented reality (AR) devices, servers providing AR services, wireless communication devices, or the like.

[0079] Although Figure 1 the source device 12 and the destination device 14 are shown as separate devices, device embodiments may also include both the source device 12 and the destination device 14 or the functionality of both, i.e., the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality. In such embodiments, the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality may be implemented using the same hardware and / or software, or using separate hardware and / or software, or any combination thereof.

[0080] A communication connection can be established between the source device 12 and the destination device 14 via the link 13. The destination device 14 can receive the encoded audio data from the source device 12 via the link 13. The link 13 can include one or more media or devices capable of moving the encoded audio data from the source device 12 to the destination device 14. In one example, the link 13 can include one or more communication media that enable the source device 12 to directly transmit the encoded audio data to the destination device 14 in real time. In this example, the source device 12 can modulate the encoded audio data according to a communication standard (such as a wireless communication protocol) and transmit the modulated audio data to the destination device 14. The one or more communication media can include wireless and / or wired communication media, such as the radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media can form part of a packet-based network, such as a local area network, a wide area network, or a global network (such as the Internet). The one or more communication media can include routers, switches, base stations, or other devices that facilitate communication from the source device 12 to the destination device 14.

[0081] The source device 12 includes an encoder 20. Additionally, optionally, the source device 12 can further include an audio source 16, a preprocessor 18, and a communication interface 22. In a specific implementation, the encoder 20, the audio source 16, the preprocessor 18, and the communication interface 22 may be hardware components in the source device 12 or software programs in the source device 12. They are described separately as follows:

[0082] The audio source 16 can include or be any type of sound capture device, such as for capturing real-world sounds, and / or any type of audio generation device. The audio source 16 can be a microphone for capturing sounds or a memory for storing audio data. The audio source 16 can also include any type of (internal or external) interface for storing previously captured or generated audio data and / or acquiring or receiving audio data. When the audio source 16 is a microphone, the audio source 16 can be, for example, a local or integrated microphone in the source device. When the audio source 16 is a memory, the audio source 16 can be local or, for example, an integrated memory in the source device. When the audio source 16 includes an interface, the interface can be, for example, an external interface for receiving audio data from an external audio source, such as an external sound capture device like a microphone, an external memory, or an external audio generation device. The interface can be any type of interface according to any proprietary or standardized interface protocol, such as a wired or wireless interface, an optical interface.

[0083] In the embodiments of this application, the audio data transmitted from the audio source 16 to the preprocessor 18 can also be referred to as the original audio data 17.

[0084] A pre-processor 18 for receiving the original audio data 17 and performing pre-processing on the original audio data 17 to obtain pre-processed audio 19 or pre-processed audio data 19. For example, the pre-processing performed by the pre-processor 18 may include filtering, denoising, etc.

[0085] An encoder 20 (or referred to as an audio encoder 20) for receiving the pre-processed audio data 19 and for implementing the various embodiments described hereinafter to implement the application of the audio signal encoding method described in the present application on the encoding side.

[0086] A communication interface 22 for receiving the encoded audio data 21 and for transmitting the encoded audio data 21 to a destination device 14 or any other device (such as a memory) via a link 13 for storage or direct reconstruction, the other device being any device for decoding or storage. The communication interface 22 may be used, for example, to encapsulate the encoded audio data 21 into a suitable format, such as a data packet, for transmission on the link 13.

[0087] The destination device 14 includes a decoder 30. Optionally, the destination device 14 may further include a communication interface 28, an audio post-processor 32, and a speaker device 34. They are described separately as follows:

[0088] A communication interface 28 for receiving the encoded audio data 21 from the source device 12 or any other source, the any other source being, for example, a storage device, such as an encoded audio data storage device. The communication interface 28 may be used to transmit or receive the encoded audio data 21 via the link 13 between the source device 12 and the destination device 14 or via any type of network, the link 13 being, for example, a direct wired or wireless connection, any type of network being, for example, a wired or wireless network or any combination thereof, or any type of private and public network, or any combination thereof. The communication interface 28 may be used, for example, to de-encapsulate the data packet transmitted by the communication interface 22 to obtain the encoded audio data 21.

[0089] Both the communication interface 28 and the communication interface 22 may be configured as unidirectional communication interfaces or bidirectional communication interfaces, and may be used, for example, to send and receive messages to establish a connection, confirm, and exchange any other information related to the communication link and / or data transmission, such as the transmission of encoded audio data.

[0090] A decoder 30 (or referred to as the decoder 30) for receiving the encoded audio data 21 and providing decoded audio data 31 or decoded audio 31.

[0091] An audio post-processor 32 for performing post-processing on the decoded audio data 31 (also referred to as the reconstructed audio data) to obtain post-processed audio data 33. The post-processing performed by the audio post-processor 32 may include, for example, rendering, or any other processing, and may also be used to transmit the post-processed audio data 33 to the speaker device 34.

[0092] A speaker device 34 for receiving the post-processed audio data 33 to play audio to, for example, a user or viewer. The speaker device 34 may be or may include any type of speaker for presenting the reconstructed sound.

[0093] Although, Figure 1 the source device 12 and the destination device 14 are depicted as separate devices, device embodiments may also include both the source device 12 and the destination device 14 or the functionality of both, i.e., the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality. In such embodiments, the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality may be implemented using the same hardware and / or software, or using separate hardware and / or software, or any combination thereof.

[0094] It will be apparent to those skilled in the art from the description that the functionality of the different units or Figure 1 the presence and (exact) partitioning of the functionality of the source device 12 and / or the destination device 14 shown may vary depending on the actual device and application. The source device 12 and the destination device 14 may include any one of a variety of devices, including any type of handheld or stationary device, such as, for example, a notebook or laptop computer, a mobile phone, a smartphone, a tablet or tablet computer, a camera, a desktop computer, a set-top box, a television, a camera, an in-vehicle device, a sound system, a digital media player, an audio game console, an audio streaming device (such as a content service server or a content distribution server), a broadcast receiver device, a broadcast transmitter device, smart glasses, a smart watch, etc., and may or may not use any type of operating system.

[0095] Both the encoder 20 and the decoder 30 can be implemented as any of a variety of suitable circuits, such as, for example, one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof. If the techniques are implemented partially in software, the device can store the instructions of the software in a suitable non-transitory computer-readable storage medium and use one or more processors to execute the instructions in hardware to perform the techniques of the present disclosure. Any of the foregoing (including hardware, software, combinations of hardware and software, etc.) can be regarded as one or more processors.

[0096] In some cases, Figure 1 the audio encoding and decoding system 10 shown in the figure is only an example, and the techniques of the present application can be applied to audio encoding settings (such as, for example, audio encoding or audio decoding) that do not necessarily include any data communication between the encoding and decoding devices. In other instances, the data can be retrieved from local memory, streamed over a network, etc. The audio encoding device can encode the data and store the data in memory, and / or the audio decoding device can retrieve the data from memory and decode the data. In some instances, the encoding and decoding are performed by devices that do not communicate with each other but only encode data into memory and / or retrieve data from memory and decode the data.

[0097] The foregoing encoder can be a multi-channel encoder, such as, for example, a stereo encoder, a 5.1-channel encoder, or a 7.1-channel encoder, etc.

[0098] The foregoing audio data can also be referred to as an audio signal. The audio signal in the embodiments of the present application refers to the input signal in the audio encoding device. The audio signal can include a plurality of frames. For example, the current frame can specifically refer to a certain frame in the audio signal. In the embodiments of the present application, the encoding and decoding of the current frame audio signal are used as an example for illustration. The previous frame or the next frame of the current frame in the audio signal can be encoded and decoded accordingly according to the encoding and decoding method of the current frame audio signal. The encoding and decoding processes of the previous frame or the next frame of the current frame in the audio signal will not be described one by one. Additionally, the audio signal in the embodiments of the present application can be a multi-channel signal, that is, an audio signal including P channels. The embodiments of the present application are used to implement multi-channel audio signal encoding.

[0099] It should be noted that "energy / amplitude" in the embodiments of the present application represents energy or amplitude. Moreover, in the actual processing, for the processing of a frame, if the energy is processed at the beginning, then the subsequent processing is all for the energy, or if the amplitude is processed at the beginning, then the subsequent processing is all for the amplitude.

[0100] The above encoder can execute the multi-channel audio signal encoding method of the embodiments of the present application to reasonably allocate the number of bits of each channel in the multi-channel signal encoding, so as to ensure the quality of the reconstructed audio signal at the decoding end and improve the encoding quality. The specific implementation manner can refer to the specific explanation in the following embodiments.

[0101] Figure 2 It is a flowchart of a multi-channel audio signal encoding method according to an embodiment of the present application. The execution subject of the embodiments of the present application can be the above encoder, such as Figure 2 As shown, the method of this embodiment may include:

[0102] Step 101, obtain the audio signals of P channels of the current frame of the multi-channel audio signal, where P is a positive integer greater than 1, and the audio signals of the P channels include the audio signals of K channel pairs.

[0103] Among them, the audio signal of a channel pair includes the audio signals of two channels. A channel pair in the embodiments of the present application can be any one of the K channel pairs. The audio signals of the two coupled channels are the audio signal of a channel pair.

[0104] In some embodiments, P = 2K. After the screening, pairing, stereo processing and multi-channel side information generation of the multi-channel signal, the audio signals of P channels, that is, the audio signals of K channel pairs, can be obtained.

[0105] In some embodiments, the audio signals of the P channels further include Q unpaired mono audio signals, P = 2 * K + Q, where K is a positive integer and Q is a positive integer.

[0106] After the screening, pairing, stereo processing, and multi-channel side information generation of the multi-channel signal, audio signals of K channel pairs and Q mono audio signals that have not undergone stereo processing can be obtained. Taking a 5.1-channel signal as an example, the 5.1 channels include a left (L) channel, a right (R) channel, a center (C) channel, a low frequency effects (LFE) channel, a left surround (LS) channel, and a right surround (RS) channel. Pair the L-channel signal and the R-channel signal to form a first channel pair, and after stereo processing, obtain a middle-channel M1-channel signal and a side-channel S1-channel signal. Pair the LS-channel signal and the RS-channel signal to form a second channel pair, and after stereo processing, obtain a middle-channel M2-channel signal and a side-channel S2-channel signal. The LFE-channel signal and the C-channel signal are unpaired audio signals. That is, P = 6, K = 2, and Q = 2. The audio signals of the above P channels include the audio signals of the first channel pair, the audio signals of the second channel pair, and the LFE-channel signal and the C-channel signal that have not undergone stereo processing. The audio signals of the first channel pair include the middle-channel M1-channel signal and the side-channel S1-channel signal, and the audio signals of the second channel pair include the middle-channel M2-channel signal and the side-channel S2-channel signal.

[0107] Step 102: Determine the number of bits for each of the K channel pairs according to the energy / amplitude of the audio signals of the P channels and the available number of bits.

[0108] Among them, the energy / amplitude of the audio signal of one channel among the P channels includes at least one of the energy / amplitude of the audio signal of this one channel in the time domain, the energy / amplitude of the audio signal of this one channel after time-frequency transformation, the energy / amplitude of the audio signal of this one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of this one channel after energy / amplitude equalization, or the energy / amplitude of the audio signal of this one channel after stereo processing. The energy / amplitude in the time domain, the energy / amplitude after time-frequency transformation, and the energy / amplitude after time-frequency transformation and whitening are the energy / amplitude before energy / amplitude equalization. In other words, any one or more of the above energy / amplitude can be selected for bit allocation during the bit allocation process.

[0109] The energy / amplitude of the audio signal of this one channel after time-frequency transformation and whitening refers to the energy / amplitude after performing time-frequency transformation and whitening processing on the audio signal of this one channel. The whitening processing is used to make the frequency domain coefficients of the audio signal of this one channel more flat for subsequent coding.

[0110] Perform a single bit allocation according to the energy / amplitude of the audio signals of the P channels and the available number of bits. Here, a single bit allocation refers to the bit allocation for the channel pairs, that is, allocate corresponding numbers of bits to different channel pairs.

[0111] For P = 2K, based on the respective energy / amplitude of the audio signals of P channels and the available number of bits, determine the respective number of bits for K channel pairs. A channel pair can be used as a basic unit. According to the proportion of the energy / amplitude of a basic unit in the energy / amplitude of all basic units (K basic units), perform a single bit allocation for this one basic unit. The energy / amplitude of any one basic unit can be determined according to the energy / amplitude of the audio signals of the two channels within this basic unit. For example, the energy / amplitude of a basic unit can be the sum of the energy / amplitude of the audio signals of the two channels within this basic unit. Through a single bit allocation, bit allocation can be performed among different basic units to obtain the number of bits for each basic unit.

[0112] For P = 2*K + Q, based on the respective energy / amplitude of the audio signals of P channels and the available number of bits, determine the respective number of bits for K channel pairs and the respective number of bits for Q mono channels. A channel pair can be used as a basic unit, and an unpaired single channel is used as a basic unit. According to the proportion of the energy / amplitude of a basic unit in the energy / amplitude of all basic units (K + Q basic units), perform a single bit allocation for this one basic unit. Among them, for the basic unit corresponding to the paired channels, the energy / amplitude of this basic unit can be determined according to the energy / amplitude of the audio signals of the two channels within this basic unit. For the basic unit corresponding to the unpaired channels, the energy / amplitude of this basic unit can be determined according to the energy / amplitude of the audio signal of the mono channel. Through a single bit allocation, bit allocation can be performed among the basic units (K + Q basic units) to obtain the number of bits for each basic unit. In other words, obtain the respective number of bits for K channel pairs and the respective number of bits for Q mono channels.

[0113] Whether P = 2K or P = 2*K + Q, for the determination of the respective number of bits for K channel pairs, one achievable method can be to determine based on any one of the respective energy / amplitude of K channel pairs in the time domain, or the energy / amplitude after time-frequency transformation, or the energy / amplitude after time-frequency transformation and whitening, and the available number of bits. In this implementation method, in order to improve the coding efficiency and coding effect, before bit allocation, energy / amplitude equalization can be performed on the audio signals of K channel pairs. The method of performing energy / amplitude equalization on the audio signals of K channel pairs can be to perform energy / amplitude equalization on the audio signals of all channels in multiple channel pairs, or multiple channel pairs and one or more unpaired mono channels. In this implementation method, the method of performing energy / amplitude equalization on the audio signals of K channel pairs can also be to perform energy / amplitude equalization on the audio signals of the two channels within a single channel pair.

[0114] Another implementable method can be determined according to any one of the energy / amplitude after energy / amplitude equalization of the audio signals of each of the K channel pairs, or the energy / amplitude after stereo processing, and the available number of bits. In this implementation method, in order to improve the coding efficiency and coding effect, before bit allocation, the energy / amplitude equalization can be performed on the audio signals of the K channel pairs. The method of performing energy / amplitude equalization on the audio signals of the K channel pairs can be to perform energy / amplitude equalization on the audio signals of the two channels within a single channel pair. Among them, the energy / amplitude after energy / amplitude equalization or the energy / amplitude after stereo processing of the audio signals of each of the K channel pairs is obtained after performing energy / amplitude equalization on the audio signals of the two channels within a single channel pair.

[0115] Similar to the determination of the number of bits of each of the K channel pairs, when P = 2*K + Q, for the determination of the number of bits of each of the Q mono channels, one implementable method can be determined according to any one of the energy / amplitude of the audio signals of each of the Q mono channels in the time domain, or the energy / amplitude after time-frequency transformation, or the energy / amplitude after time-frequency transformation and whitening, and the available number of bits. Another implementable method can be determined according to any one of the energy / amplitude after energy / amplitude equalization of the audio signals of each of the Q mono channels, or the energy / amplitude after stereo processing, and the available number of bits. Among them, the energy / amplitude after energy / amplitude equalization or the energy / amplitude after stereo processing of the audio signals of each of the Q mono channels is equal to the energy / amplitude before energy / amplitude equalization or the energy / amplitude before stereo processing.

[0116] Step 103: Encode the audio signals of the P channels according to the number of bits of each of the K channel pairs to obtain an encoded bitstream.

[0117] Encoding the audio signals of the P channels can include quantizing, entropy encoding, and bitstream multiplexing the audio signals of the P channels to obtain an encoded bitstream.

[0118] For P = 2K, quantize, entropy encode, and bitstream multiplex the audio signals of the P channels according to the number of bits of each of the K channel pairs to obtain an encoded bitstream.

[0119] For P = 2*K + Q, quantize, entropy encode, and bitstream multiplex the audio signals of the P channels according to the number of bits of each of the K channel pairs and the number of bits of each of the Q mono channels to obtain an encoded bitstream.

[0120] In this embodiment, the audio signals of P channels in the current frame of the multi-channel audio signal are obtained. The audio signals of the P channels include the audio signals of K channel pairs. According to the energy / amplitude of each of the audio signals of the P channels and the available number of bits, the number of bits for each of the K channel pairs is determined. According to the number of bits for each of the K channel pairs, the audio signals of the P channels are encoded to obtain an encoded bit stream. Among them, the energy / amplitude of the audio signal of one channel among the P channels includes at least one of the energy / amplitude of the audio signal of this one channel in the time domain, the energy / amplitude after time-frequency transformation, the energy / amplitude after time-frequency transformation and whitening, the energy / amplitude after energy / amplitude equalization, or the energy / amplitude after stereo processing. By performing bit allocation for the channel pairs according to at least one of the energy / amplitude of each of the audio signals of the P channels in the time domain, the energy / amplitude after time-frequency transformation, the energy / amplitude after time-frequency transformation and whitening, the energy / amplitude after energy / amplitude equalization, or the energy / amplitude after stereo processing, the number of bits for each of the K channel pairs is determined, so as to realize reasonable allocation of the number of bits for each channel pair in the multi-channel signal encoding to ensure the quality of the reconstructed audio signal at the decoding end. For example, for the case where there is a large difference in energy / amplitude between channel pairs, through the method of this embodiment of the present application, the problem of insufficient encoding bits for the channel pair with large energy / amplitude can be solved to ensure the quality of the reconstructed audio signal at the decoding end.

[0121] Figure 3 It is a flowchart of a multi-channel audio signal encoding method according to an embodiment of the present application. The execution subject of the embodiment of the present application may be the above-mentioned encoder, such as Figure 3 shown. The method of this embodiment may include:

[0122] Step 201: Obtain the audio signals of P channels in the current frame of the multi-channel audio signal, where P is a positive integer greater than 1, and the audio signals of the P channels include the audio signals of K channel pairs.

[0123] Among them, for a specific explanation of step 201, reference can be made to Figure 2 step 101 of the embodiment shown, which will not be elaborated here.

[0124] Step 202: Determine the number of bits for each of the K channel pairs according to the energy / amplitude of each of the audio signals of the P channels and the available number of bits.

[0125] Perform a bit allocation according to the energy / amplitude of each of the audio signals of the P channels and the available number of bits.

[0126] For P = 2*K, in the process of one-bit allocation, the method of this embodiment of the present application can determine the number of bits for each of the K channel pairs according to the energy / amplitude of each of the audio signals of the P channels and the available number of bits.

[0127] For P = 2*K + Q, in a single bit allocation process, the method of the embodiment of the present application can determine the number of bits for each of the K channel pairs and the number of bits for each of the Q mono channels according to the energy / amplitude of the audio signals of the P channels and the available number of bits.

[0128] Among them, whether P = 2K or P = 2*K + Q, the explanation of the determination of the number of bits for each of the K channel pairs and the number of bits for each of the Q mono channels in step 202 can be referred to Figure 1 Step 102 of the embodiment shown, which will not be elaborated here.

[0129] Step 203: Determine the number of bits for each of the two channels in the current channel pair according to the number of bits of the current channel pair among the K channel pairs and the energy / amplitude of the audio signals of the two channels in the current channel pair after stereo processing.

[0130] Taking the current channel pair among the K channel pairs as an example, according to the number of bits of the current channel pair among the K channel pairs and the energy / amplitude of the audio signals of the two channels in the current channel pair after stereo processing, perform secondary bit allocation within the current channel pair. The secondary bit allocation is to allocate the number of bits for the two channels in the current channel pair. That is, for the basic unit corresponding to the paired channels, allocate bits within the basic unit according to the energy / amplitude ratio of the audio signals of the two channels in the basic unit. The current channel pair can be any one of the K channel pairs. Here, the secondary bit allocation refers to the bit allocation for the two channels within the channel pair, that is, allocate the corresponding number of bits for the two channels within the channel pair.

[0131] Whether P = 2K or P = 2*K + Q, the above method of step 203 can be used to perform bit allocation within the channel pair to obtain the number of bits for each of the two channels within the channel pair.

[0132] Step 204: Encode the audio signals of the two channels in the current channel pair according to the number of bits for each of the two channels respectively to obtain an encoded bitstream.

[0133] Encoding the audio signals of the two channels in the current channel pair respectively may include quantizing, entropy encoding, and bitstream multiplexing the audio signals of the two channels in the current channel pair respectively to obtain an encoded bitstream.

[0134] For P = 2K, quantize, entropy encode, and bitstream multiplex the audio signals of the P channels respectively according to the number of bits for each of the K channel pairs to obtain an encoded bitstream.

[0135] For P = 2*K + Q, quantize, entropy code, and multiplex the audio signals of K channel pairs according to the respective number of bits of each of the K channels, and quantize, entropy code, and multiplex the audio signals of the Q mono channels according to the respective number of bits of each of the Q mono channels to obtain an encoded bitstream.

[0136] In this embodiment, the audio signals of P channels in the current frame of the multi-channel audio signal are obtained. The audio signals of the P channels include the audio signals of K channel pairs. According to the respective energy / amplitude and available number of bits of the audio signals of the P channels, determine the respective number of bits of the K channel pairs. According to the respective number of bits of the K channel pairs, and according to the number of bits of the current channel pair in the K channel pairs and the respective energy / amplitude of the audio signals of the two channels in the current channel pair after stereo processing, determine the respective number of bits of the two channels in the current channel pair. Encode the audio signals of the two channels according to the respective number of bits of the two channels in the current channel pair to obtain an encoded bitstream. By performing bit allocation for the channel pairs according to at least one of the respective energy / amplitude of the audio signals of the P channels in the time domain, the energy / amplitude after time-frequency transformation, the energy / amplitude after time-frequency transformation and whitening, the energy / amplitude after energy / amplitude equalization, or the energy / amplitude after stereo processing, determine the respective number of bits of the K channel pairs, and then perform bit allocation within the channel pairs based on the respective number of bits of the K channel pairs, so as to reasonably allocate the number of bits of each channel in the multi-channel signal encoding to ensure the quality of the audio signal reconstructed at the decoding end. For example, for the case where the energy / amplitude difference between channel pairs is large, through the method of this embodiment of the present application, the problem of insufficient encoding bits for the channel signal with large energy / amplitude can be solved to ensure the quality of the audio signal reconstructed at the decoding end.

[0137] Figure 4 It is a flowchart of a method for bit allocation of a channel pair according to an embodiment of the present application. The execution subject of the embodiment of the present application can be the above encoder. This embodiment is a specific implementable manner of step 102 of the above Figure 2 As shown in the embodiment, the method of this embodiment may include: Figure 4 As shown,

[0138] Step 1021: Determine the sum of energy / amplitude of the current frame according to the respective energy / amplitude of the audio signals of the P channels.

[0139] For example, the respective energy / amplitude of the audio signals of the P channels includes at least one of the respective energy / amplitude of the audio signals of the P channels in the time domain, the energy / amplitude after time-frequency transformation, the energy / amplitude after time-frequency transformation and whitening, the energy / amplitude after energy / amplitude equalization, or the energy / amplitude after stereo processing.

[0140] Explain how to determine the sum of energy / amplitude of the current frame for different energy / amplitude types.

[0141] Method 1: Determine the sum of energy / amplitude of the current frame based on the energy / amplitude after stereo processing of the audio signals of P channels. The sum of energy / amplitude of the current frame can be the sum of energy / amplitude after stereo processing, sum_E pos 。

[0142] Exemplarily, the sum of energy / amplitude after stereo processing, sum_E, can be determined according to the following formulas (1) and (2) post 。

[0143]

[0144]

[0145] where ch represents the channel index, and E post (ch) represents the energy / amplitude of the audio signal of the channel with channel index ch after stereo processing, and sampleCoef post (ch,i) represents the i-th coefficient of the current frame of the ch channel after stereo processing, and N represents the number of coefficients of the current frame, where N is a positive integer greater than 1. The channel with channel index ch can be any one of the above P channels.

[0146] That is, the sum of energy / amplitude of the current frame can be determined through Method 1 above, and the above-mentioned one-bit allocation can be completed through the following steps 1022 and 1023.

[0147] Method 2: Determine the sum of energy / amplitude of the current frame based on the energy / amplitude of the audio signals of P channels before energy / amplitude equalization. The sum of energy / amplitude can be the sum of energy / amplitude before energy / amplitude equalization, sum_E pre 。

[0148] Exemplarily, the sum of energy / amplitude before energy / amplitude equalization, sum_E, can be determined according to the following formulas (3) and (4) pre 。

[0149]

[0150]

[0151] where E pre(ch) represents the energy / amplitude of the audio signal of the channel with channel index ch before energy / amplitude equalization, sampleCoef(ch,i) represents the i-th coefficient of the current frame of the ch channel before energy / amplitude equalization, N represents the number of coefficients of the current frame, and N is a positive integer greater than 1.

[0152] That is, the energy / amplitude sum of the current frame can be determined by the above method 2, and then the above one-bit allocation can be completed through the following steps 1022 and 1023.

[0153] Method 3: Determine the energy / amplitude sum of the current frame according to the energy / amplitude before energy / amplitude equalization of the audio signals of P channels and the weighting coefficients of the P channels respectively. The weighting coefficient of any one of the P channels is less than or equal to 1. The energy / amplitude sum can be the energy / amplitude sum sum_E before energy / amplitude equalization pre .

[0154] Exemplarily, the energy / amplitude sum sum_E before energy / amplitude equalization is determined according to the following formula (5) pre .

[0155]

[0156] Among them, α(ch) is the weighting coefficient of the channel with channel index ch. The weighting coefficients of the two channels of a channel pair are the same, and the magnitudes of the weighting coefficients of the two channels of a channel pair are inversely proportional to the normalized correlation value between the two channels in the channel pair.

[0157] An implementation method is as follows. When the channel with channel index ch does not participate in pairing, α(ch) is 1. When the channel with channel index ch participates in pairing, taking the channels with channel indices ch1 (hereinafter referred to as ch1), ch2 (hereinafter referred to as ch2), ch3 (hereinafter referred to as ch3), and ch4 (hereinafter referred to as ch4) as examples, where ch1 and ch2 are paired, and ch3 and ch4 are paired, α(ch1) and α(ch2) are equal and both less than 1, and α(ch3) and α(ch4) are equal and both less than 1. α(ch1) and α(ch2) can be determined according to the normalized correlation value Corr_norm(ch1, ch2) between ch1 and ch2. α(ch3) and α(ch4) can be determined according to the normalized correlation value Corr_norm(ch3, ch4). The values of α(ch3) and α(ch4) corresponding to the larger normalized correlation value Corr_norm(ch3, ch4) are less than the values of α(ch1) and α(ch2) corresponding to the smaller normalized correlation value Corr_norm(ch1, ch2). That is, α(ch1) and α(ch2) are inversely proportional to the normalized correlation value Corr_norm(ch1, ch2) between ch1 and ch2.

[0158] Exemplarily, when ch1 and ch2 are paired, α(ch1) and α(ch2) can be calculated by the following formula (6).

[0159] α(ch1, ch2) = C + (1 - C) * (1 – Corr_norm(ch1, ch2)) / (1 - threhold) (6)

[0160] Where C is a constant, C ∈ [0, 1], threhold is the normalized pairing threshold between ch1 and ch2, threhold ∈ [0, 1], Corr_norm(ch1, ch2) is the normalized correlation value between ch1 and ch2, and coeff(ch1, ch2) ∈ [0, 1]. In some embodiments, C can be taken as 0.707. Threhold can be taken as 0.2, 0.25, or 0.28, etc.

[0161] The correlation value between two channels can be calculated by the following formula (7), taking ch1 and ch2 as examples.

[0162]

[0163] Among them, Corr_norm(ch1,ch2) is the normalized correlation value of ch1 and ch2, spec_ch1(i) is the time-domain or frequency-domain coefficient of ch1, spec_ch2(i) is the time-domain or frequency-domain coefficient of channel ch2, and N is the number of coefficients in the current frame.

[0164] For example, the L channel and the R channel are the first channel pair and the normalized correlation value is corr_norm(L,R), and the LS channel and the RS channel are the second channel pair and the normalized correlation value is corr_norm(LS,RS).

[0165] The correlation values of the two channels of other channel pairs can also be calculated using formula (7), and the weighting coefficients of the channels of the channel pairs can also be calculated using formula (6).

[0166] Considering that stereo processing will reduce the sum of the energy / amplitude of the two channels participating in stereo processing, and the degree of reduction of the sum of the energy / amplitude of the two channels is related to the similarity of the audio signals of the two channels, that is, the higher the correlation of the audio signals of the two channels, the more the sum of the energy / amplitude of the two channels is reduced after stereo processing.

[0167] Therefore, when using the energy / amplitude before stereo processing for one-time bit allocation, the weighting coefficient is increased during one-time bit allocation. The weighting coefficients of two channels with high correlation are smaller than those of two channels with low correlation. The weighting coefficient of an unpaired channel is greater than that of a paired channel. The weighting coefficients of the two channels in the same pair are the same. That is, the sum of the energy / amplitude can be determined in the above manner three, and then the above one-time bit allocation can be completed through the following step 1022 and step 1023.

[0168] Step 1022: Determine the bit coefficients of each of the K channel pairs according to the respective energy / amplitude of the audio signals of the K channel pairs and the sum of the energy / amplitude of the current frame.

[0169] After determining the sum of the energy / amplitude by using the above method one, method two or method three, for P = 2K, the bit coefficients of each of the K channel pairs can be determined according to the respective energy / amplitude of the audio signals of the K channel pairs and the sum of the energy / amplitude determined in the above step 1021.

[0170] After determining the sum of the energy / amplitude by using the above method one, method two or method three, for P = 2*K + Q, the bit coefficients of each of the K channel pairs can be determined according to the respective energy / amplitude of the audio signals of the K channel pairs and the sum of the energy / amplitude determined in the above step 1021, and the bit coefficients of each of the Q mono channels can be determined according to the respective energy / amplitude of the Q mono channels and the sum of the energy / amplitude determined in the above step 1021.

[0171] The bit coefficients of the K channel pairs can be the proportions of the energies / amplitudes of the K channel pairs in the sum of the energies / amplitudes determined in the above step 1021. The energy / amplitude of a channel pair can be the sum of the energies / amplitudes of the two channels in the channel pair. The bit coefficients of the Q unpaired mono channels are the proportions of the energies / amplitudes of the Q mono channels in the sum of the energies / amplitudes determined in the above step 1021.

[0172] Step 1023: Determine the number of bits of each of the K channel pairs according to the bit coefficients of each of the K channel pairs and the available number of bits.

[0173] For P = 2K, the number of bits of each of the K channel pairs can be determined according to the bit coefficients of each of the K channel pairs and the available number of bits.

[0174] For P = 2*K + Q, the number of bits of each of the K channel pairs can be determined according to the bit coefficients of each of the K channel pairs and the available number of bits, and the number of bits of each of the Q mono channels can be determined according to the bit coefficients of each of the Q mono channels and the available number of bits.

[0175] In this embodiment, the audio signals of P channels in the current frame of the multi-channel audio signal are obtained. The audio signals of the P channels include the audio signals of K channel pairs. According to the energies / amplitudes of the audio signals of the P channels respectively, the sum of the energies / amplitudes of the current frame is determined. According to the energies / amplitudes of the audio signals of the K channel pairs respectively and the sum of the energies / amplitudes of the current frame, the bit coefficients of each of the K channel pairs are determined. According to the bit coefficients of each of the K channel pairs and the available number of bits, the number of bits of each of the K channel pairs is determined. According to the number of bits of each of the K channel pairs, the audio signals of the P channels are encoded to obtain an encoded bit stream. Among them, the sum of the energies / amplitudes of the current frame is determined by at least one of the energies / amplitudes of the audio signals of the P channels in the time domain, the energies / amplitudes after time-frequency transformation, the energies / amplitudes after time-frequency transformation and whitening, the energies / amplitudes after energy / amplitude equalization, or the energies / amplitudes after stereo processing. Based on the proportion of the energy / amplitude of the audio signal of each channel pair in the sum of the energies / amplitudes, bit allocation for the channel pairs is performed to determine the number of bits of each of the K channel pairs, so as to reasonably allocate the number of bits of each channel pair in the multi-channel signal encoding to ensure the quality of the audio signal reconstructed at the decoding end. For example, for the case where the energy / amplitude difference between channel pairs is large, through the method of this embodiment of the present application, the problem of insufficient encoding bits for the channel pair with large energy / amplitude can be solved to ensure the quality of the audio signal reconstructed at the decoding end.

[0176] The following embodiments take a 5.1-channel signal as an example to illustrate the multi-channel audio signal encoding method of the embodiments of the present application schematically.

[0177] Figure 5 This is a schematic diagram of the processing procedure at the encoding end of the present application embodiment. As Figure 5 shown, the encoding end may include a multi-channel encoding processing unit 401, a channel encoding unit 402, and a bitstream multiplexing interface 403. The encoding end may be the encoder as described above.

[0178] The multi-channel encoding processing unit 401 is used to screen, pair, perform stereo processing on, and generate multi-channel side information for the input signal. In this embodiment, the input signal is a 5.1 (L channel, R channel, C channel, LFE channel, LS channel, RS channel) signal.

[0179] As an example, the multi-channel encoding processing unit 401 pairs the L channel signal and the R channel signal to form a first channel pair, and through stereo processing, obtains a center channel M1 channel signal and a side channel S1 channel signal. The LS channel signal and the RS channel signal are paired to form a second channel pair, and through stereo processing, obtains a center channel M2 channel signal and a side channel S2 channel signal.

[0180] Since there are significant differences in energy / amplitude between the center channels of the multi-channel, before performing stereo processing, energy / amplitude equalization is performed on the multi-channel to increase the benefit of stereo processing, that is, the energy / amplitude is concentrated on the center channels to facilitate the channel encoding unit to improve the encoding efficiency. In the embodiment of the present application, energy / amplitude equalization is performed on the paired channels to obtain energy / amplitude balance between the channels. Assume that the energy / amplitude of the current frame of each input channel before energy / amplitude equalization is energy_L, energy_R, energy_C, energy_LS, energy_RS respectively. energy_L is the energy / amplitude of the L channel signal before energy / amplitude equalization, energy_R is the energy / amplitude of the R channel signal before energy / amplitude equalization, energy_C is the energy / amplitude of the C channel signal before energy / amplitude equalization, energy_LS is the energy / amplitude of the LS channel signal before energy / amplitude equalization, and energy_RS is the energy / amplitude of the RS channel signal before energy / amplitude equalization.

[0181] The energy / amplitude of both the L channel and the R channel of the first channel pair after energy / amplitude equalization is energy_avg_LR, and the calculation method of energy_avg_LR can adopt the following formula (8).

[0182] energy_avg_LR = avg(energy_L, energy_R) (8)

[0183] After the energy / amplitude equalization of the LS channel and the RS channel of the second channel pair, the energy / amplitude of both is energy_avg_LSRS, and the calculation method of energy_avg_LSRS can adopt the following formula (9).

[0184] energy_avg_LSRS = avg(energy_LS, energy_RS) (9)

[0185] Among them, the avg(a1, a2) function realizes the average value of the two input parameters a1 and a2. a1 takes energy_L, a2 takes energy_R. a1 takes energy_LS, a2 takes energy_RS.

[0186] The calculation formulas of the energy / amplitude energy(ch) (including energy_L, energy_R, energy_C, energy_LS, energy_RS) of each channel before energy / amplitude equalization are as follows:

[0187]

[0188] Among them, sampleCoef(ch, i) represents the i-th coefficient of the current frame of the channel with the channel index ch, N represents the number of coefficients of the current frame, and different ch values can correspond to the above L channel, R channel, C channel, LFE channel, LS channel, and RS channel.

[0189] In the embodiment of the present application, energy_L is equal to E pre (L), energy_R is equal to E pre (R), energy_LS is equal to E pre (LS), energy_RS is equal to E pre (RS), energy_C is equal to E pre (C). E post (L) = E post (R) = energy_avg_LR. E post (LS) = E post (RS) = energy_avg_LSRS.

[0190] The multi-channel encoding processing unit 401 outputs the M1 channel signal, S1 channel signal, M2 channel signal, S2 channel signal that have undergone stereo processing, the LFE channel signal and C channel signal that have not undergone stereo processing, and multi-channel side information.

[0191] The channel encoding unit 402 is used to encode the M1 channel signal, S1 channel signal, M2 channel signal, S2 channel signal that have undergone stereo processing, the LFE channel signal and C channel signal that have not undergone stereo processing, as well as the multi-channel side information, and output the encoded channels E1 - E6. The channel encoding unit 402 may include a plurality of mono processing boxes, and the mono processing boxes allocate more bits to the channels with greater energy / amplitude than to the channels with smaller energy / amplitude. After the channel encoding unit 402 performs quantization and entropy encoding to remove the redundancy at the encoding end, it sends the encoded channels E1 - E6 to the bitstream multiplexing interface 403.

[0192] The bitstream multiplexing interface 403 multiplexes the six encoded channels E1 - E6 to form a serial bitstream (bitStream) to facilitate the transmission of the multi-channel audio signal in the channel or storage in the digital medium.

[0193] Figure 6 It is a schematic diagram of the processing process of the channel encoding unit of the embodiment of the present application, as Figure 6 shown, the above-mentioned channel encoding unit 402 may include a bit allocation unit 4021 and a quantization entropy encoding unit 4023. This embodiment is an illustrative example of the above method 1.

[0194] The bit allocation unit 4021 is used to perform the first bit allocation and the second bit allocation in the above embodiment to obtain the number of bits for each channel.

[0195] Exemplarily, the bit allocation unit 4021 determines the energy / amplitude and sum_E after stereo processing through the above formulas (1) and (2) post . Then, the bit coefficients of each channel pair and the bit coefficients of the unpaired mono channels are determined through the following formulas (11) to (14). In this embodiment, the bit coefficient of the first channel pair is represented by Ratio(L, R), the bit coefficient of the second channel pair is represented by Ratio(LS, RS), the bit coefficient of the unpaired C channel is represented by Ratio(C), and the bit coefficient of the unpaired LFE channel is represented by Ratio(LFE).

[0196] Ratio(L, R) = (E post (M1) + E post (S1)) / sum_E post (11)

[0197] Ratio(LS, RS) = (E post (M2) + E post (S2)) / sum_E post (12)

[0198] Ratio(C) = E post(C) / sum_E post (13)

[0199] Ratio(LFE) = E post (LFE) / sum_E post (14)

[0200] The bit allocation unit calculates the number of bits for each channel according to Ratio(L,R), Ratio(LS,RS), Ratio(C), Ratio(LFE), the available number of bits bAvail, the channel pair indices pairIdx1 and pairIdx2, and the energy / amplitude E post (ch) after stereo processing of each channel. The channel pair indices pairIdx1 and pairIdx2 can be output by the multi-channel encoding processing unit 401. The channel pair index pairIdx1 is used to indicate the pairing of the L channel and the R channel, and the channel pair index pairIdx2 is used to indicate the pairing of the LS channel and the RS channel.

[0201] Exemplarily, the number of bits for each channel can be determined by the following formulas (15) to (22).

[0202] Bit allocation for channel pairs:

[0203] Bits(M1,S1) = bAvail * Ratio(L,R) (15)

[0204] Bits(M2,S2) = bAvail * Ratio(LS,RS) (16)

[0205] where Bits(M1,S1) represents the number of bits for the first channel pair, and Bits(M2,S2) represents the number of bits for the second channel pair.

[0206] Bit allocation between channels within a channel pair and for channels not participating in pairing:

[0207] Among them, the bit allocation between channels of the paired channels is as follows:

[0208] Bits(M1) = Bits(M1,S1) * E post (M1) / (E post (M1)+E post (S1)) (17)

[0209] Bits(S1) = Bits(M1,S1) * E post (S1) / (E post (M1)+E post (S1)) (18)

[0210] Bits(M2) = Bits(M2,S2) * E post (M2) / (E post (M2) + E post (S2)) (19)

[0211] Bits(S2) = Bits(M2,S2) * E post (S2) / (E post (M2) + E post (S2)) (20)

[0212] Among them, Bits(M1) represents the number of bits of the M1 channel, Bits(S1) represents the number of bits of the S1 channel, Bits(M2) represents the number of bits of the M2 channel, and Bits(S2) represents the number of bits of the S2 channel.

[0213] The bit allocation for the channels not participating in pairing is as follows:

[0214] Bits(C) = bAvail * Ratio(C) (21)

[0215] Bits(LFE) = bAvail * Ratio(LFE) (22)

[0216] Among them, Bits(C) represents the number of bits of the C channel, and Bits(LFE) represents the number of bits of the LFE channel.

[0217] The quantization entropy encoding unit 4023 quantizes and entropy encodes the M1 channel signal, S1 channel signal, M2 channel signal, S2 channel signal, C channel signal, LFE channel signal, and multi-channel side information that have undergone stereo processing according to the number of bits of each channel to obtain the encoded channel E1 - E6 signals.

[0218] In this embodiment, taking the channel pair as the granularity, the energies / amplitudes of the two channels of the channel pair are equalized. Since the energy / amplitude ratios between channel pairs before stereo processing are different, the energy / amplitude ratios between channel pairs after stereo processing are also different. Then, according to the energy / amplitude ratios of each channel pair after stereo processing, bit allocation between channel pairs is performed, and finally, bit allocation within the channel pair is performed, which can achieve reasonable allocation of the number of bits of each channel in the multi-channel signal encoding to ensure the quality of the reconstructed audio signal at the decoding end. For example, for the case where the energy / amplitude difference between channel pairs is large, through the method of this embodiment of the present application, the problem of insufficient encoding bits for the channel signal with large energy / amplitude can be solved to ensure the quality of the reconstructed audio signal at the decoding end.

[0219] And Figure 5Specific implementation of energy / amplitude equalization of the multi-channel encoding processing unit 401 in the illustrated embodiment. Another way of energy / amplitude equalization is also provided in the embodiments of the present application. Taking the above 5.1-channel signal as an example, further illustration is given below.

[0220] After energy / amplitude equalization for each channel, the energy / amplitude is energy_avg for all channels. energy_avg can be determined by the following formula (23).

[0221] energy_avg = avg(energy_L, energy_R, energy_C, energy_LS, energy_RS) (23)

[0222] Among them, the Avg(a1, a2,..., an) function realizes the average value of the input n parameters a1, a2,..., an.

[0223] Figure 7 It is a schematic diagram of the processing process of the channel encoding unit in the embodiments of the present application. As Figure 7 shown, the above channel encoding unit 402 may include a bit allocation unit 4021, a quantization entropy encoding unit 4023, and a bit calculation unit 4022. This embodiment is an illustration of the above-mentioned second method.

[0224] The bit allocation unit 4021 is used to perform the first bit allocation and the second bit allocation in the above embodiments to obtain the number of bits for each channel.

[0225] Exemplarily, the bit calculation unit 4022 determines the energy / amplitude and sum_E before energy / amplitude equalization through the above formulas (3) and (4). pre . Then, the bit coefficients of each channel pair and the bit coefficients of the unpaired mono channels are determined through the following formulas (24) to (27). In this embodiment, the bit coefficient of the first channel pair is represented by Ratio(L, R), the bit coefficient of the second channel pair is represented by Ratio(LS, RS), the bit coefficient of the unpaired C channel is represented by Ratio(C), and the bit coefficient of the unpaired LFE channel is represented by Ratio(LFE).

[0226] Ratio(L, R) = (E pre (L) + E pre (R)) / sum_E pre (24)

[0227] Ratio(LS, RS) = (E pre (LS) + E pre (RS)) / sum_E pre (25)

[0228] Ratio(C) = E pre (C) / sum_E pre (26)

[0229] Ratio(LFE) = E pre (LFE) / sum_E pre (27)

[0230] The bit allocation unit 4021 calculates the number of bits for each channel according to Ratio(L, R), Ratio(LS, RS), Ratio(C), Ratio(LFE), the available number of bits bAvail, the channel pair indexes pairIdx1 and pairIdx2, and the energy / amplitude E post (ch) after stereo processing of each channel. The channel pair indexes pairIdx1 and pairIdx2 can be output by the multi-channel encoding processing unit 401. The channel pair index pairIdx1 is used to indicate the pairing of the L channel and the R channel, and the channel pair index pairIdx2 is used to indicate the pairing of the LS channel and the RS channel.

[0231] Exemplarily, based on the number of bits determined by the above formulas (24) to (27), the number of bits for each channel can be determined by the above formulas (15) to (22).

[0232] The quantization entropy encoding unit 4023 quantizes and entropy encodes the stereo-processed M1 channel signal, S1 channel signal, M2 channel signal, S2 channel signal, C channel signal, LFE channel signal, and multi-channel side information according to the number of bits for each channel to obtain the encoded channel E1 - E6 signals.

[0233] In this embodiment, after performing energy / amplitude equalization on all channels and then performing stereo processing, although the energy / amplitude ratios of each channel are similar after stereo processing, in the embodiments of the present application, after stereo processing, the bit allocation between channel pairs is performed according to the energy / amplitude ratios of each channel pair before stereo processing, and then the bit allocation within the channel pair is performed according to the energy / amplitude after stereo processing. Guiding the bit allocation between channel pairs according to the energy / amplitude ratios of the channel pairs before stereo processing, since the energy / amplitude ratios of the channel pairs before stereo processing are different, the bit allocation between each channel pair is performed accordingly, which can realize a reasonable allocation of the number of bits for each channel in the multi-channel signal encoding to ensure the quality of the reconstructed audio signal at the decoding end. For example, for the case where the energy / amplitude difference between channel pairs is large, through the method of the embodiments of the present application, the problem of insufficient encoding bits for the channel signal with large energy / amplitude can be solved to ensure the quality of the reconstructed audio signal at the decoding end.

[0234] In some embodiments, the above audio channel encoding unit 402 may include a bit allocation unit 4021, a quantization entropy encoding unit 4023, and a bit calculation unit 4022, and may also be used to implement the functions of each step of the above method three.

[0235] The bit allocation unit 4021 is configured to perform the primary bit allocation and the secondary bit allocation in the above embodiments to obtain the number of bits for each audio channel.

[0236] Exemplarily, the bit allocation unit 4021 determines the energy / amplitude and sum_E before energy / amplitude equalization through the above formulas (5) to (7). pre . Then, the bit coefficients of each audio channel pair and the bit coefficients of the unpaired mono channels are determined through the following formulas (28) to (31). In this embodiment, the bit coefficient of the first audio channel pair is represented by Ratio(L,R), the bit coefficient of the second audio channel pair is represented by Ratio(LS,RS), the bit coefficient of the unpaired C channel is represented by Ratio(C), and the bit coefficient of the unpaired LFE channel is represented by Ratio(LFE).

[0237] Ratio(L,R) = (α(L)*E pre (L) + α(R)*E pre (R)) / sum_E pre (28)

[0238] Ratio(LS,RS) = (α(LS)*E pre (LS) + α(RS)*E pre (RS)) / sum_E pre (29)

[0239] Ratio(C) = α(C)*E pre (C) / sum_E pre (30)

[0240] Ratio(LFE) = α(LFE)*E pre (LFE) / sum_E pre (31)

[0241] Wherein, α(L) represents the weighting coefficient of the L channel, α(R) represents the weighting coefficient of the R channel, α(LS) represents the weighting coefficient of the LS channel, α(RS) represents the weighting coefficient of the RS channel, α(C) represents the weighting coefficient of the C channel, and α(LFE) represents the weighting coefficient of the LFE channel.

[0242] Exemplarily, based on the number of bits determined by the above formulas (28) to (31), the number of bits for each audio channel can be determined through the above formulas (15) to (22).

[0243] The quantization entropy encoding unit performs quantization and entropy encoding on the M1 channel signal, S1 channel signal, M2 channel signal, S2 channel signal, C channel signal, LFE channel signal, and multichannel side information that have undergone stereo processing according to the number of bits of each channel to obtain the encoded channel E1-E6 signals.

[0244] In this embodiment, by adjusting the bit allocation through the weighting coefficient, it is possible to reasonably allocate the number of bits of each channel in the multichannel signal encoding to ensure the quality of the reconstructed audio signal at the decoding end.

[0245] Figure 8 It is a flowchart of another multichannel audio signal encoding method according to an embodiment of the present application. The execution subject of the embodiment of the present application may be the above-mentioned encoder, such as Figure 8 As shown, the method of this embodiment may include:

[0246] Step 501, obtain the audio signals of P channels of the current frame of the multichannel audio signal, where P is a positive integer greater than 1, and the audio signals of the P channels include the audio signals of K channel pairs.

[0247] Among them, the audio signal of a channel pair includes the audio signals of two channels.

[0248] A channel pair in an embodiment of the present application may be any one of the K channel pairs. The audio signals of the two coupled channels are the audio signals of a channel pair.

[0249] In some embodiments, P = 2K. After the screening, pairing, stereo processing, and multichannel side information generation of the multichannel signal, the audio signals of P channels can be obtained, that is, the audio signals of K channel pairs.

[0250] In some embodiments, the audio signals of the P channels further include the audio signals of Q unpaired mono channels, P = 2*K + Q, K is a positive integer, and Q is a positive integer.

[0251] Among them, for the specific explanation of step 501, reference can be made to Figure 2 Step 101 of the embodiment shown, which will not be elaborated here.

[0252] Step 502, according to the energy / amplitude of the audio signals of the two channels of the current channel pair among the K channel pairs, perform energy / amplitude equalization on the audio signals of the two channels of the current channel pair to obtain the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization.

[0253] In the embodiments of the present application, energy / amplitude equalization is performed on each channel pair, that is, each channel pair performs energy / amplitude equalization within the channel pair itself. Taking the current channel pair among K channel pairs as an example, according to the energy / amplitude of the audio signals of the two channels of the current channel pair among the K channel pairs respectively, energy / amplitude equalization is performed on the audio signals of the two channels of the current channel pair, and the energy / amplitude after energy / amplitude equalization of the two channels of the current channel pair is obtained.

[0254] Whether P = 2K or P = 2*K + Q, the above-mentioned method of step 502 can be used to perform energy / amplitude equalization within the channel pair to obtain the energy / amplitude after energy / amplitude equalization of each of the two channels within the current channel pair.

[0255] Exemplarily, the energy / amplitude after energy / amplitude equalization of the two channels of the current channel pair can be determined using the above formula (8). That is, L and R in formula (8) are replaced with the two channels of the current channel pair.

[0256] Step 503: According to the energy / amplitude after energy / amplitude equalization of the audio signals of the two channels of the current channel pair respectively, and the available number of bits, determine the number of bits of each of the two channels of the current channel pair.

[0257] Taking the current channel pair among K channel pairs as an example, according to the energy / amplitude after energy / amplitude equalization of each of the two channels of the current channel pair, and the available number of bits, determine the number of bits of each of the two channels of the current channel pair. The current channel pair can be any one of the K channel pairs.

[0258] For P = 2*K, the method of the embodiments of the present application can determine the sum of energy / amplitude of the current frame according to the energy / amplitude after energy / amplitude equalization of the audio signals of the two channels of each of the K channel pairs. According to the sum of energy / amplitude of the current frame, the energy / amplitude after energy / amplitude equalization of the audio signals of the two channels of the current channel pair respectively, and the available number of bits, determine the number of bits of each of the two channels of the current channel pair.

[0259] For example, according to the proportion of the energy / amplitude after energy / amplitude equalization of the audio signals of the two channels of the current channel pair in the sum of energy / amplitude, and the available number of bits, determine the number of bits of each of the two channels of the current channel pair.

[0260] For P = 2*K + Q, the method according to the embodiments of the present application can determine the energy / sum of amplitudes of the current frame according to the energy / sum of amplitudes after energy / amplitude equalization of the audio signals of two channels of each of the K channels, and the energy / sum of amplitudes after energy / amplitude equalization of the audio signals of the Q mono channels. According to the sum of the energy / amplitude, the energy / amplitude of each of the two channels of the current channel pair, and the available number of bits, determine the number of bits of each of the two channels of the current channel pair. According to the sum of the energy / amplitude, the energy / amplitude after energy / amplitude equalization of each of the Q mono channels, and the available number of bits, determine the number of bits of each of the Q mono channels.

[0261] For example, according to the proportion of the energy / amplitude of the audio signals of the two channels of the current channel pair in the sum of the energy / amplitude, and the available number of bits, determine the number of bits of each of the two channels of the current channel pair. According to the proportion of the energy / amplitude after energy / amplitude equalization of each of the Q mono channels in the sum of the energy / amplitude, and the available number of bits, determine the number of bits of each of the Q mono channels.

[0262] Among them, the energy / amplitude after energy / amplitude equalization of each of the Q mono channels can be equal to the energy / amplitude before energy / amplitude equalization, and approximately equal to the energy / amplitude after stereo processing. The energy / amplitude after energy / amplitude equalization of the audio signals of two channels of each of the K channel pairs can be approximately equal to the energy / amplitude after stereo processing of the audio signals of the two channels.

[0263] Exemplarily, the sum of the energy / amplitude can be determined by using the above formula (1), that is, replacing the energy / amplitude after stereo processing in formula (1) with the energy / amplitude after energy / amplitude equalization of each channel in this embodiment.

[0264] Step 504: Encode the audio signals of the two channels of the current channel pair according to the number of bits of each of the two channels, and obtain an encoded bitstream.

[0265] Encoding the audio signals of the two channels in the current channel pair respectively may include quantizing, entropy encoding, and bitstream multiplexing the audio signals of the two channels in the current channel pair respectively to obtain an encoded bitstream.

[0266] For P = 2K, according to the number of bits of each of the K channel pairs, quantize, entropy encode, and bitstream multiplex the audio signals of the P channels respectively to obtain an encoded bitstream.

[0267] For P = 2*K + Q, quantize, entropy code, and multiplex the bitstreams of the audio signals of K channel pairs according to the respective number of bits of each of the K channels, and quantize, entropy code, and multiplex the bitstreams of the audio signals of the Q mono channels according to the respective number of bits of each of the Q mono channels to obtain an encoded bitstream.

[0268] In this embodiment, the audio signals of P channels in the current frame of the multi-channel audio signal are obtained. The audio signals of the P channels include the audio signals of K channel pairs. According to the energy / amplitude of the audio signals of the two channels in the current channel pair among the K channel pairs, equalize the energy / amplitude of the audio signals of the two channels in the current channel pair to obtain the energy / amplitude after equalizing the energy / amplitude of the two channels in the current channel pair. According to the energy / amplitude after equalizing the energy / amplitude of the two channels in the current channel pair and the available number of bits, determine the respective number of bits of the two channels in the current channel pair. Encode the audio signals of the two channels according to the respective number of bits of the two channels in the current channel pair to obtain an encoded bitstream. Through the energy / amplitude equalization within the channel pair and based on the energy / amplitude after equalization, perform bit allocation, so as to reasonably allocate the number of bits of each channel in the multi-channel signal encoding to ensure the quality of the audio signal reconstructed at the decoding end. For example, for the case where the energy / amplitude difference between channel pairs is large, through the method of this embodiment of the present application, the problem of insufficient encoding bits for the channel signal with large energy / amplitude can be solved to ensure the quality of the audio signal reconstructed at the decoding end.

[0269] Take Figure 5 and Figure 6 The embodiments shown are used as examples to explain. Figure 8 The embodiments shown are used as examples to explain.

[0270] Figure 5 The multi-channel encoding processing unit 401 in the embodiments shown can execute Figure 8 Steps 501 and 502 in the embodiments shown, and the channel encoding unit 402 can execute Figure 8 Step 503 in the embodiments shown. When the channel encoding unit 402 can execute Figure 8 Step 503 in the embodiments shown, the difference from Figure 5 and Figure 6 The embodiments shown is that the bit allocation unit 4021 can determine the number of bits of each channel in the following manner.

[0271] The bit allocation unit 4021 in the embodiments of the present application can perform bit allocation according to the energy / amplitude after equalizing the energy / amplitude of each of the P channels. Specifically, it can be determined by the following formulas (31) to (36).

[0272] Bits(M1) = bAvail * E post(M1) / sum_E post (31)

[0273] Bits(S1) = bAvail * E post (S1) / sum_E post (32)

[0274] Bits(M2) = bAvail * E post (M2) / sum_E post (33)

[0275] Bits(S2) = bAvail * E post (S2) / sum_E post (34)

[0276] Bits(C) = bAvail * E post (C) / sum_E post (35)

[0277] Bits(LFE) = bAvail * E post (LFE) / sum_E post (36)

[0278] When performing bit allocation using formulas (31) to (36), the multi-channel encoding processing unit 401 needs to adopt the energy / amplitude equalization method of the channel pair, that is, the energy / amplitude equalization within the channel pair. Among them, sum_E post can be determined using the above formula (1).

[0279] Before the energy / amplitude equalization of the energy / amplitude sum E(L, R) of the L channel and the R channel, after the energy / amplitude equalization, the energy / amplitude sum of the L channel and the R channel does not change and remains E(L, R). After the L channel and the R channel are processed by stereo processing, the energy / amplitude sum after the stereo processing of the L channel and the R channel becomes E post (M1, S1). Because stereo processing will slightly reduce the redundancy between the L channel and the R channel and satisfy E post (M1, S1) ≈ E(L, R). That is to say, when the energy / amplitude sum E(L, R) of the L channel and the R channel >> (much greater than) the energy / amplitude sum E(LS, RS) of the LS channel and the RS channel, through the processing of the multi-channel encoding processing unit 401 of the embodiment of the present application and the bit allocation unit 4021 of this embodiment, the bits Bits(M1) + Bits(S1) allocated to E(L, R) can be made much greater than Bits(M2) + Bits(S2), thus achieving the purpose of allocating bits according to energy / amplitude between channel pairs.

[0280] Bits(M1) + Bits(S1) = bAvail * E post (M1) / sum_E post+ bAvail * E post (S1) / sum_E post

[0281] = bAvail * E post (M1, S1) / sum_E post

[0282] >> bAvail * E post (M2, S2) / sum_E post

[0283] = Bits(M2) + Bits(S2)

[0284] In this embodiment, through the energy / amplitude equalization within the sound channels, bit allocation is performed based on the energy / amplitude after the energy / amplitude equalization, so as to reasonably allocate the number of bits for each sound channel in the multi-channel signal coding, and ensure the quality of the audio signal reconstructed at the decoding end. For example, for the case where the energy / amplitude difference between sound channel pairs is large, through the method of this embodiment of the present application, the problem of insufficient coding bits for the sound channel signal with large energy / amplitude can be solved to ensure the quality of the audio signal reconstructed at the decoding end.

[0285] Based on the same inventive concept as the above method, an embodiment of the present application further provides an audio signal coding device, and this audio signal coding device can be applied to an audio encoder.

[0286] Figure 9 It is a schematic structural diagram of an audio signal coding device according to an embodiment of the present application, as Figure 9 shown, the audio signal coding device 700 includes: an acquisition module 701, a bit allocation module 702, and an encoding module 703.

[0287] The acquisition module 701 is configured to acquire the audio signals of P sound channels of the current frame of the multi-channel audio signal and the energy / amplitude of the audio signals of the P sound channels respectively, where P is a positive integer greater than 1, and the audio signals of the P sound channels include the audio signals of K sound channel pairs, and K is a positive integer.

[0288] The bit allocation module 702 is configured to determine the number of bits for each of the K sound channel pairs according to the energy / amplitude of the audio signals of the P sound channels respectively and the available number of bits.

[0289] The encoding module 703 is configured to encode the audio signals of the P sound channels according to the number of bits for each of the K sound channel pairs to obtain an encoded bit stream.

[0290] Among them, the energy / amplitude of the audio signal of one of the P channels includes at least one of the energy / amplitude of the audio signal of this one channel in the time domain, the energy / amplitude of the audio signal of this one channel after time-frequency transformation, the energy / amplitude of the audio signal of this one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of this one channel after energy / amplitude equalization, or the energy / amplitude of the audio signal of this one channel after stereo processing.

[0291] In some embodiments, the encoding module 703 is configured to determine the number of bits of each of the two channels in the current channel pair according to the number of bits of the current channel pair among the K channel pairs and the energy / amplitude of the audio signals of the two channels in the current channel pair after stereo processing respectively; and encode the audio signals of the two channels according to the number of bits of each of the two channels in the current channel pair respectively.

[0292] In some embodiments, the bit allocation module 702 is configured to: determine the sum of energy / amplitude of the current frame according to the energy / amplitude of the audio signals of the P channels respectively; determine the bit coefficients of the K channel pairs respectively according to the energy / amplitude of the audio signals of the K channel pairs and the sum of energy / amplitude of the current frame; and determine the number of bits of the K channel pairs respectively according to the bit coefficients of the K channel pairs respectively and the available number of bits.

[0293] In some embodiments, the bit allocation module 702 is configured to: determine the sum of energy / amplitude of the current frame according to the energy / amplitude of the audio signals of the P channels after stereo processing respectively.

[0294] In some embodiments, the bit allocation module 702 is configured to:

[0295] According to the formula Calculate the sum of energy / amplitude of the current frame sum_E post ;

[0296] Among them,

[0297] Among them, ch represents the channel index, and E post (ch) represents the energy / amplitude of the audio signal of the channel with the channel index ch after stereo processing, sampleCoef post (ch,i) represents the i-th coefficient of the current frame of the ch channel after stereo processing, and N represents the number of systems of the current frame, and N takes a positive integer greater than 1.

[0298] In some embodiments, the bit allocation module 702 is configured to: determine the sum of energy / amplitude of the current frame according to the energy / amplitude of the audio signals of the P channels before energy / amplitude equalization respectively.

[0299] In some embodiments, the bit allocation module 702 is configured to: according to the formula calculate the energy / magnitude sum sum_E of the current frame pre , where ch represents the channel index, and E pre (ch) represents the energy / magnitude of the audio signal of the channel with the channel index ch before energy / magnitude equalization.

[0300] In some embodiments, the bit allocation module 702 is configured to: determine the energy / magnitude sum of the current frame according to the energy / magnitude before energy / magnitude equalization of the audio signals of the P channels and the respective weighting coefficients of the P channels, and the weighting coefficients are less than or equal to 1.

[0301] In some embodiments, the bit allocation module 702 is configured to:

[0302] calculate the energy / magnitude sum sum_E of the current frame according to the formula ; pre

[0303] where α(ch) is the weighting coefficient of the ch channel, the weighting coefficients of the two channels of a channel pair are the same, and the magnitude of the weighting coefficients of the two channels of a channel pair is inversely proportional to the normalized correlation value between the two channels.

[0304] In some embodiments, the audio signals of the P channels further include Q unpaired mono audio signals, P = 2*K + Q, K is a positive integer, and Q is a positive integer. The bit allocation module 702 is configured to: determine the respective bit numbers of the K channel pairs and the respective bit numbers of the Q mono channels according to the energy / magnitude of the audio signals of the P channels and the available number of bits. The encoding module 703 is configured to encode the audio signals of the K channel pairs according to the respective bit numbers of the K channel pairs, and encode the audio signals of the Q mono channels according to the respective bit numbers of the Q mono channels.

[0305] In some embodiments, the bit allocation module 702 is configured to: determine the energy / magnitude sum of the current frame according to the energy / magnitude of the audio signals of the P channels. Determine the respective bit coefficients of the K channel pairs according to the energy / magnitude of the audio signals of the K channel pairs and the energy / magnitude sum of the current frame. Determine the respective bit coefficients of the Q mono channels according to the energy / magnitude of the audio signals of the Q mono channels and the energy / magnitude sum of the current frame. Determine the respective bit numbers of the K channel pairs according to the respective bit coefficients of the K channel pairs and the available number of bits. Determine the respective bit numbers of the Q mono channels according to the respective bit coefficients of the Q mono channels and the available number of bits.

[0306] ​In some embodiments, the apparatus may further include: an energy / amplitude equalization module 704. The energy / amplitude equalization module 704 is configured to obtain the audio signals of the P channels after energy / amplitude equalization according to the audio signals of the P channels. The energy / amplitude after the audio signal of a foregoing channel is subjected to energy / amplitude equalization is obtained from the audio signal of the foregoing channel after energy / amplitude equalization.

[0307] The encoding module 703 is configured to encode the audio signals of the P channels after energy / amplitude equalization according to the respective numbers of bits of the K channels.

[0308] It should be noted that the foregoing acquisition module 701, bit allocation module 702, and encoding module 703 may be applied to the audio signal encoding process at the encoding end.

[0309] It should also be noted that the specific implementation processes of the acquisition module 701, bit allocation module 702, and encoding module 703 may refer to the detailed descriptions of the foregoing method embodiments. For the sake of brevity of the specification, they will not be elaborated here.

[0310] The embodiment of the present application further provides another audio signal encoding apparatus. The structure diagram of the audio signal encoding apparatus may be as shown in Figure 9 The audio signal encoding apparatus in this embodiment is configured to execute the method in the embodiment shown in Figure 8 The embodiment shown.

[0311] In some embodiments, different from the functions of the respective modules in the embodiment shown in Figure 9 In this embodiment, the acquisition module 701 is configured to acquire the audio signals of the P channels of the current frame of the multi-channel audio signal, where P is a positive integer greater than 1, and the audio signals of the P channels include the audio signals of K channel pairs, and K is a positive integer.

[0312] The energy / amplitude equalization module 704 is configured to perform energy / amplitude equalization on the audio signals of the two channels of the current channel pair according to the respective energies / amplitudes of the audio signals of the two channels of the current channel pair among the K channel pairs, so as to obtain the energies / amplitudes of the audio signals of the two channels of the current channel pair after energy / amplitude equalization.

[0313] The bit allocation module 702 is configured to determine the respective numbers of bits of the two channels of the current channel pair according to the energies / amplitudes of the audio signals of the two channels of the current channel pair after energy / amplitude equalization and the available number of bits.

[0314] The encoding module 703 is configured to encode the audio signals of the two channels respectively according to the respective numbers of bits of the two channels of the current channel pair to obtain an encoded bit stream.

[0315] In some embodiments, the bit allocation module 702 is configured to determine the sum of energies / amplitudes of the current frame according to the energies / amplitudes of the audio signals of the P channels after energy / amplitude equalization. According to the sum of energies / amplitudes of the current frame, the energies / amplitudes of the audio signals of the two channels of the current channel pair after energy / amplitude equalization, and the available number of bits, determine the number of bits of the two channels of the current channel pair respectively.

[0316] In some embodiments, the audio signals of the P channels further include Q unpaired mono audio signals, where P = 2*K + Q, K is a positive integer, and Q is a positive integer.

[0317] The bit allocation module 702 is configured to determine the sum of energies / amplitudes of the current frame according to the energies / amplitudes of the audio signals of the two channels of the K channel pairs respectively after energy / amplitude equalization, and the energies / amplitudes of the Q mono audio signals after energy / amplitude equalization. According to the sum of energies / amplitudes of the current frame, the energies / amplitudes of the audio signals of the two channels of the current channel pair, and the available number of bits, determine the number of bits of the two channels of the current channel pair respectively. According to the sum of energies / amplitudes of the current frame, the energies / amplitudes of the Q mono audio signals after energy / amplitude equalization, and the available number of bits, determine the number of bits of the Q mono audio signals respectively.

[0318] The encoding module 703 is configured to encode the audio signals of the K channel pairs according to the number of bits of the K channel pairs respectively, and encode the audio signals of the Q mono audio signals according to the number of bits of the Q mono audio signals respectively, so as to obtain an encoded bit stream.

[0319] It should be noted that the above-mentioned acquisition module 701, bit allocation module 702, energy / amplitude equalization module 704, and encoding module 703 can be applied to the audio signal encoding process at the encoding end.

[0320] It should also be noted that the specific implementation processes of the above-mentioned acquisition module 701, bit allocation module 702, energy / amplitude equalization module 704, and encoding module 703 can refer to the detailed description of the above-mentioned Figure 8 method embodiment shown. For the sake of brevity of the specification, it will not be elaborated here.

[0321] Based on the same inventive concept as the above method, an embodiment of the present application provides an audio signal encoder, which is used to encode audio signals and includes: an encoder as described in one or more of the above embodiments, where the audio signal encoding device is used to encode and generate a corresponding bit stream.

[0322] Based on the same inventive concept as the above method, an embodiment of the present application provides a device for encoding audio signals. For example, for an audio signal encoding device, please refer toFigure 10 As shown, the audio signal encoding device 800 includes:

[0323] a processor 801, a memory 802, and a communication interface 803 (where the number of processors 801 in the audio signal encoding device 800 can be one or more, Figure 10 and one processor is taken as an example here). In some embodiments of the present application, the processor 801, the memory 802, and the communication interface 803 can be connected through a bus or other means, where Figure 10 taking the connection through a bus as an example here.

[0324] The memory 802 can include a read-only memory and a random access memory, and provide instructions and data to the processor 801. A part of the memory 802 can also include a non-volatile random access memory (NVRAM). The memory 802 stores an operating system and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, where the operation instructions can include various operation instructions for implementing various operations. The operating system can include various system programs for implementing various basic services and processing hardware-based tasks.

[0325] The processor 801 controls the operation of the audio encoding device. The processor 801 can also be referred to as a central processing unit (CPU). In a specific application, the various components of the audio encoding device are coupled together through a bus system, where the bus system can include a power bus, a control bus, a status signal bus, etc. in addition to a data bus. However, for the sake of clear illustration, all various buses are referred to as a bus system in the figure.

[0326] The method disclosed in the embodiments of the present application can be applied to or implemented by the processor 801. The processor 801 can be an integrated circuit chip with signal processing capabilities. During implementation, the steps of the above method can be completed by the integrated logic circuit in hardware or instructions in software form in the processor 801. The above-mentioned processor 801 can be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor or completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, register, etc. This storage medium is located in the memory 802, and the processor 801 reads the information in the memory 802 and combines its hardware to complete the steps of the above method.

[0327] The communication interface 803 can be used to receive or send digital or character information, for example, it can be an input / output interface, a pin, or a circuit, etc. For example, the above-mentioned encoded bitstream is sent through the communication interface 803.

[0328] Based on the same inventive concept as the above method, an embodiment of the present application provides an audio encoding device, including: a non-volatile memory and a processor coupled to each other, and the processor calls the program code stored in the memory to execute some or all of the steps of the multi-channel audio signal encoding method described in the above one or more embodiments.

[0329] Based on the same inventive concept as the above method, an embodiment of the present application provides a computer-readable storage medium, and the computer-readable storage medium stores program code, wherein the program code includes instructions for executing some or all of the steps of the multi-channel audio signal encoding method described in the above one or more embodiments.

[0330] Based on the same inventive concept as the above method, an embodiment of the present application provides a computer program product. When the computer program product runs on a computer, it causes the computer to execute some or all of the steps of the multi-channel audio signal encoding method described in one or more of the above embodiments.

[0331] The processor mentioned in each of the above embodiments may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the integrated logic circuit in the hardware of the processor or instructions in software form. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed and completed by a hardware encoding processor, or by a combination of hardware and software modules in the encoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.

[0332] The memories mentioned in the above embodiments may be volatile memories or non-volatile memories, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memories of the systems and methods described herein are intended to include, but are not limited to, these and any other suitable types of memories.

[0333] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0334] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0335] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0336] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0337] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0338] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0339] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for encoding a multi-channel audio signal, characterized in that, comprising: obtaining audio signals of P channels of the current frame of the multi-channel audio signal, where P is a positive integer greater than 1, and the audio signals of the P channels include audio signals of K channel pairs, and K is a positive integer; obtaining the energy / amplitude of each of the audio signals of the P channels; determining the number of bits of each of the K channel pairs according to the energy / amplitude of each of the audio signals of the P channels and the available number of bits; encoding the audio signals of the P channels according to the number of bits of each of the K channel pairs to obtain an encoded bit stream; wherein, the energy / amplitude of the audio signal of one of the P channels includes at least one of the energy / amplitude of the audio signal of the one channel in the time domain, the energy / amplitude of the audio signal of the one channel after time-frequency transformation, the energy / amplitude of the audio signal of the one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of the one channel after energy / amplitude equalization, or the energy / amplitude of the audio signal of the one channel after stereo processing; The energy / amplitude after energy / amplitude equalization and the energy / amplitude after stereo processing of each of the audio signals of the K channel pairs are obtained by performing energy / amplitude equalization on the audio signals of the two channels within a single channel pair.

2. The method according to claim 1, characterized in that, the K channel pairs include a current channel pair, and encoding the audio signals of the P channels according to the number of bits of each of the K channel pairs includes: encoding the audio signals of the current channel pair according to the number of bits of the current channel pair; encoding the audio signals of the current channel pair according to the number of bits of the current channel pair includes: determining the number of bits of each of the two channels in the current channel pair according to the number of bits of the current channel pair and the energy / amplitude after stereo processing of each of the audio signals of the two channels in the current channel pair; encoding the audio signals of the two channels respectively according to the number of bits of each of the two channels in the current channel pair.

3. The method according to claim 1 or 2, characterized in that, determining the number of bits of each of the K channel pairs according to the energy / amplitude of each of the audio signals of the P channels and the available number of bits includes: determining the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the audio signals of the P channels; determining the bit coefficient of each of the K channel pairs according to the energy / amplitude of each of the audio signals of the K channel pairs and the sum of the energy / amplitude of the current frame; determining the number of bits of each of the K channel pairs according to the bit coefficient of each of the K channel pairs and the available number of bits.

4. The method according to claim 3, characterized in that, determining the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the audio signals of the P channels includes: determining the sum of the energy / amplitude of the current frame according to the energy / amplitude after stereo processing of each of the audio signals of the P channels.

5. The method according to claim 4, wherein, determining the energy / magnitude sum of the current frame according to the energy / magnitude of each of the audio signals of the P channels after stereo processing includes: According to the formula calculate the energy / amplitude sum_E of the current frame post ; Among them, where ch represents the channel index, and E post (ch) represents the energy / amplitude of the audio signal of the channel with channel index ch after stereo processing, and sampleCoef post (ch, i) represents the i-th coefficient of the current frame of the ch-th channel after stereo processing, N represents the number of coefficients of the current frame, and N is a positive integer greater than 1.

6. The method according to claim 3, wherein, determining the energy / magnitude sum of the current frame according to the energy / magnitude of each of the audio signals of the P channels includes: determining the energy / magnitude sum of the current frame according to the energy / magnitude of each of the audio signals of the P channels before energy / magnitude equalization, where the energy / magnitude of the audio signal of one of the P channels before energy / magnitude equalization includes the energy / magnitude of the audio signal of the one channel in the time domain, or the energy / magnitude of the audio signal of the one channel after time-frequency transformation, or the energy / magnitude of the audio signal of the one channel after time-frequency transformation and whitening.

7. The method according to claim 6, wherein, determining the energy / magnitude sum of the current frame according to the energy / magnitude of each of the audio signals of the P channels before energy / magnitude equalization includes: According to the formula calculate the energy / amplitude sum_E of the current frame pre , where ch represents the channel index, and E pre (ch) represents the energy / amplitude of the audio signal of the channel with channel index ch before energy / amplitude equalization.

8. The method according to claim 3, wherein, determining the energy / magnitude sum of the current frame according to the energy / magnitude of each of the audio signals of the P channels includes: determining the energy / magnitude sum of the current frame according to the energy / magnitude of each of the audio signals of the P channels before energy / magnitude equalization and the respective weighting coefficients of the P channels, where the weighting coefficients are less than or equal to 1.

9. The method according to claim 8, wherein, determining the energy / magnitude sum of the current frame according to the energy / magnitude of each of the audio signals of the P channels before energy / magnitude equalization and the respective weighting coefficients of the P channels includes: According to the formula calculate the energy / amplitude sum_E of the current frame pre ; where ch represents the channel index, E pre (ch) is the energy / amplitude of the audio signal of the ch-th channel before energy / amplitude equalization, α(ch) is the weighting coefficient of the ch-th channel, the weighting coefficients of the two channels of a channel pair are the same, and the magnitude of the weighting coefficients of the two channels of the one channel pair is inversely proportional to the normalized correlation value between the two channels of the one channel pair.

10. The method according to any one of claims 1, 2, 4 to 9, wherein, the audio signals of the P channels further include Q unpaired mono audio signals, P = 2*K + Q, and Q is a positive integer; determining the respective bit numbers of the K channel pairs according to the energy / magnitude of each of the audio signals of the P channels and the available number of bits includes: determining the respective bit numbers of the K channel pairs and the respective bit numbers of the Q mono channels according to the energy / magnitude of each of the audio signals of the P channels and the available number of bits; encoding the audio signals of the P channels according to the respective bit numbers of the K channel pairs includes: encoding the audio signals of the K channel pairs according to the respective bit numbers of the K channel pairs, and encoding the audio signals of the Q mono channels according to the respective bit numbers of the Q mono channels.

11. The method according to claim 10, wherein, determining the respective bit numbers of the K channel pairs and the respective bit numbers of the Q mono channels according to the energy / magnitude of each of the audio signals of the P channels and the available number of bits includes: Determine the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the audio signals of the P channels; Determine the bit coefficients of each of the K channel pairs according to the energy / amplitude of each of the audio signals of the K channel pairs and the sum of the energy / amplitude of the current frame; Determine the bit coefficients of each of the Q mono audio signals according to the energy / amplitude of each of the audio signals of the Q mono audio signals and the sum of the energy / amplitude of the current frame; Determine the number of bits of each of the K channel pairs according to the bit coefficients of each of the K channel pairs and the available number of bits; Determine the number of bits of each of the Q mono audio signals according to the bit coefficients of each of the Q mono audio signals and the available number of bits.

12. The method according to any one of claims 1, 2, 4 to 9, 11, wherein, The encoding of the audio signals of the P channels according to the number of bits of each of the K channel pairs includes: Encoding the audio signals of the P channels after energy / amplitude equalization according to the number of bits of each of the K channel pairs.

13. A multi-channel audio signal encoding device, wherein, The device includes: An acquisition module, configured to acquire the audio signals of P channels of the current frame of the multi-channel audio signal and the energy / amplitude of each of the audio signals of the P channels, P is a positive integer greater than 1, and the audio signals of the P channels include the audio signals of K channel pairs, and K is a positive integer; A bit allocation module, configured to determine the number of bits of each of the K channel pairs according to the energy / amplitude of each of the audio signals of the P channels and the available number of bits; An encoding module, configured to encode the audio signals of the P channels according to the number of bits of each of the K channel pairs to obtain an encoded bit stream; wherein, the energy / amplitude of the audio signal of one of the P channels includes at least one of the energy / amplitude of the audio signal of the one channel in the time domain, the energy / amplitude of the audio signal of the one channel after time-frequency transformation, the energy / amplitude of the audio signal of the one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of the one channel after energy / amplitude equalization, or the energy / amplitude of the audio signal of the one channel after stereo processing; The energy / amplitude after energy / amplitude equalization and the energy / amplitude after stereo processing of each of the audio signals of the K channel pairs are both obtained by performing energy / amplitude equalization on the audio signals of the two channels within a single channel pair.

14. The device according to claim 13, wherein, The K channel pairs include a current channel pair, and the encoding module is configured to: determine the number of bits of each of the two channels in the current channel pair according to the number of bits of the current channel pair and the energy / amplitude after stereo processing of each of the audio signals of the two channels in the current channel pair; Encode the audio signals of the two channels respectively according to the number of bits of each of the two channels in the current channel pair.

15. The device according to claim 14, wherein, The bit allocation module is configured to: Determine the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the audio signals of the P channels. Determine the bit coefficients of each of the K channel pairs according to the energy / amplitude of each of the audio signals of the K channel pairs and the sum of the energy / amplitude of the current frame. Determine the number of bits of each of the K channel pairs according to the bit coefficients of each of the K channel pairs and the available number of bits.

16. The apparatus according to claim 15, wherein, the bit allocation module is configured to: determine the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the audio signals of the P channels after stereo processing.

17. The apparatus according to claim 16, wherein, the bit allocation module is configured to: According to the formula calculate the energy / amplitude and sum_E of the current frame post ; Among them, where ch represents the channel index, and E post (ch) represents the energy / amplitude of the audio signal of the channel with channel index ch after stereo processing, and sampleCoef post (ch, i) represents the i-th coefficient of the current frame of the ch-th channel after stereo processing, N represents the number of coefficients in the current frame, and N is a positive integer greater than 1.

18. The apparatus according to claim 15, wherein, the bit allocation module is configured to: determine the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization, and the energy / amplitude of the audio signal of one of the P channels before energy / amplitude equalization includes the energy / amplitude of the audio signal of the one channel in the time domain, or the energy / amplitude of the audio signal of the one channel after time-frequency transformation, or the energy / amplitude of the audio signal of the one channel after time-frequency transformation and whitening.

19. The apparatus according to claim 18, wherein, the bit allocation module is configured to: According to the formula calculate the energy / amplitude sum_E of the current frame pre , where ch represents the channel index, and E pre (ch) represents the energy / amplitude of the audio signal of the channel with channel index ch before energy / amplitude equalization.

20. The apparatus according to claim 15, wherein, the bit allocation module is configured to: determine the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization and the weighting coefficients of each of the P channels, and the weighting coefficients are less than or equal to 1.

21. The apparatus according to claim 20, wherein, the bit allocation module is configured to: According to the formula calculate the energy / amplitude sum_E of the current frame pre ; where ch represents the channel index, E pre (ch) is the energy / amplitude of the audio signal of the ch-th channel before energy / amplitude equalization, α(ch) is the weighting coefficient of the ch-th channel, the weighting coefficients of the two channels of a channel pair are the same, and the magnitude of the weighting coefficients of the two channels of the one channel pair is inversely proportional to the normalized correlation value between the two channels of the one channel pair.

22. The apparatus according to any one of claims 13 to 21, wherein, the audio signals of the P channels further include Q unpaired mono audio signals, P = 2*K + Q, and Q is a positive integer; the bit allocation module is configured to: determine the number of bits of each of the K channel pairs and the number of bits of each of the Q mono channels according to the energy / amplitude of each of the audio signals of the P channels and the available number of bits; the encoding module is configured to encode the audio signals of the K channel pairs according to the number of bits of each of the K channel pairs respectively, and encode the audio signals of the Q mono channels according to the number of bits of each of the Q mono channels respectively.

23. The apparatus according to claim 22, wherein, The bit allocation module is configured to: determine the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the audio signals of the P channels; determine the bit coefficients of each of the K channel pairs according to the energy / amplitude of each of the audio signals of the K channel pairs and the sum of the energy / amplitude of the current frame; determine the bit coefficients of each of the Q mono audio signals according to the energy / amplitude of each of the Q mono audio signals and the sum of the energy / amplitude of the current frame; determine the number of bits of each of the K channel pairs according to the bit coefficients of each of the K channel pairs and the available number of bits; determine the number of bits of each of the Q mono audio signals according to the bit coefficients of each of the Q mono audio signals and the available number of bits.

24. The apparatus according to any one of claims 13 to 21, 23, wherein, the encoding module is configured to encode the audio signals of the P channels after energy / amplitude equalization according to the number of bits of each of the K channel pairs.

25. A multi-channel audio signal encoding method, wherein, it includes: obtaining audio signals of P channels of the current frame of the multi-channel audio signal, P being a positive integer greater than 1, and the audio signals of the P channels including audio signals of K channel pairs, K being a positive integer; performing energy / amplitude equalization on the audio signals of the two channels of the current channel pair according to the energy / amplitude of each of the audio signals of the two channels of the current channel pair among the K channel pairs, so as to obtain the energy / amplitude of each of the audio signals of the two channels of the current channel pair after energy / amplitude equalization; determining the number of bits of each of the two channels of the current channel pair according to the energy / amplitude of each of the audio signals of the two channels of the current channel pair after energy / amplitude equalization and the available number of bits; encoding the audio signals of the two channels respectively according to the number of bits of each of the two channels of the current channel pair to obtain an encoded bit stream.

26. The method according to claim 25, wherein, P = 2*K, K being a positive integer, and the determining the number of bits of each of the two channels of the current channel pair according to the energy / amplitude of each of the audio signals of the two channels of the current channel pair after energy / amplitude equalization and the available number of bits includes: determining the sum of the energy / amplitude of the current frame according to the energy / amplitude of each of the audio signals of the P channels after energy / amplitude equalization; determining the number of bits of each of the two channels of the current channel pair according to the sum of the energy / amplitude of the current frame, the energy / amplitude of each of the audio signals of the two channels of the current channel pair after energy / amplitude equalization, and the available number of bits.

27. The method according to claim 25 or 26, wherein, the audio signals of the P channels further include Q unpaired mono audio signals, P = 2*K + Q, K being a positive integer, and Q being a positive integer; Determining the number of bits for each of the two channels of the current channel pair based on the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization and the available number of bits includes: Determining the sum of energy / amplitude of the current frame based on the energy / amplitude of the audio signals of the two channels of each of the K channel pairs after energy / amplitude equalization and the energy / amplitude of the audio signals of the Q mono channels after energy / amplitude equalization; Determining the number of bits for each of the two channels of the current channel pair based on the sum of energy / amplitude of the current frame, the energy / amplitude of the audio signals of the two channels of the current channel pair, and the available number of bits; Determining the number of bits for each of the Q mono channels based on the sum of energy / amplitude of the current frame, the energy / amplitude of the audio signals of the Q mono channels after energy / amplitude equalization, and the available number of bits; Encoding the audio signals of the two channels of the current channel pair respectively according to the number of bits for each of the two channels of the current channel pair to obtain an encoded bitstream, including: Encoding the audio signals of the K channel pairs respectively according to the number of bits for each of the K channel pairs, and encoding the audio signals of the Q mono channels respectively according to the number of bits for each of the Q mono channels to obtain an encoded bitstream.

28. An audio signal encoding device characterized in that it includes: An acquisition module for acquiring the audio signals of P channels of the current frame of a multi-channel audio signal, where P is a positive integer greater than 1, and the audio signals of the P channels include the audio signals of K channel pairs, and K is a positive integer; An energy / amplitude equalization module for equalizing the energy / amplitude of the audio signals of the two channels of the current channel pair among the K channel pairs according to the energy / amplitude of the audio signals of the two channels of the current channel pair to obtain the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization; A bit allocation module for determining the number of bits for each of the two channels of the current channel pair according to the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization and the available number of bits; An encoding module for encoding the audio signals of the two channels of the current channel pair respectively according to the number of bits for each of the two channels of the current channel pair to obtain an encoded bitstream.

29. The device according to claim 28 characterized in that P = 2*K, where K is a positive integer, and the bit allocation module is used for: Determining the sum of energy / amplitude of the current frame according to the energy / amplitude of the audio signals of the P channels after energy / amplitude equalization; Determining the number of bits for each of the two channels of the current channel pair according to the sum of energy / amplitude of the current frame, the energy / amplitude of the audio signals of the two channels of the current channel pair after energy / amplitude equalization, and the available number of bits.

30. The device according to claim 28 or 29 characterized in that The audio signals of the P channels further include Q unpaired mono audio signals, where P = 2*K + Q, K is a positive integer, and Q is a positive integer; The bit allocation module is configured to: Determine the sum of energies / amplitudes of the current frame according to the energies / amplitudes after energy / amplitude equalization of the audio signals of the two channels of each of the K channels and the energies / amplitudes after energy / amplitude equalization of the Q mono audio signals; Determine the number of bits of each of the two channels of the current channel pair according to the sum of energies / amplitudes of the current frame, the energies / amplitudes of the two channels of the current channel pair, and the available number of bits; Determine the number of bits of each of the Q mono channels according to the sum of energies / amplitudes of the current frame, the energies / amplitudes after energy / amplitude equalization of the Q mono audio signals, and the available number of bits; The encoding module is configured to: Encode the audio signals of the K channel pairs according to the number of bits of each of the K channel pairs respectively, and encode the audio signals of the Q mono channels according to the number of bits of each of the Q mono channels respectively to obtain an encoded bit stream.

31. An audio signal encoding device, Characterized in that, It includes: A non-volatile memory and a processor coupled to each other, and the processor calls the program code stored in the memory to execute the method according to any one of claims 1 to 12, or to execute the method according to any one of claims 25 to 27.

32. An audio signal encoding device, Characterized in that, It includes: an encoder, and the encoder is configured to execute the method according to any one of claims 1 to 12, or to execute the method according to any one of claims 25 to 27.

33. A computer-readable storage medium, Characterized in that, It includes a computer program, and when the computer program is executed on a computer, it causes the computer to execute the method according to any one of claims 1 to 12, or causes the computer to execute the method according to any one of claims 25 to 27.

34. A computer-readable storage medium, Characterized in that, It includes an encoded bit stream obtained by the method according to any one of claims 1 to 12, or an encoded bit stream obtained by the method according to any one of claims 25 to 27.

Citation Information

Patent Citations

  • Method for encoding and decoding of multi channel audio signal, encoder and decoder

    US20150025894A1