Time-domain stereo parameter coding method and related products

By determining multiple channel coupling schemes for time-domain stereo coding, the method enhances encoding and decoding quality by maintaining primary signal energy and reducing energy loss, addressing the limitations of conventional techniques.

JP7886444B2Active Publication Date: 2026-07-07HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-02-06
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Conventional time-domain stereo coding techniques often result in low or lost energy of the primary signal, degrading the coding quality due to the need for multiple channel coupling schemes that do not adequately fit various scenarios.

Method used

A method that determines multiple channel coupling schemes, including correlated and anticorrelated signal channel coupling schemes, to calculate time-domain stereo parameters such as channel coupling ratio coefficients and inter-channel time differences, enhancing the fitting and matching of diverse scenarios.

Benefits of technology

Improves encoding and decoding quality by better fitting and matching various scenarios, ensuring that the primary signal maintains sufficient energy and reducing energy loss in the secondary signal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007886444000150
    Figure 0007886444000150
  • Figure 0007886444000151
    Figure 0007886444000151
  • Figure 0007886444000152
    Figure 0007886444000152
Patent Text Reader

Abstract

To provide a time domain stereo parameter encoding method and a related product, which improve quality of encoding and decoding.SOLUTION: A time domain stereo parameter encoding method includes the steps of: determining a channel coupling scheme of a current frame; determining a time domain stereo parameter of the current frame based on the channel coupling scheme of the current frame; and encoding the determined time domain stereo parameter of the current frame including at least one of a channel coupling ratio coefficient and an inter-channel time difference.SELECTED DRAWING: Figure 8
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application relates to the field of audio coding and decoding techniques, and more particularly to time-domain stereo parameter coding methods and related products. [Background technology]

[0002] As the quality of life improves, people's demand for high-quality audio is increasing. Compared to mono audio, stereo audio provides a sense of direction and distribution regarding various sound sources, and can improve clarity, definition, and the presence of information, which is why it is popular.

[0003] Parametric stereo coding and decoding techniques convert stereo signals into mono signals and spatial perception parameters, and compress multi-channel signals. This is a common stereo coding and decoding technique. However, because parametric stereo coding and decoding techniques typically require extracting spatial perception parameters in the frequency domain and performing time-frequency conversion, the overall delay of the codec is relatively large. Therefore, if the delay requirements are relatively strict, time-domain stereo coding techniques are more suitable.

[0004] In conventional time-domain stereo coding techniques, a signal is downmixed to obtain two time-domain mono signals. For example, in MS coding, the left and right channel signals are first downmixed to obtain the Mid channel signal and the Side channel signal. For example, L represents the left channel signal and R represents the right channel signal. In this case, the Mid channel signal is 0.5 × (L + R), and the Mid channel signal represents information about the correlation between the left and right channels, and the Side channel signal is 0.5 × (LR), and the Side channel signal represents information about the difference between the left and right channels. Next, the Mid channel signal and the Side channel signal are coded separately using a mono coding method, with the Mid channel signal usually coded using more bits and the Side channel signal usually coded using fewer bits.

[0005] The inventors of this application have found through research and practice that when conventional time-domain stereo coding techniques are used, the energy of the primary signal can become extremely low, or even lost, which can degrade the final coding quality. [Overview of the Initiative] [Means for solving the problem]

[0006] Embodiments of this application provide a time-domain stereo parameter coding method and related products.

[0007] According to a first aspect, an embodiment of the present application provides a time-domain stereo parameter coding method. The method includes the steps of: determining the channel coupling scheme of the current frame; determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame; and coding the determined time-domain stereo parameters of the current frame, wherein the time-domain stereo parameters include at least one of a channel coupling ratio coefficient and an inter-channel time difference.

[0008] Embodiments of this application further provide a method for determining time-domain stereo parameters. The method may include the steps of: determining the channel coupling scheme of the current frame; and determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame, wherein the time-domain stereo parameters include at least one of a channel coupling ratio coefficient and an inter-channel time difference.

[0009] The stereo signal for the current frame includes, for example, the left and right channel signals for the current frame.

[0010] The current frame's channel coupling scheme is one of several channel coupling schemes.

[0011] For example, multiple channel combination schemes include anticorrelated signal channel combination schemes and correlated signal channel combination schemes.

[0012] A correlated signal channel coupling scheme is a channel coupling scheme that corresponds to nearly in-phase signals. An anticorrelated signal channel coupling scheme is a channel coupling scheme that corresponds to nearly in-phase signals. It will be understood that a channel coupling scheme that corresponds to nearly in-phase signals is applicable to nearly in-phase signals, and a channel coupling scheme that corresponds to nearly in-phase signals is applicable to nearly in-phase signals.

[0013] If the channel coupling scheme of the current frame is determined to be a correlated-signal channel coupling scheme, the time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame. Alternatively, if the channel coupling scheme of the current frame is determined to be an anticorrelated-signal channel coupling scheme, the time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame.

[0014] The solution described above requires determining the channel coupling scheme of the current frame, which should be understood as indicating that there are multiple possible channel coupling schemes for the current frame. Compared to conventional solutions with only one channel coupling scheme, this solution, with multiple possible channel coupling schemes, can better fit and match multiple possible scenarios. Since the time-domain stereo parameters of the current frame are determined based on the channel coupling scheme of the current frame, the time-domain stereo parameters can better fit and match multiple possible scenarios, potentially leading to further improvements in encoding and decoding quality.

[0015] In some possible implementations, the channel coupling ratio coefficients corresponding to the inverse-correlated signal channel coupling scheme of the current frame and the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame may be calculated separately first. Then, if the channel coupling scheme of the current frame is determined to be a correlated signal channel coupling scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the correlated signal channel coupling scheme of the current frame; or, if the channel coupling scheme of the current frame is determined to be an inverse-correlated signal channel coupling scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the inverse-correlated signal channel coupling scheme of the current frame. Alternatively, the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame may be calculated first. If the channel coupling scheme of the current frame is determined to be a correlated-signal channel coupling scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame. Or, if the channel coupling scheme of the current frame is determined to be an anticorrelated-signal channel coupling scheme, the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame are calculated, and the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame are determined to be the time-domain stereo parameters of the current frame.

[0016] Alternatively, the channel coupling scheme of the current frame may be determined first. If the channel coupling scheme of the current frame is determined to be a correlated-signal channel coupling scheme, the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame are calculated, and these time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame. If the channel coupling scheme of the current frame is determined to be an anticorrelated-signal channel coupling scheme, the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame are calculated, and these time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame.

[0017] In some possible implementations, the step of determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame includes the step of determining the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame based on the channel coupling scheme of the current frame. If it is not necessary to change the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame (correlated signal channel coupling scheme or anticorrelated signal channel coupling scheme), the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame are equal to the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame. If it is necessary to change the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame (correlated signal channel coupling scheme or anticorrelated signal channel coupling scheme), the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame is changed in order to obtain the changed value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame, and the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame are equal to the changed value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame.

[0018] For example, the step of determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame may include the steps of: calculating the frame energy of the left channel signal of the current frame based on the left channel signal of the current frame; calculating the frame energy of the right channel signal of the current frame based on the right channel signal of the current frame; and calculating initial values ​​of the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame based on the frame energy of the left channel signal of the current frame and the frame energy of the right channel signal of the current frame.

[0019] If there is no need to change the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, then the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme is equal to the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, and the encoded index of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme is equal to the encoded index of the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme.

[0020] If it is necessary to change the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme and its encoded index are changed in order to obtain the changed value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme and the encoded index of the changed value. The channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme is equal to the changed value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, and the encoded index of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme is equal to the encoded index of the changed value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme.

[0021] Specifically, for example, if the initial values ​​and encoded indices of the channel coupling ratio coefficients corresponding to the current frame's correlated signal channel coupling scheme are changed, ratio_idx_mod = 0.5 * (tdm_last_ratio_idx + 16), ratio bamod qua =ratio_tabl[ratio_idx_mod], tdm_last_ratio_idx indicates the encoded index of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the previous frame, ratio_idx_mod indicates the encoded index of the changed value of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the current frame, and ratio_mod qua This shows the change in the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme.

[0022] As another example, the step of determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame includes the steps of: obtaining the reference channel signal of the current frame based on the left channel signal and the right channel signal of the current frame; calculating the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame; calculating the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame; calculating the amplitude correlation difference parameter between the left and right channel signals of the current frame based on the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame and the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame; and calculating the channel coupling ratio coefficients corresponding to the anticorrelation signal channel coupling scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame.

[0023] The step of calculating the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame may include, for example, the steps of calculating an initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame, and changing the initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame in order to obtain the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame. If it is not necessary to change the initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame, it will be understood that the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame is equal to the initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame.

[0024] In some possible implementations,

number

[0025] In some possible implementations, based on the amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal and the amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal, the step of calculating the amplitude correlation difference parameter between the left and right channel signals of the current frame includes: calculating the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal based on the amplitude correlation parameter between the left channel signal of the current frame after delay alignment processing and the reference channel signal; calculating the long-term smoothed amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal based on the amplitude correlation parameter between the right channel signal of the current frame after delay alignment processing and the reference channel signal; and calculating the amplitude correlation difference parameter between the left and right channels of the current frame based on the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal and the long-term smoothed amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal.

[0026] There are various smoothing methods. For example, tdm_lt_corr_LM_SM cur =α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM, and tdm_lt_rms_L_SM cur =(1 - A)*tdm_lt_rms_L_SM pre +A*rms_L, where A represents the update coefficient of the long-term smoothed frame energy of the left channel signal of the current frame, tdm_lt_rms_L_SM cur represents the long-term smoothed frame energy of the left channel signal of the current frame, rms_L represents the frame energy of the left channel signal of the current frame, tdm_lt_corr_LM_SM cur represents the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal, tdm_lt_corr_LM_SM preα represents the long-term smoothing amplitude correlation parameter between the left channel signal and the reference channel signal of the previous frame, and α represents the left channel smoothing coefficient.

[0027] for example, tdm_lt_corr_RM_SM cur =β*tdm_lt_corr_RM_SM pre It is +(1-β)corr_LM.

[0028] tdm_lt_rms_R_SM cur =(1-B)*tdm_lt_rms_R_SM pre +B*rms_R, where B represents the update coefficient for the long-term smoothed frame energy of the right channel signal of the current frame, and tdm_lt_rms_R_SM pre `rms_R` represents the long-time smoothed frame energy of the right channel signal of the current frame, `tdm_lt_corr_RM_SM` represents the frame energy of the right channel signal of the current frame, and `tdm_lt_corr_RM_SM` represents the frame energy of the right channel signal of the current frame. cur This parameter, tdm_lt_corr_RM_SM, represents the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame. pre β represents the long-term smoothing amplitude correlation parameter between the right channel signal and the reference channel signal of the previous frame, and β represents the right channel smoothing coefficient.

[0029] In some possible implementations, diff_lt_corr = tdm_lt_corr_LM_SM - tdm_lt_corr_RM_SM, where tdm_lt_corr_LM_SM represents the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, tdm_lt_corr_RM_SM represents the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, and diff_lt_corr represents the amplitude correlation difference parameter between the left and right channel signals of the current frame.

[0030] In some possible implementations, the steps include: calculating channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame based on amplitude correlation difference parameters between the left and right channel signals of the current frame; performing a mapping process on the amplitude correlation difference parameters between the left and right channel signals of the current frame such that the range of values ​​for the mapped amplitude correlation difference parameters is [MAP_MIN, MAP_MAX]; and converting the mapped amplitude correlation difference parameters between the left and right channel signals into channel coupling ratio coefficients.

[0031] In some possible implementations, the step of performing a mapping process for amplitude correlation difference parameters between the left and right channels of the current frame includes the step of performing amplitude limiting on the amplitude correlation difference parameters between the left and right channel signals of the current frame, and the step of performing a mapping process on the amplitude-limited amplitude correlation difference parameters between the left and right channel signals of the current frame.

[0032] Various amplitude limiting methods are possible, specifically, for example,

number

[0033] Various mapping processing methods are possible, specifically, for example,

number

[0034] As another example,

number

number

[0035] In some possible implementations,

number

[0036] If it is necessary to change the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame in order to obtain the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame may be changed based on the channel coupling ratio coefficient of the previous frame and the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, or the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame may be changed based on the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame.

[0037] In some possible implementations, ratio_init_SM qua =ratio_tabl_SM[ratio_idx_init_SM], where ratio_tabl_SM is the codebook for performing scalar quantization on the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame, and ratio_idx_init_SM is the initially encoded index corresponding to the inversely correlated signal channel coupling scheme of the current frame, and ratio_init_SM qua This shows the quantized-encoded initial values ​​of the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame.

[0038] In some possible implementations, ratio_idx_SM = ratio_idx_init_SM, ratio_SM = ratio_tabl[ratio_idx_SM], where ratio_SM represents the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, and ratio_idx_SM represents the encoded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, or ratio_idx_SM=φ*ratio_idx_init_SM+(1-φ)*tdm_last_ratio_idx_SM, ratio_SM = ratio_tabl[ratio_idx_SM], where ratio_idx_init_SM represents the initial encoded index corresponding to the inversely correlated signal channel coupling scheme of the current frame, tdm_last_ratio_idx_SM represents the final encoded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the previous frame, φ is the change coefficient of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme, and ratio_SM represents the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame.

[0039] Naturally, the specific implementations that modify the initial values ​​of the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame in order to obtain the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame are not limited to the examples described above.

[0040] In addition, if the time-domain stereo parameters include inter-channel time differences, the step of determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame may include the step of calculating the inter-channel time differences of the current frame if the channel coupling scheme of the current frame is a correlated-signal channel coupling scheme. In addition, the inter-channel time differences of the current frame obtained by calculation may be written to the bitstream. If the channel coupling scheme of the current frame is an anticorrelated-signal channel coupling scheme, a default inter-channel time difference (e.g., 0) is used as the inter-channel time difference of the current frame. In addition, the default inter-channel time difference does not have to be written to the bitstream, and the decoder also uses the default inter-channel time difference.

[0041] According to a second aspect, embodiments of the present application further provide a time-domain stereo parameter coding apparatus which may comprise a coupled processor and memory. The processor may be configured to perform some or all of the steps of any method in the first aspect. Embodiments of the present application further provide a time-domain stereo coding apparatus which may include the time-domain stereo parameter coding apparatus described above.

[0042] According to a third aspect, an embodiment of the present application provides a time-domain stereoparameter coding device comprising several functional units configured to implement any of the methods of the first aspect.

[0043] According to a fourth aspect, one embodiment of the present application provides a computer-readable storage medium that stores program code, the program code including instructions used to perform some or all of the steps of any method in the first aspect.

[0044] According to a fifth aspect, one embodiment of the present application provides a computer program product which, when executed on a computer, the computer performs some or all of the steps of any method in the first aspect.

[0045] The following describes the accompanying drawings necessary to illustrate the embodiments or background art of this application. [Brief explanation of the drawing]

[0046] [Figure 1] This is a schematic diagram of a substantially non-in-phase signal according to one embodiment of this application. [Figure 2] This is a schematic flowchart of an audio encoding method according to one embodiment of this application. [Figure 3] This is a schematic flowchart of a method for determining the audio decoding mode according to one embodiment of this application. [Figure 4] This is a schematic flowchart of another audio encoding method according to one embodiment of the present application. [Figure 5] This is a schematic flowchart of an audio decoding method according to one embodiment of this application. [Figure 6] This is a schematic flowchart of another audio encoding method according to one embodiment of the present application. [Figure 7] This is a schematic flowchart of another audio decoding method according to one embodiment of this application. [Figure 8] This is a schematic flowchart of a time-domain stereo parameter determination method according to one embodiment of this application. [Figure 9-A] This is a schematic flowchart of another audio encoding method according to one embodiment of the present application. [Figure 9-B]This is a schematic flowchart of a method for calculating and encoding channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of a current frame, according to one embodiment of the present application. [Figure 9-C] This is a schematic flowchart of a method for calculating the amplitude correlation difference parameter between the left and right channels of a current frame, according to one embodiment of the present application. [Figure 9-D] This is a schematic flowchart of a method, according to one embodiment of the present application, for converting the amplitude correlation difference parameter between the left and right channels of the current frame into a channel coupling ratio coefficient. [Figure 10] This is a schematic flowchart of another audio decoding method according to one embodiment of this application. [Figure 11-A] This is a schematic diagram of an apparatus according to one embodiment of the present application. [Figure 11-B] This is a schematic diagram of another device according to one embodiment of this application. [Figure 11-C] This is a schematic diagram of another device according to one embodiment of this application. [Figure 12-A] This is a schematic diagram of another device according to one embodiment of this application. [Figure 12-B] This is a schematic diagram of another device according to one embodiment of this application. [Figure 12-C] This is a schematic diagram of another device according to one embodiment of this application. [Modes for carrying out the invention]

[0047] Hereinafter, embodiments of this application will be described with reference to the accompanying drawings of the embodiments of this application.

[0048] The terms “including,” “having,” or any other variation thereof, as used in the specification, claims, and accompanying drawings of this application are intended to include non-exclusive inclusion. For example, a process, method, system, product, or device comprising a series of steps or units may, but may also include, by choice, further steps or units not described, or other specific steps or units of the process, method, product, or device. In addition, terms such as “first,” “second,” “third,” and “fourth” are used to distinguish subjects rather than to describe a specific order.

[0049] Since the solutions in the embodiments of this application are specific to time-domain scenarios, it should be noted that, for the sake of brevity, time-domain signals may be simply referred to as "signals." For example, a left-channel time-domain signal may be simply referred to as a "left-channel signal." In another example, a right-channel time-domain signal may be simply referred to as a "right-channel signal." In yet another example, a monaural time-domain signal may be simply referred to as a "monaural signal." In yet another example, a reference-channel time-domain signal may be simply referred to as a "reference-channel signal." In yet another example, a primary-channel time-domain signal may be simply referred to as a "primary-channel signal." A secondary-channel time-domain signal may be simply referred to as a "secondary-channel signal." In yet another example, a Mid-channel time-domain signal may be simply referred to as a "Mid-channel signal." In yet another example, a Side-channel time-domain signal may be simply referred to as a "Side-channel signal." Other cases can be inferred by analogy.

[0050] In the embodiments of this application, the left channel time-domain signal and the right channel time-domain signal may be collectively referred to as the "left and right channel time-domain signals" or as the "left and right channel signals." In other words, the left and right channel time-domain signals include the left channel time-domain signal and the right channel time-domain signal. In another example, the left and right channel time-domain signals that have undergone delay alignment processing for the current frame include the left channel time-domain signal that has undergone delay alignment processing for the current frame and the right channel time-domain signal that has undergone delay alignment processing for the current frame. Similarly, the primary channel signal and the secondary channel signal may be collectively referred to as the "primary and secondary channel signals." In other words, the primary and secondary channel signals include the primary channel signal and the secondary channel signal. In another example, the decoded primary and secondary channel signals include the decoded primary channel signal and the decoded secondary channel signal. In yet another example, the reconstructed left and right channel signals include the reconstructed left channel signal and the reconstructed right channel signal. The rest can be inferred by analogy.

[0051] For example, in conventional MS coding techniques, the left and right channel signals are first downmixed to obtain the Mid channel and Side channel signals. For example, L represents the left channel signal and R represents the right channel signal. In this case, the Mid channel signal is 0.5 × (L + R), and the Mid channel signal represents information about the correlation between the left and right channels, while the Side channel signal is 0.5 × (LR), and the Side channel signal represents information about the difference between the left and right channels. Next, the Mid channel signal and the Side channel signal are coded separately using a monaural coding method. The Mid channel signal is usually coded using a relatively large number of bits, and the Side channel signal is usually coded using a relatively small number of bits.

[0052] Furthermore, in some solutions, the left and right channel time-domain signals are analyzed to extract time-domain stereo parameters used to indicate the ratio of the left channel to the right channel in the time-domain downmixing process, in order to improve encoding quality. The objective of the proposed method is that, when the energy difference between the left and right channel signals of the stereo is relatively large, it may be possible to increase the energy of the primary channel and decrease the energy of the secondary channel in the time-domain downmix signal. For example, L represents the left channel signal and R represents the right channel signal. In this case, the primary channel signal is denoted by Y, where Y = alpha x L + beta x R, and Y represents information about the correlation between the two channels, and the secondary channel is denoted by X, where X = alpha x L - beta x R, and X represents information about the difference between the two channels, where alpha and beta are real numbers between 0 and 1.

