Method and apparatus for encoding multi-channel audio signals

JP7636516B2Active Publication Date: 2025-02-26HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2023502892
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-07-17
Filing Date
2021-07-13
Publication Date
2025-02-26
Estimated Expiration
2041-07-13

Smart Images

  • Figure 0007636516000024
    Figure 0007636516000024
  • Figure 0007636516000025
    Figure 0007636516000025
  • Figure 0007636516000026
    Figure 0007636516000026
Patent Text Reader

Abstract

A multi-channel audio signal encoding method and apparatus (700) is disclosed, which includes: obtaining P-channel audio signals in a current frame of a multi-channel audio signal, the P-channel audio signals including K-channel pair audio signals (steps 101, 201, 501); determining the number of bits for each of the K-channel pairs based on the energy / amplitude of each of the P-channel audio signals and the number of available bits (steps 101, 202); and encoding the P-channel audio signals based on the number of bits for each of the K-channel pairs to improve encoding quality.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001]

[0001] This application claims priority to Chinese Patent Application No. 202010699775.8, entitled "Method and apparatus for encoding multi-channel audio signals," filed with the State Intellectual Property Office of the People's Republic of China on July 17, 2020, the entirety of which is incorporated herein by reference.

[0002]

[0002] TECHNICAL FIELD The present application relates to audio encoding and decoding techniques, and in particular to a method and apparatus for encoding a multi-channel audio signal. [Background technology]

[0003]

[0003] With the continuous development of multimedia technology, audio has been widely used in fields such as multimedia communication, consumer electronics, virtual reality, and human-computer interaction. Audio coding is one of the key technologies in multimedia technology. In audio coding, redundant information in raw audio signals is removed to reduce the amount of data for facilitating storage or transmission.

[0004]

[0004] Multi-channel audio coding is the coding of more than two channels, including the common 5.1 channel, 7.1 channel, 7.1.4 channel, 22.2 channel, etc. Multi-channel signal screening, coupling, stereo processing, multi-channel side information generation, quantization processing, entropy coding processing, and bitstream multiplexing are performed on the multi-channel raw audio signals to form a serial bitstream (encoded bitstream) to facilitate transmission in channels or storage in digital media. Since the energy difference between multiple channels is relatively large, energy equalization needs to be performed on multiple channels before stereo processing to increase the stereo processing gain, thereby improving the coding efficiency.

[0005]

[0005] Regarding energy equalization, a method is usually used that averages the energy of all channels. This method affects the quality of the encoded audio signal. For example, when the energy difference between channels is relatively large, the aforementioned energy equalization method will result in insufficient coding bits for channel frames with larger energy / larger amplitude, resulting in poor quality channel frames, and the coding bits for channel frames with smaller energy will be redundant, resulting in wasted resources. In the case of low bit rates, the total available bits are insufficient. As a result, the quality of channel frames with larger energy / larger amplitude will be significantly degraded. Summary of the Invention

[0006]

[0006] The present application provides a multi-channel audio signal encoding method and apparatus to help improve the quality of the encoded audio signal.

[0007]

[0007] According to a first aspect, an embodiment of the present application provides a multi-channel audio signal encoding method, which may include the steps of: acquiring P channel audio signals in a current frame of a multi-channel audio signal, where P is a positive integer greater than 1, and the P channel audio signals include K channel pair audio signals, where K is a positive integer; acquiring energy / amplitude of each of the P channel audio signals; determining a number of bits of each of the K channel pairs based on the respective energy / amplitude of the P channel audio signals and an available number of bits; and encoding the P channel audio signals based on the respective number of bits of the K channel pairs to obtain an encoded bitstream.

[0008] The energy / amplitude of the audio signal of one of the P channels is: the energy / amplitude of the audio signal of said one channel in the time domain; the energy / amplitude of the audio signal of said one channel after time-frequency transformation, the energy / amplitude of the audio signal in one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of said one channel after energy / amplitude equalization, or Energy / amplitude of the audio signal in one channel after stereo processing Includes at least one of the following:

[0009]

[0009] In this implementation, bits are allocated to the channel pairs based on at least one of the energy / amplitude of each of the P channel audio signals in the time domain, the energy / amplitude of each of the P channel audio signals after time-frequency transformation and whitening, the energy / amplitude of each of the P channel audio signals after energy / amplitude equalization, or the energy / amplitude of each of the P channel audio signals after stereo processing to determine the number of bits for each of the K channel pairs. In this way, the number of bits for the channel pairs in the multi-channel signal coding is appropriately allocated to ensure the quality of the audio signal reconstructed by the decoder side.

[0010]

[0010] In a possible design, the K channel pairs include a current channel pair, and the method may further include a step of performing energy / amplitude equalization on the two-channel audio signals in the current channel pair of the K channel pairs to obtain respective energies / amplitudes of the two-channel audio signals in the current channel pair after energy / amplitude equalization.

[0011]

[0011] In this implementation, energy / amplitude equalization is performed on the audio signals of two channels in a single channel pair, so that a relatively large energy / amplitude difference can still be maintained between channel pairs having a relatively large energy / amplitude difference after energy / amplitude equalization is performed on the channel pairs. In this case, when bits are allocated based on the energy / amplitude after energy / amplitude equalization, more bits are allocated to the channel pair having a larger energy / larger amplitude, so as to ensure that the coding bits of the channel pair having a larger energy / amplitude meet the coding conditions of the channel pair. In this way, the quality of the reconstructed audio signal at the decoder side is improved.

[0012]

[0012] In a possible design, the K channel pairs include a current channel pair, and encoding the P channel audio signals based on the respective number of bits of the K channel pairs may include: determining the number of bits of each of two channels in the current channel pair based on the number of bits of the current channel pair and respective energy / amplitude of the two channel audio signals in the current channel pair after stereo processing; and encoding the two channel audio signals based on the respective number of bits of the two channels in the current channel pair.

[0013]

[0013] In this implementation, after the number of bits for each of the K channel pairs is obtained, the bits within the channel pairs are allocated based on the number of bits for each of the K channel pairs, appropriately allocating the number of bits of the channels in multi-channel signal coding, thereby ensuring the quality of the audio signal reconstructed at the decoder side.

[0014]

[0014] In a possible design, the step of determining the number of bits for each of the K channel pairs based on the respective energies / amplitudes of the audio signals of the P channels and the number of available bits may include the steps of: determining an energy / amplitude sum of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; determining a bit coefficient for each of the K channel pairs based on the respective energies / amplitudes of the audio signals of the K channel pairs and the energy / amplitude sum of the current frame; and determining the number of bits for each of the K channel pairs based on the respective bit coefficients of the K channel pairs and the number of available bits.

[0015]

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

[0016]

[0016] In this implementation, energy / amplitude equalization can be performed on two channels in a single channel pair, so that a relatively large energy / amplitude difference can be maintained between channel pairs having a relatively large energy / amplitude difference even after energy / amplitude equalization is performed on the channel pairs. In this case, when bits are allocated based on the energy / amplitude after energy / amplitude equalization, more bits are allocated to the channel pair having a larger energy / amplitude, so that the coding bits of the channel pair having a larger energy / amplitude can be guaranteed to satisfy the coding requirements of the channel pair. In this way, the quality of the audio signal reconstructed at the decoder side is improved.

[0017]

[0017] In a possible design, the step of determining the total energy / amplitude of the current frame based on the energy / amplitude of each of the audio signals of the P channels after stereo processing comprises: The energy / amplitude sum of the current frame, sum_E post , the formula

[0018]

number

[0019]

[0018] In a possible design, the step of determining the energy / amplitude sum of the current frame based on the respective energy / amplitude of the audio signals of the P channels may include the step of: determining the energy / amplitude sum of the current frame based on the respective energy / amplitude of the audio signals of the P channels before energy / amplitude equalization, in which case the energy / amplitude of the audio signal of one of the P channels before the energy / amplitude equalization comprises 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 a time-frequency transformation, or the energy / amplitude of the audio signal of the one channel after a time-frequency transformation and whitening.

[0020]

[0019] In this implementation, the energy / amplitude sum of the current frame is determined based on the energy / amplitude of each of the P channels of the audio signals in the current frame before the energy / amplitude equalization, and bit allocation is performed based on the energy / amplitude sum of the current frame, i.e., bit allocation is performed based on the energy / amplitude before the energy / amplitude equalization. In this way, the number of bits of the channels in the multi-channel signal coding can be appropriately allocated, and the quality of the reconstructed audio signal at the decoder side can be guaranteed. In this implementation, the problem that it is insufficient to code the bits of the signal of the channel pair having a larger energy / larger amplitude can be solved, and the quality of the reconstructed audio signal at the decoder side can be guaranteed.

[0021]

[0020] Compared with the bit allocation performed based on the energy / amplitude after the energy / amplitude equalization, the bit allocation performed based on the energy / amplitude before the energy / amplitude equalization can properly allocate the number of bits of the channel in the multi-channel signal coding, and the bit allocation process can be separated from the energy / amplitude equalization process. In other words, the bit allocation process is not affected by the energy / amplitude equalization process. For example, even if a method of averaging the energy / amplitude of all channels is used in the energy / amplitude equalization process procedure, in this implementation, the bits are allocated based on the energy / amplitude before the energy / amplitude equalization, so that the number of bits of the channel in the multi-channel signal coding can be properly allocated. In this way, more coding bits are allocated to the channel signals with larger energy / larger amplitude, ensuring the quality of the audio signal reconstructed at the decoder side.

[0022] In a possible design, the step of determining the total energy / amplitude of the current frame based on the energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization comprises: The energy / amplitude sum of the current frame, sum_E pre , the formula

[0023]

number

[0024]

[0022] In a possible design, the step of determining the energy / amplitude sum of the current frame based on the respective energies / amplitudes of the audio signals of the P channels includes: determining the energy / amplitude sum of the current frame based on the respective energies / amplitudes of the audio signals of the P channels before energy / amplitude equalization and a weighting coefficient for each of the P channels, wherein the weighting coefficient is less than or equal to 1.

[0025]

[0023] In this implementation, the weighting factor is used to adjust the number of bits of the channels in the multi-channel signal coding so as to appropriately allocate the number of bits of the channels in the multi-channel signal coding.

[0026]

[0024] In a possible design, the step of determining the energy / amplitude sum based on the respective energies / amplitudes of the audio signals of the P channels before energy / amplitude equalization and respective weighting factors of the P channels may further comprise: The energy / amplitude sum of the current frame, sum_E pre , the formula

[0027]

number

[0028]

[0025] In this implementation, the weighting factor is used to adjust the number of bits of the channels in the multi-channel signal coding. The value of the weighting factor of the two channels in a channel pair is inversely proportional to the normalized correlation value of the two channels in a channel pair, i.e., the weighting factor is used to increase the number of bits of the channel pair with low correlation. In this way, the effect of coding is improved and the quality of the reconstructed audio signal at the decoder side is guaranteed.

[0029]

[0026] In a possible design, the audio signal of the P channels further comprises audio signals of Q uncoupled channels, where P = 2 x K + Q, and Q is a positive integer. Determining the number of bits of each of the K channel pairs based on the respective energy / amplitude of the audio signal of the P channels and the number of available 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 channels based on the respective energy / amplitude of the audio signal of the P channels and the number of available bits. Encoding the audio signal of the P channels based on the number of bits of each of the K channel pairs may include: encoding the audio signal of the K channel pairs based on the number of bits of each of the K channel pairs and encoding the audio signal of the Q channels based on the number of bits of each of the Q channels. One of the Q channels may be a mono channel or a channel obtained by downmixing.

[0030]

[0027] In a possible design, the step of determining the number of bits for each of the K channel pairs and the number of bits for each of the Q channels based on the respective energies / amplitudes of the audio signals of the P channels and the number of available bits may include the steps of: determining the energy / amplitude sums of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; determining the bit coefficients of each of the K channel pairs based on the respective energies / amplitudes of the audio signals of the K channel pairs and the energy / amplitude sums of the current frame; determining the bit coefficients of each of the Q channels based on the respective energies / amplitudes of the audio signals of the Q channels and the energy / amplitude sums of the current frame; determining the number of bits for each of the K channel pairs based on the respective bit coefficients of the K channel pairs and the number of available bits; and determining the number of bits for each of the Q channels based on the respective bit coefficients of the Q channels and the number of available bits.

[0031]

[0028] In a possible design, the step of encoding the audio signals of the P channels based on the number of bits of each of the K channel pairs may include the step of: encoding the audio signals of the P channels after energy / amplitude equalization based on the number of bits of each of the K channel pairs.

[0032]

[0029] In this implementation, the P channel audio signal after energy / amplitude equalization is encoded, and the P channel audio signal after energy / amplitude equalization can be obtained by performing energy / amplitude equalization on the P channel audio signal. The encoding may include stereo processing, entropy encoding, etc., which can improve the encoding efficiency and enhance the encoding effect.

[0033]

[0030] According to 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, an audio encoding device chip, or a system in a chip; or a functional module in an audio encoder configured to implement the method in the first aspect or any of the possible designs of the first aspect. The multi-channel audio signal encoding device may implement the functions performed in the first aspect or any of the possible designs of the first aspect, and the functions may be realized by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functions. For example, in a possible design, a multi-channel audio signal encoding device may include: an acquisition module configured to acquire audio signals of P channels and respective energies / amplitudes of the audio signals of the P channels in a 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 audio signals of K channel pairs, where K is a positive integer; a bit allocation module configured to determine a number of bits for each of the K channel pairs based on the respective energies / amplitudes of the audio signals of the P channels and a number of available bits; and an encoding module configured to encode the audio signals of the P channels based on the respective numbers of bits for the K channel pairs to obtain an encoded bitstream.

[0034]

[0031] 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 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.

[0035]

[0032] In a possible design, the K channel pairs include a current channel pair, and the encoding module is configured to: determine a number of bits for each of two channels in the current channel pair based on the number of bits of the current channel pair and an energy / amplitude of each of the audio signals of the two channels in the current channel pair after stereo processing; and encode the audio signals of the two channels based on the number of bits for each of the two channels in the current channel pair.

[0036]

[0033] In a possible design, the bit allocation module is configured to: determine an energy / amplitude sum of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; determine a bit coefficient for each of the K channel pairs based on the respective energies / amplitudes of the audio signals of the K channel pairs and the energy / amplitude sum of the current frame; and determine a number of bits for each of the K channel pairs based on the respective bit coefficients of the K channel pairs and the number of available bits.

[0037]

[0034] In a possible design, the bit allocation module is configured to determine the total energy / amplitude of the current frame based on the energy / amplitude of each of the audio signals of the P channels after stereo processing.

[0038]

[0035] In a possible design, the bit allocation module may include: The energy / amplitude sum of the current frame, sum_E post , the formula

[0039]

number

[0040]

[0036] In a possible design, the bit allocation module is configured to determine the total energy / amplitude of the current frame based on the respective energy / amplitude of the audio signals of the P channels before energy / amplitude equalization, where the energy / amplitude of the audio signal of one of the P channels before the energy / amplitude equalization includes 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 a time-frequency transformation, or the energy / amplitude of the audio signal of the one channel after a time-frequency transformation and whitening.

[0041]

[0037] In a possible design, the bit allocation module may include: The energy / amplitude sum of the current frame, sum_E pre , the formula

[0042]

number

[0043]

[0038] In a possible design, the bit allocation module is configured to determine the energy / amplitude total of the current frame based on the energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization and a weighting coefficient for each of the P channels, the weighting coefficient being less than or equal to 1.

[0044] In one possible design, the bit allocation module may further include: pre , the formula

[0045]

number

[0046]

