Time domain stereo encoding and decoding method and related product
The time-domain stereo encoding method addresses the issue of degraded quality in conventional techniques by dynamically determining coding modes and using phase-specific downmixing methods, resulting in enhanced encoding performance across varying signal conditions.
Patent Information
- Application Number
- JP2025040107
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2017-08-10
- Filing Date
- 2025-03-13
- Publication Date
- 2025-06-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Conventional time-domain stereo encoding techniques often result in degraded encoding quality due to extremely small or undetectable energy in the primary signal.
A time-domain stereo encoding method that determines a coding mode for each frame and performs time-domain downmixing using specific methods corresponding to anti-correlated or correlated signal coding modes, enhancing channel combination schemes for signals close to opposite phases.
Improves encoding quality by dynamically adapting to different signal phases and energies, ensuring optimal encoding performance even when primary signal energy is low.
Smart Images

Figure 2025090767000001_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio encoding and decoding technologies, and more particularly, to time-domain stereo encoding and decoding methods and related products.
Background Art
[0002] Since the quality of life has improved, people have increasingly high demands for high-quality audio. Compared with monaural audio, stereo audio has a sense of direction and distribution for various sound sources, and can improve the clarity, intelligibility, and presence of information, and thus is popular among people.
[0003] In parametric stereo encoding and decoding technologies, a stereo signal is converted into a monaural signal and spatial perception parameters, and a multi-channel signal is compressed. This is a common stereo encoding and decoding technology. However, in parametric stereo encoding and decoding technologies, spatial perception parameters usually need to be extracted in the frequency domain and time-domain conversion needs to be performed, so the delay of the entire codec is relatively large. Therefore, when relatively strict requirements exist for delay, time-domain stereo encoding technology is a better choice.
[0004] In conventional time-domain stereo encoding techniques, the signal is downmixed to obtain two monaural signals in the time domain. For example, in MS encoding techniques, the left and right channel signals are first downmixed to obtain a Mid channel signal and a Side channel signal. For example, L represents the left channel signal and R represents the right channel signal. In this case, the Mid channel signal is 0.5×(L+R), the Mid channel signal indicates information about the correlation between the left and right channels, the Side channel signal is 0.5×(L-R), and the Side channel signal indicates information about the difference between the left and right channels. Thereafter, the Mid channel signal and the Side channel signal are encoded separately by using a monaural encoding method. The Mid channel signal is usually encoded by using a larger number of bits, and the Side channel signal is usually encoded by using a smaller number of bits.
[0005] When conventional time-domain stereo encoding techniques are used, sometimes the energy of the primary signal is extremely small or the energy is even undetectable, resulting in a degradation of the final encoding quality. is found through research and practice performed .
Summary of the Invention
[0006] Embodiments of the present application provide a time-domain stereo encoding method and related products.
[0007] According to a first aspect, an embodiment of the present application provides a time-domain stereo encoding method. The method includes determining a coding mode of a current frame, and when it is determined that the coding mode of the current frame is an anti-correlated signal coding mode, in order to obtain a primary channel signal and a secondary channel signal in the current frame, performing a time-domain downmixing process on the left and right channel signals in the current frame by using a time-domain downmixing process method corresponding to the anti-correlated signal coding mode, where the time-domain downmixing process method corresponding to the anti-correlated signal coding mode is a time-domain downmixing process method corresponding to an anti-correlated signal channel combination scheme, and the anti-correlated signal channel combination scheme is a channel combination scheme corresponding to signals that are close to being out of phase, and encoding the obtained primary and secondary channel signals in the current frame.
[0008] The stereo signal in the current frame includes, for example, the left and right channel signals in the current frame.
[0009] The coding mode of the current frame can be one of a plurality of coding modes. For example, the coding mode of the current frame can be one of the following coding modes, namely, a correlated signal coding mode, an anti-correlated signal coding mode, a switching mode from correlated to anti-correlated signal coding, and a switching mode from anti-correlated to correlated signal coding.
[0010] In the above solution, the coding mode of the current frame needs to be determined, and it can be understood that this indicates that there are multiple possibilities for the coding mode of the current frame. Compared with the conventional solution with only one coding mode, this solution with multiple possible coding modes is more compatible with and can harmonize with multiple possible scenarios. In addition, since a channel combination scheme corresponding to a signal close to the opposite phase is introduced, when the stereo signal in the current frame is a signal close to the opposite phase, there exists a more target-oriented channel combination scheme and coding mode, which helps to improve the encoding quality.
[0011] In some possible implementations, the method may further include the step of performing time-domain downmix processing on the left and right channel signals in the current frame by using a time-domain downmix processing method corresponding to the correlation signal coding mode to obtain the primary and secondary channel signals in the current frame when it is determined that the coding mode of the current frame is the correlation signal coding mode. The time-domain downmix processing method corresponding to the correlation signal coding mode is a time-domain downmix processing method corresponding to the correlation signal channel combination scheme, and the correlation signal channel combination scheme is a channel combination scheme corresponding to a signal close to the same phase.
[0012] In some possible implementations, when it is determined that the coding mode of the current frame is a switching mode from correlation to anti-correlation signal coding, the method may further include performing a time-domain downmixing process on the left and right channel signals in the current frame by using a time-domain downmixing process method corresponding to the switching mode from correlation to anti-correlation signal coding to obtain the primary and secondary channel signals in the current frame. The time-domain downmixing process method corresponding to the switching mode from correlation to anti-correlation signal coding is a time-domain downmixing process method corresponding to the transition from a correlation signal channel combination scheme to an anti-correlation signal channel combination scheme.
[0013] In some possible implementations, when it is determined that the coding mode of the current frame is a switching mode from anti-correlation to correlation signal coding, the method may further include performing a time-domain downmixing process on the left and right channel signals in the current frame by using a time-domain downmixing process method corresponding to the switching mode from anti-correlation to correlation signal coding to obtain the primary and secondary channel signals in the current frame. The time-domain downmixing process method corresponding to the switching mode from anti-correlation to correlation signal coding is a time-domain downmixing process method corresponding to the transition from an anti-correlation signal channel combination scheme to a correlation signal channel combination scheme.
[0014] It can be understood that the time-domain downmixing process methods corresponding to different coding modes are usually different. In addition, each coding mode may correspond to one or more time-domain downmixing process methods.
[0015] For example, in some possible implementations, to obtain the primary and secondary channel signals in the current frame, by using a time-domain downmix processing method corresponding to the anti-correlation signal coding mode, the step of performing time-domain downmix processing on the left and right channel signals in the current frame is: to obtain the primary and secondary channel signals in the current frame, based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame, perform time-domain downmix processing on the left and right channel signals in the current frame, or to obtain the primary and secondary channel signals in the current frame, based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame, perform time-domain downmix processing on the left and right channel signals in the current frame may be included.
[0016] The channel combination ratio coefficient of the channel combination scheme (e.g., the anti-correlation signal channel combination scheme or correlation the signal channel combination scheme) for an audio frame (e.g., the current frame or the previous frame) can be understood to be a preset fixed value. Of course, the channel combination ratio coefficient of the audio frame may also be determined based on the channel combination scheme for the audio frame.
[0017] In some possible implementations, based on the channel combination ratio coefficient of the audio frame, a corresponding downmix matrix can be constructed, and to obtain the primary and secondary channel signals in the current frame, by using the downmix matrix corresponding to the channel combination scheme, time-domain downmix processing is performed on the left and right channel signals in the current frame.
[0018] For example, in order to obtain the primary and secondary channel signals in the current frame, when time-domain downmix processing is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame,
[0019]
Number
[0020] it is.
[0021] For another example, in order to obtain the primary and secondary channel signals in the current frame, when time-domain downmix processing is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame, when 0 ≦ n < N-delay_com,
[0022]
Number
[0023] it is, or when N-delay_com ≦ n < N,
[0024]
Number
[0025] it is, where delay_com indicates encoding delay compensation.
[0026] For another example, in order to obtain the primary and secondary channel signals in the current frame, when time-domain downmix processing is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame, if 0 ≦ n < N-delay_com,
[0027] [Number]
[0028] it is, if N-delay_com ≦ n < N-delay_com + NOVA_1,
[0029] [Number]
[0030] or if N-delay_com + NOVA_1 ≦ n < N,
[0031] [Number]
[0032] it is.
[0033] In this specification, fade_in(n) represents the fade-in coefficient. For example,
[0034] [Number]
[0035] it is. Of course, fade_in(n) may alternatively be a fade-in coefficient of another functional relationship based on n.
[0036] fade_out(n) represents the fade - out coefficient. For example,
[0037]
Number
[0038] it is. Of course, fade_out(n) may be, or may be a fade - out coefficient of another functional relationship based on n.
[0039] In this specification, NOVA_1 represents the transition processing length. The value of NOVA_1 may be set based on specific scenario requirements. For example, NOVA_1 may be equal to 3 / N, or NOVA_1 may be another value smaller than N.
[0040] For another example, in order to obtain the primary and secondary channel signals in the current frame, when time - domain down - mixing processing is performed on the left and right channel signals in the current frame by using a time - domain down - mixing processing method corresponding to the correlation signal coding mode,
[0041]
Number
[0042] it is.
[0043] In the above example, X L (n) represents the left - channel signal in the current frame, X R (n) represents the right - channel signal in the current frame, Y(n) represents the primary channel signal that is within the current frame and is obtained through time - domain down - mixing processing, and X(n) represents the secondary channel signal that is within the current frame and is obtained through time - domain down - mixing processing.
[0044] In the above example, n indicates the number of sampling points. For example, n = 0, 1, ..., N - 1.
[0045] In the above example, delay_com indicates encoding delay compensation.
[0046] M 11 represents a downmix matrix corresponding to the correlation signal channel combination scheme for the previous frame, and M 11 is constructed based on the channel combination ratio coefficients corresponding to the correlation signal channel combination scheme for the previous frame.
[0047] M 12 represents a downmix matrix corresponding to the anti-correlation signal channel combination scheme for the previous frame, and M 12 is constructed based on the channel combination ratio coefficients corresponding to the anti-correlation signal channel combination scheme for the previous frame.
[0048] M 22 represents a downmix matrix corresponding to the anti-correlation signal channel combination scheme for the current frame, and M 22 is constructed based on the channel combination ratio coefficients corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0049] M 21 represents a downmix matrix corresponding to the correlation signal channel combination scheme for the current frame, and M 21 is constructed based on the channel combination ratio coefficients corresponding to the correlation signal channel combination scheme for the current frame.
[0050] M 21 represents a plurality of formats, for example,
[0051]
Number
[0052] or
[0053]
Number
[0054] may have
[0055] In this specification, ratio indicates the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0056] In this specification, M 22 is of multiple forms, for example
[0057]
Number
[0058] or
[0059]
Number
[0060] or
[0061]
Number
[0062] or
[0063]
Number
[0064] or
[0065]
Number
[0066] or
[0067]
Number
[0068] may have.
[0069] In this specification, α1 = ratio_SM, α2 = 1 - ratio_SM, and ratio_SM represents the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0070] In this specification, M 12 is of multiple forms, for example
[0071]
Number
[0072] or
[0073]
Number
[0074] or
[0075]
Number
[0076] or
[0077]
Number
[0078] or
[0079]
Number
[0080] or
[0081]
Number
[0082] may have.
[0083] In this specification, α 1_pre = tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM, and tdm_last_ratio_SM indicates the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame.
[0084] The left and right channel signals in the current frame may specifically be the original left and right channel signals in the current frame (the original left and right channel signals are left and right channel signals that have not undergone time-domain preprocessing, and may be, for example, left and right channel signals obtained through sampling), or may be left and right channel signals that have undergone time preprocessing in the current frame, or may be left and right channel signals that have undergone delay alignment processing in the current frame.
[0085] Specifically, for example,
[0086]
Number
[0087] or
[0088]
Number
[0089] or
[0090]
Number
[0091] is.
[0092] In this specification, x L (n) represents the original left channel signal in the current frame, and x R (n) represents the original right channel signal in the current frame, and x L_HP (n) represents the left channel signal subjected to time-domain preprocessing in the current frame, and x R_HP (n) represents the right channel signal subjected to time-domain preprocessing in the current frame, and x’ L (n) represents the left channel signal subjected to delay alignment processing in the current frame, and x’ R (n)x R_HP (n) represents the right channel signal subjected to delay alignment processing in the current frame.
[0093] According to a second aspect, an embodiment of the present application further provides a time-domain stereo decoding method, and the method includes Steps of decoding a bitstream to obtain the decoded primary and secondary channel signals in the current frame, determining the decoding mode of the current frame, and when it is determined that the decoding mode of the current frame is the anti-correlation signal decoding mode, performing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain upmix processing method corresponding to the anti-correlation signal decoding mode to obtain the reconstructed left and right channel signals in the current frame, where the time-domain upmix processing method corresponding to the anti-correlation signal decoding mode is a time-domain upmix processing method corresponding to an anti-correlation signal channel combination scheme, and the anti-correlation signal channel combination scheme is a channel combination scheme corresponding to signals that are close to being out of phase. may include.
[0094] The decoding mode of the current frame can be one of a plurality of decoding modes. For example, the decoding mode of the current frame can be one of the following decoding modes, namely, the correlation signal decoding mode, the anti-correlation signal decoding mode, the switching mode from correlation to anti-correlation signal decoding, and the switching mode from anti-correlation to correlation signal decoding.
[0095] In the above solution, the decoding mode of the current frame needs to be determined, and it can be understood that this indicates that there are multiple possibilities for the decoding mode of the current frame. Compared with the conventional solution with only one decoding mode, this solution with multiple possible decoding modes is more compatible with and can harmonize with multiple possible scenarios. In addition, since a channel combination scheme corresponding to a signal close to the opposite phase is introduced, when the stereo signal in the current frame is a signal close to the opposite phase, a more target-oriented channel combination scheme and decoding mode exist, which helps to improve the decoding quality.
[0096] In some possible implementations, the method When it is determined that the decoding mode of the current frame is the correlation signal decoding mode, in order to obtain the reconstructed left and right channel signals in the current frame, by using the time-domain upmix processing method corresponding to the correlation signal decoding mode, performing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame, where the time-domain upmix processing method corresponding to the correlation signal decoding mode is the time-domain upmix processing method corresponding to the correlation signal channel combination scheme, and the correlation signal channel combination scheme is the channel combination scheme corresponding to a signal close to the in-phase, step may further include.
[0097] In some possible implementations, when it is determined that the decoding mode of the current frame is the switching mode from correlation to anti-correlation signal decoding, the method may further include performing a time-domain upmixing process on the decoded primary and secondary channel signals in the current frame by using a time-domain upmixing process method corresponding to the switching mode from correlation to anti-correlation signal decoding to obtain the reconstructed left and right channel signals in the current frame. The time-domain upmixing process method corresponding to the switching mode from correlation to anti-correlation signal decoding is a time-domain upmixing process method corresponding to the transition from a correlation signal channel combination scheme to an anti-correlation signal channel combination scheme.
[0098] In some possible implementations, when it is determined that the decoding mode of the current frame is the switching mode from anti-correlation to correlation signal decoding, the method may further include performing a time-domain upmixing process on the decoded primary and secondary channel signals in the current frame by using a time-domain upmixing process method corresponding to the switching mode from anti-correlation to correlation signal decoding to obtain the reconstructed left and right channel signals in the current frame. The time-domain upmixing process method corresponding to the switching mode from anti-correlation to correlation signal decoding is a time-domain upmixing process method corresponding to the transition from an anti-correlation signal channel combination scheme to a correlation signal channel combination scheme.
[0099] It can be understood that the time-domain upmixing process methods corresponding to different decoding modes are usually different. In addition, each decoding mode may correspond to one or more time-domain upmixing process methods.
[0100] For example, in some possible implementations, in order to obtain the reconstructed left and right channel signals in the current frame, by using a time-domain upmix processing method corresponding to the anti-correlation signal decoding mode, the step of performing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame is The step of performing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame in order to obtain the reconstructed left and right channel signals in the current frame, or the step of performing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame in order to obtain the reconstructed left and right channel signals in the current frame is included.
[0101] In some possible implementations, based on the channel combination ratio coefficient of the audio frame, a corresponding upmix matrix can be constructed, and in order to obtain the reconstructed left and right channel signals in the current frame, by using the upmix matrix corresponding to the channel combination scheme, time-domain upmix processing is performed on the decoded primary and secondary channel signals in the current frame.
[0102] For example, when time-domain upmix processing is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame in order to obtain the reconstructed left and right channel signals in the current frame
[0103]
Number
[0104] is.
[0105] For another example, in order to obtain the reconstructed left and right channel signals in the current frame, based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame, when time-domain upmixing processing is performed on the decoded primary and secondary channel signals in the current frame, if 0 ≦ n < N-upmixing_delay,
[0106]
Number
[0107] is, or if N-upmixing_delay ≦ n < N,
[0108]
Number
[0109] is, where delay_com indicates encoding delay compensation.
[0110] For another example, in order to obtain the reconstructed left and right channel signals in the current frame, when time-domain upmixing processing is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficients of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficients of the anti-correlation signal channel combination scheme for the previous frame, If 0 ≦ n < N-upmixing_delay,
[0111]
Number
[0112] where If N-upmixing_delay ≦ n < N-upmixing_delay + NOVA_1,
[0113]
Number
[0114] where or If N-upmixing_delay + NOVA_1 ≦ n < N,
[0115]
Number
[0116] where.
[0117] In this specification,
[0118]
Number
[0119] represents the reconfiguration left channel signal obtained in the current frame,
[0120]
Number
[0121] represents the reconstructed right channel signal in the current frame,
[0122]
Number
[0123] represents the decoded primary channel signal in the current frame,
[0124]
Number
[0125] represents the decoded secondary channel signal in the current frame.
[0126] In this specification, NOVA_1 represents the transition processing length.
[0127] In this specification, fade_in(n) represents the fade-in coefficient. For example,
[0128]
Number
[0129] and of course, fade_in(n) may be, or alternatively, a fade-in coefficient of another functional relationship based on n.
[0130] In this specification, fade_out(n) represents the fade-out coefficient. For example,
[0131]
Number
[0132] That is, of course, fade_out(n) may be, or may be another functional relationship fade-out coefficient based on n.
[0133] In this specification, NOVA_1 indicates the transition processing length. The value of NOVA_1 may be set based on specific scenario requirements. For example, NOVA_1 may be equal to 3 / N, or NOVA_1 may be another value smaller than N.
[0134] For another example, in order to obtain the reconstructed left and right channel signals in the current frame, when time-domain upmix processing is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficient of the correlation signal channel combination scheme for the current frame,
[0135]
Number
[0136] is.
[0137] In the above example,
[0138]
Number
[0139] indicates the reconfiguration left channel signal obtained in the current frame,
[0140]
Number
[0141] indicates the reconstructed right channel signal in the current frame,
[0142]
Number
[0143] indicates the decoded primary channel signal in the current frame,
[0144]
Number
[0145] indicates the decoded secondary channel signal in the current frame.
[0146] In the above example, n indicates the number of sampling points. For example, n = 0, 1,..., N - 1.
[0147] In the above example, upmixing_delay indicates decoding delay compensation.
[0148]
Number
[0149] indicates an upmix matrix corresponding to a correlation signal channel combination scheme for the previous frame,
[0150]
Number
[0151] is constructed based on the channel combination ratio coefficients corresponding to the correlation signal channel combination scheme for the previous frame.
[0152]
Number
[0153] shows an upmix matrix corresponding to an anti-correlation signal channel combination scheme for the current frame,
[0154]
Number
[0155] is constructed based on channel combination ratio coefficients corresponding to an anti-correlation signal channel combination scheme for the current frame.
[0156]
Number
[0157] shows an upmix matrix corresponding to an anti-correlation signal channel combination scheme for the previous frame,
[0158]
Number
[0159] is constructed based on channel combination ratio coefficients corresponding to an anti-correlation signal channel combination scheme for the previous frame.
[0160]
Number
[0161] shows an upmix matrix corresponding to a correlation signal channel combination scheme for the current frame,
[0162]
Number
[0163] is constructed based on channel combination ratio coefficients corresponding to a correlation signal channel combination scheme for the current frame.
[0164]
Number
[0165] is of multiple forms, for example,
[0166]
Number
[0167] or
[0168]
Number
[0169] or
[0170]
Number
[0171] or
[0172]
Number
[0173] or
[0174]
Number
[0175] or
[0176]
Number
[0177] may have.
[0178] In this specification, α1 = ratio_SM, α2 = 1 - ratio_SM, and ratio_SM represents the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0179] In this specification,
[0180]
Number
[0181] is of multiple forms, for example,
[0182]
Number
[0183] or
[0184]
Number
[0185] or
[0186]
Number
[0187] or
[0188]
Number
[0189] or
[0190]
Number
[0191] or
[0192]
Number
[0193] may have.
[0194] In this specification, α 1_pre = tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM.
[0195] In this specification, tdm_last_ratio_SM indicates the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame.
[0196] In this specification,
[0197]
Number
[0198] is of multiple forms, for example,
[0199]
Number
[0200] or
[0201]
Number
[0202] may have.
[0203] In this specification, ratio indicates the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0204] According to a third aspect, an embodiment of the present application further provides a time-domain stereo encoding device, which may include a processor and a memory coupled to each other. The processor may be configured to execute some or all of the steps of any of the stereo encoding methods in the first aspect.
[0205] According to a fourth aspect, an embodiment of the present application further provides a time-domain stereo decoding device, which may include a processor and a memory coupled to each other. The processor may be configured to execute some or all of the steps of any of the stereo encoding methods in the second aspect.
[0206] According to a fifth aspect, an embodiment of the present application provides a time-domain stereo encoding device including some functional units configured to implement any of the methods in the first aspect.
[0207] According to a sixth aspect, an embodiment of the present application provides a time-domain stereo decoding device including some functional units configured to implement any of the methods in the second aspect.
[0208] According to a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores program code, and the program code includes instructions used to execute some or all of the steps of any of the methods in the first aspect.
[0209] According to an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores program code, and the program code includes instructions used to execute some or all of the steps of any of the methods in the second aspect.
[0210] According to a ninth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute some or all of the steps of any of the methods in the first aspect.
[0211] According to a tenth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute some or all of the steps of any of the methods in the second aspect.
Brief Description of the Drawings
[0212] The attached drawings required to explain the embodiments or background of the present application are described below.
[0213]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9-A
Figure 9-B
Figure 9-C
Figure 9-D
Figure 10
Figure 11-A
Figure 11-B
Figure 11-C
Figure 12-A
Figure 12-B
Figure 12-C
Mode for Carrying Out the Invention
[0214] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application.
[0215] As used in the specification, claims, and appended drawings of this application, the terms "comprising", "having", and any other variations thereof are intended to include non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units is not limited to the listed steps or units, and may optionally further include steps or units not listed, or may optionally further include other specific steps or units of the process, method, product, or device. In addition, terms such as "first", "second", "third", and "fourth" are used to distinguish objects rather than to describe a specific order.
[0216] It should be noted that for the sake of simplicity in the description, since the solutions of the embodiments of this application are specific to the time-domain scenario, the time-domain signal may sometimes be simply referred to as the "signal" for brevity. For example, the left-channel time-domain signal may sometimes be simply referred to as the "left-channel signal". For another example, the right-channel time-domain signal may sometimes be simply referred to as the "right-channel signal". For another example, the monaural time-domain signal may sometimes be simply referred to as the "monaural signal". For another example, the reference-channel time-domain signal may sometimes be simply referred to as the "reference-channel signal". For another example, the primary-channel time-domain signal may sometimes be simply referred to as the "primary-channel signal". The secondary-channel time-domain signal may sometimes be simply referred to as the "secondary-channel signal". For another example, the mid-channel time-domain signal may sometimes be simply referred to as the "mid-channel signal". For another example, the side-channel time-domain signal may sometimes be simply referred to as the "side-channel signal". Other cases can be inferred by analogy.
[0217] In an embodiment of the present application, it should be noted that the left-channel time-domain signal and the right-channel time-domain signal may be collectively referred to as the "left and right channel time-domain signals", or may be collectively referred to as the "left and right channel signals". In other words, the left and right channel time-domain signals include the left-channel time-domain signal and the right-channel time-domain signal. For another example, the left and right channel time-domain signals subjected to delay alignment processing in the current frame include the left-channel time-domain signal subjected to delay alignment processing in the current frame and the right-channel time-domain signal subjected to delay alignment processing in the current frame. Similarly, the primary channel signal and the secondary channel signal may be collectively referred to as the "primary and secondary channel signals". In other words, the primary and secondary channel signals include the primary channel signal and the secondary channel signal. For another example, the decoded primary and secondary channel signals include the decoded primary channel signal and the decoded secondary channel signal. For another example, the reconstructed left and right channel time-domain signals include the left-channel reconstruction signal and the right-channel reconstruction signal. The rest can be inferred by analogy.
[0218] For example, in the conventional MS encoding technology, in order to obtain the Mid channel signal and the Side channel signal, the left and right channel signals are first downmixed. For example, L represents the left channel signal and R represents the right channel signal. In this case, the Mid channel signal is 0.5×(L + R), the Mid channel signal indicates information about the correlation between the left and right channels, the Side channel signal is 0.5×(L - R), and the Side channel signal indicates information about the difference between the left and right channels. Then, the Mid channel signal and the Side channel signal are encoded separately by using a monaural encoding method. The Mid channel signal is usually encoded by using a larger number of bits, and the Side channel signal is usually encoded by using a smaller number of bits.
[0219] Furthermore, in some solutions, in order to improve the encoding quality, in the time-domain downmixing process, the left and right channel time-domain signals are analyzed to extract the time-domain stereo parameters used to indicate the ratio of the left channel to the right channel. The purpose of the proposed method is as follows: that is, when the energy difference between the stereo left and right channel signals is relatively large, in the time-domain downmixed signal, the energy of the primary channel can be increased, and the energy of the secondary channel can be decreased. For example, L represents the left channel signal and R represents the right channel signal. In this case, the Primary channel signal is denoted as Y, and Y = alpha×L + beta×R. Y indicates information about the correlation between the two channels, and the Secondary channel signalIt is denoted as X, and X = alpha × L - beta × R. X represents information about the difference between two channels. In this specification, alpha and beta are real numbers from 0 to 1.
[0220] FIG. 1 shows the amplitude changes of the left channel signal and the right channel signal. At an instant in the time domain, the absolute value of the amplitude of the sampling point of the left channel signal at a specific 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 signal close to a typical anti-phase. FIG. 1 simply shows a typical example of a signal close to anti-phase. In fact, a signal close to anti-phase is a stereo signal where the phase difference between the left and right channel signals is approximately 180°. For example, a stereo signal where the phase difference between the left and right channel signals is included within [180 - θ, 180 + θ] may be called a signal close to anti-phase, and θ may be any angle between 0° and 90°. For example, θ may be equal to an angle of 0°, 5°, 15°, 17°, 20°, 30°, or 40°.
[0221] Similarly, a signal close to in-phase is a stereo signal where the phase difference between the left and right channel signals is approximately 0 degrees. For example, a stereo signal where the phase difference between the left and right channel signals is included within [-θ, θ] may be called a signal close to in-phase. θ may be any angle between 0° and 90°. For example, θ may be equal to an angle of 0°, 5°, 15°, 17°, 20°, 30°, or 40°.
[0222] When the left and right channel signals are signals that are close to being in phase, the energy of the primary channel signal generated through time-domain downmix processing is usually significantly greater than the energy of the secondary channel signal. If the primary channel signal is encoded by using a larger number of bits and the secondary channel signal is encoded by using a smaller number of bits, a better encoding effect can be obtained. However, when the left and right channel signals are signals that are close to being in antiphase and the same time-domain downmix processing method is used, the energy of the generated primary channel signal may be very small or even lost, resulting in a degradation of the final encoding quality.
[0223] In the following, several technical solutions that can help improve stereo encoding and decoding quality will be described.
[0224] The encoding device and the decoding device described in the embodiments of the present application can be devices having functions such as collection, storage, and transmission to the outside of audio signals. Specifically, the encoding device and the decoding device can be, for example, a mobile phone, a server, a tablet computer, a personal computer, or a notebook computer.
[0225] In the solution of this application, it can be understood that the left and right channel signals are the left and right channel signals of the stereo signal. The stereo signal can be the original stereo signal, or a stereo signal including two channels of signals in the multi-channel signal, or a stereo signal including two channels of signals jointly generated by a plurality of channels of signals in the multi-channel signal. The stereo encoding method can also be the stereo encoding method used in multi-channel encoding. The stereo encoding device can also be the stereo encoding device used in the multi-channel encoding device. The stereo decoding method can also be the stereo decoding method used in multi-channel decoding. The stereo decoding device can also be the stereo decoding device used in the multi-channel decoding device. The audio encoding method in the embodiment of this application is, for example, specific to the stereo encoding scenario, and the audio decoding method in the embodiment of this application is, for example, specific to the stereo decoding scenario.
[0226] In the following, first, a method for determining the audio encoding mode is provided. The method may include a step of determining a channel combination scheme for the current frame, and a step of determining the encoding mode of the current frame based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame.
[0227] FIG. 2 is a schematic flowchart of an audio encoding method according to an embodiment of this application. The related steps of the audio encoding method can be implemented by an encoding device and may include, for example, the following steps.
[0228] 201. Determine a channel combination scheme for the current frame.
[0229] The channel combination scheme for the current frame is one of a plurality of channel combination schemes. For example, the plurality of channel combination schemes include an anticorrelated signal Channel Combination Scheme and a correlated signal Channel Combination Scheme. The correlated signal channel combination scheme is a channel combination scheme corresponding to signals that are close to being in-phase. The anticorrelated signal channel combination scheme is a channel combination scheme corresponding to signals that are close to being in antiphase. It can be understood that the channel combination scheme corresponding to signals that are close to being in-phase is applicable to signals that are close to being in-phase, and the channel combination scheme corresponding to signals that are close to being in antiphase is applicable to signals that are close to being in antiphase.
[0230] 202. Determine the coding mode of the current frame based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame.
[0231] In addition, if the current frame is the first frame (i.e., there is no previous frame for the current frame), the coding mode of the current frame can be determined based on the channel combination scheme for the current frame. Alternatively, a default coding mode can be used as the coding mode of the current frame.
[0232] 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 correlated-to-anticorrelated signal coding switching mode, an anticorrelated-to-correlated signal coding switching mode, a correlated signal coding mode, and an anticorrelated signal coding mode, etc.
[0233] The time-domain downmix mode corresponding to the correlated-to-anticorrelated signal coding switching mode may be called, for example, "correlated-to-anticorrelated signal downmix switching mode". The time-domain downmix mode corresponding to the anticorrelated-to-correlated signal coding switching mode may be called, for example, "anticorrelated-to-correlated signal downmix switching mode". The time-domain downmix mode corresponding to the correlated signal coding mode may be called, for example, "correlated signal downmix mode". The time-domain downmix mode corresponding to the anticorrelated signal coding mode may be called, for example, "anticorrelated signal downmix mode".
[0234] In this embodiment of the present application, for names of objects such as coding mode, decoding mode, and channel combination scheme, all are examples, and it can be understood that in actual applications, other names may also be used.
[0235] 203. To obtain the primary and secondary channel signals in the current frame, based on the time-domain downmixing process corresponding to the coding mode of the current frame, perform the time-domain downmixing process on the left and right channel signals in the current frame.
[0236] To obtain the primary and secondary channel signals in the current frame, the time-domain downmixing process can be performed on the left and right channel signals in the current frame, and the primary and secondary channel signals are further encoded to obtain a bitstream. Further, the channel combination scheme flag of the current frame (the channel combination scheme flag of the current frame is used to indicate the channel combination scheme for the current frame) can be written into the bitstream, and the decoding device is made to determine the channel combination scheme for the current frame based on the channel combination scheme flag of the current frame included in the bitstream.
[0237] Based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame, various specific implementations may exist for determining the coding mode of the current frame.
[0238] Specifically, for example, in some possible implementations, determining the coding mode of the current frame based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame is When the channel combination scheme for the previous frame is the correlation signal channel combination scheme and the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, it is determined that the coding mode of the current frame is the switching mode from correlation to anti-correlation signal coding. In the switching mode from correlation to anti-correlation signal coding, time-domain downmix processing is performed by using a downmix processing method corresponding to the transition from the correlation signal channel combination scheme to the anti-correlation signal channel combination scheme, or When the channel combination scheme for the previous frame is the anti-correlation signal channel combination scheme and the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, it is determined that the coding mode of the current frame is the anti-correlation signal coding mode. In the anti-correlation signal coding mode, time-domain downmix processing is performed by using a downmix processing method corresponding to the anti-correlation signal channel combination scheme, or When the channel combination scheme for the previous frame is an anti-correlation signal channel combination scheme and the channel combination scheme for the current frame is a correlation signal channel combination scheme, it is determined that the coding mode of the current frame is a switching mode from anti-correlation to correlation signal coding. In the switching mode from anti-correlation to correlation signal coding, time-domain downmix processing is performed by using a downmix processing method corresponding to the transition from the anti-correlation signal channel combination scheme to the correlation signal channel combination scheme. The time-domain downmix processing method corresponding to the switching mode from anti-correlation to correlation signal coding may specifically be a segmented time-domain downmix method, that is, based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame, performing, determining, or When the channel combination scheme for the previous frame is a correlation signal channel combination scheme and the channel combination scheme for the current frame is a correlation signal channel combination scheme, it is determined that the coding mode of the current frame is a correlation signal coding mode. In the correlation signal coding mode, time-domain downmix processing is performed by using a downmix processing method corresponding to the correlation signal channel combination scheme. may be included.
[0239] It can be understood that the time-domain downmix processing methods corresponding to different coding modes are usually different. In addition, each coding mode may correspond to one or more time-domain downmix processing methods.
[0240] For example, in some possible implementations, when the coding mode of the current frame is the correlation signal coding mode aAt this time, in order to obtain the primary and secondary channel signals in the current frame, by using a time-domain downmix processing method corresponding to the correlation signal coding mode, time-domain downmix processing is performed on the left and right channel signals in the current frame. The time-domain downmix processing method corresponding to the correlation signal coding mode is a time-domain downmix processing method corresponding to the correlation signal channel combination scheme.
[0241] For another example, in some possible implementations, when it is determined that the coding mode of the current frame is the anti-correlation signal coding mode, in order to obtain the primary and secondary channel signals in the current frame, by using a time-domain downmix processing method corresponding to the anti-correlation signal coding mode, time-domain downmix processing is performed on the left and right channel signals in the current frame. The time-domain downmix processing method corresponding to the anti-correlation signal coding mode is a time-domain downmix processing method corresponding to the anti-correlation signal channel combination scheme.
[0242] For another example, in some possible implementations, when it is determined that the coding mode of the current frame is the switching mode from correlation to anti-correlation signal coding, in order to obtain the primary and secondary channel signals in the current frame, by using a time-domain downmix processing method corresponding to the switching mode from correlation to anti-correlation signal coding, time-domain downmix processing is performed on the left and right channel signals in the current frame. The time-domain downmix processing method corresponding to the switching mode from correlation to anti-correlation signal coding is a time-domain downmix processing method corresponding to the transition from a correlation signal channel combination scheme to an anti-correlation signal channel combination scheme. The time-domain downmix processing method corresponding to the switching mode from correlation to anti-correlation signal coding may specifically be a segmented time-domain downmix method, that is, based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame, segmented time-domain downmix processing is performed on the left and right channel signals in the current frame.
[0243] For another example, in some possible implementations, when it is determined that the coding mode of the current frame is the switching mode from anti-correlation to correlation signal coding, in order to obtain the primary and secondary channel signals in the current frame, by using a time-domain downmix processing method corresponding to the switching mode from anti-correlation to correlation signal coding, time-domain downmix processing is performed on the left and right channel signals in the current frame. The time-domain downmix processing method corresponding to the switching mode from anti-correlation to correlation signal coding is a time-domain downmix processing method corresponding to the transition from an anti-correlation signal channel combination scheme to a correlation signal channel combination scheme.
[0244] Time-domain downmix processing methods corresponding to different coding modes are usually understood to be different. In addition, each coding mode may correspond to one or more time-domain downmix processing methods.
[0245] For example, in some possible implementations, to obtain the primary and secondary channel signals in the current frame, by using the time-domain downmix processing method corresponding to the anti-correlation signal coding mode, performing time-domain downmix processing on the left and right channel signals in the current frame may include performing time-domain downmix processing on the left and right channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame, or performing time-domain downmix processing on the left and right channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame.
[0246] In the above solution, the channel combination scheme for the current frame needs to be determined, which indicates that there are multiple possibilities for the channel combination scheme for the current frame. It can be understood that compared with the conventional solution with only one channel combination scheme, this solution with multiple possible channel combination schemes is more compatible and can be coordinated with multiple possible scenarios. In the above solution, the coding mode of the current frame needs to be determined based on the channel combination scheme for the previous frame and the channel combination scheme for 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, this solution with multiple possible coding modes is more compatible and can be coordinated with multiple possible scenarios.
[0247] Specifically, for example, if the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame, the coding mode of the current frame can be determined to be, for example, a switching mode from correlation to anti-correlation signal coding, or a switching mode from anti-correlation to correlation signal coding. In this case, based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame, segmented time-domain downmix processing can be performed on the left and right channel signals in the current frame.
[0248] When the channel combination scheme for the current frame and the channel combination scheme for the previous frame are different, a mechanism is introduced that performs segmented time-domain downmix processing on the left and right channel signals in the current frame. The segmented time-domain downmix processing mechanism helps to implement a smooth transition of the channel combination scheme and further helps to improve the encoding quality.
[0249] Correspondingly, hereinafter, a time-domain stereo decoding scenario will be described by using an example.
[0250] Referring to FIG. 3, hereinafter, a method for determining an audio decoding mode will be provided. The related steps of the method for determining the audio decoding mode can be implemented by a decoding device, and the method may specifically include the following steps.
[0251] 301. Determine the channel combination scheme for the current frame based on the channel combination scheme flag of the current frame in the bitstream.
[0252] 302. Determine the decoding mode of the current frame based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame.
[0253] 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 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, and the like.
[0254] The time-domain upmix mode corresponding to the correlated-to-anticorrelated signal decoding switching mode may be referred to as, for example, a "correlated-to-anticorrelated signal upmix switching mode". The time-domain upmix mode corresponding to the anticorrelated-to-correlated signal decoding switching mode may be referred to as, for example, an "anticorrelated-to-correlated signal upmix switching mode". The time-domain upmix mode corresponding to the correlated signal decoding mode may be referred to as, for example, a "correlated signal upmix mode". The time-domain upmix mode corresponding to the anticorrelated signal decoding mode may be referred to as, for example, an "anticorrelated signal upmix mode".
[0255] In this embodiment of the present application, it can be understood that the names of objects such as the coding mode, decoding mode, and channel combination scheme are all examples, and in actual applications, other names may also be used.
[0256] In some possible implementations, determining the decoding mode of the current frame based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame When the channel combination scheme for the previous frame is the correlation signal channel combination scheme and the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, the decoding mode of the current frame is determined to be the switching mode from correlation to anti-correlation signal decoding. In the switching mode from correlation to anti-correlation signal decoding, time-domain upmix processing is performed by using an upmix processing method corresponding to the transition from the correlation signal channel combination scheme to the anti-correlation signal channel combination scheme, or When the channel combination scheme for the previous frame is the anti-correlation signal channel combination scheme and the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, the decoding mode of the current frame is determined to be the anti-correlation signal decoding mode. In the anti-correlation signal decoding mode, time-domain upmix processing is performed by using an upmix processing method corresponding to the anti-correlation signal channel combination scheme, or When the channel combination scheme for the previous frame is an anti-correlation signal channel combination scheme and the channel combination scheme for the current frame is a correlation signal channel combination scheme, it is determined that the decoding mode of the current frame is a switching mode from anti-correlation to correlation signal decoding. In the switching mode from anti-correlation to correlation signal decoding, time-domain upmix processing is executed by using an upmix processing method corresponding to the transition from the anti-correlation signal channel combination scheme to the correlation signal channel combination scheme, or When the channel combination scheme for the previous frame is a correlation signal channel combination scheme and the channel combination scheme for the current frame is a correlation signal channel combination scheme, it is determined that the decoding mode of the current frame is a correlation signal decoding mode. In the correlation signal decoding mode, time-domain upmix processing is executed by using an upmix processing method corresponding to the correlation signal channel combination scheme. Including.
[0257] For example, when it is determined that the decoding mode of the current frame is an anti-correlation signal decoding mode, the decoding device executes time-domain upmix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain upmix processing method corresponding to the anti-correlation signal decoding mode in order to obtain the reconstructed left and right channel signals in the current frame.
[0258] The reconstructed left and right channel signals may be the decoded left and right channel signals, or delay adjustment processing and / or time-domain post-processing may be executed on the reconstructed left and right channel signals in order to obtain the decoded left and right channel signals.
[0259] The time-domain upmix processing method corresponding to the anti-correlation signal decoding mode is a time-domain upmix processing method corresponding to the anti-correlation signal channel combination scheme, and the anti-correlation signal channel combination scheme is a channel combination scheme corresponding to signals close to the opposite phase.
[0260] The decoding mode of the current frame is one of a plurality of decoding modes. For example, the decoding mode of the current frame can be one of the following decoding modes, namely, the correlation signal decoding mode, the anti-correlation signal decoding mode, the switching mode from correlation to anti-correlation signal decoding, and the switching mode from anti-correlation to correlation signal decoding.
[0261] In the above solution, the decoding mode of the current frame needs to be determined, which can be understood as indicating that there are multiple possibilities for the decoding mode of the current frame. Compared with the conventional solution with only one decoding mode, this solution with multiple possible decoding modes is more compatible and can be coordinated with multiple possible scenarios. In addition, since a channel combination scheme corresponding to signals close to the opposite phase is introduced, when the stereo signal in the current frame is a signal close to the opposite phase, a more target-oriented channel combination scheme and decoding mode exist, which helps to improve the decoding quality.
[0262] For another example, when it is determined that the decoding mode of the current frame is the correlation signal decoding mode, the decoding apparatus executes time-domain upmix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain upmix processing method corresponding to the correlation signal decoding mode in order to obtain the reconstructed left and right channel signals in the current frame. The time-domain upmix processing method corresponding to the correlation signal decoding mode is a time-domain upmix processing method corresponding to a correlation signal channel combination scheme, and the correlation signal channel combination scheme is a channel combination scheme corresponding to signals that are close to being in phase.
[0263] For another example, when it is determined that the decoding mode of the current frame is the switching mode from correlation to anti-correlation signal decoding, the decoding apparatus executes time-domain upmix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain upmix processing method corresponding to the switching mode from correlation to anti-correlation signal decoding in order to obtain the reconstructed left and right channel signals in the current frame. The time-domain upmix processing method corresponding to the switching mode from correlation to anti-correlation signal decoding is a time-domain upmix processing method corresponding to the transition from a correlation signal channel combination scheme to an anti-correlation signal channel combination scheme.
[0264] For another example, when it is determined that the decoding mode of the current frame is the switching mode from anti-correlation to correlation signal decoding, the decoding apparatus executes time-domain upmix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain upmix processing method corresponding to the switching mode from anti-correlation to correlation signal decoding in order to obtain the reconstructed left and right channel signals in the current frame. The time-domain upmix processing method corresponding to the switching mode from anti-correlation to correlation signal decoding is a time-domain upmix processing method corresponding to the transition from an anti-correlation signal channel combination scheme to a correlation signal channel combination scheme.
[0265] It can be understood that time-domain upmix processing methods corresponding to different decoding modes are usually different. In addition, each decoding mode may correspond to one or more time-domain upmix processing methods.
[0266] In the above solution, it is necessary to determine the channel combination scheme for the current frame, and it can be understood that this indicates that there are multiple possibilities for the channel combination scheme for the current frame. Compared with the conventional solution with only one channel combination scheme, this solution with multiple possible channel combination schemes is more compatible and can be coordinated with multiple possible scenarios. In the above solution, the decoding mode of the current frame needs to be determined based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame, and there are multiple possibilities for the decoding mode of the current frame. Compared with the conventional solution with only one decoding mode, this solution with multiple possible decoding modes is more compatible and can be coordinated with multiple possible scenarios.
[0267] Furthermore, in order to obtain the reconstructed left and right channel signals in the current frame, the decoding device performs a time-domain upmixing process on the decoded primary and secondary channel signals in the current frame based on the time-domain upmixing process corresponding to the decoding mode of the current frame.
[0268] Hereinafter, several specific implementations for determining the channel combination scheme for the current frame by the encoding device will be described using examples. There are various specific implementations for determining the channel combination scheme for the current frame by the encoding device.
[0269] For example, in some possible implementations, determining the channel combination scheme for the current frame may include performing at least once a determination of the channel combination scheme for the current frame in order to determine the channel combination scheme for the current frame.
[0270] Specifically, for example, determining the channel combination scheme for the current frame includes performing a determination of the initial channel combination scheme for the current frame in order to determine the initial channel combination scheme for the current frame, and performing a determination of modifying the channel combination scheme for the current frame based on the initial channel combination scheme for the current frame in order to determine the channel combination scheme for the current frame. In addition, the initial channel combination scheme for the current frame may also be directly used as the channel combination scheme for the current frame. In other words, the channel combination scheme for the current frame may be the initial channel combination scheme for the current frame determined after the determination of the initial channel combination scheme for the current frame has been performed.
[0271] For example, performing an initial channel combination scheme determination for the current frame may include determining the in-phase / anti-phase signal type of the stereo signal in the current frame by using the left and right channel signals in the current frame, and determining the initial channel combination scheme for the current frame based on the in-phase / anti-phase signal type of the stereo signal in the current frame and the channel combination scheme for the previous frame. The in-phase / anti-phase signal type of the stereo signal in the current frame may be a signal close to in-phase or a signal close to anti-phase. The in-phase / anti-phase signal type of the stereo signal in the current frame may be indicated by the in-phase / anti-phase signal type flag of the current frame (for example, the in-phase / anti-phase signal type flag is represented by tmp_SM_flag). Specifically, for example, when the value of the in-phase / anti-phase signal type flag of the current frame is "1", it indicates that the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to in-phase, or when the value of the in-phase / anti-phase signal type flag of the current frame is "0", it indicates that the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to anti-phase, or vice versa.
[0272] The channel combination scheme for an audio frame (for example, the previous frame or the current frame) may be indicated by the channel combination scheme flag of the audio frame. For example, when the value of the channel combination scheme flag of the audio frame is "0", it indicates that the channel combination scheme for the audio frame is a correlated signal channel combination scheme, or when the value of the channel combination scheme flag of the audio frame is "1", it indicates that the channel combination scheme for the audio frame is an anti-correlated signal channel combination scheme, or vice versa.
[0273] Similarly, an initial channel combination scheme for an audio frame (e.g., a previous frame or a current frame) can be indicated by an initial channel combination scheme flag for the audio frame (e.g., the initial channel combination scheme flag is represented by tdm_SM_flag_loc). For example, when the value of the initial channel combination scheme flag for the audio frame is "0", it indicates that the initial channel combination scheme for the audio frame is the correlated signal channel combination scheme, or, for another example, when the value of the initial channel combination scheme flag for the audio frame is "1", it indicates that the initial channel combination scheme for the audio frame is the anti-correlated signal channel combination scheme, or vice versa.
[0274] Determining the in-phase / anti-phase signal type of the stereo signal in the current frame by using the left and right channel signals in the current frame may include calculating a correlation value xorr between the left and right channel signals in the current frame, and when xorr is less than or equal to a first threshold, determining that the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to in-phase, or when xorr is greater than the first threshold, determining that the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to anti-phase. Further, in order to indicate the in-phase / anti-phase signal type of the stereo signal in the current frame, when an in-phase / anti-phase signal type flag of the current frame is used, when it is determined that the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to in-phase, the value of the in-phase / anti-phase signal type flag of the current frame can be set to indicate that the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to in-phase, or when the in-phase / anti-phase signal type of the stereo signal in the current frame is inverseWhen it is determined that the signal is close to in-phase, the value of the in-phase / anti-phase signal type flag for the current frame can be set to indicate that the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to anti-phase.
[0275] The value range of the first threshold can be, for example, (0.5, 1.0), and the first threshold can be equal to, for example, 0.5, 0.85, 0.75, 0.65, or 0.81.
[0276] Specifically, for example, when the value of the in-phase / anti-phase signal type flag of an audio frame (e.g., a previous frame or the current frame) is "0", it indicates that the in-phase / anti-phase signal type of the stereo signal of the audio frame is a signal close to in-phase, or when the value of the in-phase / anti-phase signal type flag of the audio frame (e.g., a previous frame or the current frame) is "1", it indicates that the in-phase / anti-phase signal type of the stereo signal of the audio frame is a signal close to anti-phase, or vice versa.
[0277] For example, determining the initial channel combination scheme for the current frame based on the in-phase / anti-phase signal type of the stereo signal in the current frame and the channel combination scheme for the previous frame When the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to in-phase and the channel combination scheme for the previous frame is a correlated signal channel combination scheme, determining that the initial channel combination scheme for the current frame is a correlated signal channel combination scheme, or when the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to anti-phase and the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme, determining that the initial channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, or When the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to in-phase and the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme, if the signal-to-noise ratios of the left and right channel signals in the current frame are both smaller than a second threshold, determine that the initial channel combination scheme for the current frame is a correlated signal channel combination 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 in the current frame is greater than or equal to the second threshold, determine that the initial channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, or When the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to anti-phase and the channel combination scheme for the previous frame is a correlated signal channel combination scheme, if the signal-to-noise ratios of the left and right channel signals in the current frame are both smaller than a second threshold, determine that the initial channel combination scheme for the current frame is an anti-correlated signal channel combination 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 in the current frame is greater than or equal to the second threshold, determine that the initial channel combination scheme for the current frame is a correlated signal channel combination scheme may be included.
[0278] The value range of the second threshold may be, for example, [0.8, 1.2], and the second threshold may be equal to, for example, 0.8, 0.85, 0.9, 1, 1.1, or 1.18.
[0279] Based on the initial channel combination scheme for the current frame, performing a determination of modifying the channel combination scheme for the current frame may include determining the channel combination scheme for the current frame based on the channel combination ratio coefficient modification flag of the previous frame, the in-phase / anti-phase signal type of the stereo signal in the current frame, and the initial channel combination scheme for the current frame.
[0280] The channel combination scheme flag for the current frame may be denoted as tdm_SM_flag, and the channel combination ratio coefficient modification flag for the current frame is denoted as tdm_SM_modi_flag. For example, when the value of the channel combination ratio coefficient modification flag is 0, it indicates that the channel combination ratio coefficient does not need to be modified, or when the value of the channel combination ratio coefficient modification flag is 1, it indicates that the channel combination ratio coefficient needs to be modified. Of course, other different values may be used as the channel combination ratio coefficient modification flag to indicate whether the channel combination ratio coefficient needs to be modified.
[0281] Specifically, for example, based on the result of the determination of the initial channel combination scheme for the current frame, performing a determination of modifying the channel combination scheme for the current frame is when the channel combination ratio coefficient modification flag of the previous frame indicates that the channel combination ratio coefficient needs to be modified, using the anti-correlation signal channel combination scheme as the channel combination scheme for the current frame, or when the channel combination ratio coefficient modification flag of the previous frame indicates that the channel combination ratio coefficient does not need to be modified, determining whether the current frame meets the switching condition, and based on the result of the determination of whether the current frame meets the switching condition, determining the channel combination scheme for the current frame may be included.
[0282] Determining a channel combination scheme for the current frame based on the result of determining whether the current frame meets the switching condition is when the channel combination scheme for the previous frame is different from the initial channel combination scheme for the current frame, the current frame meets the switching condition, the initial channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, and the channel combination scheme for the previous frame is the correlation signal channel combination scheme, determining that the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, or when the channel combination scheme for the previous frame is different from the initial channel combination scheme for the current frame, the current frame meets the switching condition, the initial channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, the channel combination scheme for the previous frame is the correlation signal channel combination scheme, and the channel combination ratio coefficient of the previous frame is less than the first ratio coefficient threshold, determining that the channel combination scheme for the current frame is the correlation signal channel combination scheme, or when the channel combination scheme for the previous frame is different from the initial channel combination scheme for the current frame, the current frame meets the switching condition, the initial channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, the channel combination scheme for the previous frame is the correlation signal channel combination scheme, and the channel combination ratio coefficient of the previous frame is greater than or equal to the first ratio coefficient threshold, determining that the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, or The channel combination scheme for the (P - 1)th-to-current frame up to now is different from the initial channel combination scheme for the Pth-to-current frame up to now. The Pth-to-current frame up to now does not satisfy the switching condition, the current frame satisfies the switching condition, the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to in-phase, the initial channel combination scheme for the current frame is a correlation signal channel combination scheme, and the channel combination scheme for the previous frame is an anti-correlation signal channel combination scheme. When this is the case, determine that the channel combination scheme for the current frame is a correlation signal channel combination scheme, or The channel combination scheme for the (P - 1)th-to-current frame up to now is different from the initial channel combination scheme for the Pth-to-current frame up to now. The Pth-to-current frame up to now does not satisfy the switching condition, the current frame satisfies the switching condition, the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to anti-phase, the initial channel combination scheme for the current frame is an anti-correlation signal channel combination scheme, and the channel combination scheme for the previous frame is a correlation signal channel combination scheme. When the channel combination ratio coefficient of the previous frame is smaller than the second ratio coefficient threshold, determine that the channel combination scheme for the current frame is a correlation signal channel combination scheme, or The channel combination scheme for the (P-1)th frame up to now is different from the initial channel combination scheme for the Pth frame up to now. The Pth frame up to now does not satisfy the switching condition, the current frame satisfies the switching condition, the in-phase / anti-phase signal type of the stereo signal in the current frame is a signal close to the anti-phase, the initial channel combination scheme for the current frame is an anti-correlation signal channel combination scheme, the channel combination scheme for the previous frame is a correlation signal channel combination scheme, and when the channel combination ratio coefficient of the previous frame is greater than or equal to the second ratio coefficient threshold, it is determined that the channel combination scheme for the current frame is an anti-correlation signal channel combination scheme. may include.
[0283] In this specification, P can be an integer greater than 1. For example, P can be equal to 2, 3, 4, 5, 6, or another value.
[0284] The value range of the first ratio coefficient threshold can be, for example, [0.4, 0.6], and the first ratio coefficient threshold can be equal to, for example, 0.4, 0.45, 0.5, 0.55, or 0.6.
[0285] The value range of the second ratio coefficient threshold can be, for example, [0.4, 0.6], and the second ratio coefficient threshold can be equal to, for example, 0.4, 0.46, 0.5, 0.56, or 0.6.
[0286] 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 the frame type of the primary channel signal in the previous frame and / or the frame type of the secondary channel signal in the previous frame.
[0287] In some possible implementations, determining whether the current frame satisfies the switching condition is When all of the first condition, the second condition, and the third condition are satisfied, the current frame is determined to satisfy the switching condition, or when all of the second condition, the third condition, the fourth condition, and the fifth condition are satisfied, the current frame is determined to satisfy the switching condition, or when the sixth condition is satisfied, the current frame is determined to satisfy the switching condition may be included.
[0288] The first condition is that the frame type of the primary channel signal in the previous frame of the previous frame is one of the following, namely, a VOICED_CLAS frame (a frame having vocal characteristics following a voiced frame or a voiced start frame), an ONSET frame (a voiced start frame), a SIN_ONSET frame (a start frame in which harmonics and noise are mixed), an INACTIVE_CLAS frame (a frame having inactive characteristics), and an AUDIO_CLAS (an audio frame), and the frame type of the primary channel signal in the previous frame is a UNVOICED_CLAS frame (one of several characteristics, namely, a silent, inactive, noisy, or frame terminated by voice), or a VOICED_TRANSITION frame (a frame having a transition after a voiced sound, the frame having very weak vocal characteristics), or the frame type of the secondary channel signal in the previous frame of the previous frame is one of the following, namely, a VOICED_CLAS frame, an ONSET frame, a SIN_ONSET frame, an INACTIVE_CLAS frame, and an AUDIO_CLAS frame, and the frame type of the secondary channel signal in the previous frame is a UNVOICED_CLAS frame, or a VOICED_TRANSITION frame.
[0289] The second condition is that the raw coding modes of the primary channel signal and the secondary channel signal in the previous frame are both not VOICED (the coding type corresponding to the voiced frame).
[0290] The third condition is that the amount of consecutive frames before the previous frame that use the channel combination scheme used by the previous frame is greater than a preset frame amount threshold. The value range of the frame amount threshold can be, for example, [3, 10]. For example, the frame amount threshold may be equal to 3, 4, 5, 6, 7, 8, 9, or another value.
[0291] The fourth condition is that the frame type of the primary channel signal in the previous frame is UNVOICED_CLAS, or the frame type of the secondary channel signal in the previous frame is UNVOICED_CLAS.
[0292] The fifth condition is that the long-term root mean square energy values of the left and right channel signals in the current frame are smaller than the energy threshold. The value range of the energy threshold can be, for example, [300, 500]. For example, energy the threshold may be equal to 300, 400, 410, 451, 482, 500, 415, or another value.
[0293] The sixth condition is that the frame type of the primary channel signal in the previous frame is a music signal, the ratio of the energy of the lower frequency band to the energy of the higher frequency band of the primary channel signal in the previous frame is greater than the first energy ratio threshold, and the ratio of the energy of the lower frequency band to the energy of the higher frequency band of the secondary channel signal in the previous frame is greater than the second energy ratio threshold.
[0294] The range of the first energy ratio threshold can be, for example, [4000, 6000]. For example,the first energy ratio The threshold value may be equal to 4000, 4500, 5000, 5105, 5200, 6000, 5800, or another value.
[0295] The range of the second energy ratio threshold value may be, for example, [4000, 6000]. For example, the second energy ratio The threshold value may be equal to 4000, 4501, 5000, 5105, 5200, 6000, 5800, or another value.
[0296] There can be various implementations for determining whether the current frame meets the switching condition, but it can be understood that they are not limited to the methods given as examples above.
[0297] Some implementations for determining the channel combination scheme for the current frame are provided in the above examples, but it can be understood that the actual application may not be limited to the methods in the above examples.
[0298] Hereinafter, further, examples will be used to describe scenarios for the anti-correlation signal coding mode.
[0299] Referring to FIG. 4, an embodiment of the present application provides an audio encoding method. The related steps of the audio encoding method can be implemented by an encoding device, and the method may specifically include the following steps.
[0300] 401. Determine the coding mode of the current frame.
[0301] 402. When it is determined that the coding mode of the current frame is the anti-correlation signal coding mode, in order to obtain the primary and secondary channel signals in the current frame, perform time-domain downmix processing on the left and right channel signals in the current frame by using the time-domain downmix processing method corresponding to the anti-correlation signal coding mode.
[0302] 403. Encode the acquired primary and secondary channel signals in the current frame.
[0303] The time-domain downmix processing method corresponding to the anti-correlation signal coding mode is the time-domain downmix processing method corresponding to the anti-correlation signal channel combination scheme, and the anti-correlation signal channel combination scheme is the channel combination scheme corresponding to the signal close to the opposite phase.
[0304] For example, in some possible implementations, in order to obtain the primary and secondary channel signals in the current frame, by using the time-domain downmix processing method corresponding to the anti-correlation signal coding mode, performing time-domain downmix processing on the left and right channel signals in the current frame is to obtain the primary and secondary channel signals in the current frame, based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame, performing time-domain downmix processing on the left and right channel signals in the current frame, or in order to obtain the primary and secondary channel signals in the current frame, based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame, performing time-domain downmix processing on the left and right channel signals in the current frame may be included.
[0305] The channel combination scheme (e.g., anti-correlation signal channel combination scheme or correlationIt can be understood that the channel combination ratio coefficient of the signal channel combination scheme) can be a preset fixed value. Of course, the channel combination ratio coefficient of the audio frame may also be determined based on the channel combination scheme for the audio frame.
[0306] In some possible implementations, based on the channel combination ratio coefficient of the audio frame, the corresponding downmix matrix can be constructed, and in order to obtain the primary and secondary channel signals in the current frame, by using the downmix matrix corresponding to the channel combination scheme, time-domain downmix processing is performed on the left and right channel signals in the current frame.
[0307] For example, when time-domain downmix processing is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame in order to obtain the primary and secondary channel signals in the current frame,
[0308]
Number
[0309] it is.
[0310] For another example, when time-domain downmix processing is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame in order to obtain the primary and secondary channel signals in the current frame, when 0 ≦ n < N-delay_com,
[0311]
Number
[0312] or if N-delay_com ≦ n < N,
[0313]
Number
[0314] where delay_com indicates encoding delay compensation.
[0315] For another example, when time-domain downmix processing is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame to obtain the primary and secondary channel signals in the current frame, if 0 ≦ n < N-delay_com,
[0316]
Number
[0317] is if N-delay_com ≦ n < N-delay_com + NOVA_1,
[0318]
Number
[0319] or if N-delay_com + NOVA_1 ≦ n < N,
[0320] [Number]
[0321] is.
[0322] In this specification, fade_in(n) indicates the fade-in coefficient. For example,
[0323] [Number]
[0324] is. Of course, fade_in(n) may be, or may be, the fade-in coefficient of another functional relationship based on n.
[0325] fade_out(n) indicates the fade-out coefficient. For example,
[0326] [Number]
[0327] is. Of course, fade_out(n) may be, or may be, the fade-out coefficient of another functional relationship based on n.
[0328] NOVA_1 indicates the transition processing length. The value of NOVA_1 may be set based on specific scenario requirements. For example, NOVA_1 may be equal to 3 / N, or NOVA_1 may be another value smaller than N.
[0329] For another example, in order to obtain the primary and secondary channel signals in the current frame, when time-domain downmixing processing is performed on the left and right channel signals in the current frame by using a time-domain downmixing processing method corresponding to the correlation signal coding mode,
[0330] [Number]
[0331] is.
[0332] In the above example, X L (n) represents the left channel signal in the current frame, and X R (n) represents the right channel signal in the current frame. Y(n) represents the primary channel signal that is within the current frame and is obtained through time-domain downmix processing. X(n) represents the secondary channel signal that is within the current frame and is obtained through time-domain downmix processing.
[0333] In the above example, n represents the number of the sampling point. For example, n = 0, 1,..., N - 1.
[0334] In the above example, delay_com represents the encoding delay compensation.
[0335] M 11 represents the downmix matrix corresponding to the correlation signal channel combination scheme for the previous frame, and M 11 is constructed based on the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame.
[0336] M 12 represents the downmix matrix corresponding to the anti-correlation signal channel combination scheme for the previous frame, and M 12 is constructed based on the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame.
[0337] M 22 represents the downmix matrix corresponding to the anti-correlation signal channel combination scheme for the current frame, and M 22is constructed based on a channel combination ratio coefficient corresponding to an anti-correlation signal channel combination scheme for the current frame.
[0338] M 21 represents a downmix matrix corresponding to a correlation signal channel combination scheme for the current frame, and M 21 is constructed based on a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for the current frame.
[0339] M 21 has a plurality of formats, for example,
[0340]
Number
[0341] or
[0342]
Number
[0343] can have, and ratio indicates a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for the current frame.
[0344] M 22 has a plurality of formats, for example,
[0345]
Number
[0346] or
[0347]
Number
[0348] or
[0349]
Number
[0350] or
[0351]
Number
[0352] or
[0353]
Number
[0354] or
[0355]
Number
[0356] may have, α1 = ratio_SM, α2 = 1 - ratio_SM, where ratio_SM represents the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0357] M 12 is of multiple forms, for example,
[0358]
Number
[0359] or
[0360]
Number
[0361] or
[0362] [Number]
[0363] or
[0364] [Number]
[0365] or
[0366] [Number]
[0367] or
[0368] [Number]
[0369] may have, α 1_pre = tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM, where tdm_last_ratio_SM indicates the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame.
[0370] The left and right channel signals in the current frame may specifically be the original left and right channel signals in the current frame (the original left and right channel signals are the left and right channel signals that have not undergone time-domain preprocessing, and may be, for example, the left and right channel signals obtained through sampling), or the left and right channel signals in the current frame that have undergone time preprocessing, or the left and right channel signals in the current frame that have undergone delay alignment processing.
[0371] Specifically, for example,
[0372]
Number
[0373] or
[0374]
Number
[0375] or
[0376]
Number
[0377] and
[0378]
Number
[0379] indicates the original left and right channel signals in the current frame,
[0380]
Number
[0381] indicates the left and right channel signals subjected to time-domain preprocessing in the current frame,
[0382]
Number
[0383] indicates the left and right channel signals subjected to delay alignment processing in the current frame.
[0384] Correspondingly, hereinafter, a scenario for the anti-correlation signal decoding mode will be described using an example.
[0385] Referring to FIG. 5, an embodiment of the present application further provides an audio decoding method. The related steps of the audio decoding method can be implemented by a decoding device, and the method may specifically include the following steps.
[0386] 501. Execute decoding based on a bitstream to obtain decoded primary and secondary channel signals in the current frame.
[0387] 502. Determine the decoding mode of the current frame.
[0388] It can be understood that there is no necessary order for executing steps 501 and 502.
[0389] 503. When it is determined that the decoding mode of the current frame is the anti-correlation signal decoding mode, perform time-domain upmix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain upmix processing method corresponding to the anti-correlation signal decoding mode to obtain the reconstructed left and right channel signals in the current frame.
[0390] The reconstructed left and right channel signals may be the 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.
[0391] The time-domain upmix processing method corresponding to the anti-correlation signal decoding mode is a time-domain upmix processing method corresponding to an anti-correlation signal channel combination scheme, and the anti-correlation signal channel combination scheme is a channel combination scheme corresponding to signals close to an inverse phase.
[0392] 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, namely, the correlation signal decoding mode, the anti-correlation signal decoding mode, the switching mode from correlation to anti-correlation signal decoding, and the switching mode from anti-correlation to correlation signal decoding.
[0393] In the above solution, it can be understood that 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 conventional solution with only one decoding mode, this solution with multiple possible decoding modes is more compatible with and can harmonize with multiple possible scenarios. In addition, since a channel combination scheme corresponding to a signal close to the inverse phase is introduced, when the stereo signal in the current frame is a signal close to the inverse phase, there is a more target-oriented channel combination scheme and decoding mode, which helps to improve the decoding quality.
[0394] In some possible implementations, the method is When it is determined that the decoding mode of the current frame is the correlation signal decoding mode, in order to obtain the reconstructed left and right channel signals in the current frame, perform time-domain upmix processing on the decoded primary and secondary channel signals in the current frame by using the time-domain upmix processing method corresponding to the correlation signal decoding mode, where the time-domain upmix processing method corresponding to the correlation signal decoding mode is the time-domain upmix processing method corresponding to the correlation signal channel combination scheme, and the correlation signal channel combination scheme is the channel combination scheme corresponding to a signal close to the in-phase, to perform may further include.
[0395] In some possible implementations, when it is determined that the decoding mode of the current frame is the switching mode from correlation to anti-correlation signal decoding, the method further includes executing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain upmix processing method corresponding to the switching mode from correlation to anti-correlation signal decoding to obtain the reconstructed left and right channel signals in the current frame, where the time-domain upmix processing method corresponding to the switching mode from correlation to anti-correlation signal decoding is a time-domain upmix processing method corresponding to the transition from the correlation signal channel combination scheme to the anti-correlation signal channel combination scheme.
[0396] In some possible implementations, when it is determined that the decoding mode of the current frame is the switching mode from anti-correlation to correlation signal decoding, the method further includes executing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain upmix processing method corresponding to the switching mode from anti-correlation to correlation signal decoding to obtain the reconstructed left and right channel signals in the current frame, where the time-domain upmix processing method corresponding to the switching mode from anti-correlation to correlation signal decoding is a time-domain upmix processing method corresponding to the transition from the anti-correlation signal channel combination scheme to the correlation signal channel combination scheme.
[0397] It can be understood that the time-domain upmix processing methods corresponding to different decoding modes are usually different. In addition, each decoding mode may correspond to one or more time-domain upmix processing methods.
[0398] For example, in some possible implementations, to obtain the reconstructed left and right channel signals in the current frame, by using a time-domain upmix processing method corresponding to the decorrelation signal decoding mode, performing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame is to obtain the reconstructed left and right channel signals in the current frame, performing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficient of the decorrelation signal channel combination scheme for the current frame, or to obtain the reconstructed left and right channel signals in the current frame, performing time-domain upmix processing on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficient of the decorrelation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the decorrelation signal channel combination scheme for the previous frame is included.
[0399] In some possible implementations, the corresponding upmix matrix may be constructed based on the channel combination ratio coefficient of the audio frame, and the time-domain upmix processing is performed on the decoded primary and secondary channel signals in the current frame by using the upmix matrix corresponding to the channel combination scheme to obtain the reconstructed left and right channel signals in the current frame.
[0400] For example, when the time-domain upmix processing is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficient of the decorrelation signal channel combination scheme for the current frame to obtain the reconstructed left and right channel signals in the current frame,
[0401]
Number
[0402] is.
[0403] For another example, when the time-domain upmixing process is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficients of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficients of the anti-correlation signal channel combination scheme for the previous frame to obtain the reconstructed left and right channel signals in the current frame, if 0 ≦ n < N-upmixing_daly,
[0404]
Number
[0405] is, or if N-upmixing_daly ≦ n < N,
[0406]
Number
[0407] is, where delay_com indicates encoding delay compensation.
[0408] For another example, when the time-domain upmixing process is performed on the decoded primary and secondary channel signals in the current frame to obtain the reconstructed left and right channel signals in the current frame, based on the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficient of the anti-correlation signal channel combination scheme for the previous frame, if 0 ≤ n < N-upmixing_daly,
[0409]
Number
[0410] it is, if N-upmixing_daly ≤ n < N-upmixing_daly + NOVA_1
[0411]
Number
[0412] it is, or if N-upmixing_daly + NOVA_1 ≤ n < N
[0413]
Number
[0414] it is.
[0415] In this specification,
[0416]
Number
[0417] represents the reconfiguration left channel signal obtained in the current frame,
[0418]
Number
[0419] indicates the reconstructed right channel signal in the current frame,
[0420]
Number
[0421] indicates the decoded primary channel signal in the current frame,
[0422]
Number
[0423] indicates the decoded secondary channel signal in the current frame.
[0424] NOVA_1 indicates the transition processing length.
[0425] fade_in(n) indicates the fade-in coefficient. For example,
[0426]
Number
[0427] is. Of course, fade_in(n) may be, or, a fade-in coefficient of another functional relationship based on n.
[0428] fade_out(n) indicates the fade-out coefficient. For example,
[0429]
Number
[0430] It goes without saying that fade_out(n) may be, or may be another fade-out coefficient of a functional relationship based on n.
[0431] NOVA_1 indicates the transition processing length. The value of NOVA_1 may be set based on specific scenario requirements. For example, NOVA_1 may be equal to 3 / N, or NOVA_1 may be another value smaller than N.
[0432] For another example, when the time-domain upmixing process is performed on the decoded primary and secondary channel signals in the current frame to obtain the reconstructed left and right channel signals in the current frame based on the channel combination ratio coefficient of the correlation signal channel combination scheme for the current frame
[0433]
Number
[0434] It is.
[0435] In the above example
[0436]
Number
[0437] indicates the left channel signal reconfiguration reconstructed in the current frame.
[0438]
Number
[0439] indicates the reconstructed right channel signal in the current frame.
[0440]
Number
[0441] indicates the decoded primary channel signal in the current frame.
[0442]
Number
[0443] indicates the decoded secondary channel signal in the current frame.
[0444] For the above example, n indicates the number of the sampling point. For example, n = 0, 1, …, N - 1.
[0445] In the above example, upmixing_delay indicates the decoding delay compensation.
[0446]
Number
[0447] indicates the upmix matrix corresponding to the correlation signal channel combination scheme for the previous frame,
[0448]
Number
[0449] is constructed based on the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame.
[0450]
Number
[0451] indicates the upmix matrix corresponding to the anti-correlation signal channel combination scheme for the current frame,
[0452] [Number]
[0453] is constructed based on the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0454] [Number]
[0455] indicates an upmix matrix corresponding to the anti-correlation signal channel combination scheme for the previous frame,
[0456] [Number]
[0457] is constructed based on the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame.
[0458] [Number] indicates an upmix matrix corresponding to the correlation signal channel combination scheme for the current frame,
[0459] [Number]
[0460] is constructed based on the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0461] [Number]
[0462] has a plurality of formats, for example,
[0463]
Number
[0464] or
[0465]
Number
[0466] or
[0467]
Number
[0468] or
[0469]
Number
[0470] or
[0471]
Number
[0472] or
[0473]
Number
[0474] may have, where α1 = ratio_SM, α2 = 1 - ratio_SM, and ratio_SM represents the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0475]
Number
[0476] has a plurality of forms, for example,
[0477]
Number
[0478] or
[0479]
Number
[0480] or
[0481]
Number
[0482] or
[0483]
Number
[0484] or
[0485]
Number
[0486] or
[0487]
Number
[0488] may have, where α 1_pre = tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM, and The tdm_last_ratio_SM indicates a channel combination ratio coefficient corresponding to an anti-correlation signal channel combination scheme for a previous frame.
[0489]
Number
[0490] is of a plurality of forms, for example,
[0491]
Number
[0492] or
[0493]
Number
[0494] may have, where the ratio indicates a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for the current frame.
[0495] The following uses examples to describe scenarios for the switching mode from correlation to anti-correlation signal encoding and the switching mode from anti-correlation to correlation signal encoding. The time-domain downmix processing method corresponding to the switching mode from correlation to anti-correlation signal encoding and the switching mode from anti-correlation to correlation signal encoding is, for example, a segmented time-domain downmix processing method.
[0496] Referring to FIG. 6, an embodiment of the present application provides an audio encoding method. The related steps of the audio encoding method may be implemented by an encoding device, and the method may specifically include the following steps.
[0497] 601. Determine a channel combination scheme for the current frame.
[0498] 602. When the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame, perform segmented time-domain downmix processing on the left and right channel signals in the current frame based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame to obtain the primary and secondary channel signals in the current frame.
[0499] 603. Encode the acquired primary and secondary channel signals in the current frame.
[0500] When the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame, it may be determined that the coding mode of the current frame is a switching mode from correlation to anti-correlation signal coding or from anti-correlation to correlation signal coding. When the coding mode of the current frame is a switching mode from correlation to anti-correlation signal coding or from anti-correlation to correlation signal coding, for example, the segmented time-domain downmix processing may be performed on the left and right channel signals in the current frame based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame.
[0501] Specifically, for example, when the channel combination scheme for a previous frame is a correlation signal channel combination scheme and the channel combination scheme for the current frame is an anti-correlation signal channel combination scheme, the coding mode of the current frame may be determined to be a switching mode from correlation to anti-correlation signal coding. For another example, when the channel combination scheme for a previous frame is an anti-correlation signal channel combination scheme and the channel combination scheme for the current frame is a correlation signal channel combination scheme, the coding mode of the current frame may be determined to be a switching mode from anti-correlation to correlation signal coding. The rest can be inferred by analogy.
[0502] The segmented time-domain downmix processing may be understood as that the left and right channel signals in the current frame are divided into at least two segments, and different time-domain downmix processing methods are used for each segment to perform time-domain downmix processing. Compared with the non-segmented time-domain downmix processing, it can be understood that the segmented time-domain downmix processing is more likely to obtain a smoother transition when the channel combination scheme for adjacent frames changes.
[0503] In the above solution, it is necessary to determine a channel combination scheme for the current frame, which can be understood to indicate that there are multiple possibilities for the channel combination scheme for the current frame. Compared with the conventional solution with only one channel combination scheme, this solution with multiple possible channel combination schemes is more compatible with and can harmonize with multiple possible scenarios. In addition, when the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame, a mechanism for performing segmented time-domain downmix processing on the left and right channel signals in the current frame is introduced. The segmented time-domain downmix processing mechanism implements a smooth transition of the channel combination scheme and further helps to improve the encoding quality.
[0504] In addition, since a channel combination scheme corresponding to a signal close to the inverted phase is introduced, when the stereo signal in the current frame is a signal close to the inverted phase, a more target-oriented channel combination scheme and coding mode exist, which helps to improve the encoding quality.
[0505] For example, the channel combination scheme for the previous frame may be a correlated signal channel combination scheme or an anti-correlated signal channel combination scheme. The channel combination scheme for the current frame may be a correlated signal channel combination scheme or an anti-correlated signal channel combination scheme. Therefore, there are several possible cases where the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame.
[0506] Specifically, for example, when the channel combination scheme for a previous frame is a correlation signal channel combination scheme and the channel combination scheme for the current frame is an anti-correlation signal channel combination scheme, the left and right channel signals in the current frame include a start segment of the left and right channel signals, an intermediate 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 in the current frame include a start segment of the primary and secondary channel signals, an intermediate segment of the primary and secondary channel signals, and an end segment of the primary and secondary channel signals. In this case, to obtain the primary and secondary channel signals in the current frame, performing time-domain downmix processing segmented on the left and right channel signals in the current frame based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame is By using the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame and the time-domain downmix processing method corresponding to the correlation signal channel combination scheme for the previous frame, to obtain the start segment of the primary and secondary channel signals in the current frame, performing time-domain downmix processing on the start segment of the left and right channel signals in the current frame and By using the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame and the time-domain downmix processing method corresponding to the anti-correlation signal channel combination scheme for the current frame, to obtain the end segment of the primary and secondary channel signals in the current frame, performing time-domain downmix processing on the end segment of the left and right channel signals in the current frame and By using a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for a previous frame and a time-domain downmix processing method corresponding to the correlation signal channel combination scheme for the previous frame, to obtain a first intermediate segment of the primary and secondary channel signals, time-domain downmix processing is performed on the intermediate segments of the left and right channel signals in the current frame; and by using a channel combination ratio coefficient corresponding to an anti-correlation signal channel combination scheme for the current frame and a time-domain downmix processing method corresponding to the anti-correlation signal channel combination scheme for the current frame, to obtain a second intermediate segment of the primary and secondary channel signals, time-domain downmix processing is performed on the intermediate segments of the left and right channel signals in the current frame; and to obtain the intermediate segments of the primary and secondary channel signals in the current frame, weighted sum processing is performed on the first intermediate segment of the primary and secondary channel signals and the second intermediate segment of the primary and secondary channel signals, which may be included.
[0507] The lengths of the start segments, intermediate segments, and end segments of the left and right channel signals in the current frame may be set based on requirements. The lengths of the start segments, intermediate segments, and end segments of the left and right channel signals in the current frame may be the same, partially the same, or different from each other.
[0508] The lengths of the start segments, intermediate segments, and end segments of the primary and secondary channel signals in the current frame may be set based on requirements. The lengths of the start segments, intermediate segments, and end segments of the primary and secondary channel signals in the current frame may be the same, may be partially the same, or may be different from each other.
[0509] When the weighted sum process is performed on the first intermediate segment of the primary and secondary channel signals and the second intermediate segment of the primary and secondary channel signals, the weighting rate corresponding to the first intermediate segment of the primary and secondary channel signals may be equal to or different from the weighting rate corresponding to the second intermediate segment of the primary and secondary channel signals.
[0510] For example, when the weighted sum process is performed on the first intermediate segment of the primary and secondary channel signals and the second intermediate segment of the primary and secondary channel signals, the weighting rate corresponding to the first intermediate segment of the primary and secondary channel signals is a fade-out coefficient, and the weighting rate corresponding to the second intermediate segment of the primary and secondary channel signals is a fade-in coefficient.
[0511] In some possible implementations,
[0512]
Number
[0513] Here, X 11 (n) represents the start segment of the primary channel signal in the current frame, and Y 11(n) indicates the start segment of the secondary channel signal in the current frame, X 31 (n) indicates the end segment of the primary channel signal in the current frame, Y 31 (n) indicates the end segment of the secondary channel signal in the current frame, X 21 (n) indicates the middle segment of the primary channel signal in the current frame, Y 21 (n) indicates the middle segment of the secondary channel signal in the current frame, X(n) indicates the primary channel signal in the current frame, Y(n) indicates the secondary channel signal in the current frame.
[0514] For example,
[0515]
Number
[0516] is.
[0517] For example, fade_in(n) indicates the fade-in coefficient, and fade_out(n) indicates the fade-out coefficient. For example, the sum of fade_in(n) and fade_out(n) is 1.
[0518] Specifically, for example,
[0519]
Number
[0520] and
[0521]
Number
[0522] That is. Of course, fade_in(n) may be, or may be a fade-in coefficient of another functional relationship based on n. Of course, fade_out(n) may be, or may be a fade out coefficient.
[0523] In this specification, n indicates the number of sampling points. n = 0, 1, …, N - 1, and 0 < N1 < N2 < N - 1.
[0524] For example, N1 is equal to 100, 107, 120, 150, or another value.
[0525] For example, N2 is equal to 180, 187, 200, 203, or another value.
[0526] In this specification, X 211 (n) indicates the first intermediate segment of the primary channel signal in the current frame, and Y 211 (n) indicates the first intermediate segment of the secondary channel signal in the current frame. X 212 (n) indicates the second intermediate segment of the primary channel signal in the current frame, and Y 212 (n) indicates the second intermediate segment of the secondary channel signal in the current frame.
[0527] In some possible implementations, when N1 ≤ n < N2,
[0528]
Equation
[0529] it is, when N1 ≤ n < N2,
[0530]
Equation
[0531] and when 0 ≦ n < N1
[0532] [Number]
[0533] and when N2 ≦ n < N
[0534] [Number]
[0535] and here X L (n) represents the left channel signal in the current frame, and X R (n) represents the right channel signal in the current frame, and M 11 represents the downmix matrix corresponding to the correlation signal channel combination scheme for the previous frame, and M 11 is constructed based on the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame, and M 22 represents the downmix matrix corresponding to the anti-correlation signal channel combination scheme for the current frame, and M 22 is constructed based on the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0536] M 22 may have multiple possible forms, and these forms are specifically, for example,
[0537] [Number]
[0538] or
[0539] [Number]
[0540] or
[0541]
Number
[0542] or
[0543]
Number
[0544] or
[0545]
Number
[0546] or
[0547]
Number
[0548] and, where α1 = ratio_SM, α2 = 1 - ratio_SM, and ratio_SM represents the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0549] M 11 may have a plurality of possible forms, which specifically include, for example,
[0550]
Number
[0551] or
[0552]
Number
[0553] and here, tdm_last_ratio indicates a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for a previous frame.
[0554] Specifically, for another example, when the channel combination scheme for the previous frame is an anti-correlation signal channel combination scheme and the channel combination scheme for the current frame is a correlation signal channel combination scheme, the left and right channel signals in the current frame include a start segment of the left and right channel signals, an intermediate 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 in the current frame include a start segment of the primary and secondary channel signals, an intermediate segment of the primary and secondary channel signals, and an end segment of the primary and secondary channel signals. In this case, in order to obtain the primary and secondary channel signals in the current frame, performing time-domain downmix processing segmented on the left and right channel signals in the current frame based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame is by using the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame and the time-domain downmix processing method corresponding to the anti-correlation signal channel combination scheme for the previous frame, performing time-domain downmix processing on the start segment of the left and right channel signals in the current frame to obtain the start segment of the primary and secondary channel signals in the current frame, and By using the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the time-domain downmix processing method corresponding to the correlation signal channel combination scheme for the current frame, in order to obtain the end segments of the primary and secondary channel signals in the current frame, time-domain downmix processing is performed on the end segments of the left and right channel signals in the current frame, and By using the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame and the time-domain downmix processing method corresponding to the anti-correlation signal channel combination scheme for the previous frame, in order to obtain the third intermediate segment of the primary and secondary channel signals, time-domain downmix processing is performed on the intermediate segments of the left and right channel signals in the current frame, and by using the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the time-domain downmix processing method corresponding to the correlation signal channel combination scheme for the current frame, in order to obtain the fourth intermediate segment of the primary and secondary channel signals, time-domain downmix processing is performed on the intermediate segments of the left and right channel signals in the current frame, and in order to obtain the intermediate segments of the primary and secondary channel signals in the current frame, it may include performing weighted sum processing on the third intermediate segment of the primary and secondary channel signals and the fourth intermediate segment of the primary and secondary channel signals.
[0555] When the weighted sum process is performed on the third intermediate segment of the primary and secondary channel signals as well as the 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 may or may not be equal to the weighting factor corresponding to the fourth intermediate segment of the primary and secondary channel signals.
[0556] For example, when the weighted sum process is performed on the third intermediate segment of the primary and secondary channel signals as well as the 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 the fade-out factor, and the weighting factor corresponding to the fourth intermediate segment of the primary and secondary channel signals is the fade-in factor.
[0557] In some possible implementations,
[0558]
Number
[0559] where, X 12 (n) represents the start segment of the primary channel signal in the current frame, and Y 12 (n) represents the start segment of the secondary channel signal in the current frame, and X 32 (n) represents the end segment of the primary channel signal in the current frame, and Y 32 (n) represents the end segment of the secondary channel signal in the current frame, and X 22 (n) represents the intermediate segment of the primary channel signal in the current frame, and Y 22 (n) represents the intermediate segment of the secondary channel signal in the current frame; in X(n) represents the primary channel signal in the current frame, Y(n) represents the secondary channel signal in the current frame.
[0560] For example,
[0561]
Number
[0562] where fade_in(n) represents the fade-in coefficient, fade_out(n) represents the fade-out coefficient, and the sum of fade_in(n) and fade_out(n) is 1.
[0563] Specifically, for example,
[0564]
Number
[0565] and
[0566]
Number
[0567] It is. Of course, fade_in(n) may be, or, a fade-in coefficient of another functional relationship based on n. Of course, fade_out(n) may be, or, a fade out coefficient of another functional relationship based on n.
[0568] In this specification, n represents the number of sampling points. For example, n = 0, 1, …, N - 1.
[0569] In this specification, 0 < N3 < N4 < N - 1.
[0570] For example, N3 is equal to 101, 107, 120, 150, or another value.
[0571] For example, N4 is equal to 181, 187, 200, 205, or another value.
[0572] X 221 (n) represents the third intermediate segment of the primary channel signal in the current frame, and Y 221 (n) represents the third intermediate segment of the secondary channel signal in the current frame. X 222 (n) represents the fourth intermediate segment of the primary channel signal in the current frame, and Y 222 (n) represents the fourth intermediate segment of the secondary channel signal in the current frame.
[0573] In some possible implementations, when N3 ≤ n < N4,
[0574]
Number
[0575] and when N3 ≤ n < N4,
[0576]
Number
[0577] and when 0 ≤ n < N3,
[0578]
Number
[0579] and when N4 ≤ n < N,
[0580]
Number
[0581] and where X L (n) represents the left channel signal in the current frame, and X R (n) represents the right channel signal in the current frame.
[0582] M 12 represents a downmix matrix corresponding to an anti-correlation signal channel combination scheme for the previous frame, and M 12 is constructed based on a channel combination ratio coefficient corresponding to an anti-correlation signal channel combination scheme for the previous frame. M 21 represents a downmix matrix corresponding to a correlation signal channel combination scheme for the current frame, and M 21 is constructed based on a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for the current frame.
[0583] M 12 may have multiple possible forms, which specifically include, for example,
[0584]
Number
[0585] or
[0586]
Number
[0587] or
[0588]
Number
[0589] or
[0590]
Number
[0591] or
[0592] [Number]
[0593] or
[0594] [Number]
[0595] and where, α 1_pre = tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM, and tdm_last_ratio_SM represents the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame.
[0596] M 21 may have multiple possible forms, which specifically include, for example,
[0597] [Number]
[0598] or
[0599] [Number]
[0600] and where, ratio represents the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0601] In some possible implementations, the left and right channel signals in the current frame may be, for example, the original left and right channel signals in the current frame, or the left and right channel signals subjected to time-domain preprocessing, or the left and right channel signals subjected to delay alignment processing.
[0602] Specifically, for example,
[0603]
Number
[0604] Or
[0605]
Number
[0606] Or
[0607]
Number
[0608] That is, where x L (n) represents the original left channel signal in the current frame (the original left channel signal is the left channel signal not subjected to time-domain preprocessing), x R (n) represents the original right channel signal in the current frame (the original right channel signal is the right channel signal not subjected to time-domain preprocessing), x L_HP (n) represents the left channel signal subjected to time-domain preprocessing in the current frame, and x R_HP (n) represents the right channel signal subjected to time-domain preprocessing in the current frame. x’ L (n) represents the left channel signal subjected to delay alignment processing in the current frame, and x’ R(n) represents the right channel signal subjected to delay alignment processing in the current frame.
[0609] It can be understood that the segmented time-domain downmix processing method in the above example may not be all possible implementations, and in actual applications, other segmented time-domain downmix processing methods may also be used.
[0610] Correspondingly, hereinafter, examples will be used to describe the switching mode from correlation to anti-correlation signal decoding and the scenario for the switching mode from anti-correlation to correlation signal decoding. The time-domain downmix processing method corresponding to the switching mode from correlation to anti-correlation signal decoding and the switching mode from anti-correlation to correlation signal decoding is, for example, a segmented time-domain downmix processing method.
[0611] Referring to FIG. 7, an embodiment of the present application provides an audio decoding method. The related steps of the audio decoding method may be implemented by a decoding device, and the method may specifically include the following steps.
[0612] 701. Execute decoding based on the bitstream to obtain the decoded primary and secondary channel signals in the current frame.
[0613] 702. Determine the channel combination scheme for the current frame.
[0614] It can be understood that there is no necessary order for executing step 701 and step 702.
[0615] When the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame, in order to obtain the reconstructed left and right channel signals in the current frame, perform segmented time-domain upmix processing on the decoded primary and secondary channel signals in the current frame based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame.
[0616] The channel combination scheme for the current frame is one of a plurality of channel combination schemes.
[0617] For example, the plurality of channel combination schemes include an anti-correlated signal channel combination scheme and a correlated signal channel combination scheme. The correlated signal channel combination scheme is a channel combination scheme corresponding to signals that are close to being in-phase. The anti-correlated signal channel combination scheme is a channel combination scheme corresponding to signals that are close to being out-of-phase. It can be understood that the channel combination scheme corresponding to signals that are close to being in-phase is applicable to signals that are close to being in-phase, and the channel combination scheme corresponding to signals that are close to being out-of-phase is applicable to signals that are close to being out-of-phase.
[0618] The segmented time-domain upmix processing may be understood such that the left and right channel signals in the current frame are divided into at least two segments, and different time-domain upmix processing methods are used for each segment to perform time-domain upmix processing. Compared with non-segmented time-domain upmix processing, it can be understood that the segmented time-domain upmix processing is more likely to obtain a smoother transition when the channel combination scheme for adjacent frames changes.
[0619] In the above solution, it is necessary to determine the channel combination scheme for the current frame, and it can be understood that this indicates that there are multiple possibilities for the channel combination scheme for the current frame. Compared with the conventional solution with only one channel combination scheme, this solution with multiple possible channel combination schemes is more compatible with and can harmonize with multiple possible scenarios. In addition, when the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame, a mechanism for performing segmented time-domain upmix processing on the left and right channel signals in the current frame is introduced. The segmented time-domain upmix processing mechanism helps to implement a smooth transition of the channel combination scheme and further helps to improve the encoding quality.
[0620] In addition, since a channel combination scheme corresponding to a signal close to the inverse phase is introduced, when the stereo signal in the current frame is a signal close to the inverse phase, a more target-oriented channel combination scheme and coding mode exist, which helps to improve the encoding quality.
[0621] For example, the channel combination scheme for the previous frame may be a correlated signal channel combination scheme or an anti-correlated signal channel combination scheme. The channel combination scheme for the current frame may be a correlated signal channel combination scheme or an anti-correlated signal channel combination scheme. Therefore, there are several possible cases where the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame.
[0622] Specifically, for example, the channel combination scheme for the previous frame is a correlation signal channel combination scheme, and the channel combination scheme for the current frame is an anti-correlation signal channel combination scheme. The reconstructed left and right channel signals in the current frame include a start segment of the reconstructed left and right channel signals, an intermediate 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 in the current frame include a start segment of the decoded primary and secondary channel signals, an intermediate segment of the decoded primary and secondary channel signals, and an end segment of the decoded primary and secondary channel signals. In this case, in order to obtain the reconstructed left and right channel signals in the current frame, based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame, performing segmented time-domain upmix processing on the decoded primary and secondary channel signals in the current frame means using the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame and the time-domain upmix processing method corresponding to the correlation signal channel combination scheme for the previous frame. To obtain the start segment of the reconstructed left and right channel signals in the current frame, performing time-domain upmix processing on the start segment of the decoded primary and secondary channel signals in the current frame, and By using the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame and the time-domain upmix processing method corresponding to the anti-correlation signal channel combination scheme for the current frame, in order to obtain the end segments of the reconstructed left and right channel signals in the current frame, perform time-domain upmix processing on the end segments of the decoded primary and secondary channel signals in the current frame, and By using the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame and the time-domain upmix processing method corresponding to the correlation signal channel combination scheme for the previous frame, in order to obtain the first intermediate segments of the reconstructed left and right channel signals, perform time-domain upmix processing on the intermediate segments of the decoded primary and secondary channel signals in the current frame, and by using the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame and the time-domain upmix processing method corresponding to the anti-correlation signal channel combination scheme for the current frame, in order to obtain the second intermediate segments of the reconstructed left and right channel signals, perform time-domain upmix processing on the intermediate segments of the decoded primary and secondary channel signals in the current frame, and in order to obtain the intermediate segments of the reconstructed left and right channel signals in the current frame, perform weighted sum processing on the first intermediate segments of the reconstructed left and right channel signals and the second intermediate segments of the reconstructed left and right channel signals and include.
[0623] The lengths of the start segments, middle segments, and end segments of the reconstructed left and right channel signals in the current frame may be set based on requirements. The lengths of the start segments, middle segments, and end segments of the reconstructed left and right channel signals in the current frame may be the same, partially the same, or different from each other.
[0624] The lengths of the start segments, middle segments, and end segments of the decoded primary and secondary channel signals in the current frame may be set based on requirements. The lengths of the start segments, middle segments, and end segments of the decoded primary and secondary channel signals in the current frame may be the same, partially the same, or different from each other.
[0625] The reconstructed left and right channel signals may be the 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.
[0626] When weighted sum processing is performed on the first middle segment and the second middle segment of the reconstructed left and right channel signals, the weighting rate corresponding to the first middle segment of the reconstructed left and right channel signals may be equal to or different from the weighting rate corresponding to the second middle segment of the reconstructed left and right channel signals.
[0627] For example, when the weighted sum process is performed on the first intermediate segment of the reconstructed left and right channel signals and the second intermediate segment of the reconstructed left and right channel signals, the weighting factor corresponding to the first intermediate segment of the reconstructed left and right channel signals is the fade-out factor, and the weighting factor corresponding to the second intermediate segment of the reconstructed left and right channel signals is the fade-in factor.
[0628] In some possible implementations,
[0629]
Number
[0630] where,
[0631]
Number
[0632] indicates the start segment of the reconstructed left channel signal in the current frame,
[0633]
Number
[0634] indicates the start segment of the reconstructed right channel signal in the current frame.
[0635]
Number
[0636] indicates the end segment of the reconstructed left channel signal in the current frame,
[0637]
Number
[0638] indicates the end segment of the reconstructed right channel signal in the current frame.
[0639]
Number
[0640] indicates the middle segment of the reconstructed left channel signal in the current frame,
[0641]
Number
[0642] indicates the middle segment of the reconstructed right channel signal in the current frame,
[0643]
Number
[0644] indicates the reconstructed left channel signal in the current frame,
[0645]
Number
[0646] indicates the reconstructed right channel signal in the current frame.
[0647] For example,
[0648]
Number
[0649] is.
[0650] For example, fade_in(n) indicates the fade-in coefficient, and fade_out(n) indicates the fade-out coefficient. For example, the sum of fade_in(n) and fade_out(n) is 1.
[0651] Specifically, for example,
[0652]
Number
[0653] and
[0654]
Number
[0655] is. Of course, fade_in(n) may be, or, a fade-in coefficient of another functional relationship based on n. Of course, fade_out(n) may be, or, a fade out coefficient of another functional relationship based on n.
[0656] In this specification, n indicates the number of sampling points, and n = 0, 1,..., N - 1. In this specification, 0 < N1 < N2 < N - 1.
[0657]
Number
[0658] indicates the first intermediate segment of the reconstructed left-channel signal in the current frame,
[0659]
Number
[0660] indicates the first intermediate segment of the reconstructed right-channel signal in the current frame.
[0661]
Number
[0662] represents the second intermediate segment of the reconstructed left channel signal in the current frame,
[0663]
Number
[0664] represents the second intermediate segment of the reconstructed right channel signal in the current frame.
[0665] In some possible implementations, when N1 ≦ n < N2,
[0666]
Number
[0667] and when N1 ≦ n < N2,
[0668]
Number
[0669] and when 0 ≦ n < N1,
[0670]
Number
[0671] and when N2 ≦ n < N,
[0672]
Number
[0673] and here,
[0674]
Number
[0675] indicates the decoded primary channel signal in the current frame,
[0676]
Number
[0677] indicates the decoded secondary channel signal in the current frame,
[0678]
Number
[0679] indicates an upmix matrix corresponding to a correlation signal channel combination scheme for a previous frame,
[0680]
Number
[0681] is constructed based on a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for a previous frame,
[0682]
Number
[0683] indicates an upmix matrix corresponding to an anti-correlation signal channel combination scheme for the current frame,
[0684]
Number
[0685] is constructed based on a channel combination ratio coefficient corresponding to an anti-correlation signal channel combination scheme for the current frame.
[0686] [Number]
[0687] may have a plurality of possible forms, and these forms are specifically, for example,
[0688] [Number]
[0689] or
[0690] [Number]
[0691] or
[0692] [Number]
[0693] or
[0694] [Number]
[0695] or
[0696] [Number]
[0697] or
[0698]
Number
[0699] and, where α1 = ratio_SM, α2 = 1 - ratio_SM, and ratio_SM indicates the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0700]
Number
[0701] may have multiple possible forms, which specifically include, for example,
[0702]
Number
[0703] or
[0704]
Number
[0705] is.
[0706] In this specification, tdm_last_ratio indicates the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame.
[0707] Specifically, for another example, the channel combination scheme for the previous frame is an anti-correlation signal channel combination scheme, and the channel combination scheme for the current frame is a correlation signal channel combination scheme. The reconstructed left and right channel signals in the current frame include a start segment of the reconstructed left and right channel signals, an intermediate 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 in the current frame include a start segment of the decoded primary and secondary channel signals, an intermediate segment of the decoded primary and secondary channel signals, and an end segment of the decoded primary and secondary channel signals. In this case, in order to obtain the reconstructed left and right channel signals in the current frame, based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame, performing a segmented time-domain upmix process on the decoded primary and secondary channel signals in the current frame is By using the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame and the time-domain upmix processing method corresponding to the anti-correlation signal channel combination scheme for the previous frame, in order to obtain the start segment of the reconstructed left and right channel signals in the current frame, performing a time-domain upmix process on the start segment of the decoded primary and secondary channel signals in the current frame, and By using the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the time-domain upmix processing method corresponding to the correlation signal channel combination scheme for the current frame, in order to obtain the end segments of the reconstructed left and right channel signals in the current frame, perform time-domain upmix processing on the end segments of the decoded primary and secondary channel signals in the current frame, and By using the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame and the time-domain upmix processing method corresponding to the anti-correlation signal channel combination scheme for the previous frame, in order to obtain the third intermediate segment of the reconstructed left and right channel signals, perform time-domain upmix processing on the intermediate segments of the decoded primary and secondary channel signals in the current frame, and by using the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the time-domain upmix processing method corresponding to the correlation signal channel combination scheme for the current frame, in order to obtain the fourth intermediate segment of the reconstructed left and right channel signals, perform time-domain upmix processing on the intermediate segments of the decoded primary and secondary channel signals in the current frame, and in order to obtain the intermediate segments of the reconstructed left and right channel signals in the current frame, perform weighted sum 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 and including.
[0708] When the weighted sum 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 rate corresponding to the third intermediate segment of the reconstructed left and right channel signals may or may not be equal to the weighting rate corresponding to the fourth intermediate segment of the reconstructed left and right channel signals.
[0709] For example, when the weighted sum 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 rate corresponding to the third intermediate segment of the reconstructed left and right channel signals is a fade - out coefficient, and the weighting rate corresponding to the fourth intermediate segment of the reconstructed left and right channel signals is a fade - in coefficient.
[0710] In some possible implementations,
[0711]
Number
[0712] where,
[0713]
Number
[0714] indicates the start segment of the reconstructed left channel signal in the current frame,
[0715]
Number
[0716] indicates the start segment of the reconstructed right channel signal in the current frame,
[0717] [Number]
[0718] indicates the end segment of the reconstructed left channel signal in the current frame,
[0719] [Number]
[0720] indicates the end segment of the reconstructed right channel signal in the current frame,
[0721] [Number]
[0722] indicates the middle segment of the reconstructed left channel signal in the current frame,
[0723] [Number]
[0724] indicates the middle segment of the reconstructed right channel signal in the current frame.
[0725] [Number]
[0726] indicates the reconstructed left channel signal in the current frame,
[0727] [Number]
[0728] indicates the reconstructed right channel signal in the current frame.
[0729] For example,
[0730]
Number
[0731] it is.
[0732] fade_in(n) represents the fade-in coefficient, fade_out(n) represents the fade-out coefficient, and the sum of fade_in(n) and fade_out(n) is 1.
[0733] Specifically, for example,
[0734]
Number
[0735] and
[0736]
Number
[0737] it is. Of course, fade_in(n) may be, or, a fade-in coefficient of another functional relationship based on n. Of course, fade_out(n) may be, or, a fade out coefficient of another functional relationship.
[0738] In this specification, n indicates the number of sampling points. For example, n = 0, 1, …, N - 1.
[0739] In this specification, 0 < N3 < N4 < N - 1.
[0740] For example, N3 is equal to 101, 107, 120, 150, or another value.
[0741] For example, N4 is equal to 181, 187, 200, 205, or another value.
[0742]
Number
[0743] represents the third intermediate segment of the reconstructed left channel signal in the current frame,
[0744]
Number
[0745] represents the third intermediate segment of the reconstructed right channel signal in the current frame.
[0746]
Number
[0747] represents the fourth intermediate segment of the reconstructed left channel signal in the current frame,
[0748]
Number
[0749] represents the fourth intermediate segment of the reconstructed right channel signal in the current frame.
[0750] In some possible implementations, when N3 ≤ n < N4,
[0751]
Number
[0752] it is, when N3 ≤ n < N4,
[0753]
Number
[0754] and, when 0 ≦ n < N3,
[0755]
Number
[0756] and, when N4 ≦ n < N,
[0757]
Number
[0758] and, where,
[0759]
Number
[0760] indicates the decoded primary channel signal in the current frame,
[0761]
Number
[0762] indicates the decoded secondary channel signal in the current frame.
[0763]
Number
[0764] indicates an upmix matrix corresponding to the anti-correlation signal channel combination scheme for the previous frame,
[0765]
Number
[0766] is constructed based on a channel combination ratio coefficient corresponding to an anti-correlation signal channel combination scheme for a previous frame.
[0767] [Number]
[0768] shows an upmix matrix corresponding to a correlation signal channel combination scheme for the current frame,
[0769] [Number]
[0770] is constructed based on a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for the current frame.
[0771] [Number]
[0772] may have a plurality of possible forms, and these forms are specifically, for example,
[0773] [Number]
[0774] or
[0775] [Number]
[0776] or
[0777] [Number]
[0778] or
[0779]
Number
[0780] or
[0781]
Number
[0782] or
[0783]
Number
[0784] is, where α 1_pre =tdm_last_ratio_SM, α 2_pre =1 - tdm_last_ratio_SM, and tdm_last_ratio_SM indicates the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame.
[0785]
Number
[0786] may have a plurality of possible forms, and these forms are specifically, for example,
[0787]
Number
[0788] or
[0789] [Number]
[0790] and here, ratio indicates the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0791] In this embodiment of the present application, the stereo parameters of the current frame (for example, the channel combination ratio coefficient and / or the inter-channel time difference) may be fixed values, or may be determined based on the channel combination scheme for the current frame (for example, the correlation signal channel combination scheme or the anti-correlation signal channel combination scheme).
[0792] Referring to FIG. 8, the following uses an example to explain the time-domain stereo parameter determination method. The related steps of the time-domain stereo parameter determination method can be implemented by an encoding device, and the method may specifically include the following steps.
[0793] 801. Determine the channel combination scheme for the current frame.
[0794] 802. Determine the time-domain stereo parameters of the current frame based on the channel combination scheme for the current frame. The time-domain stereo parameters may include at least one of the channel combination ratio coefficient and the inter-channel time difference.
[0795] The channel combination scheme for the current frame is one of a plurality of channel combination schemes.
[0796] For example, the plurality of channel combination schemes include an anti-correlation signal channel combination scheme and a correlation signal channel combination scheme.
[0797] The correlation signal channel combination scheme is a channel combination scheme corresponding to signals that are close to being in-phase. The anti-correlation signal channel combination scheme is a channel combination scheme corresponding to signals that are close to being in anti-phase. It can be understood that the channel combination scheme corresponding to signals that are close to being in-phase is applicable to signals that are close to being in-phase, and the channel combination scheme corresponding to signals that are close to being in anti-phase is applicable to signals that are close to being in anti-phase.
[0798] When it is determined that the channel combination scheme for the current frame is the correlation signal channel combination scheme, the time-domain stereo parameter of the current frame is the time-domain stereo parameter corresponding to the correlation signal channel combination scheme for the current frame. Or, when it is determined that the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, the time-domain stereo parameter of the current frame is the time-domain stereo parameter corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0799] In the above solution, it is necessary to determine the channel combination scheme for the current frame, and it can be understood that this indicates that there are multiple possibilities for the channel combination scheme for the current frame. Compared with the conventional solution with only one channel combination scheme, this solution with multiple possible channel combination schemes is more compatible with and can harmonize with multiple possible scenarios. Since the time-domain stereo parameter of the current frame is determined based on the channel combination scheme for the current frame, the time-domain stereo parameter is more compatible with and can harmonize with multiple possible scenarios, and the encoding quality and decoding quality can be further improved.
[0800] In some possible implementations, the channel combination ratio coefficients corresponding to the anti-correlation signal channel combination scheme for the current frame and the channel combination ratio coefficients corresponding to the correlation signal channel combination scheme for the current frame may first be calculated separately. Thereafter, when it is determined that the channel combination scheme for the current frame is the correlation signal channel combination scheme, the time-domain stereo parameter of the current frame is determined to be the time-domain stereo parameter corresponding to the correlation signal channel combination scheme for the current frame, or when it is determined that the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, the time-domain stereo parameter of the current frame is determined to be the time-domain stereo parameter corresponding to the anti-correlation signal channel combination scheme for the current frame. Alternatively, the time-domain stereo parameter corresponding to the correlation signal channel combination scheme for the current frame may first be calculated, and when it is determined that the channel combination scheme for the current frame is the correlation signal channel combination scheme, the time-domain stereo parameter of the current frame is determined to be the time-domain stereo parameter corresponding to the correlation signal channel combination scheme for the current frame, or when it is determined that the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, the time-domain stereo parameter corresponding to the anti-correlation signal channel combination scheme for the current frame is calculated, and the time-domain stereo parameter corresponding to the anti-correlation signal channel combination scheme for the current frame is determined to be the time-domain stereo parameter of the current frame.
[0801] Alternatively, a channel combination scheme for the current frame may be determined first. When it is determined that the channel combination scheme for the current frame is the correlation signal channel combination scheme, a time-domain stereo parameter corresponding to the correlation signal channel combination scheme for the current frame is calculated, and the time-domain stereo parameter of the current frame is the time-domain stereo parameter corresponding to the correlation signal channel combination scheme for the current frame. Or, when it is determined that the channel combination scheme for the current frame is the anti-correlation signal channel combination scheme, a time-domain stereo parameter corresponding to the anti-correlation signal channel combination scheme for the current frame is calculated, and the time-domain stereo parameter of the current frame is the time-domain stereo parameter corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0802] In some possible implementations, determining the time-domain stereo parameters of the current frame based on the channel combination scheme for the current frame includes determining an initial value of a channel combination ratio coefficient corresponding to the channel combination scheme for the current frame based on the channel combination scheme for the current frame. When there is no need to correct the initial value of the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame (correlation signal channel combination scheme or anti-correlation signal channel combination scheme), the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame is equal to the initial value of the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame. When it is necessary to correct the initial value of the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame (correlation signal channel combination scheme or anti-correlation signal channel combination scheme), the initial value of the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame is corrected to obtain a corrected value of the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame, and the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame is equal to the corrected value of the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame.
[0803] For example, determining the time-domain stereo parameters of the current frame based on the channel combination scheme for the current frame may include calculating the frame energy of the left-channel signal in the current frame based on the left-channel signal in the current frame, calculating the frame energy of the right-channel signal in the current frame based on the right-channel signal in the current frame, and calculating an initial value of a channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame based on the frame energy of the left-channel signal in the current frame and the frame energy of the right-channel signal in the current frame.
[0804] When there is no need to correct the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is equal to the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, and the encoded index of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is equal to the encoded index of the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0805] When the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame needs to be corrected, the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the encoded index of the initial value are corrected to obtain the corrected value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the encoded index of the corrected value. The channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is equal to the corrected value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, and the encoded index of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is equal to the encoded index of the corrected value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0806] Specifically, for example, the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the encoded index of the initial value are corrected, ratio_idx_mod = 0.5 * (tdm_last_ratio_idx + 16) and, ratio_mod qua = ratio_tabl[ratio_idx_mod], where, tdm_last_ratio_idx indicates the encoded index of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame, ratio_idx_mod indicates the encoded index corresponding to the corrected value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, and ratio_mod qua indicates the corrected value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0807] For another example, determining the temporal stereo parameters of the current frame based on the channel combination scheme for the current frame includes obtaining a reference channel signal in the current frame based on the left and right channel signals in the current frame, calculating an amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, calculating an amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame, calculating an amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame based on the amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame and the amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame, and calculating a channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame based on the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame.
[0808] Calculating a channel combination ratio coefficient corresponding to an anti-correlation signal channel combination scheme for a current frame based on an amplitude correlation difference parameter between a left channel signal and a right channel signal in the current frame may include, for example, calculating an initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame based on the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame, and modifying the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame in order to obtain the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame. When there is no need to modify the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, it can be understood that the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame is equal to the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0809] In some possible implementations,
[0810] [Number]
[0811] and
[0812] [Number]
[0813] where,
[0814] [Number]
[0815] and mono_i(n) represents the reference channel signal in the current frame, x’ L (n) represents the left channel signal that has undergone delay alignment processing in the current frame, x’ R (n) represents the right channel signal that has undergone delay alignment processing in the current frame, corr_LM represents the amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, and corr_RM represents the amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame.
[0816] In some possible implementations, based on the amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame and the amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame, calculating the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame includes calculating the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame based on the amplitude correlation parameter between the left channel signal that has undergone delay alignment processing and the reference channel signal in the current frame, calculating the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame based on the amplitude correlation parameter between the right channel signal that has undergone delay alignment processing and the reference channel signal in the current frame, and calculating the amplitude correlation difference parameter between the left channel and the right channel in the current frame based on the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame and the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame.
[0817] Various smoothing methods, for example, tdm_lt_corr_LM_SM cur= α * tdm_lt_corr_LM_SM pre + (1 - α)corr_LM is acceptable, where tdm_lt_rms_L_SM cur = (1 - A) * tdm_lt_rms_L_SM pre + A * rms_L, where A represents the update coefficient of the long-term smoothed frame energy of the left channel signal in the current frame, and tdm_lt_rms_L_SM cur represents the long-term smoothed frame energy of the left channel signal in the current frame, rms_L represents the frame energy of the left channel signal in the current frame, and tdm_lt_corr_LM_SM cur represents the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, and tdm_lt_corr_LM_SM pre represents the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the previous frame, and α represents the left channel smoothing coefficient.
[0818] For example, tdm_lt_corr_RM_SM cur = β * tdm_lt_corr_RM_SM pre + (1 - β)corr_LM, where tdm_lt_rms_R_SM cur = (1 - B) * tdm_lt_rms_R_SM pre + B * rms_R, where B represents the update coefficient of the long-term smoothed frame energy of the right channel signal in the current frame, and tdm_lt_rms_R_SM pre represents the long-term smoothed frame energy of the right channel signal in the current frame, rms_R represents the frame energy of the right channel signal in the current frame, and tdm_lt_corr_RM_SM cur represents the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame, and tdm_lt_corr_RM_SM preshows the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the previous frame, and β represents the right channel smoothing coefficient.
[0819] In some possible implementations, diff_lt_corr = tdm_lt_corr_LM_SM - tdm_lt_corr_RM_SM, where tdm_lt_corr_LM_SM shows the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, tdm_lt_corr_RM_SM shows the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame, and diff_lt_corr shows the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame.
[0820] In some possible implementations, calculating the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame based on the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame involves performing a mapping process on the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame, and converting the amplitude correlation difference parameter that has undergone the mapping process between the left channel signal and the right channel signal into the channel combination ratio coefficient, in order to enable the value range of the amplitude correlation difference parameter that has undergone the mapping process between the left channel signal and the right channel signal in the current frame to be [MAP_MIN, MAP_MAX].
[0821] In some possible implementations, performing mapping processing on the amplitude correlation difference parameter between the left channel and the right channel in the current frame includes performing amplitude limiting on the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame, and performing mapping processing on the amplitude-limited amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame.
[0822] There may be various amplitude limiting methods, specifically, for example,
[0823]
Number
[0824] where RATIO_MAX represents the maximum value of the amplitude-limited amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame, RATIO_MIN represents the minimum value of the amplitude-limited amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame, and RATIO_MAX > RATIO_MIN.
[0825] There may be various mapping processing methods, specifically, for example,
[0826]
Number
[0827] where
[0828]
Number
[0829] where B1 = MAP_MAX - RATIO_MAX * A1 or B1 = MAP_HIGH - RATIO_HIGH * A1,
[0830]
Number
[0831] and B2 = MAP_LOW - RATIO_LOW * A2 or B2 = MAP_MIN - RATIO_MIN * A2,
[0832]
Number
[0833] and B3 = MAP_HIGH - RATIO_HIGH * A3 or B3 = MAP_LOW - RATIO_LOW * A3, diff_lt_corr_map represents the amplitude correlation difference parameter that is between the left channel signal and the right channel signal in the current frame and has been subjected to mapping processing, MAP_MAX represents the maximum value of the amplitude correlation difference parameter that is between the left channel signal and the right channel signal in the current frame and has been subjected to mapping processing, MAP_HIGH represents the high threshold value of the amplitude correlation difference parameter that is between the left channel signal and the right channel signal in the current frame and has been subjected to mapping processing, MAP_LOW represents the low threshold value of the amplitude correlation difference parameter that is between the left channel signal and the right channel signal in the current frame and has been subjected to mapping processing, MAP_MIN represents the minimum value of the amplitude correlation difference parameter that is between the left channel signal and the right channel signal in the current frame and has been subjected to mapping processing, MAP_MAX > MAP_HIGH > MAP_LOW > MAP_MIN, RATIO_MAX represents the maximum value of the amplitude-limited amplitude correlation difference parameter between the left-channel signal and the right-channel signal in the current frame, and RATIO_HIGH represents the of amplitude limited amplitude high threshold value of the correlation difference parameter between the left-channel signal and the right-channel signal in the current frame, and RATIO_LOW represents the of amplitude limited amplitude low threshold value of the correlation difference parameter between the left-channel signal and the right-channel signal in the current frame, and RATIO_MIN represents the of amplitude limited amplitude minimum value of the correlation difference parameter, and RATIO_MAX > RATIO_HIGH > RATIO_LOW > RATIO_MIN.
[0834] For another example,
[0835]
Number
[0836] and here, diff_lt_corr_limit represents the amplitude-limited amplitude correlation difference parameter between the left-channel signal and the right-channel signal in the current frame, and diff_lt_corr_map represents the amplitude correlation difference parameter that exists between the left-channel signal and the right-channel signal in the current frame and has been subjected to mapping processing.
[0837]
Number
[0838] and RATIO_MAX indicates the maximum amplitude of the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame, and -RATIO_MAX indicates the minimum amplitude of the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame.
[0839] In some possible implementations,
[0840]
Number
[0841] and here, diff_lt_corr_map indicates the amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame that has been subjected to mapping processing, and ratio_SM indicates the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, or ratio_SM indicates the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0842] In some implementations of the present application, in a scenario where the channel combination ratio coefficient needs to be corrected, the correction may be performed before or after the channel combination ratio coefficient is encoded. Specifically, for example, the initial value of the channel combination ratio coefficient of the current frame (e.g., the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme or the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme) may be first obtained through calculation, and then the initial value of the channel combination ratio coefficient is encoded to obtain the initial encoded index of the channel combination ratio coefficient of the current frame, and the obtained initial encoded index of the channel combination ratio coefficient of the current frame is corrected to obtain the encoded index of the channel combination ratio coefficient of the current frame (obtaining the encoded index of the channel combination ratio coefficient of the current frame is equivalent to obtaining the channel combination ratio coefficient of the current frame). Alternatively, the initial value of the channel combination ratio coefficient of the current frame may be first obtained through calculation, and then the initial value of the channel combination ratio coefficient of the current frame obtained through calculation is corrected to obtain the channel combination ratio coefficient of the current frame, and the obtained channel combination ratio coefficient of the current frame is encoded to obtain the encoded index of the channel combination ratio coefficient of the current frame.
[0843] There are various ways to modify the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame. For example, when the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame needs to be modified to obtain the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame may be modified based on the channel combination ratio coefficient of the previous frame and the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame. Or the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame may be modified based on the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0844] For example, first, it is determined based on the long-term smoothed frame energy of the left channel signal in the current frame, the long-term smoothed frame energy of the right channel signal in the current frame, the inter-frame energy difference of the left channel signal in the current frame, the buffered encoding 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 combination scheme flags of the current frame and the previous frame, the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame, and the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame whether it is necessary to correct the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame. If correction is necessary, the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame is used as the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame. Otherwise, the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame is used as the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0845] Of course, the specific implementation of correcting the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame to obtain the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame is not limited to the above example.
[0846] 803. Encode the determined time-domain stereo parameters of the current frame.
[0847] In some possible implementations, the quantization encoding is performed on the determined channel combination ratio coefficients corresponding to the anti-correlation signal channel combination scheme for the current frame, ratio_init_SM qua = ratio_tabl[ratio_idx_init_SM], where ratio_tabl_SM represents a codebook for performing scalar quantization for the channel combination ratio coefficients corresponding to the anti-correlation signal channel combination scheme for the current frame, ratio_idx_init_SM represents the initial encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, and ratio_init_SM qua represents the quantized encoded initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0848] In some possible implementations, ratio_idx_SM = ratio_idx_init_SM, and ratio_SM = ratio_tabl[ratio_idx_SM], where ratio_SM represents the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, ratio_idx_SM represents the encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, or ratio_idx_SM = φ * ratio_idx_init_SM+(1 - φ)*tdm_last_ratio_idx_SM, and ratio_SM = ratio_tabl[ratio_idx_SM], where The ratio_idx_init_SM indicates the initially encoded index corresponding to the anti-correlation signal channel combination scheme for the current frame, the tdm_last_ratio_idx_SM indicates the finally encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame,
[0849]
Number
[0850] is the correction coefficient of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme, and the ratio_SM indicates the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0851] In some possible implementations, when the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame needs to be modified to obtain the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, quantization encoding may first be performed on the initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame in order to obtain the initial encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame. Subsequently, the initial encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame may be modified based on the encoded index of the channel combination ratio coefficient of the previous frame corresponding to the anti-correlation signal channel combination scheme for the current frame and the initial encoded index of the channel combination ratio coefficient. Alternatively, the initial encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame may be modified based on the initial encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0852] For example, quantization encoding may first be performed on the initial value of the channel combination ratio coefficient corresponding to the decorrelation signal channel combination scheme for the current frame in order to obtain the initially encoded index corresponding to the decorrelation signal channel combination scheme for the current frame. Then, when the initial value of the channel combination ratio coefficient corresponding to the decorrelation signal channel combination scheme for the current frame needs to be corrected, the encoded index of the channel combination ratio coefficient corresponding to the decorrelation signal channel combination scheme for the previous frame is used as the encoded index of the channel combination ratio coefficient corresponding to the decorrelation signal channel combination scheme for the current frame. Otherwise, the initially encoded index of the channel combination ratio coefficient corresponding to the decorrelation signal channel combination scheme for the current frame is used as the encoded index of the channel combination ratio coefficient corresponding to the decorrelation signal channel combination scheme for the current frame. Finally, the quantized encoded value corresponding to the encoded index of the channel combination ratio coefficient corresponding to the decorrelation signal channel combination scheme for the current frame is used as the channel combination ratio coefficient corresponding to the decorrelation signal channel combination scheme for the current frame.
[0853] In addition, when the time-domain stereo parameter includes an inter-channel time difference, determining the time-domain stereo parameter for the current frame based on the channel combination scheme for the current frame may include calculating the inter-channel time difference for the current frame when the channel combination scheme for the current frame is a correlation signal channel combination scheme. In addition, the inter-channel time difference for the current frame obtained through the calculation may be written into the bit stream. The default inter-channel time difference (e.g., 0) is used as the inter-channel time difference for the current frame when the channel combination scheme for the current frame is an anti-correlation signal channel combination scheme. In addition, the default inter-channel time difference may not be written into the bit stream, and the decoding device also uses the default inter-channel time difference.
[0854] The following further provides a time-domain stereo parameter encoding method by using examples. This method may include, for example, determining a channel combination scheme for the current frame, determining the time-domain stereo parameter for the current frame based on the channel combination scheme for the current frame, and encoding the determined time-domain stereo parameter for the current frame, where the time-domain stereo parameter may include at least one of a channel combination ratio coefficient and an inter-channel time difference.
[0855] Correspondingly, the decoding device may obtain the time-domain stereo parameter for the current frame from the bit stream and further perform related decoding based on the time-domain stereo parameter for the current frame obtained from the bit stream.
[0856] The following provides an explanation by using examples related to more specific application scenarios.
[0857] FIG. 9-A is a schematic flowchart of an audio encoding method according to an embodiment of the present application. The audio encoding method provided in the present embodiment of the present application may be implemented by an encoding device, and this method may specifically include the following steps.
[0858] 901. Perform time-domain preprocessing on the original left and right channel signals in the current frame.
[0859] For example, when the sampling rate of a stereo audio signal is 16 KHz, one frame of the signal is 20 ms, the frame length is denoted as N, and when N = 320, it indicates that the frame length is 320 sampling points. The stereo signal in the current frame may include the left channel signal in the current frame and the right channel signal in the current frame. The original left channel signal in the current frame is x L denoted as (n), and the original right channel signal in the current frame is x R denoted as (n), where n is the number of the sampling point, and n = 0, 1,..., N - 1.
[0860] For example, performing time-domain preprocessing on the original left and right channel signals in the current frame means performing high-pass filtering processing on the original left and right channel signals in the current frame to obtain the left and right channel signals subjected to time-domain preprocessing in the current frame. The left channel signal subjected to time-domain preprocessing in the current frame is x L_HP denoted as (n), and the right channel signal subjected to time-domain preprocessing in the current frame is x R_HP denoted as (n), which may include performing. In this specification, n is the number of the sampling point, and n = 0, 1,..., N - 1. The filter used in the high-pass filtering processing is, for example, an infinite impulse response with a cut-off frequency of 20 Hz ( Infinite Impulse Response、 It may be an IIR filter or another type of filter.
[0861] For example, when the sampling rate is 16 KHz, the transfer function of a high-pass filter corresponding to a cut-off frequency of 20 Hz is
[0862] [Number]
[0863] It may be, where b0 = 0.994461788958195, b1 = -1.988923577916390, b2 = 0.994461788958195, a1 = 1.988892905899653, a2 = -0.988954249933127, and z is the transform coefficient of the Z-transform.
[0864] The transfer function of the corresponding time-domain filter is x L_HP (n) = b0 * x L (n) + b1 * x L (n - 1) + b2 * x L (n - 2) - a1 * x L_HP (n - 1) - a2 * x L_HP (n - 2), and x R_HP (n) = b0 * x R (n) + b1 * x R (n - 1) + b2 * x R (n - 2) - a1 * x R_HP (n - 1) - a2 * x R_HP (n - 2) may be expressed as.
[0865] 902. To obtain the left and right channel signals subjected to delay alignment processing in the current frame, delay alignment processing is performed on the left and right channel signals subjected to time-domain preprocessing in the current frame.
[0866] A signal subjected to delay alignment processing may be simply referred to as a "delay-aligned signal". For example, a left-channel signal subjected to delay alignment processing may be simply referred to as a "delay-aligned left-channel signal", and a right-channel signal subjected to delay alignment processing may be simply referred to as a "delay-aligned right right-channel signal", and so on for the following.
[0867] Specifically, the inter-channel delay parameter may be extracted based on the pre-processed left and right channel signals in the current frame and then encoded. The delay alignment processing is performed on the left and right channel signals based on the encoded inter-channel delay parameter in order to obtain the left and right channel signals subjected to delay alignment processing in the current frame. The left-channel signal subjected to delay alignment processing in the current frame is denoted as x’ L (n), and the right-channel signal subjected to delay alignment processing in the current frame is denoted as x’ R (n), where n is the sampling point number, and n = 0, 1, …, N - 1.
[0868] Specifically, for example, the encoding device calculates the time-domain cross-correlation functions of the left and right channels based on the pre-processed left and right channel signals in the current frame, searches for the maximum value (or another value) of the time-domain cross-correlation functions of the left and right channels in order to determine the time difference between the left-channel signal and the right-channel signal, performs quantization encoding on the determined time difference between the left and right channels, uses the signal of one channel selected from the left and right channels as a reference, and performs delay adjustment for the signals of the other channel based on the quantized encoded time difference between the left and right channels in order to obtain the left and right channel signals subjected to delay alignment processing in the current frame.
[0869] There are many specific implementation methods for the delay alignment process, and it should be noted that in this embodiment, no specific delay alignment process method is limited.
[0870] 903. Perform time-domain analysis for the left and right channel signals that have undergone delay alignment processing in the current frame.
[0871] Specifically, the time-domain analysis may include transient detection and the like. Transient detection may be energy detection performed on the left and right channel signals that have undergone delay alignment processing in the current frame (specifically, it may be detected whether the current frame has a sudden energy change). For example, the energy of the left channel signal that has undergone delay alignment processing in the current frame is E cur_L and is represented as, and the energy of the left channel signal that has undergone delay alignment in the previous frame is E pre_L and is represented as. In this case, transient detection may be performed based on the absolute value of the difference between E pre_L and E cur_L to obtain the transient detection result of the left channel signal that has undergone delay alignment processing in the current frame. Similarly, transient detection may be performed on the right channel signal that has undergone delay alignment processing in the current frame by using the same method. The time-domain analysis may further include another conventional method of time-domain analysis other than transient detection, and may include, for example, preprocessing for frequency band expansion.
[0872] It can be understood that step 903 may be executed at any time after step 902 and before the primary and secondary channel signals in the current frame are encoded.
[0873] To determine the channel combination scheme for the current frame, perform a channel combination scheme determination for the current frame based on the left and right channel signals that have undergone delay alignment processing in the current frame.
[0874] Two possible channel combination schemes are described as examples in this embodiment, and in the following description, they are referred to as the correlation signal channel combination scheme and the anti-correlation signal channel combination scheme, respectively. In this embodiment, the correlation signal channel combination scheme corresponds to the case where the left and right channel signals (obtained after delay alignment) in the current frame are signals that are close to being in phase, and the anti-correlation signal channel combination scheme corresponds to the case where the left and right channel signals (obtained after delay alignment) in the current frame are signals that are close to being in anti-phase. Of course, in addition to the "correlation signal channel combination scheme" and the "anti-correlation signal channel combination scheme", other names may also be used to represent the two possible channel combination schemes in actual applications.
[0875] In some solutions of this embodiment, the channel combination scheme determination may be classified into an initial channel combination scheme determination and a channel combination scheme change determination. It can be understood that the channel combination scheme determination is performed on the current frame to determine the channel combination scheme for the current frame. For some examples of the implementation of determining the channel combination scheme for the current frame, refer to the relevant descriptions in the above embodiments. Details will not be described again in this specification.
[0876] To obtain the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the encoded index of the initial value, calculate and encode the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame based on the left and right channel signals subjected to delay alignment processing in the current frame and the channel combination scheme flag of the current frame.
[0877] Specifically, for example, the frame energies of the left and right channel signals in the current frame are first calculated based on the left and right channel signals subjected to delay alignment processing in the current frame, where the frame energy rms_L of the left channel signal in the current frame is
[0878]
Number
[0879] satisfies the frame energy rms_R of the right channel signal in the current frame is
[0880]
Number
[0881] satisfies, where x’ L (n) represents the left channel signal subjected to delay alignment processing in the current frame, x’ R (n) represents the right channel signal subjected to delay alignment processing in the current frame.
[0882] Thereafter, a channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is calculated based on the frame energy of the left channel and the frame energy of the right channel in the current frame. The channel combination ratio coefficient ratio_init corresponding to the correlation signal channel combination scheme for the current frame, obtained through the calculation, satisfies
[0883] [Number]
[0884] and satisfies.
[0885] Thereafter, quantization encoding is performed on the channel combination ratio coefficient ratio_init corresponding to the correlation signal channel combination scheme for the current frame, obtained through the calculation, in order to obtain the corresponding encoded index ratio_idx_init and the quantized encoded channel combination ratio coefficient ratio_init for the quantization current frame. qua The quantization encoding is performed on the channel combination ratio coefficient ratio_init corresponding to the correlation signal channel combination scheme for the current frame, obtained through the calculation. ratio_init qua =ratio_tabl[ratio_idx_init]
[0886] In this specification, ratio_tabl is a codebook for scalar quantization. The quantization encoding may be performed by using any conventional scalar quantization method, for example, uniform scalar quantization or non-uniform scalar quantization. The amount of bits used for encoding is, for example, 5 bits. The specific scalar quantization method is not described again in this specification.
[0887] The quantized encoded channel combination ratio coefficient ratio_init corresponding to the correlation signal channel combination scheme for the current frame quais the obtained initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, and the encoded index ratio_idx_init is the encoded index corresponding to the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0888] In addition, the encoded index corresponding to the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame may be further corrected based on the value of the channel combination scheme flag tdm_SM_flag of the current frame.
[0889] For example, the quantization encoding is 5-bit scalar quantization. When tdm_SM_flag = 1, the encoded index ratio_idx_init corresponding to the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is corrected to a preset value (for example, 15 or another value), and the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is ratio_init qua =ratio_tabl
[15] may be corrected.
[0890] In addition to the above calculation method, it should be noted that any method for calculating the channel combination ratio coefficient corresponding to the channel combination scheme in the conventional time-domain stereo encoding technology may be used to calculate the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame. Alternatively, the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame may be directly set to a fixed value (for example, 0.5 or another value).
[0891] Based on the channel combination ratio coefficient correction flag, it is determined whether the channel combination ratio coefficient needs to be corrected.
[0892] If it is necessary to be corrected, the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the encoded index of the channel combination ratio coefficient are corrected to obtain the corrected value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the encoded index of this corrected value.
[0893] The channel combination ratio coefficient correction flag for the current frame is denoted as tdm_SM_modi_flag. For example, when the value of the channel combination ratio coefficient correction flag is 0, it indicates that the channel combination ratio coefficient does not need to be corrected. Or, when the value of the channel combination ratio coefficient correction flag is 1, it indicates that the channel combination ratio coefficient needs to be corrected. Of course, other different values may be used as the channel combination ratio coefficient correction flag to indicate whether the channel combination ratio coefficient needs to be corrected.
[0894] For example, determining whether the channel combination ratio coefficient needs to be corrected based on the channel combination ratio coefficient correction flag may specifically include, for example, when the channel combination ratio coefficient correction flag tdm_SM_modi_flag = 1, it is determined that the channel combination ratio coefficient needs to be corrected. For another example, when the channel combination ratio coefficient correction flag tdm_SM_modi_flag = 0, it is determined that the channel combination ratio coefficient does not need to be corrected.
[0895] Correcting the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and the encoded index of the channel combination ratio coefficient specifically means For example, the encoded index corresponding to the correction value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame satisfies ratio_idx_mod = 0.5 * (tdm_last_ratio_idx + 16), where tdm_last_ratio_idx is the encoded index of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame. may be included.
[0896] The correction value ratio_mod of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame qua is such that ratio_mod qua = ratio_tabl[ratio_idx_mod].
[0897] 907. Based on the initial value and the encoded index of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, the correction value and the encoded index of the correction value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, and the channel combination ratio coefficient correction flag, determine the channel combination ratio coefficient ratio and the encoded index ratio_idx corresponding to the correlation signal channel combination scheme for the current frame.
[0898] Specifically, for example, the determined channel combination ratio coefficient ratio corresponding to the correlation signal channel combination scheme
[0899]
Equation
[0900] is satisfied, where ratio_init quaindicates the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, ratio_mod qua indicates the correction value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, and tdm_SM_modi_flag indicates the channel combination ratio coefficient correction flag for the current frame.
[0901] The determined encoded index ratio_idx corresponding to the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme is
[0902] [Number]
[0903] satisfies, where ratio_idx_init indicates the encoded index corresponding to the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame, and ratio_idx_mod indicates the encoded index corresponding to the correction value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0904] 908. Determine whether the channel combination scheme flag of the current frame corresponds to the anti-correlation signal channel combination scheme. If so, calculate and encode the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame in order to obtain the channel combination ratio coefficient and the encoded index corresponding to the anti-correlation signal channel combination scheme.
[0905] First, it may be determined whether the history buffer used to calculate the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame needs to be reset.
[0906] For example, when the channel combination scheme flag tdm_SM_flag of the current frame is equal to 1 (for example, the fact that tdm_SM_flag is equal to 1 indicates that the channel combination scheme flag of the current frame corresponds to the anti-correlation signal channel combination scheme), and the channel combination scheme flag tdm_SM_flag of the previous frame is equal to 0 (for example, the fact that tdm_SM_flag is equal to 0 indicates that previous the channel combination scheme flag of the frame corresponds to the correlation signal channel combination scheme), it indicates that the history buffer used to calculate the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame needs to be reset.
[0907] The history buffer reset flag tdm_SM_reset_flag may be determined in the processes of initial channel combination scheme determination and channel combination scheme modification determination. Subsequently, it should be noted that the value of the history buffer reset flag is determined to decide whether the history buffer used to calculate the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame needs to be reset. For example, when tdm_SM_reset_flag is 1, it indicates that the channel combination scheme flag of the current frame corresponds to the anti-correlation signal channel combination scheme, and the channel combination scheme flag of the previous frame corresponds to the correlation signal channel combination 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 combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame needs to be reset. There are many specific reset methods. All parameters in the history buffer used to calculate the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame may be reset based on preset initial values. Alternatively, some parameters in the history buffer used to calculate the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame may be reset based on preset initial values. Alternatively, some parameters in the history buffer used to calculate the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame may be reset based on preset initial values, and other parameters may be reset based on the corresponding parameters in the history buffer used to calculate the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame.
[0908] Thereafter, it is further determined whether the channel combination scheme flag tdm_SM_flag of the current frame corresponds to the anti-correlation signal channel combination scheme. The anti-correlation signal channel combination scheme is a suitable channel combination scheme by performing time-domain downmixing on a stereo signal close to the opposite phase. In the present embodiment, when the channel combination scheme flag tdm_SM_flag of the current frame = 1, it indicates that the channel combination scheme flag of the current frame corresponds to the anti-correlation signal channel combination scheme. When the channel combination scheme flag tdm_SM_flag of the current frame = 0, it indicates that the channel combination scheme flag of the current frame corresponds to the correlation signal channel combination scheme.
[0909] Specifically, determining whether the channel combination scheme flag of the current frame corresponds to the anti-correlation signal channel combination scheme may include determining whether the value of the channel combination scheme flag of the current frame is 1. When the channel combination scheme flag tdm_SM_flag of the current frame = 1, it indicates that the channel combination scheme flag of the current frame corresponds to the anti-correlation signal channel combination scheme. In this case, the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame may be calculated and encoded.
[0910] Referring to FIG. 9-B, calculating and encoding the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame may include, for example, the following steps 9081 to 9085.
[0911] 9081. Perform signal energy analysis for the left and right channel signals subjected to delay line alignment processing in the current frame.
[0912] The frame energy of the left channel signal in the current frame, the frame energy of the right channel signal in the current frame, the long-term smoothed frame energy of the left channel in the current frame, the long-term smoothed frame energy of the right channel in the current frame, the inter-frame energy difference of the left channel in the current frame, and the inter-frame energy difference of the right channel in the current frame are separately obtained.
[0913] For example, the frame energy rms_L of the left channel signal in the current frame is
[0914]
Equation
[0915] satisfies The frame energy rms_R of the right channel signal in the current frame is
[0916]
Equation
[0917] satisfies, where x’ L (n) represents the left channel signal subjected to delay alignment processing in the current frame, x’ R (n) represents the right channel signal subjected to delay alignment processing in the current frame.
[0918] For example, the long-term smoothed frame energy tdm_lt_rms_L_SM of the left channel in the current frame cur is tdm_lt_rms_L_SM cur =(1 - A)*tdm_lt_rms_L_SM pre + A*rms_L satisfies, where tdm_lt_rms_L_SMpre represents the long-term smoothed frame energy of the left channel in the previous frame, A represents the update coefficient of the long-term smoothed frame energy of the left channel, A may be, for example, a real number from 0 to 1, and A may be, for example, equal to 0.4.
[0919] For example, the long-term smoothed frame energy tdm_lt_rms_R_SM of the right channel in the current frame cur is tdm_lt_rms_R_SM cur =(1 - B)*tdm_lt_rms_R_SM pre + B*rms_R, where tdm_lt_rms_R_SM pre represents the long-term smoothed frame energy of the right channel in the previous frame, B represents the update coefficient of the long-term smoothed frame energy of the right channel, B may be, for example, a real number from 0 to 1, and B may be, for example, 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.
[0920] For example, the inter-frame energy difference ener_L_dt of the left channel in the current frame is ener_L_dt = tdm_lt_rms_L_SM cur - tdm_lt_rms_L_SM pre satisfies.
[0921] For example, the inter-frame energy difference ener_R_dt of the right channel in the current frame is ener_R_dt = tdm_lt_rms_R_SM cur - tdm_lt_rms_R_SM pre satisfies.
[0922] 9082. Determine the reference channel signal in the current frame based on the left and right channel signals subjected to delay alignment processing in the current frame. The reference channel signal may also be referred to as a monaural signal. When the reference channel signal is referred to as a monaural signal, for all descriptions and parameter names related to the reference channel, the reference channel signal may be exchanged with the monaural signal.
[0923] For example, the reference channel signal mono_i(n) satisfies
[0924]
Equation
[0925] where x’ L (n) is the left channel signal subjected to delay alignment processing in the current frame, and x’ R (n) is the right channel signal subjected to delay alignment processing in the current frame.
[0926] 9083. Calculate separately the amplitude correlation parameter between the left channel signal subjected to delay alignment processing and the reference channel signal in the current frame, and the amplitude correlation parameter between the right channel signal subjected to delay alignment processing and the reference channel signal in the current frame.
[0927] For example, the amplitude correlation parameter corr_LM between the left channel signal subjected to delay alignment processing and the reference channel signal in the current frame satisfies, for example,
[0928]
Equation
[0929] where
[0930] For example, the amplitude correlation parameter corr_RM between the right channel signal subjected to delay alignment processing and the reference channel signal in the current frame satisfies, for example,
[0931] [Number]
[0932] .
[0933] In this specification, x’ L (n) represents the left channel signal subjected to delay alignment processing in the current frame, x’ R (n) represents the right channel signal subjected to delay alignment processing in the current frame, mono_i(n) represents the reference channel signal in the current frame, and |●| indicates that the absolute value is adopted.
[0934] 9084. Based on the amplitude correlation parameter between the left channel signal subjected to delay alignment processing and the reference channel signal in the current frame and the amplitude correlation parameter between the right channel signal subjected to delay alignment processing and the reference channel signal in the current frame, calculate the amplitude correlation difference parameter diff_lt_corr between the left channel and the right channel in the current frame.
[0935] It can be understood that step 9081 may be executed before step 9082 and step 9083, or may be executed after step 9082 and step 9083 and before step 9084.
[0936] Referring to FIG. 9-C, for example, calculating the amplitude correlation difference parameter diff_lt_corr between the left channel and the right channel in the current frame may specifically include the following steps 90841 and 90842.
[0937] Based on the amplitude correlation parameter between the left channel signal subjected to delay alignment processing in the current frame and the reference channel signal, and the amplitude correlation parameter between the right channel signal subjected to delay alignment processing in the current frame and the reference channel signal, calculate the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, and the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame.
[0938] For example, a method for calculating the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, and the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame is that the long-term smoothed amplitude correlation parameter tdm_lt_corr_LM_SM between the left channel signal and the reference channel signal in the current frame tdm_lt_corr_LM_SM cur =α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM may include satisfying this.
[0939] In this specification, tdm_lt_corr_LM_SM cur represents the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, dm_lt_corr_LM_SM pre represents the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the previous frame, α represents the left channel smoothing coefficient, and α may be a preset real number from 0 to 1, for example, 0.2, 0.5, or 0.8. Alternatively, the value of α may be obtained through adaptive calculation.
[0940] For example, the long-term smoothed amplitude correlation parameter tdm_lt_corr_RM_SM between the right channel signal and the reference channel signal in the current frame is tdm_lt_corr_RM_SM cur = β * tdm_lt_corr_RM_SM pre + (1 - β) corr_LM satisfies.
[0941] In this specification, tdm_lt_corr_RM_SM cur represents the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame, tdm_lt_corr_RM_SM pre represents the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the previous frame, β represents the right channel smoothing coefficient, and β may be a preset real number from 0 to 1. Β may be the same as the value of the left channel smoothing coefficient α or different from it, and β may be equal to, for example, 0.2, 0.5, or 0.8. Alternatively, the value of β may be obtained through adaptive calculation.
[0942] Another method for calculating the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame and the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame is First, to obtain the modified amplitude correlation parameter corr_LM_mod between the left channel signal and the reference channel signal in the current frame, correct the amplitude correlation parameter corr_LM between the left channel signal and the reference channel signal subjected to delay alignment processing in the current frame, and to obtain the modified amplitude correlation parameter corr_RM_mod between the right channel signal and the reference channel signal in the current frame, correct the amplitude correlation parameter corr_RM between the right channel signal and the reference channel signal subjected to delay alignment processing in the current frame, After that, the corrected amplitude correlation parameter corr_LM_mod between the left channel signal and the reference channel signal in the current frame, the corrected amplitude correlation parameter corr_RM_mod between the right channel signal and the reference channel signal in the current frame, the long-term smoothed amplitude correlation parameter tdm_lt_corr_LM_SM between the left channel signal and the reference channel signal in the previous frame pre , and the long-term smoothed amplitude correlation parameter tdm_lt_corr_RM_SM between the right channel signal and the reference channel signal in the previous frame pre Based on these, determine the long-term smoothed amplitude correlation difference parameter diff_lt_corr_LM_tmp between the left channel signal and the reference channel signal in the current frame and current the long-term smoothed amplitude correlation difference parameter diff_lt_corr_RM_tmp between the right channel signal and the reference channel signal in the frame of After that, based on the long-term smoothed amplitude correlation difference parameter diff_lt_corr_LM_tmp between the left channel signal and the reference channel signal in the current frame and current the long-term smoothed amplitude correlation difference parameter diff_lt_corr_RM_tmp between the right channel signal and the reference channel signal in the frame of, obtain the initial value diff_lt_corr_SM of the amplitude correlation difference parameter between the left channel and the right channel in the current frame, and based on the obtained initial value diff_lt_corr_SM of the amplitude correlation difference parameter between the left channel and the right channel in the current frame and the amplitude correlation difference parameter tdm_last_diff_lt_corr_SM between the left channel and the right channel in the previous frame, determine the inter-frame variation parameter d_lt_corr of the amplitude correlation difference between the left channel and the right channel in the current frame Finally, based on the frame energy of the left channel signal in the current frame, the frame energy of the right channel signal in the current frame, the long-term smoothed frame energy of the left channel in the current frame, the long-term smoothed frame energy of the right channel in the current frame, the inter-frame energy difference of the left channel in the current frame, and the inter-frame energy difference of the right channel in the current frame, as well as the inter-frame variation parameter of the amplitude correlation difference between the left channel and the right channel in the current frame, adaptively select different left channel smoothing coefficients and right channel smoothing coefficients, and calculate the long-term smoothed amplitude correlation parameter tdm_lt_corr_LM_SM between the left channel signal and the reference channel signal in the current frame and the long-term smoothed amplitude correlation parameter tdm_lt_corr_RM_SM between the right channel signal and the reference channel signal in the current frame may include.
[0943] In addition to the two methods given as examples above, there can be many ways to calculate the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame and the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame. This is not limited in this application.
[0944] 90842. Calculate the amplitude correlation difference parameter diff_lt_corr between the left channel and the right channel in the current frame based on the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame and the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame.
[0945] For example, the amplitude correlation difference parameter diff_lt_corr between the left channel and the right channel in the current frame is diff_lt_corr = tdm_lt_corr_LM_SM - tdm_lt_corr_RM_SM is satisfied, where tdm_lt_corr_LM_SM represents the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, and tdm_lt_corr_RM_SM represents the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame.
[0946] 9085. Convert the amplitude correlation difference parameter diff_lt_corr between the left channel and the right channel in the current frame to a channel combination ratio coefficient, and perform encoding and quantization so as to determine the channel combination ratio coefficient and the encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0947] Referring to FIG. 9-D, a possible method for converting the amplitude correlation difference parameter between the left channel and the right channel in the current frame to a channel combination ratio coefficient may specifically include steps 90851 to 90853.
[0948] 90851. Perform a mapping process on the amplitude correlation difference parameter between the left channel and the right channel to enable the value range of the amplitude correlation difference parameter subjected to the mapping process between the left channel and the right channel to be [MAP_MIN, MAP_MAX].
[0949] A method for performing a mapping process on the amplitude correlation difference parameter between the left channel and the right channel may include the following steps.
[0950] First, an amplitude limit is performed on the amplitude correlation difference parameter between the left channel and the right channel. For example, the amplitude-limited amplitude correlation difference parameter diff_lt_corr_limit between the left channel and the right channel is
[0951]
Number
[0952] satisfies.
[0953] In this specification, RATIO_MAX represents the maximum value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, and RATIO_MIN represents the minimum value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel. For example, RATIO_MAX is a preset empirical value, and RATIO_MAX may be 1.5, 3.0, or another value. RATIO_MIN is a preset empirical value, and RATIO_MIN may be -1.5, -3.0, or another value, where RATIO_MAX > RATIO_MIN.
[0954] Subsequently, mapping processing is performed on the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel. The amplitude correlation difference parameter diff_lt_corr_map that is between the left channel and the right channel and is subjected to mapping processing is
[0955]
Number
[0956] satisfies, where
[0957]
Number
[0958] is, B1 = MAP_MAX - RATIO_MAX * A1 or B1 = MAP_HIGH - RATIO_HIGH * A1,
[0959]
Number
[0960] and B2 = MAP_LOW-RATIO_LOW * A2 or B2 = MAP_MIN-RATIO_MIN * A2
[0961] [Number]
[0962] and B3 = MAP_HIGH-RATIO_HIGH * A3 or B3 = MAP_LOW-RATIO_LOW * A3 is
[0963] In this specification, MAP_MAX represents the maximum value of the amplitude correlation difference parameter that is between the left channel and the right channel and has been subjected to mapping processing, MAP_HIGH represents the high threshold value of the amplitude correlation difference parameter that is between the left channel and the right channel and has been subjected to mapping processing, MAP_LOW represents the low threshold value of the amplitude correlation difference parameter that is between the left channel and the right channel and has been subjected to mapping processing, and MAP_MIN represents the minimum value of the amplitude correlation difference parameter that is between the left channel and the right channel and has been subjected to mapping processing. Here, MAP_MAX > MAP_HIGH > MAP_LOW > MAP_MIN is
[0964] 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 actual applications, the values are not limited to such examples.
[0965] RATIO_MAX represents the maximum value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, RATIO_HIGH represents the high threshold value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, RATIO_LOW represents the low threshold value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, and RATIO_MIN represents the minimum value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, where RATIO_MAX > RATIO_HIGH > RATIO_LOW > RATIO_MIN is true.
[0966] 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 actual applications, the values are not limited to such examples.
[0967] Another method in some embodiments of the present application is as follows. The amplitude correlation difference parameter diff_lt_corr_map that is between the left channel and the right channel and is subjected to mapping processing satisfies
[0968]
Number
[0969] is satisfied.
[0970] In this specification, diff_lt_corr_limit represents the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, where
[0971]
Number
[0972] is true.
[0973] In this specification, RATIO_MAX represents the maximum amplitude of the amplitude correlation difference parameter between the left channel and the right channel, and -RATIO_MAX represents the minimum amplitude of the amplitude correlation difference parameter between the left channel and the right channel. 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.
[0974] 90852. Convert the amplitude correlation difference parameter between the left channel and the right channel, which has been subjected to mapping processing, into a channel combination ratio coefficient.
[0975] The channel combination ratio coefficient ratio_SM satisfies
[0976]
Equation
[0977] where cos(·) represents the cosine operation. cos(·) represents the cosine operation.
[0978] In addition to the above method, another method is used to convert the amplitude correlation difference parameter between the left channel and the right channel into a channel combination ratio coefficient. For example, Whether the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme needs to be updated is determined based on the long-term smoothed frame energy of the left channel in the current frame, the long-term smoothed frame energy of the right channel in the current frame, and the inter-frame energy difference of the left channel in the current frame, which are obtained through signal energy analysis, the buffered encoding parameters of the previous frame in the encoder history buffer (for example, the inter-frame correlation parameters of the primary channel signal and the inter-frame correlation parameters of the secondary channel signal), the channel combination scheme flags of the current frame and the previous frame, and the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame and the previous frame.
[0979] If the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme needs to be updated, the amplitude correlation difference parameter between the left channel and the right channel is converted into the channel combination ratio coefficient by using the method in the above example. Otherwise, the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame and the encoded index of the channel combination ratio coefficient are directly used as the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame and the encoded index of the channel combination ratio coefficient.
[0980] Perform quantization encoding on the channel combination ratio coefficient obtained after conversion to determine the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0981] Specifically, for example, the quantization encoding corresponds to an initial encoded index ratio_idx_init_SM for the anti-correlation signal channel combination scheme for the current frame and an initial value ratio_init_SM of the quantization encoding of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame qua is obtained by being executed on the channel combination ratio coefficient obtained after conversion, where ratio_init_SM qua = ratio_tabl_SM[ratio_idx_init_SM] is the case.
[0982] In this specification, ratio_tabl_SM indicates a codebook for performing scalar quantization on the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme. The quantization encoding may be performed by using any scalar quantization method in the prior art, for example, uniform scalar quantization or non-uniform scalar quantization. The amount of bits used for encoding may be 5 bits. The specific method is not described in this specification. The codebook for performing scalar quantization on the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme may be the same as or different from the codebook for performing scalar quantization on the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme. When the codebooks are the same, only one codebook used for performing scalar quantization on the channel combination ratio coefficient needs to be stored. In this case, the initial value ratio_init_SM of the quantization encoding of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame qua is ratio_init_SM qua = ratio_tabl[ratio_idx_init_SM] is the case.
[0983] For example, the method directly uses the quantized encoded initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame as the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, and directly uses the initially encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame as the encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0984] The encoded index ratio_idx_SM of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame satisfies ratio_idx_SM = ratio_idx_init_SM where
[0985] The channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame satisfies ratio_SM = ratio_tabl[ratio_idx_SM] where
[0986] Another method is to modify the quantized encoded initial value of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame and the initially encoded index corresponding to the anti-correlation signal channel combination scheme for the current frame based on the encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame or the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame, and use the modified encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame as the encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, and use the modified channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme as the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[0987] The encoded index ratio_idx_SM of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame is ratio_idx_SM = φ * ratio_idx_init_SM+(1 - φ)*tdm_last_ratio_idx_SM satisfies.
[0988] In this specification, ratio_idx_init_SM indicates the initially encoded index corresponding to the anti-correlation signal channel combination scheme for the current frame, and tdm_last_ratio_idx_SM is the encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame.
[0989] [Number]
[0990] is the correction coefficient of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme.
[0991]
Number
[0992] The value of may be an empirical value,
[0993]
Number
[0994] for example, may be equal to 0.8.
[0995] The channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame is ratio_SM = ratio_tabl[ratio_idx_SM] satisfies.
[0996] Another method is to use the unquantized channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme as the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame. In other words, the channel combination ratio coefficient ratio_SM corresponding to the anti-correlation signal channel combination scheme for the current frame is
[0997]
Number
[0998] satisfies.
[0999] In addition, the fourth method modifies the unquantized channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame based on the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the previous frame, and uses the modified channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme as the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame, and performs quantization encoding on the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame in order to obtain the encoded index of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame.
[1000] In addition to the above methods, there may be many ways to convert the amplitude correlation difference parameter between the left channel and the right channel into a channel combination ratio coefficient and perform encoding and quantization. Similarly, there may be many different ways to determine the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame and the encoded index of the channel combination ratio coefficient. This is not limited in this application.
[1001] 909. To determine the coding mode of the current frame, perform coding mode determination based on the channel combination scheme flag of the previous frame and the channel combination scheme flag of the current frame.
[1002] The channel combination scheme flag of the current frame is denoted as tmd_SM_flag, the channel combination scheme flag of the previous frame is denoted as tmd_last_SM_flag, and the joint flag of the channel combination scheme flag of the previous frame and the current frame can be denoted as (tmd_last_SM_flag, tmd_SM_flag). The coding mode determination may be performed based on the joint flag. Details are given in the following example.
[1003] It is assumed that the correlation signal channel combination scheme is represented by 0 and the anti-correlation signal channel combination scheme is represented by 1. In this case, the joint flag of the channel combination scheme flags 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 the correlation signal coding mode, the anti-correlation signal coding mode, the switching mode from correlation to anti-correlation signal coding, and the switching mode from anti-correlation to correlation signal coding. For example, the previous frame and When the joint flag of the channel combination scheme flag of the current frame is (00), it indicates that the coding mode of the current frame is the correlation signal coding mode. the previous frame and When the joint flag of the channel combination scheme flag of the current frame is (11), it indicates that the coding mode of the current frame is the anti-correlation signal coding mode. the previous frame and When the joint flag of the channel combination scheme flag of the current frame is (01), it indicates that the coding mode of the current frame is the switching mode from correlation to anti-correlation signal coding. Or, the previous frame and When the joint flag of the channel combination scheme flag of the current frame is (10), it indicates that the coding mode of the current frame is the switching mode from anti-correlation to correlation signal coding.
[1004] After obtaining the coding mode stereo_tdm_coder_type of the current frame, the encoding apparatus performs time-domain downmix processing on the left and right channel signals in the current frame based on the time-domain downmix processing method corresponding to the coding mode of the current frame in order to obtain the primary and secondary channel signals in the current frame.
[1005] 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 switching mode from correlation to anti-correlation signal coding, a switching mode from anti-correlation to correlation signal coding, a correlation signal coding mode, and an anti-correlation signal coding mode. For the implementation of time-domain downmix processing in different coding modes, refer to the relevant descriptions of the examples in the above embodiments. Details are not described again in this specification.
[1006] 911. The encoding apparatus encodes the primary channel signal and the secondary channel signal separately in order to obtain the encoded primary channel signal and the encoded secondary channel signal.
[1007] Specifically, bit allocation may first be performed for encoding the primary channel signal and / or the secondary channel signal in a previous frame based on parameter information obtained in the encoding of the primary channel signal and / or the secondary channel signal and the total amount of bits for encoding the primary and secondary channel signals. Thereafter, the primary channel signal and the secondary channel signal are separately encoded based on the result of the bit allocation to obtain the encoded index of the primary channel encoding and the encoded index of the secondary channel encoding. The primary channel encoding and the secondary channel encoding may be implemented by using any monoaural audio encoding technique, which will not be further described herein.
[1008] 912. The encoding apparatus selects the corresponding encoded index of the channel combination ratio coefficient based on the channel combination scheme flag, writes the encoded index into the bitstream, and writes the encoded primary channel signal, the encoded secondary channel signal, and the channel combination scheme flag of the current frame into the bitstream.
[1009] Specifically, for example, when the channel combination scheme flag tdm_SM_flag of the current frame corresponds to the correlation signal channel combination scheme, the encoded index ratio_idx of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is written into the bit stream. Or, when the channel combination scheme flag tdm_SM_flag of the current frame corresponds to the anti-correlation signal channel combination scheme, the encoded index ratio_idx_SM of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame is written into the bit stream. For example, when tdm_SM_flag = 0, the encoded index ratio_idx of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is written into the bit stream. Or, when tdm_SM_flag = 1, the encoded index ratio_idx_SM of the channel combination ratio coefficient corresponding to the anti-correlation signal channel combination scheme for the current frame is written into the bit stream.
[1010] In addition, the encoded primary channel signal, the encoded secondary channel signal, and the channel combination scheme flag of the current frame are written into the bit stream. It can be understood that there is no order for performing the bit stream writing operation.
[1011] Correspondingly, the following describes a time-domain stereo decoding scenario by using an example.
[1012] Referring to FIG. 10, the following further provides an audio decoding method. The related steps of the audio decoding method may specifically be implemented by a decoding device, and the method may specifically include the following steps.
[1013] 1001. Execute decoding based on the bitstream to obtain the decoded primary and secondary channel signals in the current frame.
[1014] 1002. Execute decoding based on the bitstream to obtain the time-domain stereo parameters of the current frame.
[1015] The time-domain stereo parameters of the current frame include the channel combination ratio coefficient of the current frame (the bitstream includes the encoded index of the channel combination ratio coefficient of the current frame, and decoding may be executed based on the encoded index of the channel combination ratio coefficient of the current frame to obtain the channel combination ratio coefficient of the current frame), and may further include the inter-channel time difference of the current frame, etc. (for example, the bitstream includes the encoded index of the inter-channel time difference of the current frame, and decoding may be executed based on the encoded index of the inter-channel time difference of the current frame to obtain the inter-channel time difference of the current frame. Or, the bitstream includes the encoded index of the absolute value of the inter-channel time difference of the current frame, and decoding may be executed based on the encoded index of the absolute value of the inter-channel time difference of the current frame to obtain the absolute value of the inter-channel time difference of the current frame).
[1016] 1003. Based on the bitstream, obtain the channel combination scheme flag of the current frame included in the bitstream, and determine the channel combination scheme for the current frame.
[1017] 1004. Based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame, determine the decoding mode of the current frame.
[1018] For determining the decoding mode of the current frame based on the channel combination scheme for the current frame and the channel combination scheme for the previous frame, 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 switching mode from correlation to anti-correlation signal decoding, a switching mode from anti-correlation to correlation signal decoding, a correlation signal decoding mode, and an anti-correlation signal decoding mode. The coding mode and the decoding mode have a one-to-one correspondence.
[1019] For example, the previous frame and if the joint flag of the channel combination scheme flag of the current frame is (00), it indicates that the decoding mode of the current frame is the correlation signal decoding mode. the previous frame and if the joint flag of the channel combination scheme flag of the current frame is (11), it indicates that the decoding mode of the current frame is the anti-correlation signal decoding mode. the previous frame and if the joint flag of the channel combination scheme flag of the current frame is (01), it indicates that the decoding mode of the current frame is the switching mode from correlation to anti-correlation signal decoding. Or, the previous frame and if the joint flag of the channel combination scheme flag of the current frame is (10), it indicates that the decoding mode of the current frame is the switching mode from anti-correlation to correlation signal decoding.
[1020] It can be understood that there is no required order for executing step 1001, step 1002, step 1003, and 1004.
[1021] To obtain the reconstructed left and right channel signals in the current frame, time-domain upmixing processing is performed on the decoded primary and secondary channel signals in the current frame by using a time-domain upmixing processing method corresponding to the determined decoding mode of the current frame.
[1022] For the related implementation of time-domain upmixing processing in different decoding modes, refer to the related description of the examples in the above embodiments. Details are not described again in this specification.
[1023] The upmixing matrix used for time-domain upmixing processing is constructed based on the obtained channel combination ratio coefficient of the current frame.
[1024] The reconstructed left and right channel signals in the current frame may be used as the decoded left and right channel signals in the current frame.
[1025] Alternatively, further, delay adjustment may be performed on the reconstructed left and right channel signals in the current frame based on the inter-channel time difference of the current frame to obtain the reconstructed left and right channel signals with delay adjustment in the current frame, and the reconstructed left and right channel signals with delay adjustment in the current frame may be used as the decoded left and right channel signals in the current frame. Alternatively, further, time-domain post-processing may be performed on the reconstructed left and right channel signals with delay adjustment in the current frame, and the reconstructed left and right channel signals with time-domain post-processing in the current frame may be used as the decoded left and right channel signals in the current frame.
[1026] The above content describes the method in the embodiments of this application in detail. The following describes the apparatus in the embodiments of this application.
[1027] Referring to FIG. 11-A, an embodiment of the present application further provides an apparatus 1100. The apparatus 1100 includes a processor 1110 and a memory 1120 coupled to each other, where the processor 1110 is configured to execute some or all of the steps of any method provided in the embodiments of the present application, the processor 1110 and the memory 1120 may include.
[1028] The memory 1120 includes, but is not limited to, a random access memory ( Random Access Memory 、 RAM), a read-only memory ( Read-Only Memory 、 ROM), an erasable programmable read-only memory ( Erasable Programmable Read Only Memory 、 EPROM), or a compact disc read-only memory ( Compact Disc Read-Only Memory 、 CD-ROM). The memory 1102 is configured to store related instructions and related data.
[1029] Of course, the apparatus 1100 may further include a transceiver 1130 configured to receive and transmit data.
[1030] The processor 1110 may be one or more central processing units ( Central Processing Unit 、 CPU). When the processor 1110 is one CPU, the CPU may be a single-core CPU or a multi-core CPU. Specifically, the processor 1110 may be a digital signal processor.
[1031] In the implementation process, the steps in the above method can be implemented by using the hardware integrated logic circuit in 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 the embodiments of the present invention. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. The steps of the method disclosed in the embodiments of the present invention may be directly executed and accomplished by using a hardware decoding processor, or may be executed and accomplished by using a combination of a hardware module and a software module in the decoding processor.
[1032] The software module may be disposed in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is disposed in the memory 1120. For example, the processor 1110 may read the information in the memory 1120 and complete the steps in the above method in combination with the hardware of the processor 1110.
[1033] Furthermore, the device 1100 may further include a transceiver 1130. The transceiver 1130 may be configured to receive and transmit, for example, related data (such as instructions, channel signals, or bitstreams). For example, the device 1100 may execute some or all of the steps of the corresponding method in any of the embodiments shown in FIGS. 2 to 9-D.
[1034] Specifically, for example, when the apparatus 1100 performs the related steps of the above-described encoding, the apparatus 1100 may be referred to as an encoding apparatus (or an audio encoding apparatus). When the apparatus 1100 performs the related steps of the above-described decoding, the apparatus 1100 may be referred to as a decoding apparatus (or an audio decoding apparatus).
[1035] Referring to FIG. 11-B, when the apparatus 1100 is an encoding apparatus, for example, the apparatus 1100 may further include a microphone 1140 and an analog-to-digital converter 1150, etc.
[1036] For example, the microphone 1140 may be configured to perform sampling to acquire an analog audio signal.
[1037] For example, the analog-to-digital converter 1150 may be configured to convert an analog audio signal into a digital audio signal.
[1038] Referring to FIG. 11-C, when the apparatus 1100 is an encoding apparatus, for example, the apparatus 1100 may further include a speaker 1160 and a digital-to-analog converter 1170, etc.
[1039] For example, the digital-to-analog converter 1170 may be configured to convert a digital audio signal into an analog audio signal.
[1040] For example, the speaker 1160 may be configured to reproduce an analog audio signal.
[1041] In addition, referring to FIG. 12-A, embodiments of the present application provide an apparatus 1200 including several functional units configured to implement any method provided in the embodiments of the present application.
[1042] For example, when device 1200 executes the corresponding method in the embodiment shown in FIG. 2, device 1200 determines a channel combination scheme for the current frame and is configured as a first determination unit 1210 to determine the coding mode of the current frame based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame, and an encoding unit 1220 configured to perform time-domain downmix processing on the left and right channel signals in the current frame based on time-domain downmix processing corresponding to the coding mode of the current frame to obtain primary and secondary channel signals in the current frame. It may sometimes include.
[1043] Furthermore, referring to FIG. 12-B, device 1200 may further include a second determination unit 1230 configured to determine the time-domain stereo parameter of the current frame. Encoding unit 1220 may be further configured to encode the time-domain stereo parameter of the current frame.
[1044] In another example, referring to FIG. 12-C, when device 1200 executes the corresponding method in the embodiment shown in FIG. 3, device 1200 determines a channel combination scheme for the current frame based on the channel combination scheme flag of the current frame in the bitstream and is configured as a third determination unit 1240 to determine the decoding mode of the current frame based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame, A decoding unit 1250 configured to perform decoding based on a bitstream to obtain decoded primary and secondary channel signals in a current frame, and to perform a time-domain upmixing process on the decoded primary and secondary channel signals in the current frame based on a time-domain upmixing process corresponding to a decoding mode of the current frame to obtain reconstructed left and right channel signals in the current frame may be included.
[1045] Cases where the device executes in another way are conjectured by analogy.
[1046] Embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium stores program code, and this program code may include instructions for executing some or all of the steps in any method provided in the embodiments of the present application.
[1047] Embodiments of the present application provide a computer program product. When the computer program product is run on a computer, the computer is capable of executing some or all of the steps in any method provided in the embodiments of the present application.
[1048] In the above embodiments, the description of all embodiments has its respective focus. For parts not described in detail in an embodiment, refer to the relevant description in another embodiment.
[1049] In some embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in another manner. For example, the described apparatus embodiments are merely examples. For example, the unit division is only a logical function division, or may be other divisions in actual implementation. For example, a plurality of units or components may be combined, integrated into another system, or some features may be ignored or not executed. In addition, the indirect or direct coupling or communication connection shown or described between each other may be implemented by using some interfaces. The indirect coupling or communication connection between apparatuses or units may be implemented in an electronic form or in other forms.
[1050] 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. Specifically speaking, the components may be arranged in one position or dispersed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
[1051] In addition, the functional units in the embodiments of the present invention may be integrated into one processing unit, or each of the units may exist physically alone, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[1052] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially, or the part that contributes to the prior art, or all or part of the technical solution may be implemented in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present invention. The above-mentioned storage medium includes any medium that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Claims
1. determining a coding mode for the current frame; when determining that the coding mode of the current frame is an anti-correlated signal coding mode, performing a time-domain down-mix processing on left and right channel signals in the current frame by using a time-domain down-mix processing scheme corresponding to the anti-correlated signal coding mode to obtain primary and secondary channel signals in the current frame, where 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 an anti-correlated signal channel combination scheme, and the anti-correlated signal channel combination scheme is a channel combination scheme corresponding to signals close to antiphase; encoding the acquired primary and secondary channel signals in the current frame; 16. A method for encoding audio, comprising:
2. performing a time-domain down-mix processing on the left and right channel signals in the current frame by using a time-domain down-mix processing manner corresponding to the decorrelated signal coding mode to obtain primary and secondary channel signals in the current frame, performing a time-domain down-mix operation on the left and right channel signals in the current frame based on channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame; or performing a time-domain downmix process on the left and right channel signals in the current frame based on the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for a previous frame to obtain the primary and secondary channel signals in the current frame. The method of claim 1 , comprising:
3. when a time-domain downmix operation is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame to obtain the primary and secondary channel signals in the current frame, [0010] where: X L (n) denotes the left channel signal in the current frame, and X R (n) denotes the right channel signal in the current frame, Y(n) denotes the primary channel signal in the current frame and obtained through the time-domain down-mixing process, and X(n) denotes the secondary channel signal in the current frame and obtained through the time-domain down-mixing process; n indicates the number of the sampling point, and M 22 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, and M 22 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame. The method of claim 2.
4. when a time-domain downmix process is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the previous frame to obtain the primary and secondary channel signals in the current frame; If 0≦n<N-delay_com, [0025] or If N-delay_com≦n<N, [0030] where: X L (n) denotes the left channel signal in the current frame, and X R (n) denotes the right channel signal in the current frame, Y(n) denotes the primary channel signal in the current frame and obtained through the time-domain down-mixing process, X(n) denotes the secondary channel signal in the current frame and obtained through the time-domain down-mixing process, n denotes a sampling point number, and delay_com denotes encoding delay compensation; M 22 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, and M 22 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame; M 12 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the previous frame, and M 12 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame. The method of claim 2.
5. when a time-domain downmix operation is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the previous frame to obtain the primary and secondary channel signals in the current frame, If 0≦n<N-delay_com, [0045] or If N-delay_com≦n<N-delay_com+NOVA_1, [0050] or If N-delay_com+NOVA_1≦n<N, [006] where: fade_in(n) denotes the fade-in coefficient, [0070] and fade_out(n) denotes the fade-out factor, [0080] NOVA_1 indicates the transition processing length, n indicates the sampling point number, n=0, 1, . . . , N-1, and X L (n) denotes the left channel signal in the current frame, and X R (n) denotes the right channel signal in the current frame, Y(n) denotes the primary channel signal in the current frame and obtained through the time-domain downmix process, X(n) denotes the secondary channel signal in the current frame and obtained through the time-domain downmix process, and delay_com denotes encoding delay compensation; M 22 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, and M 22 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame; M 12 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the previous frame, and M 12 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame. The method of claim 2. 【Request 6】 【Number 9】 or [0089] or ##EQU00011## or ##EQU00012## or ##EQU00013## or ##EQU00014## where α 1 = ratio_SM, α 2 = 1 - ratio_SM, where ratio_SM denotes the channel combining ratio factor corresponding to the decorrelated signal channel combining scheme for the current frame; The method according to any one of claims 3 to 5. 【Request 7】 【Number 15】 or ##EQU00016## or ##EQU00017## or [0018] or [0019] or [0020] where α 1_pre =tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM, where tdm_last_ratio_SM indicates the channel combining ratio factor corresponding to the decorrelated signal channel combining scheme for the previous frame; The method according to any one of claims 3 to 6. 【Request 8】 【Number 21】 or [0022] or [0023] where x L (n) denotes the original left channel signal in the current frame, and x R (n) denotes the original right channel signal in the current frame, and x L_HP (n) denotes the time-domain pre-processed left channel signal in the current frame, and x R_HP (n) denotes a time-domain pre-processed right channel signal in the current frame; x' L (n) denotes the delay aligned left channel signal in the current frame; and x′ R (n) indicates the delay aligned right channel signal in the current frame; The method according to any one of claims 3 to 7.
9. performing decoding based on the bitstream to obtain decoded primary and secondary channel signals in the current frame; determining a decoding mode for the current frame; when determining that the decoding mode of the current frame is an anti-correlated signal decoding mode, performing a time-domain up-mix processing on the decoded primary and secondary channel signals in 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 in the current frame, where 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 an anti-correlated signal channel combination scheme, and the anti-correlated signal channel combination scheme is a channel combination scheme corresponding to signals close to antiphase. Stereo decoding method.
10. performing a time-domain up-mix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain up-mix processing scheme corresponding to the decorrelated signal decoding mode to obtain reconstructed left and right channel signals in the current frame, performing a time-domain up-mix operation on the decoded primary and secondary channel signals in the current frame based on channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame to obtain the reconstructed left and right channel signals in the current frame; or performing a time-domain up-mix process on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for a previous frame to obtain the reconstructed left and right channel signals in the current frame.
10. The method of claim 9, comprising:
11. when a time-domain up-mix process is performed on the decoded primary and secondary channel signals in the current frame based on the channel combining ratio coefficients of the decorrelated signal channel combining scheme for the current frame to obtain the reconstructed left and right channel signals in the current frame; ##EQU00024## where: [0025] denotes the reconstructed left channel signal in the current frame, [0026] denotes the reconstructed right channel signal in the current frame, [0027] indicates the decoded primary channel signal in the current frame, [0028] denotes the decoded secondary channel signal in the current frame, n denotes the sampling point number, [0029] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, [0030] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame. The method of claim 10.
12. when a time-domain up-mix operation is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the previous frame to obtain the reconstructed left and right channel signals in the current frame; If 0≦n<N-upmixing_delay, [0031] or If N-upmixing_delay≦n<N, [0032] where: [Equation 33] denotes the reconstructed left channel signal in the current frame, [0034] denotes the reconstructed right channel signal in the current frame, [Equation 35] indicates the decoded primary channel signal in the current frame, [0036] denotes the decoded secondary channel signal in the current frame, n denotes the sampling point number, n=0, 1, ..., N-1, upmixing_delay denotes a decoding delay compensation, [Equation 37] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, [Equation 38] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame; [0039] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the previous frame, [0040] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame. The method of claim 10.
13. when a time-domain up-mix process is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the previous frame to obtain the reconstructed left and right channel signals in the current frame; If 0≦n<N-upmixing_delay, [0041] Or, if N-upmixing_delay≦n<N-upmixing_delay+NOVA_1, [0042] Or, if N-upmixing_delay≦n<N, [0043] where: [0044] denotes the reconstructed left channel signal in the current frame, [0045] denotes the reconstructed right channel signal in the current frame, [0046] indicates the decoded primary channel signal in the current frame, [0047] denotes the decoded secondary channel signal in the current frame, NOVA_1 denotes the transition processing length, fade_in(n) denotes the fade-in coefficient, [0048] and fade_out(n) denotes the fade-out coefficient, [0049] where n represents the number of sampling points, n=0, 1, . . . , N−1, and upmixing_delay represents the decoding delay compensation. [Number 50] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, [0051] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame; [0052] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the previous frame, [0,53] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame. The method of claim 10. 【Request 14】 【Number 54】 or [0.55] or [0,56] or [0.57] or [0,58] or [0,59] where α 1 = ratio_SM, α 2 = 1 - ratio_SM, where ratio_SM denotes the channel combining ratio factor corresponding to the decorrelated signal channel combining scheme for the current frame; The method according to any one of claims 11 to 13. 【Request 15】 【Number 60】 or [0061] or [0062] or [0063] or [0,64] or [0.65] where α 1_pre =tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM, where tdm_last_ratio_SM indicates the channel combining ratio factor corresponding to the decorrelated signal channel combining scheme for the previous frame; The method according to any one of claims 11 to 14.
16. A time domain stereo encoding apparatus comprising a processor and a memory coupled to each other, the processor performing the following steps: determining a coding mode for the current frame; when determining that the coding mode of the current frame is an anti-correlated signal coding mode, performing a time-domain down-mix processing on left and right channel signals in the current frame by using a time-domain down-mix processing scheme corresponding to the anti-correlated signal coding mode to obtain primary and secondary channel signals in the current frame, where 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 an anti-correlated signal channel combination scheme, and the anti-correlated signal channel combination scheme is a channel combination scheme corresponding to signals close to antiphase; encoding the acquired primary and secondary channel signals in the current frame; An apparatus configured to perform the steps of:
17. In an aspect of performing a time-domain downmix processing on the left and right channel signals in the current frame by using the time-domain downmix processing scheme corresponding to the decorrelated signal coding mode to obtain the primary and secondary channel signals in the current frame, the processor: performing a time-domain downmix process on the left and right channel signals in the current frame based on channel combination coefficients of the decorrelated signal channel combination scheme for the current frame to obtain the primary and secondary channel signals in the current frame; or performing a time-domain down-mix process on the left and right channel signals in the current frame according to the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for a previous frame to obtain the primary and secondary channel signals in the current frame.
17. The apparatus of claim 16.
18. when a time-domain downmix operation is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame to obtain the primary and secondary channel signals in the current frame, [0.66] where X L (n) denotes the left channel signal in the current frame, and X R (n) denotes the right channel signal in the current frame, Y(n) denotes the primary channel signal in the current frame and obtained through the time-domain down-mixing process, X(n) denotes the secondary channel signal in the current frame and obtained through the time-domain down-mixing process, and n denotes a sampling point number; M 22 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, and M 22 is reconstructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame.
20. The apparatus of claim 17.
19. when a time-domain downmix operation is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the previous frame to obtain the primary and secondary channels in the current frame, If 0≦n<N-delay_com, [0.67] or If N-delay_com≦n<N, [0068] where X L (n) denotes the left channel signal in the current frame, and X R (n) denotes the right channel signal in the current frame, Y(n) denotes the primary channel signal in the current frame and obtained through the time-domain down-mixing process, X(n) denotes the secondary channel signal in the current frame and obtained through the time-domain down-mixing process, n denotes a sampling point number, and delay_com denotes encoding delay compensation; M 22 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, and M 22 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame; M 12 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the previous frame, and M 12 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame.
20. The apparatus of claim 17.
20. when a time-domain downmix operation is performed on the left and right channel signals in the current frame based on the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the previous frame to obtain the primary and secondary channel signals in the current frame, If 0≦n<N-delay_com, [0,69] or If N-delay_com≦n<N-delay_com+NOVA_1, [Number 70] or If N-delay_com+NOVA_1≦n<N, [Equation 71] where fade_in(n) denotes the fade-in factor, [Equation 72] and fade_out(n) denotes the fade-out factor, [73] NOVA_1 indicates the transition processing length, n indicates the sampling point number, n=0, 1, . . . , N-1, and X L (n) denotes the left channel signal in the current frame, and X R (n) denotes the right channel signal in the current frame, Y(n) denotes the primary channel signal in the current frame and obtained through the time-domain downmix process, X(n) denotes the secondary channel signal in the current frame and obtained through the time-domain downmix process, and delay_com denotes encoding delay compensation; M 22 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, and M 22 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame; M 12 denotes the downmix matrix corresponding to the decorrelated signal channel combination scheme for the previous frame, and M 22 is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame.
20. The apparatus of claim 17. 【Request 21】 【Number 74】 or [Number 75] or [76] or [77] or [78] or [79] where α 1 = ratio_SM, α 2 = 1 - ratio_SM, where ratio_SM denotes the channel combining ratio factor corresponding to the decorrelated signal channel combining scheme for the current frame; Apparatus according to any one of claims 18 to 20. 【Request 22】 【Number 79】 or [Number 80] or [Number 81] or [0082] or [Number 83] or [Number 84] where α 1_pre =tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM, where tdm_last_ratio_SM indicates the channel combining ratio factor corresponding to the decorrelated signal channel combining scheme for the previous frame; Apparatus according to any one of claims 18 to 21. 【Request 23】 【Number 85】 or [Number 86] or [Number 87] where: x L (n) denotes the original left channel signal in the current frame, and x R (n) denotes the original right channel signal in the current frame, and x L_HP (n) denotes the time-domain pre-processed left channel signal in the current frame, and x R_HP (n) denotes the time-domain pre-processed right channel signal in the current frame; and x′ L (n) denotes the delay aligned left channel signal in the current frame; and x′ R (n) indicates the delay aligned right channel signal in the current frame; Apparatus according to any one of claims 18 to 22.
24. A stereo decoding device comprising a processor and a memory connected to each other, The processor performs the following steps: decoding the bitstream to obtain decoded primary and secondary channel signals in the current frame; determining a decoding mode for the current frame; when determining that the decoding mode of the current frame is an anti-correlated signal decoding mode, performing a time-domain up-mix processing on the decoded primary and secondary channel signals in 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 in the current frame, where 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 an anti-correlated signal channel combination scheme, and the anti-correlated signal channel combination scheme is a channel combination scheme corresponding to signals close to antiphase; An apparatus configured to perform the steps of:
25. In an aspect of performing a time-domain up-mix processing on the decoded primary and secondary channel signals in the current frame by using the time-domain up-mix processing scheme corresponding to the decorrelated signal decoding mode to obtain the reconstructed left and right channel signals in the current frame, the processor: performing a time-domain up-mix operation on the decoded primary and secondary channel signals based on channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame to obtain the reconstructed left and right channel signals in the current frame; or performing a time-domain up-mix operation on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the anti-correlated signal channel combination scheme for a previous frame to obtain the reconstructed left and right channel signals in the current frame.
25. The apparatus of claim 24.
26. when a time-domain up-mix operation is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame to obtain the reconstructed left and right channel signals in the current frame; [Number 88] and [Number 89] denotes the decoded left channel signal in the current frame, [Number 90] denotes the reconstructed right channel signal in the current frame, [Number 91] indicates the decoded primary channel signal in the current frame, [Number 92] denotes the decoded secondary channel signal in the current frame, n denotes the sampling point number, [Number 93] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, [Number 94] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame.
26. The apparatus of claim 25.
27. when a time-domain up-mix operation is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the previous frame to obtain the reconstructed left and right channel signals in the current frame; If 0≦n<N-upmixing_delay, [Number 95] or If N-upmixing_delay≦n<N, [Number 96] where: [Number 97] denotes the decoded left channel signal in the current frame, [Number 98] denotes the reconstructed right channel signal in the current frame, [Number 99] indicates the decoded primary channel signal in the current frame, [Number 100] denotes the decoded secondary channel signal in the current frame, n denotes the sampling point number, n=0, 1, ..., N-1, upmixing_delay denotes decoding delay compensation, [Number 101] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, [00102] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame; [00103] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the previous frame, [00104] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame.
26. The apparatus of claim 25.
28. when a time-domain up-mix operation is performed on the decoded primary and secondary channel signals in the current frame based on the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the current frame and the channel combination ratio coefficients of the decorrelated signal channel combination scheme for the previous frame to obtain the reconstructed left and right channel signals in the current frame; If 0≦n<N-upmixing_delay, [00105] or If N-upmixing_delay≦n<N-upmixing_delay+NOVA_1, [Number 106] or If N-upmixing_delay+NOVA_1≦n<N, [Equation 107] where: [Number 108] denotes the decoded left channel signal in the current frame, [Number 109] denotes the reconstructed right channel signal in the current frame, [Equation 110] indicates the decoded primary channel signal in the current frame, [Equation 111] denotes the decoded secondary channel signal in the current frame, NOVA_1 denotes the transition processing length, fade_in(n) denotes the fade-in coefficient, [Equation 112] and fade_out(n) denotes the fade-out factor, [Equation 113] where n represents the number of sampling points, n=0, 1, . . . , N−1, and upmixing_delay represents the decoding delay compensation. [Equation 114] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, [Number 115] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame; [Equation 116] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the previous frame, [Equation 117] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame.
26. The apparatus of claim 25. 【Request 29】 【Number 118】 or [Equation 119] or [Number 120] or [Number 121] or [Number 122] or [Number 123] where α 1 = ratio_SM, α 2 = 1 - ratio_SM, where ratio_SM denotes the channel combining ratio factor corresponding to the decorrelated signal channel combining scheme for the current frame; Apparatus according to any one of claims 26 to 28. 【Request 30】 【Number 124】 or [Number 125] or [Number 126] or [Number 127] or [Number 128] or [Number 129] where α 1_pre =tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM, where tdm_last_ratio_SM indicates the channel combining ratio factor corresponding to the decorrelated signal channel combining scheme for the previous frame; 30. Apparatus according to any one of claims 26 to 29.
31. A computer readable recording medium having stored thereon a program code, the program code comprising instructions used to carry out the method according to any one of claims 1 to 8.
32. A computer-readable recording medium having stored thereon a program code, the program code comprising instructions used to carry out the method according to any one of claims 9 to 15.
Citation Information
Patent Citations
Stereo sound signal processing method and apparatus
JP2003516555A
Method and apparatus for adjusting the channel delay parameter of a multichannel signal
JP2012524304A
Method and system using a long-term correlation difference between left and right channels for time domain down mixing a stereo sound signal into primary and secondary channels
WO2017049397A1