[0053] Figure 1 shows the amplitude fluctuations of the left and right channel signals. At a given moment in the time domain, the absolute value of the amplitude of the sampling point of the left channel signal at a particular position is essentially the same as the absolute value of the amplitude of the sampling point of the right channel signal at the corresponding position, but the amplitudes have opposite signs. This is a typical nearly in-phase signal. Figure 1 is merely a typical example of a nearly in-phase signal. In practice, a nearly in-phase signal is a stereo signal where the phase difference between the left and right channel signals is approximately 180 degrees. For example, a stereo signal where the phase difference between the left and right channel signals is within the range of [180-θ, 180+θ] is called a nearly in-phase signal, where θ can be any angle from 0° to 90°. For example, θ may be equal to angles such as 0°, 5°, 15°, 17°, 20°, 30°, 40°, etc.

[0054] Similarly, a nearly in-phase signal is a stereo signal where the phase difference between the left and right channel signals is approximately 0 degrees. For example, a stereo signal where the phase difference between the left and right channel signals is within the range [-θ, θ] can be called a nearly in-phase signal, where θ can be any angle between 0° and 90°. For example, θ may be equal to angles such as 0°, 5°, 15°, 17°, 20°, 30°, or 40°.

[0055] When the left and right channel signals are nearly in phase, the energy of the primary channel signal generated by time-domain downmixing is usually significantly greater than that of the secondary channel signal. Better encoding results can be obtained when the primary channel signal is encoded using a relatively large number of bits and the secondary channel signal is encoded using a relatively small number of bits. However, when the left and right channel signals are nearly out of phase, using the same time-domain downmixing method may result in a primary channel signal with very little or even no energy, leading to a decrease in the final encoding quality.

[0056] Below, we will continue to discuss some technical solutions that may help improve the quality of stereo coding and decoding.

[0057] The encoding and decoding devices referred to in the embodiments of this application may be devices having functions such as collecting, storing, and transmitting audio signals externally. Specifically, the encoding and decoding devices may be, for example, mobile phones, servers, tablet computers, personal computers, or notebook computers.

[0058] In the solutions of this application, the left and right channel signals will be understood to be the left and right channel signals of a stereo signal. A stereo signal may be an original stereo signal, a stereo signal formed by two signal channels included in a multichannel signal, or a stereo signal formed by two signal channels jointly generated by multiple signal channels included in a multichannel signal. A stereo coding method may also be a stereo coding method used in multichannel coding. A stereo coding device may also be a stereo coding device used in a multichannel coding device. A stereo decoding method may also be a stereo decoding method used in multichannel decoding. A stereo decoding device may also be a stereo decoding device used in a multichannel decoding device. The audio coding method in the embodiments of this application is, for example, specific to a stereo coding scenario, and the audio decoding method in the embodiments of this application is, for example, specific to a stereo decoding scenario.

[0059] The following initially provides a method for determining the audio coding mode, which may include the steps of determining the channel combination scheme of the current frame and determining the coding mode of the current frame based on the channel combination scheme of the previous frame and the channel combination scheme of the current frame.

[0060] Figure 2 is a schematic flowchart of an audio encoding method according to one embodiment of the present application. The relevant steps of the audio encoding method may be carried out by an encoding device and may include, for example, the following steps:

[0061] 201. Determine the channel coupling scheme of the current frame.

[0062] The current frame's channel combination scheme is one of several channel combination schemes. For example, several channel combination schemes include the anticorrelated signal channel combination scheme and the correlated signal channel combination scheme. The correlated signal channel combination scheme is a channel combination scheme that corresponds to nearly in-phase signals. The anticorrelated signal channel combination scheme is a channel combination scheme that corresponds to nearly in-phase signals. It will be understood that the channel combination scheme that corresponds to nearly in-phase signals is applicable to nearly in-phase signals, and the channel combination scheme that corresponds to nearly in-phase signals is applicable to nearly in-phase signals.

[0063] 202. Determine the encoding mode of the current frame based on the channel coupling scheme of the previous frame and the channel coupling scheme of the current frame.

[0064] In addition, if the current frame is the first frame (i.e., there is no frame preceding the current frame), the encoding mode of the current frame may be determined based on the channel joining scheme of the current frame. Alternatively, the default encoding mode may be used as the encoding mode of the current frame.

[0065] The current encoding mode of a frame is one of several encoding modes. For example, these encoding modes may include a correlated-to-anticorrelated signal coding switching mode, an anticorrelated-to-correlated signal coding switching mode, a correlated signal coding mode, and an anticorrelated signal coding mode.

[0066] A time-domain downmix mode that switches signal coding from correlation to anticorrelation may be called, for example, a "correlated-to-anticorrelated signal downmix switching mode." A time-domain downmix mode that switches signal coding from anticorrelation to correlation may be called, for example, an "anticorrelated-to-correlated signal downmix switching mode." A time-domain downmix mode that corresponds to a correlated signal coding mode may be called, for example, a "correlated signal downmix mode." A time-domain downmix mode that corresponds to an anticorrelated signal coding mode may be called, for example, an "anticorrelated signal downmix mode."

[0067] In the embodiments of this application, all subject names such as encoding mode, decoding mode, and channel coupling scheme are examples, and it should be understood that other names may be used in actual applications.

[0068] 203. To obtain the primary and secondary channel signals of the current frame, a time-domain downmix is ​​performed on the left and right channel signals of the current frame, based on the time-domain downmix process corresponding to the encoding mode of the current frame.

[0069] To obtain the primary and secondary channel signals of the current frame, a time-domain downmixing process may be performed on the left and right channel signals of the current frame, and the primary and secondary channel signals are further encoded to obtain a bitstream. Furthermore, the channel coupling scheme flag of the current frame (the channel coupling scheme flag of the current frame is used to indicate the channel coupling scheme of the current frame) is written to the bitstream, and as a result, the decoder may determine the channel coupling scheme of the current frame based on the channel coupling scheme flag of the current frame contained in the bitstream.

[0070] There can be various specific implementations of determining the encoding mode of the current frame based on the channel coupling scheme of the previous frame and the channel coupling scheme of the current frame.

[0071] Specifically, for example, in some possible implementations, determining the encoding mode of the current frame based on the channel coupling scheme of the previous frame and the channel coupling scheme of the current frame is possible. If the channel coupling scheme of the previous frame is a correlated-signal channel coupling scheme and the channel coupling scheme of the current frame is an anticorrelated-signal channel coupling scheme, then it is determined that the encoding mode of the current frame is a mode that switches signal coding from correlated to anticorrelated, and in the mode that switches signal coding from correlated to anticorrelated, the time-domain downmixing process is performed by using a downmixing method that corresponds to the transition from a correlated-signal channel coupling scheme to an anticorrelated-signal channel coupling scheme, or If the channel coupling scheme of the previous frame is an anticorrelated signal channel coupling scheme and the channel coupling scheme of the current frame is an anticorrelated signal channel coupling scheme, then it is determined that the encoding mode of the current frame is an anticorrelated signal encoding mode, and in the anticorrelated signal encoding mode, the time-domain downmixing process is performed by using a downmixing method corresponding to the anticorrelated signal channel coupling scheme, or When the channel coupling scheme of the previous frame is an anticorrelated signal channel coupling scheme and the channel coupling scheme of the current frame is a correlated signal channel coupling scheme, it is determined that the encoding mode of the current frame is a mode that switches signal coding from anticorrelation to correlation, and in the mode that switches signal coding from anticorrelation to correlation, the time-domain downmixing process is performed by using a downmixing method that corresponds to the transition from an anticorrelated signal channel coupling scheme to a correlated signal channel coupling scheme, and the time-domain downmixing method that corresponds to the mode that switches signal coding from anticorrelation to correlation is specifically a segmented time-domain downmixing method, that is, performing segmented time-domain downmixing on the left and right channel signals of the current frame based on the channel coupling scheme of the current frame and the channel coupling scheme of the previous frame, or If the channel coupling scheme of the previous frame is a correlated-signal channel coupling scheme and the channel coupling scheme of the current frame is a correlated-signal channel coupling scheme, then determining that the encoding mode of the current frame is a correlated-signal encoding mode may include determining that in the correlated-signal encoding mode, the time-domain downmixing process is performed by using a downmixing method corresponding to the correlated-signal channel coupling scheme.

[0072] It will be understood that different encoding modes typically correspond to different time-domain downmixing methods, and each encoding mode may correspond to one or more time-domain downmixing methods.

[0073] For example, in some possible implementations, if the encoding mode of the current frame is determined to be correlated signal coding mode, a time-domain downmixing scheme corresponding to correlated signal coding mode is used to perform time-domain downmixing on the left and right channel signals of the current frame in order to obtain the primary and secondary channel signals of the current frame. The time-domain downmixing scheme corresponding to correlated signal coding mode is a time-domain downmixing scheme corresponding to a correlated signal channel coupling scheme.

[0074] As another example, in some possible implementations, if the encoding mode of the current frame is determined to be inversely correlated signal encoding mode, a time-domain downmixing scheme corresponding to inversely correlated signal encoding mode is used to perform time-domain downmixing on the left and right channel signals of the current frame in order to obtain the primary and secondary channel signals of the current frame. The time-domain downmixing scheme corresponding to inversely correlated signal encoding mode is the time-domain downmixing scheme corresponding to the inversely correlated signal channel coupling scheme.

[0075] As another example, in some possible implementations, if the encoding mode of the current frame is determined to be a mode that switches signal coding from correlated to decorrelated, a time-domain downmixing scheme corresponding to the mode that switches signal coding from correlated to decorrelated is used to perform time-domain downmixing on the left and right channel signals of the current frame in order to obtain the primary and secondary channel signals of the current frame. The time-domain downmixing scheme corresponding to the mode that switches signal coding from correlated to decorrelated is a time-domain downmixing scheme that corresponds to the transition from a correlated-to-channel-coupled scheme to a decorrelated-to-channel-coupled scheme. Specifically, the time-domain downmixing scheme corresponding to the mode that switches signal coding from correlated to decorrelated may be a segmented time-domain downmixing scheme, that is, it may be a segmented time-domain downmixing scheme that performs segmented time-domain downmixing on the left and right channel signals of the current frame based on the channel-coupled scheme of the current frame and the channel-coupled scheme of the previous frame.

[0076] As another example, in some possible implementations, if the encoding mode of the current frame is determined to be a mode that switches signal coding from inverse correlation to correlation, then a time-domain downmixing scheme corresponding to the mode that switches signal coding from inverse correlation to correlation is used to perform time-domain downmixing on the left and right channel signals of the current frame in order to obtain the primary and secondary channel signals of the current frame. The time-domain downmixing scheme corresponding to the mode that switches signal coding from inverse correlation to correlation is a time-domain downmixing scheme that corresponds to the transition from an inversely correlated signal channel coupling scheme to a correlated signal channel coupling scheme.

[0077] It will be understood that different encoding modes typically correspond to different time-domain downmixing methods, and each encoding mode may correspond to one or more time-domain downmixing methods.

[0078] For example, in some possible implementations, performing a time-domain downmix on the left and right channel signals of the current frame by using a time-domain downmixing method corresponding to the anticorrelated signal coding mode to obtain the primary and secondary channel signals of the current frame may include performing a time-domain downmix on the left and right channel signals of the current frame based on the channel coupling ratio coefficients of the anticorrelated signal channel coupling scheme of the current frame to obtain the primary and secondary channel signals of the current frame, or performing a time-domain downmix on the left and right channel signals of the current frame based on the channel coupling ratio coefficients of the anticorrelated signal channel coupling scheme of the current frame and the channel coupling ratio coefficients of the anticorrelated signal channel coupling scheme of the previous frame to obtain the primary and secondary channel signals of the current frame.

[0079] The above solution requires determining the channel join scheme of the current frame, which indicates that there are multiple possible channel join schemes for the current frame. Compared to conventional solutions with only one possible channel join scheme, this solution, with multiple possible channel join schemes, can better fit and match multiple possible scenarios. In the above solution, the encoding mode of the current frame must be determined based on the channel join scheme of the previous frame and the channel join scheme of the current frame, and there are multiple possible encoding modes for the current frame. Compared to conventional solutions with only one possible encoding mode, this solution, with multiple possible encoding modes, can better fit and match multiple possible scenarios.

[0080] Specifically, for example, if the channel coupling scheme of the current frame differs from that of the previous frame, the encoding mode of the current frame can be determined to be, for example, a mode that switches signal coding from correlation to decorrelation or from decorrelation to correlation. In this case, segmented time-domain downmixing can be performed on the left and right channel signals of the current frame, based on the channel coupling scheme of the current frame and the channel coupling scheme of the previous frame.

[0081] If the channel coupling scheme of the current frame differs from that of the previous frame, a mechanism is introduced to perform segmented time-domain downmixing on the left and right channel signals of the current frame. This segmented time-domain downmixing mechanism facilitates a smooth transition between channel coupling schemes and further improves coding quality.

[0082] Accordingly, the following describes a time-domain stereo decoding scenario using an example.

[0083] Referring to Figure 3, the following further provides a method for determining the audio decoding mode. The relevant steps of the method for determining the audio decoding mode may be performed by the decoding device, and the method may particularly include the following.

[0084] 301. Determine the channel join scheme of the current frame based on the channel join scheme flag of the current frame in the bitstream.

[0085] 302. Determine the decoding mode of the current frame based on the channel coupling scheme of the previous frame and the channel coupling scheme of the current frame.

[0086] The current decoding mode of a frame is one of several decoding modes. For example, these decoding modes may include a correlated-to-anticorrelated signal decoding switching mode, an anticorrelated-to-correlated signal decoding switching mode, a correlated signal decoding mode, and an anticorrelated signal decoding mode.

[0087] A time-domain upmix mode that corresponds to a mode that switches signal decoding from correlation to anticorrelation may be called, for example, a "correlated-to-anticorrelated signal upmix switching mode." A time-domain upmix mode that corresponds to a mode that switches signal decoding from anticorrelation to correlation may be called, for example, an "anticorrelated-to-correlated signal upmix switching mode." A time-domain upmix mode that corresponds to a correlation signal decoding mode may be called, for example, a "correlated signal upmix mode." A time-domain upmix mode that corresponds to an anticorrelation signal decoding mode may be called, for example, an "anticorrelated signal upmix mode."

[0088] In the embodiments of this application, all subject names such as encoding mode, decoding mode, and channel coupling scheme are examples, and it should be understood that other names may be used in actual applications.

[0089] In some possible implementations, determining the encoding mode of the current frame based on the channel coupling scheme of the previous frame and the channel coupling scheme of the current frame is possible. If the channel coupling scheme of the previous frame is a correlated-signal channel coupling scheme and the channel coupling scheme of the current frame is an anticorrelated-signal channel coupling scheme, then it is determined that the decoding mode of the current frame is a mode that switches signal decoding from correlated to anticorrelated, and in the mode that switches signal decoding from correlated to anticorrelated, the time-domain upmixing process is performed by using an upmixing method that corresponds to the transition from a correlated-signal channel coupling scheme to an anticorrelated-signal channel coupling scheme, or If the channel coupling scheme of the previous frame is an anticorrelated signal channel coupling scheme and the channel coupling scheme of the current frame is an anticorrelated signal channel coupling scheme, then it is determined that the decoding mode of the current frame is an anticorrelated signal decoding mode, and in the anticorrelated signal decoding mode, the time-domain upmixing process is performed by using an upmixing method corresponding to the anticorrelated signal channel coupling scheme, or If the channel coupling scheme of the previous frame is an anticorrelated signal channel coupling scheme and the channel coupling scheme of the current frame is a correlated signal channel coupling scheme, then it is determined that the decoding mode of the current frame is a mode that switches signal decoding from anticorrelation to correlation, and in the mode that switches signal decoding from anticorrelation to correlation, the time-domain upmixing process is performed by using an upmixing method that corresponds to the transition from an anticorrelated signal channel coupling scheme to a correlated signal channel coupling scheme, or If the channel coupling scheme of the previous frame is a correlated-signal channel coupling scheme and the channel coupling scheme of the current frame is a correlated-signal channel coupling scheme, then it is determined that the decoding mode of the current frame is a correlated-signal decoding mode, and in the correlated-signal decoding mode, the time-domain upmixing process is performed by using an upmixing method corresponding to the correlated-signal channel coupling scheme.

[0090] For example, if the decoding mode of the current frame is determined to be inverse correlation decoding mode, the decoding device performs time-domain upmixing on the decoded primary and secondary channel signals of the current frame by using a time-domain upmixing method corresponding to inverse correlation decoding mode in order to obtain the reconfigured left and right channel signals of the current frame.

[0091] The reconstructed left and right channel signals may be the decoded left and right channel signals, or delay adjustment and / or time-domain post-processing may be performed on the reconstructed left and right channel signals in order to obtain the decoded left and right channel signals.

[0092] The time-domain upmixing method corresponding to the anticorrelation signal decoding mode is the time-domain upmixing method corresponding to the anticorrelation signal channel coupling scheme, and the anticorrelation signal channel coupling scheme is the channel coupling scheme corresponding to nearly in-phase signals.

[0093] The decoding mode of the current frame can be one of several decoding modes. For example, the decoding mode of the current frame can be one of the following decoding modes: correlated signal decoding mode, anticorrelated signal decoding mode, a mode that switches signal decoding from correlated to anticorrelated, and a mode that switches signal decoding from anticorrelated to correlated.

[0094] The solution described above requires determining the decoding mode of the current frame, which should be understood as indicating that there are multiple possible decoding modes for the current frame. Compared to conventional solutions with only one decoding mode, this solution, with multiple possible decoding modes, can better fit and match multiple possible scenarios. In addition, a channel coupling scheme corresponding to nearly in-phase signals is introduced, so if the stereo signal of the current frame is a nearly in-phase signal, there is a more targeted channel coupling scheme and decoding mode, which helps improve decoding quality.

[0095] As another example, if the decoding mode of the current frame is determined to be correlated signal decoding mode, the decoding device performs time-domain upmixing on the decoded primary and secondary channel signals of the current frame by using a time-domain upmixing scheme corresponding to correlated signal decoding mode in order to obtain the reconfigured left and right channel signals of the current frame. The time-domain upmixing scheme corresponding to correlated signal decoding mode is a time-domain upmixing scheme corresponding to a correlated signal channel coupling scheme, and the correlated signal channel coupling scheme is a channel coupling scheme corresponding to substantially in-phase signals.

[0096] As another example, if the decoding mode of the current frame is determined to be a mode that switches signal decoding from correlation to decorrelation, the decoding device performs a time-domain upmix on the decoded primary and secondary channel signals of the current frame by using a time-domain upmixing method that corresponds to the mode that switches signal decoding from correlation to decorrelation in order to obtain the reconfigured left and right channel signals of the current frame. The time-domain upmixing method that corresponds to the mode that switches signal decoding from correlation to decorrelation is a time-domain upmixing method that corresponds to the transition from a correlated signal channel coupling scheme to a decorrelation signal channel coupling scheme.

[0097] As another example, if the decoding mode of the current frame is determined to be a mode that switches signal decoding from inverse correlation to correlation, the decoder performs a time-domain upmix on the decoded primary and secondary channel signals of the current frame by using a time-domain upmixing scheme that corresponds to the mode that switches signal decoding from inverse correlation to correlation in order to obtain the reconfigured left and right channel signals of the current frame. The time-domain upmixing scheme that corresponds to the mode that switches signal decoding from inverse correlation to correlation is a time-domain upmixing scheme that corresponds to the transition from an inversely correlated signal channel coupling scheme to a correlated signal channel coupling scheme.

[0098] It will be understood that different decoding modes typically correspond to different time-domain upmixing schemes, and each decoding mode may correspond to one or more time-domain upmixing schemes.

[0099] The above solution requires determining the channel coupling scheme of the current frame, which indicates that there are multiple possible channel coupling schemes for the current frame. Compared to conventional solutions with only one possible channel coupling scheme, this solution, with multiple possible channel coupling schemes, can better fit and match multiple possible scenarios. In the above solution, the decoding mode of the current frame must be determined based on the channel coupling scheme of the previous frame and the channel coupling scheme of the current frame, and there are multiple possible decoding modes for the current frame. Compared to conventional solutions with only one decoding mode, this solution, with multiple possible decoding modes, can better fit and match multiple possible scenarios.