[0040] In a possible design, the P channel audio signals further include Q uncoupled channel audio signals, where P=2×K+Q, Q being 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 channels based on the respective energy / amplitude of the P channel audio signals and the available number of bits. The encoding module is configured to encode the K channel pairs audio signals based on the respective number of bits of the K channel pairs and encode the Q channel audio signals based on the respective number of bits of the Q channels.

[0047]

[0041] In a possible design, the bit allocation module is configured to perform the steps of: determining the energy / amplitude sum of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; determining the bit coefficients of each of the K channel pairs based on the respective energies / amplitudes of the audio signals of the K channel pairs and the energy / amplitude sum of the current frame; determining the bit coefficients of each of the Q channels based on the respective energies / amplitudes of the audio signals of the Q channels and the energy / amplitude sum of the current frame; determining the number of bits of each of the K channel pairs based on the bit coefficients of each of the K channel pairs and the number of available bits; and determining the number of bits of each of the Q channels based on the bit coefficients of each of the Q channels and the number of available bits.

[0048]

[0042] In a possible design, the encoding module is configured to encode the audio signal of the P channels after energy / amplitude equalization based on the number of bits of each of the K channel pairs.

[0049]

[0043] In some implementations, the apparatus may further include an energy / amplitude equalization module, which is configured to obtain an energy / amplitude equalized P-channel audio signal based on the P-channel audio signal.

[0050]

[0044] According to a third aspect, an embodiment of the present application provides a multi-channel audio signal encoding method. The method may include: obtaining audio signals of P channels in a 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 audio signals of K channel pairs, where K is a positive integer; performing energy / amplitude equalization on the audio signals of two channels in the current channel pair of the K channel pairs based on respective energies / amplitudes of the audio signals of the two channels in the current channel pair to obtain respective energies / amplitudes of the audio signals of the two channels in the current channel pair after energy / amplitude equalization; determining a number of bits for each of the two channels in the current channel pair based on the respective energies / amplitudes of the audio signals of the two channels in the current channel pair after energy / amplitude equalization and a number of available bits; and encoding the audio signals of the two channels based on the respective numbers of bits of the two channels in the current channel pair to obtain an encoded bitstream.

[0051]

[0045] In this implementation, energy / amplitude equalization is performed on the audio signals of two channels in a single channel pair, so that a relatively large energy / amplitude difference can still be maintained between channel pairs having a relatively large energy / amplitude difference after energy / amplitude equalization is performed on the channel pairs. In this case, when bits are allocated based on the energy / amplitude after energy / amplitude equalization, more bits are allocated to the channel pair having a larger energy / larger amplitude, so as to ensure that the coding bits of the channel pair having a larger energy / amplitude meet the coding conditions of the channel pair. In this way, the quality of the audio signal reconstructed at the decoder side is improved.

[0052]

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

[0053]

[0047] In a possible design, the P-channel audio signals further include Q uncoupled-channel audio signals, where P=2×K+Q, and Q is a positive integer. Determining the number of bits for each of the two channels in the current channel pair based on the respective energies / amplitudes of the audio signals of the two channels in the current channel pair after energy / amplitude equalization and the number of available bits may include: determining the energy / amplitude sum of the current frame based on the energy / amplitude of the audio signals of the two channels in each of the K channel pairs after energy / amplitude equalization and the energy / amplitude of the audio signals of the Q channels after energy / amplitude equalization; determining the number of bits for each of the two channels in the current channel pair based on the energy / amplitude of the current frame, the respective energy / amplitude of the audio signals of the two channels in the current channel pair and the number of available bits; and determining the number of bits for each of the Q channels based on the energy / amplitude sum of the current frame, the respective energy / amplitude of the audio signals of the Q channels after energy / amplitude equalization and the number of available bits. The step of encoding the audio signals of the two channels based on the respective numbers of bits for the two channels in the current channel pair to obtain an encoded bitstream may include the steps of: encoding the audio signals of the K channel pairs based on the respective numbers of bits for the K channel pairs, and encoding the audio signals of the Q channels based on the respective numbers of bits for the Q channels to obtain the encoded bitstream.

[0054]

[0048] According to a fourth aspect, an embodiment of the present application provides an audio signal encoding apparatus. The multi-channel audio signal encoding apparatus may be an audio encoder, an audio encoding device chip, or a system in a chip; or a functional module in an audio encoder configured to implement the method in any of the third aspect or possible designs of the third aspect. The multi-channel audio signal encoding apparatus may implement the functions performed in the third aspect or possible designs of the third aspect, and the functions may be realized by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functions. For example, in a possible design, a multi-channel audio signal encoding apparatus includes: an acquisition module configured to acquire audio signals of P channels in a 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 audio signals of K channel pairs, where K is a positive integer; performing energy / amplitude equalization on the audio signals of two channels in the current channel pair of the K channel pairs based on respective energies / amplitudes of the audio signals of the two channels in the current channel pair, and generating an energy / amplitude equalized signal for the current channel pair. a bit allocation module configured to determine a number of bits for each of the two channels in the current channel pair based on the respective energies / amplitudes of the audio signals of the two channels in the current channel pair after energy / amplitude equalization and a number of available bits; and an encoding module configured to encode the audio signals of the two channels based on the respective numbers of bits for the two channels in the current channel pair to obtain an encoded bitstream.

[0055]

[0049] In a possible design, P = 2 × K, where K is a positive integer. The bit allocation module is configured to: determine an energy / amplitude sum of the current frame based on respective energies / amplitudes of the audio signals of the P channels after energy / amplitude equalization; and determine the respective number of bits of the two channels in the current channel pair based on the energy / amplitude sum of the current frame, the respective energies / amplitudes of the audio signals of the two channels in the current channel pair after energy / amplitude equalization, and the number of available bits.

[0056]

[0050] In a possible design, the audio signals of the P channels further include audio signals of Q uncoupled channels, where P = 2 × K + Q, and Q is a positive integer. The bit allocation module is configured to: determine the energy / amplitude sum of the current frame based on the energy / amplitude of the audio signals of two channels in each of the K channel pairs after the energy / amplitude equalization and the energy / amplitude of the audio signals of the Q channels after the energy / amplitude equalization; determine the number of bits of each of the two channels in the current channel pair based on the energy / amplitude of the current frame, the respective energy / amplitude of the audio signals of the two channels in the current channel pair, and the number of available bits; and determine the number of bits of each of the Q channels based on the energy / amplitude sum of the current frame, the respective energy / amplitude of the audio signals of the Q channels after energy / amplitude equalization, and the number of available bits. The encoding module is configured to: encode the audio signals of the K channel pairs based on the respective numbers of bits for the K channel pairs, and encode the audio signals of the Q channels based on the respective numbers of bits for the Q channels to obtain the encoded bitstream.

[0057]

[0051] According to a fifth aspect, an embodiment of the present application provides an audio signal encoding device including a non-volatile memory and a processor coupled to each other, the processor running program code stored in the memory to perform a method according to the first aspect or any of the possible designs of the first aspect, or to perform a method according to the third aspect or any of the possible designs of the third aspect.

[0058]

[0052] According to a sixth aspect, an embodiment of the present application provides an audio signal encoding device including an encoder configured to perform a method according to the first aspect or any of the possible designs of the first aspect, or to perform a method according to the third aspect or any of the possible designs of the third aspect.

[0059] According to a seventh aspect, an embodiment of the present application provides a computer readable storage medium comprising a computer program, the computer program being operable, when executed on a computer, to perform a method according to the first aspect or any of the possible designs of the first aspect, or to perform a method according to the third aspect or any of the possible designs of the third aspect.

[0060]

[0054] According to an eighth aspect, an embodiment of the present application provides a computer-readable storage medium comprising an encoded bitstream obtained by a method according to the first aspect or any of the possible designs of the first aspect, or an encoded bitstream obtained by a method according to the third aspect or any of the possible designs of the third aspect.

[0061]

[0055] According to a ninth aspect, the present application provides a computer program product, the computer program product comprising a computer program which, when executed by a computer, is used to perform a method according to the first aspect or any of the possible designs of the first aspect, or to perform a method according to the third aspect or any of the possible designs of the third aspect.

[0062] According to a tenth aspect, an embodiment of the present application provides a chip including a processor and a memory, the memory being configured to store a computer program, and the processor being configured to run and execute the program code stored in the memory to perform a method according to the first aspect or any of the possible designs of the first aspect, or to perform a method according to the third aspect or any of the possible designs of the third aspect.

[0063]

[0057] According to the multi-channel audio signal coding method and apparatus in the embodiment of the present application, P channel audio signals in a current frame of a multi-channel audio signal are obtained, where the P channel audio signals include K channel pair audio signals; the number of bits of each of the K channel pairs is determined based on the energy / amplitude of each of the P channel audio signals and the number of available bits; and the P channel audio signals are coded based on the number of bits of each of the K channel pairs to obtain a coded bitstream. The energy / amplitude of one channel audio signal among the P channels includes at least one of: the energy / amplitude of the one channel audio signal in a time domain, the energy / amplitude of the one channel audio signal after a time-frequency transform, the energy / amplitude of the one channel audio signal after a time-frequency transform and whitening, the energy / amplitude of the one channel audio signal after energy / amplitude equalization, or the energy / amplitude of the one channel audio signal after stereo processing. The bits are allocated to the channel pairs based on at least one of the energy / amplitude of each of the P channel audio signals in the time domain, the energy / amplitude of each of the P channel audio signals after time-frequency transformation, the energy / amplitude of each of the P channel audio signals after time-frequency transformation and whitening, the energy / amplitude of each of the P channel audio signals after energy / amplitude equalization, or the energy / amplitude of each of the P channel audio signals after stereo processing to determine the number of bits for each of the K channel pairs. In this way, the number of bits for the channel pairs in the multi-channel signal coding is appropriately allocated to ensure the quality of the audio signal reconstructed by the decoder.For example, when the energy / amplitude difference between a channel pair is relatively large, the method in the embodiment of the present application is used to solve the problem that coding the bits of the channel pair with larger energy / larger amplitude is insufficient, and the quality of the reconstructed audio signal at the decoder side can be guaranteed. [Brief description of the drawings]

[0064] [Figure 1]

[0058] FIG. 1 is a schematic diagram of an example of an audio encoding and decoding system according to an embodiment of the present application. [Diagram 2]

[0059] FIG. 2 is a flowchart of a multi-channel audio signal encoding method according to an embodiment of the present application. [Diagram 3]

[0060] FIG. 3 is a flowchart of a multi-channel audio signal encoding method according to an embodiment of the present application. [Figure 4]

[0061] FIG. 4 is a flowchart of a method for allocating bits of a channel pair according to one embodiment of the present application. [Diagram 5]

[0062] Figure 5 is a schematic diagram of the encoder side procedure according to one embodiment of the present application. [Figure 6]

[0063] Figure 6 is a schematic diagram of the processing steps of a channel encoding unit according to an embodiment of the present application. [Figure 7]

[0064] Figure 7 is a schematic diagram of the processing steps of a channel encoding unit according to an embodiment of the present application. [Figure 8]

[0065] FIG. 8 is a flowchart of another multi-channel audio signal encoding method according to an embodiment of the present application. [Figure 9]

[0066] FIG. 9 is a schematic structural diagram of an audio signal encoding device according to an embodiment of the present application. [Figure 10]

[0067] FIG. 10 is a schematic structural diagram of an audio signal encoding device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0065]

[0068] Terms such as "first" and "second" in the embodiments of the present application are used for distinction and explanation only, and cannot be understood as indicating or implying relative importance or order. Furthermore, the terms "comprise", "have", and any variations thereof are intended to cover a non-exclusive inclusion, for example, including a series of steps or units. A method, system, product, or device is not necessarily limited to the literally recited steps or units, and may include other steps or units that are not literally recited or that are inherent to such a process, method, product, or device.

[0066]

[0069] In this application, it should be understood that "at least one" means one or more, and "multiple" means two or more. The term "and / or" is used to describe an association relationship to describe related objects, and indicates that three relationships may exist. For example, "A and / or B" may represent three cases: only A is present, only B is present, and both A and B are present, where A and B may be singular or plural. The character " / " generally represents an "or" relationship between related objects. "At least one of" or similar expressions means any combination of the following, including any combination of one or more of the following. For example, at least one of a, b, or c may represent a, b, c, "a and b," "a and c," "b and c," or "a, b, and c." Each of a, b, and c may be singular or plural. Alternatively, some of a, b, and c may be singular; some of a, b, and c may be plural.

[0067]

[0070] A system architecture to which the embodiments of the present application are applied will be described below. FIG. 1 is a schematic block diagram of an example of an audio encoding and decoding system 10 to which the embodiments of the present application are applied. As shown in FIG. 1, 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. Thus, 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. Thus, the destination device 14 may be referred to as an audio decoding device. In various implementation solutions, the source device 12, the destination device 14, or both the source device 12 and the destination device 14 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, a RAM, a ROM, an EEPROM, a flash memory, or any other medium that can be used to store desired program code in the form of computer-accessible instructions or data structures as described herein. The source device 12 and destination device 14 may include a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablets, set-top boxes, telephone handsets such as “smart” phones, television sets, speakers, digital media players, video game consoles, in-vehicle computers, some wearable devices, virtual reality (VR) devices, servers providing VR services, augmented reality (AR) devices, servers providing AR services, wireless communication devices, and the like.

[0068]

[0071] 1 depicts source device 12 and destination device 14 as separate devices, an embodiment of the devices may alternatively include both source device 12 and destination device 14, or functionality of both source device 12 and destination device 14, i.e., source device 12 or corresponding functionality and destination device 14 or corresponding functionality. In such an embodiment, source device 12 or corresponding functionality and destination device 14 or corresponding functionality may be implemented using the same hardware and / or software, or using separate hardware and / or software, or any combination thereof.

[0069]

[0072] The communication connection between the source device 12 and the destination device 14 may be performed over a link 13, and the destination device 14 may receive the encoded audio data from the source device 12 over the link 13. The link 13 may 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 may include one or more communication media that enable the source device 12 to transmit the encoded audio data directly to the destination device 14 in real time. In this example, the source device 12 may modulate the encoded audio data according to a communication standard (e.g., a wireless communication protocol) and transmit the modulated audio data to the destination device 14. The one or more communication media may include wireless communication media and / or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet), and may include routers, switches, base stations, or other devices that facilitate communication from source device 12 to destination device 14.

[0070]

[0073] Source device 12 includes an encoder 20. Optionally, source device 12 may further include an audio source 16, a pre-processor 18, and a communication interface 22. In a particular implementation, encoder 20, audio source 16, pre-processor 18, and communication interface 22 may be hardware components within source device 12 or may be software programs within source device 12, which are described separately below.

[0071]

[0074] The audio source 16 may include or be, for example, any type of sound capture device configured to capture sounds from the real world and / or any type of sound generation device. The audio source 16 may be a microphone configured to capture sounds, or a memory configured to store audio data, and the audio source 16 may further include some type of interface (internal or external) for storing pre-captured or generated audio data and / or for acquiring or receiving audio data. If the audio source 16 is a microphone, the audio source 16 may be, for example, a local microphone or a microphone integrated in the source device. If the audio source 16 is a memory, the audio source 16 may be, for example, a local memory or a memory integrated in the source device. If the audio source 16 includes an interface, the interface may be, for example, an external interface for receiving audio data from an external audio source. For example, the external audio source is an external sound capture device such as a microphone, external storage, or an external audio generation device. The interface can be any type of interface, e.g. a wired or wireless interface or an optical interface, according to any proprietary or standardized interface protocol.

[0072]

[0075] In this embodiment of the present application, the audio data transmitted by the audio source 16 to the pre-processor 18 is also referred to as raw audio data 17 .

