Time domain stereo parameter encoding method and related product
By determining channel combination schemes and calculating time-domain stereo parameters for each frame, the method addresses the issue of low primary signal energy in conventional time-domain stereo coding, resulting in improved encoding and decoding quality.
Patent Information
- Application Number
- JP2025018398
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2017-08-10
- Filing Date
- 2025-02-06
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2038-08-10
AI Technical Summary
Conventional time-domain stereo coding techniques often result in extremely low or lost energy of the primary signal, leading to reduced coding quality.
The proposed method involves determining a channel combination scheme for each frame and calculating time-domain stereo parameters, including channel combination ratio coefficients and inter-channel time differences, to improve encoding quality.
This approach enhances the energy of the primary signal and improves the overall quality of encoding and decoding by better fitting multiple scenarios through multiple channel combination schemes.
Smart Images

Figure 2025072539000001_ABST
Abstract
Description
[Technical field]
[0001] The present application relates to the field of audio encoding and decoding technologies, and in particular to a time-domain stereo parameter encoding method and related products. [Background technology]
[0002] As the quality of life improves, people's demand for high quality audio increases. Compared with mono audio, stereo audio has a sense of direction and distribution for various sound sources, and can improve the clarity, clarity, and information presence, which makes it popular with people.
[0003] In parametric stereo coding and decoding technology, stereo signals are converted into mono signals and spatial perceptual parameters, and multi-channel signals are compressed. This is a common stereo coding and decoding technology. However, parametric stereo coding and decoding technology usually requires extracting spatial perceptual parameters in the frequency domain and performing time-frequency transformation, so the delay of the whole codec is relatively large. Therefore, when the delay requirement is relatively strict, the time-domain stereo coding technology is more suitable.
[0004] In a conventional time domain stereo coding technique, a signal is downmixed to obtain two mono signals in the time domain. For example, in an MS coding technique, left and right channel signals are first downmixed to obtain a mid channel signal and a side channel signal. For example, L indicates a left channel signal, and R indicates a right channel signal. In this case, the mid channel signal is 0.5×(L+R), which indicates information about the correlation between the left channel and the right channel, and the side channel signal is 0.5×(LR), which indicates information about the difference between the left channel and the right channel. Then, the mid channel signal and the side channel signal are coded separately by using a mono coding method, where the mid channel signal is usually coded by using a larger number of bits, and the side channel signal is usually coded by using a smaller number of bits.
[0005] The inventors of the present application have found through research and practice that when conventional time-domain stereo encoding techniques are used, the energy of the primary signal may become extremely small or even be lost, resulting in a deterioration of the final encoding quality. Summary of the Invention [Means for solving the problem]
[0006] SUMMARY OF THE PRESENT APPLICATION The embodiments of the present 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 encoding method, the method includes the steps of: determining a channel combining scheme of a current frame, determining time-domain stereo parameters of the current frame based on the channel combining scheme of the current frame, and encoding the determined time-domain stereo parameters of the current frame, where the time-domain stereo parameters include at least one of a channel combining ratio coefficient and an inter-channel time difference.
[0008] An embodiment of the present application further provides a time-domain stereo parameter determination method, which may include: determining a channel combining scheme of a current frame; and determining time-domain stereo parameters of the current frame based on the channel combining scheme of the current frame, where the time-domain stereo parameters include at least one of a channel combining ratio coefficient and an inter-channel time difference.
[0009] The stereo signal of the current frame includes, for example, the left and right channel signals of the current frame.
[0010] The channel bonding scheme for the current frame is one of a plurality of channel bonding schemes.
[0011] For example, the multiple channel combination schemes include an anticorrelated signal channel combination scheme and a correlated signal channel combination scheme.
[0012] A correlated signal channel combining scheme is a channel combining scheme that corresponds to approximately in-phase signals. An anti-correlated signal channel combining scheme is a channel combining scheme that corresponds to approximately non-in-phase signals. It will be understood that a channel combining scheme that corresponds to approximately in-phase signals is applicable to approximately in-phase signals and a channel combining scheme that corresponds to approximately non-in-phase signals is applicable to approximately non-in-phase signals.
[0013] If the channel combining scheme of the current frame is determined to be a correlated signal channel combining scheme, the time domain stereo parameters of the current frame are time domain stereo parameters corresponding to the correlated signal channel combining scheme of the current frame, or if the channel combining scheme of the current frame is determined to be an anti-correlated signal channel combining scheme, the time domain stereo parameters of the current frame are time domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame.
[0014] It can be understood that in the above solution, the channel combining scheme of the current frame needs to be determined, which indicates that there are multiple possibilities for the channel combining scheme of the current frame. Compared with the conventional solution with only one channel combining scheme, the present solution with multiple possible channel combining schemes can better match and match multiple possible scenarios. Because the time domain stereo parameters of the current frame are determined based on the channel combining scheme of the current frame, the time domain stereo parameters can better match and match multiple possible scenarios, and the quality of encoding and decoding can be further improved.
[0015] In some possible implementations, a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame and a channel combining ratio coefficient corresponding to the correlated signal channel combining scheme of the current frame may be calculated separately first. Then, if the channel combining scheme of the current frame is determined to be a correlated signal channel combining 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 combining scheme of the current frame, or if the channel combining scheme of the current frame is determined to be an anti-correlated signal channel combining scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame. Alternatively, time-domain stereo parameters corresponding to the correlated signal channel combining scheme of the current frame may be calculated first, and if it is determined that the channel combining scheme of the current frame is a correlated signal channel combining 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 combining scheme of the current frame; or if it is determined that the channel combining scheme of the current frame is an anti-correlated signal channel combining scheme, the time-domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame are calculated, and the time-domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame are determined as the time-domain stereo parameters of the current frame.
[0016] Alternatively, the channel combining scheme of the current frame may be determined first. If it is determined that the channel combining scheme of the current frame is a correlated signal channel combining scheme, time domain stereo parameters corresponding to the correlated signal channel combining 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 combining scheme of the current frame. If it is determined that the channel combining scheme of the current frame is an anti-correlated signal channel combining scheme, time domain stereo parameters corresponding to the anti-correlated signal channel combining 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 anti-correlated signal channel combining 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 bonding scheme of the current frame includes the step of determining an initial value of a channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame based on the channel bonding scheme of the current frame. If the initial value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame (correlated signal channel bonding scheme or anti-correlated signal channel bonding scheme) does not need to be changed, the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame is equal to the initial value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame. If the initial value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame (correlated signal channel bonding scheme or anti-correlated signal channel bonding scheme) needs to be changed, the initial value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame is changed to obtain a changed value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame, and the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame is equal to the changed value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame.
[0018] For example, determining the time-domain stereo parameters of the current frame based on the channel combining scheme of the current frame may include: calculating a frame energy of a left channel signal of the current frame based on the left channel signal of the current frame; calculating a frame energy of a right channel signal of the current frame based on the right channel signal of the current frame; and calculating an initial value of a channel combining ratio coefficient corresponding to the correlation signal channel combining 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] When the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame does not need to be changed, the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is equal to the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame, and the coded index of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is equal to the coded index of the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame.
[0020] If the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame needs to be changed, the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame and the coded index of the initial value are modified to obtain a modified value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame and a coded index of the modified value. The channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is equal to the modified value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame, and the coded index of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is equal to the coded index of the modified value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame.
[0021] Specifically, for example, when the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame and the coded index of the initial value are changed, ratio_idx_mod=0.5*(tdm_last_ratio_idx+16), ratio_mod qua = ratio_tabl[ratio_idx_mod], tdm_last_ratio_idx indicates an encoded index of a channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the previous frame, ratio_idx_mod indicates an encoded index corresponding to a modified value of a channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame, and ratio_mod qua denotes the modified value of the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme of the current frame.
[0022] As another example, determining the time-domain stereo parameters of the current frame based on the channel combining scheme of the current frame includes obtaining a reference channel signal of the current frame based on a left channel signal and a right channel signal of the current frame; calculating an amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal; calculating an amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal; calculating an 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 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; and calculating a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining 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 anti-correlated 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, for example, include: calculating an initial value of the channel coupling ratio coefficient corresponding to the anti-correlated 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 modifying the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame to obtain the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame. It should be understood that when the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame does not need to be modified, the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame is equal to the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame.
[0024] In some possible implementations,
number
[0025] In some possible implementations, calculating an amplitude correlation difference parameter between the left and right channel signals of the current frame based on an amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame and an amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame includes: calculating a long-term 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 delay-aligned left channel signal and the reference channel signal of the current frame; calculating a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame based on the amplitude correlation parameter between the delay-aligned right channel signal and the reference channel signal of the current frame; and calculating an 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 and the reference channel signal of the current frame and the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame.
[0026] There are various smoothing methods, for example: tdm_lt_corr_LM_SM cur =α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM, tdm_lt_rms_L_SM cur =(1-A)*tdm_lt_rms_L_SM pre +A*rms_L, where A is the update coefficient of the long-term smoothed frame energy of the left channel signal of the current frame, and tdm_lt_rms_L_SM cur denotes the long-term smoothed frame energy of the left channel signal of the current frame, rms_L denotes the frame energy of the left channel signal of the current frame, and tdm_lt_corr_LM_SM cur denotes the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal, and tdm_lt_corr_LM_SM predenotes the long-term smoothed amplitude correlation parameter between the left channel signal of the previous frame and the reference channel signal, and α denotes the left channel smoothing coefficient.
[0027] for example, tdm_lt_corr_RM_SM cur =β*tdm_lt_corr_RM_SM pre +(1-β)corr_LM.
[0028] tdm_lt_rms_R_SM cur =(1-B)*tdm_lt_rms_R_SM pre +B*rms_R, where B is the update coefficient of the long-term smoothed frame energy of the right channel signal of the current frame, and tdm_lt_rms_R_SM pre denotes the long-term smoothed frame energy of the right channel signal of the current frame, rms_R denotes the frame energy of the right channel signal of the current frame, and tdm_lt_corr_RM_SM cur denotes the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, and tdm_lt_corr_RM_SM pre denotes the long-term smoothed amplitude correlation parameter between the right channel signal of the previous frame and the reference channel signal, and β denotes 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 indicates 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 indicates 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 indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame.
[0030] In some possible implementations, the step of calculating a channel coupling ratio coefficient corresponding to an anti-correlated signal channel coupling scheme of the current frame based on an amplitude correlation difference parameter between the left and right channel signals of the current frame includes the steps of performing a mapping process on the amplitude correlation difference parameter between the left and right channel signals of the current frame, such that the value range of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process can be [MAP_MIN, MAP_MAX], and converting the amplitude correlation difference parameter between the left and right channel signals and that has undergone the mapping process into a channel coupling ratio coefficient.
[0031] In some possible implementation forms, the step of performing a mapping process on amplitude correlation difference parameters between the left and right channels of the current frame includes the steps of performing amplitude limiting on amplitude correlation difference parameters between the left and right channel signals of the current frame, and performing a mapping process on the amplitude-limited amplitude correlation difference parameters between the left and right channel signals of the current frame.
[0032] There are various amplitude limiting methods, for example:
number
[0033] There are various mapping methods available. For example,
number
[0034] As another example,
number
number
[0035] In some possible implementations,
number
[0036] When the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame needs to be changed to obtain the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame, the initial value of the channel coupling ratio coefficient corresponding to the anti-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 anti-correlated signal channel coupling scheme of the current frame, or the initial value of the channel coupling ratio coefficient corresponding to the anti-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 anti-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 indicates a codebook for performing scalar quantization on the channel combining ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the current frame, ratio_idx_init_SM indicates an initial coded index corresponding to the anti-correlated signal channel combining scheme of the current frame, and ratio_init_SM qua denote the quantized coded initial values of the channel combining ratio coefficients corresponding to the decorrelation signal channel combining 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 indicates a channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame, and ratio_idx_SM indicates a coded index of the channel coupling ratio coefficient corresponding to the anti-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 indicates an initial coded index corresponding to the anti-correlated signal channel combining scheme of the current frame, tdm_last_ratio_idx_SM indicates a final coded index of the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the previous frame, φ is a modification coefficient of the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme, and ratio_SM indicates the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame.
[0039] Of course, the specific implementation of modifying the initial values of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame to obtain the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame is not limited to the above examples.
[0040] In addition, when the time domain stereo parameters include inter-channel time differences, determining the time domain stereo parameters of the current frame based on the channel combining scheme of the current frame may include calculating the inter-channel time differences of the current frame when the channel combining scheme of the current frame is a correlated signal channel combining scheme. In addition, the inter-channel time differences of the current frame obtained by calculation may be written into the bitstream. When the channel combining scheme of the current frame is an anti-correlated signal channel combining 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 may not be written into the bitstream, and the decoding device also uses the default inter-channel time difference.
[0041] According to a second aspect, an embodiment of the present application further provides a time domain stereo parameter coding device, which may include a processor and a memory coupled to each other. The processor may be configured to perform some or all of the steps of any method in the first aspect. An embodiment of the present application further provides a time domain stereo coding device, which may include the time domain stereo parameter coding device described above.
[0042] According to a third aspect, an embodiment of the present application provides a time-domain stereo parameter coding device comprising a number of functional units configured to implement any of the methods in the first aspect.
[0043] According to a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium storing program code, the program code comprising instructions used to perform some or all of the steps of any of the methods in the first aspect.
[0044] According to a fifth aspect, an embodiment of the present application provides a computer program product, which when run on a computer causes the computer to perform some or all of the steps of any of the methods in the first aspect.
[0045] Hereinafter, accompanying drawings necessary for explaining the embodiments or background art of the present application will be described. [Brief description of the drawings]
[0046] [Figure 1] FIG. 2 is a schematic diagram of a substantially out-of-phase signal according to an embodiment of the present application. [Diagram 2] 1 is a schematic flow chart of an audio encoding method according to an embodiment of the present application; [Diagram 3] 2 is a schematic flow chart of a method for determining an audio decoding mode according to an embodiment of the present application; [Figure 4] 4 is a schematic flow chart of another audio encoding method according to an embodiment of the present application; [Diagram 5] 1 is a schematic flow chart of an audio decoding method according to an embodiment of the present application; [Figure 6] 4 is a schematic flow chart of another audio encoding method according to an embodiment of the present application; [Figure 7] 4 is a schematic flow chart of another audio decoding method according to an embodiment of the present application; [Figure 8] 1 is a schematic flow chart of a time-domain stereo parameter determination method according to an embodiment of the present application; [Figure 9-A] 4 is a schematic flow chart of another audio encoding method according to an embodiment of the present application; [Figure 9-B]4 is a schematic flow diagram of a method for calculating and encoding channel combining ratio coefficients corresponding to a decorrelation signal channel combining scheme of a current frame according to an embodiment of the present application; [Figure 9-C] 4 is a schematic flow chart of a method for calculating an amplitude correlation difference parameter between a left channel and a right channel of a current frame according to an embodiment of the present application; [Figure 9-D] 4 is a schematic flow chart of a method for converting an amplitude correlation difference parameter between a left channel and a right channel of a current frame into a channel coupling ratio coefficient according to an embodiment of the present application. [Figure 10] 4 is a schematic flow chart of another audio decoding method according to an embodiment of the present application; [Figure 11-A] 1 is a schematic diagram of an apparatus according to an embodiment of the present application; [Figure 11-B] FIG. 2 is a schematic diagram of another apparatus according to an embodiment of the present application. [Figure 11-C] FIG. 2 is a schematic diagram of another apparatus according to an embodiment of the present application. [Figure 12-A] FIG. 2 is a schematic diagram of another apparatus according to an embodiment of the present application. [Figure 12-B] FIG. 2 is a schematic diagram of another apparatus according to an embodiment of the present application. [Figure 12-C] FIG. 2 is a schematic diagram of another apparatus according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0047] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application.
[0048] The terms "comprise," "have," or any other variations thereof, referred to in the specification, claims, and accompanying drawings of this application, are intended to include a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, and may optionally further include steps or units that are not listed, or may optionally further include other inherent steps or units of the process, method, product, or device. In addition, terms such as "first," "second," "third," "fourth," etc. are used to distinguish between objects rather than to describe a particular order.
[0049] It should be noted that, since the solution in the embodiment of the present application is specific to the time domain scenario, for the sake of brevity, the time domain signal may be simply referred to as a "signal". For example, the left channel time domain signal may be simply referred to as a "left channel signal". In another example, the right channel time domain signal may be simply referred to as a "right channel signal". In another example, the mono time domain signal may be simply referred to as a "mono signal". In another example, the reference channel time domain signal may be simply referred to as a "reference channel signal". In another example, the primary channel time domain signal may be simply referred to as a "primary channel signal". The secondary channel time domain signal may be simply referred to as a "secondary channel signal". In another example, the Mid channel time domain signal may be simply referred to as a "Mid channel signal". In another example, the Side channel time domain signal may be simply referred to as a "Side channel signal". Other cases can be inferred by analogy.
[0050] It should be noted that in the embodiment of the present application, the left channel time domain signal and the right channel time domain signal may be collectively referred to as "left and right channel time domain signals" or "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 subjected to delay alignment processing of the current frame include the left channel time domain signal subjected to delay alignment processing of the current frame and the right channel time domain signal subjected to delay alignment processing of the current frame. Similarly, the primary channel signal and the secondary channel signal may be collectively referred to as "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 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 a conventional MS coding technique, the left and right channel signals are first downmixed to obtain a mid channel signal and a side channel signal. For example, L indicates the left channel signal, and R indicates the right channel signal. In this case, the mid channel signal is 0.5×(L+R), which indicates information about the correlation between the left channel and the right channel, and the side channel signal is 0.5×(LR), which indicates information about the difference between the left channel and the right channel. Then, the mid channel signal and the side channel signal are separately coded by using a mono coding method. The mid channel signal is usually coded by using a relatively large number of bits, and the side channel signal is usually coded by 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 that are used to indicate the ratio of the left channel to the right channel in the time-domain downmix process to improve the coding quality. The aim of the proposed method is to increase the energy of the primary channel and decrease the energy of the secondary channel in the time-domain downmix signal when the energy difference between the left and right channel signals of the stereo is relatively large. For example, L denotes the left channel signal and R denotes the right channel signal. In this case, the primary channel signal is denoted by Y, where Y=alpha x L+beta x R, where Y indicates information about the correlation between the two channels, and the secondary channel is denoted by X, where X=alpha x L-beta x R, where X represents information about the difference between the two channels. Here, alpha and beta are real numbers from 0 to 1.
[0053] FIG. 1 shows the amplitude variation of the left channel signal and the right channel signal. At a certain moment in the time domain, the absolute value of the amplitude of the sampling point of the left channel signal at a certain position and the absolute value of the amplitude of the sampling point of the right channel signal at the corresponding position are basically the same, but the amplitudes have opposite signs. This is a typical approximately non-in-phase signal. FIG. 1 only shows a typical example of an approximately non-in-phase signal. In reality, an approximately non-in-phase signal is a stereo signal with a phase difference between the left and right channel signals of about 180 degrees. For example, a stereo signal with a phase difference between the left and right channel signals in the range of [180-θ, 180+θ] is called an approximately non-in-phase signal, where θ can be any angle between 0° and 90°. For example, θ may be equal to an angle of 0°, 5°, 15°, 17°, 20°, 30°, 40°, etc.
[0054] Similarly, a substantially in-phase signal is a stereo signal in which the phase difference between the left and right channel signals is approximately 0 degrees. For example, a stereo signal in which the phase difference between the left and right channel signals is in the range of [-θ, θ] may be referred to as a substantially in-phase signal. θ may be any angle between 0° and 90°. For example, θ may be equal to an angle of 0°, 5°, 15°, 17°, 20°, 30°, 40°, etc.
[0055] When the left and right channel signals are approximately in-phase signals, the energy of the primary channel signal generated by the time-domain down-mix processing is usually significantly larger than that of the secondary channel signal. If the primary channel signal is encoded by using a relatively large number of bits and the secondary channel signal is encoded by using a relatively small number of bits, a better encoding effect can be obtained. However, when the left and right channel signals are approximately out-of-phase signals, the energy of the generated primary channel signal may be very small or even lost when the same time-domain down-mix processing method is used, which reduces the final encoding quality.
[0056] The following continues to describe some technical solutions that can help improve the quality of stereo encoding and decoding.
[0057] The encoding device and the decoding device referred to in the embodiments of the present application may be devices having functions such as collecting, storing, and transmitting audio signals to the outside, etc. Specifically, the encoding device and the decoding device may be, for example, a mobile phone, a server, a tablet computer, a personal computer, or a notebook computer.
[0058] It should be understood that in the solution of the present application, the left and right channel signals are left and right channel signals of a stereo signal. The stereo signal may be an original stereo signal, or a stereo signal formed by two signal channels included in a multi-channel signal, or a stereo signal formed by two signal channels jointly generated by a plurality of signal channels included in a multi-channel signal. The stereo encoding method may also be a stereo encoding method used in multi-channel encoding. The stereo encoding device may also be a stereo encoding device used in a multi-channel encoding device. The stereo decoding method may also be a stereo decoding method used in multi-channel decoding. The stereo decoding device may also be a stereo decoding device used in a multi-channel decoding device. The audio encoding method in the embodiment of the present application is, for example, specific to a stereo encoding scenario, and the audio decoding method in the embodiment of the present application is, for example, specific to a stereo decoding scenario.
[0059] The following first provides a method for determining an audio coding mode, which may include determining a channel combining scheme for a current frame, and determining an coding mode for the current frame based on the channel combining scheme of a previous frame and the channel combining scheme of the current frame.
[0060] 2 is a schematic flow chart of an audio encoding method according to an embodiment of the present application. The relevant steps of the audio encoding method may be implemented by an encoding device, and may include, for example, the following steps:
[0061] 201. Determine the channel bonding scheme for the current frame.
[0062] The channel combining scheme of the current frame is one of a plurality of channel combining schemes. For example, the plurality of channel combining schemes include an anticorrelated signal channel combining scheme and a correlated signal channel combining scheme. The correlated signal channel combining scheme is a channel combining scheme corresponding to approximately in-phase signals. The anticorrelated signal channel combining scheme is a channel combining scheme corresponding to approximately non-in-phase signals. It can be understood that the channel combining scheme corresponding to approximately in-phase signals is applicable to approximately in-phase signals, and the channel combining scheme corresponding to approximately non-in-phase signals is applicable to approximately non-in-phase signals.
[0063] 202. Determine an encoding mode for the current frame based on a channel combining scheme of a previous frame and a channel combining scheme of the current frame.
[0064] In addition, if the current frame is the first frame (i.e., there is no frame before the current frame), the coding mode of the current frame may be determined based on the channel combining scheme of the current frame. Alternatively, a default coding mode may be used as the coding mode of the current frame.
[0065] The coding mode of the current frame is one of a plurality of coding modes, which may include, for example, a correlated-to-anticorrelated signal coding switching mode, an anticorrelated-to-correlated signal coding switching mode, a correlated signal coding mode, an anticorrelated signal coding mode, etc.
[0066] A time-domain downmix mode corresponding to a mode of switching signal coding from correlated to anticorrelated may be called, for example, a "correlated-to-anticorrelated signal downmix switching mode." A time-domain downmix mode corresponding to a mode of switching signal coding from anticorrelated to correlated may be called, for example, an "anticorrelated-to-correlated signal downmix switching mode." A time-domain downmix mode corresponding to a correlated signal coding mode may be called, for example, a "correlated signal downmix mode." A time-domain downmix mode corresponding to an anticorrelated signal coding mode may be called, for example, an "anticorrelated signal downmix mode."
[0067] It will be understood that in this embodiment of the present application, the names of objects such as encoding modes, decoding modes, and channel bonding schemes are all examples, and other names may also be used in real applications.
[0068] 203. Perform a time-domain down-mix process on the left and right channel signals of the current frame based on a time-domain down-mix process corresponding to the encoding mode of the current frame, to obtain primary and secondary channel signals of the current frame.
[0069] A time-domain downmix process may be performed on the left and right channel signals of the current frame to obtain primary and secondary channel signals of the current frame, and the primary and secondary channel signals are further encoded to obtain a bitstream. Furthermore, a channel combining scheme flag of the current frame (the channel combining scheme flag of the current frame is used to indicate the channel combining scheme of the current frame) is written into the bitstream, so that the decoding device may determine the channel combining scheme of the current frame based on the channel combining scheme flag of the current frame included in the bitstream.
[0070] There may be various specific implementations of determining the encoding mode for the current frame based on the channel combining scheme of the previous frame and the channel combining scheme of the current frame.
[0071] Specifically, for example, in some possible implementations, determining an encoding mode for a current frame based on a channel combining scheme of a previous frame and a channel combining scheme of a current frame includes: determining that the coding mode of the current frame is a mode of switching signal coding from correlation to anti-correlation when the channel combining scheme of the previous frame is a correlated signal channel combining scheme and the channel combining scheme of the current frame is an anti-correlated signal channel combining scheme, in which in the mode of switching signal coding from correlation to anti-correlation, the time-domain down-mix processing is performed by using a down-mix processing method corresponding to the transition from the correlated signal channel combining scheme to the anti-correlated signal channel combining scheme; or If the channel combining scheme of the previous frame is an anti-correlated signal channel combining scheme and the channel combining scheme of the current frame is an anti-correlated signal channel combining scheme, determining that the coding mode of the current frame is an anti-correlated signal coding mode, in which the time-domain down-mix processing is performed by using a down-mix processing method corresponding to the anti-correlated signal channel combining scheme; or or determining that, when the channel combining scheme of the previous frame is an anti-correlated signal channel combining scheme and the channel combining scheme of the current frame is a correlated signal channel combining scheme, the encoding mode of the current frame is a mode of switching signal encoding from anti-correlated to correlated, where in the mode of switching signal encoding from anti-correlated to correlated, the time-domain down-mix processing is performed by using a down-mix processing method corresponding to the transition from anti-correlated signal channel combining scheme to correlated signal channel combining scheme, and the time-domain down-mix processing scheme corresponding to the mode of switching signal encoding from anti-correlated to correlated is specifically a segmented time-domain down-mix scheme, i.e., performing a segmented time-domain down-mix processing on the left and right channel signals of the current frame according to the channel combining scheme of the current frame and the channel combining scheme of the previous frame; The method may include: if the channel combining scheme of the previous frame is a correlated signal channel combining scheme and the channel combining scheme of the current frame is a correlated signal channel combining scheme, determining that the encoding mode of the current frame is a correlated signal encoding mode, in which in the correlated signal encoding mode, the time-domain down-mix processing is performed by using a down-mix processing method corresponding to the correlated signal channel combining scheme.
[0072] It will be appreciated that different coding modes typically correspond to different time-domain downmix processing schemes, and each coding mode may correspond to one or more time-domain downmix processing schemes.
[0073] For example, in some possible implementations, when it is determined that the encoding mode of the current frame is a correlated signal encoding mode, a time-domain downmix processing scheme corresponding to the correlated signal encoding mode is used to perform time-domain downmix processing on the left and right channel signals of the current frame to obtain the primary and secondary channel signals of the current frame. The time-domain downmix processing scheme corresponding to the correlated signal encoding mode is a time-domain downmix processing scheme corresponding to the correlated signal channel combining scheme.
[0074] As another example, in some possible implementations, when it is determined that the encoding mode of the current frame is an anti-correlated signal encoding mode, a time-domain down-mix processing scheme corresponding to the anti-correlated signal encoding mode is used to perform time-domain down-mix processing on the left and right channel signals of the current frame to obtain the primary and secondary channel signals of the current frame. The time-domain down-mix processing scheme corresponding to the anti-correlated signal encoding mode is a time-domain down-mix processing scheme corresponding to an anti-correlated signal channel combining scheme.
[0075] As another example, in some possible implementations, when it is determined that the encoding mode of the current frame is a mode of switching signal encoding from correlation to anti-correlation, a time-domain downmix processing scheme corresponding to the mode of switching signal encoding from correlation to anti-correlation is used to perform a time-domain downmix processing on the left and right channel signals of the current frame to obtain primary and secondary channel signals of the current frame. The time-domain downmix processing scheme corresponding to the mode of switching signal encoding from correlation to anti-correlation is a time-domain downmix processing scheme corresponding to a transition from a correlation signal channel combining scheme to an anti-correlation signal channel combining scheme. The time-domain downmix processing scheme corresponding to the mode of switching signal encoding from correlation to anti-correlation may specifically be a segmented time-domain downmix scheme, that is, performing a segmented time-domain downmix processing on the left and right channel signals of the current frame based on the channel combining scheme of the current frame and the channel combining scheme of the previous frame.
[0076] As another example, in some possible implementations, when it is determined that the encoding mode of the current frame is a mode of switching signal encoding from anti-correlation to correlation, a time-domain downmix processing scheme corresponding to the mode of switching signal encoding from anti-correlation to correlation is used to perform time-domain downmix processing on the left and right channel signals of the current frame to obtain primary and secondary channel signals of the current frame. The time-domain downmix processing scheme corresponding to the mode of switching signal encoding from anti-correlation to correlation is a time-domain downmix processing scheme corresponding to a transition from an anti-correlation signal channel combining scheme to a correlation signal channel combining scheme.
[0077] It will be appreciated that different coding modes typically correspond to different time-domain downmix processing schemes, and each coding mode may correspond to one or more time-domain downmix processing schemes.
[0078] For example, in some possible implementations, performing a time-domain downmix processing on the left and right channel signals of the current frame by using a time-domain downmix processing scheme corresponding to the anti-correlated signal coding mode to obtain primary and secondary channel signals of the current frame may include performing a time-domain downmix processing on the left and right channel signals of the current frame based on channel combining ratio coefficients of the anti-correlated signal channel combining scheme of the current frame to obtain primary and secondary channel signals of the current frame, or performing a time-domain downmix processing on the left and right channel signals of the current frame based on channel combining ratio coefficients of the anti-correlated signal channel combining scheme of the current frame and channel combining ratio coefficients of the anti-correlated signal channel combining scheme of the previous frame to obtain primary and secondary channel signals of the current frame.
[0079] It can be understood that in the above solution, the channel bonding scheme of the current frame needs to be determined, which indicates that there are multiple possibilities for the channel bonding scheme of the current frame. Compared with the conventional solution with only one channel bonding scheme, the present solution with multiple possible channel bonding schemes can better match and match with multiple possible scenarios. In the above solution, the coding mode of the current frame needs to be determined based on the channel bonding scheme of the previous frame and the channel bonding scheme of the current frame, and there are multiple possibilities for the coding mode of the current frame. Compared with the conventional solution with only one coding mode, the present solution with multiple possible coding modes can better match and match with multiple possible scenarios.
[0080] Specifically, for example, it may be determined that if the channel combining scheme of the current frame is different from the channel combining scheme of the previous frame, the encoding mode of the current frame may be, for example, a mode of switching signal encoding from correlation to anti-correlation or a mode of switching signal encoding from anti-correlation to correlation. In this case, a segmented time-domain downmix process may be performed on the left and right channel signals of the current frame based on the channel combining scheme of the current frame and the channel combining scheme of the previous frame.
[0081] When the channel combining scheme of the current frame and the channel combining scheme of the previous frame are different, a mechanism is introduced to perform segmented time-domain downmix processing on the left and right channel signals of the current frame. The segmented time-domain downmix processing mechanism helps to implement a smooth transition of the channel combining scheme, and further helps to improve the encoding quality.
[0082] Correspondingly, the following describes a time-domain stereo decoding scenario by using an example.
[0083] With reference to Figure 3, the following further provides a method for determining an audio decoding mode. The relevant steps of the method for determining an audio decoding mode may be implemented by a decoding device, and the method may specifically include:
[0084] 301. Determine the channel bonding scheme of the current frame based on the channel bonding scheme flag of the current frame in the bitstream.
[0085] 302. Determine a decoding mode for the current frame based on a channel bonding scheme of a previous frame and a channel bonding scheme of the current frame.
[0086] The decoding mode of the current frame is one of a plurality of decoding modes, which may include, for example, a correlated-to-anticorrelated signal decoding switching mode, an anticorrelated-to-correlated signal decoding switching mode, a correlated signal decoding mode, an anticorrelated signal decoding mode, etc.
[0087] A time-domain upmix mode corresponding to a mode of switching signal decoding from correlated to anticorrelated may be called, for example, a "correlated-to-anticorrelated signal upmix switching mode." A time-domain upmix mode corresponding to a mode of switching signal decoding from anticorrelated to correlated may be called, for example, an "anticorrelated-to-correlated signal upmix switching mode." A time-domain upmix mode corresponding to a correlated signal decoding mode may be called, for example, a "correlated signal upmix mode." A time-domain upmix mode corresponding to an anticorrelated signal decoding mode may be called, for example, an "anticorrelated signal upmix mode."
[0088] It will be understood that in this embodiment of the present application, the names of objects such as encoding modes, decoding modes, and channel bonding schemes are all examples, and other names may also be used in real applications.
[0089] In some possible implementations, determining an encoding mode for a current frame based on a channel combining scheme of a previous frame and a channel combining scheme of a current frame comprises: determining that the decoding mode of the current frame is a mode of switching signal decoding from correlation to anti-correlation when the channel combining scheme of the previous frame is a correlated signal channel combining scheme and the channel combining scheme of the current frame is an anti-correlated signal channel combining scheme, in which in the mode of switching signal decoding from correlation to anti-correlation, the time-domain up-mix processing is performed by using an up-mix processing method corresponding to the transition from the correlated signal channel combining scheme to the anti-correlated signal channel combining scheme; or If the channel combining scheme of the previous frame is an anti-correlated signal channel combining scheme and the channel combining scheme of the current frame is an anti-correlated signal channel combining scheme, determining that the decoding mode of the current frame is an anti-correlated signal decoding mode, in which the time-domain up-mix processing is performed by using an up-mix processing method corresponding to the anti-correlated signal channel combining scheme; or determining that the decoding mode of the current frame is a mode of switching signal decoding from anti-correlation to correlation when the channel combining scheme of the previous frame is an anti-correlation signal channel combining scheme and the channel combining scheme of the current frame is a correlation signal channel combining scheme, in which in the mode of switching signal decoding from anti-correlation to correlation, the time-domain up-mix processing is performed by using an up-mix processing method corresponding to the transition from the anti-correlation signal channel combining scheme to the correlation signal channel combining scheme; or If the channel combining scheme of the previous frame is a correlated signal channel combining scheme and the channel combining scheme of the current frame is a correlated signal channel combining scheme, determining that a decoding mode of the current frame is a correlated signal decoding mode, in which in the correlated signal decoding mode, a time-domain up-mix processing is performed by using an up-mix processing method corresponding to the correlated signal channel combining scheme.
[0090] For example, when determining that the decoding mode of the current frame is an anti-correlated signal decoding mode, the decoding device performs a time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to the anti-correlated signal decoding mode to obtain reconstructed left and right channel signals of the current frame.
[0091] The reconstructed left and right channel signals may be decoded left and right channel signals, or delay adjustment processing and / or time domain post-processing may be performed on the reconstructed left and right channel signals to obtain the decoded left and right channel signals.
[0092] The time-domain up-mix processing scheme corresponding to the anti-correlated signal decoding mode is a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combining scheme, which is a channel combining scheme corresponding to approximately out-of-phase signals.
[0093] The decoding mode of the current frame may be one of a plurality of decoding modes. For example, the decoding mode of the current frame may be one of the following decoding modes: a correlated signal decoding mode, an anti-correlated signal decoding mode, a mode of switching signal decoding from correlated to anti-correlated, and a mode of switching signal decoding from anti-correlated to correlated.
[0094] It can be understood that in the above solution, the decoding mode of the current frame needs to be determined, which indicates that there are multiple possibilities for the decoding mode of the current frame.Compared with the traditional solution that has only one decoding mode, the present solution with multiple possible decoding modes can better match and match with multiple possible scenarios.In addition, since a channel combining scheme that corresponds to nearly non-co-phase signals is introduced, when the stereo signal of the current frame is a nearly non-co-phase signal, there are more targeted channel combining schemes and decoding modes, which helps to improve the decoding quality.
[0095] As another example, when determining that the decoding mode of the current frame is a correlated signal decoding mode, the decoding device performs time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to the correlated signal decoding mode, to obtain reconstructed left and right channel signals of the current frame, where the time-domain up-mix processing scheme corresponding to the correlated signal decoding mode is a time-domain up-mix processing scheme corresponding to a correlated signal channel combining scheme, and the correlated signal channel combining scheme is a channel combining scheme corresponding to a nearly in-phase signal.
[0096] As another example, when determining that the decoding mode of the current frame is a mode of switching signal decoding from correlation to anti-correlation, the decoding device performs time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to the mode of switching signal decoding from correlation to anti-correlation, so as to obtain reconstructed left and right channel signals of the current frame. The time-domain up-mix processing scheme corresponding to the mode of switching signal decoding from correlation to anti-correlation is a time-domain up-mix processing scheme corresponding to a transition from a correlated signal channel combining scheme to an anti-correlated signal channel combining scheme.
[0097] As another example, when determining that the decoding mode of the current frame is a mode of switching signal decoding from anti-correlation to correlation, the decoding device performs time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to the mode of switching signal decoding from anti-correlation to correlation, so as to obtain reconstructed left and right channel signals of the current frame. The time-domain up-mix processing scheme corresponding to the mode of switching signal decoding from anti-correlation to correlation is a time-domain up-mix processing scheme corresponding to a transition from an anti-correlation signal channel combining scheme to a correlation signal channel combining scheme.
[0098] It will be appreciated that different decoding modes typically correspond to different time-domain up-mix processing schemes, and each decoding mode may correspond to one or more time-domain up-mix processing schemes.
[0099] It can be understood that in the above solution, the channel bonding scheme of the current frame needs to be determined, which indicates that there are multiple possibilities for the channel bonding scheme of the current frame. Compared with the traditional solution with only one channel bonding scheme, the present solution with multiple possible channel bonding schemes can better match and match with multiple possible scenarios. In the above solution, the decoding mode of the current frame needs to be determined based on the channel bonding scheme of the previous frame and the channel bonding scheme of the current frame, and there are multiple possibilities for the decoding mode of the current frame. Compared with the traditional solution with only one decoding mode, the present solution with multiple possible decoding modes can better match and match with multiple possible scenarios.
[0100] Furthermore, the decoding device performs a time-domain up-mix process on the decoded primary and secondary channel signals of the current frame based on a time-domain up-mix process corresponding to a decoding mode of the current frame to obtain reconstructed left and right channel signals of the current frame.
[0101] In the following, examples are used to describe some specific implementations of determining the channel bonding scheme of the current frame by the encoding device: There are various specific implementations of determining the channel bonding scheme of the current frame by the encoding device.
[0102] For example, in some possible implementations, determining the channel bonding scheme for the current frame may include performing a channel bonding scheme determination for the current frame at least once to determine the channel bonding scheme for the current frame.
[0103] Specifically, for example, determining the channel bonding scheme of the current frame includes performing an initial channel bonding scheme determination of the current frame to determine an initial channel bonding scheme of the current frame, and performing a channel bonding scheme change determination of the current frame based on the initial channel bonding scheme of the current frame to determine the channel bonding scheme of the current frame. In addition, the initial channel bonding scheme of the current frame can also be directly used as the channel bonding scheme of the current frame. In other words, the channel bonding scheme of the current frame can be the initial channel bonding scheme of the current frame determined after the initial channel bonding scheme determination of the current frame is performed.
[0104] For example, performing the initial channel combining scheme determination for the current frame may include determining an in-phase / out-of-phase signal type of the stereo signal of the current frame by using left and right channel signals of the current frame, and determining an initial channel combining scheme for the current frame based on the in-phase / out-of-phase signal type of the stereo signal of the current frame and the channel combining scheme of the previous frame. The in-phase / out-of-phase signal type of the stereo signal of the current frame may be a nearly in-phase signal or a nearly out-of-phase signal. The in-phase / out-of-phase signal type of the stereo signal of the current frame may be indicated by a signal type of an in-phase / out-of-phase flag of the current frame (e.g., 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 in-phase / out-of-phase flag for the current frame is "1", it indicates that the in-phase / out-of-phase signal type of the stereo signal of the current frame is an approximately in-phase signal, or if the signal type value of the in-phase / out-of-phase flag for the current frame is "0", it indicates that the in-phase / out-of-phase signal type of the stereo signal of the current frame is an approximately out-of-phase signal, and vice versa.
[0105] The channel combining scheme of an audio frame (e.g., a previous frame or a current frame) may be indicated by a channel combining scheme flag of the audio frame. For example, a value of the channel combining scheme flag of the audio frame is "0" to indicate that the channel combining scheme of the audio frame is a correlated signal channel combining scheme, or a value of the channel combining scheme flag of the audio frame is "1" to indicate that the channel combining scheme of the audio frame is an anti-correlated signal channel combining scheme, and vice versa.
[0106] Similarly, the initial channel combining scheme of an audio frame (e.g., a previous frame or a current frame) may be indicated by an initial channel combining scheme flag of the audio frame (e.g., the initial channel combining scheme flag is represented by tdm_SM_flag_loc). For example, a value of the initial channel combining scheme flag of an audio frame is "0" indicates that the initial channel combining scheme of the audio frame is a correlated signal channel combining scheme, or in another example, a value of the initial channel combining scheme flag of an audio frame is "1" indicates that the initial channel combining scheme of the audio frame is an anti-correlated signal channel combining scheme, and vice versa.
[0107] Determining the in-phase / out-of-phase signal type of the stereo signal of the current frame by using the left and right channel signals of the current frame may include calculating a correlation value xorr between the left and right channel signals of the current frame, and determining that the in-phase / out-of-phase signal type of the stereo signal of the current frame is an approximately in-phase signal if the xorr is less than or equal to a first threshold, or determining that the in-phase / out-of-phase signal type of the stereo signal of the current frame is an approximately out-of-phase signal if the xorr is greater than the first threshold. Furthermore, when the signal type of the in-phase / out-of-phase flag of the current frame is used to indicate the in-phase / out-of-phase signal type of the stereo signal of the current frame, if it is determined that the in-phase / out-of-phase signal type of the stereo signal of the current frame is an approximately in-phase signal, the value of the signal type of the in-phase / out-of-phase flag of the current frame may be set to indicate that the in-phase / out-of-phase signal type of the stereo signal of the current frame is an approximately in-phase signal, or if it is determined that the in-phase / out-of-phase signal type of the current frame is an approximately in-phase signal, the value of the signal type of the in-phase / out-of-phase flag of the current frame may be set to indicate that the in-phase / out-of-phase signal type of the stereo signal of the current frame is an approximately out-of-phase signal.
[0108] The range of values of the first threshold may be, for example, (0.5, 1.0), and the first threshold may be, for example, equal to 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 of the audio frame is an approximately in-phase signal, 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 of the audio frame is an approximately out-of-phase signal, and vice versa.
[0110] For example, determining an initial channel combining scheme for a current frame based on an in-phase / out-of-phase signal type of a stereo signal of the current frame and a channel combining scheme of a previous frame includes: determining that an initial channel combining scheme of the current frame is a correlated signal channel combining scheme if the in-phase / out-of-phase signal type of the stereo signal of the current frame is an approximately in-phase signal and the channel combining scheme of the previous frame is a correlated signal channel combining scheme; or determining that an initial channel combining scheme of the current frame is an anti-correlated signal channel combining scheme if the in-phase / out-of-phase signal type of the stereo signal of the current frame is an approximately out-of-phase signal and the channel combining scheme of the previous frame is an anti-correlated signal channel combining scheme; or When the in-phase / out-of-phase signal type of the stereo signal of the current frame is a nearly in-phase signal and the channel combining scheme of the previous frame is an anti-correlated signal channel combining scheme, if the signal-to-noise ratios of the left and right channel signals of the current frame are both less than a second threshold, determining that the initial channel combining scheme of the current frame is a correlated signal channel combining scheme, or if the signal-to-noise ratio of the left channel signal and / or the signal-to-noise ratio of the right channel signal of the current frame are equal to or greater than a second threshold, determining that the initial channel combining scheme of the current frame is an anti-correlated signal channel combining scheme; or The method may include determining that an initial channel combining scheme for the current frame is an anti-correlated signal channel combining scheme if the signal-to-noise ratios of the left and right channel signals of the current frame are both less than a second threshold when the in-phase / out-of-phase signal type of the stereo signal of the current frame is a substantially out-of-phase signal and the channel combining scheme of the previous frame is a correlated signal channel combining scheme, or determining that an initial channel combining scheme for the current frame is a correlated signal channel combining scheme if the signal-to-noise ratios of the left channel signal and / or the signal-to-noise ratio of the right channel signal of the current frame are equal to or greater than a second threshold.
[0111] The range of values of the second threshold may be, for example, [0.8, 1.2], and the second threshold may be, for example, equal to 0.8, 0.85, 0.9, 1, 1.1, or 1.18.
[0112] Performing a channel combining scheme change decision for the current frame based on the initial channel combining scheme for the current frame may include determining a channel combining scheme for the current frame based on a channel combining ratio coefficient change flag of a previous frame, an in-phase / out-of-phase signal type of the stereo signal of the current frame, and the initial channel combining scheme for the current frame.
[0113] The channel bonding scheme flag of the current frame is indicated as tdm_SM_flag, and the channel bonding ratio coefficient modification flag of the current frame is indicated as tdm_SM_modi_flag. For example, a value of the channel bonding ratio coefficient modification flag is 0, indicating that the channel bonding ratio coefficient does not need to be modified, or a value of the channel bonding ratio coefficient modification flag is 1, indicating that the channel bonding ratio coefficient needs to be modified. Of course, other different values may be used as the channel bonding ratio coefficient modification flag to indicate whether the channel bonding ratio coefficient needs to be modified or not.
[0114] Specifically, for example, performing a channel bonding scheme change decision for a current frame based on a result of an initial channel bonding scheme decision for the current frame includes: The method may include using an anti-correlated signal channel bonding scheme as a channel bonding scheme for the current frame if the channel bonding ratio coefficient change flag of the previous frame indicates that the channel bonding ratio coefficient needs to be changed, or determining whether the current frame satisfies a switching condition if the channel bonding ratio coefficient change flag of the previous frame indicates that the channel bonding ratio coefficient does not need to be changed, and determining a channel bonding scheme for the current frame based on a result of determining whether the current frame satisfies the switching condition.
[0115] Determining a channel bonding scheme for the current frame based on a result of determining whether the current frame satisfies a switching condition, If the channel bonding scheme of the previous frame is different from the initial channel bonding scheme of the current frame, and the current frame satisfies a switching condition, the initial channel bonding scheme of the current frame is a correlated signal channel bonding scheme, and the channel bonding scheme of the previous frame is an anti-correlated signal channel bonding scheme, determining that the channel bonding scheme of the current frame is an anti-correlated signal channel bonding scheme; or When the channel bonding scheme of the previous frame is different from the initial channel bonding scheme of the current frame, the current frame satisfies a switching condition, the initial channel bonding scheme of the current frame is an anti-correlated signal channel bonding scheme, the channel bonding scheme of the previous frame is a correlated signal channel bonding scheme, and the channel bonding ratio factor of the previous frame is less than a first ratio factor threshold, determining that the channel bonding scheme of the current frame is a correlated signal channel bonding scheme; or If the channel bonding scheme of the previous frame is different from the initial channel bonding scheme of the current frame, the current frame satisfies a switching condition, the initial channel bonding scheme of the current frame is an anti-correlated signal channel bonding scheme, the channel bonding scheme of the previous frame is a correlated signal channel bonding scheme, and the channel bonding ratio factor of the previous frame is equal to or greater than a first ratio factor threshold, determining that the channel bonding scheme of the current frame is an anti-correlated signal channel bonding scheme; or If the channel combining scheme of the (P-1)th frame from the current frame is different from the initial channel combining 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 type of the stereo signal of the current frame is an approximately in-phase signal, the initial channel combining scheme of the current frame is a correlated signal channel combining scheme, and the channel combining scheme of the previous frame is an anti-correlated signal channel combining scheme, then determining that the channel combining scheme of the current frame is a correlated signal channel combining scheme; If the channel combining scheme of the (P-1)th frame from the current frame is different from the initial channel combining 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 type of the stereo signal of the current frame is an almost out-of-phase signal, the initial channel combining scheme of the current frame is an anti-correlated signal channel combining scheme, the channel combining scheme of the previous frame is a correlated signal channel combining scheme, and the channel combining ratio coefficient of the previous frame is less than a second ratio coefficient threshold, determining that the channel combining scheme of the current frame is a correlated signal channel combining scheme; The method may include determining that the channel bonding scheme of the current frame is an anti-correlated signal channel combining scheme when the channel bonding scheme of the (P-1)th frame from the current frame is different from the initial channel bonding 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, an in-phase / out-of-phase signal type of the stereo signal of the current frame is a substantially out-of-phase signal, the initial channel bonding scheme of the current frame is an anti-correlated signal channel combining scheme, the channel bonding scheme of the previous frame is a correlated signal channel combining scheme, and a channel bonding ratio coefficient of the previous frame is equal to or greater than a second ratio coefficient threshold.
[0116] Here, P can be an integer greater than 1. For example, P can be equal to 2, 3, 4, 5, 6, or another value.
[0117] The range of values of the first ratio factor threshold may be, for example, [0.4, 0.6], and the first ratio factor threshold may be, for example, equal to 0.4, 0.45, 0.5, 0.55, or 0.6.
[0118] The range of values of the second ratio factor threshold may be, for example, [0.4, 0.6], and the second ratio factor threshold may be, for example, equal to 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 include determining whether the current frame satisfies the switching condition based on a frame type of the primary channel signal of the previous frame and / or a frame type of the secondary channel signal of the previous frame.
[0120] In some possible implementations, determining whether the current frame satisfies the switching condition includes: This may include determining that the current frame satisfies the switching condition if the first condition, the second condition, and the third condition are all satisfied, or determining that the current frame satisfies the switching condition if the second condition, the third condition, the fourth condition, and the fifth condition are all satisfied, or determining that the current frame satisfies the switching condition if the sixth condition is satisfied.
[0121] The first condition is as follows: the frame type of the primary channel signal of the frame preceding the previous frame is any one of VOICED_CLAS frame (a voiced frame or a frame with voiced characteristics following a 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 that ends with one of several characteristics, namely unvoiced, 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 preceding the previous frame is any one of VOICED_CLAS frame, ONSET frame, SIN_ONSET frame, INACTIVE_CLAS frame, and AUDIO_CLAS 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 that the raw coding modes of the primary channel signal and the secondary channel signal of the previous frame are not both VOICED (the coding type corresponding to a voiced frame).
[0123] The third condition is: the number of consecutive frames before the previous frame that use the channel bonding scheme used by the previous frame is greater than a preset frame number threshold. The value range of the frame number threshold may be, for example, [3, 10]. For example, the frame number threshold may be equal to 3, 4, 5, 6, 7, 8, 9, or another 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: the long-term root mean square energy value of the left and right channel signals of the current frame is less than the energy threshold. The value range of the energy threshold may be, for example, [300, 500]. For example, the frame number threshold may be equal to 300, 400, 410, 451, 482, 500, 415, or another 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 of the low frequency band to the energy of the high frequency band of the primary channel signal of the previous frame is greater than a first energy ratio threshold, and the ratio of the energy of the low frequency band to the energy of the high frequency band of the secondary channel signal of the previous frame is greater than a second energy ratio threshold.
[0127] The range of the first energy ratio threshold may be, for example, [4000, 6000]. For example, the frame number threshold may be equal to 4000, 4500, 5000, 5105, 5200, 6000, 5800, or another value.
[0128] The range of the second energy ratio threshold may be, for example, [4000, 6000]. For example, the frame number threshold may be equal to 4000, 4501, 5000, 5105, 5200, 6000, 5800, or another value.
[0129] It will be appreciated that there are various implementations for determining whether the current frame satisfies the switching condition, and these are not limited to the schemes given as examples above.
[0130] Although some implementation forms of determining the channel bonding scheme of the current frame are provided in the above examples, it should be understood that actual applications are not limited to the above example schemes.
[0131] In the following, an example is further used to explain the scenario in the decorrelated signal coding mode.
[0132] Referring to Figure 4, an embodiment of the present application provides an audio encoding method. The relevant steps of the audio encoding method may be implemented by an encoding device, and the method may specifically include:
[0133] 401. Determine the coding mode of the current frame.
[0134] 402. When determining that the encoding mode of the current frame is an anti-correlated signal encoding mode, perform a time-domain down-mix processing on the left and right channel signals of the current frame by using a time-domain down-mix processing scheme corresponding to the anti-correlated signal encoding mode, so as to obtain 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 down-mix processing scheme corresponding to the anti-correlated signal coding mode is a time-domain down-mix processing scheme corresponding to the anti-correlated signal channel combining scheme, and the anti-correlated signal channel combining scheme is a channel combining scheme corresponding to the nearly out-of-phase signals.
[0137] For example, in some possible implementations, performing a time-domain downmix processing on the left and right channel signals of the current frame by using a time-domain downmix processing scheme corresponding to the anti-correlated signal coding mode to obtain primary and secondary channel signals of the current frame may include performing a time-domain downmix processing on the left and right channel signals of the current frame based on channel combining ratio coefficients of the anti-correlated signal channel combining scheme of the current frame to obtain primary and secondary channel signals of the current frame, or performing a time-domain downmix processing on the left and right channel signals of the current frame based on channel combining ratio coefficients of the anti-correlated signal channel combining scheme of the current frame and channel combining ratio coefficients of the anti-correlated signal channel combining scheme of the previous frame to obtain primary and secondary channel signals of the current frame.
[0138] It will be understood that the channel combining ratio coefficient of the channel combining scheme (e.g., the anti-correlated signal channel combining scheme or the anti-correlated signal channel combining scheme) of the audio frame (e.g., the current frame or the previous frame) may be a preset fixed value. Of course, the channel combining ratio coefficient of the audio frame may also be determined based on the channel combining scheme of the audio frame.
[0139] In some possible implementations, a corresponding downmix matrix may be constructed based on the channel combining ratio coefficients of the audio frame, and a time-domain downmix process is performed on the left and right channel signals of the current frame by using the downmix matrix corresponding to the channel combining scheme to obtain primary and secondary channel signals of the current frame.
[0140] For example, if a time-domain downmix process is performed on the left and right channel signals of the current frame based on the channel combining ratio coefficients of the decorrelation signal channel combining scheme of the current frame to obtain the primary and secondary channel signals of the current frame,
number
[0141] As another example, when a time-domain downmix process is performed on left and right channel signals of a current frame based on a channel combining ratio coefficient of an anti-correlated signal channel combining scheme of a current frame and a channel combining ratio coefficient of an anti-correlated signal channel combining scheme of a previous frame to obtain primary and secondary channel signals of the current frame,
number
[0142] As another example, when a time-domain downmix process is performed on left and right channel signals of a current frame based on a channel combining ratio coefficient of an anti-correlated signal channel combining scheme of a current frame and a channel combining ratio coefficient of an anti-correlated signal channel combining scheme of a previous frame to obtain primary and secondary channel signals of the current frame,
number
[0143] Here, fade_in(n) is 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 the requirements of a particular scenario. For example, NOVA_1 can be equal to 3 / N, or NOVA_1 can be another value less than N.
[0146] In another example, when a time-domain downmix processing is performed on left and right channel signals of a current frame by using a time-domain downmix processing scheme corresponding to a correlation signal coding mode to obtain primary and secondary channel signals of the current frame,
number
[0147] In the above example, x L (n) denotes the left channel signal of the current frame. x R (n) denotes the right channel signal of the current frame, Y(n) denotes the primary channel signal in the current frame and obtained by the time-domain downmix process, and X(n) denotes the secondary channel signal in the current frame and obtained by the time-domain downmix process.
[0148] In the above example, n indicates the sampling point number, for example, n=0, 1, . . . , N-1.
[0149] In the above example, delay_com denotes the coding delay compensation.
[0150] M 11denotes the downmix matrix corresponding to the correlation signal channel combining scheme of the previous frame, and M 11 is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme of the previous frame.
[0151] M 12 denotes the downmix matrix corresponding to the decorrelation signal channel combining scheme of the previous frame, and M 12 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme of the previous frame.
[0152] M 22 denotes the downmix matrix corresponding to the decorrelation signal channel combining scheme of the current frame, and M 22 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme of the current frame.
[0153] M 21 denotes the downmix matrix corresponding to the correlation signal channel combining scheme of the current frame, and M 21 is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme of the current frame.
[0154] M 21 can have multiple forms, for example:
number
[0155] M 22 can have multiple forms, for example:
number
[0156] M 12 can have multiple forms, for example:
number
[0157] The left and right channel signals of the current frame may specifically be 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 pre-processing, and may be, for example, left and right channel signals obtained by sampling), may be the left and right channel signals of the current frame that have undergone time-domain pre-processing, or may be 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] Correspondingly, an example is used below to explain a scenario in the decorrelated signal decoding mode.
[0160] Referring to Figure 5, an embodiment of the present application further provides an audio decoding method. The relevant steps of the audio decoding method may be implemented by a decoding device, and the method may specifically include the following steps:
[0161] 501. Perform decoding based on a bitstream to obtain decoded primary and secondary channel signals of a current frame.
[0162] 502. Determine the decoding mode of the current frame.
[0163] It will be appreciated that there is no limited order for performing steps 501 and 502.
[0164] 503. If it is determined that the decoding mode of the current frame is an anti-correlated signal decoding mode, perform a time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to the anti-correlated signal decoding mode, so as to obtain reconstructed left and right channel signals of the current frame.
[0165] The reconstructed left and right channel signals may be decoded left and right channel signals, or delay adjustment processing and / or time domain post-processing may be performed on the reconstructed left and right channel signals to obtain the decoded left and right channel signals.
[0166] The time-domain up-mix processing scheme corresponding to the anti-correlated signal decoding mode is a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combining scheme, which is a channel combining scheme corresponding to approximately out-of-phase signals.
[0167] The decoding mode of the current frame may be one of a plurality of decoding modes. For example, the decoding mode of the current frame may be one of the following decoding modes: a correlated signal decoding mode, an anti-correlated signal decoding mode, a mode of switching signal decoding from correlated to anti-correlated, and a mode of switching signal decoding from anti-correlated to correlated.
[0168] It can be understood that in the above solution, the decoding mode of the current frame needs to be determined, which indicates that there are multiple possibilities for the decoding mode of the current frame.Compared with the traditional solution that has only one decoding mode, the present solution with multiple possible decoding modes can better match and match with multiple possible scenarios.In addition, since a channel combining scheme that corresponds to nearly non-co-phase signals is introduced, when the stereo signal of the current frame is a nearly non-co-phase signal, there are more targeted channel combining schemes and decoding modes, which helps to improve the decoding quality.
[0169] In some possible implementations, the method includes: When determining that the decoding mode of the current frame is a correlated signal decoding mode, performing a time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to the correlated signal decoding mode to obtain reconstructed left and right channel signals of the current frame, where the time-domain up-mix processing scheme corresponding to the correlated signal decoding mode is a time-domain up-mix processing scheme corresponding to a correlated signal channel combining scheme, and the correlated signal channel combining scheme is a channel combining scheme corresponding to approximately in-phase signals. It may further include.
[0170] In some possible implementations, the method may further include, when determining that the decoding mode of the current frame is a mode of switching signal decoding from correlation to anti-correlation, performing time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to the mode of switching signal decoding from correlation to anti-correlation, to obtain reconstructed left and right channel signals of the current frame, where the time-domain up-mix processing scheme corresponding to the mode of switching signal decoding from correlation to anti-correlation is a time-domain up-mix processing scheme corresponding to a transition from a correlated signal channel combining scheme to an anti-correlated signal channel combining scheme.
[0171] In some possible implementations, the method may further include, when determining that the decoding mode of the current frame is a mode of switching signal decoding from anti-correlation to correlation, performing time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to the mode of switching signal decoding from anti-correlation to correlation, to obtain reconstructed left and right channel signals of the current frame, where the time-domain up-mix processing scheme corresponding to the mode of switching signal decoding from anti-correlation to correlation is a time-domain up-mix processing scheme corresponding to a transition from an anti-correlation signal channel combining scheme to a correlation signal channel combining scheme.
[0172] It will be appreciated that different decoding modes typically correspond to different time-domain up-mix processing schemes, and each decoding mode may correspond to one or more time-domain up-mix processing schemes.
[0173] For example, in some possible implementations, performing time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to a decorrelated signal decoding mode to obtain reconstructed left and right channel signals of the current frame includes: performing a time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame based on a channel combining ratio coefficient of the anti-correlated signal channel combining scheme of the current frame to obtain reconstructed left and right channel signals of the current frame, or performing a time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame based on the channel combining ratio coefficient of the anti-correlated signal channel combining scheme of the current frame and the channel combining ratio coefficient of the anti-correlated signal channel combining scheme of the previous frame to obtain reconstructed left and right channel signals of the current frame. Includes.
[0174] In some possible implementations, a corresponding up-mix matrix may be constructed based on the channel combining ratio coefficients of the audio frame, and a time-domain up-mix process is performed on the decoded primary and secondary channel signals of the current frame by using the up-mix matrix corresponding to the channel combining scheme to obtain reconstructed left and right channel signals of the current frame.
[0175] For example, when a time-domain up-mix process is performed on the decoded primary and secondary channel signals of the current frame based on the channel combining ratio coefficients of the decorrelation signal channel combining scheme of the current frame to obtain reconstructed left and right channel signals of the current frame,
number
[0176] As another example, if a time-domain up-mix process is performed on the decoded primary and secondary channel signals of the current frame based on the channel combining ratio coefficients of the decorrelation signal channel combining scheme of the current frame and the channel combining ratio coefficients of the decorrelation signal channel combining scheme of the previous frame to obtain reconstructed left and right channel signals of the current frame,
number
[0177] As another example, if a time-domain up-mix process is performed on the decoded primary and secondary channel signals of the current frame based on the channel combining ratio coefficients of the decorrelation signal channel combining scheme of the current frame and the channel combining ratio coefficients of the decorrelation signal channel combining scheme of the previous frame to obtain reconstructed left and right channel signals of the current frame,
number
[0178] Where:
number
number
number
number
[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 the requirements of a particular scenario. For example, NOVA_1 can be equal to 3 / N, or NOVA_1 can be another value less than N.
[0183] In another example, when a time-domain up-mix process is performed on the decoded primary and secondary channel signals of the current frame based on a channel combining ratio coefficient of a correlation signal channel combining scheme of the current frame to obtain reconstructed left and right channel signals of the current frame,
number
[0184] In the above example,
number
number
number
number
[0185] In the above example, n indicates the sampling point number, for example, n=0, 1, . . . , N-1.
[0186] In the above example, upmixing_delay denotes the 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] In the following, an example is used to explain the scenarios of the mode of switching signal coding from correlation to anti-correlation and the mode of switching signal coding from anti-correlation to anti-correlation. The time-domain down-mix processing scheme corresponding to the mode of switching signal coding from correlation to anti-correlation and the mode of switching signal coding from anti-correlation to anti-correlation is, for example, a segmented time-domain down-mix processing scheme.
[0195] Referring to Figure 6, an embodiment of the present application provides an audio encoding method. The relevant steps of the audio encoding method may be implemented by an encoding device, and the method may specifically include:
[0196] 601. Determine the channel bonding scheme for the current frame.
[0197] 602. If the channel combining scheme of the current frame is different from the channel combining scheme of the previous frame, perform a segmented time-domain downmix process on the left and right channel signals of the current frame based on the channel combining scheme of the current frame and the channel combining scheme of the previous frame to obtain 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 combining scheme of the current frame is different from the channel combining scheme of the previous frame, the encoding mode of the current frame may be determined to be a mode of switching signal encoding from correlation to anti-correlation or a mode of switching signal encoding from anti-correlation to anti-correlation. If the encoding mode of the current frame is a mode of switching signal encoding from correlation to anti-correlation or a mode of switching signal encoding from anti-correlation to anti-correlation, for example, a segmented time-domain downmix process may be performed on the left and right channel signals of the current frame based on the channel combining scheme of the current frame and the channel combining scheme of the previous frame.
[0200] Specifically, for example, if the channel combining scheme of the previous frame is a correlation signal channel combining scheme and the channel combining scheme of the current frame is an anti-correlation signal channel combining scheme, the coding mode of the current frame may be determined to be a mode of switching signal coding from correlation to anti-correlation. In another example, if the channel combining scheme of the previous frame is an anti-correlation signal channel combining scheme and the channel combining scheme of the current frame is a correlation signal channel combining scheme, the coding mode of the current frame may be determined to be a mode of switching signal coding from anti-correlation to correlation. The rest can be inferred by analogy.
[0201] The segmented time-domain downmix processing may be understood as the left and right channel signals of a current frame are divided into at least two segments, and a different time-domain downmix processing scheme is used for each segment to perform the time-domain downmix processing. It may be understood that compared with the non-segmented time-domain downmix processing, the segmented time-domain downmix processing is more likely to obtain a better and smoother transition when the channel combining scheme of adjacent frames is changed.
[0202] It can be understood that the above solution needs to determine the channel combining scheme of the current frame, which indicates that there are multiple possibilities for the channel combining scheme of the current frame. Compared with the conventional solution with only one channel combining scheme, the present solution with multiple possible channel combining schemes can better adapt and match multiple possible scenarios. In addition, a mechanism is introduced to perform segmented time-domain downmix processing on the left and right channel signals of the current frame when the channel combining scheme of the current frame is different from the channel combining scheme of the previous frame. The segmented time-domain downmix processing mechanism helps to implement a smooth transition of the channel combining scheme, which further helps to improve the coding quality.
[0203] In addition, a channel combining scheme corresponding to nearly out-of-phase signals is introduced, so that when the stereo signal of the current frame is a nearly out-of-phase signal, there are more targeted channel combining schemes and coding modes, which helps to improve the coding quality.
[0204] For example, the channel combining scheme of the previous frame may be a correlated signal channel combining scheme or an anti-correlated signal channel combining scheme. The channel combining scheme of the current frame may be a correlated signal channel combining scheme or an anti-correlated signal channel combining scheme. Therefore, there may be some cases where the channel combining scheme of the current frame and the channel combining scheme of the previous frame are different.
[0205] Specifically, for example, when the channel combining scheme of the previous frame is a correlated signal channel combining scheme and the channel combining scheme of the current frame is an anti-correlated signal channel combining scheme, the left and right channel signals of the current frame include a start segment of the left and right channel signals, a middle segment of the left and right channel signals, and an end segment of the left and right channel signals, and the primary and secondary channel signals of the current frame include a start segment of the primary and secondary channel signals, a middle segment of the primary and secondary channel signals, and an end segment of the primary and secondary channel signals. In this case, performing a segmented time-domain downmix process on the left and right channel signals of the current frame based on the channel combining scheme of the current frame and the channel combining scheme of the previous frame to obtain the primary and secondary channel signals of the current frame includes: Performing a time-domain down-mix processing on the starting segments of left and right channel signals of the current frame by using a channel combining ratio coefficient corresponding to the correlation signal channel combining scheme of the previous frame and a time-domain down-mix processing scheme corresponding to the correlation signal channel combining scheme of the previous frame to obtain starting segments of primary and secondary channel signals of the current frame; performing a time-domain downmix processing on the end segments of left and right channel signals of the current frame by using a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame and a time-domain downmix processing scheme corresponding to the anti-correlated signal channel combining scheme of the current frame to obtain end segments of primary and secondary channel signals of the current frame; The method may include performing a time-domain down-mix processing on intermediate segments of left and right channel signals of the current frame by using a channel combining ratio coefficient corresponding to the correlated signal channel combining scheme of the previous frame and a time-domain down-mix processing scheme corresponding to the correlated signal channel combining scheme of the previous frame to obtain a first intermediate segment of the primary and secondary channel signals; performing a time-domain down-mix processing on the intermediate segments of the left and right channel signals of the current frame by using a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame and a time-domain down-mix processing scheme corresponding to the anti-correlated signal channel combining scheme of the current frame to obtain a second intermediate segment of the primary and secondary channel signals; and performing a weighted summation 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 an intermediate segment of the primary and secondary channel signals of the current frame.
[0206] The lengths of the start segment of the left and right channel signals of the current frame, the middle segment of the left and right channel signals, and the end segment of the left and right channel signals of the current frame can be set based on requirements. The lengths of the start segment of the left and right channel signals of the current frame, the middle segment of the left and right channel signals, and the end segment of the left and right channel signals of the current frame can be the same, partially the same, or different from each other.
[0207] The lengths of the start segments of the primary and secondary channel signals of the current frame, the middle segments of the primary and secondary channel signals, and the end segments of the primary and secondary channel signals of the current frame may be set based on requirements. The lengths of the start segments of the primary and secondary channel signals of the current frame, the middle segments of the primary and secondary channel signals, and the end segments of the primary and secondary channel signals of the current frame may be the same, partially the same, or different from each other.
[0208] When the weighted summation process is performed on the first intermediate segments of the primary and secondary channel signals and the second intermediate segments of the primary and secondary channel signals, the weighting factors corresponding to the first intermediate segments of the primary and secondary channel signals may or may not be equal to the weighting factors corresponding to the second intermediate segments of the primary and secondary channel signals.
[0209] For example, if the weighted summation process is performed on a first intermediate segment of the primary and secondary channel signals and a second intermediate segment of the primary and secondary channel signals, the weighting factor corresponding to the first intermediate segment of the primary and secondary channel signals is a fade-out factor, and the weighting factor corresponding to the second intermediate segment of the primary and secondary channel signals is a fade-in factor.
[0210] In some possible implementations,
number
[0211] for example,
number
[0212] For example, fade_in(n) indicates a fade-in coefficient, and fade_out(n) indicates a 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 indicates the sampling point number, n = 0, 1, . . . , N-1 and 0. <N1<N2<N-1である。
[0215] For example, N1 may be equal to 100, 107, 120, 150, or another value.
[0216] For example, N2 may be equal to 180, 187, 200, 203, or another value.
[0217] where X 211 (n) denotes the first intermediate segment of the primary channel signal of the current frame, and Y 211 (n) denotes the first intermediate segment of the secondary channel signal of the current frame. 212 (n) denotes the second intermediate segment of the primary channel signal of the current frame, and Y 212 (n) denotes the second intermediate segment of the secondary channel signal of the current frame.
[0218] In some possible implementations,
number
[0219] M 22 can have several possible forms, specifically, for example:
number
[0220] M 11 can have several possible forms, specifically, for example:
number
[0221] Specifically, in another example, when the channel combining scheme of the previous frame is an anti-correlated signal channel combining scheme and the channel combining scheme of the current frame is a correlated signal channel combining scheme, the left and right channel signals of the current frame include a start segment of the left and right channel signals, a middle segment of the left and right channel signals, and an end segment of the left and right channel signals, and the primary and secondary channel signals of the current frame include a start segment of the primary and secondary channel signals, a middle segment of the primary and secondary channel signals, and an end segment of the primary and secondary channel signals. In this case, performing a segmented time-domain downmix process on the left and right channel signals of the current frame based on the channel combining scheme of the current frame and the channel combining scheme of the previous frame to obtain the primary and secondary channel signals of the current frame includes: performing a time-domain down-mix processing on the starting segments of left and right channel signals of the current frame by using a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the previous frame and a time-domain down-mix processing scheme corresponding to the anti-correlated signal channel combining scheme of the previous frame to obtain starting segments of primary and secondary channel signals of the current frame; performing a time-domain down-mix processing on the end segments of left and right channel signals of the current frame by using a channel combining ratio coefficient corresponding to the correlation signal channel combining scheme of the current frame and a time-domain down-mix processing scheme corresponding to the correlation signal channel combining scheme of the current frame to obtain end segments of primary and secondary channel signals of the current frame; The method may include performing a time-domain down-mix processing on the intermediate segments of left and right channel signals of the current frame by using a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the previous frame and a time-domain down-mix processing scheme corresponding to the anti-correlated signal channel combining scheme of the previous frame to obtain a third intermediate segment of the primary and secondary channel signals; performing a time-domain down-mix processing on the intermediate segments of the left and right channel signals of the current frame by using a channel combining ratio coefficient corresponding to the correlated signal channel combining scheme of the current frame and a time-domain down-mix processing scheme corresponding to the correlated signal channel combining scheme of the current frame to obtain a fourth intermediate segment of the primary and secondary channel signals; and performing a weighted summation 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 an intermediate segment of the primary and secondary channel signals of the current frame.
[0222] When the weighted summation process is performed on the third intermediate segments of the primary and secondary channel signals and the fourth intermediate segments of the primary and secondary channel signals, the weighting factors corresponding to the third intermediate segments of the primary and secondary channel signals may or may not be equal to the weighting factors corresponding to the fourth intermediate segments of the primary and secondary channel signals.
[0223] For example, if the weighted summation process is performed on a third intermediate segment of the primary and secondary channel signals and a fourth intermediate segment of the primary and secondary channel signals, the weighting factor corresponding to the third intermediate segment of the primary and secondary channel signals is a fade-out factor, and the weighting factor corresponding to the fourth intermediate segment of the primary and secondary channel signals is a fade-in factor.
[0224] In some possible implementations,
number
[0225] for example,
number
[0226] Specifically, for example,
number
[0227] Here, n indicates the sampling point number, for example, n = 0, 1, . . . , N-1.
[0228] where 0 <N3<N4<N-1である。
[0229] For example, N3 may be equal to 101, 107, 120, 150, or another value.
[0230] For example, N4 may be equal to 181, 187, 200, 205, or another value.
[0231] X 221 (n) denotes the third intermediate segment of the primary channel signal of the current frame, and Y 221 (n) denotes the third intermediate segment of the secondary channel signal of the current frame. 222 (n) denotes the fourth intermediate segment of the primary channel signal of the current frame, and Y 222 (n) denotes the fourth intermediate segment of the secondary channel signal of the current frame.
[0232] In some possible implementations,
number
[0233] M 12 denotes the downmix matrix corresponding to the decorrelation signal channel combining scheme of the previous frame, and M 12 is constructed based on the channel combining ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the previous frame. 21 denotes the downmix matrix corresponding to the correlation signal channel combining scheme of the current frame, and M 21 is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme of the current frame.
[0234] M 12can have several possible forms, specifically, for example:
number
[0235] M 21 can have several 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, left and right channel signals that have undergone time-domain pre-processing, or left and right channel signals that have undergone delay alignment processing.
[0237] Specifically, for example,
number
[0238] It should be understood that the above example segmented time-domain down-mix processing schemes are not all possible implementations, and other segmented time-domain down-mix processing schemes may also be used in practical applications.
[0239] Correspondingly, an example is used below to describe the scenarios of the mode of switching signal decoding from correlation to anti-correlation and the mode of switching signal decoding from anti-correlation to anti-correlation. The time-domain downmix processing scheme corresponding to the mode of switching signal decoding from correlation to anti-correlation and the mode of switching signal decoding from anti-correlation to anti-correlation is, for example, a segmented time-domain downmix processing scheme.
[0240] Referring to Figure 7, an embodiment of the present application provides an audio decoding method. The relevant steps of the audio decoding method may be implemented by a decoding device, and the method may specifically include the following steps:
[0241] 701. Perform decoding based on a bitstream to obtain decoded primary and secondary channel signals of a current frame.
[0242] 702. Determine the channel bonding scheme for the current frame.
[0243] It will be appreciated that there is no limited order for performing steps 701 and 702.
[0244] 703. If the channel combining scheme of the current frame is different from the channel combining scheme of the previous frame, a segmented time-domain up-mix process is performed on the decoded primary and secondary channel signals of the current frame based on the channel combining scheme of the current frame and the channel combining scheme of the previous frame to obtain reconstructed left and right channel signals of the current frame.
[0245] The channel bonding scheme for the current frame is one of a plurality of channel bonding schemes.
[0246] For example, the plurality of channel combining schemes include an anti-correlated signal channel combining scheme and a correlated signal channel combining scheme. The correlated signal channel combining scheme is a channel combining scheme corresponding to approximately in-phase signals. The anti-correlated signal channel combining scheme is a channel combining scheme corresponding to approximately non-in-phase signals. It will be understood that the channel combining scheme corresponding to approximately in-phase signals is applicable to approximately in-phase signals, and the channel combining scheme corresponding to approximately non-in-phase signals is applicable to approximately non-in-phase signals.
[0247] The segmented time-domain upmix processing may be understood as the left and right channel signals of a current frame are divided into at least two segments, and a different time-domain upmix processing scheme is used for each segment to perform the time-domain upmix processing. It may be understood that compared with the non-segmented time-domain upmix processing, the segmented time-domain upmix processing is more likely to obtain a better and smoother transition when the channel combining scheme of adjacent frames is changed.
[0248] It can be understood that the above solution requires determining the channel combining scheme of the current frame, which indicates that there are multiple possibilities for the channel combining scheme of the current frame. Compared with the conventional solution with only one channel combining scheme, the present solution with multiple possible channel combining schemes can better adapt and match multiple possible scenarios. In addition, a mechanism is introduced to perform segmented time-domain upmix processing on the left and right channel signals of the current frame when the channel combining scheme of the current frame is different from the channel combining scheme of the previous frame. The segmented time-domain upmix processing mechanism helps to implement a smooth transition of the channel combining scheme, which further helps to improve the coding quality.
[0249] In addition, a channel combining scheme corresponding to nearly out-of-phase signals is introduced, so that when the stereo signal of the current frame is a nearly out-of-phase signal, there are more targeted channel combining schemes and coding modes, which helps to improve the coding quality.
[0250] For example, the channel combining scheme of the previous frame may be a correlated signal channel combining scheme or an anti-correlated signal channel combining scheme. The channel combining scheme of the current frame may be a correlated signal channel combining scheme or an anti-correlated signal channel combining scheme. Therefore, there may be some cases where the channel combining scheme of the current frame and the channel combining scheme of the previous frame are different.
[0251] Specifically, for example, the channel combining scheme of the previous frame is a correlated signal channel combining scheme, and the channel combining scheme of the current frame is an anti-correlated signal channel combining scheme. The reconstructed left and right channel signals of the current frame include a start segment of the reconstructed left and right channel signals, a middle segment of the reconstructed left and right channel signals, and an end segment of the reconstructed left and right channel signals. The decoded primary and secondary channel signals of the current frame include a start segment of the decoded primary and secondary channel signals, a middle segment of the decoded primary and secondary channel signals, and an end segment of the decoded primary and secondary channel signals. In this case, performing a segmented time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame based on the channel combining scheme of the current frame and the channel combining scheme of the previous frame to obtain the reconstructed left and right channel signals of the current frame includes: performing a time-domain up-mix processing on the start segment of the decoded primary and secondary channel signals of the current frame by using a channel combining ratio coefficient corresponding to the correlated signal channel combining scheme of the previous frame and a time-domain up-mix processing scheme corresponding to the correlated signal channel combining scheme of the previous frame to obtain the start segment of the reconstructed left and right channel signals of the current frame; performing a time-domain up-mix processing on the end segments of the decoded primary and secondary channel signals of the current frame by using a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame and a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combining scheme of the current frame to obtain end segments of reconstructed left and right channel signals of the current frame; The method includes performing a time-domain up-mix processing on the intermediate segments of the decoded primary and secondary channel signals of the current frame by using a channel combining ratio coefficient corresponding to the correlated signal channel combining scheme of the previous frame and a time-domain up-mix processing scheme corresponding to the correlated signal channel combining scheme of the previous frame to obtain a first intermediate segment of the reconstructed left and right channel signals; performing a time-domain down-mix processing on the intermediate segments of the decoded primary and secondary channel signals of the current frame by using a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame and a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combining scheme of the current frame to obtain a second intermediate segment of the reconstructed left and right channel signals; and performing a weighted summation processing 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 a intermediate segment of the reconstructed left and right channel signals of the current frame.
[0252] The lengths of the start segment of the reconstructed left and right channel signals of the current frame, the middle segment of the reconstructed left and right channel signals, and the end segment of the reconstructed left and right channel signals of the current frame can be set based on requirements. The lengths of the start segment of the reconstructed left and right channel signals of the current frame, the middle segment of the reconstructed left and right channel signals, and the end segment of the reconstructed left and right channel signals of the current frame can be the same, partially the same, or different from each other.
[0253] The lengths of the start segment of the decoded primary and secondary channel signals of the current frame, the middle segment of the decoded primary and secondary channel signals, and the 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 of the decoded primary and secondary channel signals of the current frame, the middle segment of the decoded primary and secondary channel signals, and the 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 decoded left and right channel signals, or delay adjustment processing and / or time domain post-processing may be performed on the reconstructed left and right channel signals to obtain the decoded left and right channel signals.
[0255] When the weighted summation operation is performed on a first intermediate segment of the reconstructed left and right channel signals and a second intermediate segment of the reconstructed left and right channel signals, the weighting factor corresponding to the first intermediate segment of the reconstructed left and right channel signals may or may not be equal to the weighting factor corresponding to the second intermediate segment of the reconstructed left and right channel signals.
[0256] For example, if the weighted summation process is performed on a first intermediate segment of the reconstructed left and right channel signals and a second intermediate segment of the reconstructed left and right channel signals, the weighting factor corresponding to the first intermediate segment of the reconstructed left and right channel signals is a fade-out factor, and the weighting factor corresponding to the second intermediate segment of the reconstructed left and right channel signals is a fade-in factor.
[0257] In some possible implementations,
number
number
number
number
number
number
number
number
number
[0258] for example,
number
[0259] For example, fade_in(n) indicates a fade-in coefficient, and fade_out(n) indicates a 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 indicates the sampling point number, 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 denotes the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme of the previous frame.
[0267] Specifically, in another example, the channel combining scheme of the previous frame is an anti-correlated signal channel combining scheme, and the channel combining scheme of the current frame is a correlated signal channel combining scheme. The reconstructed left and right channel signals of the current frame include a start segment of the reconstructed left and right channel signals, a middle segment of the reconstructed left and right channel signals, and an end segment of the reconstructed left and right channel signals. The decoded primary and secondary channel signals of the current frame include a start segment of the decoded primary and secondary channel signals, a middle segment of the decoded primary and secondary channel signals, and an end segment of the decoded primary and secondary channel signals. In this case, performing a segmented time-domain up-mix process on the decoded primary and secondary channel signals of the current frame based on the channel combining scheme of the current frame and the channel combining scheme of the previous frame to obtain the reconstructed left and right channel signals of the current frame includes: performing a time-domain up-mix processing on the starting segments of the decoded primary and secondary channel signals of the current frame by using a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the previous frame and a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combining scheme of the previous frame to obtain starting segments of reconstructed left and right channel signals of the current frame; performing a time-domain up-mix processing on the end segments of the decoded primary and secondary channel signals of the current frame by using a channel combining ratio coefficient corresponding to the correlation signal channel combining scheme of the current frame and a time-domain up-mix processing scheme corresponding to the correlation signal channel combining scheme of the current frame to obtain end segments of reconstructed left and right channel signals of the current frame; The method includes performing a time-domain up-mix processing on the intermediate segment of the decoded primary and secondary channel signals of the current frame by using a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the previous frame and a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combining scheme of the previous frame to obtain a third intermediate segment of the reconstructed left and right channel signals; performing a time-domain down-mix processing on the intermediate segment of the decoded primary and secondary channel signals of the current frame by using a channel combining ratio coefficient corresponding to the correlated signal channel combining scheme of the current frame and a time-domain up-mix processing scheme corresponding to the correlated signal channel combining scheme of the current frame to obtain a fourth intermediate segment of the reconstructed left and right channel signals; and performing a weighted summation processing 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 a reconstructed intermediate segment of the left and right channel signals of the current frame.
[0268] When the weighted summation process 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 weighting factor corresponding to the third intermediate segment of the reconstructed left and right channel signals may or may not be equal to the weighting factor corresponding to the fourth intermediate segment of the reconstructed left and right channel signals.
[0269] For example, if the weighted summation process 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 weighting factor corresponding to the third intermediate segment of the reconstructed left and right channel signals is a fade-out factor, and the weighting factor corresponding to the fourth intermediate segment of the reconstructed left and right channel signals is a fade-in factor.
[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 indicates the sampling point number, for example, n = 0, 1, . . . , N-1.
[0274] where 0 <N3<N4<N-1である。
[0275] For example, N3 may be equal to 101, 107, 120, 150, or another value.
[0276] For example, N4 may be 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 application, the stereo parameters (e.g., channel combining ratio coefficients and / or inter-channel time differences) for the current frame may be fixed values or may be determined based on a channel combining scheme for the current frame (e.g., a correlated signal channel combining scheme or an anti-correlated signal channel combining scheme).
[0283] With reference to Figure 8, an example is used below to describe the time-domain stereo parameter estimation method. The relevant steps of the time-domain stereo parameter estimation method may be implemented by an encoding device, and the method may specifically include the following steps:
[0284] 801. Determine the channel bonding scheme for the current frame.
[0285] 802. Determine time-domain stereo parameters for the current frame based on a channel combining scheme for the current frame, where the time-domain stereo parameters include at least one of a channel combining ratio coefficient and an inter-channel time difference.
[0286] The channel bonding scheme for the current frame is one of a plurality of channel bonding schemes.
[0287] For example, the multiple channel combining schemes include an anti-correlated signal channel combining scheme and a correlated signal channel combining scheme.
[0288] A correlated signal channel combining scheme is a channel combining scheme that corresponds to approximately in-phase signals. An anti-correlated signal channel combining scheme is a channel combining scheme that corresponds to approximately non-in-phase signals. It will be understood that a channel combining scheme that corresponds to approximately in-phase signals is applicable to approximately in-phase signals and a channel combining scheme that corresponds to approximately non-in-phase signals is applicable to approximately non-in-phase signals.
[0289] If the channel combining scheme of the current frame is determined to be a correlated signal channel combining scheme, the time domain stereo parameters of the current frame are time domain stereo parameters corresponding to the correlated signal channel combining scheme of the current frame, or if the channel combining scheme of the current frame is determined to be an anti-correlated signal channel combining scheme, the time domain stereo parameters of the current frame are time domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame.
[0290] It can be understood that in the above solution, the channel combining scheme of the current frame needs to be determined, which indicates that there are multiple possibilities for the channel combining scheme of the current frame. Compared with the conventional solution with only one channel combining scheme, the present solution with multiple possible channel combining schemes can better match and match multiple possible scenarios. Because the time domain stereo parameters of the current frame are determined based on the channel combining scheme of the current frame, the time domain stereo parameters can better match and match multiple possible scenarios, and the quality of encoding and decoding can be further improved.
[0291] In some possible implementations, a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame and a channel combining ratio coefficient corresponding to the correlated signal channel combining scheme of the current frame may be calculated separately first. Then, if the channel combining scheme of the current frame is determined to be a correlated signal channel combining 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 combining scheme of the current frame, or if the channel combining scheme of the current frame is determined to be an anti-correlated signal channel combining scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame. Alternatively, time-domain stereo parameters corresponding to the correlated signal channel combining scheme of the current frame may be calculated first, and if it is determined that the channel combining scheme of the current frame is a correlated signal channel combining 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 combining scheme of the current frame; or if it is determined that the channel combining scheme of the current frame is an anti-correlated signal channel combining scheme, the time-domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame are calculated, and the time-domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame are determined as the time-domain stereo parameters of the current frame.
[0292] Alternatively, the channel combining scheme of the current frame may be determined first. If the channel combining scheme of the current frame is determined to be a correlated signal channel combining scheme, then the time domain stereo parameters corresponding to the correlated signal channel combining 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 combining scheme of the current frame; or if the channel combining scheme of the current frame is determined to be an anti-correlated signal channel combining scheme, then the time domain stereo parameters corresponding to the anti-correlated signal channel combining 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 anti-correlated signal channel combining 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 bonding scheme of the current frame includes the step of determining an initial value of a channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame based on the channel bonding scheme of the current frame. If the initial value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame (correlated signal channel bonding scheme or anti-correlated signal channel bonding scheme) does not need to be changed, the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame is equal to the initial value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame. If the initial value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame (correlated signal channel bonding scheme or anti-correlated signal channel bonding scheme) needs to be changed, the initial value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame is changed to obtain a changed value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame, and the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame is equal to the changed value of the channel bonding ratio coefficient corresponding to the channel bonding scheme of the current frame.
[0294] For example, determining the time-domain stereo parameters of the current frame based on the channel combining scheme of the current frame may include: calculating a frame energy of a left channel signal of the current frame based on the left channel signal of the current frame; calculating a frame energy of a right channel signal of the current frame based on the right channel signal of the current frame; and calculating an initial value of a channel combining ratio coefficient corresponding to the correlation signal channel combining 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] When the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame does not need to be changed, the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is equal to the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame, and the coded index of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is equal to the coded index of the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame.
[0296] If the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame needs to be changed, the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame and the coded index of the initial value are modified to obtain a modified value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame and a coded index of the modified value. The channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is equal to the modified value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame, and the coded index of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is equal to the coded index of the modified value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame.
[0297] Specifically, for example, when the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame and the coded index of the initial value are changed, ratio_idx_mod=0.5*(tdm_last_ratio_idx+16), ratio_mod qua = ratio_tabl[ratio_idx_mod], tdm_last_ratio_idx indicates an encoded index of a channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the previous frame, ratio_idx_mod indicates an encoded index corresponding to a modified value of a channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame, and ratio_mod qua denotes the modified value of the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme of the current frame.
[0298] As another example, determining the time-domain stereo parameters of the current frame based on the channel combining scheme of the current frame includes obtaining a reference channel signal of the current frame based on a left channel signal and a right channel signal of the current frame; calculating an amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal; calculating an amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal; calculating an 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 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; and calculating a channel combining ratio coefficient corresponding to the anti-correlated signal channel combining 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 anti-correlated 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, for example, include: calculating an initial value of the channel coupling ratio coefficient corresponding to the anti-correlated 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 modifying the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame to obtain the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame. It should be understood that when the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame does not need to be modified, the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame is equal to the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame.
[0300] In some possible implementations,
number
[0301] In some possible implementations, calculating an amplitude correlation difference parameter between the left and right channel signals of the current frame based on an amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame and an amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame includes: calculating a long-term 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 delay-aligned left channel signal and the reference channel signal of the current frame; calculating a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame based on the amplitude correlation parameter between the delay-aligned right channel signal and the reference channel signal of the current frame; and calculating an 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 and the reference channel signal of the current frame and the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame.
[0302] There are various smoothing methods, for example: tdm_lt_corr_LM_SM cur =α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM, tdm_lt_rms_L_SM cur =(1-A)*tdm_lt_rms_L_SM pre +A*rms_L, where A is the update coefficient of the long-term smoothed frame energy of the left channel signal of the current frame, and tdm_lt_rms_L_SM cur denotes the long-term smoothed frame energy of the left channel signal of the current frame, rms_L denotes the frame energy of the left channel signal of the current frame, and tdm_lt_corr_LM_SM cur denotes the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal, and tdm_lt_corr_LM_SM predenotes the long-term smoothed amplitude correlation parameter between the left channel signal of the previous frame and the reference channel signal, and α denotes the left channel smoothing coefficient.
[0303] for example, tdm_lt_corr_RM_SM cur =β*tdm_lt_corr_RM_SM pre +(1-β)corr_LM, tdm_lt_rms_R_SM cur =(1-B)*tdm_lt_rms_R_SM pre +B*rms_R, where B is the update coefficient of the long-term smoothed frame energy of the right channel signal of the current frame, and tdm_lt_rms_R_SM pre denotes the long-term smoothed frame energy of the right channel signal of the current frame, rms_R denotes the frame energy of the right channel signal of the current frame, and tdm_lt_corr_RM_SM cur denotes the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, and tdm_lt_corr_RM_SM pre denotes the long-term smoothed amplitude correlation parameter between the right channel signal of the previous frame and the reference channel signal, and β denotes 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 indicates 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 indicates 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 indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame.
[0305] In some possible implementations, the step of calculating a channel coupling ratio coefficient corresponding to an anti-correlated signal channel coupling scheme of the current frame based on an amplitude correlation difference parameter between the left and right channel signals of the current frame includes the steps of performing a mapping process on the amplitude correlation difference parameter between the left and right channel signals of the current frame, such that the value range of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process can be [MAP_MIN, MAP_MAX], and converting the amplitude correlation difference parameter between the left and right channel signals and that has undergone the mapping process into a channel coupling ratio coefficient.
[0306] In some possible implementation forms, the step of performing a mapping process on amplitude correlation difference parameters between the left and right channels of the current frame includes the steps of performing amplitude limiting on amplitude correlation difference parameters between the left and right channel signals of the current frame, and performing a mapping process on the amplitude-limited amplitude correlation difference parameters between the left and right channel signals of the current frame.
[0307] There are various amplitude limiting methods, for example:
number
[0308] There are various mapping methods available. For example,
number
[0309] As another example,
number
number
[0310] In some possible implementations,
number
[0311] In some implementations of the present application, in a scenario where the channel coupling ratio coefficient needs to be changed, the change may be performed before or after the channel coupling ratio coefficient is coded. Specifically, for example, an initial value of the channel coupling ratio coefficient of the current frame (e.g., a channel coupling ratio coefficient corresponding to an anti-correlated signal channel coupling scheme, or a 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 coded to obtain an initial coded index of the channel coupling ratio coefficient of the current frame, and the obtained initial coded index of the channel coupling ratio coefficient of the current frame may be modified to obtain an encoded index of the channel coupling ratio coefficient of the current frame (obtaining an encoded index of the channel coupling ratio coefficient of the current frame is equivalent to obtaining the channel coupling ratio coefficient of the current frame). Alternatively, an initial value of the channel coupling ratio coefficient of the current frame is first obtained by calculation, then the initial value of the channel coupling ratio coefficient of the current frame obtained by calculation is modified to obtain the channel coupling ratio coefficient of the current frame, and the obtained channel coupling ratio coefficient of the current frame is coded to obtain an encoded index coefficient of the channel coupling ratio coefficient of the current frame.
[0312] There are various ways to modify the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame. For example, when the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame needs to be modified to obtain the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame, the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame can be modified based on the channel coupling ratio coefficient of the previous frame and the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame, or the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame can be modified based on the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame.
[0313] For example, whether the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame needs to be changed is first determined based on the long-term smoothed frame energy of the left channel signal of the current frame, the long-term 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., the inter-frame correlation of the primary channel signal and the inter-frame correlation of the secondary channel signal), the channel coupling scheme flags of the current frame and the previous frame, the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the previous frame, and the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame. If it needs to be changed, the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the previous frame is used as the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame, and if it does not need to be changed, the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame is used as the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame.
[0314] Of course, the specific implementation of modifying the initial values of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame to obtain the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame is not limited to the above examples.
[0315] 803. Encode the determined time-domain stereo parameters of the current frame.
[0316] In some possible implementations, a quantization coding is performed on the determined channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme of the current frame; ratio_init_SM qua=ratio_tabl_SM[ratio_idx_init_SM], where ratio_tabl_SM indicates a codebook for performing scalar quantization on the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame, ratio_idx_init_SM indicates an initial coded index of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame, and ratio_init_SM qua denote the quantized coded initial values of the channel combining ratio coefficients corresponding to the decorrelation signal channel combining 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 indicates a channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame, and ratio_idx_SM indicates a coded index of the channel coupling ratio coefficient corresponding to the anti-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 indicates an initial coded index corresponding to the anti-correlated signal channel combining scheme of the current frame, tdm_last_ratio_idx_SM indicates a final coded index of the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the previous frame, φ is a modification coefficient of the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme, and ratio_SM indicates the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame.
[0318] In some possible implementations, when the initial values of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the current frame need to be changed to obtain the channel coupling ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the current frame, quantization encoding is first performed on the initial values of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the current frame to obtain the initial coded indexes of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the current frame, and then the initial coded indexes of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the current frame may be changed based on the coded indexes of the channel coupling ratio coefficients of the previous frame and the initial coded indexes of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the current frame, or the initial coded indexes of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the current frame may be changed based on the initial coded indexes of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel combining scheme of the current frame.
[0319] For example, quantization coding may be first performed on the initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame to obtain an initial coded index corresponding to the anti-correlated signal channel coupling scheme of the current frame. Then, if the initial value of the channel coupling ratio coefficient corresponding to the anti-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 anti-correlated signal channel coupling scheme of the previous frame is used as the coded index of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame, and if no change is required, the initial coded index of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame is used as the coded index of the channel coupling ratio coefficient corresponding to the anti-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 anti-correlated signal channel coupling scheme of the current frame is used as the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame.
[0320] In addition, when the time domain stereo parameters include inter-channel time differences, determining the time domain stereo parameters of the current frame based on the channel combining scheme of the current frame may include calculating the inter-channel time differences of the current frame when the channel combining scheme of the current frame is a correlated signal channel combining scheme. In addition, the inter-channel time differences of the current frame obtained by calculation may be written into the bitstream. When the channel combining scheme of the current frame is an anti-correlated signal channel combining 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 may not be written into the bitstream, and the decoding device also uses the default inter-channel time difference.
[0321] Hereinafter, by using an example, a time-domain stereo parameter coding method is further provided, which may include, for example, determining a channel combining scheme of a current frame, determining time-domain stereo parameters of the current frame according to the channel combining scheme of the current frame, and encoding the determined time-domain stereo parameters of the current frame, where the time-domain stereo parameters include at least one of a channel combining ratio coefficient and an inter-channel time difference.
[0322] Correspondingly, the decoding device may obtain time-domain stereo parameters of the current frame from the bitstream, and further perform associated decoding based on the time-domain stereo parameters of the current frame obtained from the bitstream.
[0323] In the following, an explanation is provided by using examples in the context of more specific application scenarios.
[0324] Figure 9-A is a schematic flow chart of an audio encoding method according to an embodiment of the present application. The audio encoding method provided in this embodiment of the present application may be implemented by an encoding device, and the method may specifically include the following steps:
[0325] 901. Perform time-domain pre-processing on the original left and right channel signals of the current frame.
[0326] For example, the sampling rate of a stereo audio signal is 16KHz, one signal frame is 20ms, and the frame length is denoted as N, where N=320 indicates that the frame length is 320 sampling points. The stereo signal of the current frame includes the left channel signal of the current frame and the right channel signal of the current frame. The original left channel signal of the current frame is x L (n), and the original right channel signal of the current frame is denoted as x R It is denoted as (n), where n is the sampling point number, n = 0, 1, . . . , N-1.
[0327] For example, performing time-domain pre-processing on the original left and right channel signals of the current frame includes performing high-pass filtering on the original left and right channel signals of the current frame to obtain time-domain pre-processed left and right channel signals of the current frame, where the time-domain pre-processed left channel signal of the current frame is x L_HP (n), and the time-domain preprocessed right channel signal of the current frame is denoted as x R_HP (n), where n is the sampling point number, n=0, 1, . . . , N-1. The filter used in the high-pass filtering may be, for example, an Infinite Impulse Response (IIR) filter with a cutoff frequency of 20 Hz, or may be another type of filter.
[0328] For example, the transfer function of a high-pass filter corresponding to a sampling rate of 16 KHz and a cutoff frequency of 20 Hz is given as follows:
number
[0329] The transfer function of the corresponding time domain filter can be expressed as: 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. Perform delay alignment on the time-domain pre-processed left and right channel signals of the current frame to obtain delay-aligned left and right channel signals of the current frame.
[0331] A signal that has undergone delay alignment processing may be simply referred to as a “delay-aligned signal.” For example, a left channel signal that has undergone delay alignment processing may be simply referred to as a “delay-aligned left channel signal,” and a right channel signal that has undergone delay alignment processing may be simply referred to as a “delay-aligned left channel signal.”
[0332] Specifically, inter-channel delay parameters are extracted based on the pre-processed left and right channel signals of the current frame, and then encoded, and delay alignment may be performed on the left and right channel signals based on the encoded inter-channel delay parameters to obtain delay-aligned left and right channel signals of the current frame. The delay-aligned left channel signal of the current frame is x' L The delay aligned right channel signal of the current frame is denoted by x' R It is denoted by (n), where n is the sampling point number, n = 0, 1, . . . , N-1.
[0333] Specifically, for example, the encoding device may calculate time-domain cross-correlation functions of the left and right channels based on pre-processed left and right channel signals of the current frame, search for a maximum value (or another value) of the time-domain cross-correlation functions of the left and right channels to determine a time difference between the left and right channel signals, perform quantization encoding on the determined time difference between the left and right channels, use a signal of one channel selected from the left and right channels as a reference to obtain left and right channel signals that have undergone delay alignment processing for the current frame, and perform delay adjustment of the signal of the other channel based on the quantization encoded time difference between the left and right channels.
[0334] It should be noted that there may be many specific implementation methods for the delay alignment process, and the specific delay alignment process method is not limited to this embodiment.
[0335] 903. Perform a time domain analysis of the delay aligned left and right channel signals of the current frame.
[0336] Specifically, the time domain analysis may include transient detection, etc. The transient detection may be energy detection performed on the delay-aligned left and right channel signals of the current frame (e.g., detecting whether there is an abrupt energy change in the current frame). For example, the energy of the delay-aligned left channel signal of the current frame may be E cur_L and the energy of the left channel signal after delay alignment of the previous frame is E pre_L In this case, to obtain the transient detection result of the delay-aligned left channel signal 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 left channel signal and the delay aligned left channel signal of the current frame. Similarly, transient detection may be performed by using the same method on the delay aligned left channel signal of the current frame. The time domain analysis may further include time domain analysis in another conventional manner other than transient detection, for example, frequency band widening pre-processing.
[0337] It will be appreciated that step 903 may be performed at any time after step 902 and before the primary and secondary channel signals of the current frame are encoded.
[0338] 904. Perform a channel combining scheme determination for the current frame based on the delay aligned left and right channel signals for the current frame to determine a channel combining scheme for the current frame.
[0339] Two possible channel combining schemes are described as examples in this embodiment, and are respectively referred to as correlated signal channel combining scheme and anti-correlated signal channel combining scheme in the following description.In this embodiment, correlated signal channel combining scheme corresponds to the case where the left and right channel signals (obtained after delay alignment) of the current frame are approximately in-phase signals, and anti-correlated signal channel combining scheme corresponds to the case where the left and right channel signals (obtained after delay alignment) of the current frame are approximately out-of-phase signals.Of course, in practical applications, other names may be used in addition to "correlated signal channel combining scheme" and "anti-correlated signal channel combining scheme" to represent the two possible channel combining schemes.
[0340] In some solutions of this embodiment, the channel bonding scheme determination can be classified into an initial channel bonding scheme determination and a channel bonding scheme change determination. It can be understood that the channel bonding scheme determination is performed for the current frame to determine the channel bonding scheme of the current frame. For some examples of the implementation form of determining the channel bonding scheme of the current frame, please refer to the relevant description of the above-mentioned embodiments. Details will not be repeated here.
[0341] 905. Calculate and encode a channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame based on the delay aligned left and right channel signals of the current frame and the channel coupling scheme flag of the current frame to obtain an initial value of a channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame and an encoded index of the initial value.
[0342] Specifically, for example, the frame energies of the left and right channel signals of the current frame are first calculated based on the delay aligned left and right channel signals of the current frame; The frame energy rms_L of the left channel signal of the current frame is
number
number
[0343] Then, a channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is calculated based on the frame energy of the left channel and the frame energy of the right channel of the current frame. The channel coupling ratio coefficient ratio_init corresponding to the correlation signal channel coupling scheme of the current frame obtained by calculation is:
number
[0344] Then, the corresponding coded index ratio_idx_init and the quantized coded channel coupling ratio coefficient ratio_init corresponding to the correlation signal channel coupling scheme of the current frame are calculated. qua Quantization coding is performed on the channel coupling ratio coefficient ratio_init corresponding to the correlation signal channel coupling scheme of the current frame obtained by calculation to obtain ratio_init qua =ratio_tabl[ratio_idx_init].
[0345] Here, ratio_tabl is a codebook for scalar quantization. The quantization encoding can be performed by using any conventional scalar quantization method, such as uniform scalar quantization or non-uniform scalar quantization. The number of bits used for encoding is, for example, 5 bits. The specific scalar quantization method will not be described again here.
[0346] The quantized coded channel combining ratio coefficient ratio_init corresponding to the correlation signal channel combining scheme of the current frame qua where ratio_idx_init is the obtained initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame, and the coded index ratio_idx_init is the coded index corresponding to the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame.
[0347] In addition, the coded index corresponding to the initial value of the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme of the current frame may be further modified based on the value of the channel combining scheme flag tdm_SM_flag of the current frame.
[0348] For example, the quantization coding is 5-bit scalar quantization. When tdm_SM_flag=1, the coded index ratio_idx_init corresponding to the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is changed to a preset value (e.g., 15 or another value), and the initial value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame is changed to ratio_init qua =ratio_tabl
[15] .
[0349] It should be noted that in addition to the above calculation method, any method for calculating the channel combining ratio coefficient corresponding to the channel combining scheme in the conventional time-domain stereo coding technology can be used to calculate the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme of the current frame. Alternatively, the initial value of the channel combining ratio coefficient corresponding to the correlation signal channel combining 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, it is determined whether or not the channel coupling ratio coefficient needs to be changed.
[0351] If necessary, the channel coupling ratio coefficients and the coded indices of the channel coupling ratio coefficients corresponding to the correlation signal channel coupling scheme of the current frame are modified to obtain modified values of the channel coupling ratio coefficients and coded indices of the modified values corresponding to the correlation signal channel coupling scheme of the current frame.
[0352] The channel coupling ratio coefficient modification flag of the current frame is indicated as tdm_SM_modi_flag. For example, if the value of the channel coupling ratio coefficient modification flag is 0, it indicates that the channel coupling ratio coefficient does not need to be modified, or if the value of the channel coupling ratio coefficient modification flag is 1, it indicates that the channel coupling ratio coefficient needs to be modified. Of course, other different values may be used as the channel coupling ratio coefficient modification flag to indicate whether the channel coupling ratio coefficient needs to be modified or not.
[0353] For example, determining whether the channel coupling ratio coefficient needs to be changed based on the channel coupling ratio coefficient change flag may particularly include: for example, when 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, when 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 coefficient and the coded index of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame may specifically include: For example, the coded index corresponding to the modified value of the channel coupling ratio coefficient corresponding to the correlation signal channel combining scheme of the current frame satisfies ratio_idx_mod=0.5*(tdm_last_ratio_idx+16), where tdm_last_ratio_idx is the coded index of the channel coupling ratio coefficient corresponding to the correlation signal channel combining scheme of the previous frame.
[0355] Modification value of the channel coupling ratio coefficient corresponding to the correlation signal channel coupling scheme of the current frame ratio_mod qua ratio_mod qua =ratio_tabl[ratio_idx_mod] is satisfied.
[0356] 907. Determine a channel coupling ratio coefficient ratio and a coded index ratio_idx corresponding to the correlation signal channel combining scheme of the current frame based on an initial value and a coded index of the initial value of a channel coupling ratio coefficient corresponding to the correlation signal channel combining scheme of the current frame, a modified value and a coded index of the modified value of a channel coupling ratio coefficient corresponding to the correlation signal channel combining scheme of the current frame, and a channel coupling ratio coefficient modification flag.
[0357] Specifically, for example, the determined channel coupling ratio factor ratio corresponding to the correlation signal channel coupling scheme is
number
[0358] The determined coded index ratio_idx corresponding to the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme is
number
[0359] 908. Determine whether the channel bonding scheme flag of the current frame corresponds to an anti-correlated signal channel bonding scheme, and if so, calculate and code a channel bonding ratio coefficient corresponding to the anti-correlated signal channel bonding scheme of the current frame to obtain a channel bonding ratio coefficient and a coded index corresponding to the anti-correlated signal channel bonding scheme of the current frame.
[0360] First, it may be determined whether the history buffer used to calculate the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme of the current frame needs to be reset.
[0361] For example, if the channel bonding scheme flag tdm_SM_flag of the current frame is equal to 1 (e.g., tdm_SM_flag equal to 1 indicates that the channel bonding scheme flag of the current frame corresponds to the anti-correlated signal channel bonding scheme) and the channel bonding scheme flag tdm_last_SM_flag of the previous frame is equal to 0 (e.g., tdm_last_SM_flag equal to 0 indicates that the channel bonding scheme flag of the current frame corresponds to the correlated signal channel bonding scheme), it indicates that the history buffer used for calculating the channel bonding ratio coefficient corresponding to the anti-correlated signal channel bonding scheme of the current frame needs to be reset.
[0362] It should be noted that the history buffer reset flag tdm_SM_reset_flag is determined in the process of initial channel bonding scheme determination and channel bonding scheme change determination, and then the value of the history buffer reset flag can be determined to determine whether the history buffer used to calculate the channel bonding ratio coefficient corresponding to the anti-correlated signal channel bonding scheme of the current frame needs to be reset. For example, when tdm_SM_reset_flag is 1, it indicates that the channel bonding scheme flag of the current frame corresponds to the anti-correlated signal channel bonding scheme, and the channel bonding scheme flag of the previous frame corresponds to the correlated signal channel bonding scheme. For example, when the history buffer reset flag tdm_SM_reset_flag is equal to 1, it indicates that the history buffer used to calculate the channel bonding ratio coefficient corresponding to the anti-correlated signal channel bonding 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 bonding ratio coefficient corresponding to the anti-correlated signal channel bonding scheme of the current frame can be reset based on a preset initial value. Alternatively, some parameters of the history buffer used to calculate the channel bonding ratio coefficient corresponding to the anti-correlated signal channel bonding scheme of the current frame can be reset based on a preset initial value. Alternatively, some parameters of the history buffer used to calculate the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame may be reset based on preset initial values, and other parameters may be reset based on 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] Then, it is further determined whether the channel combining scheme flag tdm_SM_flag of the current frame corresponds to an anti-correlated signal channel combining scheme. The anti-correlated signal channel combining scheme is a channel combining scheme that is more suitable for performing time-domain downmixing on non-in-phase stereo signals. In this embodiment, if the channel combining scheme flag of the current frame is tdm_SM_flag=1, it indicates that the channel combining scheme flag of the current frame corresponds to an anti-correlated signal channel combining scheme. If the channel combining scheme flag of the current frame is tdm_SM_flag=0, it indicates that the channel combining scheme flag of the current frame corresponds to a correlated signal channel combining scheme.
[0364] Determining whether a channel bonding scheme flag of the current frame corresponds to a decorrelated signal channel bonding scheme includes: Determining whether the value of a channel bonding scheme flag of the current frame is 1, and if the channel bonding scheme flag of the current frame is tdm_SM_flag=1, it indicates that the channel bonding scheme flag of the current frame corresponds to a de-correlated signal channel bonding scheme, in which case a channel bonding ratio coefficient corresponding to the de-correlated signal channel bonding scheme of the current frame is calculated and coded. It may particularly include.
[0365] Referring to FIG. 9-B, calculating and encoding a channel combining ratio coefficient corresponding to a decorrelation signal channel combining scheme of a current frame may include, for example, the following steps 9081 to 9085.
[0366] 9081. Perform signal energy analysis of the delay aligned left and right channel signals of the current frame.
[0367] A frame energy of a left channel signal of the current frame, a frame energy of a right channel signal of the current frame, a long-term smoothed frame energy of the left channel of the current frame, a long-term smoothed frame energy of the right channel of the current frame, an inter-frame energy difference of the left channel of the current frame, and an inter-frame energy difference of the right channel of the current frame 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 where tdm_lt_rms_L_SM pre denotes the long-term smoothed frame energy of the left channel of the previous frame, A denotes the update coefficient of the long-term smoothed frame energy of the left channel, A is a real number, for example, from 0 to 1, and A may be equal to 0.4, for example.
[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 where tdm_lt_rms_R_SM pre denotes the long-term smoothed frame energy of the right channel of the previous frame, and B denotes the update coefficient of the long-term smoothed frame energy of the right channel, where B is a real number, for example, from 0 to 1, and B may be the same as or different from the update coefficient of the long-term 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 of the left channel of the current frame is ener_L_dt=tdm_lt_rms_L_SM cur -tdm_lt_rms_L_SM pre Meet the following.
[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 Meet the following.
[0373] 9082. Determine a reference channel signal for a current frame based on the delay-aligned left and right channel signals of the current frame. The reference channel signal may also be referred to as a mono signal. When the reference channel signal is referred to as a mono signal, the reference channel signal may be replaced with the mono signal for all descriptions and parameter names related to the reference channel.
[0374] For example, the reference channel signal mono_i(n) is
number
[0375] 9083. Separately calculate an amplitude correlation parameter between the delay-aligned left channel signal of the current frame and the reference channel signal, and an amplitude correlation parameter between the delay-aligned right channel signal of the current frame and the reference channel signal.
[0376] For example, the amplitude correlation parameter corr_LM between the delay aligned left channel signal and the reference channel signal of the current frame can be expressed as, for example,
number
[0377] For example, the amplitude correlation parameter corr_RM between the delay aligned right channel signal and the reference channel signal of the current frame can be expressed as, for example,
number
[0378] where x' L (n) denotes the delay-aligned left channel signal of the current frame, and x' R (n) denotes the delay aligned right channel signal of the current frame, mono_i(n) denotes the reference channel signal of the current frame, and |·| denotes taking the absolute value.
[0379] 9084. Calculate an amplitude correlation difference parameter diff_lt_corr between the left and right channels of the current frame based on an amplitude correlation parameter between the delay aligned left channel signal and the reference channel signal of the current frame and an amplitude correlation parameter between the delay aligned right channel signal and the reference channel signal of the current frame.
[0380] It will be appreciated that step 9081 may be performed before step 9082 and step 9083, or may be performed after step 9082 and step 9083 and before step 9084.
[0381] Referring to FIG. 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 include the following steps 90841 and 90842.
[0382] 90841. Based on an amplitude correlation parameter between the delay-aligned left channel signal and the reference channel signal of the current frame and an amplitude correlation parameter between the delay-aligned right channel signal and the reference channel signal of the current frame, a long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame and a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame are calculated.
[0383] For example, a method for calculating a long-term smoothed amplitude correlation parameter between a left channel signal of a current frame and a reference channel signal, and a long-term smoothed amplitude correlation parameter between a right channel signal of a current frame and a reference channel signal may include the following: tdm_lt_corr_LM_SM cur =α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM
[0036]
[0384] where tdm_lt_corr_LM_SM cur denotes the long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal, and tdm_lt_corr_LM_SM pre denotes a long-term smoothed amplitude correlation parameter between the left channel signal of the previous frame and the reference channel signal, and α denotes a left channel smoothing coefficient, where α may be a preset real number from 0 to 1, e.g., 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 Meet the following.
[0386] where tdm_lt_corr_RM_SM cur denotes the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, and tdm_lt_corr_RM_SM pre denotes a long-term smoothed amplitude correlation parameter between the right channel signal of the previous frame and the reference channel signal, and β denotes a right channel smoothing coefficient, where β may be a preset real number from 0 to 1. β may be the same as or different from the value of the left channel smoothing coefficient α, and β may be equal to 0.2, 0.5, or 0.8, for example. Alternatively, the value of β may be obtained by adaptive calculation.
[0387] Another method for calculating a long-term smoothed amplitude correlation parameter between a left channel signal of a current frame and a reference channel signal and a long-term smoothed amplitude correlation parameter between a right channel signal of a current frame and a reference channel signal includes the steps of: First, modifying an amplitude correlation parameter corr_LM between the delay-aligned left channel signal and the reference channel signal of the current frame to obtain a modified amplitude correlation parameter corr_LM_mod between the left channel signal and the reference channel signal of the current frame, and modifying an amplitude correlation parameter corr_RM between the delay-aligned right channel signal and the reference channel signal of the current frame to obtain a modified amplitude correlation parameter corr_RM_mod between the right channel signal and the reference channel signal of the current frame; Next, a modified amplitude correlation parameter corr_LM_mod between the left channel signal and the reference channel signal of the current frame, a modified amplitude correlation parameter corr_RM_mod between the right channel signal and the reference channel signal of the current frame, a long-term smoothed amplitude correlation parameter tdm_lt_corr_LM_SM 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 determining a long-term smoothed amplitude correlation parameter diff_lt_corr_LM_tmp between the left channel signal of the current frame and the reference channel signal and a long-term smoothed amplitude correlation parameter diff_lt_corr_RM_tmp between the right channel signal of the previous frame and the reference channel signal based on Next, obtain an initial value of an amplitude correlation difference parameter between the left and right channels of the current frame, diff_lt_corr_SM, based on a long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, diff_lt_corr_LM_tmp, and a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the previous frame, diff_lt_corr_RM_tmp; and determine an inter-frame variation parameter d_lt_corr of the amplitude correlation difference between the left and right channels of the current frame, based on the obtained initial value of the amplitude correlation difference parameter between the left and right channels of the current frame, diff_lt_corr_SM, and an amplitude correlation difference parameter between the left and right channels of the previous frame, tdm_last_diff_lt_corr_SM; Finally, the method may include adaptively selecting different left channel smoothing coefficients and right channel smoothing coefficients 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-term smoothed frame energy of the left channel of the current frame, the long-term 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 obtained in the signal energy analysis, as well as inter-frame variation parameters of the amplitude correlation difference between the left and right channels of the current frame, and calculating a long-term smoothed amplitude correlation parameter tdm_lt_corr_LM_SM between the left channel signal of the current frame and the reference channel signal and a long-term 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 methods for calculating 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, which is not limited in this application.
[0389] 90842. Calculate an amplitude correlation difference parameter diff_lt_corr between the left and right channels of the current frame based on a long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame and a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame.
[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 where tdm_lt_corr_LM_SM indicates a long-term smoothed amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal, and tdm_lt_corr_RM_SM indicates a long-term smoothed amplitude correlation parameter between the right channel signal of the current frame and the reference channel signal.
[0391] 9085. To determine a channel coupling ratio coefficient and a coded index of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame, convert the amplitude correlation difference parameter diff_lt_corr between the left and right channels of the current frame into a channel coupling ratio coefficient, and perform coding and quantization.
[0392] Referring to FIG. 9-D, a possible method for converting the amplitude correlation difference parameter between the left and right channels of the current frame into a channel coupling ratio coefficient may specifically include steps 90851 to 90853.
[0393] 90851. A mapping process is performed on the amplitude correlation difference parameters between the left and right channels such that the range of values of the amplitude correlation difference parameters that are between the left and right channels and have been subjected to the mapping process can be [MAP_MIN, MAP_MAX].
[0394] A method for performing a mapping process on the amplitude correlation difference parameters between the left and right channels may include the following steps.
[0395] First, amplitude limiting is performed on 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, is
number
[0396] Here, RATIO_MAX indicates the maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channels, and RATIO_MIN indicates the minimum value of the amplitude-limited amplitude correlation difference parameter between the left and right channels. For example, RATIO_MAX is a preset empirical value, RATIO_MAX may be 1.5, 3.0, or another value, RATIO_MIN is a preset empirical value, RATIO_MIN may be −1.5, −3.0, or another value, and 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 between the left and right channels that has been subjected to the mapping process is
number
number
[0398] where MAP_MAX is between the left and right channels and indicates a maximum value of the amplitude correlation difference parameter that has been subjected to the mapping process, MAP_HIGH is between the left and right channels and indicates a high threshold value of the amplitude correlation difference parameter that has been subjected to the mapping process, MAP_LOW is between the left and right channels and indicates a low threshold value of the amplitude correlation difference parameter that has been subjected to the mapping process, and MAP_MIN is between the left and right channels and indicates a minimum value of the amplitude correlation difference parameter that has been subjected to the mapping process, MAP_MAX>MAP_HIGH>MAP_LOW>MAP_MIN It is.
[0399] For example, in some embodiments of the present 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 real applications, the values are not limited to such examples.
[0400] RATIO_MAX indicates a maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channels, RATIO_HIGH indicates a high threshold value of the amplitude-limited amplitude correlation difference parameter between the left and right channels, RATIO_LOW indicates a low threshold value of the amplitude-limited amplitude correlation difference parameter between the left and right channels, and RATIO_MIN indicates a 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 It is.
[0401] For example, in some embodiments of the present application, RATIO_MAX is 1.5, RATIO_HIGH is 0.75, RATIO_LOW is -0.75, and RATIO_MIN is -1.5. Of course, in practical applications, the values are not limited to such examples.
[0402] Another method in some embodiments of the present application is as follows: the amplitude correlation difference parameter diff_lt_corr_map between the left and right channels and subjected to the mapping process is:
number
[0403] where diff_lt_corr_limit denotes the amplitude-limited amplitude correlation difference parameter between the left and right channels,
number
[0404] Here, RATIO_MAX indicates the maximum amplitude of the amplitude correlation difference parameter between the left and right channels, and -RATIO_MAX indicates the minimum amplitude of the amplitude correlation difference parameter between the left and right channels. RATIO_MAX may be a preset empirical value, and RATIO_MAX may be, for example, 1.5, 3.0, or another real number greater than 0.
[0405] 90852. The amplitude correlation difference parameters between the left and right channels and which have been subjected to a mapping process are converted into channel coupling ratio coefficients.
[0406] The channel coupling ratio coefficient ratio_SM is
number
[0407] In addition to the above-mentioned methods, other methods may be used to convert the amplitude correlation difference parameters between the left and right channels into channel coupling ratio coefficients, for example: Whether the channel coupling ratio coefficients corresponding to the anti-correlated signal channel combining schemes need to be updated is determined based on the long-term smoothed frame energy of the left channel of the current frame, the long-term 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 obtained by signal energy analysis, the buffered encoding parameters of the previous frame in the history buffer of the encoder (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 combining scheme flags of the current frame and the previous frame, and the channel combining ratio coefficients corresponding to the anti-correlated signal channel combining schemes of the current frame and the previous frame.
[0408] When the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme needs to be updated, the amplitude correlation difference parameter between the left and right channels is converted into a channel coupling ratio coefficient by using the method in the above example; when no update is needed, the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the previous frame and the coded index of the channel coupling ratio coefficient are directly used as the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame and the coded index of the channel coupling ratio coefficient.
[0409] 90853. Perform quantization coding on the channel combining ratio coefficients obtained after transformation to determine the channel combining ratio coefficients corresponding to the decorrelation signal channel combining scheme of the current frame.
[0410] Specifically, for example, an initial coded index ratio_idx_init_SM corresponding to the anti-correlated signal channel coupling scheme of the current frame, and a quantized coded initial value ratio_init_SM of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame. qua Quantization coding is performed on the channel combining ratio coefficients obtained after transformation to obtain ratio_init_SM qua = ratio_tabl_SM[ratio_idx_init_SM], ratio_tabl_SM indicates a codebook for performing scalar quantization on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme.
[0411] The quantization coding can be performed by using any scalar quantization method in the prior art, for example, uniform scalar quantization or non-uniform scalar quantization. The number of bits used for coding can be 5 bits. The specific method is not described here. The codebook for performing scalar quantization on the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme can be the same as or different from the codebook for performing scalar quantization on the channel coupling ratio coefficient corresponding to the correlated signal channel coupling scheme. If the codebooks are the same, only one codebook used for performing scalar quantization on the channel coupling ratio coefficient needs to be stored.
[0412] In this case, the quantized coded initial value of the channel coupling ratio coefficient corresponding to the decorrelated signal channel coupling scheme of the current frame, 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 coded initial value of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame as the channel coupling ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame, and to directly use the initial coded index of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame as the coded index of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame.
[0414] The coded index of the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme of the current frame, ratio_idx_SM, satisfies ratio_idx_SM=ratio_idx_init_SM.
[0415] The channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame is ratio_SM=ratio_tabl[ratio_idx_SM] Meet the following.
[0416] For example, another method may include the steps of modifying quantized coded initial values of channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame and the initial coded indexes corresponding to the anti-correlated signal channel coupling scheme of the current frame based on coded indexes of channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the previous frame or the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the previous frame, using the modified coded indexes of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame as the coded indexes of the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame, and using the modified channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme as the channel coupling ratio coefficients corresponding to the anti-correlated signal channel coupling scheme of the current frame.
[0417] The coded index of the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme of the current frame, ratio_idx_SM, satisfies ratio_idx_SM=φ*ratio_idx_init_SM+(1−φ)*tdm_last_ratio_idx_SM.
[0418] where ratio_idx_init_SM indicates the initial coded index corresponding to the anti-correlated signal channel combining scheme of the current frame, tdm_last_ratio_idx_SM is the coded index of the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the previous frame, and φ is the modification coefficient of the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme. The value of φ may be an empirical value, and φ may be equal to 0.8, for example.
[0419] The channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame is ratio_SM=ratio_tabl[ratio_idx_SM] Meet the following.
[0420] Another method is to use the non-quantized channel coupling ratio coefficient corresponding to the anti-correlated signal channel combining scheme as the channel coupling ratio coefficient corresponding to the anti-correlated signal channel combining scheme of the current frame. In other words, the channel coupling ratio coefficient ratio_SM corresponding to the anti-correlated signal channel combining scheme of the current frame is:
number
[0421] In addition, a fourth method includes the steps of modifying a non-quantized channel coupling ratio coefficient corresponding to an anti-correlated signal channel coupling scheme of a current frame based on a channel coupling ratio coefficient corresponding to an anti-correlated signal channel coupling scheme of a previous frame; using the modified channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme as the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame; and performing quantization coding on the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame to obtain a coded index of the channel coupling ratio coefficient corresponding to the anti-correlated signal channel coupling scheme of the current frame.
[0422] In addition to the above-mentioned methods, there may be many ways to convert the amplitude correlation difference parameters between the left and right channels into channel coupling ratio coefficients and perform coding and quantization.Similarly, there are many different ways to determine the channel coupling ratio coefficients corresponding to the current frame's anti-correlation signal channel coupling scheme and the coded indexes of the channel coupling ratio coefficients.This is not limited in this application.
[0423] 909. Perform an encoding mode decision based on the channel bonding scheme flag of the previous frame and the channel bonding scheme flag of the current frame to determine the encoding mode of the current frame.
[0424] The channel bonding scheme flag of the current frame may be denoted as tdm_SM_flag, the channel bonding scheme flag of the previous frame may be denoted as tdm_last_SM_flag, and the joint flag of the channel bonding scheme flag of the previous frame and the channel bonding scheme flag of the current frame may be denoted as (tdm_last_SM_flag, tdm_SM_flag). The coding mode decision may be performed based on the joint flags. Details are shown in the following example.
[0425] It is assumed that the correlated signal channel combining scheme is represented by 0, and the anti-correlated signal channel combining scheme is represented by 1. In this case, the joint flag of the channel combining scheme flag of the previous frame and the current frame has the following four cases, namely (01), (11), (10), and (00), and the coding mode of the current frame is determined as a correlated signal coding mode, an anti-correlated signal coding mode, a mode of switching signal coding from correlated to anti-correlated, and a mode of switching signal coding from anti-correlated to correlated. For example, if the joint flag of the channel bonding scheme flags of the current frame is (00), it indicates that the coding mode of the current frame is a correlated signal coding mode, or if the joint flag of the channel bonding scheme flags of the current frame is (11), it indicates that the coding mode of the current frame is an anti-correlated signal coding mode, or if the joint flag of the channel bonding scheme flags of the current frame is (01), it indicates that the coding mode of the current frame is a mode of switching signal coding from correlated to anti-correlated, or if the joint flag of the channel bonding scheme flags of the current frame is (10), it indicates that the coding mode of the current frame is a mode of switching signal coding from anti-correlated to correlated.
[0426] 910. After obtaining the encoding mode stereo_tdm_coder_type of the current frame, the encoding device performs a time-domain downmix processing on the left and right channel signals of the current frame based on the time-domain downmix processing method corresponding to the encoding mode of the current frame, to obtain a primary channel signal and a secondary channel signal of the current frame.
[0427] The coding mode of the current frame is one of a plurality of coding modes. For example, the plurality of coding modes may include a mode of switching signal coding from correlation to anti-correlation, a mode of switching signal coding from anti-correlation to correlation, a correlation signal coding mode, and an anti-correlation signal coding mode. For the implementation of the time-domain downmix processing in different coding modes, please refer to the relevant description of the above-mentioned embodiment examples. Details are not repeated here.
[0428] 911. To obtain an encoded primary channel signal and an encoded secondary channel signal, an encoding device separately encodes the primary channel signal and the secondary channel signal.
[0429] Specifically, bit allocation may be first performed for encoding the primary channel signal and encoding the secondary channel signal based on parameter information obtained in encoding the primary channel signal and / or the secondary channel signal of the previous frame and the total number of bits for encoding the primary channel signal and the secondary channel signal. Then, the primary channel signal and the secondary channel signal are separately encoded based on the result of bit allocation to obtain a coded index of the primary channel encoding and a coded index of the secondary channel encoding. The primary channel encoding and the secondary channel encoding may be implemented by using any mono audio encoding technique, which will not be described further herein.
[0430] 912. The encoding device selects a corresponding coded index of the channel bonding ratio coefficient based on the channel bonding scheme flag, writes the coded index into the bitstream, and writes the coded primary channel signal, the coded secondary channel signal, and the channel bonding scheme flag of the current frame into the bitstream.
[0431] Specifically, for example, if the channel bonding scheme flag tdm_SM_flag of the current frame corresponds to a correlated signal channel bonding scheme, the coded index ratio_idx of the channel bonding ratio coefficient corresponding to the correlated signal channel bonding scheme of the current frame is written into the bitstream, or if the channel bonding scheme flag tdm_SM_flag of the current frame corresponds to an anti-correlated signal channel bonding scheme, the coded index ratio_idx_SM of the channel bonding ratio coefficient corresponding to the anti-correlated signal channel bonding scheme of the current frame is written into the bitstream. For example, if tdm_SM_flag=0, the coded index ratio_idx of the channel bonding ratio coefficient corresponding to the correlated signal channel bonding scheme of the current frame is written into the bitstream, or if tdm_SM_flag=1, the coded index tdm_SM_flag=0 of the channel bonding ratio coefficient corresponding to the anti-correlated signal channel bonding scheme of the current frame is written into the bitstream.
[0432] In addition, the encoded primary channel signal, the encoded secondary channel signal, and the channel bonding scheme flag for the current frame are written to the bitstream. It will be appreciated that there is no order for performing the bitstream write operations.
[0433] Correspondingly, the following describes a time-domain stereo decoding scenario by using an example.
[0434] With reference to Figure 10, an audio decoding method is further provided below. The relevant steps of the audio decoding method may be specifically implemented by a decoding device, and the method may specifically include the following steps:
[0435] 1001. Perform decoding based on a bitstream to obtain decoded primary and secondary channel signals of a current frame.
[0436] 1002. Perform decoding based on the bitstream to obtain time-domain stereo parameters of the current frame.
[0437] The time-domain stereo parameters of the current frame may include channel coupling ratio coefficients of the current frame (the bitstream includes coded indices of the channel coupling ratio coefficients of the current frame and the decoding may be performed based on the coded indices of the channel coupling ratio coefficients of the current frame to obtain the channel coupling ratio coefficients of the current frame), may further include inter-channel time differences of the current frame, etc. (e.g., the bitstream includes coded indices of inter-channel time differences of the current frame and the decoding may be performed based on the coded indices of the inter-channel time differences of the current frame to obtain the inter-channel time differences of the current frame, or the bitstream includes coded indices of absolute values of inter-channel time differences of the current frame and the decoding may be performed based on the coded indices of absolute values of inter-channel time differences of the current frame to obtain the absolute values of inter-channel time differences of the current frame).
[0438] 1003. Based on the bitstream, obtain a channel bonding scheme flag of a current frame included in the bitstream, and determine a channel bonding scheme of the current frame.
[0439] 1004. Determine a decoding mode for the current frame based on a channel bonding scheme of the current frame and a channel bonding scheme of a previous frame.
[0440] For determining the decoding mode of the current frame based on the channel bonding scheme of the current frame and the channel bonding scheme of the previous frame, please refer to the method for determining the coding mode of the current frame in step 909. The decoding mode of the current frame is one of a plurality of decoding modes. For example, the plurality of decoding modes may include a mode of switching signal decoding from correlation to anti-correlation, a mode of switching signal decoding from anti-correlation to correlation, a correlation signal coding mode, and an anti-correlation signal decoding mode. The coding mode and the decoding mode have a one-to-one correspondence.
[0441] For example, if the joint flag of the channel bonding scheme flags of the current frame is (00), it indicates that the decoding mode of the current frame is a correlated signal decoding mode, or if the joint flag of the channel bonding scheme flags of the current frame is (11), it indicates that the decoding mode of the current frame is an anti-correlated signal decoding mode, or if the joint flag of the channel bonding scheme flags of the current frame is (01), it indicates that the decoding mode of the current frame is a mode of switching signal decoding from correlated to anti-correlated, or if the joint flag of the channel bonding scheme flags of the current frame is (10), it indicates that the decoding mode of the current frame is a mode of switching signal decoding from anti-correlated to correlated.
[0442] It will be appreciated that there is no limited order for performing steps 1001, 1002, and steps 1003 and 1004.
[0443] 1005. Perform time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame by using a time-domain up-mix processing scheme corresponding to the determined decoding mode of the current frame to obtain reconstructed left and right channel signals of the current frame.
[0444] For related implementation forms of the time-domain upmix processing in different decoding modes, please refer to the related descriptions of the above embodiment examples, and details will not be repeated here.
[0445] The upmix matrix used for the time-domain upmix processing is constructed based on the obtained channel combining ratio coefficients of the current frame.
[0446] The reconstructed left and right channel signals of the current frame may be used as the decoded left and right channel signals of the current frame.
[0447] Alternatively, delay adjustment may be further performed on the reconstructed left and right channel signals of the current frame based on the inter-channel time difference of the current frame to obtain delay-adjusted reconstructed left and right channel signals of the current frame, and the delay-adjusted reconstructed left and right channel signals of the current frame may be used as the decoded left and right channel signals of the current frame. Alternatively, time-domain post-processing may be further performed on the delay-adjusted reconstructed left and right channel signals of the current frame, and the time-domain post-processed reconstructed left and right channel signals of the current frame may be used as the decoded left and right channel signals of the current frame.
[0448] The method according to the embodiment of the present application has been described in detail above. The apparatus according to the embodiment of the present application will now be described.
[0449] The method according to the embodiment of the present application has been described in detail above. The apparatus according to the embodiment of the present application will now be described.
[0450] 11-A, an embodiment of the present application further provides an apparatus 1100. The apparatus 1100 includes: It may comprise a processor 1110 and a memory 1120 connected to each other, such that the processor 1110 may be configured to execute some or all of the steps of any method provided in the embodiments of the present application.
[0451] The memory 1120 includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), or a Compact Disc Read-Only Memory (CD-ROM). The memory 1102 is configured to store relevant instructions and relevant data.
[0452] Of course, the apparatus 1100 may further comprise a transceiver 1130 configured to receive and transmit data.
[0453] The processor 1110 may be one or more central processing units (CPUs). If the processor 1110 is a CPU, the CPU may be a single-core CPU or a multi-core CPU. The processor 1110 may be a digital signal processor.
[0454] In the implementation process, the steps of the above-mentioned method may be implemented using 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 discrete gate or transistor logic device, or a discrete 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, the processor may be any conventional processor, and so on. The steps of the methods disclosed in connection with each embodiment of the present invention may be directly performed and achieved using a hardware decode processor, or may be performed and achieved using a combination of hardware and software modules of the decode processor.
[0455] The software module may be located in a storage medium that is mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory 1120. For example, the processor 1110 can read information in the memory 1120 and complete the steps of the above-mentioned method in combination with the hardware of the processor 1110.
[0456] Further, the apparatus 1100 may further include a transceiver 1130. The transceiver 1130 may be configured to receive and transmit, for example, relevant data (e.g., instructions, channel signals, or bit streams). For example, the apparatus 1100 may perform some or all of the steps of the corresponding method in any of the embodiments shown in Figures 2 to 9-D.
[0457] Specifically, for example, when the device 1100 performs the above-mentioned steps of encoding, the device 1100 may be called an encoding device (or an audio encoding device). When the device 1100 performs the above-mentioned steps of decoding, the device 1100 may be called a decoding device (or an audio decoding device).
[0458] Referring to FIG. 11-B, for example, if the device 1100 is an encoding device, the device 1100 may further include a microphone 1140, an analog-to-digital converter 1150, and the like.
[0459] For example, the microphone 1140 may be configured to perform sampling to obtain an analog audio signal.
[0460] For example, the analog-to-digital converter 1150 may be configured to convert an analog audio signal to a digital audio signal.
[0461] Referring to FIG. 11-C, for example, if the device 1100 is an encoding device, the device 1100 may further include a speaker 1160, a digital-to-analog converter 1170, and the like.
[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, the speaker 1160 may be configured to reproduce an analog audio signal.
[0464] Additionally, referring to FIG. 12-A, an embodiment of the present application provides an apparatus 1200 comprising several functional units configured to implement any of the methods provided in the embodiments of the present application.
[0465] For example, when the apparatus 1200 executes the method corresponding to the embodiment shown in FIG. 2, the apparatus 1200: A first determining unit 1210 configured to determine a channel bonding scheme of a current frame, and determine a decoding mode of the current frame according to the channel bonding scheme of a previous frame and the channel bonding scheme of the current frame; and an encoding unit 1220 configured to perform a time-domain downmix process on left and right channel signals of the current frame based on a time-domain downmix process corresponding to an encoding mode of the current frame to obtain 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 determining unit 1230 configured to determine a time-domain stereo parameter of the current frame. The encoding unit 1220 may be further configured to encode the time-domain stereo parameter of the current frame.
[0467] As another example, referring to FIG. 12-C, when the apparatus 1200 executes the method corresponding to the embodiment shown in FIG. 3, the apparatus 1200: A third determining unit 1240 configured to determine a channel bonding scheme of the current frame based on a channel bonding scheme flag of the current frame in the bitstream, and determine a decoding mode of the current frame based on the channel bonding scheme of the previous frame and the channel bonding scheme of the current frame; and a decoding unit 1250 configured to perform decoding based on the bitstream to obtain decoded primary and secondary channel signals of the current frame, and to perform a time-domain up-mix processing on the decoded primary and secondary channel signals of the current frame based on a time-domain up-mix processing corresponding to a decoding mode of the current frame to obtain reconstructed left and right channel signals of the current frame.
[0468] If the device performs another method, this is inferred by analogy.
[0469] An embodiment of the present application provides a computer-readable storage medium, which stores a program code, the program code including instructions for performing some or all of the steps of any method provided in the embodiments of the present application.
[0470] An embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to perform some or all of the steps of any method provided in the embodiments of the present application.
[0471] In the above embodiments, the description of each embodiment has its own emphasis. For the parts not described in detail in one embodiment, please refer to the related description in another embodiment.
[0472] In some embodiments provided in the present application, it should be understood that the device of the present disclosure may be implemented in other ways. For example, the described device embodiment is merely an example. For example, the division of units may be merely a logical functional division, or may be other divisions in actual implementation. For example, multiple units or components may be combined or integrated into another system, and some features may be ignored or not implemented. In addition, the shown or described mutual indirect or direct couplings or communication connections may also be realized using some interfaces. The indirect couplings or communication connections between devices or units may be realized as electronic forms or other forms.
[0473] The units described as separate parts may or may not be physically separated, and the components shown as units may or may not be physical units. In particular, the components may be located in one location or distributed across multiple network units. Some or all of the units may be selected according to the actual needs to achieve the objectives of the solutions of each embodiment.
[0474] In addition, the functional units in the embodiments of the present invention may be integrated into one processing unit, each of the units may exist physically independent, or two or more units may be integrated into one unit. The integrated unit may be realized in the form of hardware or in the form of a software functional unit.
[0475] When the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, the integrated unit can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention can be essentially realized, or the part that contributes to the prior art, or all or part of the technical solution can be realized in the form of a software product. The computer software product is stored in a storage medium and includes some instructions for instructing a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The storage medium includes any medium that can store program code, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a removable hard disk, a magnetic disk, an optical disk, etc. [Explanation of symbols]
[0476] 1100 equipment 1110 Processor 1120 Memory 1130 Transmitter / Receiver 1140 Microphone 1150 Analog-to-Digital Converter 1160 Speaker 1170 Digital to Analog Converter 1200 equipment 1210 First Judgment Unit 1220 coding units 1230 Second Judgment Unit 1240 Third Judgment Unit 1250 Decoding Unit
Claims
1. determining a channel bonding scheme for a current frame; determining time-domain stereo parameters of the current frame based on the channel combining scheme of the current frame; encoding the determined time domain stereo parameters of the current frame, the time domain stereo parameters including at least one of a channel coupling ratio coefficient and an inter-channel time difference; 2. A method for time domain stereo parameter coding, comprising:
2. 2. The method of claim 1, wherein the channel bonding scheme of the current frame is one of a plurality of channel bonding schemes, the plurality of channel bonding schemes including an anti-correlated signal channel bonding scheme and a correlated signal channel bonding scheme, the correlated signal channel bonding scheme being a channel bonding scheme corresponding to approximately in-phase signals, and the anti-correlated signal channel bonding scheme being a channel bonding scheme corresponding to approximately out-of-phase signals.
3. 3. The method of claim 2, wherein if the channel combining scheme of the current frame is determined to be the correlated signal channel combining scheme, the time domain stereo parameters of the current frame are time domain stereo parameters corresponding to the correlated signal channel combining scheme of the current frame, and if the channel combining scheme of the current frame is determined to be the anti-correlated signal channel combining scheme, the time domain stereo parameters of the current frame are time domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame.
4. determining time domain stereo parameters of the current frame based on the channel combining scheme of the current frame, obtaining a reference channel signal of the current frame based on a left channel signal and a right channel signal of the current frame; calculating an amplitude correlation parameter between the left channel signal of the current frame and the reference channel signal; calculating an amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame; calculating an 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 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; and calculating a channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame. 【Request 5】 【Number 1】 and mono_i(n) denotes the reference channel signal of the current frame, x' L (n) denotes the delay aligned left channel signal of the current frame, and x' R 5. The method of claim 4, wherein (n) denotes a delay aligned right channel signal of the current frame, corr_LM denotes the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and corr_RM denotes the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame.
6. calculating an 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 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, calculating a long-term 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 delay-aligned left channel signal and the reference channel signal of the current frame; and calculating a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame based on the amplitude correlation parameter between the delay-aligned right channel signal and the reference channel signal of the current frame; 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 and the reference channel signal of the current frame and the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame.
7. tdm.lt.corr.LM.SM cur α(tdm!lt!corr.LM.SM pre N(10α)corr(LMであり、 tdm_lt_rms_L_SM cur = (1-A) *tdm_lt_rms_L_SM pre +A*rms_L, where A denotes the update coefficient of the long-term smoothed frame energy of the left channel signal of the current frame, and tdm_lt_rms_L_SM cur denotes the long-term smoothed frame energy of the left channel signal of the current frame, rms_L denotes the frame energy of the left channel signal of the current frame, and tdm_lt_corr_LM_SM cur denotes 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_LM_SM pre denotes the long-term smoothed amplitude correlation parameter between the left channel signal of the previous frame and the reference channel signal, α denotes the left channel smoothing coefficient, tdm_lt_corr_RM_SM cur =β*tdm_lt_corr_RM_SM pre +(1-β)corr_LMであり、 tdm_lt_rms_R_SM cur = (1-B) *tdm_lt_rms_R_SM pre +B*rms_R, where B denotes the update factor of the long-term smoothed frame energy of the right channel signal of the current frame, and tdm_lt_rms_R_SM pre denotes the long-term smoothed frame energy of the right channel signal of the current frame, rms_R denotes the frame energy of the right channel signal of the current frame, and tdm_lt_corr_RM_SM cur denotes the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, and tdm_lt_corr_RM_SM pre 7. The method of claim 6, wherein: β denotes a long-term smoothed amplitude correlation parameter between the right channel signal of the previous frame and the reference channel signal, and β denotes a right channel smoothing factor.
8. diff_lt_corr=tdm_lt_corr_LM_SM-tdm_lt_corr_RM_SM, where 8. The method of claim 6 or 7, wherein tdm_lt_corr_LM_SM indicates 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 indicates 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 indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame.
9. calculating a channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame, 9. The method according to claim 6, further comprising: performing the mapping process on the amplitude correlation difference parameters between the left and right channel signals of the current frame such that a value range of the mapped amplitude correlation difference parameters between the left and right channel signals of the current frame can be [MAP_MIN, MAP_MAX]; and converting the mapped amplitude correlation difference parameters between the left and right channel signals into the channel coupling ratio coefficients.
10. 10. The method of claim 9, wherein the step of performing a mapping process on the amplitude correlation difference parameters between the left and right channel signals of the current frame comprises the steps of performing amplitude limiting on the amplitude correlation difference parameters between the left and right channel signals of the current frame, and performing a mapping process on amplitude-limited amplitude correlation difference parameters between the left and right channel signals of the current frame. 【Request 11】 【Number 2】 where 11. The method of claim 10, wherein RATIO_MAX indicates a maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, and RATIO_MIN indicates a minimum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, and RATIO_MAX>RATIO_MIN. 【Request 12】 【Number 3】 and diff_lt_corr_map indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process; MAP_MAX indicates a maximum value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process, MAP_HIGH indicates a high threshold value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process, MAP_LOW indicates a low threshold value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process, and MAP_MIN indicates a minimum value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process, MAP_MAX>MAP_HIGH>MAP_LOW>MAP_MIN, RATIO_MAX indicates a maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, RATIO_HIGH indicates a high threshold value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process, RATIO_LOW indicates a low threshold value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process, and RATIO_MIN indicates a minimum value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process, 12. The method of claim 10, wherein RATIO_MAX>RATIO_HIGH>RATIO_LOW>RATIO_MIN. 【Request 13】 【Number 4】 where diff_lt_corr_limit indicates the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, diff_lt_corr_map indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame and has been subjected to the mapping process, [0050] and 12. The method according to claim 10 or 11, wherein RATIO_MAX indicates a maximum amplitude of the amplitude correlation difference parameter between the left and right channel signals of the current frame, and −RATIO_MAX indicates a minimum amplitude of the amplitude correlation difference parameter between the left and right channel signals of the current frame. 【Request 14】 【Number 6】 where 14. The method of claim 9, wherein diff_lt_corr_map indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process, and ratio_SM indicates the channel coupling ratio coefficient corresponding to the decorrelated signal channel coupling scheme of the current frame.
15. A time domain stereo parameter coding apparatus comprising a processor and a memory coupled to each other, the processor and memory comprising: The processor, determining a channel bonding scheme for a current frame; determining time-domain stereo parameters of the current frame based on the channel combining scheme of the current frame; and b. encoding the determined time domain stereo parameters of the current frame, wherein the time domain stereo parameters include at least one of a channel combining ratio coefficient and an inter-channel time difference.
16. 16. The apparatus of claim 15, wherein the channel bonding scheme for the current frame is one of a plurality of channel bonding schemes, the plurality of channel bonding schemes including an anti-correlated signal channel bonding scheme and a correlated signal channel bonding scheme, the correlated signal channel bonding scheme being a channel bonding scheme corresponding to approximately in-phase signals, and the anti-correlated signal channel bonding scheme being a channel bonding scheme corresponding to approximately out-of-phase signals.
17. 17. The apparatus of claim 16, wherein if the channel combining scheme of the current frame is determined to be the correlated signal channel combining scheme, the time domain stereo parameters of the current frame are time domain stereo parameters corresponding to the correlated signal channel combining scheme of the current frame, and if the channel combining scheme of the current frame is determined to be the anti-correlated signal channel combining scheme, the time domain stereo parameters of the current frame are time domain stereo parameters corresponding to the anti-correlated signal channel combining scheme of the current frame.
18. determining the time-domain stereo parameters for the current frame based on the channel combining scheme for the current frame; 18. The apparatus of claim 16, comprising: obtaining a reference channel signal of the current frame based on a left channel signal and a right channel signal of the current frame; calculating an amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame; calculating an amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame; calculating an 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 a channel coupling ratio coefficient corresponding to the anti-correlated 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.
19. 【Number 7】 and mono_i(n) denotes the reference channel signal of the current frame, x' L (n) denotes the delay aligned left channel signal of the current frame, and x' R 20. The apparatus of claim 18, wherein (n) denotes a delay aligned right channel signal of the current frame, corr_LM denotes the amplitude correlation parameter between the left channel signal and the reference channel signal of the current frame, and corr_RM denotes the amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame.
20. the processor 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 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; calculating a long-term 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 delay-aligned left channel signal and the reference channel signal of the current frame; and calculating a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame based on the amplitude correlation parameter between the delay-aligned right channel signal and the reference channel signal of the current frame; 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.
21. tdm.lt.corr.LM.SM cur α(tdm!lt!corr.LM.SM pre N(10α)corr(LMであり、 tdm_lt_rms_L_SM cur = (1-A) *tdm_lt_rms_L_SM pre +A*rms_L, where A denotes the update coefficient of the long-term smoothed frame energy of the left channel signal of the current frame, and tdm_lt_rms_L_SM cur denotes the long-term smoothed frame energy of the left channel signal of the current frame, rms_L denotes the frame energy of the left channel signal of the current frame, and tdm_lt_corr_LM_SM cur denotes 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_LM_SM pre denotes the long-term smoothed amplitude correlation parameter between the left channel signal of the previous frame and the reference channel signal, α denotes the left channel smoothing coefficient, tdm_lt_corr_RM_SM cur =β*tdm_lt_corr_RM_SM pre +(1-β)corr_LMであり、 tdm_lt_rms_R_SM cur = (1-B) *tdm_lt_rms_R_SM pre +B*rms_R, where B denotes the update factor of the long-term smoothed frame energy of the right channel signal of the current frame, and tdm_lt_rms_R_SM pre denotes the long-term smoothed frame energy of the right channel signal of the current frame, rms_R denotes the frame energy of the right channel signal of the current frame, and tdm_lt_corr_RM_SM cur denotes the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal of the current frame, and tdm_lt_corr_RM_SM pre 21. The apparatus of claim 20, wherein x denotes a long-term smoothed amplitude correlation parameter between a right channel signal of the previous frame and the reference channel signal, and β denotes a right channel smoothing factor.
22. diff_lt_corr=tdm_lt_corr_LM_SM-tdm_lt_corr_RM_SM, where 22. The apparatus of claim 20 or 21, wherein tdm_lt_corr_LM_SM indicates 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 indicates 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 indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame.
23. the processor calculating the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme of the current frame based on the amplitude correlation difference parameter between the left and right channel signals of the current frame; 23. The apparatus of claim 20, further comprising: performing the mapping operation on the amplitude correlation difference parameter between the left and right channel signals of the current frame such that a value range 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.
24. 24. The apparatus of claim 23, wherein the processor performing a mapping process on the amplitude correlation difference parameters between the left and right channel signals of the current frame comprises: performing amplitude limiting on the amplitude correlation difference parameters between the left and right channel signals of the current frame; and performing a mapping process on amplitude-limited amplitude correlation difference parameters between the left and right channel signals of the current frame. 【Request 25】 【Number 8】 where 25. The apparatus of claim 24, wherein RATIO_MAX indicates a maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, and RATIO_MIN indicates a minimum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, and RATIO_MAX>RATIO_MIN. 【Request 26】 【Number 9】 and diff_lt_corr_map indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process; MAP_MAX indicates a maximum value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process, MAP_HIGH indicates a high threshold value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process, MAP_LOW indicates a low threshold value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process, and MAP_MIN indicates a minimum value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and that has undergone the mapping process, MAP_MAX>MAP_HIGH>MAP_LOW>MAP_MIN, RATIO_MAX indicates a maximum value of the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, RATIO_HIGH indicates a high threshold value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process, RATIO_LOW indicates a low threshold value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process, and RATIO_MIN indicates a minimum value of the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process, 26. Apparatus according to claim 24 or 25, wherein RATIO_MAX > RATIO_HIGH > RATIO_LOW > RATIO_MIN. 【Request 27】 【Number 10】 where diff_lt_corr_limit indicates the amplitude-limited amplitude correlation difference parameter between the left and right channel signals of the current frame, diff_lt_corr_map indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame and has been subjected to the mapping process, ##EQU00011## and 26. The apparatus of claim 24 or 25, wherein RATIO_MAX indicates a maximum amplitude of the amplitude correlation difference parameter between the left and right channel signals of the current frame, and −RATIO_MAX indicates a minimum amplitude of the amplitude correlation difference parameter between the left and right channel signals of the current frame. 【Request 28】 【Number 12】 where 28. The apparatus of claim 23, wherein diff_lt_corr_map indicates the amplitude correlation difference parameter between the left and right channel signals of the current frame and subjected to the mapping process, and ratio_SM indicates the channel coupling ratio coefficient corresponding to the decorrelated signal channel coupling scheme of the current frame.
29. 15. A computer readable storage medium, the computer readable storage medium storing program code, the program code comprising instructions used to perform the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
A method and system for using long-term correlation differences between left and right channels to time-domain downmix a stereo audio signal into primary and secondary channels.
JP2018533056A