[0100] Furthermore, the decoder performs a time-domain upmix on the decoded primary and secondary channel signals of the current frame, based on a time-domain upmix corresponding to the decoding mode of the current frame, in order to obtain the reconfigured left and right channel signals of the current frame.

[0101] The following examples illustrate several specific implementations of how the encoding device determines the channel coupling scheme of the current frame. There are various specific implementations of how the encoding device determines the channel coupling scheme of the current frame.

[0102] For example, in some possible implementations, determining the channel coupling scheme of the current frame may involve performing a channel coupling scheme determination of the current frame at least once in order to determine the channel coupling scheme of the current frame.

[0103] Specifically, for example, determining the channel coupling scheme of the current frame includes performing an initial channel coupling scheme determination for the current frame in order to determine the initial channel coupling scheme of the current frame, and performing a channel coupling scheme modification determination for the current frame based on the initial channel coupling scheme of the current frame in order to determine the channel coupling scheme of the current frame. In addition, the initial channel coupling scheme of the current frame can also be used directly as the channel coupling scheme of the current frame. In other words, the channel coupling scheme of the current frame may be the initial channel coupling scheme of the current frame determined after the initial channel coupling scheme determination of the current frame has been performed.

[0104] For example, performing the initial channel coupling scheme determination for the current frame may include determining the in-phase / out-of-phase nature of the stereo signal for the current frame by using the left and right channel signals of the current frame, and determining the initial channel coupling scheme for the current frame based on the in-phase / out-of-phase nature of the stereo signal for the current frame and the channel coupling scheme of the previous frame. The in-phase / out-of-phase nature of the stereo signal for the current frame may be approximately in-phase or approximately out-of-phase. The in-phase / out-of-phase nature of the stereo signal for the current frame may be indicated by the signal type of the in-phase / out-of-phase flag for the current frame (for example, the signal type of the in-phase / out-of-phase flag is represented by tmp_SM_flag). Specifically, for example, if the signal type value of the current frame's in-phase / out-of-phase flag is "1", it indicates that the in-phase / out-of-phase signal type of the current frame's stereo signal is approximately in-phase, or if the signal type value of the current frame's in-phase / out-of-phase flag is "0", it indicates that the in-phase / out-of-phase signal type of the current frame's stereo signal is approximately out-of-phase, and vice versa.

[0105] The channel coupling scheme of an audio frame (e.g., the previous frame or the current frame) can be indicated by the audio frame's channel coupling scheme flag. For example, a value of "0" for the audio frame's channel coupling scheme flag indicates that the audio frame's channel coupling scheme is a correlated signal channel coupling scheme, or a value of "1" indicates that the audio frame's channel coupling scheme is an anticorrelated signal channel coupling scheme, and vice versa.

[0106] Similarly, the initial channel coupling scheme of an audio frame (e.g., the previous or current frame) can be indicated by the audio frame's initial channel coupling scheme flag (e.g., the initial channel coupling scheme flag is represented by tdm_SM_flag_loc). For example, a value of "0" for the audio frame's initial channel coupling scheme flag indicates that the audio frame's initial channel coupling scheme is a correlated signal channel coupling scheme, or, in another example, a value of "1" for the audio frame's initial channel coupling scheme indicates that the audio frame's initial channel coupling scheme is an anticorrelated signal channel coupling scheme, and vice versa.

[0107] Determining whether the stereo signal of the current frame is in-phase or out-of-phase by using the left and right channel signals of the current frame may include calculating the correlation value xorr between the left and right channel signals of the current frame, determining that the stereo signal of the current frame is approximately in-phase if xorr is less than or equal to a first threshold, or determining that the stereo signal of the current frame is approximately out-of-phase if xorr is greater than the first threshold. Furthermore, if the signal type of the current frame's in-phase / out-of-phase flag is used to indicate the in-phase / out-of-phase signal type of the current frame's stereo signal, and it is determined that the in-phase / out-of-phase signal type of the current frame's stereo signal is approximately in-phase, then the value of the signal type of the current frame's in-phase / out-of-phase flag may be set to indicate that the in-phase / out-of-phase signal type of the current frame's stereo signal is approximately in-phase, or if it is determined that the in-phase / out-of-phase signal type of the current frame's stereo signal is approximately in-phase, then the value of the signal type of the current frame's in-phase / out-of-phase flag may be set to indicate that the in-phase / out-of-phase signal type of the current frame's stereo signal is approximately out-of-phase.

[0108] The range of the first threshold value may be, for example, (0.5, 1.0), and the first threshold may be equal to, for example, 0.5, 0.85, 0.75, 0.65, or 0.81.

[0109] Specifically, for example, if the signal type value of the in-phase / out-of-phase flag of an audio frame (e.g., the previous frame or the current frame) is "0", it indicates that the in-phase / out-of-phase signal type of the stereo signal in the audio frame is approximately in-phase, or if the signal type value of the in-phase / out-of-phase flag of an audio frame (e.g., the previous frame or the current frame) is "1", it indicates that the in-phase / out-of-phase signal type of the stereo signal in the audio frame is approximately out-of-phase, and vice versa.

[0110] For example, determining the initial channel coupling scheme of the current frame based on the in-phase / out-of-phase signal types of the stereo signal in the current frame and the channel coupling scheme of the previous frame is possible. If the in-phase / out-of-phase signal type of the stereo signal in the current frame is approximately in-phase, and the channel coupling scheme of the previous frame was a correlated-signal channel coupling scheme, then it is determined that the initial channel coupling scheme of the current frame is a correlated-signal channel coupling scheme; or, if the in-phase / out-of-phase signal type of the stereo signal in the current frame is approximately out-of-phase, and the channel coupling scheme of the previous frame was an anticorrelated-signal channel coupling scheme, then it is determined that the initial channel coupling scheme of the current frame is an anticorrelated-signal channel coupling scheme; or If the in-phase / out-of-phase signal types of the stereo signal in the current frame are approximately in-phase signals, and the channel coupling scheme of the previous frame was an anticorrelated signal channel coupling scheme, then if the signal-to-noise ratio of both the left and right channel signals of the current frame is less than the second threshold, then it is determined that the initial channel coupling scheme of the current frame is a correlated signal channel coupling scheme. Alternatively, if the signal-to-noise ratio of the left channel signal and / or the right channel signal of the current frame is greater than or equal to the second threshold, then it is determined that the initial channel coupling scheme of the current frame is an anticorrelated signal channel coupling scheme. This may include determining that the initial channel coupling scheme for the current frame is an anticorrelated channel coupling scheme if the in-phase / out-of-phase signal types of the stereo signal in the current frame are approximately out-of-phase signals, and the channel coupling scheme of the previous frame is a correlated-signal channel coupling scheme, and both the signal-to-noise ratios of the left and right channel signals in the current frame are less than a second threshold, or determining that the initial channel coupling scheme for the current frame is a correlated-signal channel coupling scheme if the signal-to-noise ratio of the left channel signal and / or the right channel signal in the current frame are greater than or equal to a second threshold.

[0111] The range of the second threshold value could be, for example, [0.8, 1.2], and the second threshold could be, for example, equal to 0.8, 0.85, 0.9, 1, 1.1, or 1.18.

[0112] Making a decision to change the channel coupling scheme for the current frame based on the initial channel coupling scheme of the current frame may involve determining the channel coupling scheme of the current frame based on the channel coupling ratio coefficient change flag of the previous frame, the in-phase / out-of-phase signal types of the stereo signals in the current frame, and the initial channel coupling scheme of the current frame.

[0113] The channel coupling scheme flag for the current frame is indicated as tdm_SM_flag, and the channel coupling ratio coefficient modification flag for the current frame is indicated as tdm_SM_modi_flag. For example, a value of 0 for the channel coupling ratio coefficient modification flag indicates that the channel coupling ratio coefficient does not need to be changed, or a value of 1 for the channel coupling ratio coefficient modification flag indicates that the channel coupling ratio coefficient needs to be changed. Naturally, other different values ​​may be used as the channel coupling ratio coefficient modification flag to indicate whether or not the channel coupling ratio coefficient needs to be changed.

[0114] Specifically, for example, performing a decision to change the channel coupling scheme of the current frame based on the result of the initial channel coupling scheme determination of the current frame is: If the channel coupling ratio coefficient change flag for the previous frame indicates that the channel coupling ratio coefficients need to be changed, this may include using an anticorrelated signal channel coupling scheme as the channel coupling scheme for the current frame; or, if the channel coupling ratio coefficient change flag for the previous frame indicates that the channel coupling ratio coefficients do not need to be changed, this may include determining whether the current frame satisfies the switching condition and, based on the result of determining whether the current frame satisfies the switching condition, determining the channel coupling scheme for the current frame.

[0115] Determining the channel coupling scheme of the current frame based on the result of determining whether the current frame satisfies the switching conditions is: If the channel coupling scheme of the previous frame is different from the initial channel coupling scheme of the current frame, and the current frame satisfies the switching condition, and the initial channel coupling scheme of the current frame is a correlated signal channel coupling scheme, and the channel coupling scheme of the previous frame was an anticorrelated signal channel coupling scheme, then it is determined that the channel coupling scheme of the current frame is an anticorrelated signal channel coupling scheme, or If the channel coupling scheme of the previous frame is different from the initial channel coupling scheme of the current frame, the current frame satisfies the switching condition, the initial channel coupling scheme of the current frame is an anticorrelated signal channel coupling scheme, the channel coupling scheme of the previous frame is a correlated signal channel coupling scheme, and the channel coupling ratio coefficient of the previous frame is smaller than the first ratio coefficient threshold, then it is determined that the channel coupling scheme of the current frame is a correlated signal channel coupling scheme, or If the channel coupling scheme of the previous frame is different from the initial channel coupling scheme of the current frame, the current frame satisfies the switching condition, the initial channel coupling scheme of the current frame is an inversely correlated signal channel coupling scheme, the channel coupling scheme of the previous frame is a correlated signal channel coupling scheme, and the channel coupling ratio coefficient of the previous frame is greater than or equal to the first ratio coefficient threshold, then it is determined that the channel coupling scheme of the current frame is an inversely correlated signal channel coupling scheme, or If the channel coupling scheme of the (P-1)th frame from the current frame is different from the initial channel coupling scheme of the Pth frame from the current frame, the Pth frame from the current frame does not satisfy the switching condition, the current frame satisfies the switching condition, the in-phase / out-of-phase signal types of the stereo signal in the current frame are approximately in-phase signals, the initial channel coupling scheme of the current frame is a correlated signal channel coupling scheme, and the channel coupling scheme of the previous frame is an anticorrelated signal channel coupling scheme, then it is determined that the channel coupling scheme of the current frame is a correlated signal channel coupling scheme, or If the channel coupling scheme of the (P-1)th frame from the current frame is different from the initial channel coupling scheme of the Pth frame from the current frame, the Pth frame from the current frame does not satisfy the switching condition, the current frame satisfies the switching condition, the in-phase / out-of-phase signal types of the stereo signal in the current frame are approximately out-of-phase signals, the initial channel coupling scheme of the current frame is an anticorrelated signal channel coupling scheme, the channel coupling scheme of the previous frame is a correlated signal channel coupling scheme, and the channel coupling ratio coefficient of the previous frame is smaller than the second ratio coefficient threshold, then it is determined that the channel coupling scheme of the current frame is a correlated signal channel coupling scheme, or This may include determining that the channel coupling scheme of the current frame is an inversely correlated signal channel coupling scheme if the channel coupling scheme of the (P-1)th frame from the current frame is different from the initial channel coupling scheme of the Pth frame from the current frame, the Pth frame from the current frame does not satisfy the switching condition, the current frame satisfies the switching condition, the in-phase / out-of-phase signal types of the stereo signals in the current frame are approximately out-of-phase signals, the initial channel coupling scheme of the current frame is an inversely correlated signal channel coupling scheme, the channel coupling scheme of the previous frame is a correlated signal channel coupling scheme, and the channel coupling ratio coefficient of the previous frame is greater than or equal to a second ratio coefficient threshold.

[0116] Here, P can be an integer greater than 1. For example, P may be equal to 2, 3, 4, 5, 6, or any other value.

[0117] The range of the first ratio coefficient threshold may be, for example, [0.4, 0.6], and the first ratio coefficient threshold may be equal to, for example, 0.4, 0.45, 0.5, 0.55, or 0.6.

[0118] The range of the second ratio coefficient threshold may be, for example, [0.4, 0.6], and the second ratio coefficient threshold may be equal to, for example, 0.4, 0.46, 0.5, 0.56, or 0.6.

[0119] In some possible implementations, determining whether the current frame satisfies the switching condition may involve determining whether the current frame satisfies the switching condition based on the frame type of the primary channel signal and / or the frame type of the secondary channel signal of the previous frame.

[0120] In some possible implementations, determining whether the current frame satisfies the switching conditions is: This may include determining that the current frame satisfies the switching condition if all of the first, second, and third conditions are met, or determining that the current frame satisfies the switching condition if all of the second, third, fourth, and fifth conditions are met, or determining that the current frame satisfies the switching condition if the sixth condition is met.

[0121] The first condition is as follows: the frame type of the primary channel signal of the frame before the previous frame is one of the following: VOICED_CLAS frame (a frame with voiced characteristics following a voiced frame or voiced onset frame), ONSET frame (a voiced onset frame), SIN_ONSET frame (an onset frame with a mixture of harmonics and noise), INACTIVE_CLAS frame (a frame with inactive characteristics), and AUDIO_CLAS (an audio frame); the frame type of the primary channel signal of the previous frame is UNVOICED_CLAS frame (a frame ending with one of several characteristics, i.e., silent, inactive, noise, or voiced) or VOICED_TRANSITION frame (a frame with a transition after a voiced sound, and the frame has very weak voiced characteristics); or the frame type of the secondary channel signal of the frame before the previous frame is VOICED_CLAS frame, ONSET frame, SIN_ONSET frame, INACTIVE_CLAS frame, and AUDIO_CLAS It is one of the frames, and the frame type of the secondary channel signal of the previous frame is either an UNVOICED_CLAS frame or a VOICED_TRANSITION frame.

[0122] The second condition is as follows: the raw coding mode of both the primary and secondary channel signals of the previous frame is not VOICED (the coding type corresponding to a voiced frame).

[0123] The third condition is as follows: the number of consecutive frames prior to the frame using the channel joining scheme used by the previous frame is greater than a pre-set frame threshold. The range of values ​​for the frame threshold may be, for example, [3, 10]. For example, the frame threshold may be equal to 3, 4, 5, 6, 7, 8, 9, or any other value.

[0124] The fourth condition is as follows: the frame type of the primary channel signal of the previous frame is UNVOICED_CLAS, or the frame type of the secondary channel signal of the previous frame is UNVOICED_CLAS.

[0125] The fifth condition is as follows: the long-time root mean square energy values ​​of the left and right channel signals of the current frame are less than the energy threshold. The range of the energy threshold can be, for example, [300, 500]. For example, Energy The threshold may be equal to 300, 400, 410, 451, 482, 500, 415, or any other value.

[0126] The sixth condition is as follows: the frame type of the primary channel signal of the previous frame is a music signal, the ratio of the energy in the low-frequency band of the primary channel signal of the previous frame to the energy in the high-frequency band is greater than the first energy ratio threshold, and the ratio of the energy in the low-frequency band of the secondary channel signal of the previous frame to the energy in the high-frequency band is greater than the second energy ratio threshold.

[0127] The range of the first energy ratio threshold can be, for example, [4000, 6000]. For example, First energy ratio The threshold may be equal to 4000, 4500, 5000, 5105, 5200, 6000, 5800, or any other value.

[0128] The range of the second energy ratio threshold can be, for example, [4000, 6000]. For example, Second energy ratio The threshold may be equal to 4000, 4501, 5000, 5105, 5200, 6000, 5800, or any other value.

[0129] It should be understood that there are various implementations for determining whether the current frame satisfies the switching conditions, and these are not limited to the methods given as examples above.

[0130] While the above examples provide several implementations for determining the channel coupling scheme of the current frame, it should be understood that actual applications are not limited to the methods shown in the examples.

[0131] The following examples will be used to illustrate scenarios in the anticorrelated signal coding mode.

[0132] Referring to Figure 4, one embodiment of the present application provides an audio coding method. The relevant steps of the audio coding method may be carried out by an coding device, and the method may particularly include the following:

[0133] 401. Determine the encoding mode of the current frame.

[0134] 402. If it is determined that the encoding mode of the current frame is inversely correlated signal encoding mode, time-domain downmixing is performed on the left and right channel signals of the current frame by using a time-domain downmixing method corresponding to the inversely correlated signal encoding mode in order to obtain the primary and secondary channel signals of the current frame.

[0135] 403. Encode the acquired primary and secondary channel signals of the current frame.

[0136] The time-domain downmixing scheme corresponding to the anticorrelated signal coding mode is the time-domain downmixing scheme corresponding to the anticorrelated signal channel coupling scheme, and the anticorrelated signal channel coupling scheme is the channel coupling scheme corresponding to nearly in-phase signals.

[0137] For example, in some possible implementations, performing a time-domain downmix on the left and right channel signals of the current frame by using a time-domain downmixing method corresponding to the anticorrelated signal coding mode to obtain the primary and secondary channel signals of the current frame may include performing a time-domain downmix on the left and right channel signals of the current frame based on the channel coupling ratio coefficients of the anticorrelated signal channel coupling scheme of the current frame to obtain the primary and secondary channel signals of the current frame, or performing a time-domain downmix on the left and right channel signals of the current frame based on the channel coupling ratio coefficients of the anticorrelated signal channel coupling scheme of the current frame and the channel coupling ratio coefficients of the anticorrelated signal channel coupling scheme of the previous frame to obtain the primary and secondary channel signals of the current frame.

[0138] The channel coupling scheme of audio frames (e.g., the current frame or the previous frame) (e.g., the anticorrelated signal channel coupling scheme) is It will be understood that the channel coupling ratio coefficients of the signal channel coupling scheme can be a pre-set fixed value. Naturally, the channel coupling ratio coefficients of an audio frame may also be determined based on the channel coupling scheme of the audio frame.

[0139] In some possible implementations, the corresponding downmix matrix may be constructed based on the channel coupling ratio coefficients of the audio frame, and the time-domain downmixing is performed on the left and right channel signals of the current frame by using the downmix matrix corresponding to the channel coupling scheme to obtain the primary and secondary channel signals of the current frame.

[0140] For example, if time-domain downmixing is performed on the left and right channel signals of the current frame to obtain the primary and secondary channel signals of the current frame, based on the channel coupling ratio coefficients of the inversely correlated signal channel coupling scheme of the current frame,

number

[0141] As another example, consider a case where time-domain downmixing is performed on the left and right channel signals of the current frame to obtain the primary and secondary channel signals of the current frame, based on the channel coupling ratio coefficients of the inversely correlated signal channel coupling scheme of the current frame and the channel coupling ratio coefficients of the inversely correlated signal channel coupling scheme of the previous frame.

number

[0142] As another example, consider a case where time-domain downmixing is performed on the left and right channel signals of the current frame to obtain the primary and secondary channel signals of the current frame, based on the channel coupling ratio coefficients of the inversely correlated signal channel coupling scheme of the current frame and the channel coupling ratio coefficients of the inversely correlated signal channel coupling scheme of the previous frame.

number

[0143] Here, fade_in(n) represents the fade-in coefficient. For example,

number

[0144] fade_out(n) indicates the fade-out coefficient. For example,

number

[0145] NOVA_1 indicates the length of the transition process. The value of NOVA_1 can be set based on specific scenario requirements. For example, NOVA_1 may be equal to 3 / N, or it may be another value less than N.

[0146] In another example, time-domain downmixing is performed on the left and right channel signals of the current frame by using a time-domain downmixing method corresponding to the correlated signal coding mode to obtain the primary and secondary channel signals of the current frame.

number

[0147] In the example above, x L (n) represents the left channel signal of the current frame. x R (n) represents the right channel signal of the current frame. Y(n) represents the primary channel signal present in the current frame and obtained by time-domain downmixing, and X(n) represents the secondary channel signal present in the current frame and obtained by time-domain downmixing.