[0073]

[0076] The pre-processor 18 is configured to receive and pre-process the raw 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 or denoising.

[0074]

[0077] The encoder 20 (also referred to as audio encoder 20) is configured to receive pre-processed audio data 19 and is configured to perform the embodiments described below, thus implementing the encoder-side application of the audio signal encoding method described in the present application.

[0075]

[0078] The communication interface 22 may be configured to receive the encoded audio data 21 and transmit the encoded audio data 21 via the link 13 to the destination device 14 for storage or direct reconstruction or to any other device (e.g., memory). The other device may be any device used for decoding or storage. The communication interface 22 may be configured, for example, to encapsulate the encoded audio data 21 into a suitable format for transmission via the link 13, for example into data packets.

[0076]

[0079] Destination device 14 includes a decoder 30. Optionally, destination device 14 may further include a communications interface 28, an audio post-processor 32, and a speaker device 34, which are described separately below.

[0077]

[0080] The communication interface 28 may be configured to receive the encoded audio data 21 from the source device 12 or any other source. The any other source may be, for example, a storage device. The storage device may be, for example, an encoded audio data storage device. The communication interface 28 may be configured to transmit or receive the encoded audio data 21 via a link 13 between the source device 12 and the destination device 14 or via any type of network. The link 13 may be, for example, a direct wired connection or a wireless connection. The any type of network may be, for example, a wired or wireless network, or any combination thereof, or any type of private or public network, or any combination thereof. The communication interface 28 may be configured to, for example, decapsulate data packets transmitted via the communication interface 22 to obtain the encoded audio data 21.

[0078]

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

[0079]

[0082] The decoder 30 (or referred to as decoder 30 ) is arranged to receive the encoded audio data 21 and to provide decoded audio data 31 or decoded audio 31 .

[0080]