[0148] In the example above, n represents the sampling point number. For example, n = 0, 1, ..., N-1.

[0149] In the example above, `delay_com` indicates coding delay compensation.

[0150] M 11This shows the downmix matrix corresponding to the correlation signal channel coupling scheme of the previous frame, M 11 This is constructed based on the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the previous frame.

[0151] M 12 This shows the downmix matrix corresponding to the anticorrelated signal channel coupling scheme of the previous frame, M 12 This is constructed based on the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the previous frame.

[0152] M 22 This shows the downmix matrix corresponding to the inversely correlated signal channel coupling scheme of the current frame, M 22 This is constructed based on the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame.

[0153] M 21 This shows the downmix matrix corresponding to the correlation signal channel coupling scheme of the current frame, M 21 This is constructed based on the channel coupling ratio coefficients corresponding to the correlation signal channel coupling scheme of the current frame.

[0154] M 21 It can have multiple forms, for example,

number

[0155] M 22 It can have multiple forms, for example,

number

[0156] M 12 It can have multiple forms, for example,

number

[0157] The left and right channel signals of the current frame may be, specifically, the original left and right channel signals of the current frame (the original left and right channel signals are left and right channel signals that have not undergone time-domain preprocessing, and may, for example, be left and right channel signals obtained by sampling), the left and right channel signals of the current frame that have undergone time-domain preprocessing, or the left and right channel signals of the current frame that have undergone delay alignment processing.

[0158] Specifically, for example,

number

number

number

number

[0159] Accordingly, the following examples will be used to illustrate scenarios in the inverse correlation signal decoding mode.

[0160] Referring to Figure 5, one embodiment of the present application further provides an audio decoding method. The relevant steps of the audio decoding method may be carried out by a decoding device, and the method may particularly include the following steps.

[0161] 501. Decoding is performed based on the bitstream to obtain the decoded primary and secondary channel signals of the current frame.

[0162] 502. Determine the decoding mode of the current frame.

[0163] It should be understood that there is no specific order in which steps 501 and 502 should be performed.

[0164] 503. If it is determined that the decoding mode of the current frame is inverse correlation decoding mode, time-domain upmixing is performed on the decoded primary and secondary channel signals of the current frame by using a time-domain upmixing method corresponding to the inverse correlation decoding mode in order to obtain the reconfigured left and right channel signals of the current frame.

[0165] The reconstructed left and right channel signals may be the decoded left and right channel signals, or delay adjustment and / or time-domain post-processing may be performed on the reconstructed left and right channel signals in order to obtain the decoded left and right channel signals.

[0166] The time-domain upmixing method corresponding to the anticorrelation signal decoding mode is the time-domain upmixing method corresponding to the anticorrelation signal channel coupling scheme, and the anticorrelation signal channel coupling scheme is the channel coupling scheme corresponding to nearly in-phase signals.

[0167] The decoding mode of the current frame can be one of several decoding modes. For example, the decoding mode of the current frame can be one of the following decoding modes: correlated signal decoding mode, anticorrelated signal decoding mode, a mode that switches signal decoding from correlated to anticorrelated, and a mode that switches signal decoding from anticorrelated to correlated.

[0168] The solution described above requires determining the decoding mode of the current frame, which should be understood as indicating that there are multiple possible decoding modes for the current frame. Compared to conventional solutions with only one decoding mode, this solution, with multiple possible decoding modes, can better fit and match multiple possible scenarios. In addition, a channel coupling scheme corresponding to nearly in-phase signals is introduced, so if the stereo signal of the current frame is a nearly in-phase signal, there is a more targeted channel coupling scheme and decoding mode, which helps improve decoding quality.

[0169] In some possible implementations, this method When it is determined that the decoding mode of the current frame is correlated signal decoding mode, time-domain upmixing is performed on the decoded primary and secondary channel signals of the current frame by using a time-domain upmixing method corresponding to the correlated signal decoding mode in order to obtain the reconstructed left and right channel signals of the current frame, wherein the time-domain upmixing method corresponding to the correlated signal decoding mode is a time-domain upmixing method corresponding to a correlated signal channel coupling scheme, and the correlated signal channel coupling scheme is a channel coupling scheme corresponding to substantially in-phase signals. This may further include:

[0170] In some possible implementations, the method, when it is determined that the decoding mode of the current frame is a mode that switches signal decoding from correlation to decorrelation, performs a time-domain upmix on the decoded primary and secondary channel signals of the current frame by using a time-domain upmixing scheme corresponding to the mode that switches signal decoding from correlation to decorrelation in order to obtain the reconfigured left and right channel signals of the current frame, further comprising the case where the time-domain upmixing scheme corresponding to the mode that switches signal decoding from correlation to decorrelation is a time-domain upmixing scheme corresponding to the transition from a correlated-channel coupling scheme to a decorrelation-channel coupling scheme.

[0171] In some possible implementations, the method, when it is determined that the decoding mode of the current frame is a mode that switches signal decoding from inverse correlation to correlation, performs a time-domain upmix on the decoded primary and secondary channel signals of the current frame by using a time-domain upmixing scheme corresponding to the mode that switches signal decoding from inverse correlation to correlation in order to obtain the reconfigured left and right channel signals of the current frame, further comprising the case where the time-domain upmixing scheme corresponding to the mode that switches signal decoding from inverse correlation to correlation is a time-domain upmixing scheme corresponding to the transition from an inversely correlated signal channel coupling scheme to a correlated signal channel coupling scheme.

[0172] It will be understood that different decoding modes typically correspond to different time-domain upmixing schemes, and each decoding mode may correspond to one or more time-domain upmixing schemes.

[0173] For example, in some possible implementations, in order to obtain the reconstructed left and right channel signals of the current frame, by using a time-domain upmix processing method corresponding to the decorrelation signal decoding mode, performing time-domain upmix processing on the decoded primary and secondary channel signals of the current frame is In order to obtain the reconstructed left and right channel signals of the current frame, based on the channel coupling ratio coefficient of the decorrelation signal channel coupling scheme of the current frame, performing time-domain upmix processing on the decoded primary and secondary channel signals of the current frame, or in order to obtain the reconstructed left and right channel signals of the current frame, based on the channel coupling ratio coefficient of the decorrelation signal channel coupling scheme of the current frame and the channel coupling ratio coefficient of the decorrelation signal channel coupling scheme of the previous frame, performing time-domain upmix processing on the decoded primary and secondary channel signals of the current frame is included.

[0174] In some possible implementations, the corresponding upmix matrix can be configured based on the channel coupling ratio coefficient of the audio frame, and the time-domain upmix processing is performed on the decoded primary and secondary channel signals of the current frame by using the upmix matrix corresponding to the channel coupling scheme in order to obtain the reconstructed left and right channel signals of the current frame.

[0175] For example, when the time-domain upmix processing is performed on the decoded primary and secondary channel signals of the current frame based on the channel coupling ratio coefficient of the decorrelation signal channel coupling scheme of the current frame in order to obtain the reconstructed left and right channel signals of the current frame,

Number

[0176] As another example, when the time-domain upmixing process is performed on the decoded primary and secondary channel signals of the current frame to obtain the reconstructed left and right channel signals of the current frame based on the channel coupling ratio coefficients of the decorrelation signal channel coupling scheme of the current frame and the channel coupling ratio coefficients of the decorrelation signal channel coupling scheme of the previous frame, [Number] where delay_com indicates coding delay compensation.

[0177] As another example, when the time-domain upmixing process is performed on the decoded primary and secondary channel signals of the current frame to obtain the reconstructed left and right channel signals of the current frame based on the channel coupling ratio coefficients of the decorrelation signal channel coupling scheme of the current frame and the channel coupling ratio coefficients of the decorrelation signal channel coupling scheme of the previous frame, [Number] is as follows.

[0178] Here, [Number] indicates the decoded left channel signal of the current frame, [Number] indicates the reconstructed right channel signal of the current frame, [Number] indicates the decoded primary channel signal of the current frame, [Number] indicates the decoded secondary channel signal of the current frame.

[0179] NOVA_1 indicates the length of the transition process.

[0180] fade_in(n) indicates the fade-in coefficient. For example,

Number

[0181] fade_out(n) indicates the fade-out coefficient. For example,

Number

[0182] NOVA_1 indicates the length of the transition process. The value of NOVA_1 can be set based on specific scenario requirements. For example, NOVA_1 may be equal to 3 / N, or NOVA_1 may be another value smaller than N.

[0183] In another example, when the time-domain upmixing process is performed on the decoded primary and secondary channel signals of the current frame in order to obtain the reconstructed left and right channel signals of the current frame based on the channel combination ratio coefficient of the correlation signal channel combination scheme of the current frame,

Number

[0184] In the above example,

Number

Number

number

number

[0185] In the example above, n represents the sampling point number. For example, n = 0, 1, ..., N-1.

[0186] In the example above, upmixing_delay indicates decoding delay compensation.

[0187]

number

number

[0188]

number

number

[0189]

number

number

[0190]

number

number

[0191]

number

number

[0192]

number

number

[0193]

number

number

[0194] The following describes the modes for switching signal coding from correlation to inverse correlation and inverse correlation. ra An example is used to illustrate the scenario of switching signal coding modes. This includes modes that switch signal coding from correlated to inversely correlated, and inversely correlated. ra A time-domain downmixing method that corresponds to a mode of switching signal coding is, for example, a segmented time-domain downmixing method.

[0195] Referring to Figure 6, one embodiment of the present application provides an audio coding method. The relevant steps of the audio coding method may be carried out by an coding device, and the method may particularly include the following:

[0196] 601. Determine the channel coupling scheme of the current frame.

[0197] 602. If the channel coupling scheme of the current frame differs from that of the previous frame, a segmented time-domain downmix process is performed on the left and right channel signals of the current frame, based on the channel coupling scheme of the current frame and the channel coupling scheme of the previous frame, in order to obtain the primary and secondary channel signals of the current frame.

[0198] 603. Encode the acquired primary and secondary channel signals of the current frame.

[0199] If the channel coupling scheme of the current frame is different from the channel coupling scheme of the previous frame, the coding mode of the current frame is either a mode that switches the signal coding from correlated to decorrelated or decorrelated. ra It can be determined that the mode is switching signal coding. The coding mode of the current frame is either switching signal coding from correlated to inversely correlated or inversely correlated. ra In a mode where signal coding is switched on and off, for example, a segmented time-domain downmixing process may be performed on the left and right channel signals of the current frame based on the channel coupling scheme of the current frame and the channel coupling scheme of the previous frame.

[0200] Specifically, for example, if the channel coupling scheme of the previous frame is a correlated signal channel coupling scheme and the channel coupling scheme of the current frame is an anticorrelated signal channel coupling scheme, the encoding mode of the current frame can be determined to be a mode that switches signal coding from correlated to anticorrelated. In another example, if the channel coupling scheme of the previous frame is an anticorrelated signal channel coupling scheme and the channel coupling scheme of the current frame is a correlated signal channel coupling scheme, the encoding mode of the current frame can be determined to be a mode that switches signal coding from anticorrelated to correlated. The rest can be inferred by analogy.

[0201] Segmented time-domain downmixing can be understood as the left and right channel signals of the current frame being divided into at least two segments, with a different time-domain downmixing scheme being used for each segment to perform the downmixing. Compared to unsegmented time-domain downmixing, segmented time-domain downmixing is likely to yield better and smoother transitions when the channel coupling scheme of adjacent frames changes.

[0202] The above solution requires determining the channel coupling scheme of the current frame, which indicates that there are multiple possible channel coupling schemes for the current frame. Compared to conventional solutions with only one possible channel coupling scheme, this solution, with multiple possible channel coupling schemes, can better accommodate and match multiple possible scenarios. In addition, if the channel coupling scheme of the current frame differs from that of the previous frame, a mechanism is introduced to perform segmented time-domain downmixing on the left and right channel signals of the current frame. This segmented time-domain downmixing mechanism facilitates a smooth transition between channel coupling schemes and further improves encoding quality.

[0203] In addition, a channel coupling scheme that handles nearly in-phase signals has been introduced, so if the stereo signal of the current frame is nearly in-phase, there is a more targeted channel coupling scheme and coding mode, which helps to improve coding quality.

[0204] For example, the channel coupling scheme of the previous frame could be either a correlated-signal channel coupling scheme or an anticorrelated-signal channel coupling scheme. The channel coupling scheme of the current frame could also be either a correlated-signal channel coupling scheme or an anticorrelated-signal channel coupling scheme. Therefore, there are several possible cases where the channel coupling scheme of the current frame differs from that of the previous frame.

[0205] Specifically, for example, if the channel coupling scheme of the previous frame is a correlated signal channel coupling scheme and the channel coupling scheme of the current frame is an anticorrelated signal channel coupling scheme, then the left and right channel signals of the current frame include the start segments of the left and right channel signals, the middle segments of the left and right channel signals, and the end segments of the left and right channel signals, and the primary and secondary channel signals of the current frame include the start segments of the primary and secondary channel signals, the middle segments of the primary and secondary channel signals, and the end segments of the primary and secondary channel signals. In this case, in order to obtain the primary and secondary channel signals of the current frame, performing a segmented time-domain downmix process on the left and right channel signals of the current frame based on the channel coupling scheme of the current frame and the channel coupling scheme of the previous frame is: To obtain the start segments of the primary and secondary channel signals of the current frame, time-domain downmixing is performed on the start segments of the left and right channel signals of the current frame by using the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the previous frame and the time-domain downmixing method corresponding to the correlated signal channel coupling scheme of the previous frame. To obtain the end segments of the primary and secondary channel signals of the current frame, a time-domain downmix is ​​performed on the end segments of the left and right channel signals of the current frame by using the channel coupling ratio coefficients corresponding to the inverse correlation signal channel coupling scheme of the current frame and the time-domain downmix processing method corresponding to the inverse correlation signal channel coupling scheme of the current frame. This may include: performing a time-domain downmix on the intermediate segments of the left and right channel signals of the current frame to obtain a first intermediate segment of the primary and secondary channel signals by using channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the previous frame and a time-domain downmix processing method corresponding to the correlated signal channel coupling scheme of the previous frame; performing a time-domain downmix on the intermediate segments of the left and right channel signals of the current frame to obtain a second intermediate segment of the primary and secondary channel signals by using channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame and a time-domain downmix processing method corresponding to the anticorrelated signal channel coupling scheme of the current frame; and performing a weighted sum processing on the first intermediate segment of the primary and secondary channel signals and the second intermediate segment of the primary and secondary channel signals to obtain the intermediate segments of the primary and secondary channel signals of the current frame.

[0206] The lengths of the start segments, middle segments, and end segments of the left and right channel signals of the current frame may be set based on requirements. The lengths of the start segments, middle segments, and end segments of the left and right channel signals of the current frame may be the same, partially the same, or different from each other.

[0207] The lengths of the start segments, middle segments, and end segments of the primary and secondary channel signals for the current frame may be set based on requirements. The lengths of the start segments, middle segments, and end segments of the primary and secondary channel signals for the current frame may be the same, partially the same, or different from each other.

[0208] When weighted summation is performed on the first intermediate segment of the primary and secondary channel signals and the second intermediate segment of the primary and secondary channel signals, the weight coefficients corresponding to the first intermediate segment of the primary and secondary channel signals may be equal to or not equal to the weight coefficients corresponding to the second intermediate segment of the primary and secondary channel signals.

[0209] For example, when weighted summation is performed on the first intermediate segment of the primary and secondary channel signals and the second intermediate segment of the primary and secondary channel signals, the weight coefficient corresponding to the first intermediate segment of the primary and secondary channel signals is the fade-out coefficient, and the weight coefficient corresponding to the second intermediate segment of the primary and secondary channel signals is the fade-in coefficient.

[0210] In some possible implementations,

number

[0211] for example,

number

[0212] For example, fade_in(n) represents the fade-in coefficient, and fade_out(n) represents the fade-out coefficient. For example, the sum of fade_in(n) and fade_out(n) is 1.

[0213] Specifically, for example,

number

[0214] Here, n represents the sampling point number. n = 0, 1, ..., N-1 and 0 <N1<N2<N-1である。

[0215] For example, N1 is equal to 100, 107, 120, 150, or another value.

[0216] For example, N2 is equal to 180, 187, 200, 203, or another value.

[0217] Here, X 211 (n) represents the first intermediate segment of the primary channel signal of the current frame, Y 211 (n) represents the first intermediate segment of the secondary channel signal of the current frame. X 212 (n) represents the second intermediate segment of the primary channel signal of the current frame, Y 212 (n) represents the second intermediate segment of the secondary channel signal of the current frame.

[0218] In some possible implementations,

number

[0219] M 22 It can have multiple possible forms, specifically, for example,

number

[0220] M 11 It can have multiple possible forms, specifically, for example,

number

[0221] Specifically, in another example, if the channel coupling scheme of the previous frame is an anticorrelated signal channel coupling scheme and the channel coupling scheme of the current frame is a correlated signal channel coupling scheme, then the left and right channel signals of the current frame include the start segments of the left and right channel signals, the middle segments of the left and right channel signals, and the end segments of the left and right channel signals, and the primary and secondary channel signals of the current frame include the start segments of the primary and secondary channel signals, the middle segments of the primary and secondary channel signals, and the end segments of the primary and secondary channel signals. In this case, in order to obtain the primary and secondary channel signals of the current frame, performing a segmented time-domain downmix process on the left and right channel signals of the current frame based on the channel coupling scheme of the current frame and the channel coupling scheme of the previous frame is: To obtain the start segments of the primary and secondary channel signals of the current frame, a time-domain downmix is ​​performed on the start segments of the left and right channel signals of the current frame by using the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the previous frame and the time-domain downmix processing scheme corresponding to the anticorrelated signal channel coupling scheme of the previous frame. To obtain the end segments of the primary and secondary channel signals of the current frame, time-domain downmixing is performed on the end segments of the left and right channel signals of the current frame by using the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame and the time-domain downmixing method corresponding to the correlated signal channel coupling scheme of the current frame. This may include performing a time-domain downmix on the intermediate segments of the left and right channel signals of the current frame by using channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the previous frame and a time-domain downmix processing method corresponding to the anticorrelated signal channel coupling scheme of the previous frame to obtain a third intermediate segment of the primary and secondary channel signals; performing a time-domain downmix on the intermediate segments of the left and right channel signals of the current frame by using channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame and a time-domain downmix processing method corresponding to the correlated signal channel coupling scheme of the current frame to obtain a fourth intermediate segment of the primary and secondary channel signals; and performing a weighted sum processing on the third intermediate segment of the primary and secondary channel signals and the fourth intermediate segment of the primary and secondary channel signals to obtain the intermediate segments of the primary and secondary channel signals of the current frame.

[0222] When weighted summation is performed on the third intermediate segment of the primary and secondary channel signals and the fourth intermediate segment of the primary and secondary channel signals, the weight coefficients corresponding to the third intermediate segment of the primary and secondary channel signals may be equal to or not equal to the weight coefficients corresponding to the fourth intermediate segment of the primary and secondary channel signals.

[0223] For example, when weighted summation is performed on the third intermediate segment of the primary and secondary channel signals and the fourth intermediate segment of the primary and secondary channel signals, the weight coefficient corresponding to the third intermediate segment of the primary and secondary channel signals is the fade-out coefficient, and the weight coefficient corresponding to the fourth intermediate segment of the primary and secondary channel signals is the fade-in coefficient.

[0224] In some possible implementations,

number

[0225] for example,

number

[0226] Specifically, for example,

number

[0227] Here, n represents the sampling point number. For example, n = 0, 1, ..., N-1.

[0228] Here, 0 <N3<N4<N-1である。

[0229] For example, N3 is equal to 101, 107, 120, 150, or another value.

[0230] For example, N4 is equal to 181, 187, 200, 205, or another value.

[0231] X 221 (n) represents the third intermediate segment of the primary channel signal of the current frame, Y 221 (n) represents the third intermediate segment of the secondary channel signal of the current frame. X 222 (n) represents the fourth intermediate segment of the primary channel signal of the current frame, Y 222 (n) represents the fourth intermediate segment of the secondary channel signal of the current frame.

[0232] In some possible implementations,

number

[0233] M 12 This shows the downmix matrix corresponding to the anticorrelated signal channel coupling scheme of the previous frame, M 12 This is constructed based on the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the previous frame. 21 This shows the downmix matrix corresponding to the correlation signal channel coupling scheme of the current frame, M 21 This is constructed based on the channel coupling ratio coefficients corresponding to the correlation signal channel coupling scheme of the current frame.

[0234] M 12It can have multiple possible forms, specifically, for example,

number

[0235] M 21 It can have multiple possible forms, specifically, for example,

number

[0236] In some possible implementations, the left and right channel signals of the current frame may be, for example, the original left and right channel signals of the current frame, or they may be left and right channel signals that have undergone time-domain preprocessing, or they may be left and right channel signals that have undergone delay alignment processing.

[0237] Specifically, for example,

number

[0238] The segmented time-domain downmixing method described above is not necessarily the only possible implementation, and it should be understood that other segmented time-domain downmixing methods may be used in actual applications.

[0239] Accordingly, the following modes switch the signal decoding from correlation to inverse correlation, and inverse correlation ra An example is used to illustrate the scenario of switching signal decoding modes. This includes modes that switch signal decoding from correlation to inverse correlation, and inverse correlation. ra A time-domain downmixing method that corresponds to a mode that switches signal decoding is, for example, a segmented time-domain downmixing method.

[0240] Referring to Figure 7, one embodiment of the present application provides an audio decoding method. The relevant steps of the audio decoding method may be carried out by a decoding device, and the method may particularly include the following steps.

[0241] 701. Decoding is performed based on the bitstream to obtain the decoded primary and secondary channel signals of the current frame.

[0242] 702. Determine the channel coupling scheme of the current frame.

[0243] It should be understood that there is no specific order in which steps 701 and 702 should be performed.

[0244] 703. If the channel coupling scheme of the current frame differs from that of the previous frame, a segmented time-domain upmix is ​​performed on the decoded primary and secondary channel signals of the current frame, based on the channel coupling scheme of the current frame and the channel coupling scheme of the previous frame, in order to obtain the reconfigured left and right channel signals of the current frame.

[0245] The current frame's channel coupling scheme is one of several channel coupling schemes.

[0246] For example, multiple channel coupling schemes include anticorrelated signal channel coupling schemes and correlated signal channel coupling schemes. Correlated signal channel coupling schemes are channel coupling schemes that correspond to nearly in-phase signals. Anticorrelated signal channel coupling schemes are channel coupling schemes that correspond to nearly in-phase signals. It will be understood that channel coupling schemes that correspond to nearly in-phase signals are applicable to nearly in-phase signals, and channel coupling schemes that correspond to nearly in-phase signals are applicable to nearly in-phase signals.

[0247] Segmented time-domain upmixing can be understood as the left and right channel signals of the current frame being divided into at least two segments, with a different time-domain upmixing scheme being used for each segment to perform the time-domain upmixing. Compared to unsegmented time-domain upmixing, segmented time-domain upmixing is likely to yield better and smoother transitions when the channel coupling scheme of adjacent frames changes.

[0248] The above solution requires determining the channel coupling scheme of the current frame, which indicates that there are multiple possible channel coupling schemes for the current frame. Compared to conventional solutions with only one possible channel coupling scheme, this solution, with multiple possible channel coupling schemes, can better accommodate and match multiple possible scenarios. In addition, if the channel coupling scheme of the current frame differs from that of the previous frame, a mechanism is introduced to perform segmented time-domain upmixing on the left and right channel signals of the current frame. This segmented time-domain upmixing mechanism facilitates a smooth transition between channel coupling schemes and further improves coding quality.

[0249] In addition, a channel coupling scheme that handles nearly in-phase signals has been introduced, so if the stereo signal of the current frame is nearly in-phase, there is a more targeted channel coupling scheme and coding mode, which helps to improve coding quality.

[0250] For example, the channel coupling scheme of the previous frame could be either a correlated-signal channel coupling scheme or an anticorrelated-signal channel coupling scheme. The channel coupling scheme of the current frame could also be either a correlated-signal channel coupling scheme or an anticorrelated-signal channel coupling scheme. Therefore, there are several possible cases where the channel coupling scheme of the current frame differs from that of the previous frame.

[0251] Specifically, for example, the channel coupling scheme of the previous frame is a correlated signal channel coupling scheme, and the channel coupling scheme of the current frame is an anticorrelated signal channel coupling scheme. The reconstructed left and right channel signals of the current frame include the start segments of the reconstructed left and right channel signals, the middle segments of the reconstructed left and right channel signals, and the end segments of the reconstructed left and right channel signals. The decoded primary and secondary channel signals of the current frame include the start segments of the decoded primary and secondary channel signals, the middle segments of the decoded primary and secondary channel signals, and the end segments of the decoded primary and secondary channel signals. In this case, performing a segmented time-domain upmix on the decoded primary and secondary channel signals of the current frame to obtain the reconstructed left and right channel signals of the current frame is equivalent to performing a time-domain upmix on the start segments of the decoded primary and secondary channel signals of the current frame by using the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the previous frame and the time-domain upmix processing scheme corresponding to the correlated signal channel coupling scheme of the previous frame to obtain the start segments of the reconstructed left and right channel signals of the current frame, To obtain the end segments of the reconfigured left and right channel signals of the current frame, time-domain upmixing is performed on the end segments of the decoded primary and secondary channel signals of the current frame by using the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame and the time-domain upmixing method corresponding to the inversely correlated signal channel coupling scheme of the current frame, This includes performing a time-domain upmix on the decoded primary and secondary channel signals of the current frame to obtain a first intermediate segment of the reconstructed left and right channel signals by using channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the previous frame and a time-domain upmix processing method corresponding to the correlated signal channel coupling scheme of the previous frame; performing a time-domain downmix on the decoded primary and secondary channel signals of the current frame to obtain a second intermediate segment of the reconstructed left and right channel signals by using channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame and a time-domain upmix processing method corresponding to the anticorrelated signal channel coupling scheme of the current frame; and performing a weighted summation on the first intermediate segment of the reconstructed left and right channel signals and the second intermediate segment of the reconstructed left and right channel signals to obtain the intermediate segments of the reconstructed left and right channel signals of the current frame.

[0252] The lengths of the start segments of the reconfigured left and right channel signals of the current frame, the middle segments of the reconfigured left and right channel signals, and the end segments of the reconfigured left and right channel signals may be set based on requirements. The lengths of the start segments of the reconfigured left and right channel signals of the current frame, the middle segments of the reconfigured left and right channel signals, and the end segments of the reconfigured left and right channel signals may be the same, partially the same, or different from each other.

[0253] The lengths of the start segment, middle segment, and end segment of the decoded primary and secondary channel signals of the current frame may be set based on requirements. The lengths of the start segment, middle segment, and end segment of the decoded primary and secondary channel signals of the current frame may be the same, partially the same, or different from each other.

[0254] The reconstructed left and right channel signals may be the decoded left and right channel signals, or delay adjustment and / or time-domain post-processing may be performed on the reconstructed left and right channel signals in order to obtain the decoded left and right channel signals.

[0255] When weighted summation is performed on the first intermediate segment of the reconstructed left and right channel signals and the second intermediate segment of the reconstructed left and right channel signals, the weight coefficient corresponding to the first intermediate segment of the reconstructed left and right channel signals may or may not be equal to the weight coefficient corresponding to the second intermediate segment of the reconstructed left and right channel signals.

[0256] For example, if weighted summation is performed on the first intermediate segment of the reconstructed left and right channel signals and the second intermediate segment of the reconstructed left and right channel signals, the weight coefficient corresponding to the first intermediate segment of the reconstructed left and right channel signals is the fade-out coefficient, and the weight coefficient corresponding to the second intermediate segment of the reconstructed left and right channel signals is the fade-in coefficient.

[0257] In some possible implementations,

number

number

number

number

number

number

number

number

number

[0258] for example,

number

[0259] For example, fade_in(n) represents the fade-in coefficient, and fade_out(n) represents the fade-out coefficient. For example, the sum of fade_in(n) and fade_out(n) is 1.

[0260] Specifically, for example,

number

[0261] Here, n represents the sampling point number, where n = 0, 1, ..., N-1. <N1<N2<N-1である。

[0262]

number

number

number

number

[0263] In some possible implementations,

number

number

number

number

number

number

number

[0264]

number

number

[0265]

number

number

[0266] Here, tdm_last_ratio represents the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the previous frame.

[0267] Specifically, in another example, the channel coupling scheme of the previous frame is an anticorrelated signal channel coupling scheme, and the channel coupling scheme of the current frame is a correlated signal channel coupling scheme. The reconstructed left and right channel signals of the current frame include the start segment of the reconstructed left and right channel signals, the middle segment of the reconstructed left and right channel signals, and the end segment of the reconstructed left and right channel signals. The decoded primary and secondary channel signals of the current frame include the start segment of the decoded primary and secondary channel signals, the middle segment of the decoded primary and secondary channel signals, and the end segment of the decoded primary and secondary channel signals. In this case, to obtain the reconstructed left and right channel signals of the current frame, a segmented time-domain upmixing process is performed on the decoded primary and secondary channel signals of the current frame based on the channel coupling scheme of the current frame and the channel coupling scheme of the previous frame. To obtain the start segments of the reconfigured left and right channel signals of the current frame, a time-domain upmix is ​​performed on the start segments of the decoded primary and secondary channel signals of the current frame, by using the channel coupling ratio coefficients corresponding to the inverse correlation signal channel coupling scheme of the previous frame and the time-domain upmix processing scheme corresponding to the inverse correlation signal channel coupling scheme of the previous frame. To obtain the end segments of the reconfigured left and right channel signals of the current frame, time-domain upmixing is performed on the end segments of the decoded primary and secondary channel signals of the current frame by using the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame and the time-domain upmixing method corresponding to the correlated signal channel coupling scheme of the current frame. This includes performing a time-domain upmix on the decoded primary and secondary channel signals of the current frame to obtain a third intermediate segment of the reconstructed left and right channel signals by using channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the previous frame and a time-domain upmix processing method corresponding to the anticorrelated signal channel coupling scheme of the previous frame; performing a time-domain downmix on the decoded primary and secondary channel signals of the current frame to obtain a fourth intermediate segment of the reconstructed left and right channel signals by using channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame and a time-domain upmix processing method corresponding to the correlated signal channel coupling scheme of the current frame; and performing a weighted summation on the third intermediate segment of the reconstructed left and right channel signals and the fourth intermediate segment of the reconstructed left and right channel signals to obtain the reconstructed left and right channel signals.

[0268] When weighted summation is performed on the third intermediate segment of the reconstructed left and right channel signals and the fourth intermediate segment of the reconstructed left and right channel signals, the weight coefficient corresponding to the third intermediate segment of the reconstructed left and right channel signals may or may not be equal to the weight coefficient corresponding to the fourth intermediate segment of the reconstructed left and right channel signals.

[0269] For example, if weighted summation is performed on the third intermediate segment of the reconstructed left and right channel signals and the fourth intermediate segment of the reconstructed left and right channel signals, the weight coefficient corresponding to the third intermediate segment of the reconstructed left and right channel signals is the fade-out coefficient, and the weight coefficient corresponding to the fourth intermediate segment of the reconstructed left and right channel signals is the fade-in coefficient.

[0270] In some possible implementations,

number

number

number

number

number

number

number

number

number

[0271] for example,

number

[0272] Specifically, for example,

number

[0273] Here, n represents the sampling point number. For example, n = 0, 1, ..., N-1.

[0274] Here, 0 <N3<N4<N-1である。

[0275] For example, N3 is equal to 101, 107, 120, 150, or another value.

[0276] For example, N4 is equal to 181, 187, 200, 205, or another value.

[0277]

number

number

number

number

[0278] In some possible implementations,

number

number

number

[0279]

number

number

number

number

[0280]

number

number

[0281]

number

number

[0282] In this embodiment of the present application, the stereo parameters of the current frame (e.g., channel coupling ratio coefficients and / or inter-channel time differences) may be fixed values ​​or may be determined based on the channel coupling scheme of the current frame (e.g., correlated-signal channel coupling scheme or anticorrelated-signal channel coupling scheme).

[0283] Referring to Figure 8, an example will be used below to illustrate the time-domain stereo parameter determination method. The relevant steps of the time-domain stereo parameter determination method may be performed by an encoding device, and this method may particularly include the following steps.

[0284] 801. Determine the channel binding scheme of the current frame.

[0285] 802. Determine the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame, wherein the time-domain stereo parameters include at least one of the channel coupling ratio coefficient and the inter-channel time difference.

[0286] The current frame's channel coupling scheme is one of several channel coupling schemes.

[0287] For example, multiple channel coupling schemes include anticorrelated signal channel coupling schemes and correlated signal channel coupling schemes.

[0288] A correlated signal channel coupling scheme is a channel coupling scheme that corresponds to nearly in-phase signals. An anticorrelated signal channel coupling scheme is a channel coupling scheme that corresponds to nearly in-phase signals. It will be understood that a channel coupling scheme that corresponds to nearly in-phase signals is applicable to nearly in-phase signals, and a channel coupling scheme that corresponds to nearly in-phase signals is applicable to nearly in-phase signals.

[0289] If the channel coupling scheme of the current frame is determined to be a correlated-signal channel coupling scheme, the time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame. Alternatively, if the channel coupling scheme of the current frame is determined to be an anticorrelated-signal channel coupling scheme, the time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame.

[0290] The solution described above requires determining the channel coupling scheme of the current frame, which should be understood as indicating that there are multiple possible channel coupling schemes for the current frame. Compared to conventional solutions with only one channel coupling scheme, this solution, with multiple possible channel coupling schemes, can better fit and match multiple possible scenarios. Since the time-domain stereo parameters of the current frame are determined based on the channel coupling scheme of the current frame, the time-domain stereo parameters can better fit and match multiple possible scenarios, potentially leading to further improvements in encoding and decoding quality.

[0291] In some possible implementations, the channel coupling ratio coefficients corresponding to the inverse-correlated signal channel coupling scheme of the current frame and the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame may be calculated separately first. Then, if the channel coupling scheme of the current frame is determined to be a correlated signal channel coupling scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the correlated signal channel coupling scheme of the current frame; or, if the channel coupling scheme of the current frame is determined to be an inverse-correlated signal channel coupling scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the inverse-correlated signal channel coupling scheme of the current frame. Alternatively, the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame may be calculated first. If the channel coupling scheme of the current frame is determined to be a correlated-signal channel coupling scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame. Or, if the channel coupling scheme of the current frame is determined to be an anticorrelated-signal channel coupling scheme, the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame are calculated, and the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame are determined to be the time-domain stereo parameters of the current frame.

[0292] Alternatively, the channel coupling scheme of the current frame may be determined first. If the channel coupling scheme of the current frame is determined to be a correlated-signal channel coupling scheme, the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame are calculated, and the time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the correlated-signal channel coupling scheme of the current frame. Or, if the channel coupling scheme of the current frame is determined to be an anticorrelated-signal channel coupling scheme, the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame are calculated, and the time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the anticorrelated-signal channel coupling scheme of the current frame.

[0293] In some possible implementations, the step of determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame includes the step of determining the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame based on the channel coupling scheme of the current frame. If it is not necessary to change the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame (correlated signal channel coupling scheme or anticorrelated signal channel coupling scheme), the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame are equal to the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame. If it is necessary to change the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame (correlated signal channel coupling scheme or anticorrelated signal channel coupling scheme), the initial value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame is changed in order to obtain the changed value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame, and the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame are equal to the changed value of the channel coupling ratio coefficients corresponding to the channel coupling scheme of the current frame.

[0294] For example, the step of determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame may include the steps of: calculating the frame energy of the left channel signal of the current frame based on the left channel signal of the current frame; calculating the frame energy of the right channel signal of the current frame based on the right channel signal of the current frame; and calculating initial values ​​of the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame based on the frame energy of the left channel signal of the current frame and the frame energy of the right channel signal of the current frame.

[0295] If there is no need to change the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, then the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme is equal to the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, and the encoded index of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme is equal to the encoded index of the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme.

[0296] If it is necessary to change the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme and its encoded index are changed in order to obtain the changed value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme and the encoded index of the changed value. The channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme is equal to the changed value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, and the encoded index of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme is equal to the encoded index of the changed value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme.

[0297] Specifically, for example, if the initial values ​​and encoded indices of the channel coupling ratio coefficients corresponding to the current frame's correlated signal channel coupling scheme are changed, ratio_idx_mod = 0.5 * (tdm_last_ratio_idx + 16), ratio bamod qua =ratio_tabl[ratio_idx_mod], tdm_last_ratio_idx indicates the encoded index of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the previous frame, ratio_idx_mod indicates the encoded index of the changed value of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the current frame, and ratio_mod qua This shows the change in the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme.

[0298] As another example, the step of determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame includes the steps of: obtaining the reference channel signal of the current frame based on the left channel signal and the right channel signal of the current frame; calculating the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame; calculating the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame; calculating the amplitude correlation difference parameter between the left and right channel signals of the current frame based on the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame and the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame; and calculating the channel coupling ratio coefficients corresponding to the anticorrelation signal channel coupling scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame.

[0299] The step of calculating the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame may include, for example, the steps of calculating an initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame, and changing the initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame in order to obtain the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame. If it is not necessary to change the initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame, it will be understood that the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame is equal to the initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame.

[0300] In some possible implementations,

number

[0301] In some possible implementations, based on the amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal and the amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal, the step of calculating the amplitude correlation difference parameter between the left and right channel signals of the current frame includes calculating the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal based on the amplitude correlation parameter between the left channel signal of the current frame after delay alignment processing and the reference channel signal, calculating the long-term smoothed amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal based on the amplitude correlation parameter between the right channel signal of the current frame after delay alignment processing and the reference channel signal, and calculating the amplitude correlation difference parameter between the left and right channels of the current frame based on the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal and the long-term smoothed amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal.

[0302] There are various smoothing methods. For example, tdm_lt_corr_LM_SM cur =α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM, where tdm_lt_rms_L_SM cur =(1 - A)*tdm_lt_rms_L_SM pre +A*rms_L. A represents the update coefficient of the long-term smoothed frame energy of the left channel signal of the current frame. tdm_lt_rms_L_SM cur represents the long-term smoothed frame energy of the left channel signal of the current frame. rms_L represents the frame energy of the left channel signal of the current frame. tdm_lt_corr_LM_SM cur represents the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal. tdm_lt_corr_LM_SM prerepresents the long-term smoothed amplitude correlation parameter between the left channel signal of the previous frame and the reference channel signal, and α represents the left channel smoothing coefficient.

[0303] For example, tdm_lt_corr_RM_SM cur =β * tdm_lt_corr_RM_SM pre +(1 - β)corr_LM, and tdm_lt_rms_R_SM cur =(1 - B) * tdm_lt_rms_R_SM pre +B * rms_R, where B represents the update coefficient of the long-term smoothed frame energy of the right channel signal of the current frame, tdm_lt_rms_R_SM pre represents the long-term smoothed frame energy of the right channel signal of the current frame, rms_R represents the frame energy of the right channel signal of the current frame, and tdm_lt_corr_RM_SM cur represents the long-term smoothed amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal, and tdm_lt_corr_RM_SM pre represents the long-term smoothed amplitude correlation parameter between the right channel signal of the previous frame and the reference channel signal, and β represents the right channel smoothing coefficient.

[0304] In some possible implementations, diff_lt_corr = tdm_lt_corr_LM_SM - tdm_lt_corr_RM_SM, where tdm_lt_corr_LM_SM represents the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal, tdm_lt_corr_RM_SM represents the long-term smoothed amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal, and diff_lt_corr represents the amplitude correlation difference parameter between the left and right channel signals of the current frame.

[0305] In some possible implementations, the steps include: calculating channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame based on amplitude correlation difference parameters between the left and right channel signals of the current frame; performing a mapping process on the amplitude correlation difference parameters between the left and right channel signals of the current frame such that the range of values ​​for the mapped amplitude correlation difference parameters is [MAP_MIN, MAP_MAX]; and converting the mapped amplitude correlation difference parameters between the left and right channel signals into channel coupling ratio coefficients.

[0306] In some possible implementations, the step of performing a mapping process for amplitude correlation difference parameters between the left and right channels of the current frame includes the step of performing amplitude limiting on the amplitude correlation difference parameters between the left and right channel signals of the current frame, and the step of performing a mapping process on the amplitude-limited amplitude correlation difference parameters between the left and right channel signals of the current frame.