[0083] The audio post-processor 32 is configured to post-process the decoded audio data 31 (also called 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 be further configured to transmit the post-processed audio data 33 to a speaker device 34.

[0081]

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

[0082]

[0085] 1 depicts source device 12 and destination device 14 as separate devices, an embodiment of the devices may alternatively include both source device 12 and destination device 14, or functionality of both source device 12 and destination device 14, i.e., source device 12 or corresponding functionality and destination device 14 or corresponding functionality. In such an embodiment, source device 12 or corresponding functionality and destination device 14 or corresponding functionality may be implemented using the same hardware and / or software, or using separate hardware and / or software, or any combination thereof.

[0083]

[0086] As will be clear to one skilled in the art based on the specification, the presence and (exact) division of the various units or functions of the source device 12 and / or destination device 14 shown in Fig. 1 may differ depending on the actual device and application. The source device 12 and destination device 14 may be any of a wide range of devices, including any type of portable or fixed device, such as, for example, a notebook or laptop computer, a mobile phone, a smartphone, a pad or tablet computer, a video camera, a desktop computer, a set-top box, a television set, a camera, an in-car device, a sound box, a digital media player, a video game console, a video streaming transmission device (such as a content service server or a content delivery server), a broadcast receiving device, a broadcast transmitting device, a smart glass or a smart watch, and may or may not use any type of operating system.

[0084]

[0087] The encoder 20 and the decoder 30 may each be implemented as any of a variety of suitable circuits, such as 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 in part using software, a device may store software instructions in a suitable non-transitory computer-readable storage medium and execute the instructions by using hardware, such as one or more processors, to perform the techniques of this disclosure. Any of the foregoing content (including hardware, software, a combination of hardware and software, etc.) may be considered one or more processors.

[0085]

[0088] In some cases, the audio encoding and decoding system 10 shown in FIG. 1 is merely an example, and the techniques herein are applicable to audio encoding settings (e.g., audio encoding or speech decoding) that do not necessarily include any data communication between the encoding device and the decoding device. In other examples, data may be retrieved from local memory, transmitted in a streaming manner over a network, etc. An audio encoding device may encode data and store the data in memory, and / or a speech decoding device may retrieve and decode data from memory. In some examples, encoding and decoding are performed by devices that simply encode data to memory and / or retrieve and decode data from memory without communicating with each other.

[0086]

[0089] The encoder may be a multi-channel encoder, for example a stereo encoder, a 5.1 channel encoder, or a 7.1 channel encoder.

[0087]

[0090] The audio data may also be referred to as an audio signal. The audio signal in this embodiment of the present application is an input signal in an audio encoding device, and the audio signal may include multiple frames. For example, the current frame may be a specific frame in the audio signal. In this embodiment of the present application, an example in which the current frame of the audio signal is encoded and decoded is used for description. The previous frame or the next frame of the current frame in the audio signal may be encoded and decoded in the coding scheme of the frame of the current audio signal, and the encoding and decoding process of the previous frame or the next frame of the current frame in the audio signal will not be described one by one. Furthermore, the audio signal in this embodiment of the present application may be a multi-channel signal, i.e., an audio signal including P channels. This embodiment of the present application is used to realize multi-channel audio signal encoding.

[0088]

[0091] It should be noted that "energy / amplitude" in the embodiment of the present application represents energy or amplitude, and in the actual processing procedure, if the energy processing is performed on the frame at the beginning, the energy processing is performed in the subsequent processing; or if the amplitude processing is performed on the frame at the beginning, the amplitude processing is performed in the subsequent processing.

[0089]

[0092] The encoder executes the multi-channel audio signal encoding method of the embodiment of the present application, and can appropriately allocate the number of bits of the channels in the multi-channel signal encoding to ensure the quality of the audio signal reconstructed by the decoder side and improve the encoding quality. For specific embodiments, please refer to the specific description of the embodiments below.

[0090]

[0093] 2 is a flowchart of a multi-channel audio signal encoding method according to an embodiment of the present application. This embodiment of the present application may be implemented by the aforementioned encoder. As shown in FIG. 2, the method in this embodiment may include the following steps:

[0091]

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

[0092]

[0095] A channel pair audio signal includes two channel audio signals. A channel pair in this embodiment of the present application can be any one of K channel pairs. An audio signal of two coupled channels is a channel pair audio signal.

[0093]

[0096] In some embodiments, P=2K. After multi-channel signal screening, coupling, stereo processing, and multi-channel side information generation, a P-channel audio signal, i.e., K-channel pair audio signals, may be obtained.

[0094]

[0097] In some embodiments, the P channel audio signals further include Q uncoupled channel audio signals, where P=2×K+Q, K is a positive integer, and Q is a positive integer.

[0095]

[0098] After the multi-channel signal screening, coupling, stereo processing, and multi-channel side information generation, it is possible to obtain Q channel audio signals without stereo processing and K channel pair audio signals. Using a 5.1 channel signal as an example, the 5.1 channel includes 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. The L channel signal and the R channel signal are coupled to form a first channel pair. Stereo processing is performed on the first channel pair to obtain a middle channel M1 channel signal and a side channel S1 channel signal. The LS channel signal and the RS channel signal are coupled to form a second channel pair. Stereo processing is performed on the second channel pair to obtain a middle channel M2 channel signal and a side channel S2 channel signal. The LFE channel signal and the C channel signal are non-coupled audio signals. That is, P=6, K=2, and Q=2. The P-channel audio signals include an audio signal of a first channel pair, an audio signal of a second channel pair, and an LFE channel signal and a C channel signal on which no stereo processing has been performed. The audio signal of the first channel pair includes a middle channel M1 channel signal and a side channel S1 channel signal, and the audio signal of the second channel pair includes a middle channel M2 channel signal and a side channel S2 channel signal. The middle channels M1 and M2 and the side channels S1 and S2 can be considered to be channels obtained by a downmixing process, i.e., downmixed channels.

[0096]

[0099] In some embodiments, the P channels do not include the LFE channel. In these embodiments, a fixed number of bits can be allocated to the LFE channel regardless of whether the energy / amplitude value of the LFE channel is high or low. For example, the fixed quantity can be a preset value. Specifically, the fixed quantity is invariant regardless of the number of channels included in the multi-channel signal and the coding bit rate of the multi-channel signal, e.g., 80, 100, or 120. Alternatively, the fixed quantity can alternatively be determined based on at least one of the following: the number of channels included in the multi-channel signal, and the coding bit rate of the multi-channel signal. In general, a larger number of channels indicates a smaller fixed quantity; a higher coding bit rate indicates a larger fixed quantity. For example, if the multi-channel signal is a 5.1 channel signal, i.e., if 6 channels are included, and the coding bit rate is 192 kbps, the fixed quantity can be 80, and specifically, 80 bits are allocated to the LFE channel. If the coding bit rate is 256 kbps, the fixed quantity may be 120, specifically, 120 bits are allocated to the LFE channel, for example, if the coding bit rate is 192 kbps and the multi-channel signal is a 7.1 channel signal, i.e., contains 8 channels, the fixed quantity may be 60, specifically, 60 bits are allocated to the LFE channel.

[0097]

[0100] Step 102: Determine the number of bits for each of the K channel pairs based on the energy / amplitude of each of the P channel audio signals and the number of available bits.

[0098]

[0101] 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 one channel in the time domain, the energy / amplitude of the audio signal of one channel after time-frequency transformation, the energy / amplitude of the audio signal of one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of one channel after energy / amplitude equalization, or the energy / amplitude of the audio signal of 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, in the bit allocation process, any one or more of the aforementioned energies / amplitudes may be selected for bit allocation.

[0099]

[0102] If the P channels do not include the LFE channel, the number of available bits does not include the fixed number of bits.

[0100]

[0103] The energy / amplitude of a single channel audio signal after time-frequency transformation and whitening is the energy / amplitude obtained after a time-frequency transformation and whitening process has been performed on the single channel audio signal, where the whitening process is performed to make the frequency domain coefficients of the single channel audio signal flatter to facilitate subsequent encoding.

[0101]

[0104] A bit allocation is performed based on the energy / amplitude of each of the P channel audio signals and the number of available bits, where the bit allocation is for the channel pairs, i.e., the corresponding number of bits is allocated to different channel pairs.

[0102]

[0105] For P=2K, the number of bits for each of the K channel pairs is determined based on the energy / amplitude of each of the P channel audio signals and the number of available bits. The number of bits may be referred to as the number of initially allocated bits. The channel pairs may be used as basic units. One-bit allocation is performed for the basic units based on the ratio of the energy / amplitude of the basic units in all the basic units (K basic units). The energy / amplitude of any basic unit may be determined based on the energy / amplitude of the audio signals of the two channels in the basic unit. For example, the energy / amplitude of the basic unit may be the sum of the energy / amplitude of the audio signals of the two channels in the basic unit. Bits may be allocated among different basic units by one-bit allocation to obtain the number of bits for each basic unit. The number of bits may be referred to as the number of initially allocated bits.

[0103]

[0106] If P=2×K+Q, the number of bits for each of the K channel pairs and the number of bits for each of the Q channels are determined based on the energy / amplitude of each of the P channel audio signals and the number of available bits. A channel pair may be used as a basic unit, or an uncoupled mono channel may be used as a basic unit. A one-bit allocation is performed for the basic units based on a ratio of the energy / amplitude of the basic unit in the energy / amplitude of all the basic units (K+Q basic units). For the basic units corresponding to the coupled channels, the energy / amplitude of the basic unit may be determined based on the energy / amplitude of the two channel audio signals in the basic unit. For the basic units corresponding to the uncoupled channels, the energy / amplitude of the basic unit may be determined based on the energy / amplitude of the single channel audio signal. Bits may be allocated among the basic units (K+Q basic units) by one-bit allocation to obtain the number of bits for each basic unit. In other words, the number of bits for each of the K channel pairs and the number of bits for each of the Q channels. One of the Q channels may be a mono channel or may be a channel obtained by a downmixing process, i.e. a downmixed channel.

[0104]

[0107] Whether P=2K or P=2×K+Q, in some implementations, the number of bits for each of the K channel pairs may be determined based on the number of available bits and any one of the following: the energy / amplitude of each of the K channel pairs in the time domain, the energy / amplitude of each of the K channel pairs after time-frequency transformation, or the energy / amplitude of each of the K channel pairs after time-frequency transformation and whitening. In this implementation, the energy / amplitude equalization is performed on the audio signals of the K channel pairs before bit allocation, which may improve coding efficiency and coding effect. The method of performing energy / amplitude equalization on the audio signals of the K channel pairs may be performing energy / amplitude equalization on the audio signals of multiple channel pairs, or on all audio signals of multiple channel pairs and one or more uncoupled channels. In this implementation, the method of performing energy / amplitude equalization on the audio signals of the K channel pairs may alternatively be performing energy / amplitude equalization on the audio signals of two channels in a single channel pair.

[0105]

[0108] In another implementation, the number of bits for each of the K channel pairs may be determined based on the number of available bits and any one of the following: the energy / amplitude of each of the audio signals of the K channel pairs after energy / amplitude equalization, or the energy / amplitude of each of the audio signals of the K channel pairs after stereo processing. In this implementation, the energy / amplitude equalization is performed on the audio signals of the K channel pairs before bit allocation, which may improve coding efficiency and coding effect. The method of performing energy / amplitude equalization on the audio signals of the K channel pairs may be performing energy / amplitude equalization on the audio signals of two channels in a single channel pair. The energy / amplitude of each of the audio signals of the K channel pairs after energy / amplitude equalization, or the energy / amplitude of each of the audio signals of the K channel pairs after stereo processing are all obtained after the energy / amplitude equalization is performed on the audio signals of two channels in a single channel pair.

[0106]

[0109] Similar to the determination of the number of bits for each of the K channel pairs, where P=2×K+Q, in one implementation, the number of bits for each of the Q channels may be determined based on the number of available bits and any one of the following: the respective energy / amplitude of the Q channel audio signal in the time domain, the respective energy / amplitude of the Q channel audio signal after time-frequency transformation, or the respective energy / amplitude of the Q channel audio signal after time-frequency transformation and whitening. In another implementation, the number of bits for each of the Q channels may be determined based on the number of available bits and any one of the following: the respective energy / amplitude of the Q channel audio signal after energy / amplitude equalization, or the respective energy / amplitude of the Q channel audio signal after stereo processing. The respective energy / amplitude of the Q channel audio signal after energy / amplitude equalization, or the respective energy / amplitude of the Q channel audio signal after stereo processing, is equal to the energy / amplitude before energy / amplitude equalization or stereo processing.

[0107]

[0110] In some embodiments, the encoding quality of a single channel is not improved if the number of bits allocated to the channel is greater than a threshold. Therefore, a threshold can be preset. In this case, the threshold is taken into account in the process of performing bit allocation on the channel, so that the number of bits allocated to the single channel does not exceed the threshold, regardless of whether the energy / amplitude value of the single channel is high or not. In this way, more bits can be allocated to other channels to improve the encoding quality of the other channels without degrading the encoding quality of the single channel, and the encoding quality of the entire signal can be improved.

[0108]

[0111] Accordingly, in some embodiments, determining the number of bits for each of the K channel pairs comprises the steps of: determining an Mth channel among the P channels, where the number of bits originally allocated to the Mth channel is greater than a threshold, and M is greater than or equal to 0 and less than P; determining the number of redundant bits for the Mth channel, wherein: Number of redundant bits in the Mth channel = number of bits originally allocated in the Mth channel - threshold and if the Mth channel is a first determined channel among the P channels and the number of bits initially allocated to the channel is greater than a threshold, allocating redundant bits to (P-1) channels other than the Mth channel among the P channels to obtain updated numbers of bits for the (P-1) channels, where the updated number of bits for the Mth channel is the threshold; or If the Mth audio channel is a channel not determined first and the number of bits initially allocated to the channel is greater than the threshold, the method may further include allocating redundant bits to channels among the P channels excluding the Mth channel and the channel determined to have the number of bits initially allocated to the channel greater than the threshold to obtain updated numbers of bits for the other channels. For example, if the channel determined to have the number of bits initially allocated to the channel greater than the threshold is the Nth channel, the other channels include (P-2) channels among the P channels excluding the Mth channel and the Nth channel. It should be noted that if a fixed number of bits is allocated to the LFE channel, the P channels do not include the LFE channel.

[0109]

[0112] If the bit count threshold for a single channel is frmBitMax, frmBitMax may be calculated based on the saturation coding bit rate, frame length, and coding sampling rate of a single channel according to the following formula: frmBitMax=rateMax×frameLen / fs Here, rateMax represents the saturation coding bit rate of a single channel, frameLen represents the frame length, and fs represents the coding sampling rate. Typically, rateMax may be 256000 bps, 240000 bps, 224000 bps, 192000 bps, etc. The value of rateMax may be selected based on the coding efficiency of the encoder, or may be set based on an empirical value, which is not limited in this case.

[0110]

[0113] For example, a multi-channel signal is a 5.1 channel signal. The L and R channels are coupled and downmixed to obtain the M1 and S1 channels, and the LS and RS channels are coupled and downmixed to obtain the M2 and S2 channels. Bits(M1) represents the number of bits originally allocated to the M1 channel, Bits(S1) represents the number of bits originally allocated to the S1 channel, Bits(M2) represents the number of bits originally allocated to the M2 channel, Bits(S2) represents the number of bits originally allocated to the S2 channel, and the numbers of bits originally allocated to the channels not involved in the coupling are Bits(C) and Bits(LFE). If a fixed number of bits is allocated to the LFE channel, Available Bits=Bits(M1)+Bits(S1)+Bits(M2)+Bits(S2)+Bits(C); or, if a variable number of bits is allocated to the LFE channel, Number of available bits = Bits(M1) + Bits(S1) + Bits(M2) + Bits(S2) + Bits(C) + Bits(LFE).

[0111]

[0114] The following description will be given using an example in which a fixed number of bits is assigned to the LFE channel.

[0112]

[0115] The number of available bits is expressed as totalBits and the threshold is expressed as frmBitMax. Let allocFlag[5]={0,0,0,0,0}. In this case, if the 5.1 channels are distinguished as M1=0, S1=1, C=2, M2=3, and S2=4, the following steps are performed:

[0116] Step 1: If Bits(i)≦frmBitMax then go to step 5, where allocFlag[i] is further required to be set to 1 if Bits(i)=frmBitMax, 0≦i<5.

[0113]

[0117] Step 2: If Bits(i)>frmBitMax, set allocFlag[i]=1, calculate diffBits=Bits(ch)-frmBitMax, then perform steps 3 through 5.

[0114]

[0118] Step 3: Calculate sumBits = ΣBits(j), 0≦j<5. Bits(j) is not accumulated in sumBits if allocFlag[j]=1.

[0115]

[0119] Step 4: Allocate diffBits for channels with allocFlag[j] ≠ 1. The details are as follows: Bits(j)=Bits(j)+diffBits×Bits(j) / sumBits

[0120] Step 5: If i=4 then the procedure ends; otherwise if i<3 then let i++ and go to step 1.

[0116]

[0121] In some implementations, after step 4 is performed, the following steps may be further performed: Determine whether Bits(j) is greater than or equal to frmBitMax, and if Bits(j) is greater than or equal to frmBitMax, set allocFlag[j] to 1.

[0117]

[0122] Below is another example where a fixed number of bits is allocated to the LFE channel:

[0123] The number of available bits is expressed as totalBits and the threshold as frmBitMax. Let allocFlag[6]={0,0,0,0,0,0,0}. In this case, if the 5.1 channels are distinguished as M1=0, S1=1, C=2, M2=3, S2=4, and LFE=5, the following steps are performed:

[0124] Step 1: If Bits(i)≦frmBitMax then go to step 5, where allocFlag[i] is further required to be set to 1 if Bits(i)=frmBitMax, 0≦i≦6.

[0118]

[0125] Step 2: If Bits(i)>frmBitMax, set allocFlag[i]=1, calculate diffBits=Bits(ch)-frmBitMax, then perform steps 3 through 5.

[0119]

[0126] Step 3: Calculate sumBits = ΣBits(j), 0≦j<4. Bits(j) is not accumulated in sumBits if allocFlag[j]=1.

[0120]

[0127] Step 4: Allocate diffBits for channels with allocFlag[j] ≠ 1. The details are as follows: Bits(j)=Bits(j)+diffBits×Bits(j) / sumBits

[0128] Step 5: If i=4 then the procedure ends; otherwise if i<3 then let i++ and go to step 1.

[0121]

[0129] In some implementations, after step 4 is performed, the following steps may be further performed: Determine whether Bits(j) is greater than or equal to frmBitMax, and if Bits(j) is greater than or equal to frmBitMax, set allocFlag[j] to 1.

[0122]

[0130] Step S103: Encode the P channel audio signals based on the bit numbers of each of the K channel pairs to obtain an encoded bitstream.

[0123]

[0131] The number of bits may be the number of bits originally allocated or may be an updated number of bits.

[0124]

[0132] Encoding the P channel audio signals may include performing quantization, entropy coding, and bitstream multiplexing on the P channel audio signals to obtain an encoded bitstream.

[0125]

[0133] If P=2K, quantization, entropy coding, and bitstream multiplexing are performed on the P-channel audio signal based on the number of bits of each of the K channel pairs to obtain a coded bitstream.

[0126]

[0134] Where P=2×K+Q, quantization, entropy coding, and bitstream multiplexing are performed on the P-channel audio signal based on the number of bits for each of the K channel pairs and the number of bits for each of the Q channels to obtain an encoded bitstream.

[0127]

[0135] In this embodiment, a P channel audio signal in a current frame of a multi-channel audio signal is obtained, where the P channel audio signal includes K channel pair audio signals; a number of bits of each of the K channel pairs is determined based on an energy / amplitude of each of the P channel audio signals and an available number of bits; and the P channel audio signal is encoded based on the number of bits of each of the K channel pairs to obtain an encoded bitstream. The energy / amplitude of one channel audio signal among the P channels includes at least one of: an energy / amplitude of the one channel audio signal in a time domain, an energy / amplitude of the one channel audio signal after a time-frequency transform, an energy / amplitude of the one channel audio signal after a time-frequency transform and whitening, an energy / amplitude of the one channel audio signal after energy / amplitude equalization, or an energy / amplitude of the one channel audio signal after stereo processing. The bits are allocated to the channel pairs based on at least one of the following: the energy / amplitude of each of the P channel audio signals in the time domain, the energy / amplitude of each of the P channel audio signals after time-frequency transformation, the energy / amplitude of each of the P channel audio signals after time-frequency transformation and whitening, the energy / amplitude of each of the P channel audio signals after energy / amplitude equalization, or the energy / amplitude of each of the P channel audio signals after stereo processing, to determine the number of bits of each of the K channel pairs. In this way, the number of bits of the channel pairs in the multi-channel signal coding is appropriately allocated to ensure the quality of the audio signal reconstructed by the decoder side. For example, when the energy / amplitude difference between the channel pairs is relatively large, the method in this embodiment of the present application is used to solve the problem that it is insufficient to code the bits of the channel pairs with larger energy / larger amplitude, and the quality of the audio signal reconstructed at the decoder side can be guaranteed.

[0128]

[0136] 3 is a flowchart of a multi-channel audio signal encoding method according to an embodiment of the present application. This embodiment of the present application may be implemented by the above-mentioned encoder. As shown in FIG. 3, the method in this embodiment may include the following steps:

[0129]

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

[0130]

[0138] For a specific description of step 201, please refer to step 101 in the embodiment shown in Figure 2. The details will not be described again here.

[0131]

[0139] Step 202: Determine the number of bits for each of the K channel pairs based on the energy / amplitude of each of the P channel audio signals and the number of available bits.

[0132]

[0140] 1 Bit allocation is performed based on the energy / amplitude of each of the P channel audio signals and the number of available bits.

[0133]

[0141] According to the method in this embodiment of the present application, where P=2×K, the number of bits for each of the K channel pairs can be determined based on the energy / amplitude of each of the P channel audio signals and the number of available bits.

[0134]

[0142] Where P=2×K+Q, in one bit allocation process, according to the method in this embodiment of the present application, the number of bits for each of the K channel pairs and the number of bits for each of the Q channels can be determined based on the energy / amplitude of each of the P channel audio signals and the number of available bits.

[0135]

[0143] Regardless of whether P=2K or P=2×K+Q, for the explanation of determining the number of bits for each of the K channel pairs and the number of bits for each of the Q channels in step 202, please refer to step 102 of the embodiment shown in Figure 1. The details will not be described again here.

[0136]

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

[0137]

[0145] The current channel pair in the K channel pairs is used as an example. Based on the bit number of the current channel pair in the K channel pairs and the energy / amplitude of each of the audio signals of the two channels in the current channel pair after stereo processing, a 2-bit allocation is performed for the current channel pair. The 2-bit allocation is to allocate the bit number of the two channels of the current channel pair, i.e., the bits in the basic unit are allocated to the basic unit corresponding to the coupled channel based on the energy / amplitude ratio of each 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. The 2-bit allocation in this case is to allocate the bit number of the two channels in the channel pair, i.e., to allocate the bit number corresponding to the two channels in the channel pair.

[0138]

[0146] Regardless of whether P=2K or P=2×K+Q, bits are assigned to the channel pair in the manner described in step 203 above, and the number of bits for each of the two channels in the channel pair can be obtained.

[0139]

[0147] Step 204: Encode the audio signals of the two channels of the current channel pair based on the number of bits of each of the two channels to obtain an encoded bitstream.

[0140]

[0148] Encoding the audio signals of the two channels in the current channel pair may include: performing quantization, entropy coding, and bitstream multiplexing on the audio signals of the two channels in the current channel pair separately to obtain an encoded bitstream.

[0141]

[0149] If P=2K, quantization, entropy coding, and bitstream multiplexing are performed separately on the P-channel audio signal based on the number of bits for each of the K channel pairs to obtain a coded bitstream.

[0142]

[0150] Where P=2×K+Q, quantization, entropy coding, and bitstream multiplexing are performed separately on the K channel-pair audio signal based on the number of bits for each of the K channel pairs, and quantization, entropy coding, and bitstream multiplexing are performed separately on the Q channel audio signal based on the number of bits for each of the Q channels to obtain a coded bitstream.

[0143]

[0151] In this embodiment, a P-channel audio signal in a current frame of a multi-channel audio signal is obtained, where the P-channel audio signal includes K-channel pair audio signals; a number of bits of each of the K channel pairs is determined based on an energy / amplitude of each of the P-channel audio signals and an available number of bits; a number of bits of each of two channels of the current channel pair in the K channel pairs is determined based on the number of bits of each of the K channel pairs, the number of bits of the current channel pair, and an energy / amplitude of each of the two-channel audio signals in the current channel pair after stereo processing; and the two-channel audio signals are separately encoded based on the number of bits of each of the two channels in the current channel pair to obtain an encoded bitstream. Bits are allocated to the channel pairs based on at least one of the energy / amplitude of each of the P channel audio signals in the time domain, the energy / amplitude of each of the P channel audio signals after time-frequency transformation, the energy / amplitude of each of the P channel audio signals after time-frequency transformation and whitening, the energy / amplitude of each of the P channel audio signals after energy / amplitude equalization, or the energy / amplitude of each of the P channel audio signals after stereo processing to determine the number of bits of each of the K channel pairs. Then, the bits in the channel pairs are allocated based on the number of bits of each of the K channel pairs. In this way, the number of bits of the channels in the multi-channel signal coding is appropriately allocated to ensure the quality of the audio signal reconstructed by the decoder side. For example, when the energy / amplitude difference between the channel pairs is relatively large, the method in this embodiment of the present application is used to solve the problem that it is insufficient to code the bits of the signal of the channel pair having a larger energy / larger amplitude, and the quality of the audio signal reconstructed at the decoder side can be guaranteed.

[0144]

[0152] 4 is a flowchart of a channel pair bit allocation method according to an embodiment of the present application. This embodiment of the present application may be performed by the above-mentioned encoder. This embodiment is a specific implementation of step 102 in the embodiment shown in FIG. 2. As shown in FIG. 4, the method in this embodiment may include the following steps:

[0145]

[0153] Step 1021: A total energy / amplitude of the current frame is determined based on the energies / amplitudes of each of the P channel audio signals.

[0146]

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

[0147]

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

[0148]

[0156] Method 1: The energy / amplitude sum of the current frame is determined based on the energy / amplitude of each of the P channels of the audio signal after stereo processing. The energy / amplitude sum of the current frame is calculated by the energy / amplitude sum of the stereo processing sum_E pos may be also possible.

[0149]

[0157] For example, the sum of energy / amplitude after stereo processing: sum_E pos may be determined according to the following equations (1) and (2):

[0150]

number

[0151]

[0158] That is, the total energy / amplitude of the current frame can be determined by method 1 described above, and then the subsequent steps 1022 and 1023 are performed to complete the one bit allocation described above.

[0152]

[0159] Method 2: Determine the energy / amplitude sum of the current frame based on the energy / amplitude of each of the P channels of the audio signal before energy / amplitude equalization. The energy / amplitude sum is the energy / amplitude sum before energy / amplitude equalization, sum_E pre may be also possible.

[0153]

[0160] For example, the sum of energy / amplitude before energy / amplitude equalization, sum_E pre may be determined according to the following equations (3) and (4):

[0154]

number

[0155]

[0161] That is, the total energy / amplitude of the current frame can be determined by method 2 described above, and then the subsequent steps 1022 and 1023 are performed to complete the one bit allocation described above.

[0156]

[0162] Method 3: Determine the energy / amplitude sum of the current frame based on the energy / amplitude of each of the P channel audio signals before energy / amplitude equalization and the weighting factor of each of the P channels. The weighting factor of any one of the P channels is less than or equal to 1. The energy / amplitude sum is the energy / amplitude sum before energy / amplitude equalization sum_E pre may be also possible.

[0157]

[0163] For example, the sum of energy / amplitude before energy / amplitude equalization, sum_E pre may be determined according to the following equation (5):

[0158]

number

[0159]

[0164] In the implementation, if a channel with channel index ch is not involved in coupling, α(ch) is 1. If a channel with channel index ch is involved in coupling, a channel with channel index ch1 (hereinafter, abbreviated as ch1), a channel with channel index ch2 (hereinafter, abbreviated as ch2), a channel with channel index ch3 (hereinafter, abbreviated as ch3), and a channel with channel index ch4 (hereinafter, abbreviated as ch4) are used as an example, where ch1 and ch2 are coupled, and ch3 and ch4 are coupled. In this case, α(ch1) and α(ch2) are equal and both less than 1, and α(ch3) and α(ch4) are equal and both less than 1. α(ch1) and α(ch2) may be determined based on the normalized correlation value Corr_norm(ch1,ch2) of ch1 and ch2. α(ch3) and α(ch4) may be determined based on the normalized correlation value Corr_norm(ch3,ch4). The values ​​of α(ch3) and α(ch4) having a larger normalized correlation value Corr_norm(ch3,ch4) are smaller than the values ​​of α(ch1) and α(ch2) having a smaller normalized correlation value Corr_norm(ch1,ch2). In other words, α(ch1) and α(ch2) are inversely proportional to the normalized correlation value Corr_norm(ch1,ch2) of ch1 and ch2.

[0160]

[0165] For example, if ch1 and ch2 are coupled, α(ch1) and α(ch2) may be calculated according to the following equation (6):

[0161]

number

[0162]

[0166] The correlation value of two channels may be calculated according to the following equation (7): ch1 and ch2 are used as an example.

[0163]

number

[0164]

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

[0165]

[0168] The correlation values ​​of the two channels of other channel pairs may also be calculated according to Equation (7), and the weighting coefficients of the channels of the channel pairs may be calculated according to Equation (6).

[0166]

[0169] Stereo processing reduces the energy / amplitude sum of the two channels involved in the stereo processing; the reduction value of the energy / amplitude sum of the two channels is related to the similarity between the audio signals of the two channels, i.e., a higher correlation between the audio signals of the two channels indicates a larger reduction value of the energy / amplitude sum of the two channels after stereo processing.

[0167]

[0170] Therefore, when the energy / amplitude before stereo processing is used in 1-bit allocation, the weighting factors are added in 1-bit allocation. The weighting factor of two highly correlated channels is smaller than the weighting factor of two less correlated channels. The weighting factor of a non-coupled channel is larger than the weighting factor of a coupled channel. The weighting factors of two channels of the same pair are the same. Specifically, the energy / amplitude sum can be determined by the above method 3, and then the above 1-bit allocation is completed by performing the following steps 1022 and 1023.

[0168]

[0171] Step 1022: Determine a bit coefficient for each of the K channel pairs based on the energy / amplitude of each of the audio signals of the K channel pairs and the total energy / amplitude of the current frame.

[0169]

[0172] After the energy / amplitude sum is determined in method 1, method 2, or method 3 above, if P=2K, the bit coefficients for each of the K channel pairs may be determined based on the energy / amplitude of each of the audio signals of the K channel pairs and the energy / amplitude sum determined in step 1021 above.

[0170]

[0173] After the energy / amplitude sum is determined by method 1, method 2, or method 3 above, if P=2K+Q, then the bit coefficients for each of the K channel pairs may be determined based on the respective energies / amplitudes of the audio signals of the K channel pairs and the energy / amplitude sum determined in step 1021 above, and the bit coefficients for each of the Q channels may be determined based on the respective energies / amplitudes of the Q channels and the energy / amplitude sum determined in step 1021.

[0171]

[0174] The bit coefficient for each of the K channel pairs may be a ratio of the energy / amplitude of each of the K channel pairs in the energy / amplitude sum determined in step 1021 above. The energy / amplitude of a channel pair may be the sum of the energies / amplitudes of the two channels in the channel pair. The bit coefficient for each of the Q uncoupled channels is a ratio of the energy / amplitude of each of the Q channels in the energy / amplitude sum determined in step 1021 above.

[0172]

[0175] Step 1023: Determine the number of bits of each of the K channel pairs based on the bit coefficient of each of the K channel pairs and the number of available bits.

[0173]

[0176] If P=2K, the number of bits for each of the K channel pairs may be determined based on the bit factor for each of the K channel pairs and the number of available bits.

[0174]

[0177] If P=2×K+Q, the number of bits for each of the K channel pairs may be determined based on the bit coefficients of each of the K channel pairs and the number of available bits, and the number of bits for each of the Q channels may be determined based on the bit coefficients of each of the Q channels and the number of available bits.

[0175]

[0178] In this embodiment, a P-channel audio signal in a current frame of a multi-channel audio signal is obtained, where the P-channel audio signal includes K-channel pair audio signals. A total energy / amplitude of the current frame is determined based on the respective energies / amplitudes of the P-channel audio signals. A bit coefficient of each of the K-channel pairs is determined based on the respective energies / amplitudes of the K-channel pair audio signals and the energy / amplitude of the current frame. A number of bits of each of the K-channel pairs is determined based on the respective bit coefficients of the K-channel pairs and the number of available bits. The P-channel audio signals are encoded based on the respective number of bits of the K-channel pairs to obtain an encoded bitstream. The energy / amplitude sum of the current frame is determined based on at least one of the energy / amplitude of each of the P channel audio signals in the time domain, the energy / amplitude of each of the P channel audio signals after time-frequency transformation, the energy / amplitude of each of the P channel audio signals after time-frequency transformation and whitening, the energy / amplitude of each of the P channel audio signals after energy / amplitude equalization, or the energy / amplitude of each of the P channel audio signals after stereo processing. To determine the number of bits of each of the K channel pairs, bits are allocated to the channel pairs based on the ratio of the energy / amplitude of each of the audio signals of the channel pairs in the energy / amplitude sum. In this way, the number of bits of the channel pairs in the multi-channel signal coding is appropriately allocated to ensure the quality of the audio signal reconstructed by the decoder side. For example, when the energy / amplitude difference between the channel pairs is relatively large, the method in this embodiment of the present application is used to solve the problem that it is insufficient to code the bits of the channel pairs with larger energy / larger amplitude, and the quality of the audio signal reconstructed at the decoder side can be guaranteed.

[0176]

[0179] In the following embodiment, a 5.1 channel signal is used as an example to describe an example of a multi-channel audio signal encoding method in the embodiment of the present application.

[0177]

[0180] Fig. 5 is a schematic diagram of the processing procedure of the encoder side according to an embodiment of the present application. As shown in Fig. 5, the encoder side may include a multi-channel encoding processing unit 401, a channel encoding unit 402, and a bitstream multiplexing interface 403. The encoder side may be the aforementioned encoder.

[0178]

[0181] The multi-channel encoding processing unit 401 is configured to perform multi-channel signal screening, coupling, stereo processing, and multi-channel side information generation on an input signal, which in this embodiment is a 5.1 channel signal (specifically including an L channel, an R channel, a C channel, an LFE channel, a LS channel, and an RS channel).

[0179]

[0182] For example, the multi-channel encoding processing unit 401 combines the L channel signal and the R channel signal to form a first channel pair, performs stereo processing on the first channel pair to obtain a middle channel M1 channel signal and a side channel S1 channel signal, combines the LS channel signal and the RS channel signal to form a second channel pair, and performs stereo processing on the second channel pair to obtain a middle channel M2 channel signal and a side channel S2 channel signal.

[0180]

[0183] Due to the relatively large energy / amplitude difference between multiple channels, before stereo processing is performed, energy / amplitude equalization is performed on multiple channels to increase the stereo processing gain, i.e., concentrate the energy / amplitude on the middle channel, and help the channel coding unit improve the coding efficiency. In this embodiment of the present application, equalization is performed on the coupled channels to obtain the energy / amplitude tradeoff between channels. Assume that the energies / amplitudes of the current frame of the input channels before energy / amplitude equalization are energy_L, energy_R, energy_C, energy_LS, and energy_RS. energy_L represents the energy / amplitude of the L channel signal before energy / amplitude equalization, energy_R represents the energy / amplitude of the R channel signal before energy / amplitude equalization, energy_C represents the energy / amplitude of the C channel signal before energy / amplitude equalization, energy_LS represents the energy / amplitude of the LS channel signal before energy / amplitude equalization, and energy_RS represents the energy / amplitude of the RS channel signal before energy / amplitude equalization.

[0181]

[0184] The energy / amplitude of each of the L and R channels in the first channel pair after energy / amplitude equalization is energy_avg_LR, which may be calculated according to the following equation (8): energy_avg_LR=avg(energy_L,energy_R) (8)

[0185] The energy / amplitude of each of the LS and RS channels in the second channel pair after energy / amplitude equalization is energy_avg_LSRS, which may be calculated according to the following equation (9): energy_avg_LSRS=avg(energy_LS,energy_RS) (9) Here, the avg(a1,a2) function performs averaging of two input parameters a1 and a2. a1 may be set to energy_L and a2 to energy_R. a1 may be set to energy_LS and a2 to energy_RS.

[0182]

[0186] The formula for calculating the energy / amplitude energy of a channel (ch) before energy / amplitude equalization (including energy_L, energy_R, energy_C, energy_LS, and energy_RS) is as follows:

[0183]

number

[0184]

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

[0185]

[0188] The multi-channel encoding processing unit 401 outputs an M1 channel signal, an S1 channel signal, an M2 channel signal, and an S2 channel signal on which stereo processing is performed, an LFE channel signal and a C channel signal on which stereo processing is not performed, and multi-channel side information.

[0186]

[0189] The channel encoding unit 402 is configured to encode the M1, S1, M2, and S2 channel signals on which stereo processing is performed, the LFE and C channel signals on which stereo processing is not performed, and multi-channel side information, and output encoded channels E1 to E6. The channel encoding unit 402 may include multiple processing boxes, which allocate more bits to channels with larger energy / amplitude than channels with smaller energy / amplitude. The channel encoding unit 402 performs quantization and entropy coding to remove redundancy from the encoder side, and then sends the encoded channels E1 to E6 to the bitstream multiplexing interface 403.

[0187]

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

[0188]

[0191] Fig. 6 is a schematic diagram of the processing procedure of a channel encoding unit according to an embodiment of the present application. As shown in Fig. 6, the channel encoding unit 402 may include a bit allocation unit 4021 and a quantization and entropy coding unit 4023. This embodiment is described by using the above-mentioned method 1 as an example.

[0189]

[0192] The bit allocation unit 4021 is configured to perform 1-bit allocation and 2-bit allocation in the above embodiments to obtain the number of bits of the channel.

[0190]

[0193] For example, the bit allocation unit 4021 calculates the post-stereo processing energy / amplitude sum sum_E post Then, bit coefficients of the channel pair and bit coefficients of the uncoupled channels are determined according to the following Equations (11) to (14). In this embodiment, the bit coefficients of the first channel pair are represented by Ratio(L,R), the bit coefficients of the second channel pair are represented by Ratio(LS,RS), the bit coefficients of the uncoupled C channel are represented by Ratio(C), and the bit coefficients of the uncoupled LFE channel are represented by Ratio(LFE): Ratio(L,R)=(E post (M1)+E post (S1)) / sum_E post (11) Ratio(LS,RS) = (E post (M2)+E post (S2)) / sum_E post (12) Ratio(C)=E post (C) / sum_E post (13) Ratio(LFE)=E post (LFE) / sum_E post (14)

[0194] The bit allocation unit calculates the Ratio(L,R), Ratio(LS,RS), Ratio(C), Ratio (LFE), the number of available bits bAvail, the channel pair indices pairIdx1, pairIdx2, and the energy / amplitude of the channels after stereo processing E postThe number of bits of the channel is obtained by calculation based on (ch). The channel pair indexes pairIdx1 and pairIdx2 may be output by the multi-channel encoding processing unit 401. The channel pair index pairIdx1 is used to indicate that the L channel and the R channel are coupled, and the channel pair index pairIdx2 is used to indicate that the LS channel and the RS channel group are coupled.

[0191]

[0195] For example, the number of bits of a channel may be determined according to the following Equations (15) to (22).

[0192]

[0196] The bit allocation for the channel pairs is as follows: Bits(M1,S1)=bAvail×Ratio(L,R) (15) Bits(M2,S2)=bAvail×Ratio(LS,RS) (16) Here, Bits(M1,S1) represents the number of bits in the first channel pair, and Bits(M2,S2) represents the number of bits in the second channel pair.

[0193]

[0197] Regarding bit allocation between channels in a channel pair and between channels not involved in coupling, bit allocation between coupled channels is done as follows: Bits(M1) = Bits(M1, S1) × E post (M1) / (E post (M1)+E post (S1)) (17) Bits(S1) = Bits(M1,S1) × E post (S1) / (E post (M1)+E post (S1)) (18) Bits(M2) = Bits(M2,S2) × E post (M2) / (E post (M2)+E post(S2)) (19) Bits(S2) = Bits(M2,S2) × E post (S2) / (E post (M2)+E post (S2)) (20) Here, 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.

[0194]

[0198] The bit allocation for the channels not involved in coupling is as follows: Bits(C)=bAvail×Ratio(C) (21) Bits(LFE)=bAvail×Ratio(LFE) (22) Here, Bits(C) represents the number of bits for the C channel, and Bits(LFE) represents the number of bits for the LFE channel.

[0195]

[0199] The quantization and entropy coding unit 4023 performs quantization and entropy coding on the M1 channel signal, the S1 channel signal, the M2 channel signal, and the S2 channel signal on which stereo processing is performed, the C channel signal, the LFE channel signal, and the multi-channel side information based on the channel bit number, to obtain an encoded channel E1 signal to an encoded channel E6 signal.

[0196]

[0200] In this embodiment, the energy / amplitude equalization is performed on two channels of a channel pair by using the channel pair as the granularity. Due to the different energy / amplitude ratios of the channel pair before stereo processing, the energy / amplitude ratios of the channel pair after stereo processing are also different; then, the bit allocation between the channel pairs is performed based on the energy / amplitude ratios of the channel pair after stereo processing; finally, the bits are allocated within the channel pair. In this way, the number of bits of the channels in the multi-channel signal coding can be appropriately allocated to ensure the quality of the audio signal reconstructed by the decoder side. For example, when the energy / amplitude difference between the channel pairs is relatively large, the method of this embodiment of the present application can be used to solve the problem that it is insufficient to code the bits of the signal of the channel pair with larger energy / larger amplitude, and the quality of the audio signal reconstructed by the decoder side can be guaranteed.

[0197]

[0201] In addition to the specific implementation of the energy / amplitude equalization of the multi-channel encoding processing unit 401 in the embodiment shown in Figure 5, this embodiment of the present application further provides another energy / amplitude equalization method. The aforementioned signal of 5.1 channel is used as an example for further description.

[0198]

[0202] The energy / amplitude of each channel after energy / amplitude equalization is energy_avg. The value of energy_avg may be determined according to the following equation (23): energy_avg=avg(energy_L,energy_R,energy_C,energy_LS,energy_RS) (23) Here, the Avg(a1,a2,...,an) function performs averaging over the input parameters a1,a2,...,an.

[0199]

[0203] Fig. 7 is a schematic diagram of the processing procedure of a channel encoding unit according to an embodiment of the present application. As shown in Fig. 7, the channel encoding unit 402 may include: a bit allocation unit 4021, a quantization and entropy coding unit 4023, and a bit calculation unit 4022. This embodiment is described by using the above-mentioned method 2 as an example.

[0200]

[0204] The bit allocation unit 4021 is configured to perform 1-bit allocation and 2-bit allocation in the above embodiments to obtain the number of bits of the channel.

[0201]

[0205] For example, the bit calculation unit 4022 determines the total energy / amplitude before energy / amplitude equalization according to the above-mentioned Equation (3) and Equation (4). Then, the bit coefficients of the channel pair and the bit coefficients of the uncoupled channels are determined according to the following Equations (24) to (27). In this embodiment, the bit coefficients of the first channel pair are represented by Ratio(L,R), the bit coefficients of the second channel pair are represented by Ratio(LS,RS), the bit coefficients of the uncoupled C channel are represented by Ratio(C), and the bit coefficients of the uncoupled LFE channel are represented by Ratio(LFE): Ratio(L,R)=(E pre (L)+E pre (R)) / sum_E pre (twenty four) Ratio(LS,RS) = (E pre (LS)+E pre (RS)) / sum_E pre (twenty five) Ratio(C)=E pre (C) / sum_E pre (26) Ratio(LFE)=E pre (LFE) / sum_E pre (27)

[0206] The bit allocation unit 4022 receives Ratio(L,R), Ratio(LS,RS), Ratio(C), Ratio (LFE), the number of available bits bAvail, the channel pair indices pairIdx1, pairIdx2, and the energy / amplitude of the channels after stereo processing E post The number of bits of the channel is obtained by calculation based on (ch). The channel pair indexes pairIdx1 and pairIdx2 may be output by the multi-channel encoding processing unit 401. The channel pair index pairIdx1 is used to indicate that the L channel and the R channel are coupled, and the channel pair index pairIdx2 is used to indicate that the LS channel and the RS channel group are coupled.

[0202]

[0207] For example, the number of bits of the channel may be determined based on the number of bits determined in the above equations (24) through (27) and according to the above equations (15) through (22).

[0203]

[0208] The quantization and entropy coding unit 4023 performs quantization and entropy coding on the M1 channel signal, the S1 channel signal, the M2 channel signal, and the S2 channel signal on which stereo processing is performed, the C channel signal, the LFE channel signal, and the multi-channel side information based on the channel bit number, to obtain an encoded channel E1 signal to an encoded channel E6 signal.

[0204]

[0209] In this embodiment, the stereo processing is performed after the energy / amplitude equalization is performed on all channels. Although the energy / amplitude ratios of the channels are similar after the stereo processing, in this embodiment of the present application, after the stereo processing, the bit allocation between the channel pairs is performed based on the energy / amplitude ratios of the channel pairs before the stereo processing, and then the bits in the channel pairs are allocated based on the energy / amplitude after the stereo processing. The bit allocation between the channel pairs is guided based on the energy / amplitude ratios of the channel pairs before the stereo processing. Due to the different energy / amplitude ratios of the channel pairs before the stereo processing, the bit allocation between the channel pairs is performed based on the different energy / amplitude ratios. In this way, the number of bits of the channels in the multi-channel signal coding can be appropriately allocated, and the quality of the audio signal reconstructed by the decoder side can be guaranteed. For example, when the energy / amplitude difference between the channel pairs is relatively large, the method in this embodiment of the present application can be used to solve the problem that it is insufficient to code the bits of the signal of the channel pair with larger energy / larger amplitude, and the quality of the audio signal reconstructed at the decoder side can be guaranteed.

[0205]

[0210] In some embodiments, the channel encoding unit 402 may include a bit allocation unit 4021, a quantization and entropy encoding unit 4023, and a bit calculation unit 4022, and may be configured to implement the functions of the steps of method 3.

[0206]

[0211] The bit allocation unit 4021 is configured to perform 1-bit allocation and 2-bit allocation in the above embodiments to obtain the number of bits of the channel.

[0207]

[0212] For example, the bit allocation unit 4021 may use the above-mentioned Equations (5) to (7) to obtain the sum of energy / amplitude before energy / amplitude equalization sum_E preThen, bit coefficients of the channel pair and bit coefficients of the uncoupled channels are determined according to the following Equations (28) to (31). In this embodiment, the bit coefficients of the first channel pair are represented by Ratio(L,R), the bit coefficients of the second channel pair are represented by Ratio(LS,RS), the bit coefficients of the uncoupled C channel are represented by Ratio(C), and the bit coefficients of the uncoupled LFE channel are represented by Ratio(LFE):

[0208]

number

[0209]

[0213] For example, the number of bits of the channel may be determined based on the number of bits determined in the above equations (28) through (31) and according to the above equations (15) through (22).

[0210]

[0214] The quantization and entropy coding unit performs quantization and entropy coding on the M1 channel signal, the S1 channel signal, the M2 channel signal, and the S2 channel signal on which stereo processing is performed, the C channel signal, the LFE channel signal, and the multi-channel side information based on the channel bit numbers, to obtain coded channel E1 signal to coded channel E6 signal.

[0211]

[0215] In this embodiment, the bit allocation is adjusted based on the weighting factor, so that the number of bits of the channels in the multi-channel signal coding can be appropriately allocated, and the quality of the audio signal reconstructed by the decoder side can be guaranteed.

[0212]

[0216] 8 is a flowchart of a multi-channel audio signal encoding method according to an embodiment of the present application. This embodiment of the present application may be implemented by the above-mentioned encoder. As shown in FIG. 8, the method in this embodiment may include the following steps:

[0213]

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

[0214]

[0218] A channel pair contains two channels of audio signals.

[0215]

[0219] A channel pair in this embodiment of the present application can be any one of the K channel pairs. An audio signal of two coupled channels is an audio signal of a channel pair.

[0216]

[0220] In some implementations, P=2K. After multi-channel signal screening, coupling, stereo processing, and multi-channel side information generation, a P-channel audio signal, i.e., K-channel pair audio signals, may be obtained.

[0217]

[0221] In some embodiments, the P channel audio signals further include Q uncoupled channel audio signals, where P=2×K+Q, K is a positive integer, and Q is a positive integer.

[0218]

[0222] For a specific description of step 501, please refer to step 101 in the embodiment shown in Figure 2. The details will not be described again here.

[0219]

[0223] Step 502: Based on the energy / amplitude of each of the two-channel audio signals in the current channel pair, perform energy / amplitude equalization on the two-channel audio signals in the current channel pair of the K channel pairs to obtain the energy / amplitude of each of the two-channel audio signals in the current channel pair after energy / amplitude equalization.

[0220]

[0224] In this embodiment of the present application, the energy / amplitude equalization is performed for a channel pair, i.e., the energy / amplitude equalization within a channel pair is performed for a channel pair. The current channel pair of the K channel pairs is used as an example. The energy / amplitude equalization is performed for the audio signals of the two channels in the current channel pair among the K channel pairs based on the respective energy / amplitude of the audio signals of the two channels in the current channel pair, and the energy / amplitude of each of the two channels in the current channel pair is obtained after the energy / amplitude equalization.

[0221]

[0225] Regardless of whether P=2K or P=2×K+Q, energy / amplitude equalization is performed within the channel pair in the manner in step 502 to obtain the energy / amplitude of each of the two channels in the current channel pair after energy / amplitude equalization.

[0222]

[0226] For example, the energies / amplitudes of the two channels in the current channel pair after energy / amplitude equalization may be determined according to the above-mentioned Equation (8). Specifically, L and R in Equation (8) are replaced with the two channels in the current channel pair.

[0223]

[0227] Step 503: Determine the number of bits for each of the two channels in the current channel pair based on the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization and the number of available bits.

[0224]

[0228] The current channel pair among the K channel pairs is used as an example. The number of bits of each of the two channels in the current channel pair is determined based on the energy / amplitude of each of the two channels in the current channel pair after energy / amplitude equalization and the number of available bits. The current channel pair can be any one of the K channel pairs.

[0225]

[0229] In the method of this embodiment of the present application, when P=2×K, the total energy / amplitude of the current frame may be determined based on the energy / amplitude of the audio signals of the two channels in each of the K channel pairs after energy / amplitude equalization, and the number of bits of each of the two channels in the current channel pair is determined based on the total energy / amplitude of the current frame, the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization, and the number of available bits.

[0226]

[0230] For example, the number of bits for each of the two channels in the current channel pair is determined based on the ratio of the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization in the energy / amplitude sum and the number of available bits.

[0227]

[0231] In the method of this embodiment of the present application, where P=2×K+Q, the energy / amplitude sum of the current frame can be determined based on the energy / amplitude of the two channels of each of the K channel pairs after energy / amplitude equalization and the energy / amplitude of the audio signal of the Q channels after energy / amplitude equalization. The number of bits of each of the two channels in the current channel pair is determined based on the energy / amplitude sum, the energy / amplitude of each of the audio signals of the two channels of the current channel pair, and the number of available bits. The number of bits of each of the Q channels is determined based on the energy / amplitude sum, the energy / amplitude of each of the audio signals of the Q channels after energy / amplitude equalization, and the number of available bits.

[0228]

[0232] For example, the number of bits for the two channels in the current channel pair is determined based on the ratio of the respective energy / amplitudes of the audio signals of the two channels in the current channel pair in the energy / amplitude sum and the number of available bits, and the number of bits for each of the Q channels is determined based on the ratio of the respective energy / amplitudes of the audio signals of the Q channels after energy / amplitude equalization in the energy / amplitude sum and the number of available bits.

[0229]

[0233] The energy / amplitude of each of the Q channel audio signals after the energy / amplitude equalization may be equal to the energy / amplitude of each of the Q channel audio signals before the energy / amplitude equalization and approximately equal to the energy / amplitude of each of the Q channel audio signals after stereo processing. The energy / amplitude of each of the two channel audio signals of the K channel pairs after the energy / amplitude equalization may be approximately equal to the energy / amplitude of each of the two channel audio signals of the K channel pairs after stereo processing.

[0230]

[0234] For example, the total energy / amplitude may be determined according to the above-mentioned equation (1), specifically, the energy / amplitude after stereo processing in equation (1) is replaced in this embodiment by the energy / amplitude of each channel after energy / amplitude equalization.

[0231]

[0235] Step 504: Encode the audio signals of the two channels in the current channel pair based on the number of bits of each of the two channels to obtain an encoded bitstream.

[0232]

[0236] Encoding the two-channel audio signals in the current channel pair may include performing quantization, entropy coding, and bitstream multiplexing on the two-channel audio signals in the current channel pair separately to obtain an encoded bitstream.

[0233]

[0237] If P=2K, quantization, entropy coding, and bitstream multiplexing are performed separately on the P-channel audio signal based on the number of bits of each of the K channel pairs to obtain a coded bitstream.

[0234]

[0238] Where P=2×K+Q, quantization, entropy coding, and bitstream multiplexing are performed separately on the K channel-pair audio signal based on the number of bits for each of the K channel pairs; and quantization, entropy coding, and bitstream multiplexing are performed separately on the Q channel audio signal based on the number of bits for each of the Q channels to obtain an encoded bitstream.

[0235]

[0239] In this embodiment, audio signals of P channels in a current frame of a multi-channel audio signal are obtained, and the audio signals of P channels include audio signals of K channel pairs. Based on the energy / amplitude of each of the audio signals of the two channels in the current channel pair, energy / amplitude equalization is performed on the audio signals of the two channels in the current channel pair of the K channel pairs to obtain the energy / amplitude of the two channels in the current channel pair after the energy / amplitude equalization. The number of bits of each of the two channels in the current channel pair is determined based on the energy / amplitude of each of the two channels in the current channel pair after the energy / amplitude equalization and the number of available bits. The audio signals of the two channels in the current channel pair are encoded based on the number of bits of each of the two channels to obtain an encoded bitstream. After the energy / amplitude equalization in the channel pair, the bits are allocated based on the energy / amplitude after the energy / amplitude equalization. In this way, the number of bits of the channels in the multi-channel signal coding can be appropriately allocated, and the quality of the audio signal reconstructed by the decoder side can be guaranteed. For example, when the energy / amplitude difference between a channel pair is relatively large, the method in this embodiment of the present application is used to solve the problem that encoding the bits of the signal of the channel pair with larger energy / larger amplitude is insufficient, and the quality of the reconstructed audio signal at the decoder side can be guaranteed.

[0236]

[0240] The embodiments shown in FIGS. 5 and 6 are used as examples to explain the embodiment shown in FIG.

[0237]

[0241] The multi-channel encoding processing unit 401 in the embodiment shown in Fig. 5 is capable of performing step 501 and step 502 in the embodiment shown in Fig. 8, and the channel encoding unit 402 is capable of performing step 503 in the embodiment shown in Fig. 8. In the embodiment shown in Fig. 8, when the channel encoding unit 402 is capable of performing step 503, the difference from the embodiments shown in Fig. 5 and Fig. 6 is that the bit allocation unit 4021 can determine the number of bits of a channel in the following manner:

[0238]

[0242] The bit allocation unit 4021 in this embodiment of the present application can perform bit allocation based on the energy / amplitude of each of the P channels after energy / amplitude equalization. Specifically, the number of bits of a channel may be determined by using the following Equations (32) to (37): Bits(M1) = bAvail × E post (M1) / sum_E post (32) Bits(S1) = bAvail × E post (S1) / sum_E post (33) Bits(M2) = bAvail × E post (M2) / sum_E post (34) Bits(S2) = bAvail × E post (S2) / sum_E post (35) Bits(C) = bAvail × E post (C) / sum_E post (36) Bits(LFE)=bAvail×E post (LFE) / sum_E post (37)

[0243] When the bits are allocated according to Equations (32) to (37), the multi-channel encoding processing unit 401 needs to use a channel pair energy / amplitude equalization scheme, i.e., energy / amplitude equalization within a channel pair. post may be determined according to equation (1) above.

[0239]

[0244] The energy / amplitude sum of the L and R channels before energy / amplitude equalization is E(L,R). After energy / amplitude equalization, the energy / amplitude sum of the L and R channels does not change and is still E(L,R). After stereo processing is performed on the L and R channels, the energy / amplitude sum of the L and R channels after stereo processing is E post (M1,S1). This is because stereo processing reduces some of the redundancy between the L and R channels, and E post This is because (M1,S1)≈E(L,R). In other words, when the energy / amplitude sum of the L channel and the R channel and E(L,R)>>(much larger) the energy / amplitude sum of the LS channel and the RS channel E(LS,RS), the multi-channel encoding processing unit 401 in the embodiment of the present application and the bit allocation unit 4021 in the present application process: Bits(M1)+Bits(S1), which are allocated based on E(L,R), can be much larger than Bits(M2)+Bits(S2). Thus, bits are allocated based on energy / amplitude between channel pairs.

[0240]

number

[0245] In this embodiment, through the energy / amplitude equalization within a channel pair, bits are allocated based on the energy / amplitude after the energy / amplitude equalization. In this way, the number of bits of the channels in the multi-channel signal coding is appropriately allocated, and the quality of the audio signal reconstructed by the decoder side is ensured. For example, when the energy / amplitude difference between the channel pairs is relatively large, the method in this embodiment of the present application is used to solve the problem that it is insufficient to code the bits of the signal of the channel pair with larger energy / larger amplitude, and the quality of the audio signal reconstructed at the decoder side can be ensured.

[0241]

[0246] Based on the same inventive concept as the aforementioned method, an embodiment of the present application further provides an audio signal encoding device, which can be used in a speech encoder.

[0242]

[0247] 9 is a schematic structural diagram of an audio signal encoding device according to an embodiment of the present application. As shown in FIG. 9, the audio signal encoding device 700 includes: an obtaining module 701, a bit allocation module 702 and an encoding module 703.

[0243]

[0248] The acquisition module 701 is configured to acquire P channel audio signals and respective energies / amplitudes of the P channel audio signals in a current frame of a multi-channel audio signal, where P is a positive integer greater than 1, and the P channel audio signals include K channel pair audio signals, where K is a positive integer.

[0244]

[0249] The bit allocation module 702 is configured to determine the number of bits for each of the K channel pairs based on the energy / amplitude of each of the P channel audio signals and the number of available bits.

[0245]

[0250] The encoding module 703 is configured to encode the P channel audio signal based on the number of bits of each of the K channel pairs to obtain an encoded bitstream.

[0246]

[0251] 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 one channel in a time domain, the energy / amplitude of the audio signal of one channel after a time-frequency transformation, the energy / amplitude of the audio signal of one channel after a time-frequency transformation and whitening, the energy / amplitude of the audio signal of one channel after energy / amplitude equalization, or the energy / amplitude of the audio signal of one channel after stereo processing.

[0247]

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

[0248]

[0253] In some embodiments, the bit allocation module 702 is configured to: determine an energy / amplitude sum of the current frame based on the energies / amplitudes of each of the P channel audio signals; determine a bit coefficient for each of the K channel pairs based on the energies / amplitudes of each of the K channel pairs and the energy / amplitude sum of the current frame; and determine a number of bits for each of the K channel pairs based on the bit coefficients of each of the K channel pairs and the number of available bits.

[0249]

[0254] In some embodiments, the bit allocation module 702 is configured to determine a total energy / amplitude of the current frame based on the energy / amplitude of each of the P channels of the audio signals after stereo processing.

[0250]

[0255] In some embodiments, the bit allocation module calculates the energy / amplitude sum for the current frame sum_E post , the formula

[0251]

number

[0252]

[0256] In some embodiments, the bit allocation module 702 is configured to determine a total energy / amplitude for the current frame based on the energy / amplitude of each of the P channel audio signals before energy / amplitude equalization.

[0253]

[0257] In some embodiments, the bit allocation module 702 calculates the energy / amplitude sum of the current frame, sum_E pre , the formula

[0254]

number

[0255]

[0258] In some embodiments, the bit allocation module 702 is configured to determine a total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels before energy / amplitude equalization and respective weighting factors for the P channels, the weighting factors being less than or equal to 1.

[0256]

[0259] In some embodiments, the bit allocation module 702 calculates the energy / amplitude sum of the current frame, sum_E pre , the formula

[0257]

number

[0258]

[0260] In some embodiments, the P channel audio signals further include Q uncoupled channel audio signals, where P=2×K+Q, K is a positive integer, and Q is a positive integer. The bit allocation module 702 is configured to determine a number of bits for each of the K channel pairs and a number of bits for each of the Q channels based on the energy / amplitude of each of the P channel audio signals and the number of available bits. The encoding module 703 is configured to encode the K channel pair audio signals based on the number of bits for each of the K channel pairs and encode the Q channel audio signals based on the number of bits for each of the Q channels.

[0259]

[0261] In some embodiments, the bit allocation module 702 is configured to perform the steps of: determining an energy / amplitude sum of the current frame based on the energy / amplitude of each of the P channels of the audio signals; determining a bit coefficient for each of the K channel pairs based on the energy / amplitude of each of the K channel pairs of the audio signals and the energy / amplitude sum of the current frame; determining a bit coefficient for each of the Q channels based on the energy / amplitude of each of the Q channels of the audio signals and the energy / amplitude sum of the current frame; determining a number of bits for each of the K channel pairs based on the bit coefficients of each of the K channel pairs and the number of available bits; and determining a number of bits for each of the Q channels based on the bit coefficients of each of the Q channels and the number of available bits.

[0260]

[0262] In some embodiments, the apparatus may further include an energy / amplitude equalization module 704. The energy / amplitude equalization module 704 is configured to obtain an energy / amplitude equalized P-channel audio signal based on the P-channel audio signal. The energy / amplitude of the energy / amplitude equalized one-channel audio signal is obtained by using the energy / amplitude equalized one-channel audio signal.

[0261]

[0263] The encoding module 703 is configured to encode the P channel audio signal after energy / amplitude equalization based on the number of bits of each of the K channel pairs.

[0262]

[0264] It should be noted that the obtaining module 701, the bit allocation module 702 and the encoding module 703 may be used in an audio signal encoding process at the encoder side.

[0263]

[0265] It should be further noted that for the specific implementation process of the obtaining module 701, the bit allocation module 702 and the encoding module 703, please refer to the detailed description in the above method embodiment. For the sake of conciseness of the specification, the details will not be described again here.

[0264]

[0266] An embodiment of the present application further provides another audio signal encoding device, which may use the schematic structure diagram shown in Fig. 9. The audio signal encoding device in this embodiment is configured to perform the method of the embodiment shown in Fig. 8.

[0265]

[0267] In some embodiments, different from the module functionality of the embodiment shown in FIG. 9, in this embodiment, the acquisition module 701 is configured to acquire P channel audio signals in a current frame of a multi-channel audio signal, where P is a positive integer greater than 1, and the P channel audio signals include K channel pair audio signals, and K is a positive integer.

[0266]

[0268] The energy / amplitude equalization module 704 is configured to perform energy / amplitude equalization on the two-channel audio signals in the current channel pair of the K channel pairs based on the energy / amplitude of each of the two-channel audio signals in the current channel pair, to obtain energy / amplitude of each of the two-channel audio signals in the current channel pair after energy / amplitude equalization.

[0267]

[0269] The bit allocation module 702 is configured to determine the number of bits for each of the two channels in the current channel pair based on the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization and the number of available bits.

[0268]

[0270] The encoding module 703 is configured to encode the two-channel audio signal based on the number of bits of each of the two channels in the current channel pair to obtain an encoded bitstream.

[0269]

[0271] In some embodiments, the bit allocation module 702 is configured to: determine a total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels after energy / amplitude equalization; and determine a number of bits for each of the two channels in the current channel pair based on the total energy / amplitude of the current frame, the respective energies / amplitudes of the audio signals of the two channels in the current channel pair after energy / amplitude equalization, and the number of available bits.

[0270]

[0272] In some embodiments, the P channel audio signals further include Q uncoupled channel audio signals, where P=2×K+Q, K is a positive integer, and Q is a positive integer.

[0271]

[0273] The bit allocation module 702 is configured to: determine an energy / amplitude sum of the current frame based on the energy / amplitude of the two-channel audio signals in each of the K channel pairs after energy / amplitude equalization and the energy / amplitude of the Q-channel audio signals after energy / amplitude equalization; determine a number of bits for each of the two channels in the current channel pair based on the energy / amplitude sum of the current frame, the energy / amplitude of each of the two-channel audio signals in the current channel pair, and the number of available bits; and determine a number of bits for each of the Q channels based on the energy / amplitude sum of the current frame, the energy / amplitude of each of the Q-channel audio signals after energy / amplitude equalization, and the number of available bits.

[0272]

[0274] The encoding module 703 is configured to: encode the K channel pairs of audio signals based on the number of bits for each of the K channel pairs, and encode the Q channel audio signals based on the number of bits for each of the Q channels to obtain an encoded bitstream.

[0273]

[0275] It should be noted that the obtaining module 701, the bit allocation module 702, the energy / amplitude equalization module 704, and the encoding module 703 may be used in an audio signal encoding process at the encoder side.

[0274]

[0276] It should be further noted that for the specific implementation process of the acquisition module 701, the bit allocation module 702, the energy / amplitude equalization module 704 and the encoding module 703, please refer to the detailed description of the embodiment of the method shown in Figure 8. For the sake of conciseness of the specification, the details will not be described again here.

[0275]

[0277] Based on the same inventive concept as the above-mentioned method, an embodiment of the present application provides an audio signal encoder, configured to encode an audio signal, for example including an encoder as described in one or more of the above-mentioned embodiments. The audio signal encoding device is configured to perform the encoding to generate a corresponding bitstream.

[0276]

[0278] Based on the same inventive concept as the above-mentioned method, an embodiment of the present application provides a device for encoding an audio signal, for example an audio signal encoding device. As shown in Figure 10, the audio signal encoding device 800 includes: The audio signal encoding device 800 includes a processor 801, a memory 802, and a communication interface 803 (there may be one or more processors 801 in the audio signal encoding device 800, and one processor is used as an example in FIG. 10). In some embodiments of the present application, the processor 801, the memory 802, and the communication interface 803 may be connected via a bus or in another manner. FIG. 10 shows an example in which the processor 801, the memory 802, and the communication interface 803 are connected via a bus.

[0277]

[0279] The memory 802 may include read-only memory and random access memory and may provide instructions and data to the processor 801. A portion of the memory 802 may further include non-volatile random access memory (NVRAM). The memory 802 stores an operating system and processing instructions, executable modules or data structures, a subset thereof, or an extended set thereof. The processing instructions may include various processing instructions for performing various processing operations. The operating system may include various system programs for implementing various basic services and handling hardware-based tasks.

[0278]

[0280] The processor 801 controls the operation of the audio encoding device, and may be referred to as a central processing unit (CPU). In a particular application, the components of the audio encoding device are coupled to each other by using a bus system. In addition to a data bus, the bus system may further include a power bus, a control bus, a status signal bus, etc. However, for clarity of explanation, the various buses are marked as a bus system in the figures.

[0279]

[0281] The methods disclosed in the above-mentioned embodiments of the present application may be applied to or performed by the processor 801. The processor 801 may be an integrated circuit chip and has signal processing capabilities. In the implementation process, the steps in the above-mentioned methods may be performed by a hardware integrated logic circuit in the processor 801 or by using instructions in software form. The processor 801 may be a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The processor 801 may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor, or any conventional processor, etc. The steps of the methods disclosed in relation to the embodiments of the present application may be performed and completed directly by a hardware decoding processor, or may be performed and completed by using a combination of hardware modules and software modules in the decoding processor. The software modules may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 802, and the processor 801, in combination with the hardware of the processor 801, reads the information in the memory 802 to complete the steps of the aforementioned method.

[0280]

[0282] The communication interface 803 may be configured to receive or transmit digital or character information and may be, for example, an input / output interface, pins, or circuitry. For example, the encoded bitstream described above is transmitted via the communication interface 803.

[0281]

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

[0282]

[0284] Based on the same inventive concept as the aforementioned method, an embodiment of the present application provides a computer-readable storage medium storing program code, the program code including instructions used to execute some or all of the steps of the multi-channel audio signal encoding method in one or more of the aforementioned embodiments.

[0283]

[0285] Based on the same inventive concept as the aforementioned method, an embodiment of the present application provides a computer program product, which, when run on a computer, enables the computer to perform some or all of the steps of the multi-channel audio signal encoding method in one or more of the aforementioned embodiments.

[0284]

[0286] The processor mentioned in the above embodiment may be an integrated circuit chip and has signal processing capabilities. In the implementation process, the steps of the above method embodiments can be implemented by hardware integrated logic circuits in the processor or by using 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 another programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The general-purpose processor may be a microprocessor, or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be performed and completed directly by a hardware encoding processor, or may be performed and completed by a combination of hardware and software modules in the encoding processor. The software modules may be located in storage media mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the aforementioned method in combination with the processor's hardware.

[0285]

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

[0286]

[0288] Those skilled in the art will recognize that in combination with the examples described in the embodiments disclosed herein, the units and algorithm steps may be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether a function is implemented using hardware or software depends on the specific application and the design constraints of the technical solution. Those skilled in the art may use various methods to realize the described functions for each specific application, but such implementation should not be considered to go beyond the scope of the present application.

[0287]

[0289] For the purpose of convenience of description, it will be clearly understood by those skilled in the art that for the detailed operation processes of the aforementioned systems, devices or units, please refer to the corresponding processes in the aforementioned method embodiments, and the details will not be described again here.

[0288]

[0290] In the various embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the described device embodiments are merely examples. For example, the division into units is merely a logical division of functions, and may be divided in other ways in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. Furthermore, the illustrated or discussed mutual couplings, direct couplings, or communication connections may be implemented via some interfaces. Indirect couplings or communication connections between devices or units may be implemented in electrical, mechanical, or other forms.

[0289]

[0291] The units described as separate parts may or may not be physically separated, and the parts shown as units may or may not be physical units, and may be located in one place or distributed over multiple network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of the embodiments.

[0290]

[0292] Furthermore, the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

[0291]

[0293] When a function is implemented in the form of a software functional unit and sold or used as an independent product, the function may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application, the part that contributes to the prior art, or any technical solution may be implemented in the form of a software product. The software product is stored in a storage medium and includes some instructions for instructing a computer device (such as a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage medium includes any medium capable of storing program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0292]

[0294] The above description is merely a specific implementation of the present application, and is not intended to limit the scope of protection of the present application. Any modifications or replacements that can be easily understood by those skilled in the art within the technical scope disclosed in the present application shall be included in the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the scope of protection of the claims.

Claims

1. 1. A method for encoding a multi-channel audio signal, comprising: obtaining P channel audio signals in a current frame of a multi-channel audio signal, where P is a positive integer greater than 1, and the P channel audio signals include K channel pair audio signals, where K is a positive integer; obtaining an energy / amplitude and a sum of the energy / amplitude of each of the P channels of the audio signal; determining a number of bits for each of the K channel pairs based on a ratio of an energy / amplitude of each of the P channels of the audio signal to the total energy / amplitude and a number of available bits; encoding the P channel audio signal based on the respective number of bits of the K channel pairs to obtain an encoded bitstream; and the energy / amplitude of the audio signal of one of the P channels is: the energy / amplitude of the audio signal of said one channel in the time domain; the energy / amplitude of the audio signal of said one channel after time-frequency transformation, the energy / amplitude of the audio signal in said one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of said one channel after energy / amplitude equalization, or Energy / amplitude of said audio signal in said one channel after stereo processing At least one of determining a number of bits for each of the K channel pairs based on a ratio of an energy / amplitude of each of the P channels of the audio signal to the total energy / amplitude and a number of available bits, determining the total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; a bit coefficient for each of the K channel pairs being a ratio of the energy / amplitude of each of the audio signals of the K channel pairs to a total energy / amplitude of the current frame; a step of processing a number of bits for each of the K channel pairs as the number of available bits multiplied by the respective bit coefficients for the K channel pairs; The K channel pairs include a current channel pair, and the step of encoding the P channel audio signal based on the respective number of bits of the K channel pairs to obtain an encoded bitstream includes:

11. A method according to claim 10, further comprising: encoding an audio signal of the current channel pair based on a number of bits of the current channel pair, the number of bits of each of the two channels in the current channel pair being the number of bits of the current channel pair multiplied by a first ratio, the first ratio being a ratio of the energy / amplitude of each of the audio signals of the two channels in the current channel pair to a sum of the energy / amplitude of each of the audio signals of the two channels in the current channel pair.

2. 2. The method according to claim 1, wherein the step of encoding the audio signals of the current channel pair based on the number of bits of the current channel pair comprises: determining a number of bits for each of the two channels in the current channel pair based on the number of bits for the current channel pair and the energy / amplitude of each of the audio signals of the two channels in the current channel pair after stereo processing; and encoding the audio signals of the two channels based on the respective numbers of bits of the two channels in the current channel pair; A method comprising:

3. 3. The method according to claim 1, wherein the step of determining the number of bits for each of the K channel pairs based on a ratio of an energy / amplitude of each of the P channels of the audio signal to the total energy / amplitude and on the number of available bits comprises: determining a total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; determining bit coefficients for each of the K channel pairs based on the energy / amplitude of each of the audio signals of the K channel pairs and the total energy / amplitude of the current frame; and determining a number of bits for each of the K channel pairs based on the bit coefficients for each of the K channel pairs and the number of available bits; A method comprising:

4. 4. The method of claim 3, wherein the step of determining the total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels comprises: determining the total energy / amplitude of the current frame based on the energy / amplitude of each of the audio signals of the P channels after stereo processing; A method comprising:

5. 5. The method of claim 4, wherein the step of determining the total energy / amplitude of the current frame based on the energy / amplitude of each of the audio signals of the P channels after stereo processing comprises: The energy / amplitude sum of the current frame, sum_E post , the formula [0018] where ch represents a 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 A method according to claim 1, wherein (ch,i) represents a coefficient of the i-th sample of the current frame of the (ch)-th channel after stereo processing, and N represents the number of coefficients of the current frame and is a positive integer greater than 1.

6. 4. The method of claim 3, wherein the step of determining the total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels comprises: determining the total energy / amplitude of the current frame based on the energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization; The energy / amplitude of the audio signal of one of the P channels before the energy amplitude equalization is: the energy / amplitude of the audio signal of said one channel in the time domain; the energy / amplitude of the audio signal in said one channel after a time-frequency transformation, or Energy / amplitude of the audio signal in one channel after time-frequency transformation and whitening A method comprising:

7. 7. The method of claim 6, wherein the step of determining the total energy / amplitude of the current frame based on the energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization comprises: The energy / amplitude sum of the current frame, sum_E pre , the formula [0019] where ch represents a channel index, and E pre (ch) denotes the energy / amplitude of the audio signal of a channel with channel index ch before energy / amplitude equalization.

8. 4. The method of claim 3, wherein the step of determining the total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels comprises: determining the energy / amplitude sum of the current frame based on the energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization and a weighting factor for each of the P channels, the weighting factor being less than or equal to 1.

9. 9. The method of claim 8, wherein the step of determining the energy / amplitude sum of the current frame based on the energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization and a weighting factor for each of the P channels comprises: The energy / amplitude sum of the current frame, sum_E pre , the formula [0020] where ch represents a channel index, and E pre wherein (ch) represents the energy / amplitude of the (ch)th channel audio signal before energy / amplitude equalization, and α(ch) represents a weighting factor for the (ch)th channel, the weighting factors of two channels in a channel pair being identical, and the values ​​of the weighting factors of the two channels in the channel pair being inversely proportional to a normalized correlation value between the two channels in the channel pair.

10. 10. The method according to claim 1, wherein the P channel audio signals further comprise Q uncoupled channel audio signals, where P=2×K+Q, Q being a positive integer; determining a number of bits for each of the K channel pairs based on a ratio of an energy / amplitude of each of the P channels of the audio signal to the total energy / amplitude and a number of available bits, determining the number of bits for each of the K channel pairs and the number of bits for each of the Q channels based on the respective energy / amplitude of the audio signal of the P channels and the number of available bits; and encoding the P channel audio signal based on the number of bits of each of the K channel pairs comprises: encoding the audio signals of the K channel pairs based on the respective numbers of bits for the K channel pairs and encoding the audio signals of the Q channels based on the respective numbers of bits for the Q channels; A method comprising:

11. 11. The method of claim 10, wherein the step of determining the number of bits for each of the K channel pairs and the number of bits for each of the Q channels based on the respective energy / amplitude of the audio signal of the P channels and the number of available bits comprises: determining the total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; determining bit coefficients for each of the K channel pairs based on the respective energies / amplitudes of the audio signals of the K channel pairs and the energy / amplitude sums of the current frame; determining bit coefficients for each of the Q channels based on the energy / amplitude of each of the audio signals for the Q channels and the energy / amplitude sum of the current frame; determining a number of bits for each of the K channel pairs based on a bit coefficient for each of the K channel pairs and the number of available bits; and determining a number of bits for each of the Q channels based on a bit coefficient for each of the Q channels and the number of available bits; A method comprising:

12. 12. The method according to claim 1, wherein the step of encoding the P-channel audio signal based on the number of bits of each of the K channel pairs comprises: encoding the P channel audio signal after energy / amplitude equalization based on the respective number of bits of the K channel pairs; A method comprising:

13. 1. An apparatus for encoding a multi-channel audio signal, the apparatus comprising: an acquisition module configured to acquire audio signals of P channels and respective energies / amplitudes and sums of energies / amplitudes of the audio signals of the P channels in a 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 audio signals of K channel pairs, where K is a positive integer; a bit allocation module configured to determine a number of bits for each of the K channel pairs based on a ratio of an energy / amplitude of each of the P channels of the audio signal to the total energy / amplitude and a number of available bits; and an encoding module configured to encode the P channel audio signal based on the respective number of bits for the K channel pairs to obtain an encoded bitstream; and the energy / amplitude of the audio signal of one of the P channels is: the energy / amplitude of the audio signal of said one channel in the time domain; the energy / amplitude of the audio signal of said one channel after time-frequency transformation, the energy / amplitude of the audio signal in said one channel after time-frequency transformation and whitening, the energy / amplitude of the audio signal of said one channel after energy / amplitude equalization, or Energy / amplitude of said audio signal in said one channel after stereo processing At least one of The bit allocation module includes: determining the total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; a bit coefficient for each of the K channel pairs being a ratio of the energy / amplitude of each of the audio signals of the K channel pairs to a total energy / amplitude of the current frame; configured to set a number of bits for each of the K channel pairs to the number of available bits multiplied by the respective bit coefficients for the K channel pairs; the K channel pairs include a current channel pair, and the encoding module is configured to encode the audio signals of the current channel pair based on a number of bits of the current channel pair, the number of bits of each of the two channels in the current channel pair being the number of bits of the current channel pair multiplied by a first ratio, the first ratio being a ratio of the energy / amplitude of each of the audio signals of the two channels to a sum of the energy / amplitude of each of the audio signals of the two channels in the current channel pair.

14. 14. The apparatus of claim 13, wherein the encoding module: determining a number of bits for each of the two channels in the current channel pair based on the number of bits for the current channel pair and the energy / amplitude of each of the audio signals of the two channels in the current channel pair after stereo processing; and encoding the audio signals of the two channels based on the respective numbers of bits of the two channels in the current channel pair; The apparatus is configured to:

15. 15. The apparatus of claim 14, wherein the bit allocation module: determining a total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; determining bit coefficients for each of the K channel pairs based on the energy / amplitude of each of the audio signals of the K channel pairs and the total energy / amplitude of the current frame; and determining a number of bits for each of the K channel pairs based on the bit coefficients for each of the K channel pairs and the number of available bits; The apparatus is configured to:

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

17. 17. The apparatus of claim 16, wherein the bit allocation module comprises: The energy / amplitude sum of the current frame, sum_E post , the formula ##EQU00021## where ch represents a 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 An apparatus, wherein (ch,i) represents a coefficient of the i-th sample of the current frame of the (ch)-th channel after stereo processing, and N represents the number of coefficients of the current frame and is a positive integer greater than 1.

18. 16. The apparatus of claim 15, wherein the bit allocation module is configured to determine the energy / amplitude sum of the current frame based on an energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization, the energy / amplitude of the audio signal of one of the P channels before energy / amplitude equalization being: the energy / amplitude of the audio signal of said one channel in the time domain; the energy / amplitude of the audio signal in said one channel after a time-frequency transformation, or Energy / amplitude of the audio signal in one channel after time-frequency transformation and whitening 13. An apparatus comprising:

19. 20. The apparatus of claim 18, wherein the bit allocation module comprises: The energy / amplitude sum of the current frame, sum_E pre , the formula [0022] where ch represents a channel index, and E pre An apparatus, wherein (ch) represents the energy / amplitude of an audio signal of a channel with channel index ch before energy / amplitude equalization.

20. 16. The apparatus of claim 15, wherein the bit allocation module is configured to determine the energy / amplitude sum of the current frame based on the energy / amplitude of each of the audio signals of the P channels before energy / amplitude equalization and a weighting factor for each of the P channels, the weighting factor being less than or equal to 1.

21. 21. The apparatus of claim 20, wherein the bit allocation module is further configured to: pre , the formula [0023] where ch represents a channel index, and E pre an apparatus for performing a weighting coefficient calculation based on a weighting coefficient of the (ch)th channel, the weighting coefficients of the two channels in a channel pair being identical, and the values ​​of the weighting coefficients of the two channels in the channel pair being inversely proportional to a normalized correlation value between the two channels in the channel pair;

22. 22. The apparatus according to claim 13, wherein the audio signals of P channels further comprise audio signals of Q uncoupled channels, where P=2×K+Q, Q being 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 channels based on the respective energy / amplitude of the audio signals of P channels and the number of available bits, the encoding module is configured to encode the audio signals of the K channel pairs based on the respective numbers of bits for the K channel pairs and to encode the audio signals of the Q channel pairs based on the respective numbers of bits for the Q channels.

23. 23. The apparatus of claim 22, wherein the bit allocation module comprises: determining the total energy / amplitude of the current frame based on the respective energies / amplitudes of the audio signals of the P channels; determining bit coefficients for each of the K channel pairs based on the respective energies / amplitudes of the audio signals of the K channel pairs and the energy / amplitude sums of the current frame; determining bit coefficients for each of the Q channels based on the energy / amplitude of each of the audio signals for the Q channels and the energy / amplitude sum of the current frame; determining a number of bits for each of the K channel pairs based on a bit coefficient for each of the K channel pairs and the number of available bits; and determining a number of bits for each of the Q channels based on a bit coefficient for each of the Q channels and the number of available bits; The apparatus is configured to:

24. 24. The apparatus of claim 13, wherein the encoding module is configured to encode the audio signal of the P channels after energy / amplitude equalization based on the respective number of bits of the K channel pairs.

25. 1. A method for encoding a multi-channel audio signal, comprising: obtaining P channel audio signals in a current frame of a multi-channel audio signal, where P is a positive integer greater than 1, and the P channel audio signals include K channel pair audio signals, where K is a positive integer; performing energy / amplitude equalization on the two-channel audio signals in the current channel pair of the K channel pairs based on the energy / amplitude of each of the two-channel audio signals in the current channel pair, to obtain an energy / amplitude and a sum of energy / amplitude of each of the two-channel audio signals in the current channel pair after energy / amplitude equalization; determining a number of bits for each of the two channels in the current channel pair based on a ratio of an energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization to the total energy / amplitude and a number of available bits; and encoding the audio signals of the two channels based on the respective number of bits of the two channels in the current channel pair to obtain an encoded bitstream; determining the number of bits for each of the two channels in the current channel pair based on a ratio of the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization to the total energy / amplitude and the number of available bits, determining the energy / amplitude sum of the current frame based on the energy / amplitude of each of the audio signals of the P channels after energy / amplitude equalization; determining a number of bits in the current channel pair by multiplying the number of available bits by a ratio of the energy / amplitude sum of the audio signals of the two channels in the current channel pair after energy / amplitude equalization to the energy / amplitude sum of the current frame; In a step of encoding the audio signals of the two channels based on the number of bits of each of the two channels in the current channel pair to obtain an encoded bitstream, A method according to claim 1, wherein the number of bits for each of the two channels in the current channel pair is multiplied by the ratio of the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization to the sum of the energy / amplitude of the audio signals of the two channels in the current channel pair after energy / amplitude equalization.

26. 26. The method of claim 25, wherein P=2×K, K being a positive integer, and the step of determining the number of bits for each of the two channels in the current channel pair based on a ratio of the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization to the total energy / amplitude and the number of available bits comprises: determining the energy / amplitude sum of the current frame based on the energy / amplitude of each of the audio signals of the P channels after energy / amplitude equalization; and determining the respective number of bits for the two channels in the current channel pair based on the energy / amplitude sum of the current frame, the respective energy / amplitude of the audio signals of the two channels in the current channel pair after energy / amplitude equalization, and the number of available bits; A method comprising:

27. 27. The method of claim 25 or 26, wherein the P channel audio signals further comprise Q uncoupled channel audio signals, where 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 in the current channel pair based on a ratio of the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization to the total energy / amplitude and the number of available bits includes: determining the energy / amplitude sum of the current frame based on the energy / amplitude of the audio signals of two channels in each of the K channel pairs after the energy / amplitude equalization and the energy / amplitude of the audio signals of the Q channels after the energy / amplitude equalization; determining the number of bits for each of the two channels in the current channel pair based on the energy / amplitude sum of the current frame, the energy / amplitude of each of the audio signals for the two channels in the current channel pair, and the number of available bits; and determining a number of bits for each of the Q channels based on the energy / amplitude sum of the current frame, the respective energies / amplitudes of the audio signals of the Q channels after energy / amplitude equalization, and the number of available bits; and encoding the audio signals of the two channels based on the respective numbers of bits of the two channels in the current channel pair to obtain an encoded bitstream, comprising: encoding the audio signals of the K channel pairs based on the respective numbers of bits for the K channel pairs and encoding the audio signals of the Q channels based on the respective numbers of bits for the Q channels to obtain the encoded bitstream; A method comprising:

28. 13. An audio signal encoding apparatus comprising: an acquisition module configured to acquire audio signals of P channels in a 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 audio signals of K channel pairs, where K is a positive integer; an energy / amplitude equalization module configured to perform energy / amplitude equalization on the two-channel audio signals in the current channel pair of the K channel pairs based on the energy / amplitude of each of the two-channel audio signals in the current channel pair to obtain an energy / amplitude and a sum of energy / amplitude of each of the two-channel audio signals in the current channel pair after energy / amplitude equalization; a bit allocation module configured to determine the number of bits for each of the two channels in the current channel pair based on a ratio of the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization to the total energy / amplitude and the number of available bits; and an encoding module configured to encode the audio signals of the two channels based on the respective numbers of bits of the two channels in the current channel pair to obtain an encoded bitstream; the bit allocation module comprising: determining the energy / amplitude sum of the current frame based on the energy / amplitude of each of the audio signals of the P channels after energy / amplitude equalization; determining a number of bits in the current channel pair by multiplying the number of available bits by a ratio of the energy / amplitude sum of the audio signals of the two channels in the current channel pair after energy / amplitude equalization to the energy / amplitude sum of the current frame; an apparatus, wherein when the encoding module encodes the audio signals of the two channels based on the number of bits of each of the two channels in the current channel pair, the number of bits of each of the two channels in the current channel pair is the number of bits in the current channel pair multiplied by a ratio of the energy / amplitude of each of the audio signals of the two channels in the current channel pair after energy / amplitude equalization to the sum of the energy / amplitude of the audio signals of the two channels in the current channel pair after energy / amplitude equalization.

29. 30. The apparatus of claim 28, wherein P=2×K, where K is a positive integer, and the bit allocation module: determining a total energy / amplitude of the current frame based on the energy / amplitude of each of the audio signals of the P channels after energy / amplitude equalization; and determining the respective number of bits for the two channels in the current channel pair based on the energy / amplitude sum of the current frame, the respective energy / amplitude of the audio signals of the two channels in the current channel pair after energy / amplitude equalization, and the number of available bits; The apparatus is configured to:

30. 30. The apparatus of claim 28 or 29, wherein the P channel audio signals further comprise Q uncoupled channel audio signals, where P=2×K+Q, K being a positive integer and Q being a positive integer; The bit allocation module: determining the energy / amplitude sum of the current frame based on the energy / amplitude of the audio signals of two channels in each of the K channel pairs after the energy / amplitude equalization and the energy / amplitude of the audio signals of the Q channels after the energy / amplitude equalization; determining the number of bits for each of the two channels in the current channel pair based on the energy / amplitude sum of the current frame, the energy / amplitude of each of the audio signals for the two channels in the current channel pair, and the number of available bits; and determining a number of bits for each of the Q channels based on the energy / amplitude sum of the current frame, the respective energies / amplitudes of the audio signals of the Q channels after energy / amplitude equalization, and the number of available bits; The encoding module: encoding the audio signals of the K channel pairs based on the respective numbers of bits for the K channel pairs and encoding the audio signals of the Q channels based on the respective numbers of bits for the Q channels to obtain the encoded bitstream; The apparatus is configured to:

31. 28. An audio signal encoding device comprising a non-volatile memory and a processor coupled to each other, the processor running a program code stored in the memory to perform a method according to any one of claims 1 to 12 or to perform a method according to any one of claims 25 to 27.

32. 28. An audio signal encoding device including an encoder, the encoder being configured to perform a method according to any one of claims 1 to 12 or to perform a method according to any one of claims 25 to 27.

33. 28. A computer readable storage medium comprising a computer program, which when executed on a computer causes the computer to operate to perform the method according to any one of claims 1 to 12 or to perform the method according to any one of claims 25 to 27.

34. 28. A storage method comprising the step of obtaining an encoded bitstream by performing a method according to any one of claims 1 to 12 or a method according to any one of claims 25 to 27, and storing said bitstream on a storage medium.

Citation Information

Patent Citations

  • Information processing method, information processor and media

    JP1995181996A

  • Efficient encoding and decoding of multi-channel audio signals with multiple substreams

    JP2015520872A

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

    US20150025894A1

  • Stereo audio encoding device, stereo audio decoding device, and method thereof

    WO2007116809A1

  • Multisignal audio coding using signal whitening as preprocessing

    WO2020007719A1