[0307] Various amplitude limiting methods are possible, specifically, for example,

number

[0308] Various mapping processing methods are possible, specifically, for example,

number

[0309] As another example,

number

number

[0310] In some possible implementations,

number

[0311] In some implementations of this application, in scenarios where the channel coupling ratio coefficient needs to be changed, the change may be performed before or after the channel coupling ratio coefficient is encoded. Specifically, for example, the initial value of the channel coupling ratio coefficient for the current frame (e.g., the channel coupling ratio coefficient corresponding to an anticorrelated signal channel coupling scheme, or the channel coupling ratio coefficient corresponding to a correlated signal channel coupling scheme) is first obtained by calculation, then the initial value of the channel coupling ratio coefficient is encoded to obtain the initial encoded index of the channel coupling ratio coefficient for the current frame, and the obtained initial encoded index of the channel coupling ratio coefficient for the current frame may be modified to obtain the encoded index of the channel coupling ratio coefficient for the current frame (obtaining the encoded index of the channel coupling ratio coefficient for the current frame is equivalent to obtaining the channel coupling ratio coefficient for the current frame). Alternatively, the initial value of the channel coupling ratio coefficient for the current frame is first obtained by calculation, then the calculated initial value of the channel coupling ratio coefficient for the current frame is modified to obtain the channel coupling ratio coefficient for the current frame, and the obtained channel coupling ratio coefficient for the current frame is encoded to obtain the encoded index coefficient of the channel coupling ratio coefficient for the current frame.

[0312] There are various ways to change the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame. For example, if it is necessary to change the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame in order to obtain the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame can be changed based on the channel coupling ratio coefficient of the previous frame and the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, or the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame can be changed based on the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame.

[0313] For example, whether or not the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame needs to be changed is first determined based on the long-time smoothed frame energy of the left channel signal of the current frame, the long-time smoothed frame energy of the right channel signal of the current frame, the inter-frame energy difference of the left channel signal in the current frame, the buffered coding parameters of the previous frame in the history buffer (e.g., inter-frame correlation of the primary channel signal and inter-frame correlation of the secondary channel signal), the channel coupling scheme flags of the current and previous frames, the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the previous frame, and the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame. If it needs to be changed, the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the previous frame is used as the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame; if it does not need to be changed, the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame is used as the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame.

[0314] Naturally, the specific implementations that modify the initial values ​​of the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame in order to obtain the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame are not limited to the examples described above.

[0315] 803. Encode the determined time-domain stereo parameters for the current frame.

[0316] In some possible implementations, quantization coding is performed on the determined channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame. ratio_init_SM qua=ratio_tabl_SM[ratio_idx_init_SM], where ratio_tabl_SM is the codebook for performing scalar quantization on the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame, and ratio_idx_init_SM is the initially encoded index of the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame, and ratio_init_SM qua This shows the quantized-encoded initial values ​​of the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame.

[0317] In some possible implementations, ratio_idx_SM = ratio_idx_init_SM, ratio_SM = ratio_tabl[ratio_idx_SM], where ratio_SM represents the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, and ratio_idx_SM represents the encoded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, or ratio_idx_SM=φ*ratio_idx_init_SM+(1-φ)*tdm_last_ratio_idx_SM, ratio_SM = ratio_tabl[ratio_idx_SM], where ratio_idx_init_SM represents the initial encoded index corresponding to the inversely correlated signal channel coupling scheme of the current frame, tdm_last_ratio_idx_SM represents the final encoded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the previous frame, φ is the change coefficient of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme, and ratio_SM represents the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame.

[0318] In some possible implementations, if it is necessary to change the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame in order to obtain the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, then quantization coding is first performed on the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame in order to obtain the initial coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, and then the initial coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame may be changed based on the coded index of the channel coupling ratio coefficient of the previous frame and the initial coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, or the initial coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame may be changed based on the initial coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame.

[0319] For example, quantization coding may first be performed on the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame in order to obtain the initial coded index corresponding to the inversely correlated signal channel coupling scheme of the current frame. Next, if the initial value of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame needs to be changed, the coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the previous frame is used as the coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame. If it does not need to be changed, the initial coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame is used as the coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame. Finally, the quantization coded value corresponding to the coded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame is used as the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame.

[0320] In addition, if the time-domain stereo parameters include inter-channel time differences, the step of determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame may include the step of calculating the inter-channel time differences of the current frame if the channel coupling scheme of the current frame is a correlated-signal channel coupling scheme. In addition, the inter-channel time differences of the current frame obtained by calculation may be written to the bitstream. If the channel coupling scheme of the current frame is an anticorrelated-signal channel coupling scheme, a default inter-channel time difference (e.g., 0) is used as the inter-channel time difference of the current frame. In addition, the default inter-channel time difference does not have to be written to the bitstream, and the decoder also uses the default inter-channel time difference.

[0321] The following provides further methods for encoding time-domain stereo parameters using examples. These methods may include, for example, the steps of: determining the channel coupling scheme of the current frame; determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame; and encoding the determined time-domain stereo parameters of the current frame, wherein the time-domain stereo parameters include at least one of the channel coupling ratio coefficients and the inter-channel time difference.

[0322] Correspondingly, the decoder may obtain the time-domain stereo parameters of the current frame from the bitstream and perform further relevant decoding based on the time-domain stereo parameters of the current frame obtained from the bitstream.

[0323] The following provides an explanation using examples related to more specific application scenarios.

[0324] Figure 9-A is a schematic flowchart of an audio coding method according to one embodiment of the present application. The audio coding method provided in this embodiment of the present application may be carried out by an coding device, and the method may particularly include the following steps.

[0325] 901. Perform time-domain preprocessing on the original left and right channel signals of the current frame.

[0326] For example, if the sampling rate of a stereo audio signal is 16kHz, one signal frame is 20ms, and the frame length is denoted as N, then N=320, it indicates that the frame length is 320 sampling points. The stereo signal of the current frame includes the left channel signal and the right channel signal of the current frame. The original left channel signal of the current frame is x L (n) is shown, and the original right channel signal of the current frame is x R This is denoted as (n), where n is the sampling point number, and n = 0, 1, ..., N-1.

[0327] For example, performing time-domain preprocessing on the original left and right channel signals of the current frame means performing a high-pass filter on the original left and right channel signals of the current frame in order to obtain the time-domain preprocessed left and right channel signals of the current frame, and the time-domain preprocessed left channel signal of the current frame is x L_HP (n) is shown, and the right channel signal, which has undergone time-domain preprocessing for the current frame, is x R_HP This may include being shown as (n), where n is the sampling point number, and n = 0, 1, ..., N-1. The filter used in the high-pass filtering process is, for example, an infinite impulse response with a cutoff frequency of 20 Hz ( IIR: Infinite Impulse Responses e) It could be a filter, or it could be a different type of filter.

[0328] For example, the transfer function of a high-pass filter with a sampling rate of 16 kHz and a cutoff frequency of 20 Hz is:

number

[0329] The transfer function of the corresponding time-domain filter can be expressed as follows: x L_HP (n) = b0 * x L (n) + b1*x L (n-1)+b2*x L (n-2)-α1*x L_HP (n-1)-α2*x L_HP (n-2) x R_HP(n) = b0 * x R (n) + b1*x R (n-1)+b2*x R (n-2)-α1*x R_HP (n-1)-α2*x R_HP (n-2)

[0330] 902. To obtain the left and right channel signals that have undergone delay alignment processing of the current frame, delay alignment processing is performed on the left and right channel signals that have undergone time-domain preprocessing of the current frame.

[0331] A signal that has undergone delay alignment processing can simply be called a "delay-aligned signal." For example, a left channel signal that has undergone delay alignment processing can simply be called a "delay-aligned left channel signal," and a right channel signal that has undergone delay alignment processing can simply be called a "delay-aligned left channel signal." right It can be simply called a "channel signal."

[0332] Specifically, inter-channel delay parameters may be extracted based on the pre-processed left and right channel signals of the current frame, then encoded, and delay alignment processing may be performed on the left and right channel signals based on the encoded inter-channel delay parameters to obtain the left and right channel signals of the current frame that have undergone delay alignment processing. The left channel signal of the current frame that has undergone delay alignment processing is x' L (n) is the right channel signal, which has undergone delay alignment processing for the current frame, and is x' R This is denoted by (n), where n is the sampling point number, and n = 0, 1, ..., N-1.

[0333] Specifically, for example, the encoding device may calculate the time-domain cross-correlation function of the left and right channels based on the pre-processed left and right channel signals of the current frame, search for the maximum value (or another value) of the time-domain cross-correlation function of the left and right channels to determine the time difference between the left and right channel signals, perform quantization coding on the determined time difference between the left and right channels, use the signal of one of the left and right channels selected from the left and right channels as a reference to obtain the left and right channel signals that have undergone delay alignment processing of the current frame, and perform delay adjustment of the signal of the other channel based on the quantized time difference between the left and right channels.

[0334] It should be noted that there are many specific implementation methods for delayed alignment processing, and no particular delayed alignment processing method is limited to this embodiment.

[0335] 903. Perform a time-domain analysis of the left and right channel signals that have undergone delay alignment processing of the current frame.

[0336] Specifically, time-domain analysis may include transient detection. Transient detection can be energy detection performed on the left and right channel signals of the current frame after delay alignment (specifically, it can detect whether or not there is a sudden energy change in the current frame). For example, the energy of the left channel signal of the current frame after delay alignment is E cur_L Represented by, the energy of the left channel signal, after delay alignment from the previous frame, is E pre_L This is represented as follows: In this case, in order to obtain the transient detection result of the left channel signal that has undergone delay alignment processing of the current frame, E pre_L and E cur_L Transient detection may be performed based on the absolute value of the difference between the two. Similarly, delayed alignment processing of the current frame is performed. right Transient detection can be performed on the channel signal using the same method. The time-domain analysis may further include time-domain analysis using other conventional methods other than transient detection, such as frequency bandwidth expansion preprocessing.

[0337] It will be understood that step 903 can be performed at any point after step 902 and before the primary and secondary channel signals of the current frame are encoded.

[0338] 904. To determine the channel coupling scheme of the current frame, the channel coupling scheme determination of the current frame is performed based on the left and right channel signals that have undergone delay alignment processing of the current frame.

[0339] Two possible channel coupling schemes are described as examples in this embodiment and will be referred to as the correlated-signal channel coupling scheme and the anticorrelated-signal channel coupling scheme, respectively, in the following description. In this embodiment, the correlated-signal channel coupling scheme corresponds to the case where the left and right channel signals (obtained after delay alignment) of the current frame are substantially in phase, and the anticorrelated-signal channel coupling scheme corresponds to the case where the left and right channel signals (obtained after delay alignment) of the current frame are substantially out of phase. Naturally, in actual applications, other names may be used in addition to "correlated-signal channel coupling scheme" and "anticorrelated-signal channel coupling scheme" to represent the two possible channel coupling schemes.

[0340] In some solutions of this embodiment, channel coupling scheme determination can be classified into initial channel coupling scheme determination and channel coupling scheme modification determination. It will be understood that channel coupling scheme determination is performed on the current frame in order to determine the channel coupling scheme of the current frame. For some examples of implementations of determining the channel coupling scheme of the current frame, please refer to the relevant descriptions of the embodiments described above. Details will not be repeated here.

[0341] 905. To obtain the initial values ​​and encoded indices of the channel coupling ratio coefficients corresponding to the current frame's correlated signal channel coupling scheme, the channel coupling ratio coefficients corresponding to the current frame's correlated signal channel coupling scheme are calculated and encoded based on the left and right channel signals of the current frame and the channel coupling scheme flag of the current frame.

[0342] Specifically, for example, the frame energy of the left and right channel signals of the current frame is first calculated based on the left and right channel signals of the current frame after delay alignment processing. The frame energy rms_L of the left channel signal in the current frame is:

number

number

[0343] Next, the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame are calculated based on the frame energy of the left channel and the frame energy of the right channel of the current frame. The calculated channel coupling ratio coefficients, ratio_init, corresponding to the correlated signal channel coupling scheme of the current frame are:

number

[0344] Next, corresponding to the current frame's correlated signal channel coupling scheme, are the corresponding encoded index ratio_idx_init and the quantized encoded channel coupling ratio coefficient ratio_init. qua To obtain this, quantization coding is performed on the channel coupling ratio coefficient `ratio_init`, which corresponds to the correlation signal channel coupling scheme of the current frame obtained by computation. ratio_init qua =ratio_tabl[ratio_idx_init]

[0345] Here, `ratio_tabl` is the codebook for scalar quantization. Quantization coding can be performed using any conventional scalar quantization method, such as uniform or heterogeneous scalar quantization. The number of bits used for coding is, for example, 5 bits. Specific scalar quantization methods are not described repeatedly here.

[0346] Quantized and encoded channel coupling ratio coefficients (ratio_init) corresponding to the current frame's correlated signal channel coupling scheme qua is the obtained initial value of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the current frame, and the encoded index ratio_idx_init is the encoded index corresponding to the initial value of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the current frame.

[0347] In addition, the encoded index corresponding to the initial value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme may be further modified based on the value of the current frame's channel coupling scheme flag, tdm_SM_flag.

[0348] For example, the quantization encoding is 5-bit scalar quantization. When tdm_SM_flag=1, the encoded index ratio_idx_init, which corresponds to the initial value of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the current frame, is changed to a pre-set value (e.g., 15 or another value), and the initial value of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the current frame is changed to ratio_init qua =ratio_tabl

[15] can be changed to this.

[0349] In addition to the calculation method described above, it should be noted that any method for calculating the channel coupling ratio coefficients corresponding to the channel coupling scheme in conventional time-domain stereo coding techniques may be used to calculate the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame. Alternatively, the initial value of the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame may be directly set to a fixed value (e.g., 0.5 or another value).

[0350] 906. Based on the channel coupling ratio coefficient change flag, determine whether or not the channel coupling ratio coefficient needs to be changed.

[0351] If changes are necessary, the channel coupling ratio coefficients and encoded indices of the channel coupling ratio coefficients corresponding to the current frame's correlated signal channel coupling scheme are modified to obtain the modified values ​​and encoded indices of the modified values ​​of the channel coupling ratio coefficients corresponding to the current frame's correlated signal channel coupling scheme.

[0352] The channel coupling ratio coefficient modification flag for the current frame is indicated as tdm_SM_modi_flag. For example, a value of 0 for the channel coupling ratio coefficient modification flag indicates that the channel coupling ratio coefficient does not need to be changed, while a value of 1 for the channel coupling ratio coefficient modification flag indicates that the channel coupling ratio coefficient needs to be changed. Naturally, other different values ​​may be used as the channel coupling ratio coefficient modification flag to indicate whether or not the channel coupling ratio coefficient needs to be changed.

[0353] For example, determining whether or not the channel coupling ratio coefficient needs to be changed based on the channel coupling ratio coefficient change flag may specifically include the following: for example, if the channel coupling ratio coefficient change flag tdm_SM_modi_flag=1, it is determined that the channel coupling ratio coefficient needs to be changed. As another example, if the channel coupling ratio coefficient change flag tdm_SM_modi_flag=0, it is determined that the channel coupling ratio coefficient does not need to be changed.

[0354] Modifying the channel coupling ratio coefficients and the encoded index of the channel coupling ratio coefficients corresponding to the current frame's correlated signal channel coupling scheme may, in particular, include: For example, the encoded index corresponding to the change in the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the current frame satisfies ratio_idx_mod=0.5*(tdm_last_ratio_idx+16), where tdm_last_ratio_idx is the encoded index of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the previous frame.

[0355] The change value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme: ratio_mod qua is ratio_mod qua The condition =ratio_tabl[ratio_idx_mod] is satisfied.

[0356] 907. Based on the initial value and encoded index of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, the changed value and encoded index of the changed value of the channel coupling ratio coefficient corresponding to the current frame's correlated signal channel coupling scheme, and the channel coupling ratio coefficient change flag, the channel coupling ratio coefficient ratio and its encoded index ratio_idx corresponding to the current frame's correlated signal channel coupling scheme are determined.

[0357] Specifically, for example, the determined channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme is:

number

[0358] The determined encoded index ratio_idx corresponding to the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme is:

number

[0359] 908. Determine whether the channel coupling scheme flag of the current frame corresponds to an inversely correlated signal channel coupling scheme. If it does, calculate and encode the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame in order to obtain the channel coupling ratio coefficients and encoded index corresponding to the inversely correlated signal channel coupling scheme of the current frame.

[0360] First, it can be determined whether the history buffer used to calculate the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame needs to be reset.

[0361] For example, if the channel coupling scheme flag tdm_SM_flag of the current frame is equal to 1 (for example, tdm_SM_flag being equal to 1 indicates that the channel coupling scheme flag of the current frame corresponds to an anticorrelated signal channel coupling scheme), and the channel coupling scheme flag tdm_last_SM_flag of the previous frame is equal to 0 (for example, tdm_last_SM_flag being equal to 0 indicates that before If the channel coupling scheme flag for the frame indicates that it corresponds to a correlated signal channel coupling scheme, it indicates that the history buffer used to calculate the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame needs to be reset.

[0362] Note that the history buffer reset flag tdm_SM_reset_flag is determined during the initial channel coupling scheme determination and channel coupling scheme change determination processes, and then the value of the history buffer reset flag may be determined to determine whether the history buffer used to calculate the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame needs to be reset. For example, if tdm_SM_reset_flag is 1, it indicates that the channel coupling scheme flag of the current frame corresponds to the inversely correlated signal channel coupling scheme, and the channel coupling scheme flag of the previous frame corresponds to the correlated signal channel coupling scheme. For example, if the history buffer reset flag tdm_SM_reset_flag is equal to 1, it indicates that the history buffer used to calculate the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame needs to be reset. There are many specific reset methods. All parameters of the history buffer used to calculate the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame may be reset based on pre-set initial values. Alternatively, some parameters of the history buffer used to calculate the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame may be reset based on pre-set initial values. Alternatively, some parameters of the history buffer used to calculate the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame may be reset based on a preset initial value, while other parameters may be reset based on the corresponding parameters of the history buffer used to calculate the channel coupling ratio coefficients corresponding to the correlated signal channel coupling scheme of the current frame.

[0363] Next, it is determined whether the channel coupling scheme flag tdm_SM_flag for the current frame corresponds to an anticorrelated signal channel coupling scheme. An anticorrelated signal channel coupling scheme is a channel coupling scheme more suitable for performing time-domain downmixing on non-in-mode stereo signals. In this embodiment, if the channel coupling scheme flag for the current frame is tdm_SM_flag=1, it indicates that the channel coupling scheme flag for the current frame corresponds to an anticorrelated signal channel coupling scheme. If the channel coupling scheme flag for the current frame is tdm_SM_flag=0, it indicates that the channel coupling scheme flag for the current frame corresponds to a correlated signal channel coupling scheme.

[0364] Determining whether the channel coupling scheme flag of the current frame corresponds to the anticorrelated signal channel coupling scheme is: This involves determining whether the value of the channel coupling scheme flag for the current frame is 1. If the channel coupling scheme flag for the current frame is tdm_SM_flag=1, it indicates that the channel coupling scheme flag for the current frame corresponds to an anticorrelated signal channel coupling scheme. In this case, the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme for the current frame are calculated and encoded. This may include in particular.

[0365] Referring to Figure 9-B, calculating and encoding the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame may include, for example, the following steps 9081 to 9085.

[0366] 9081. Perform a signal energy analysis of the left and right channel signals that have undergone delay alignment processing for the current frame.

[0367] The frame energy of the current frame's left channel signal, the frame energy of the current frame's right channel signal, the long-time smoothed frame energy of the current frame's left channel, the long-time smoothed frame energy of the current frame's right channel, the inter-frame energy difference of the current frame's left channel, and the inter-frame energy difference of the current frame's right channel are obtained separately.

[0368] For example, the frame energy rms_L of the left channel signal of the current frame is:

number

number

[0369] For example, the long-term smoothed frame energy of the left channel of the current frame tdm_lt_rms_L_SM cur teeth, tdm_lt_rms_L_SM cur =(1-A)*tdm_lt_rms_L_SM pre +A*rms_L Satisfying the conditions, here tdm_lt_rms_L_SM pre is the long-time smoothed frame energy of the left channel of the previous frame, A is the update coefficient of the long-time smoothed frame energy of the left channel, A is a real number from, for example, 0 to 1, and A may be equal to, for example, 0.4.

[0370] For example, the long-term smoothed frame energy of the right channel of the current frame tdm_lt_rms_R_SM cur teeth, tdm_lt_rms_R_SM cur =(1-B)*tdm_lt_rms_R_SM pre +B*rms_R Satisfying the conditions, here tdm_lt_rms_R_SM pre is the long-time smoothed frame energy of the right channel of the previous frame, B is the update coefficient of the long-time smoothed frame energy of the right channel, B is a real number between 0 and 1, for example, and B may be the same as or different from the update coefficient of the long-time smoothed frame energy of the left channel, for example, B may be equal to 0.4.

[0371] For example, the inter-frame energy difference ener_L_dt for the left channel of the current frame is: ener_L_dt=tdm_lt_rms_L_SM cur -tdm_lt_rms_L_SM pre It satisfies the condition.

[0372] For example, the inter-frame energy difference ener_R_dt of the right channel of the current frame is: ener_R_dt=tdm_lt_rms_R_SM cur -tdm_lt_rms_R_SM pre It satisfies the condition.

[0373] 9082. Determine the reference channel signal for the current frame based on the left and right channel signals that have undergone delay alignment processing for the current frame. The reference channel signal is sometimes called the monaural signal. When the reference channel signal is called the monaural signal, all descriptions and parameter names related to the reference channel may be replaced with the monaural signal.

[0374] For example, the reference channel signal mono_i(n) is:

number

[0375] 9083. Calculate separately the amplitude correlation parameter between the left channel signal and the reference channel signal after delay alignment processing of the current frame, and the amplitude correlation parameter between the right channel signal and the reference channel signal after delay alignment processing of the current frame.

[0376] For example, the amplitude correlation parameter corr_LM between the left channel signal and the reference channel signal after delay alignment processing of the current frame is, for example,

number

[0377] For example, the amplitude correlation parameter corr_RM between the right channel signal and the reference channel signal after delay alignment processing of the current frame is, for example,

number

[0378] Here, x' L (n) represents the left channel signal after delay alignment processing of the current frame, and x' R (n) represents the right channel signal of the current frame after delay alignment processing, mono_i(n) represents the reference channel signal of the current frame, and |·| indicates that the absolute value is adopted.

[0379] 9084. The amplitude correlation difference parameter diff_lt_corr between the left and right channels of the current frame is calculated based on the amplitude correlation parameter between the left channel signal and the reference channel signal after delay alignment processing of the current frame, and the amplitude correlation parameter between the right channel signal and the reference channel signal after delay alignment processing of the current frame.

[0380] It will be understood that step 9081 may be performed before steps 9082 and 9083, or after steps 9082 and 9083 and before step 9084.

[0381] Referring to Figure 9-C, for example, calculating the amplitude correlation difference parameter diff_lt_corr between the left and right channels of the current frame may specifically involve the following steps 90841 and 90842.

[0382] 90841. Based on the amplitude correlation parameters between the left channel signal and the reference channel signal of the current frame, which have undergone delay alignment processing, and the amplitude correlation parameters between the right channel signal and the reference channel signal of the current frame, the long-time smoothed amplitude correlation parameters between the left channel signal and the reference channel signal of the current frame are calculated.

[0383] For example, a method for calculating the long-time smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and the long-time smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, is given by the long-time smoothed amplitude correlation parameter tdm_lt_corr_LM_SM between the left channel signal and the reference channel signal of the current frame, tdm_lt_corr_LM_SM cur =α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM This may include satisfying the following conditions.

[0384] Here, tdm_lt_corr_LM_SM cur This parameter, tdm_lt_corr_LM_SM, represents the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame. pre α represents the long-term smoothed amplitude correlation parameter between the left channel signal of the previous frame and the reference channel signal, where α represents the left channel smoothing coefficient, and α may be a preset real number between 0 and 1, for example, 0.2, 0.5, or 0.8. Alternatively, the value of α may be obtained by adaptive calculation.

[0385] For example, the long-term smoothed amplitude correlation parameter tdm_lt_corr_RM_SM between the right channel signal and the reference channel signal of the current frame is: tdm_lt_corr_RM_SM cur =β*tdm_lt_corr_RM_SM pre +(1-β)corr_LM It satisfies the condition.

[0386] Here, tdm_lt_corr_RM_SM cur This parameter, tdm_lt_corr_RM_SM, represents the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame. pre α represents the long-term smoothed amplitude correlation parameter between the right channel signal of the previous frame and the reference channel signal, where β represents the right channel smoothing coefficient, and β can be a preset real number between 0 and 1. β may be the same as or different from the value of the left channel smoothing coefficient α, and β may be equal to, for example, 0.2, 0.5, or 0.8. Alternatively, the value of β may be obtained by adaptive calculation.

[0387] Another method for calculating the long-time smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and the long-time smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, is: First, to obtain the modified amplitude correlation parameter corr_LM_mod between the left channel signal and the reference channel signal of the current frame, the amplitude correlation parameter corr_LM between the left channel signal and the reference channel signal after delay alignment of the current frame is modified. Then, to obtain the modified amplitude correlation parameter corr_RM_mod between the right channel signal and the reference channel signal of the current frame, the amplitude correlation parameter corr_RM between the right channel signal and the reference channel signal after delay alignment of the current frame is modified. Next, the modified amplitude correlation parameter corr_LM_mod between the left channel signal and the reference channel signal of the current frame, the modified amplitude correlation parameter corr_RM_mod between the right channel signal and the reference channel signal of the current frame, and the long-term smoothed amplitude correlation parameter tdm_lt_corr_LM_SM between the left channel signal and the reference channel signal of the previous frame. pre , and the long-term smoothed amplitude correlation parameter tdm_lt_corr_RM_SM between the right channel signal and the reference channel signal of the previous frame. pre Based on this, the long-term smoothed amplitude correlation between the left channel signal and the reference channel signal of the current frame. difference Parameters diff_lt_corr_LM_tmp and the current Long-term smoothed amplitude correlation between the right channel signal and the reference channel signal of the frame. difference Determine the parameter diff_lt_corr_RM_tmp, Next, the long-term smoothed amplitude correlation between the left channel signal and the reference channel signal of the current frame. difference Parameters diff_lt_corr_LM_tmp and the current Long-term smoothed amplitude correlation between the right channel signal and the reference channel signal of the frame. differenceBased on the parameter diff_lt_corr_RM_tmp, the initial value diff_lt_corr_SM of the amplitude correlation difference parameter between the left and right channels of the current frame is obtained. Based on the obtained initial value diff_lt_corr_SM of the amplitude correlation difference parameter between the left and right channels of the current frame and the amplitude correlation difference parameter tdm_last_diff_lt_corr_SM of the left and right channels of the previous frame, the inter-frame variation parameter d_lt_corr of the amplitude correlation difference between the left and right channels of the current frame is determined. Finally, based on the frame energy of the left channel signal of the current frame, the frame energy of the right channel signal of the current frame, the long-time smoothed frame energy of the left channel of the current frame, the long-time smoothed frame energy of the right channel of the current frame, the inter-frame energy difference of the left channel of the current frame, and the inter-frame energy difference of the right channel of the current frame, as well as the inter-frame variation parameters of the amplitude correlation difference between the left and right channels of the current frame, obtained by signal energy analysis, different left channel smoothing coefficients and right channel smoothing coefficients are adaptively selected to calculate the long-time smoothed amplitude correlation parameter tdm_lt_corr_LM_SM between the left channel signal of the current frame and the reference channel signal, and the long-time smoothed amplitude correlation parameter tdm_lt_corr_RM_SM between the right channel signal of the current frame and the reference channel signal.

[0388] In addition to the two methods given as examples above, there may be many other methods for calculating the long-time smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and the long-time smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame. This is not limited to the present application.

[0389] 90842. Long-term smoothed amplitude correlation between the left channel signal and the reference channel signal of the current frame. difference The parameter and the long-term smoothed amplitude correlation between the right channel signal and the reference channel signal of the current frame. difference Based on the parameters, the amplitude correlation difference parameter diff_lt_corr between the left and right channels of the current frame is calculated.

[0390] For example, the amplitude correlation difference parameter diff_lt_corr between the left and right channels of the current frame is: diff_lt_corr=tdm_lt_corr_LM_SM-tdm_lt_corr_RM_SM Satisfying the conditions, here tdm_lt_corr_LM_SM represents the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and tdm_lt_corr_RM_SM represents the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame.

[0391] 9085. To determine the channel coupling ratio coefficients and the encoded index of the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame, the amplitude correlation difference parameter diff_lt_corr between the left and right channels of the current frame is converted to channel coupling ratio coefficients, and then encoded and quantized.

[0392] Referring to Figure 9-D, possible methods for converting the amplitude correlation difference parameter between the left and right channels of the current frame into channel coupling ratio coefficients may particularly include steps 90851 to 90853.

[0393] 90851. Mapping is performed on the amplitude correlation difference parameters between the left and right channels such that the range of values ​​for the amplitude correlation difference parameters that have undergone mapping can be [MAP_MIN, MAP_MAX].

[0394] A method for performing a mapping process on the amplitude correlation difference parameter between the left and right channels may include the following steps:

[0395] First, amplitude limiting is applied to the amplitude correlation difference parameter between the left and right channels. For example, the amplitude-limited amplitude correlation difference parameter between the left and right channels, diff_lt_corr_limit,

number

[0396] Here, RATIO_MAX represents the maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channels, and RATIO_MIN represents the minimum value of the amplitude-limited amplitude correlation difference parameter between the left and right channels. For example, RATIO_MAX is a pre-set empirical value and may be 1.5, 3.0, or another value, and RATIO_MIN is a pre-set empirical value and may be -1.5, -3.0, or another value, with RATIO_MAX > RATIO_MIN.

[0397] Next, a mapping process is performed on the amplitude-limited amplitude correlation difference parameter between the left and right channels. The amplitude correlation difference parameter diff_lt_corr_map, which is between the left and right channels and has undergone the mapping process,

number

number

[0398] Here, MAP_MAX represents the maximum value of the amplitude correlation difference parameter between the left and right channels that has undergone mapping; MAP_HIGH represents the high threshold of the amplitude correlation difference parameter between the left and right channels that has undergone mapping; MAP_LOW represents the low threshold of the amplitude correlation difference parameter between the left and right channels that has undergone mapping; and MAP_MIN represents the minimum value of the amplitude correlation difference parameter between the left and right channels that has undergone mapping. MAP_MAX>MAP_HIGH>MAP_LOW>MAP_MIN That is the case.

[0399] For example, in some embodiments of this application, MAP_MAX may be 2.0, MAP_HIGH may be 1.2, MAP_LOW may be 0.8, and MAP_MIN may be 0.0. Of course, in actual applications, the values ​​are not limited to such examples.

[0400] RATIO_MAX represents the maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channels, RATIO_HIGH represents the high threshold of the amplitude-limited amplitude correlation difference parameter between the left and right channels, RATIO_LOW represents the low threshold of the amplitude-limited amplitude correlation difference parameter between the left and right channels, and RATIO_MIN represents the minimum value of the amplitude-limited amplitude correlation difference parameter between the left and right channels, where RATIO_MAX>RATIO_HIGH>RATIO_LOW>RATIO_MIN That is the case.

[0401] For example, in some embodiments of this application, RATIO_MAX is 1.5, RATIO_HIGH is 0.75, RATIO_LOW is -0.75, and RATIO_MIN is -1.5. Naturally, in actual applications, the values ​​are not limited to such examples.

[0402] Another method in some embodiments of this application is as follows: namely, the amplitude correlation difference parameter diff_lt_corr_map, which is between the left and right channels and has been mapped,

number

[0403] Here, diff_lt_corr_limit represents the amplitude-limited amplitude correlation difference parameter between the left and right channels, where

number

[0404] Here, RATIO_MAX represents the maximum amplitude of the amplitude correlation difference parameter between the left and right channels, and -RATIO_MAX represents the minimum amplitude of the amplitude correlation difference parameter between the left and right channels. RATIO_MAX may be a pre-set empirical value, and RATIO_MAX can be, for example, 1.5, 3.0, or another real number greater than 0.

[0405] 90852. Convert the amplitude correlation difference parameter, which is between the left and right channels and has undergone mapping processing, into a channel coupling ratio coefficient.

[0406] The channel coupling ratio coefficient, ratio_SM, is

number

[0407] In addition to the method described above, another method may be used to convert the amplitude correlation difference parameter between the left and right channels into the channel coupling ratio coefficient, for example, Whether or not the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme need to be updated is determined based on the following obtained by signal energy analysis: the long-time smoothed frame energy of the left channel of the current frame, the long-time smoothed frame energy of the right channel of the current frame, and the inter-frame energy difference of the left channel of the current frame; the buffered coding parameters of the previous frame in the encoder's history buffer (e.g., the inter-frame correlation parameter of the primary channel signal and the inter-frame correlation parameter of the secondary channel signal); the channel coupling scheme flags of the current and previous frames; and the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current and previous frames.

[0408] If it is necessary to update the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme, the amplitude correlation difference parameter between the left and right channels is converted to the channel coupling ratio coefficients using the method in the example above. If it is not necessary to update them, the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the previous frame, and the encoded index of the channel coupling ratio coefficients, are directly used as the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame, and the encoded index of the channel coupling ratio coefficients.

[0409] 90853. Perform quantization coding on the channel coupling ratio coefficients obtained after the transformation to determine the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame.

[0410] Specifically, for example, the initially encoded index ratio_idx_init_SM corresponding to the inversely correlated signal channel coupling scheme of the current frame, and the quantized encoded initial value ratio_init_SM of the channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame. qua To obtain this, quantization coding is performed on the channel coupling ratio coefficients obtained after the transformation, and here ratio_init_SM qua =ratio_tabl_SM[ratio_idx_init_SM], ratio_tabl_SM is a codebook for performing scalar quantization on channel coupling ratio coefficients corresponding to anticorrelated signal channel coupling schemes.

[0411] Quantization coding can be performed using any scalar quantization method of the prior art, such as uniform or heterogeneous scalar quantization. The number of bits used for coding may be 5 bits. Specific methods are not described here. The codebook for performing scalar quantization on channel coupling ratio coefficients corresponding to an anticorrelated signal channel coupling scheme may be the same as or different from the codebook for performing scalar quantization on channel coupling ratio coefficients corresponding to a correlated signal channel coupling scheme. If the codebooks are the same, only one codebook needs to be stored for performing scalar quantization on channel coupling ratio coefficients.

[0412] In this case, the quantized and encoded initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame is ratio_init_SM. qua teeth, ratio_init_SM qua =ratio_tabl[ratio_idx_init_SM]

[0413] For example, the method is to directly use the quantized encoded initial values ​​of the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame as the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame, and to directly use the initially encoded index of the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame as the encoded index of the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame.

[0414] The encoded index ratio_idx_SM of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame satisfies ratio_idx_SM = ratio_idx_init_SM.

[0415] The channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame are: ratio_SM=ratio_tabl[ratio_idx_SM] It satisfies the condition.

[0416] For example, another method could involve the steps of: modifying the quantized encoded initial value of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame, and the initial encoded index corresponding to the anticorrelated signal channel coupling scheme of the current frame, based on the encoded index of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the previous frame, or the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the previous frame; using the modified encoded index of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame as the encoded index of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame; and using the modified channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme as the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame.

[0417] The encoded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame, ratio_idx_SM, satisfies ratio_idx_SM = φ * ratio_idx_init_SM + (1 - φ) * tdm_last_ratio_idx_SM.

[0418] Here, ratio_idx_init_SM is the initial encoded index corresponding to the inversely correlated signal channel coupling scheme of the current frame, tdm_last_ratio_idx_SM is the encoded index of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the previous frame, and φ is the change coefficient of the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme. The value of φ may be empirical, and φ may be equal to, for example, 0.8.

[0419] The channel coupling ratio coefficients corresponding to the inversely correlated signal channel coupling scheme of the current frame are: ratio_SM=ratio_tabl[ratio_idx_SM] It satisfies the condition.

[0420] Another approach is to use the unquantized channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme as the channel coupling ratio coefficient corresponding to the inversely correlated signal channel coupling scheme of the current frame. In other words, the channel coupling ratio coefficient ratio_SM corresponding to the inversely correlated signal channel coupling scheme of the current frame is:

number

[0421] In addition, a fourth method is a step of modifying the unquantized channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame based on the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the previous frame; a step of using the modified channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme as the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame; and a step of performing quantization coding on the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame in order to obtain an encoded index of the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame.

[0422] In addition to the methods described above, there are many possible methods for converting the amplitude correlation difference parameter between the left and right channels into channel coupling ratio coefficients and performing encoding and quantization. Similarly, there are many different methods for determining the channel coupling ratio coefficients corresponding to the anticorrelated signal channel coupling scheme of the current frame, and the encoded index of the channel coupling ratio coefficients. This is not limited to the present application.

[0423] 909. To determine the encoding mode of the current frame, encoding mode determination is performed based on the channel join scheme flag of the previous frame and the channel join scheme flag of the current frame.

[0424] The channel coupling scheme flag for the current frame is denoted as tdm_SM_flag, the channel coupling scheme flag for the previous frame is denoted as tdm_last_SM_flag, and the joint flag between the channel coupling scheme flags of the previous and current frames may be denoted as (tdm_last_SM_flag,tdm_SM_flag). Encoding mode determination may be performed based on the joint flag. Details are shown in the following example.

[0425] It is assumed that a correlated signal channel coupling scheme is represented by 0, and an anticorrelated signal channel coupling scheme is represented by 1. In this case, the joint flag of the channel coupling scheme flag between the previous frame and the current frame has the following four cases: (01), (11), (10), and (00), and the coding mode of the current frame is determined to be a correlated signal coding mode, an anticorrelated signal coding mode, a mode that switches signal coding from correlated to anticorrelated, and a mode that switches signal coding from anticorrelated to correlated. For example, Previous frame and If the joint flag of the channel coupling scheme flag for the current frame is (00), it indicates that the coding mode of the current frame is correlated signal coding mode, or Previous frame andIf the joint flag of the channel joining scheme flag for the current frame is (11), it indicates that the coding mode of the current frame is inversely correlated signal coding mode, or Previous frame and If the joint flag of the channel joining scheme flag for the current frame is (01), it indicates that the encoding mode of the current frame is a mode that switches signal coding from correlated to decorrelated, or Previous frame and If the joint flag of the channel joining scheme flag for the current frame is (10), it indicates that the coding mode for the current frame is a mode that switches signal coding from inverse correlation to correlated.

[0426] 910. After obtaining the encoding mode of the current frame, stereo_tdm_coder_type, the encoding device performs time-domain downmixing on the left and right channel signals of the current frame based on the time-domain downmixing method corresponding to the encoding mode of the current frame, in order to obtain the primary and secondary channel signals of the current frame.

[0427] The current encoding mode of the frame is one of several encoding modes. For example, the encoding modes may include a mode that switches signal encoding from correlated to decorrelated, a mode that switches signal encoding from decorrelated to correlated, a correlated signal encoding mode, and a decorrelated signal encoding mode. For implementations of time-domain downmixing in different encoding modes, please refer to the relevant descriptions in the examples of embodiments above. Details will not be repeated here.

[0428] 911. In order to obtain the encoded primary channel signal and the encoded secondary channel signal, the encoding device encodes the primary channel signal and the secondary channel signal separately.

[0429] Specifically, bit allocation may be performed first for the encoding of the primary channel signal and the secondary channel signal, based on parameter information obtained from encoding the primary and / or secondary channel signals of the previous frame and the total number of bits to encode the primary and secondary channel signals. Next, the primary and secondary channel signals are encoded separately based on the bit allocation results in order to obtain the encoded index of the primary channel encoding and the encoded index of the secondary channel encoding. Primary and secondary channel encoding may be performed by using any monaural audio encoding technique, which will not be discussed further here.

[0430] 912. The encoding device selects the corresponding encoded index of the channel coupling ratio coefficient based on the channel coupling scheme flag, writes the encoded index to the bitstream, and writes the encoded primary channel signal, the encoded secondary channel signal, and the channel coupling scheme flag for the current frame to the bitstream.

[0431] Specifically, for example, if the channel coupling scheme flag tdm_SM_flag of the current frame corresponds to a correlated signal channel coupling scheme, then the encoded index ratio_idx of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the current frame is written to the bitstream. Alternatively, if the channel coupling scheme flag tdm_SM_flag of the current frame corresponds to an anticorrelated signal channel coupling scheme, then the encoded index ratio_idx_SM of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame is written to the bitstream. For example, if tdm_SM_flag=0, then the encoded index ratio_idx of the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme of the current frame is written to the bitstream, or if tdm_SM_flag=1, then the encoded index tdm_SM_flag=0 of the channel coupling ratio coefficient corresponding to the anticorrelated signal channel coupling scheme of the current frame is written to the bitstream.

[0432] In addition, the encoded primary channel signal, the encoded secondary channel signal, and the channel coupling scheme flags for the current frame are written to the bitstream. It should be understood that there is no specific order in which the bitstream writing operations are performed.

[0433] Accordingly, the following describes a time-domain stereo decoding scenario using an example.

[0434] Referring to Figure 10, the following further provides an audio decoding method. The relevant steps of the audio decoding method may be specifically performed by a decoding device, and the method may particularly include the following steps.

[0435] 1001. Decoding is performed based on the bitstream to obtain the decoded primary and secondary channel signals of the current frame.

[0436] 1002. Decode based on the bitstream to obtain the time-domain stereo parameters of the current frame.

[0437] The time-domain stereo parameters of the current frame include the channel coupling ratio coefficients of the current frame (the bitstream includes an encoded index of the channel coupling ratio coefficients of the current frame, and decoding may be performed based on the encoded index of the channel coupling ratio coefficients of the current frame to obtain the channel coupling ratio coefficients of the current frame), and may further include the inter-channel time difference of the current frame, etc. (for example, the bitstream includes an encoded index of the inter-channel time difference of the current frame, and decoding may be performed based on the encoded index of the inter-channel time difference of the current frame to obtain the inter-channel time difference of the current frame, or the bitstream includes an encoded index of the absolute value of the inter-channel time difference of the current frame, and decoding may be performed based on the encoded index of the absolute value of the inter-channel time difference of the current frame to obtain the absolute value of the inter-channel time difference of the current frame).

[0438] 1003. Based on the bitstream, obtain the channel coupling scheme flag for the current frame contained in the bitstream and determine the channel coupling scheme for the current frame.

[0439] 1004. Determine the decoding mode of the current frame based on the channel binding scheme of the current frame and the channel binding scheme of the previous frame.

[0440] For determining the decoding mode of the current frame based on the channel coupling scheme of the current frame and the channel coupling scheme of the previous frame, see the method for determining the coding mode of the current frame in step 909. The decoding mode of the current frame is one of several decoding modes. For example, the multiple decoding modes include a mode that switches signal decoding from correlation to inverse correlation, a mode that switches signal decoding from inverse correlation to correlation, and a correlated signal decrypt This may include modes and inversely correlated signal decoding modes. There is a one-to-one correspondence between encoding modes and decoding modes.

[0441] for example, Previous frame and If the joint flag of the channel coupling scheme flag for the current frame is (00), it indicates that the decoding mode for the current frame is correlated signal decoding mode, or Previous frame and If the joint flag of the channel coupling scheme flag for the current frame is (11), it indicates that the decoding mode for the current frame is inverse correlation signal decoding mode, or Previous frame and If the joint flag of the channel coupling scheme flag for the current frame is (01), it indicates that the decoding mode for the current frame is a mode that switches signal decoding from correlated to decorrelated, or Previous frame and If the joint flag of the channel coupling scheme flag for the current frame is (10), it indicates that the decoding mode for the current frame is a mode that switches signal decoding from inverse correlation to correlated.

[0442] It will be understood that there is no specific order in which steps 1001, 1002, and 1003 and 1004 are performed.

[0443] 1005. To obtain the reconfigured left and right channel signals of the current frame, time-domain upmixing is performed on the decoded primary and secondary channel signals of the current frame by using a time-domain upmixing method corresponding to the determined decoding mode of the current frame.

[0444] For relevant implementations of time-domain upmixing in different decoding modes, please refer to the relevant descriptions in the examples of embodiments described above. Details will not be repeated here.

[0445] The upmix matrix used for time-domain upmixing is constructed based on the acquired channel coupling ratio coefficients for the current frame.

[0446] The reconfigured left and right channel signals of the current frame can be used as the decoded left and right channel signals of the current frame.

[0447] Alternatively, to obtain reconstructed left and right channel signals that have undergone delay adjustment for the current frame, further delay adjustment may be performed on the reconstructed left and right channel signals of the current frame based on the inter-channel time difference of the current frame, and the reconstructed left and right channel signals that have undergone delay adjustment for the current frame may be used as the decoded left and right channel signals of the current frame. Alternatively, further time-domain post-processing may be performed on the reconstructed left and right channel signals that have undergone delay adjustment for the current frame, and the reconstructed left and right channel signals that have undergone time-domain post-processing for the current frame may be used as the decoded left and right channel signals of the current frame.

[0448] The method in the embodiment of this application has been described in detail above. The apparatus in the embodiment of this application will now be described below. 。

[0450] Referring to Figure 11-A, one embodiment of the present application further provides apparatus 1100. Apparatus 1100 is, The system may include a processor 1110 and a memory 1120, which are connected to each other and can be configured so that the processor 1110 performs some or all of the steps of any method provided in the embodiments of this application.

[0451] Memory 1120 is random access memory ( RAMRandom Access Memory y) , read-only memory ( ROM Read-Only Memory y) , erasable programmable read-only memory ( EPROM :Erasable Programmable Read Only Memor y) , or compact disc read-only memory ( CD-ROM Compact Disc Read-Only Memory y) This includes, but is not limited to, the following: Memory 1102 is configured to store the relevant instructions and associated data.

[0452] Naturally, the device 1100 may further include a transceiver 1130 configured to receive and transmit data.

[0453] The processor 1110 has one or more central processing units ( CPU :Central Processing Uni t) This is also possible. If the processor 1110 is a single CPU, the CPU may be a single-core CPU or a multi-core CPU. Specifically, the processor 1110 may be a digital signal processor.

[0454] In the implementation process, the steps of the method described above may be carried out using the hardware integrated logic circuitry of the processor 1110 or by using instructions in the form of software. The processor 1110 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array or another programmable logic device, a single gate or transistor logic device, or a single hardware component. The processor 1110 may implement or execute the methods, steps, and logic block diagrams disclosed in each embodiment of the present invention. The general-purpose processor may be a microprocessor, and the processor may be any conventional processor, etc. The steps of the method disclosed in relation to each embodiment of the present invention may be carried out and achieved directly using a hardware decoding processor, or they may be carried out and achieved using a combination of hardware and software modules of the decoding processor.

[0455] The software module may be placed in a storage medium that is mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically eraseable programmable memory, or registers. The storage medium is placed in memory 1120. For example, the processor 1110 can read information in memory 1120 and, in combination with the hardware of the processor 1110, complete the steps of the method described above.

[0456] Furthermore, the device 1100 may further include a transceiver 1130. The transceiver 1130 may be configured, for example, to receive and transmit relevant data (e.g., instructions, channel signals, or bitstreams). For example, the device 1100 may perform some or all of the steps of the corresponding method in any embodiment shown in Figures 2 to 9-D.

[0457] Specifically, for example, when device 1100 performs the encoding steps described above, device 1100 may be called an encoding device (or audio encoding device). When device 1100 performs the decoding steps described above, device 1100 may be called a decoding device (or audio decoding device).

[0458] Referring to Figure 11-B, for example, if device 1100 is an encoding device, device 1100 may further include a microphone 1140, an analog-to-digital converter 1150, and so on.

[0459] For example, the microphone 1140 may be configured to perform sampling to acquire an analog audio signal.

[0460] For example, the analog-to-digital converter 1150 may be configured to convert an analog audio signal into a digital audio signal.

[0461] Referring to Figure 11-C, for example, if device 1100 is an encoding device, device 1100 may further include a speaker 1160, a digital-to-analog converter 1170, and so on.

[0462] For example, the digital-to-analog converter 1170 may be configured to convert a digital audio signal to an analog audio signal.

[0463] For example, speaker 1160 may be configured to reproduce analog audio signals.

[0464] In addition, referring to Figure 12-A, one embodiment of the present application provides a device 1200 comprising several functional units configured to carry out any method provided in the embodiments of the present application.

[0465] For example, when the apparatus 1200 performs the corresponding method of the embodiment shown in Figure 2, the apparatus 1200, A first determination unit 1210 is configured to determine the channel coupling scheme of the current frame and to determine the decoding mode of the current frame based on the channel coupling scheme of the previous frame and the channel coupling scheme of the current frame, The system may include an encoding unit 1220 configured to perform a time-domain downmix on the left and right channel signals of the current frame, based on a time-domain downmix process corresponding to the encoding mode of the current frame, in order to obtain the primary and secondary channel signals of the current frame.

[0466] In addition, referring to Figure 12-B, the device 1200 may further include a second determination unit 1230 configured to determine the time-domain stereo parameters of the current frame. An encoding unit 1220 may further be configured to encode the time-domain stereo parameters of the current frame.

[0467] As another example, referring to Figure 12-C, when the apparatus 1200 performs the corresponding method of the embodiment shown in Figure 3, the apparatus 1200, A third determination unit 1240 is configured to determine the channel coupling scheme of the current frame based on the channel coupling scheme flag of the current frame in the bitstream, and to determine the decoding mode of the current frame based on the channel coupling scheme of the previous frame and the channel coupling scheme of the current frame, The system may include a decoding unit 1250 configured to perform decoding based on a bitstream to obtain the decoded primary and secondary channel signals of the current frame, and to perform time-domain upmixing on the decoded primary and secondary channel signals of the current frame based on time-domain upmixing corresponding to the decoding mode of the current frame to obtain the reconfigured left and right channel signals of the current frame.

[0468] If this device performs a different procedure, it will be inferred by analogy.

[0469] One embodiment of this application provides a computer-readable storage medium that stores program code, the program code including instructions for performing some or all of the steps of any method provided in the embodiments of this application.

[0470] One embodiment of this application provides a computer program product. When the computer program product is executed on a computer, the computer is able to perform some or all of the steps of any method provided in the embodiment of this application.

[0471] In the embodiments described above, each embodiment has its own emphasis. For aspects not described in detail in one embodiment, please refer to the relevant descriptions in other embodiments.

[0472] It should be understood that in some embodiments provided in this application, the apparatus of the disclosure may be implemented in other ways. For example, the described apparatus embodiments are merely examples. For example, the division of units may be merely a logical functional division, or other divisions may be possible in actual implementation. For example, multiple units or components may be combined or integrated to form a different system, and some features may be ignored or not implemented. In addition, the mutual indirect or direct coupling or communication connection shown or described may also be realized using several interfaces. Indirect coupling or communication connection between devices or units may be realized in electronic or other forms.

[0473] Units described as separate parts may or may not be physically separated, and components shown as units may or may not be physical units. Specifically, components can be located in one place or distributed across multiple network units. Some or all of the units can also be selected according to the actual needs to achieve the objectives of the solution in each embodiment.

[0474] In addition, the functional units in the embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically independently, or two or more units may be integrated into a single unit. The integrated unit can be implemented in hardware form or in the form of a software functional unit.

[0475] When an integrated unit is implemented in the form of a software function unit and sold or used as an independent product, the integrated unit can be stored on a computer-readable storage medium. Based on this understanding, the technical solutions of the present invention can be implemented essentially, or in part with respect to the prior art, or all or part of the technical solutions can be implemented in the form of a software product. The computer software product is stored on a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The storage medium includes any medium capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), removable hard disk, magnetic disk, or optical disk. [Explanation of symbols]

[0476] 1100 equipment 1110 processor 1120 memory 1130 Transmitter / Receiver 1140 Microphone 1150 Analog-to-Digital Converter 1160 speakers 1170 Digital-to-Analog Converter 1200 equipment 1210 First Judgment Unit 1220 encoding units 1230 Second judgment unit 1240 Third Judgment Unit 1250 Decoding Units

Claims

1. The steps include determining the channel coupling scheme of the current frame, The steps include determining the encoded channel coupling ratio coefficients of the current frame based on the channel coupling scheme of the current frame, Obtaining the encoded index of the channel coupling ratio coefficient, Writing the encoded index to the bitstream, A time-domain stereo parameter coding method, including...

2. The channel combination scheme of the current frame is one of a plurality of channel combination schemes, the plurality of channel combination schemes include an anticorrelated signal channel combination scheme and a correlated signal channel combination scheme, the correlated signal channel combination scheme is a channel combination scheme corresponding to substantially in-phase signals, and the anticorrelated signal channel combination scheme is a channel combination scheme corresponding to substantially out-of-phase signals. The time-domain stereo parameter coding method according to claim 1.

3. The method according to claim 2, wherein when the channel coupling scheme of the current frame is the correlated signal channel coupling scheme, the time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the correlated signal channel coupling scheme of the current frame, and when the channel coupling scheme of the current frame is the anticorrelated signal channel coupling scheme, the time-domain stereo parameters of the current frame are the time-domain stereo parameters corresponding to the anticorrelated signal channel coupling scheme of the current frame.

4. The step of determining the time-domain stereo parameters of the current frame based on the channel coupling scheme of the current frame, The steps include: obtaining a reference channel signal for the current frame based on the left channel signal and right channel signal of the current frame; The steps include: calculating the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame; The steps include: calculating the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame; A step of calculating the amplitude correlation difference parameter between the left and right channel signals of the current frame, based on the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame. A step of calculating the channel coupling ratio coefficient corresponding to the anticorrelation signal channel coupling scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame. The method according to claim 3, including the method described in claim 3. 【Request Item 5】 【Number 1】 And, [Math 2] And here [Math 3] And, mono_i(n) represents the reference channel signal of the current frame, [Math 4] This shows the left channel signal that has undergone delay alignment of the current frame, [Math 5] `corr_LM` indicates the right channel signal with delay alignment of the current frame, `corr_LM` indicates the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and `corr_RM` indicates the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame. The method according to claim 4.

6. The step of calculating the amplitude correlation difference parameter between the left and right channel signals of the current frame based on the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, A step of calculating a long-time smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame based on the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, based on the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, A step of calculating the amplitude correlation difference parameter between the left and right channel signals of the current frame based on the long-time smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and the long-time smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame. The method according to claim 4, including the method described in claim 4.

7. tdm_lt_corr_LM_SM cur =α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM, where tdm_lt_rms_L_SM cur =(1-A)*tdm_lt_rms_L_SM pre +A*rms_L, where A represents the update coefficient of the long-time smoothed frame energy of the left channel signal of the current frame, and tdm_lt_rms_L_SM cur `<frame_energy_L>` represents the long-time smoothed frame energy of the left channel signal of the current frame, `<frame_energy_L>` represents the frame energy of the left channel signal of the current frame, and `<frame_energy_L>` represents the frame energy of the left channel signal of the current frame, and `<frame_energy_L>` represents the long-time smoothed cur This indicates the long-time smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and is tdm_lt_corr_LM_SM pre represents the long-term smoothing amplitude correlation parameter between the left channel signal and the reference channel signal of the previous frame, and α represents the left channel smoothing coefficient. tdm_lt_corr_RM_SM cur = β * tdm_lt_corr_RM_SM pre + (1 - β) corr_LM, where tdm_lt_rms_R_SM cur =(1-B)*tdm_lt_rms_R_SM pre +B*rms_R, where B is the update coefficient for the long-time smoothed frame energy of the right channel signal of the current frame, and tdm_lt_rms_R_SM pre `rms_R` represents the long-time smoothed frame energy of the right channel signal of the current frame, and `tdm_lt_corr_RM_SM` represents the frame energy of the right channel signal of the current frame. cur This indicates the long-time smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, and is tdm_lt_corr_RM_SM pre is the long-time smoothing amplitude correlation parameter between the right channel signal of the previous frame and the reference channel signal, and β is the right channel smoothing coefficient. The method according to claim 6.

8. diff_lt_corr = tdm_lt_corr_LM_SM - tdm_lt_corr_RM_SM, where tdm_lt_corr_LM_SM represents the long-time smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, tdm_lt_corr_RM_SM represents the long-time smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, and diff_lt_corr represents the amplitude correlation difference parameter between the left and right channel signals of the current frame. The method according to claim 6.

9. The step of calculating the channel coupling ratio coefficient corresponding to the anticorrelation signal channel coupling scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame, The steps include: performing the mapping process on the amplitude correlation difference parameter between the left and right channel signals of the current frame, such that the range of values ​​of the mapped amplitude correlation difference parameter between the left and right channel signals of the current frame can be [MAP_MIN, MAP_MAX]; and converting the mapped amplitude correlation difference parameter between the left and right channel signals into the channel coupling ratio coefficient. The method according to claim 6, including the method described in claim 6.

10. The method according to claim 9, wherein the step of performing the mapping process on the amplitude correlation difference parameter between the left and right channels of the current frame includes the steps of performing amplitude limiting on the amplitude correlation difference parameter between the left and right channel signals of the current frame, and performing the mapping process on the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame. [Request Item 11] [Number 6] And here RATIO_MAX represents the maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, and RATIO_MIN represents the minimum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, such that RATIO_MAX > RATIO_MIN. The method according to claim 10. [Request Item 12] [Number 7] And here [Number 8] And, B 1 =MAP_MAX-RATIO_MAX*A 1 or B 1 =MAP_HIGH-RATIO_HIGH*A 1 And, [Number 9] And, B 2 =MAP_LOW-RATIO_LOW*A 2 or B 2 =MAP_MIN-RATIO_MIN*A 2 And, [Number 10] And, B 3 =MAP_HIGH-RATIO_HIGH*A 3 or B 3 =MAP_LOW-RATIO_LOW*A 3 And, diff_lt_corr_map is between the left and right channel signals of the current frame and indicates the amplitude correlation difference parameter that has undergone the mapping process. MAP_MAX represents the maximum value of the amplitude correlation difference parameter that has been mapped, between the left and right channel signals of the current frame; MAP_HIGH represents the high threshold of the amplitude correlation difference parameter that has been mapped, between the left and right channel signals of the current frame; MAP_LOW represents the low threshold of the amplitude correlation difference parameter that has been mapped, between the left and right channel signals of the current frame; and MAP_MIN represents the minimum value of the amplitude correlation difference parameter that has been mapped, between the left and right channel signals of the current frame. MAP_MAX > MAP_HIGH > MAP_LOW > MAP_MIN, RATIO_MAX indicates the maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, RATIO_HIGH indicates the high threshold of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, RATIO_LOW indicates the low threshold of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, and RATIO_MIN indicates the minimum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame. RATIO_MAX > RATIO_HIGH > RATIO_LOW > RATIO_MIN The method according to claim 10. [Request Item 13] [Number 11] And here diff_lt_corr_limit represents the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, and diff_lt_corr_map represents the amplitude correlation difference parameter between the left and right channel signals of the current frame, which has undergone the mapping process. [Math 12] And, RATIO_MAX represents the maximum amplitude of the amplitude correlation difference parameter between the left and right channel signals in the current frame, and -RATIO_MAX represents the minimum amplitude of the amplitude correlation difference parameter between the left and right channel signals in the current frame. The method according to claim 10. [Request Item 14] [Number 13] And here diff_lt_corr_map represents the amplitude correlation difference parameter between the left and right channel signals of the current frame, which has undergone the mapping process, and ratio_SM represents the channel coupling ratio coefficient corresponding to the anticorrelation signal channel coupling scheme of the current frame. The method according to claim 9.

15. A time-domain stereo parameter coding device comprising a coupled processor and memory, The processor is configured to perform the method described in any one of claims 1 to 14. Time-domain stereo parameter coding device.

16. A computer-readable storage medium, The computer-readable storage medium stores program code, and the program code includes instructions used to perform the method according to any one of claims 1 to 14. Computer-readable storage medium.

17. A computer program stored in a computer-readable storage medium, configured to cause a computer to perform the method described in any one of claims 1 to 14.