Time-domain stereo encoding and decoding method and related products
Patent Information
- Application Number
- JP2023111288
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2017-08-10
- Filing Date
- 2023-07-06
- Publication Date
- 2025-03-26
- Estimated Expiration
- 2038-08-10
Smart Images

Figure 0007651625000285 
Figure 0007651625000286 
Figure 0007651625000287
Abstract
Description
[Technical field]
[0001] The present application relates to the field of audio encoding and decoding technologies, and in particular to a time-domain stereo encoding and decoding method and related products. [Background technology]
[0002] As the quality of life improves, people have higher and higher requirements for high quality audio. Compared with mono 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 therefore is popular with people.
[0003] In parametric stereo encoding and decoding technology, stereo signals are converted into mono signals and spatial perception parameters, and the multi-channel signals are compressed. This is a common stereo encoding and decoding technology. However, in parametric stereo encoding and decoding technology, spatial perception parameters usually need to be extracted in frequency domain, and time domain transformation needs to be performed, so the delay of the whole codec is relatively large. Therefore, when there is a relatively strict requirement on delay, the time domain stereo encoding technology is a better choice.
[0004] In conventional time domain stereo encoding techniques, signals are downmixed to obtain two mono signals in the time domain. For example, in MS encoding techniques, left and right channel signals are first downmixed to obtain a mid channel signal and a side channel signal. For example, L indicates the left channel signal and R indicates the right channel signal. In this case, the mid channel signal is 0.5×(L+R), which indicates information about the correlation between the left channel and the right channel, and the side channel signal is 0.5×(LR), which indicates information about the difference between the left channel and the right channel. Then, the mid channel signal and the side channel signal are encoded separately by using a mono encoding method, where the mid channel signal is usually encoded by using a larger amount of bits and the side channel signal is usually encoded by using a smaller amount of bits.
[0005] When conventional time-domain stereo encoding techniques are used, sometimes the energy of the primary signals is very small or even missing, resulting in a degradation of the final encoding quality. but , through research and practice was done . Summary of the Invention
[0006] SUMMARY OF THE PRESENT APPLICATION The 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 may include: determining a coding mode of a current frame; when the coding mode of the current frame is determined to be an anti-correlated signal coding mode, performing 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 a primary channel signal and a secondary channel signal 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 anti-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, a left and a right channel signal in the current frame.
[0009] The coding mode of the current frame may be one of a plurality of coding modes. For example, the coding mode of the current frame may be one of the following coding modes: a correlated signal coding mode, an anti-correlated signal coding mode, a switch mode from correlated to anti-correlated signal coding, and a switch mode from anti-correlated to correlated signal coding.
[0010] It can be seen that in the above solution, the coding mode of the current frame needs to be determined, which indicates that there are multiple possibilities for the coding mode of the current frame.Compared with the traditional solution with only one coding mode, this solution with multiple possible coding modes can be more compatible and compatible with multiple possible scenarios.In addition, since a channel combination scheme corresponding to signals close to antiphase is introduced, when the stereo signals in the current frame are signals close to antiphase, there is a more targeted channel combination scheme and coding mode, which helps to improve the encoding quality.
[0011] In some possible implementations, the method may further include, when the coding mode of the current frame is determined to be a correlated signal coding mode, performing a time-domain downmix processing on the left and right channel signals in the current frame by using a time-domain downmix processing scheme corresponding to the correlated signal coding mode to obtain primary and secondary channel signals in the current frame, where the time-domain downmix processing scheme corresponding to the correlated signal coding mode is a time-domain downmix processing scheme corresponding to a correlated signal channel combining scheme, and the correlated signal channel combining scheme is a channel combining scheme corresponding to signals close to in-phase.
[0012] In some possible implementations, the method may further include, when it is determined that the coding mode of the current frame is a correlation-to-anti-correlated signal coding switching mode, 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 scheme corresponding to the correlation-to-anti-correlated signal coding switching mode to obtain primary and secondary channel signals in the current frame. The time-domain down-mix processing scheme corresponding to the correlation-to-anti-correlated signal coding switching mode is a time-domain down-mix processing scheme corresponding to a transition from a correlation signal channel combination scheme to an anti-correlated signal channel combination scheme.
[0013] In some possible implementations, the method may further include, when it is determined that the coding mode of the current frame is a switching mode from anti-correlation to correlation signal coding, 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 scheme corresponding to the switching mode from anti-correlation to correlation signal coding to obtain primary and secondary channel signals in the current frame. The time-domain down-mix processing scheme corresponding to the switching mode from anti-correlation to correlation signal coding is a time-domain down-mix processing scheme corresponding to a 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 downmix processing schemes corresponding to different coding modes are usually different, and in addition, each coding mode may correspond to one or more time-domain downmix processing schemes.
[0015] For example, in some possible implementations, 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 may include: performing a time-domain down-mix processing on left and right channel signals in the current frame based on channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame to obtain primary and secondary channel signals in the current frame, or performing a time-domain down-mix processing on left and right channel signals in the current frame based on channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the previous frame to obtain primary and secondary channel signals in the current frame.
[0016] A channel combining scheme (e.g., decorrelated signal channel combining scheme or correlation It can be understood that the channel combination ratio coefficient of the signal channel combination scheme may 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 coefficients of the audio frame, a corresponding downmix matrix may be constructed, and a time-domain downmix process is performed on the left and right channel signals in the current frame by using the downmix matrix corresponding to the channel combination scheme to obtain the primary and secondary 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, when obtaining the primary and secondary channel signals in the current frame and 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, 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) indicates the fade-out coefficient, for example,
[0037]
number
[0038] Of course, fade_out(n) may alternatively be another functionally related fade-out factor based on n.
[0039] In this specification, NOVA_1 indicates a 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, when a time-domain down-mix processing is performed on left and right channel signals in a current frame by using a time-domain down-mix processing manner corresponding to a correlation signal coding mode to obtain primary and secondary channel signals in the current frame,
[0041]
number
[0042] It is.
[0043] In the above example, 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 a time-domain downmix process, and X(n) denotes the secondary channel signal in the current frame and obtained through a time-domain downmix process.
[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 denotes the encoding delay compensation.
[0046] M 11 denote the downmix matrix corresponding to the correlated signal channel combination scheme for the previous frame, and M 11 is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the previous frame.
[0047] M 12 denote the downmix matrix corresponding to the anti-correlated 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.
[0048] M 22 denote 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.
[0049] M 21 denote the downmix matrix corresponding to the correlated signal channel combination scheme for the current frame, and M 21 is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the current frame.
[0050] M 21 can take multiple forms, e.g.
[0051]
number
[0052] or
[0053]
number
[0054] may have:
[0055] Herein, ratio denotes the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme for the current frame.
[0056] In this specification, M 22 can take multiple forms, e.g.
[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] Herein, α1=ratio_SM, α2=1-ratio_SM, where ratio_SM denotes the channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the current frame.
[0070] In this specification, M 12 can take multiple forms, e.g.
[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, where tdm_last_ratio_SM indicates the channel combining ratio coefficient corresponding to the decorrelated signal channel combining 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 been subjected to time-domain pre-processing, for example, left and right channel signals obtained through sampling), or may be the left and right channel signals in the current frame that have been subjected to time pre-processing, or may be the left and right channel signals in the current frame that have been subjected to delay alignment processing.
[0085] Specifically, for example,
[0086]
number
[0087] or
[0088]
number
[0089] or
[0090]
number
[0091] It is.
[0092] In this specification, 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 preprocessed 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)x R_HP (n) shows the delay aligned right channel signal in the current frame.
[0093] According to a second aspect, an embodiment of the present application further provides a time-domain stereo decoding method, the method comprising: decoding the bitstream to obtain decoded primary and secondary channel signals in the current frame; determining a decoding mode of the current frame; and when the decoding mode of the current frame is determined to be 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 anti-phase. may include.
[0094] 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: correlated signal decoding mode, anti-correlated signal decoding mode, switch from correlated to anti-correlated signal decoding mode, and switch from anti-correlated to correlated signal decoding mode.
[0095] It can be seen that in the above solution, the decoding mode of the current frame needs to be determined, which indicates that there are multiple possibilities for the decoding mode of the current frame.Compared with the traditional solution with only one decoding mode, this solution with multiple possible decoding modes can be more compatible and compatible with multiple possible scenarios.In addition, since a channel combination scheme corresponding to signals close to antiphase is introduced, when the stereo signals in the current frame are signals close to antiphase, there are more targeted channel combination schemes and decoding modes, which helps to improve the decoding quality.
[0096] In some possible implementations, the method includes: when it is determined that the decoding mode of the current frame is a correlated signal decoding mode, performing a time-domain up-mix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain up-mix processing scheme corresponding to the correlated signal decoding mode to obtain reconstructed left and right channel signals in the current frame, where the time-domain up-mix processing scheme corresponding to the correlated signal decoding mode is a time-domain up-mix processing scheme corresponding to a correlated signal channel combination scheme, and the correlated signal channel combination scheme is a channel combination scheme corresponding to signals close to in-phase; It may further include.
[0097] In some possible implementations, the method may further include, when it is determined that the decoding mode of the current frame is a switching mode from correlation to anti-correlated signal decoding, 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 switching mode from correlation to anti-correlated signal decoding to obtain reconstructed left and right channel signals in the current frame. The time-domain up-mix processing scheme corresponding to the switching mode from correlation to anti-correlated signal decoding is a time-domain up-mix processing scheme corresponding to a transition from a correlated signal channel combination scheme to an anti-correlated signal channel combination scheme.
[0098] In some possible implementations, the method may further include, when it is determined that the decoding mode of the current frame is a switching mode from anti-correlation to correlated signal decoding, 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 switching mode from anti-correlation to correlated signal decoding to obtain reconstructed left and right channel signals in the current frame. The time-domain up-mix processing scheme corresponding to the switching mode from anti-correlation to correlated signal decoding is a time-domain up-mix processing scheme corresponding to a 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 upmix processing schemes corresponding to different decoding modes are usually different, and in addition, each decoding mode may correspond to one or more time-domain upmix processing schemes.
[0100] For example, in some possible implementations, 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 a decorrelated signal decoding mode to obtain reconstructed left and right channel signals in the current frame includes: 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 to obtain 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 the previous frame to obtain reconstructed left and right channel signals in the current frame. Includes.
[0101] In some possible implementations, based on the channel combination ratio coefficients of the audio frame, a corresponding up-mix matrix may be constructed, and a time-domain up-mix process is performed on the decoded primary and secondary channel signals in the current frame by using the up-mix matrix corresponding to the channel combination scheme to obtain reconstructed left and right channel signals in the current frame.
[0102] For example, 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 to obtain 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, when performing time-domain upmixing processing 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_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]
[0117] In this specification,
[0118]
Number
[0119] represents the Reconstruction left channel signal
[0120]
number
[0121] denotes the reconstructed right channel signal in the current frame,
[0122]
number
[0123] denotes the decoded primary channel signal in the current frame,
[0124]
number
[0125] indicates the decoded secondary channel signal in the current frame.
[0126] In this specification, NOVA_1 refers to the transition treatment length.
[0127] In this specification, fade_in(n) denotes a fade-in coefficient, for example,
[0128]
number
[0129] and of course fade_in(n) may alternatively be another functionally related fade-in factor based on n.
[0130] In this specification, fade_out(n) denotes a fade-out coefficient, for example,
[0131]
number
[0132] and of course fade_out(n) may alternatively be another functionally related fade-out factor based on n.
[0133] In this specification, NOVA_1 indicates a 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, when a time-domain up-mix process is performed on the decoded primary and secondary channel signals in the current frame based on a channel combination ratio coefficient of a correlation signal channel combination scheme for the current frame to obtain reconstructed left and right channel signals in the current frame,
[0135]
number
[0136] It is.
[0137] In the above example,
[0138]
number
[0139] is the current frame Reconstruction indicates the left channel signal,
[0140]
number
[0141] denotes the reconstructed right channel signal in the current frame,
[0142]
number
[0143] denotes 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 denotes the decoding delay compensation.
[0148]
number
[0149] denote the upmix matrix corresponding to the correlated signal channel combination scheme for the previous frame,
[0150]
number
[0151] is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the previous frame.
[0152]
number
[0153] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame,
[0154]
number
[0155] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame.
[0156]
number
[0157] denote the upmix matrix corresponding to the anti-correlated signal channel combination scheme for the previous frame,
[0158]
number
[0159] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame.
[0160]
number
[0161] denote the upmix matrix corresponding to the correlated signal channel combination scheme for the current frame,
[0162]
number
[0163] is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the current frame.
[0164]
number
[0165] can take multiple forms, e.g.
[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] Herein, α1=ratio_SM, α2=1-ratio_SM, where ratio_SM denotes the channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the current frame.
[0179] In this specification,
[0180]
number
[0181] can take multiple forms, e.g.
[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] Herein, tdm_last_ratio_SM denotes the channel combining ratio factor corresponding to the decorrelated signal channel combining scheme for the previous frame.
[0196] In this specification,
[0197]
number
[0198] can take multiple forms, e.g.
[0199]
number
[0200] or
[0201]
number
[0202] may have:
[0203] Herein, ratio denotes the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme for the current frame.
[0204] According to a third aspect, an embodiment of the present application further provides a time-domain stereo encoding apparatus, the apparatus may include a processor and a memory coupled to each other, the processor may be configured to perform some or all of the steps of any 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 apparatus, the apparatus may include a processor and a memory coupled to each other, the processor may be configured to perform some or all 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 apparatus, comprising a number of 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 apparatus, comprising a number of 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, the computer readable storage medium storing program code, the program code comprising instructions used to perform some or all of the steps of any of the methods in the first aspect.
[0209] According to an eighth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing program code, the program code comprising instructions used to perform some or all of the steps of any of the methods in the 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 perform 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 perform some or all of the steps of any of the methods in the second aspect. [Brief description of the drawings]
[0212] The following describes the accompanying drawings that are necessary to explain the embodiments or background of the present application.
[0213] [Figure 1] FIG. 2 is a schematic diagram of signals close to antiphase according to an embodiment of the present application; [Diagram 2] 1 is a schematic flowchart of an audio encoding method according to an embodiment of the present application. [Diagram 3] 4 is a schematic flowchart of a method for determining an audio decoding mode according to an embodiment of the present application; [Figure 4] 4 is a schematic flowchart of another audio encoding method according to an embodiment of the present application. [Diagram 5] 1 is a schematic flowchart of an audio decoding method according to an embodiment of the present application; [Figure 6] 4 is a schematic flowchart of another audio encoding method according to an embodiment of the present application. [Figure 7] 4 is a schematic flowchart of another audio decoding method according to an embodiment of the present application; [Figure 8] 1 is a schematic flowchart of a time-domain stereo parameter determination method according to an embodiment of the present application; [Figure 9-A] 4 is a schematic flowchart of another audio encoding method according to an embodiment of the present application. [Figure 9-B] 4 is a schematic flowchart of a method for calculating and encoding channel combining ratio coefficients corresponding to an anti-correlated signal channel combining scheme for a current frame according to an embodiment of the present application. [Figure 9-C] 4 is a schematic flowchart of a method for calculating an amplitude correlation difference parameter between a left channel and a right channel in a current frame according to an embodiment of the present application; [Figure 9-D] 4 is a schematic flowchart of a method for converting an amplitude correlation difference parameter between a left channel and a right channel in a current frame into a channel combination ratio coefficient according to an embodiment of the present application. [Figure 10] 4 is a schematic flowchart of another audio decoding method according to an embodiment of the present application; [Figure 11-A] 1 is a schematic diagram of an apparatus according to an embodiment of the present application. [Figure 11-B] 2 is a schematic diagram of another apparatus according to an embodiment of the present application. [Figure 11-C] 2 is a schematic diagram of another apparatus according to an embodiment of the present application. [Figure 12-A] 2 is a schematic diagram of another apparatus according to an embodiment of the present application. [Figure 12-B] 2 is a schematic diagram of another apparatus according to an embodiment of the present application. [Figure 12-C] 2 is a schematic diagram of another apparatus according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0214] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings in which the embodiments of the present application are described.
[0215] The words "comprise", "have", and any other variations thereof as used in the specification, claims, and accompanying drawings of this application are intended to include a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the recited steps or units, and may optionally include additional steps or units that are not recited, or may optionally include additional steps or units that are specific to the process, method, product, or device. In addition, words such as "first", "second", "third", and "fourth" are used to distinguish objects instead of describing a particular order.
[0216] It should be noted that since the solution of the embodiments of the present application is specific to a time domain scenario for simplicity of explanation, the time domain signals may be referred to simply as "signals". For example, the left channel time domain signal may be referred to simply as "left channel signal". For another example, the right channel time domain signal may be referred to simply as "right channel signal". For another example, the mono time domain signal may be referred to simply as "mono signal". For another example, the reference channel time domain signal may be referred to simply as "reference channel signal". For another example, the primary channel time domain signal may be referred to simply as "primary channel signal". The secondary channel time domain signal may be referred to simply as "secondary channel signal". For another example, the mid channel time domain signal may be referred to simply as "mid channel signal". For another example, the side channel time domain signal may be referred to simply as "side channel signal". Other cases can be inferred by analogy.
[0217] It should be noted that in the embodiment of the present application, the left channel time domain signal and the right channel time domain signal may be collectively referred to as "left and right channel time domain signals" or collectively referred to as "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 delay aligned left and right channel time domain signals in the current frame include the delay aligned left channel time domain signal in the current frame and the delay aligned right channel time domain signal in the current frame. Similarly, the primary channel signal and the secondary channel signal may be collectively referred to as "primary and secondary channel signals". In other words, the primary and secondary channel signals include the primary channel signal and the secondary channel signal. 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 reconstructed signal and the right channel reconstructed signal. The rest can be inferred by analogy.
[0218] For example, in a conventional MS encoding technique, the left and right channel signals are first downmixed to obtain a mid channel signal and a side channel signal. For example, L indicates the left channel signal and R indicates the right channel signal. In this case, the mid channel signal is 0.5×(L+R), which indicates the information about the correlation between the left channel and the right channel, and the side channel signal is 0.5×(LR), which indicates the information about the difference between the left channel and the right channel. Then, the mid channel signal and the side channel signal are encoded separately by using a mono encoding method, where the mid channel signal is usually encoded by using a larger amount of bits and the side channel signal is usually encoded by using a smaller amount of bits.
[0219] Furthermore, in some solutions, in order to improve the encoding quality, in the time-domain downmix process, the left and right channel time-domain signals are analyzed to extract time-domain stereo parameters that are used to indicate the ratio of the left channel to the right channel. The objective of the proposed method is as follows: 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 denotes the left channel signal and R denotes the right channel signal. In this case, the primary channel signal is denoted as Y, where Y=alpha×L+beta×R, and Y denotes the information about the correlation between the two channels, and the secondary channel signal is denoted as Y. signalis denoted as X, where X=alpha×L−beta×R, and X represents information about the difference between the two channels. In this specification, alpha and beta are real numbers between 0 and 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 typical near-anti-phase signal. FIG. 1 simply shows a typical example of a near-anti-phase signal. In fact, a near-anti-phase signal is a stereo signal in which the phase difference between the left and right channel signals is approximately 180°. For example, a stereo signal in which the phase difference between the left and right channel signals is included within [180-θ, 180+θ] may be called a near-anti-phase signal, where θ 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 nearly in-phase signal is a stereo signal in which the phase difference between the left and right channel signals is approximately 0 degrees. For example, a stereo signal in which the phase difference between the left and right channel signals falls within [-θ,θ] may be referred to as a nearly in-phase signal. θ may be any angle between 0° and 90°. For example, θ may be equal to an angle of 0°, 5°, 15°, 17°, 20°, 30°, or 40°.
[0222] When the left and right channel signals are close to in-phase signals, the energy of the primary channel signal generated through the time-domain down-mix processing is usually significantly larger than that of the secondary channel signal. If the primary channel signal is encoded by using a larger amount of bits and the secondary channel signal is encoded by using a smaller amount of bits, a better encoding effect can be obtained. However, when the left and right channel signals are close to out-of-phase signals, if the same time-domain down-mix processing method is used, the energy of the generated primary channel signal may be very small or even lost, resulting in a deterioration of the final encoding quality.
[0223] The following subsequently describes some technical solutions that can help improve the stereo encoding and decoding quality.
[0224] The encoding device and the decoding device described in the embodiments of the present application may be devices having functions such as collecting, storing, and transmitting audio signals to the outside, etc. Specifically, the encoding device and the decoding device may be, for example, a mobile phone, a server, a tablet computer, a personal computer, or a notebook computer.
[0225] In the solution of the present application, the left and right channel signals can be understood to be the left and right channel signals of a stereo signal. The stereo signal can be an original stereo signal, or a stereo signal including two channels of a signal in a multi-channel signal, or a stereo signal including two channels of a signal jointly generated by multiple channels of a signal in a multi-channel signal. The stereo encoding method can also be a stereo encoding method used in multi-channel encoding. The stereo encoding device can also be a stereo encoding device used in a multi-channel encoding device. The stereo decoding method can also be a stereo decoding method used in multi-channel decoding. The stereo decoding device can also be a stereo decoding device used in a multi-channel decoding device. The audio encoding method in the embodiment of the present application is, for example, specific to a stereo encoding scenario, and the audio decoding method in the embodiment of the present application is, for example, specific to a stereo decoding scenario.
[0226] In the following, we first provide a method for determining an audio coding mode, which includes the steps of determining a channel combination scheme for a current frame; and determining a coding mode for the current frame based on the channel combining scheme for the previous frame and the channel combining scheme for the current frame.
[0227] 2 is a schematic flowchart of an audio encoding method according to an embodiment of the present application. The relevant steps of the audio encoding method may be performed by an encoding device, and may include, for example, the following steps:
[0228] 201. Determine the channel combining 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 close to the same phase. The anticorrelated signal channel combination scheme is a channel combination scheme corresponding to signals close to the opposite phase. It can be understood that the channel combination scheme corresponding to signals close to the same phase is applicable to signals close to the same phase, and the channel combination scheme corresponding to signals close to the opposite phase is applicable to signals close to the opposite phase.
[0230] 202. Determine a coding mode for the current frame based on the channel combining scheme for the previous frame and the channel combining scheme for the current frame.
[0231] In addition, if the current frame is the first frame (i.e., there is no frame before the current frame), the coding mode of the current frame may be determined based on the channel combination scheme for the current frame, or a default coding mode may 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, which may include, for example, a correlated-to-anticorrelated signal coding switching mode, an anticorrelated-to-correlated signal coding switching mode, a correlated signal coding mode, and an anticorrelated signal coding mode, etc.
[0233] The time-domain downmix mode corresponding to the switching mode from correlated to anticorrelated signal coding may be referred to as, for example, a "correlated-to-anticorrelated signal downmix switching mode." The time-domain downmix mode corresponding to the switching mode from anticorrelated to correlated signal coding may be referred to as, for example, an "anticorrelated-to-correlated signal downmix switching mode." The time-domain downmix mode corresponding to the correlated signal coding mode may be referred to as, for example, a "correlated signal downmix mode." The time-domain downmix mode corresponding to the anticorrelated signal coding mode may be referred to as, for example, an "anticorrelated signal downmix mode."
[0234] In this embodiment of the present application, the names of objects, such as coding mode, decoding mode, and channel combination scheme, are all examples, and it can be understood that in actual applications, other names may also be used.
[0235] 203. Perform a time-domain down-mix process on the left and right channel signals in the current frame based on a time-domain down-mix process corresponding to a coding mode of the current frame, to obtain primary and secondary channel signals in the current frame.
[0236] A time-domain downmix process may be performed on the left and right channel signals in the current frame to obtain primary and secondary channel signals in the current frame, and the primary and secondary channel signals are further encoded to obtain a bitstream. Furthermore, a 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) may be written into the bitstream, so that a decoding device determines the channel combination scheme for the current frame based on the channel combination scheme flag of the current frame included in the bitstream.
[0237] There may be various specific implementations of determining the coding mode of the current frame based on the channel combining scheme for the previous frame and the channel combining scheme for the current frame.
[0238] Specifically, for example, in some possible implementations, determining a coding mode for a current frame based on a channel combination scheme for a previous frame and a channel combination scheme for a current frame may include: determining that when the channel combination scheme for the previous frame is a correlated signal channel combination scheme and the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, the coding mode of the current frame is a correlated to anti-correlated signal coding switching mode, in which the time-domain down-mix processing is performed by using a down-mix processing method corresponding to the transition from the correlated signal channel combination scheme to the anti-correlated signal channel combination scheme in the correlated to anti-correlated signal coding switching mode; or determining, when the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme and the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, a coding mode of the current frame is an anti-correlated signal coding mode, in which a time-domain down-mix processing is performed by using a down-mix processing method corresponding to the anti-correlated signal channel combination scheme; or determining that when the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme and the channel combination scheme for the current frame is a correlated signal channel combination scheme, the coding mode of the current frame is a switching mode from anti-correlated to correlated signal coding, in which in the switching mode from anti-correlated to correlated signal coding, a time-domain down-mix processing is performed by using a down-mix processing method corresponding to the transition from the anti-correlated signal channel combination scheme to the correlated signal channel combination scheme, and the time-domain down-mix processing scheme corresponding to the switching mode from anti-correlated to correlated signal coding may specifically be a segmented time-domain down-mix scheme, i.e., performing a segmented time-domain down-mix processing on the left and right channel signals in the current frame according to the channel combination scheme for the current frame and the channel combination scheme for the previous frame; or determining that when the channel combination scheme for the previous frame is a correlated signal channel combination scheme and the channel combination scheme for the current frame is the correlated signal channel combination scheme, a coding mode of the current frame is a correlated signal coding mode, in which a time-domain down-mix processing is performed by using a down-mix processing method corresponding to the correlated signal channel combination scheme; may include.
[0239] It can be understood that the time-domain downmix processing schemes corresponding to different coding modes are usually different, and in addition, each coding mode may correspond to one or more time-domain downmix processing schemes.
[0240] For example, in some possible implementations, the coding mode of the current frame is a correlation signal coding mode. beWhen the current frame is generated, a time-domain down-mix processing is performed on the left and right channel signals in the current frame by using a time-domain down-mix processing scheme corresponding to the correlated signal coding mode to obtain the primary and secondary channel signals in the current frame. The time-domain down-mix processing scheme corresponding to the correlated signal coding mode is a time-domain down-mix processing scheme corresponding to the correlated signal channel combination scheme.
[0241] For another example, in some possible implementations, when the coding mode of the current frame is determined to be an anti-correlated signal coding mode, a time-domain down-mix processing is performed on the 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. 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.
[0242] For another example, in some possible implementations, when it is determined that the coding mode of the current frame is a correlation-to-anti-correlated signal coding switching mode, a time-domain downmix processing is performed on the left and right channel signals in the current frame by using a time-domain downmix processing scheme corresponding to the correlation-to-anti-correlated signal coding switching mode to obtain primary and secondary channel signals in the current frame. The time-domain downmix processing scheme corresponding to the correlation-to-anti-correlated signal coding switching mode is a time-domain downmix processing scheme corresponding to a transition from a correlation signal channel combination scheme to an anti-correlated signal channel combination scheme. The time-domain downmix processing scheme corresponding to the correlation-to-anti-correlated signal coding switching mode may specifically be a segmented time-domain downmix scheme, i.e., performing a 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.
[0243] For another example, 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, a time-domain down-mix processing is performed on the left and right channel signals in the current frame by using a time-domain down-mix processing scheme corresponding to the switching mode from anti-correlation to correlation signal coding to obtain primary and secondary channel signals in the current frame. The time-domain down-mix processing scheme corresponding to the switching mode from anti-correlation to correlation signal coding is a time-domain down-mix processing scheme corresponding to a transition from an anti-correlation signal channel combination scheme to a correlation signal channel combination scheme.
[0244] It can be understood that the time-domain downmix processing schemes corresponding to different coding modes are usually different, and in addition, each coding mode may correspond to one or more time-domain downmix processing schemes.
[0245] For example, in some possible implementations, performing a time-domain downmix processing on left and right channel signals in the current frame by using a time-domain downmix processing scheme corresponding to the anti-correlated signal coding mode to obtain primary and secondary channel signals in the current frame may include: performing a time-domain downmix processing on left and right channel signals in the current frame based on channel combination ratio coefficients of an anti-correlated signal channel combination scheme for the current frame to obtain primary and secondary channel signals in the current frame, or performing a time-domain downmix processing on left and right channel signals in the current frame based on channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and 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.
[0246] It can be seen that 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. Compared with the conventional solution with only one channel combination scheme, this solution with multiple possible channel combination schemes can be more compatible and compatible 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, which 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 can be more compatible and compatible 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, it may be determined that the coding mode of the current frame may be, for example, a correlation-to-anti-correlation signal coding switching mode, or an anti-correlation-to-correlation signal coding switching mode. In this case, a segmented time-domain downmix process 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.
[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 to perform segmented time-domain down-mix processing on the left and right channel signals in the current frame. The segmented time-domain down-mix processing mechanism helps to implement a smooth transition of the channel combination schemes and further helps to improve the encoding quality.
[0249] Correspondingly, a time-domain stereo decoding scenario is described below by using an example.
[0250] With reference to Figure 3, the following provides a method for determining an audio decoding mode. The relevant steps of the method for determining an audio decoding mode may be implemented by a decoding device, and the method may specifically include the following steps:
[0251] 301. Determine a channel combining scheme for a current frame based on the channel combining scheme flag of the current frame in the bitstream.
[0252] 302. Determine a decoding mode for the current frame based on the channel combining scheme for the previous frame and the channel combining scheme for the current frame.
[0253] The decoding mode of the current frame is one of a plurality of decoding modes, which may include, for example, a correlated-to-anticorrelated signal decoding switching mode, an anticorrelated-to-correlated signal decoding switching mode, a correlated signal decoding mode, and an anticorrelated signal decoding mode, etc.
[0254] A time-domain upmix mode corresponding to a switching mode from correlated to anticorrelated signal decoding may be referred to as, for example, a "correlated-to-anticorrelated signal upmix switching mode." A time-domain upmix mode corresponding to a switching mode from anticorrelated to correlated signal decoding may be referred to as, for example, an "anticorrelated-to-correlated signal upmix switching mode." A time-domain upmix mode corresponding to a correlated signal decoding mode may be referred to as, for example, a "correlated signal upmix mode." A time-domain upmix mode corresponding to an anticorrelated signal decoding mode may be referred to as, for example, an "anticorrelated signal upmix mode."
[0255] In this embodiment of the present application, the names of objects, such as coding mode, decoding mode, and channel combination scheme, are all examples, and it can be understood that in actual applications, other names may also be used.
[0256] In some possible implementations, determining a decoding mode for the current frame based on a channel combining scheme for the previous frame and a channel combining scheme for the current frame includes: determining that when the channel combination scheme for the previous frame is a correlated signal channel combination scheme and the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, the decoding mode of the current frame is a correlation to anti-correlated signal decoding switching mode, in which the time-domain up-mix processing is performed by using an up-mix processing method corresponding to the transition from the correlated signal channel combination scheme to the anti-correlated signal channel combination scheme in the correlation to anti-correlated signal decoding switching mode; or determining that when the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme and the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, a decoding mode of the current frame is an anti-correlated signal decoding mode, in which a time-domain up-mix processing is performed by using an up-mix processing method corresponding to the anti-correlated signal channel combination scheme; or determining that when the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme and the channel combination scheme for the current frame is a correlated signal channel combination scheme, the decoding mode of the current frame is a switching mode from anti-correlated to correlated signal decoding, in which the time-domain up-mix processing is performed by using an up-mix processing method corresponding to the transition from the anti-correlated signal channel combination scheme to the correlated signal channel combination scheme; or determining that when the channel combination scheme for the previous frame is a correlated signal channel combination scheme and the channel combination scheme for the current frame is a correlated signal channel combination scheme, a decoding mode of the current frame is a correlated signal decoding mode, in which a time-domain up-mix processing is performed by using an up-mix processing method corresponding to the correlated signal channel combination scheme; Includes.
[0257] For example, when determining that the decoding mode of the current frame is an anti-correlated signal decoding mode, the decoding device performs a time-domain up-mix processing on the decoded primary and secondary channel signals 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.
[0258] The reconstructed left and right channel signals may be decoded left and right channel signals, or delay adjustment processing and / or time domain post-processing may be performed on the reconstructed left and right channel signals to obtain the decoded left and right channel signals.
[0259] 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.
[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: correlated signal decoding mode, anti-correlated signal decoding mode, switch from correlated to anti-correlated signal decoding mode, and switch from anti-correlated to correlated signal decoding mode.
[0261] It can be seen that in the above solution, the decoding mode of the current frame needs to be determined, which indicates that there are multiple possibilities for the decoding mode of the current frame.Compared with the traditional solution with only one decoding mode, this solution with multiple possible decoding modes can be more compatible and compatible with multiple possible scenarios.In addition, since a channel combination scheme corresponding to signals close to antiphase is introduced, when the stereo signals in the current frame are signals close to antiphase, there are more targeted channel combination schemes and decoding modes, which helps to improve the decoding quality.
[0262] For another example, when it is determined that the decoding mode of the current frame is a correlated signal decoding mode, the decoding device performs 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 correlated signal decoding mode, so as to obtain reconstructed left and right channel signals in the current frame. The time-domain up-mix processing scheme corresponding to the correlated signal decoding mode is a time-domain up-mix processing scheme corresponding to a correlated signal channel combining scheme, and the correlated signal channel combining scheme is a channel combining scheme corresponding to signals close to in-phase.
[0263] For another example, when it is determined that the decoding mode of the current frame is a switching mode from correlation to anti-correlated signal decoding, the decoding device performs 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 switching mode from correlation to anti-correlated signal decoding, so as to obtain reconstructed left and right channel signals in the current frame. The time-domain up-mix processing scheme corresponding to the switching mode from correlation to anti-correlated signal decoding is a time-domain up-mix processing scheme corresponding to a transition from a correlation signal channel combination scheme to an anti-correlated signal channel combination scheme.
[0264] For another example, when it is determined that the decoding mode of the current frame is a switching mode from anti-correlation to correlated signal decoding, the decoding device performs 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 switching mode from anti-correlation to correlated signal decoding, so as to obtain reconstructed left and right channel signals in the current frame. The time-domain up-mix processing scheme corresponding to the switching mode from anti-correlation to correlated signal decoding is a time-domain up-mix processing scheme corresponding to a transition from an anti-correlation signal channel combination scheme to a correlation signal channel combination scheme.
[0265] It can be understood that the time-domain upmix processing schemes corresponding to different decoding modes are usually different, and in addition, each decoding mode may correspond to one or more time-domain upmix processing schemes.
[0266] It can be seen that 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. Compared with the conventional solution with only one channel combination scheme, this solution with multiple possible channel combination schemes can be more compatible and consistent 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, 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 can be more compatible and consistent with multiple possible scenarios.
[0267] Furthermore, the decoding device performs a time-domain up-mix process on the decoded primary and secondary channel signals in the current frame based on a time-domain up-mix process corresponding to a decoding mode of the current frame to obtain reconstructed left and right channel signals in the current frame.
[0268] In the following, some specific implementations of determining a channel combination scheme for a current frame by an encoding device are described using examples. There are various specific implementations of determining a channel combination scheme for a current frame by an encoding device.
[0269] For example, in some possible implementations, determining the channel combining scheme for the current frame may include performing a channel combining scheme determination for the current frame at least once to determine the channel combining scheme for the current frame.
[0270] Specifically, for example, determining a channel combination scheme for the current frame includes performing an initial channel combination scheme determination for the current frame to determine an initial channel combination scheme for the current frame, and performing a channel combination scheme modification determination for the current frame based on the initial channel combination scheme for the current frame to determine a 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 an initial channel combination scheme for the current frame that is determined after the initial channel combination scheme determination for the current frame is performed.
[0271] For example, performing the initial channel combination scheme determination for the current frame may include determining an in-phase / anti-phase signal type of a stereo signal in the current frame by using left and right channel signals in the current frame, and determining an 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 an in-phase / anti-phase signal type flag of the current frame (e.g., the in-phase / anti-phase signal type flag is represented by tmp_SM_flag). Specifically, for example, when the value of the in-phase / out-of-phase signal type flag of the current frame is "1", it indicates that the in-phase / out-of-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 / out-of-phase signal type flag of the current frame is "0", it indicates that the in-phase / out-of-phase signal type of the stereo signal in the current frame is a signal close to out-of-phase, or vice versa.
[0272] The channel combination scheme for an audio frame (e.g., a previous frame or a current frame) may be indicated by a 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, the initial channel combination scheme for an audio frame (e.g., a previous frame or a current frame) may be indicated by an initial channel combination scheme flag of 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 of the audio frame is "0", it indicates that the initial channel combination scheme for the audio frame is a correlated signal channel combination scheme, or for another example, when the value of the initial channel combination scheme flag of the audio frame is "1", it indicates that the initial channel combination scheme for the audio frame is an anti-correlated signal channel combination scheme, or vice versa.
[0274] Determining the in-phase / out-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 determining that the in-phase / out-phase signal type of the stereo signal in the current frame is close to in-phase signal when the xorr is equal to or less than a first threshold, or determining that the in-phase / out-phase signal type of the stereo signal in the current frame is close to out-phase signal when the xorr is greater than the first threshold. Furthermore, if an in-phase / out-phase signal type flag of the current frame is used to indicate the in-phase / out-phase signal type of the stereo signal in the current frame, when it is determined that the in-phase / out-phase signal type of the stereo signal in the current frame is close to in-phase signal, a value of the in-phase / out-phase signal type flag of the current frame may be set to indicate that the in-phase / out-phase signal type of the stereo signal in the current frame is close to in-phase signal, or the in-phase / out-phase signal type of the stereo signal in the current frame is close to out-phase signal. reverseWhen it is determined that the signals are close to antiphase, the value of the inphase / antiphase signal type flag for the current frame may be set to indicate that the inphase / antiphase signal type of the stereo signal in the current frame is a signal that is close to antiphase.
[0275] The value range of the first threshold may be, for example, (0.5, 1.0), and the first threshold may be, for example, equal to 0.5, 0.85, 0.75, 0.65, or 0.81.
[0276] Specifically, for example, when the value of the in-phase / out-of-phase signal type flag of an audio frame (e.g., the previous frame or the current frame) is “0”, it indicates that the in-phase / out-of-phase signal type of the stereo signal of the audio frame is a signal close to in-phase, or when the value of the in-phase / out-of-phase signal type flag of an audio frame (e.g., the previous frame or the current frame) is “1”, it indicates that the in-phase / out-of-phase signal type of the stereo signal of the audio frame is a signal close to out-of-phase, or vice versa.
[0277] For example, determining an initial channel combination scheme for a current frame based on an in-phase / anti-phase signal type of a stereo signal in the current frame and a channel combination scheme for a previous frame may include: Determining that when the in-phase / anti-phase signal type of the stereo signals in the current frame is close to in-phase signal and the channel combination scheme for the previous frame is correlated signal channel combination scheme, the initial channel combination scheme for the current frame is correlated signal channel combination scheme; or determining that when the in-phase / anti-phase signal type of the stereo signals in the current frame is close to anti-phase signal and the channel combination scheme for the previous frame is anti-correlated signal channel combination scheme, the initial channel combination scheme for the current frame is 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 near in-phase signal 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 less than a second threshold, determining 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 equal to or greater than a second threshold, 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 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 less than a second threshold, determining 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 equal to or greater than a second threshold, determining that the initial channel combination scheme for the current frame is a correlated signal channel combination scheme. may include.
[0278] The value range of the second threshold may for example be [0.8, 1.2] and the second threshold may for example be equal to 0.8, 0.85, 0.9, 1, 1.1 or 1.18.
[0279] Performing a channel combination scheme modification determination for the current frame based on the initial channel combination scheme for the current frame may include determining a channel combination scheme for the current frame based on a channel combination ratio coefficient modification flag of the previous frame, an 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, performing a channel combination scheme modification decision for the current frame based on a result of the initial channel combination scheme decision for the current frame may include: using an anti-correlated signal channel combination scheme as a channel combination scheme for the current frame if the channel combination ratio coefficient modification flag of the previous frame indicates that the channel combination ratio coefficient needs to be modified, or determining whether the current frame satisfies a switching condition if the channel combination ratio coefficient modification flag of the previous frame indicates that the channel combination ratio coefficient does not need to be modified, and determining a channel combination scheme for the current frame based on a result of the determination of whether the current frame satisfies the switching condition. may include.
[0282] determining a channel combination scheme for the current frame based on a result of the determination as to whether the current frame satisfies a switching condition; determining that the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme when the channel combination scheme for the previous frame is different from the initial channel combination scheme for the current frame, the current frame satisfies a switching condition, and the initial channel combination scheme for the current frame is a correlated signal channel combination scheme and the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme; or determining that the channel combination scheme for the current frame is a correlated signal channel combination scheme when the channel combination scheme for the previous frame is different from the initial channel combination scheme for the current frame, the current frame satisfies a switching condition, the initial channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, the channel combination scheme for the previous frame is a correlated signal channel combination scheme, and a channel combination ratio factor of the previous frame is less than a first ratio factor threshold; or determining that the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme when the channel combination scheme for the previous frame is different from the initial channel combination scheme for the current frame, the current frame satisfies a switching condition, the initial channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, the channel combination scheme for the previous frame is a correlated signal channel combination scheme, and a channel combination ratio factor of the previous frame is equal to or greater than a first ratio factor threshold; or Determining that the channel combination scheme for the current frame is a correlated signal channel combination scheme when the channel combination scheme for the (P-1)th-to-current frame is different from the initial channel combination scheme for the Pth-to-current frame, the Pth-to-current frame does not satisfy a switching condition, the current frame satisfies a switching condition, the in-phase / anti-phase signal type of the stereo signal in the current frame is a close to in-phase signal, the initial channel combination scheme for the current frame is a correlated signal channel combination scheme, and the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme; or Determining that the channel combination scheme for the current frame is a correlated signal channel combination scheme when the channel combination scheme for the current (P-1)th frame is different from the initial channel combination scheme for the current Pth frame, the current Pth frame 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-correlated signal channel combination scheme, the channel combination scheme for the previous frame is a correlated signal channel combination scheme, and the channel combination ratio coefficient of the previous frame is less than a second ratio coefficient threshold; or When 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 a 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-correlated signal channel combination scheme, the channel combination scheme for the previous frame is a correlated signal channel combination scheme, and the channel combination ratio coefficient of the previous frame is equal to or greater than a second ratio coefficient threshold, determining that the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme. may include.
[0283] As used herein, P may be an integer greater than 1. For example, P may be equal to 2, 3, 4, 5, 6, or another value.
[0284] The value range of the first ratio factor threshold may be, for example, [0.4, 0.6], and the first ratio factor threshold may be, for example, equal to 0.4, 0.45, 0.5, 0.55, or 0.6.
[0285] The value range of the second ratio factor threshold may be, for example, [0.4, 0.6], and the second ratio factor threshold may be, for example, equal to 0.4, 0.46, 0.5, 0.56, or 0.6.
[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 a frame type of the primary channel signal in the previous frame and / or a 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 includes: determining that the current frame satisfies the switching condition when the first condition, the second condition, and the third condition are all satisfied, or determining that the current frame satisfies the switching condition when the second condition, the third condition, the fourth condition, and the fifth condition are all satisfied, or determining that the current frame satisfies the switching condition when the sixth condition is satisfied. may include.
[0288] The first condition is that the frame type of the primary channel signal in the previous frame is one of the following, namely, a VOICED_CLAS frame (a voiced frame or a frame having voiced characteristics following a voiced onset frame), an ONSET frame (a voiced onset frame), a SIN_ONSET frame (a frame having a mixture of harmonic and noise onset), 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 an UNVOICED_CLAS frame (a frame having one of several characteristics, namely, unvoiced, inactive, the frame type of the secondary channel signal in the previous frame is one of the following: 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 an UNVOICED_CLAS frame or a VOICED_TRANSITION frame (a frame that ends in noise or voiced speech, the frame has very weak voiced characteristics); or the frame type of the secondary channel signal in the previous frame is one of the following: 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 an 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 not both VOICED (the coding type corresponding to a 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 may 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 an 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 a 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 a second energy ratio threshold.
[0294] The range of the first energy ratio threshold may be, for example, [4000, 6000]. For example, First Energy Ratio The threshold may be equal to 4000, 4500, 5000, 5105, 5200, 6000, 5800, or another value.
[0295] The range of the second energy ratio threshold may be, for example, [4000, 6000]. Second Energy Ratio The threshold may be equal to 4000, 4501, 5000, 5105, 5200, 6000, 5800, or another value.
[0296] It can be understood that there are various implementations for determining whether the current frame satisfies the switching condition, and they are not limited to the schemes given as examples above.
[0297] Although some implementations of determining a channel combining scheme for the current frame have been provided in the above examples, it can be understood that the actual application may not be limited to the schemes in the above examples.
[0298] In the following, a scenario for the decorrelation signal coding mode is further described using an example.
[0299] Referring to Figure 4, an embodiment of the present application provides an audio encoding method, the relevant steps of which may 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 a decorrelated signal coding mode, perform 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 scheme corresponding to the decorrelated signal coding mode, so as to obtain primary and secondary channel signals in the current frame.
[0302] 403. Encode the acquired primary and secondary channel signals in the current frame.
[0303] 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.
[0304] For example, in some possible implementations, performing a time-domain downmix processing on left and right channel signals in the current frame by using a time-domain downmix processing scheme corresponding to the anti-correlated signal coding mode to obtain primary and secondary channel signals in the current frame may include: performing a time-domain downmix processing on left and right channel signals in the current frame based on channel combination ratio coefficients of an anti-correlated signal channel combination scheme for the current frame to obtain primary and secondary channel signals in the current frame, or performing a time-domain downmix processing on left and right channel signals in the current frame based on channel combination ratio coefficients of the anti-correlated signal channel combination scheme for the current frame and 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.
[0305] A channel combining scheme (e.g., decorrelated signal channel combining 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, a 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 when 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, when 0 ≤ n < N-delay_com,
[0316] [Number]
[0317] where when N-delay_com ≤ n < N-delay_com + NOVA_1,
[0318] [Number]
[0319] or when N-delay_com + NOVA_1 ≤ n < N,
[0320]
number
[0321] It is.
[0322] In this specification, fade_in(n) denotes a fade-in coefficient. For example,
[0323]
number
[0324] Of course, fade_in(n) may alternatively be another functionally related fade-in factor based on n.
[0325] fade_out(n) indicates the fade-out coefficient. For example,
[0326]
number
[0327] Of course, fade_out(n) may alternatively be another functionally related fade-out factor based on n.
[0328] NOVA_1 indicates the transition processing length. The value of NOVA_1 may be set based on the 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, when a time-domain down-mix processing is performed on left and right channel signals in a current frame by using a time-domain down-mix processing manner corresponding to a correlation signal coding mode to obtain primary and secondary channel signals in the current frame,
[0330]
number
[0331] It is.
[0332] In the above example, 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 a time-domain downmix process, and X(n) denotes the secondary channel signal in the current frame and obtained through a time-domain downmix process.
[0333] In the above example, n indicates the number of sampling points, for example, n=0, 1, ..., N-1.
[0334] In the above example, delay_com denotes the encoding delay compensation.
[0335] M 11 denote the downmix matrix corresponding to the correlated signal channel combination scheme for the previous frame, and M 11 is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the previous frame.
[0336] M 12 denote the downmix matrix corresponding to the anti-correlated 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.
[0337] M 22 denote the downmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, and M 22is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame.
[0338] M 21 denote the downmix matrix corresponding to the correlated signal channel combination scheme for the current frame, and M 21 is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the current frame.
[0339] M 21 can take multiple forms, e.g.
[0340]
number
[0341] or
[0342]
number
[0343] and ratio denotes the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme for the current frame.
[0344] M 22 can take multiple forms, e.g.
[0345]
number
[0346] or
[0347]
number
[0348] or
[0349]
number
[0350] or
[0351]
number
[0352] or
[0353]
number
[0354] or
[0355]
number
[0356] and α1=ratio_SM, α2=1-ratio_SM, where ratio_SM denotes the channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the current frame.
[0357] M 12 can take multiple forms, e.g.
[0358]
number
[0359] or
[0360]
number
[0361] or
[0362]
number
[0363] or
[0364]
number
[0365] or
[0366]
number
[0367] or
[0368]
number
[0369] and α 1_pre =tdm_last_ratio_SM, α 2_pre = 1 - tdm_last_ratio_SM, where tdm_last_ratio_SM indicates the channel combining ratio coefficient corresponding to the decorrelated signal channel combining 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 left and right channel signals that have not been subjected to time-domain pre-processing, for example, left and right channel signals obtained through sampling), or may be the left and right channel signals in the current frame that have been subjected to time pre-processing, or may be the left and right channel signals in the current frame that have been subjected to delay alignment processing.
[0371] Specifically, for example,
[0372]
number
[0373] or
[0374]
number
[0375] or
[0376]
number
[0377] and
[0378]
number
[0379] denote the original left and right channel signals in the current frame,
[0380]
number
[0381] denote the time-domain pre-processed left and right channel signals in the current frame,
[0382]
number
[0383] denotes the delay aligned left and right channel signals in the current frame.
[0384] Correspondingly, in the following, a scenario for the decorrelated signal decoding mode is described using an example.
[0385] Referring to Figure 5, an embodiment of the present application further provides an audio decoding method. The relevant steps of the audio decoding method may be implemented by a decoding device, and the method may specifically include the following steps:
[0386] 501. Perform decoding based on a bitstream to obtain decoded primary and secondary channel signals in a current frame.
[0387] 502. Determine the decoding mode for the current frame.
[0388] It may be understood that there is no necessary order for performing steps 501 and 502.
[0389] 503. When it is determined that the decoding mode of the current frame is an anti-correlated signal decoding mode, perform a time-domain up-mix processing on the decoded primary and secondary channel signals 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.
[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 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.
[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: correlated signal decoding mode, anti-correlated signal decoding mode, switch from correlated to anti-correlated signal decoding mode, and switch from anti-correlated to correlated signal decoding mode.
[0393] It can be seen that in the above solution, the decoding mode of the current frame needs to be determined, which indicates that there are multiple possibilities for the decoding mode of the current frame.Compared with the traditional solution that has only one decoding mode, this solution with multiple possible decoding modes can be more compatible and compatible with multiple possible scenarios.In addition, since a channel combination scheme corresponding to signals close to antiphase is introduced, when the stereo signals in the current frame are signals close to antiphase, there is a more targeted channel combination scheme and decoding mode, which helps to improve the decoding quality.
[0394] In some possible implementations, the method includes: When it is determined that the decoding mode of the current frame is a correlated signal decoding mode, performing a time-domain up-mix processing on the decoded primary and secondary channel signals in the current frame by using a time-domain up-mix processing scheme corresponding to the correlated signal decoding mode to obtain reconstructed left and right channel signals in the current frame, where the time-domain up-mix processing scheme corresponding to the correlated signal decoding mode is a time-domain up-mix processing scheme corresponding to a correlated signal channel combination scheme, and the correlated signal channel combination scheme is a channel combination scheme corresponding to signals close to in-phase. It may further include:
[0395] In some possible implementations, the method may further include, when the decoding mode of the current frame is determined to be a switching mode from correlated to anti-correlated signal decoding, 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 switching mode from correlated to anti-correlated signal decoding to obtain reconstructed left and right channel signals in the current frame, where the time-domain up-mix processing scheme corresponding to the switching mode from correlated to anti-correlated signal decoding is a time-domain up-mix processing scheme corresponding to a transition from a correlated signal channel combination scheme to an anti-correlated signal channel combination scheme.
[0396] In some possible implementations, the method may further include, when it is determined that the decoding mode of the current frame is a switching mode from anti-correlation to correlated signal decoding, 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 switching mode from anti-correlation to correlated signal decoding to obtain reconstructed left and right channel signals in the current frame, where the time-domain up-mix processing scheme corresponding to the switching mode from anti-correlation to correlated signal decoding is a time-domain up-mix processing scheme corresponding to a transition from an anti-correlation signal channel combination scheme to a correlated signal channel combination scheme.
[0397] It can be understood that the time-domain upmix processing schemes corresponding to different decoding modes are usually different, and in addition, each decoding mode may correspond to one or more time-domain upmix processing schemes.
[0398] For example, in some possible implementations, performing 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 a decorrelation signal decoding mode to obtain reconstructed left and right channel signals in the current frame includes: 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 to obtain 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 the previous frame to obtain reconstructed left and right channel signals in the current frame. Includes.
[0399] In some possible implementations, a corresponding up-mix matrix may be constructed based on the channel combination ratio coefficients of the audio frame, and a time-domain up-mix process is performed on the decoded primary and secondary channel signals in the current frame by using the up-mix matrix corresponding to the channel combination scheme to obtain reconstructed left and right channel signals in the current frame.
[0400] For example, 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 to obtain 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 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 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 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_daly,
[0409] [Number]
[0410] then, if N-upmixing_daly ≦ n < N-upmixing_daly + NOVA_1
[0411] [Number]
[0412] then, or if N-upmixing_daly + NOVA_1 ≦ n < N
[0413] [Number]
[0414] then.
[0415] In this specification,
[0416] [Number]
[0417] denotes the Reconstruction left channel signal obtained in the current frame,
[0418]
number
[0419] denotes the reconstructed right channel signal in the current frame,
[0420]
number
[0421] denotes 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] Of course, fade_in(n) may alternatively be another functionally related fade-in factor based on n.
[0428] fade_out(n) indicates the fade-out coefficient. For example,
[0429]
number
[0430] Of course, fade_out(n) may alternatively be another functionally related fade-out factor based on n.
[0431] NOVA_1 indicates the transition processing length. The value of NOVA_1 may be set based on the 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 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 correlation signal channel combination scheme for the current frame to obtain reconstructed left and right channel signals in the current frame,
[0433]
number
[0434] It is.
[0435] In the above example,
[0436]
number
[0437] is the current frame Reconstruction 4 shows the filtered left channel signal.
[0438]
number
[0439] denotes 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] In the above example, n indicates the number of sampling points, for example, n=0, 1, ..., N-1.
[0445] In the above example, upmixing_delay denotes the decoding delay compensation.
[0446]
number
[0447] denote the upmix matrix corresponding to the correlated signal channel combination scheme for the previous frame,
[0448]
number
[0449] is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the previous frame.
[0450]
number
[0451] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame,
[0452]
number
[0453] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame.
[0454]
number
[0455] denote the upmix matrix corresponding to the anti-correlated signal channel combination scheme for the previous frame,
[0456]
number
[0457] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame.
[0458]
number
[0459]
number
[0460] is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the current frame.
[0461]
number
[0462] can take multiple forms, e.g.
[0463]
number
[0464] or
[0465]
number
[0466] or
[0467]
number
[0468] or
[0469]
number
[0470] or
[0471]
number
[0472] or
[0473]
number
[0474] where α1=ratio_SM, α2=1-ratio_SM, where ratio_SM denotes the channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the current frame.
[0475]
number
[0476] can take multiple forms, e.g.
[0477]
number
[0478] or
[0479]
number
[0480] or
[0481]
number
[0482] or
[0483]
number
[0484] or
[0485]
number
[0486] or
[0487]
number
[0488] where α 1_pre =tdm_last_ratio_SM, α 2_pre = 1-tdm_last_ratio_SM, tdm_last_ratio_SM indicates the channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the previous frame.
[0489]
number
[0490] can take multiple forms, e.g.
[0491]
number
[0492] or
[0493]
number
[0494] where ratio denotes the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme for the current frame.
[0495] The following uses an example to show the switching mode from correlation to anti-correlation signal coding and from anti-correlation to correlation Scenarios for switching modes of signal coding are described. Switching modes from correlated to anti-correlated signal coding and from anti-correlated to correlation The time-domain downmix processing scheme corresponding to the switching mode for signal coding is, for example, a segmented time-domain downmix processing scheme.
[0496] Referring to Figure 6, an embodiment of the present application provides an audio encoding method. The relevant steps of the audio encoding method may be implemented by an encoding device, and the method may specifically include the following steps:
[0497] 601. Determine a channel combining 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 a segmented time-domain downmix process 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 primary and secondary channel signals in the current frame.
[0499] 603. Encode the acquired primary and secondary channel signals in the current frame.
[0500] If the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame, it means that the coding mode of the current frame is switched from correlated to anti-correlated signal coding mode or from anti-correlated to anti-correlated signal coding mode. correlation It may be determined that the coding mode of the current frame is a switching mode from correlated to anti-correlated signal coding or a switching mode from anti-correlated to correlated signal coding. correlation When in a switching to signal encoding mode, for example, a segmented time-domain downmix process 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 the previous frame is a correlated signal channel combination scheme and the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, it may be determined that the coding mode of the current frame is a correlation to anti-correlated signal coding switching mode. For another example, when the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme and the channel combination scheme for the current frame is a correlation signal channel combination scheme, it may be determined that the coding mode of the current frame is an anti-correlated to correlation signal coding switching mode. The rest can be inferred by analogy.
[0502] The segmented time-domain downmix processing may be understood as the left and right channel signals in a current frame are divided into at least two segments, and a different time-domain downmix processing scheme is used for each segment to perform the time-domain downmix processing. It can be understood that compared with the non-segmented time-domain downmix processing, the segmented time-domain downmix processing is more likely to obtain a smoother transition when the channel combination scheme for adjacent frames changes.
[0503] It can be seen that in the above solution, a 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. Compared with the conventional solution with only one channel combination scheme, this solution with multiple possible channel combination schemes can be more compatible and compatible with multiple possible scenarios. In addition, a mechanism is introduced to perform segmented time-domain downmix processing on the left and right channel signals in the current frame when the channel combination scheme for the current frame and the channel combination scheme for the previous frame are different. The segmented time-domain downmix processing mechanism helps to implement a smooth transition of the channel combination scheme and further improve the encoding quality.
[0504] In addition, a channel combining scheme corresponding to signals close to antiphase is introduced, so that when the stereo signals in the current frame are signals close to antiphase, there are more targeted channel combining schemes and coding modes, which helps to improve the encoding quality.
[0505] For example, the channel combining scheme for the previous frame may be a correlated signal channel combining scheme or an anti-correlated signal channel combining scheme. The channel combining scheme for the current frame may be a correlated signal channel combining scheme or an anti-correlated signal channel combining scheme. Thus, there are several possible cases where the channel combining scheme for the current frame and the channel combining scheme for the previous frame are different.
[0506] Specifically, for example, when the channel combination scheme for the previous frame is a correlated signal channel combination scheme and the channel combination scheme for the current frame is an anti-correlated 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, a middle segment of the left and right channel signals, and an end segment of the left and right channel signals, and the primary and secondary channel signals in the current frame include a start segment of the primary and secondary channel signals, a middle segment of the primary and secondary channel signals, and an end segment of the primary and secondary channel signals. In this case, performing a segmented time-domain downmix process on the left and right channel signals 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 includes: performing a time-domain down-mix processing on starting segments of left and right channel signals in the current frame to obtain starting segments of primary and secondary channel signals in the current frame by using a channel combination ratio coefficient corresponding to the correlated signal channel combination scheme for the previous frame and a time-domain down-mix processing scheme corresponding to the correlated signal channel combination scheme for the previous frame; performing a time-domain down-mix processing on the end segments of left and right channel signals in the current frame to obtain end segments of primary and secondary channel signals in the current frame by using a channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame and a time-domain down-mix processing scheme corresponding to the anti-correlated signal channel combination scheme for the current frame; The method may include performing a time-domain down-mix processing on intermediate segments of left and right channel signals in the current frame to obtain a first intermediate segment of the primary and secondary channel signals by using a channel combination ratio coefficient corresponding to the correlated signal channel combination scheme for the previous frame and a time-domain down-mix processing scheme corresponding to the correlated signal channel combination scheme for the previous frame; performing a time-domain down-mix processing on the intermediate segments of the left and right channel signals in the current frame to obtain a second intermediate segment of the primary and secondary channel signals by using a channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame and a time-domain down-mix processing scheme corresponding to the anti-correlated signal channel combination scheme for the current frame; and performing a weighted sum processing on the first intermediate segment of the primary and secondary channel signals and the second intermediate segment of the primary and secondary channel signals to obtain the intermediate segment of the primary and secondary channel signals in the current frame.
[0507] The lengths of the start segments of the left and right channel signals, the middle segments of the left and right channel signals, and the end segments of the left and right channel signals in the current frame may be set based on requirements. The lengths of the start segments of the left and right channel signals, the middle segments of the left and right channel signals, and the end segments of the left and right channel signals in the current frame may be the same, partially the same, or different from each other.
[0508] The lengths of the start segments of the primary and secondary channel signals, the middle segments of the primary and secondary channel signals, and the end segments of the primary and secondary channel signals in the current frame may be set based on requirements. The lengths of the start segments of the primary and secondary channel signals, the middle segments of the primary and secondary channel signals, and the end segments of the primary and secondary channel signals in the current frame may be the same, partially the same, or different from each other.
[0509] When the weighted sum process is performed on the first intermediate segments of the primary and secondary channel signals and the second intermediate segments of the primary and secondary channel signals, the weighting ratio corresponding to the first intermediate segments of the primary and secondary channel signals may or may not be equal to the weighting ratio corresponding to the second intermediate segments of the primary and secondary channel signals.
[0510] For example, when a weighted sum process is performed on first intermediate segments of the primary and secondary channel signals and second intermediate segments of the primary and secondary channel signals, the weighting factor corresponding to the first intermediate segments of the primary and secondary channel signals is a fade-out factor, and the weighting factor corresponding to the second intermediate segments of the primary and secondary channel signals is a fade-in factor.
[0511] In some possible implementations,
[0512]
number
[0513] Where: X 11 (n) indicates 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, and X 31 (n) indicates the end segment of the primary channel signal in the current frame, and Y 31 (n) indicates the end segment of the secondary channel signal in the current frame, and X 21 (n) denotes the middle segment of the primary channel signal in the current frame, and Y 21 (n) denotes an intermediate segment of the secondary channel signal in the current frame; X(n) denotes the primary channel signal in the current frame, Y(n) denotes the secondary channel signal in the current frame.
[0514] for example,
[0515]
number
[0516] It 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) represents the first intermediate segment of the primary channel signal in the current frame, and Y 211 (n) represents the first intermediate segment of the secondary channel signal in the current frame. X 212 (n) represents the second intermediate segment of the primary channel signal in the current frame, and Y 212 (n) represents 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 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, 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] where: α1=ratio_SM, α2=1-ratio_SM, where ratio_SM denotes the channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the current frame.
[0549] M 11 may have several possible forms, and these forms are specifically, for example,
[0550]
number
[0551] or
[0552]
number
[0553] where: tdm_last_ratio indicates the channel combining ratio coefficient corresponding to the correlated signal channel combining scheme for the previous frame.
[0554] Specifically, for another example, when the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme and the channel combination scheme for the current frame is a correlated 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, a middle segment of the left and right channel signals, and an end segment of the left and right channel signals, and the primary and secondary channel signals in the current frame include a start segment of the primary and secondary channel signals, a middle segment of the primary and secondary channel signals, and an end segment of the primary and secondary channel signals. In this case, performing a segmented time-domain downmix process on the left and right channel signals 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 includes: performing a time-domain down-mix processing on starting segments of left and right channel signals in the current frame to obtain starting segments of primary and secondary channel signals in the current frame by using a channel combination ratio coefficient corresponding to an anti-correlated signal channel combination scheme for a previous frame and a time-domain down-mix processing scheme corresponding to an anti-correlated signal channel combination scheme for the previous frame; performing a time-domain down-mix processing on the end segments of left and right channel signals in the current frame to obtain end segments of primary and secondary channel signals in the current frame by using a channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and a time-domain down-mix processing scheme corresponding to the correlation signal channel combination scheme for the current frame; The method may include performing a time-domain down-mix processing on the intermediate segments of left and right channel signals in the current frame to obtain a third intermediate segment of the primary and secondary channel signals by using a channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the previous frame and a time-domain down-mix processing scheme corresponding to the anti-correlated signal channel combination scheme for the previous frame; performing a time-domain down-mix processing on the intermediate segments of the left and right channel signals in the current frame to obtain a fourth intermediate segment of the primary and secondary channel signals by using a channel combination ratio coefficient corresponding to the correlated signal channel combination scheme for the current frame and a time-domain down-mix processing scheme corresponding to the correlated signal channel combination scheme for the current frame; and performing a weighted sum processing on the third intermediate segment of the primary and secondary channel signals and the fourth intermediate segment of the primary and secondary channel signals to obtain the intermediate segments of the primary and secondary channel signals in the current frame.
[0555] When the weighted sum process is performed on the third intermediate segments of the primary and secondary channel signals and the fourth intermediate segments of the primary and secondary channel signals, the weighting ratio corresponding to the third intermediate segments of the primary and secondary channel signals may or may not be equal to the weighting ratio corresponding to the fourth intermediate segments of the primary and secondary channel signals.
[0556] For example, when the weighted sum process is performed on a third intermediate segment of the primary and secondary channel signals and a fourth intermediate segment of the primary and secondary channel signals, the weighting factor corresponding to the third intermediate segment of the primary and secondary channel signals is a fade-out factor, and the weighting factor corresponding to the fourth intermediate segment of the primary and secondary channel signals is a fade-in factor.
[0557] In some possible implementations,
[0558]
number
[0559] where: X 12 (n) indicates the start segment of the primary channel signal in the current frame, and Y 12 (n) indicates the start segment of the secondary channel signal in the current frame, and X 32 (n) indicates the end segment of the primary channel signal in the current frame, and Y 32 (n) indicates the end segment of the secondary channel signal in the current frame, and X 22 (n) denotes the middle segment of the primary channel signal in the current frame, and Y 22 (n) denotes an intermediate segment of the secondary channel signal in the current frame; X(n) denotes the primary channel signal in the current frame, Y(n) denotes the secondary channel signal in the current frame.
[0560] for example,
[0561]
number
[0562] where: fade_in(n) indicates a fade-in coefficient, fade_out(n) indicates a 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] Of course, fade_in(n) may be a fade-in coefficient that is a different function based on n. Of course, fade_out(n) may be a fade-out coefficient that is a different function based on n. Out It may be a coefficient.
[0568] In this specification, n indicates 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 may be 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] 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.
[0582] M 12 denotes the downmix matrix corresponding to the anti-correlated signal channel combination scheme for the previous frame, and M 12 is constructed based on the channel combining ratio coefficients corresponding to the anti-correlated signal channel combining scheme for the previous frame. 21 denotes the downmix matrix corresponding to the correlated signal channel combination scheme for the current frame, and M 21 is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the current frame.
[0583] M 12 may have several possible forms, and these forms are specifically, 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] where: α 1_pre =tdm_last_ratio_SM, α 2_pre = 1-tdm_last_ratio_SM, tdm_last_ratio_SM indicates the channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the previous frame.
[0596] M 21 may have several possible forms, and these forms are specifically, for example,
[0597]
number
[0598] or
[0599]
number
[0600] where: ratio denotes the channel combining ratio coefficient corresponding to the correlation signal channel combining 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, left and right channel signals that have been subjected to time-domain pre-processing, or left and right channel signals that have been subjected to delay alignment processing.
[0602] Specifically, for example,
[0603]
number
[0604] or
[0605]
number
[0606] or
[0607]
number
[0608] where: x L (n) denotes the original left channel signal in the current frame (the original left channel signal is the left channel signal that has not been subjected to time-domain pre-processing), and x R (n) denotes the original right channel signal in the current frame (the original right channel signal is the right channel signal without time-domain pre-processing); 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. L (n) denotes the delay-aligned left channel signal in the current frame, and x' R(n) shows the delay aligned right channel signal in the current frame.
[0609] It can be understood that the segmented time-domain down-mix processing schemes in the above examples may not be all possible implementations, and in practical applications, other segmented time-domain down-mix processing schemes may also be used.
[0610] Correspondingly, in the following, we will use an example to explain the switching mode from correlation to anti-correlation signal decoding and from anti-correlation to correlation Scenarios for switching modes of signal decoding are described. Switching modes from correlated to anti-correlated signal decoding and from anti-correlated to correlated signal decoding are described. correlation The time-domain downmix processing scheme corresponding to the switching mode for signal decoding is, for example, a segmented time-domain downmix processing scheme.
[0611] Referring to Figure 7, an embodiment of the present application provides an audio decoding method. The relevant steps of the audio decoding method may be implemented by a decoding device, and the method may specifically include the following steps:
[0612] 701. Perform decoding based on a bitstream to obtain decoded primary and secondary channel signals in a current frame.
[0613] 702. Determine the channel combining scheme for the current frame.
[0614] It may be understood that there is no necessary order for performing steps 701 and 702.
[0615] 703. When the channel combination scheme for the current frame is different from the channel combination scheme for the previous frame, perform a segmented time-domain up-mix process 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 to obtain reconstructed left and right channel signals in the current frame.
[0616] The channel combining scheme for the current frame is one of a plurality of channel combining schemes.
[0617] For example, the multiple 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 close to in-phase. The anti-correlated signal channel combination scheme is a channel combination scheme corresponding to signals close to anti-phase. It can be understood that the channel combination scheme corresponding to signals close to in-phase is applicable to signals close to in-phase, and the channel combination scheme corresponding to signals close to anti-phase is applicable to signals close to anti-phase.
[0618] The segmented time-domain up-mix processing may be understood as the left and right channel signals in a current frame are divided into at least two segments, and a different time-domain up-mix processing scheme is used for each segment to perform the time-domain up-mix processing. It can be understood that compared with the non-segmented time-domain up-mix processing, the segmented time-domain up-mix processing is more likely to obtain a smoother transition when the channel combination scheme for adjacent frames changes.
[0619] It can be seen that in the above solution, a channel combination scheme for a current frame needs to be determined, which 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 can be more compatible and compatible with multiple possible scenarios. In addition, a mechanism is introduced to perform segmented time-domain upmix processing on the left and right channel signals in the current frame when the channel combination scheme for the current frame and the channel combination scheme for the previous frame are different. 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, a channel combining scheme corresponding to signals close to antiphase is introduced, so that when the stereo signals in the current frame are signals close to antiphase, there are more targeted channel combining schemes and coding modes, which helps to improve the encoding quality.
[0621] For example, the channel combining scheme for the previous frame may be a correlated signal channel combining scheme or an anti-correlated signal channel combining scheme. The channel combining scheme for the current frame may be a correlated signal channel combining scheme or an anti-correlated signal channel combining scheme. Thus, there are several possible cases where the channel combining scheme for the current frame and the channel combining scheme for the previous frame are different.
[0622] Specifically, for example, the channel combination scheme for the previous frame is a correlated signal channel combination scheme, and the channel combination scheme for the current frame is an anti-correlated 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, a middle segment of the reconstructed left and right channel signals, and an end segment of the reconstructed left and right channel signals. The decoded primary and secondary channel signals in the current frame include a start segment of the decoded primary and secondary channel signals, a middle segment of the decoded primary and secondary channel signals, and an end segment of the decoded primary and secondary channel signals. In this case, performing segmented time-domain up-mix 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 to obtain reconstructed left and right channel signals in the current frame includes performing a time-domain up-mix processing on a starting segment of the decoded primary and secondary channel signals in the current frame by using a channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the previous frame and a time-domain up-mix processing scheme corresponding to the correlation signal channel combination scheme for the previous frame to obtain a starting segment of the reconstructed left and right channel signals in the current frame; performing a time-domain up-mix processing on the end segments of the decoded primary and secondary channel signals in the current frame to obtain end segments of reconstructed left and right channel signals in the current frame by using a channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame and a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combination scheme for the current frame; performing a time-domain up-mix processing on intermediate segments of decoded primary and secondary channel signals in the current frame to obtain a first intermediate segment of reconstructed left and right channel signals by using a channel combination ratio coefficient corresponding to a correlated signal channel combination scheme for a previous frame and a time-domain up-mix processing scheme corresponding to the correlated signal channel combination scheme for the previous frame; performing a time-domain up-mix processing on intermediate segments of decoded primary and secondary channel signals in the current frame to obtain a second intermediate segment of reconstructed left and right channel signals by using a channel combination ratio coefficient corresponding to an anti-correlated signal channel combination scheme for the current frame and a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combination scheme for the current frame; and performing a weighted sum processing on the first intermediate segment of the reconstructed left and right channel signals and the second intermediate segment of the reconstructed left and right channel signals to obtain an intermediate segment of the reconstructed left and right channel signals in the current frame. Includes.
[0623] The lengths of the start segments of the reconstructed left and right channel signals, the middle segments of the reconstructed left and right channel signals, and the end segments of the reconstructed left and right channel signals in the current frame may be set based on requirements. The lengths of the start segments of the reconstructed left and right channel signals, the middle segments of the reconstructed left and right channel signals, and the end segments of the reconstructed left and right channel signals in the current frame may be the same, may be partially the same, or may be different from each other.
[0624] The lengths of the start segment of the decoded primary and secondary channel signals, the middle segment of the decoded primary and secondary channel signals, and the end segment of the decoded primary and secondary channel signals in the current frame may be set based on requirements. The lengths of the start segment of the decoded primary and secondary channel signals, the middle segment of the decoded primary and secondary channel signals, and the end segment of the decoded primary and secondary channel signals in 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 the weighted sum processing is performed 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, the weighting ratios corresponding to the first intermediate segments of the reconstructed left and right channel signals may or may not be equal to the weighting ratios corresponding to the second intermediate segments of the reconstructed left and right channel signals.
[0627] For example, when the weighted sum process is performed on a first intermediate segment of the reconstructed left and right channel signals and a second intermediate segment of the reconstructed left and right channel signals, the weighting factor corresponding to the first intermediate segment of the reconstructed left and right channel signals is a fade-out factor, and the weighting factor corresponding to the second intermediate segment of the reconstructed left and right channel signals is a fade-in factor.
[0628] In some possible implementations,
[0629]
number
[0630] where:
[0631]
number
[0632] denotes the start segment of the reconstructed left channel signal in the current frame,
[0633]
number
[0634] denotes the starting segment of the reconstructed right channel signal in the current frame.
[0635]
number
[0636] denotes the end segment of the reconstructed left channel signal in the current frame,
[0637]
number
[0638] denotes the end segment of the reconstructed right channel signal in the current frame.
[0639]
number
[0640] denotes the middle segment of the reconstructed left channel signal in the current frame,
[0641]
number
[0642] denotes the middle segment of the reconstructed right channel signal in the current frame,
[0643]
number
[0644] denotes the reconstructed left channel signal in the current frame,
[0645]
number
[0646] denotes the reconstructed right channel signal in the current frame.
[0647] for example,
[0648]
number
[0649] It 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] Of course, fade_in(n) may be a fade-in coefficient that is a different function based on n. Of course, fade_out(n) may be a fade-out coefficient that is a different function based on n. Out It may be a coefficient.
[0656] In this specification, n indicates the number of sampling points, and n=0, 1, ..., N-1. <N1<N2<N-1である。
[0657]
number
[0658] denotes the first intermediate segment of the reconstructed left channel signal in the current frame,
[0659]
number
[0660] denotes 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] where:
[0674]
number
[0675] denotes the decoded primary channel signal in the current frame,
[0676]
number
[0677] denotes the decoded secondary channel signal in the current frame,
[0678]
number
[0679] denote the upmix matrix corresponding to the correlated signal channel combination scheme for the previous frame,
[0680]
number
[0681] is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the previous frame,
[0682]
number
[0683] denote the upmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame,
[0684]
number
[0685] is constructed based on the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame.
[0686]
number
[0687] may have several 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] where: α1=ratio_SM, α2=1-ratio_SM, where ratio_SM denotes the channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the current frame.
[0700]
number
[0701] may have several possible forms, and these forms are specifically, for example,
[0702]
number
[0703] or
[0704]
number
[0705] It is.
[0706] Herein, tdm_last_ratio denotes the channel combining ratio coefficient corresponding to the correlated signal channel combining scheme for the previous frame.
[0707] Specifically, for another example, the channel combination scheme for the previous frame is an anti-correlated signal channel combination scheme, and the channel combination scheme for the current frame is a correlated 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, a middle segment of the reconstructed left and right channel signals, and an end segment of the reconstructed left and right channel signals. The decoded primary and secondary channel signals in the current frame include a start segment of the decoded primary and secondary channel signals, a middle segment of the decoded primary and secondary channel signals, and an end segment of the decoded primary and secondary channel signals. In this case, performing a segmented time-domain upmix process 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 to obtain the reconstructed left and right channel signals in the current frame includes: performing a time-domain up-mix processing on starting segments of the decoded primary and secondary channel signals in the current frame to obtain starting segments of reconstructed left and right channel signals in the current frame by using a channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the previous frame and a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combination scheme for the previous frame; performing a time-domain up-mix processing on the end segments of the decoded primary and secondary channel signals in the current frame to obtain end segments of reconstructed left and right channel signals in the current frame by using a channel combination ratio coefficient corresponding to the correlated signal channel combination scheme for the current frame and a time-domain up-mix processing scheme corresponding to the correlated signal channel combination scheme for the current frame; performing a time-domain up-mix processing on intermediate segments of decoded primary and secondary channel signals in the current frame to obtain a third intermediate segment of reconstructed left and right channel signals by using a channel combination ratio coefficient corresponding to an anti-correlated signal channel combination scheme for a previous frame and a time-domain up-mix processing scheme corresponding to the anti-correlated signal channel combination scheme for the previous frame; performing a time-domain up-mix processing on intermediate segments of decoded primary and secondary channel signals in the current frame to obtain a fourth intermediate segment of reconstructed left and right channel signals by using a channel combination ratio coefficient corresponding to a correlated signal channel combination scheme for the current frame and a time-domain up-mix processing scheme corresponding to the correlated signal channel combination scheme for the current frame; and performing a 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 to obtain an intermediate segment of the reconstructed left and right channel signals in the current frame. Includes.
[0708] When the weighted sum processing is performed on the third intermediate segments of the reconstructed left and right channel signals and the fourth intermediate segments of the reconstructed left and right channel signals, the weighting ratio corresponding to the third intermediate segments of the reconstructed left and right channel signals may or may not be equal to the weighting ratio corresponding to the fourth intermediate segments 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 factor corresponding to the third intermediate segment of the reconstructed left and right channel signals is a fade-out coefficient, and the weighting factor 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] denotes the start segment of the reconstructed left channel signal in the current frame,
[0715]
number
[0716] denotes the start segment of the reconstructed right channel signal in the current frame,
[0717]
number
[0718] denotes the end segment of the reconstructed left channel signal in the current frame,
[0719]
number
[0720] denotes the end segment of the reconstructed right channel signal in the current frame,
[0721]
number
[0722] denotes the middle segment of the reconstructed left channel signal in the current frame,
[0723]
number
[0724] denotes the middle segment of the reconstructed right channel signal in the current frame.
[0725]
number
[0726] denotes the reconstructed left channel signal in the current frame,
[0727]
number
[0728] denotes the reconstructed right channel signal in the current frame.
[0729] for example,
[0730]
number
[0731] It is.
[0732] fade_in(n) indicates a fade-in coefficient, fade_out(n) indicates a 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] Of course, fade_in(n) may be a fade-in coefficient that is a different function based on n. Of course, fade_out(n) may be a fade-out coefficient that is a different function based on n. Out It may be a coefficient.
[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 may be equal to 101, 107, 120, 150, or another value.
[0741] For example, N4 may be 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] and when N3 ≤ n < N4,
[0753]
Number
[0754] and when 0 ≦ n < N3
[0755] [Number]
[0756] and when N4 ≦ n < N
[0757] [Number]
[0758] and here
[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 the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the previous frame.
[0767]
number
[0768] denote the upmix matrix corresponding to the correlated signal channel combination scheme for the current frame,
[0769]
number
[0770] is constructed based on the channel combining ratio coefficients corresponding to the correlation signal channel combining scheme for the current frame.
[0771]
number
[0772] may have several 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] where: α 1_pre =tdm_last_ratio_SM, α 2_pre = 1-tdm_last_ratio_SM, tdm_last_ratio_SM indicates the channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the previous frame.
[0785]
number
[0786] may have several possible forms, and these forms are specifically, for example,
[0787]
number
[0788] or
[0789]
number
[0790] where: ratio denotes the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme for the current frame.
[0791] In this embodiment of the present application, the stereo parameters of the current frame (e.g., channel combination ratio coefficients and / or inter-channel time differences) may be fixed values or may be determined based on a channel combination scheme for the current frame (e.g., a correlated signal channel combination scheme or an anti-correlated signal channel combination scheme).
[0792] With reference to Figure 8, the following uses an example to describe a time-domain stereo parameter determining method. The relevant steps of the time-domain stereo parameter determining method may be implemented by an encoding device, and the method may specifically include the following steps:
[0793] 801. Determine the channel combining scheme for the current frame.
[0794] 802. Determine time-domain stereo parameters for the current frame based on a channel combination scheme for the current frame, where the time-domain stereo parameters may include at least one of a channel combination ratio coefficient and an inter-channel time difference.
[0795] The channel combining scheme for the current frame is one of a plurality of channel combining schemes.
[0796] For example, the multiple channel combining schemes include anti-correlated signal channel combining schemes and correlated signal channel combining schemes.
[0797] A correlated signal channel combining scheme is a channel combining scheme corresponding to signals close to in-phase. An anti-correlated signal channel combining scheme is a channel combining scheme corresponding to signals close to anti-phase. It can be understood that a channel combining scheme corresponding to signals close to in-phase is applicable to signals close to in-phase, and a channel combining scheme corresponding to signals close to anti-phase is applicable to signals close to anti-phase.
[0798] When the channel combination scheme for the current frame is determined to be a correlated signal channel combination scheme, the time-domain stereo parameters of the current frame are time-domain stereo parameters corresponding to the correlated signal channel combination scheme for the current frame, or when the channel combination scheme for the current frame is determined to be an anti-correlated signal channel combination scheme, the time-domain stereo parameters of the current frame are time-domain stereo parameters corresponding to the anti-correlated signal channel combination scheme for the current frame.
[0799] It can be seen that in the above solution, a 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. Compared with the conventional solution with only one channel combination scheme, this solution with multiple possible channel combination schemes can be more compatible and consistent with multiple possible scenarios. Since the time domain stereo parameters of the current frame are determined based on the channel combination scheme for the current frame, the time domain stereo parameters can be more compatible and consistent with multiple possible scenarios, and the encoding quality and the decoding quality can be further improved.
[0800] In some possible implementations, the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame and the channel combination ratio coefficients corresponding to the correlated signal channel combination scheme for the current frame may be calculated separately first, and then when the channel combination scheme for the current frame is determined to be a correlated signal channel combination scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the correlated signal channel combination scheme for the current frame, or when the channel combination scheme for the current frame is determined to be an anti-correlated signal channel combination scheme, the time-domain stereo parameters of the current frame are determined to be the time-domain stereo parameters corresponding to the anti-correlated signal channel combination scheme for the current frame. Alternatively, time domain stereo parameters corresponding to the correlated signal channel combination scheme for the current frame may be calculated first, and when it is determined that the channel combination scheme for the current frame is a correlated signal channel combination scheme, the time domain stereo parameters of the current frame are determined to be the time domain stereo parameters corresponding to the correlated signal channel combination scheme for the current frame; or when it is determined that the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme, time domain stereo parameters corresponding to the anti-correlated signal channel combination scheme for the current frame are calculated, and the time domain stereo parameters corresponding to the anti-correlated signal channel combination scheme for the current frame are determined to be the time domain stereo parameters of the current frame.
[0801] Alternatively, the channel combination scheme for the current frame may be determined first. When the channel combination scheme for the current frame is determined to be a correlated signal channel combination scheme, time domain stereo parameters corresponding to the correlated signal channel combination scheme for the current frame are calculated, and the time domain stereo parameters of the current frame are the time domain stereo parameters corresponding to the correlated signal channel combination scheme for the current frame. Or, when the channel combination scheme for the current frame is determined to be an anti-correlated signal channel combination scheme, time domain stereo parameters corresponding to the anti-correlated signal channel combination scheme for the current frame are calculated, and the time domain stereo parameters of the current frame are the time domain stereo parameters corresponding to the anti-correlated signal channel 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 the initial value of the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame (correlated signal channel combination scheme or anti-correlated signal channel combination scheme) does not need to be modified, 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 the initial value of the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame (correlated signal channel combination scheme or anti-correlated signal channel combination scheme) needs to be modified, the initial value of the channel combination ratio coefficient corresponding to the channel combination scheme for the current frame is modified to obtain a modified 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 modified 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 a frame energy of a left channel signal in the current frame based on the left channel signal in the current frame; calculating a frame energy of a right channel signal in the current frame based on the right channel signal in the current frame; and calculating initial values of channel combination ratio coefficients 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 the initial value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame does not need to be modified, 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 modified, 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 modified to obtain a modified value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame and an encoded index of the modified value. The channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame is equal to the modified 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 modified 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 values of the channel combination ratio coefficients corresponding to the correlation signal channel combination scheme for the current frame and the encoded indexes of the initial values are modified; 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 an encoded index of a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for a previous frame, ratio_idx_mod indicates an encoded index corresponding to a modified value of a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for a current frame, and ratio_mod qua denotes the modified value of the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme for the current frame.
[0807] For another example, determining the time-domain 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 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 an anti-correlated 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 the channel combination ratio coefficient corresponding to the anti-correlated 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 may include, for example, calculating an initial value of the channel combination ratio coefficient corresponding to the anti-correlated 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-correlated signal channel combination scheme for the current frame to obtain the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame. It can be understood that when the initial value of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame does not need to be modified, the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame is equal to the initial value of the channel combination ratio coefficient corresponding to the anti-correlated 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) denotes the reference 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 right channel signal in the current frame that has been subjected to delay alignment processing, corr_LM indicates the amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, and corr_RM indicates the amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame.
[0816] In some possible implementations, calculating an amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame based on an amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame and an amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame includes: calculating a 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 delay aligned left channel signal and the reference channel signal in the current frame; calculating a 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 delay aligned right channel signal and the reference channel signal in the current frame; and calculating an 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, e.g. tdm_lt_corr_LM_SM cur=α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM, where tdm_lt_rms_L_SM cur =(1-A)*tdm_lt_rms_L_SM pre +A*rms_L, where A denotes 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 denotes the long-term smoothed frame energy of the left channel signal in the current frame, rms_L denotes the frame energy of the left channel signal in the current frame, and tdm_lt_corr_LM_SM cur denotes the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, and tdm_lt_corr_LM_SM pre denotes the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the previous frame, and α denotes 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 denotes 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 denotes the long-term smoothed frame energy of the right channel signal in the current frame, rms_R denotes the frame energy of the right channel signal in the current frame, and tdm_lt_corr_RM_SM cur denotes the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame, and tdm_lt_corr_RM_SM predenotes the long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the previous frame, and β denotes 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 indicates a 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 indicates a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame, and diff_lt_corr indicates an amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame.
[0820] In some possible implementations, calculating a channel combination ratio coefficient corresponding to an anti-correlated signal channel combination scheme for the current frame based on an amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame includes performing a mapping process on an amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame to enable a value range of the mapped amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame to be [MAP_MIN, MAP_MAX], and converting the mapped amplitude correlation difference parameter between the left channel signal and the right channel signal into a channel combination ratio coefficient.
[0821] In some possible implementations, performing a mapping process on an amplitude correlation difference parameter between the left channel and the right channel in the current frame includes performing amplitude limiting on an amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame, and performing a mapping process on an 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 schemes, in particular, for example:
[0823]
number
[0824] where: RATIO_MAX indicates 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_MIN indicates 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, where RATIO_MAX>RATIO_MIN.
[0825] There may be various mapping methods, specifically, for example:
[0826]
number
[0827] where:
[0828]
number
[0829] and 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 indicates the mapped amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame; MAP_MAX indicates a maximum value of the amplitude correlation difference parameter that is mapped between the left channel signal and the right channel signal in the current frame, MAP_HIGH indicates a high threshold value of the amplitude correlation difference parameter that is mapped between the left channel signal and the right channel signal in the current frame, MAP_LOW indicates a low threshold value of the amplitude correlation difference parameter that is mapped between the left channel signal and the right channel signal in the current frame, and MAP_MIN indicates a minimum value of the amplitude correlation difference parameter that is mapped between the left channel signal and the right channel signal in the current frame, MAP_MAX>MAP_HIGH>MAP_LOW>MAP_MIN, RATIO_MAX indicates the maximum value of the amplitude-limited amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame, and RATIO_HIGH indicates 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. of amplitude Limit Amplitude RATIO_LOW indicates the high threshold of the correlation difference parameter, and RATIO_LOW indicates the difference between the left and right channel signals in the current frame. of amplitude Limit Amplitude RATIO_MIN indicates the low threshold of the correlation difference parameter, and RATIO_MIN is the correlation difference between the left and right channel signals in the current frame. of amplitude Limit Amplitude indicates the minimum value of the correlation difference parameter, RATIO_MAX>RATIO_HIGH>RATIO_LOW>RATIO_MIN.
[0834] Another example:
[0835]
number
[0836] where: diff_lt_corr_limit indicates an 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 indicates a mapped amplitude correlation difference parameter between the left channel signal and the right channel signal in the current frame;
[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] where: diff_lt_corr_map indicates an amplitude correlation difference parameter that has been mapped between the left channel signal and the right channel signal in the current frame, and ratio_SM indicates a channel combination ratio coefficient corresponding to an anti-correlated signal channel combination scheme for the current frame, or ratio_SM indicates an initial value of the channel combination ratio coefficient corresponding to an anti-correlated 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 modified, the modification may be performed before or after the channel combination ratio coefficient is encoded. Specifically, for example, an initial value of a channel combination ratio coefficient of a current frame (e.g., a channel combination ratio coefficient corresponding to an anti-correlated signal channel combination scheme or a channel combination ratio coefficient corresponding to a correlated signal channel combination scheme) may be first obtained through calculation, then the initial value of the channel combination ratio coefficient is encoded to obtain an initial encoded index of the channel combination ratio coefficient of the current frame, and the initial encoded index of the obtained channel combination ratio coefficient of the current frame is modified to obtain an 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, an initial value of the channel combination ratio coefficient of the current frame may be first obtained through calculation, then the initial value of the channel combination ratio coefficient of the current frame obtained through calculation is modified to obtain a channel combination ratio coefficient of the current frame, and the obtained channel combination ratio coefficient of the current frame is encoded to obtain an 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-correlated signal channel combination scheme for the current frame. For example, when the initial value of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame needs to be modified to obtain the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame, the initial value of the channel combination ratio coefficient corresponding to the anti-correlated 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-correlated signal channel combination scheme for the current frame. Or the initial value of the channel combination ratio coefficient corresponding to the anti-correlated 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-correlated signal channel combination scheme for the current frame.
[0844] For example, first, it is determined whether the initial value of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame needs to be modified 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-correlated signal channel combination scheme for the previous frame, and the initial value of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame. If it needs to be modified, the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the previous frame is used as the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame. Otherwise, the initial value of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame is used as the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame.
[0845] Of course, the specific implementation of modifying the initial value of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame to obtain the channel combination ratio coefficient corresponding to the anti-correlated 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, quantization encoding is performed on the determined channel combining ratio coefficients corresponding to an anti-correlated signal channel combining scheme for the current frame; ratio_init_SM qua = ratio_tabl[ratio_idx_init_SM], where: ratio_tabl_SM indicates a codebook for performing scalar quantization for channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame, ratio_idx_init_SM indicates an initial encoded index of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame, and ratio_init_SM qua , where ∈ denotes the quantized encoded initial values of the channel combining ratio coefficients corresponding to the decorrelated signal channel combining 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 indicates a channel combining ratio coefficient corresponding to the decorrelated signal channel combining scheme for the current frame, and ratio_idx_SM indicates an encoded index of the channel combining ratio coefficient corresponding to the decorrelated signal channel combining 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: ratio_idx_init_SM indicates an initial encoded index of a channel combination ratio coefficient corresponding to an anti-correlated signal channel combination scheme for a current frame, tdm_last_ratio_idx_SM indicates a final encoded index of a channel combination ratio coefficient corresponding to an anti-correlated signal channel combination scheme for a previous frame,
[0849]
number
[0850] is a modification coefficient of the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme, and ratio_SM denotes the channel combining ratio coefficient corresponding to the anti-correlated signal channel combining scheme for the current frame.
[0851] In some possible implementations, when the initial values of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame need to be modified to obtain the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame, quantization encoding may be first performed on the initial values of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame to obtain the initial encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame. Then, the initial encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame may be modified based on the encoded indexes of the channel combination ratio coefficients of the previous frame and the initial encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame. Or, the initial encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame may be modified based on the initial encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame.
[0852] For example, quantization encoding may be first performed on the initial values of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame to obtain initial encoded indexes corresponding to the anti-correlated signal channel combination scheme for the current frame. Then, when the initial values of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame need to be modified, the encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the previous frame are used as the encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame. Otherwise, the initial encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame are used as the encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame. Finally, the quantization encoded values corresponding to the encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame are used as the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame.
[0853] In addition, when the time-domain stereo parameters include an inter-channel time difference, determining the time-domain stereo parameters of the current frame based on the channel combination scheme for the current frame may include calculating the inter-channel time difference of the current frame when the channel combination scheme for the current frame is a correlated signal channel combination scheme. In addition, the inter-channel time difference of the current frame obtained through the calculation may be written into the bitstream. A default inter-channel time difference (e.g., 0) is used as the inter-channel time difference of the current frame when the channel combination scheme for the current frame is an anti-correlated signal channel combination scheme. In addition, the default inter-channel time difference may not be written into the bitstream, and the decoding device also uses the default inter-channel time difference.
[0854] The following further provides a time-domain stereo parameter encoding method by using an example, which may include, for example, determining a channel combination scheme for a current frame, determining time-domain stereo parameters of the current frame based on the channel combination scheme for the current frame, and encoding the determined time-domain stereo parameters of the current frame, where the time-domain stereo parameters may include at least one of a channel combination ratio coefficient and an inter-channel time difference.
[0855] Correspondingly, the decoding apparatus may obtain time-domain stereo parameters of the current frame from the bitstream, and further perform associated decoding based on the time-domain stereo parameters of the current frame obtained from the bitstream.
[0856] The following provides an explanation by using an example regarding a more specific application scenario.
[0857] 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 this embodiment of the present application may be implemented by an encoding device, and the method may specifically include the following steps:
[0858] 901. Perform time-domain pre-processing on the original left and right channel signals in the current frame.
[0859] For example, if the sampling rate of a stereo audio signal is 16KHz, one frame of the signal is 20ms, and 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 a left channel signal in the current frame and a right channel signal in the current frame. The original left channel signal in the current frame is x L (n), and the original right channel signal in the current frame is denoted as x R It is denoted as (n), where n is the sampling point number, n=0, 1, ..., N-1.
[0860] For example, performing time-domain pre-processing on the original left and right channel signals in the current frame includes performing a high-pass filtering operation on the original left and right channel signals in the current frame to obtain time-domain pre-processed left and right channel signals in the current frame, where the time-domain pre-processed left channel signal in the current frame is x L_HP (n), and the time-domain preprocessed right channel signal in the current frame is denoted as x R_HP In this specification, n is the number of sampling points, n=0, 1, ..., N-1. The filter used in the high-pass filtering process may be, for example, an infinite impulse response filter with a cutoff frequency of 20 Hz. ( Infinite Impulse Response、 It may be a IIR filter or another type of filter.
[0861] For example, if the sampling rate is 16KHz and the corresponding high-pass filter has a cutoff frequency of 20Hz, the transfer function is
[0862]
number
[0863] where b0=0.994461788958195, b1=-1.988923577916390, b2=0.994461788958195, a1=1.988892905899653, a2=-0.988954249933127, z is the transformation coefficient for the Z transform.
[0864] The corresponding time domain filter transfer function 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) It is sometimes expressed as:
[0865] 902. Perform delay alignment on the time-domain pre-processed left and right channel signals in the current frame to obtain delay aligned left and right channel signals in the current frame.
[0866] A delay-aligned signal may be referred to simply as a "delay-aligned signal." For example, a delay-aligned left channel signal may be referred to simply as a "delay-aligned left channel signal" and a delay-aligned right channel signal may be referred to simply as a "delay-aligned right These are sometimes referred to as "channel signals" and the same applies below.
[0867] Specifically, inter-channel delay parameters may be extracted based on the pre-processed left and right channel signals in the current frame and then encoded, and delay alignment is performed on the left and right channel signals based on the encoded inter-channel delay parameters to obtain delay-aligned left and right channel signals in the current frame. The delay-aligned left channel signal in the current frame is denoted by x' L (n), and the delay-aligned right channel signal in the current frame is denoted as x' R It is denoted as (n), where n is the sampling point number, n=0, 1, ..., N-1.
[0868] Specifically, for example, the encoding device may calculate time-domain cross-correlation functions of the left channel and the right channel based on the pre-processed left and right channel signals in the current frame, search for a maximum (or another value) of the time-domain cross-correlation functions of the left channel and the right channel to determine a time difference between the left channel signal and the right channel signal, perform quantization encoding on the determined time difference between the left channel and the right channel, use a signal of one channel selected from the left channel and the right channel as a reference, and perform delay adjustment for the signal of the other channel based on the quantization encoded time difference between the left channel and the right channel to obtain left and right channel signals in the current frame that have been subjected to delay alignment processing.
[0869] It should be noted that there are many specific implementation methods of the delay alignment process, and the present embodiment is not limited to a specific delay alignment process method.
[0870] 903. Perform a time domain analysis for the delay aligned left and right channel signals in the current frame.
[0871] In particular, the time domain analysis may include transient detection, etc. The transient detection may be energy detection performed on the delay-aligned left and right channel signals in the current frame (in particular, it may be detected whether the current frame has a sudden energy change). For example, the energy of the delay-aligned left channel signal in the current frame may be E cur_L and the energy of the delay-aligned left channel signal in the previous frame is E pre_L In this case, the transient detection is performed by using E pre_L and E cur_L Similarly, transient detection may be performed based on the absolute value of the difference between the delay-aligned right The time domain analysis may be performed on the channel signal. The time domain analysis may further include other conventional forms of time domain analysis other than transient detection, for example, frequency band extension pre-processing.
[0872] It can be appreciated that step 903 may be performed at any time after step 902 and before the primary and secondary channel signals in the current frame are encoded.
[0873] 904. Perform channel combining scheme determination for the current frame based on the delay aligned left and right channel signals in the current frame to determine a channel combining scheme for the current frame.
[0874] Two possible channel combination schemes are described as examples in this embodiment, and are referred to as correlated signal channel combination scheme and anti-correlated signal channel combination scheme in the following description. In this embodiment, the correlated signal channel combination scheme corresponds to the case where the left and right channel signals in the current frame (obtained after delay alignment) are close to the same phase signals, and the anti-correlated signal channel combination scheme corresponds to the case where the left and right channel signals in the current frame (obtained after delay alignment) are close to the opposite phase signals. Of course, in addition to "correlated signal channel combination scheme" and "anti-correlated signal channel combination scheme", other names may also be used to represent the two possible channel combination schemes in practical 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 implementations of determining the channel combination scheme for the current frame, please refer to the related descriptions in the above embodiments. The details will not be described again in this specification.
[0876] 905. Calculate and encode a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for the current frame based on the delay aligned left and right channel signals in the current frame and the channel combination scheme flag of the current frame to obtain an initial value and an encoded index of the initial value of a channel combination ratio coefficient corresponding to a correlation signal channel combination scheme for 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 delay-aligned left and right channel signals in the current frame, where: The frame energy rms_L of the left channel signal in the current frame is
[0878]
number
[0879] Fulfilling The frame energy rms_R of the right channel signal in the current frame is
[0880]
number
[0881] where x' L (n) shows the delay aligned left channel signal in the current frame; x' R (n) shows the delay aligned right channel signal in the current frame.
[0882] Then, 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 calculation is:
[0883]
number
[0884] Meet the following.
[0885] Then, the quantization encoding is performed by dividing the corresponding encoded index ratio_idx_init and the quantization encoded channel combination ratio coefficient ratio_init corresponding to the correlation signal channel combination scheme for the current frame. qua To obtain R_i, a channel combination ratio coefficient ratio_init corresponding to the correlation signal channel combination scheme for the current frame is performed, which is obtained through 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 will not be described again in this specification.
[0887] The quantized encoded channel combination ratio coefficients ratio_init corresponding to the correlated 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 an 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 combining ratio coefficient corresponding to the correlation signal channel combining scheme for the current frame may be further modified based on the value of the channel combining 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 modified to a preset value (e.g., 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 modified to ratio_init qua This may be corrected to =ratio_tabl
[15] .
[0890] It should be noted that in addition to the above-mentioned calculation method, 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 (e.g., 0.5 or another value).
[0891] 906. Determine whether the channel combining ratio coefficient needs to be modified based on the channel combining ratio coefficient modification flag.
[0892] If necessary, the channel combination ratio coefficient corresponding to the correlated signal channel combination scheme for the current frame and the encoded index of the channel combination ratio coefficient are modified to obtain a modified value of the channel combination ratio coefficient corresponding to the correlated signal channel combination scheme for the current frame and the encoded index of the modified value.
[0893] The channel combination ratio coefficient modification flag of 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.
[0894] For example, determining whether the channel combination ratio coefficient needs to be modified based on the channel combination ratio coefficient modification flag may specifically include, for example, determining that the channel combination ratio coefficient needs to be modified if the channel combination ratio coefficient modification flag tdm_SM_modi_flag=1. For another example, determining that the channel combination ratio coefficient does not need to be modified if the channel combination ratio coefficient modification flag tdm_SM_modi_flag=0.
[0895] Modifying the channel combination ratio coefficients corresponding to the correlation signal channel combination scheme for the current frame and the encoded indexes of the channel combination ratio coefficients can be specifically For example, the encoded index corresponding to the modified 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; It may include:
[0896] Modification value of the channel combination ratio coefficient corresponding to the correlation signal channel combination scheme for the current frame ratio_mod qua ratio_mod qua =ratio_tabl[ratio_idx_mod] is satisfied.
[0897] 907. Based on 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, the modified 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 modified value, and the channel combination ratio coefficient modification flag, determine a channel combination ratio coefficient ratio and an 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 is:
[0899]
number
[0900] where ratio_init quadenotes the initial 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 modification value of the channel combining ratio coefficient corresponding to the correlation signal channel combining scheme for the current frame, and tdm_SM_modi_flag indicates the channel combining ratio coefficient modification flag of 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] where ratio_idx_init indicates an encoded index corresponding to an 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 an encoded index corresponding to a modified 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 an anti-correlated signal channel combination scheme, and if so, calculate and encode a channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame to obtain a channel combination ratio coefficient and an encoded index corresponding to the anti-correlated signal channel combination scheme.
[0905] First, it may be determined whether the history buffer used to calculate the channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame needs to be reset.
[0906] For example, the channel combination scheme flag tdm_SM_flag of the current frame is equal to 1 (e.g., tdm_SM_flag equal to 1 indicates that the channel combination scheme flag of the current frame corresponds to the decorrelated signal channel combination scheme), and the channel combination scheme flag tdm_SM_flag of the previous frame is equal to 0 (e.g., tdm_SM_flag equal to 0 indicates that the channel combination scheme flag of the current frame corresponds to the decorrelated signal channel combination scheme). Previously If the channel combining scheme flag of the frame indicates that it corresponds to a correlated signal channel combining scheme, it indicates that the history buffer used to calculate the channel combining ratio coefficients corresponding to the anti-correlated signal channel combining scheme for the current frame needs to be reset.
[0907] It should be noted that the history buffer reset flag tdm_SM_reset_flag may be determined in the process of initial channel combination scheme determination and channel combination scheme modification determination, and then the value of the history buffer reset flag is determined to determine whether the history buffer used to calculate the channel combination ratio coefficient corresponding to the anti-correlated 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-correlated signal channel combination scheme, and the channel combination scheme flag of the previous frame corresponds to the correlated 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-correlated 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-correlated signal channel combination scheme for the current frame may be reset based on a preset initial value. Alternatively, some parameters in the history buffer used to calculate the channel combination ratio coefficients corresponding to the anti-correlated 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 coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame may be reset based on preset initial values, and other parameters are reset based on corresponding parameters in the history buffer used to calculate the channel combination ratio coefficients corresponding to the correlated signal channel combination scheme for the current frame.
[0908] Then, it is further determined whether the channel combination scheme flag tdm_SM_flag of the current frame corresponds to an anti-correlated signal channel combination scheme. The anti-correlated signal channel combination scheme is a channel combination scheme that is more suitable for performing time-domain downmix on stereo signals that are close to antiphase. In this embodiment, when the channel combination scheme flag tdm_SM_flag of the current frame is 1, it indicates that the channel combination scheme flag of the current frame corresponds to an anti-correlated signal channel combination scheme. When the channel combination scheme flag tdm_SM_flag of the current frame is 0, it indicates that the channel combination scheme flag of the current frame corresponds to a correlated signal channel combination scheme.
[0909] Determining whether the channel combination scheme flag of the current frame corresponds to an anti-correlated signal channel combination scheme specifically includes: It may include determining whether the value of the channel combination scheme flag of the current frame is 1, and if the channel combination scheme flag of the current frame tdm_SM_flag=1, it indicates that the channel combination scheme flag of the current frame corresponds to an anti-correlated signal channel combination scheme, in this case, a channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame may be calculated and encoded.
[0910] Referring to FIG. 9-B, calculating and encoding channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame may include, for example, the following steps 9081 to 9085.
[0911] 9081. Perform signal energy analysis for the delay aligned left and right channel signals 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 obtained separately.
[0913] For example, the frame energy rms_L of the left channel signal in the current frame is
[0914]
number
[0915] Fulfilling The frame energy rms_R of the right channel signal in the current frame is
[0916]
number
[0917] where x' L (n) shows the delay aligned left channel signal for the current frame; x' R (n) shows the delay aligned right channel signal in the current frame.
[0918] For example, the long-term smoothed frame energy of the left channel in the current frame, tdm_lt_rms_L_SM cur teeth, tdm_lt_rms_L_SM cur =(1-A)*tdm_lt_rms_L_SM pre +A*rms_L, where tdm_lt_rms_L_SMpre denotes the long-term smoothed frame energy of the left channel in the previous frame, and A denotes an update coefficient of the long-term smoothed frame energy of the left channel, where 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 of the right channel in the current frame, tdm_lt_rms_R_SM cur teeth, tdm_lt_rms_R_SM cur =(1-B)*tdm_lt_rms_R_SM pre +B*rms_R, where tdm_lt_rms_R_SM pre denotes the long-term smoothed frame energy of the right channel in the previous frame, and B denotes the update coefficient of the long-term smoothed frame energy of the right channel, where B may be a real number between 0 and 1, and B may be the same as or different from the update coefficient of the long-term smoothed frame energy of the left channel, for example, B may be equal to 0.4.
[0920] For example, the interframe 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 Meet the following.
[0921] For example, the interframe 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 Meet the following.
[0922] 9082. Determine a reference channel signal in the current frame based on the delay aligned left and right channel signals in the current frame. The reference channel signal may also be referred to as a mono signal. When the reference channel signal is referred to as a mono signal, for all descriptions and parameter names related to the reference channel, the reference channel signal may be replaced with the mono signal.
[0923] For example, the reference channel signal mono_i(n) is
[0924]
number
[0925] where x' L (n) is the delay-aligned left channel signal in the current frame, and x' R (n) is the delay aligned right channel signal for the current frame.
[0926] 9083. Separately calculate an amplitude correlation parameter between the delay aligned left channel signal and the reference channel signal in the current frame, and an amplitude correlation parameter between the delay aligned right channel signal and the reference channel signal in the current frame.
[0927] For example, the amplitude correlation parameter corr_LM between the delay aligned left channel signal and the reference channel signal in the current frame can be expressed as, for example,
[0928]
number
[0929] Meet the following.
[0930] For example, the amplitude correlation parameter corr_RM between the delay aligned right channel signal and the reference channel signal in the current frame can be expressed as:
[0931]
number
[0932] Meet the following.
[0933] In this specification, x' L (n) denotes the delay-aligned left channel signal in the current frame, and x' R (n) denotes the right channel signal in the current frame that has been subjected to delay alignment processing, mono_i(n) denotes the reference channel signal in the current frame, and |●| denotes taking the absolute value.
[0934] 9084. Calculate an amplitude correlation difference parameter diff_lt_corr between the left channel and the right channel in the current frame based on an amplitude correlation parameter between the delay aligned left channel signal and the reference channel signal in the current frame and an amplitude correlation parameter between the delay aligned right channel signal and the reference channel signal in the current frame.
[0935] It may be understood that step 9081 may be performed before step 9082 and step 9083, or may be performed after step 9082 and step 9083 and before step 9084.
[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] 90841. Based on an amplitude correlation parameter between the delay-aligned left channel signal and the reference channel signal in the current frame and an amplitude correlation parameter between the delay-aligned right channel signal and the reference channel signal in the current frame, a long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame and a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the current frame are calculated.
[0938] For example, a method for calculating a long-term smoothed amplitude correlation parameter between a left channel signal and a reference channel signal in a current frame and a long-term smoothed amplitude correlation parameter between a right channel signal and a reference channel signal in a current frame may include: tdm_lt_corr_LM_SM cur =α*tdm_lt_corr_LM_SM pre +(1-α)corr_LM This may include satisfying the following:
[0939] In this specification, tdm_lt_corr_LM_SM cur denotes the long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, and dm_lt_corr_LM_SM pre denotes a long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the previous frame, and α denotes a left channel smoothing coefficient, where α may be a preset real number between 0 and 1, for example, 0.2, 0.5, or 0.8. Alternatively, the value of α may be obtained 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 Meet the following.
[0941] In this specification, tdm_lt_corr_RM_SM cur denotes 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 pre where β denotes a long-term smoothed amplitude correlation parameter between the right channel signal and the reference channel signal in the previous frame, and β denotes a right channel smoothing coefficient, which may be a preset real number between 0 and 1. β may be the same as or different from the value of the left channel smoothing coefficient α, and β may be equal to 0.2, 0.5, or 0.8, for example. Alternatively, the value of β may be obtained through adaptive calculation.
[0942] Another method for calculating a long-term smoothed amplitude correlation parameter between a left channel signal and a reference channel signal in a current frame and a long-term smoothed amplitude correlation parameter between a right channel signal and a reference channel signal in a current frame includes the steps of: First, modifying an amplitude correlation parameter corr_LM between the delay-aligned left channel signal and the reference channel signal in the current frame to obtain a modified amplitude correlation parameter corr_LM_mod between the left channel signal and the reference channel signal in the current frame; and modifying an amplitude correlation parameter corr_RM between the delay-aligned right channel signal and the reference channel signal in the current frame to obtain a modified amplitude correlation parameter corr_RM_mod between the right channel signal and the reference channel signal in the current frame; Then, a modified amplitude correlation parameter corr_LM_mod between the left channel signal and the reference channel signal in the current frame, a modified amplitude correlation parameter corr_RM_mod between the right channel signal and the reference channel signal in the current frame, a long-term smoothed amplitude correlation parameter tdm_lt_corr_LM_SM pre , and the long-term smoothed amplitude correlation parameter tdm_lt_corr_RM_SM between the right channel signal and the reference channel signal in the previous frame. pre Based on the long-term smoothed amplitude correlation between the left channel signal and the reference channel signal in the current frame, difference The parameters diff_lt_corr_LM_tmp and the current The long-term smoothed amplitude correlation between the right channel signal and the reference channel signal in the frame difference determining a parameter diff_lt_corr_RM_tmp; Then, the long-term smoothed amplitude correlation between the left channel signal and the reference channel signal in the current frame is calculated. difference The parameters diff_lt_corr_LM_tmp and the current The long-term smoothed amplitude correlation between the right channel signal and the reference channel signal in the frame difference obtaining an initial value of an amplitude correlation difference parameter between the left channel and the right channel in the current frame, diff_lt_corr_SM, based on a parameter diff_lt_corr_RM_tmp; and determining an inter-frame variation parameter d_lt_corr of the amplitude correlation difference between the left channel and the right channel in the current frame, based on the obtained initial value of the amplitude correlation difference parameter between the left channel and the right channel in the current frame, diff_lt_corr_SM, and an amplitude correlation difference parameter between the left channel and the right channel in a previous frame, tdm_last_diff_lt_corr_SM; Finally, adaptively select different left channel smoothing coefficients and right channel smoothing coefficients according to 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, which are obtained through the signal energy analysis, as well as an inter-frame variation parameter of the amplitude correlation difference between the left channel and the right channel in the current frame, and calculate a long-term smoothed amplitude correlation parameter tdm_lt_corr_LM_SM between the left channel signal in the current frame and the reference channel signal and a long-term smoothed amplitude correlation parameter tdm_lt_corr_RM_SM between the right channel signal in the current frame and the reference channel signal. It may include:
[0943] In addition to the two methods given as examples above, there may be many methods for calculating the long-term smoothed amplitude correlation parameter between the left channel signal 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, which is not limited in this application.
[0944] 90842. Calculate an amplitude correlation difference parameter diff_lt_corr between the left channel and the right channel in the current frame based on a long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame and a 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 and right channels in the current frame is diff_lt_corr = tdm_lt_corr_LM_SM - tdm_lt_corr_RM_SM, where: tdm_lt_corr_LM_SM indicates a long-term smoothed amplitude correlation parameter between the left channel signal and the reference channel signal in the current frame, and tdm_lt_corr_RM_SM indicates a 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 into a channel combination ratio coefficient, and perform encoding and quantization, so as to determine a channel combination ratio coefficient and an encoded index of the channel combination ratio coefficient corresponding to an anti-correlated signal channel combination scheme for the current frame.
[0947] Referring to FIG. 9-D, a possible method for converting an amplitude correlation difference parameter between the left channel and the right channel in the current frame into a channel combination ratio coefficient may specifically include steps 90851 to 90853.
[0948] 90851. A mapping process is performed 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 that is mapped between the left channel and the right channel to be [MAP_MIN, MAP_MAX].
[0949] A method for performing a mapping process on an amplitude correlation difference parameter between a left channel and a right channel may include the following steps.
[0950] First, amplitude limiting is performed on the amplitude correlation difference parameter between the left channel and the right channel. For example, the amplitude limiting amplitude correlation difference parameter diff_lt_corr_limit between the left channel and the right channel is
[0951]
number
[0952] Meet the following.
[0953] In this specification, RATIO_MAX indicates a maximum value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, and RATIO_MIN indicates a 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] Then, a mapping process is performed on the amplitude-limited amplitude correlation difference parameter between the left and right channels. The mapped amplitude correlation difference parameter diff_lt_corr_map between the left and right channels is given by:
[0955]
number
[0956] where
[0957]
number
[0958] and 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 It is.
[0963] In this specification, MAP_MAX denotes a maximum value of the amplitude correlation difference parameter mapped between the left channel and the right channel, MAP_HIGH denotes a high threshold value of the amplitude correlation difference parameter mapped between the left channel and the right channel, MAP_LOW denotes a low threshold value of the amplitude correlation difference parameter mapped between the left channel and the right channel, and MAP_MIN denotes a minimum value of the amplitude correlation difference parameter mapped between the left channel and the right channel, where MAP_MAX>MAP_HIGH>MAP_LOW>MAP_MIN It 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 practical applications, the values are not limited to such examples.
[0965] RATIO_MAX indicates a maximum value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, RATIO_HIGH indicates a high threshold value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, RATIO_LOW indicates a low threshold value of the amplitude-limited amplitude correlation difference parameter between the left channel and the right channel, and RATIO_MIN indicates a 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 It is.
[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 practical applications, the values are not limited to such examples.
[0967] Another method in some embodiments of the present application is as follows: The mapped amplitude correlation difference parameter diff_lt_corr_map between the left and right channels is:
[0968]
number
[0969] Meet the following.
[0970] As used herein, diff_lt_corr_limit denotes an amplitude-limited amplitude correlation difference parameter between the left and right channels, where:
[0971]
number
[0972] It is.
[0973] In this specification, RATIO_MAX indicates the maximum amplitude of the amplitude correlation difference parameter between the left channel and the right channel, and -RATIO_MAX indicates 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. The mapped amplitude correlation difference parameters between the left and right channels are converted into channel combination ratio coefficients.
[0975] The channel combination ratio coefficient ratio_SM is
[0976]
number
[0977] where cos(·) indicates the cosine operation.
[0978] In addition to the above method, another method can be used to convert the amplitude correlation difference parameters between the left and right channels into channel combination ratio coefficients, for example: Whether the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination schemes need 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 obtained through signal energy analysis, the buffered encoding parameters of the previous frames in the history buffer of the encoder (e.g., the inter-frame correlation parameter of the primary channel signal and the inter-frame correlation parameter of the secondary channel signal), the channel combination scheme flags of the current frame and the previous frame, and the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination schemes for the current frame and the previous frame.
[0979] If the channel combination ratio coefficient corresponding to the anti-correlated 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-correlated 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-correlated signal channel combination scheme for the current frame and the encoded index of the channel combination ratio coefficient.
[0980] 90853. Perform quantization encoding on the channel combination ratio coefficients obtained after transformation to determine the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame.
[0981] Specifically, for example, the quantization encoding may include an initial encoded index ratio_idx_init_SM corresponding to the anti-correlated signal channel combination scheme for the current frame and a quantization encoded initial value ratio_init_SM of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame. qua is performed on the channel combination ratio coefficients obtained after transformation to obtain ratio_init_SM qua =ratio_tabl_SM[ratio_idx_init_SM] It is.
[0982] In this specification, ratio_tabl_SM indicates a codebook for performing scalar quantization on the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination schemes. 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 coefficients corresponding to the anti-correlated signal channel combination schemes may be the same as or different from the codebook for performing scalar quantization on the channel combination ratio coefficients corresponding to the correlated signal channel combination schemes. When the codebooks are the same, only one codebook used to perform scalar quantization on the channel combination ratio coefficients needs to be stored. In this case, the quantization encoded initial value ratio_init_SM of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination schemes for the current frame may be stored. qua teeth, ratio_init_SM qua =ratio_tabl[ratio_idx_init_SM] It is.
[0983] For example, the method is to directly use the quantized encoded initial value of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame as the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame, and directly use the initial encoded index of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame as the encoded index of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame.
[0984] The encoded index of the channel combination ratio coefficient corresponding to the decorrelated signal channel combination scheme for the current frame, ratio_idx_SM, is ratio_idx_SM=ratio_idx_init_SM Meet the following.
[0985] The channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame are ratio_SM=ratio_tabl[ratio_idx_SM] Meet the following.
[0986] Another method may be to modify the quantized encoded initial values of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame and the initial encoded indexes corresponding to the anti-correlated signal channel combination scheme for the current frame based on the encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the previous frame or the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the previous frame, and use the modified encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame as the encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame, and use the modified channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme as the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame.
[0987] The encoded index of the channel combination ratio coefficient corresponding to the decorrelated signal channel combination scheme for the current frame, ratio_idx_SM, is ratio_idx_SM=φ*ratio_idx_init_SM+(1-φ)*tdm_last_ratio_idx_SM Meet the following.
[0988] In this specification, ratio_idx_init_SM indicates an initial encoded index corresponding to the decorrelated signal channel combination scheme for the current frame, tdm_last_ratio_idx_SM is an encoded index of a channel combination ratio coefficient corresponding to the decorrelated signal channel combination scheme for the previous frame,
[0989]
number
[0990] is the modification factor of the channel combining ratio coefficients corresponding to the anti-correlated signal channel combining scheme.
[0991]
number
[0992] The value of may be an empirical value,
[0993]
number
[0994] may be equal to 0.8, for example.
[0995] The channel combining ratio coefficients corresponding to the decorrelated signal channel combining scheme for the current frame are ratio_SM=ratio_tabl[ratio_idx_SM] Meet the following.
[0996] Another method is to use the unquantized channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme as the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame. In other words, the channel combination ratio coefficient ratio_SM corresponding to the anti-correlated signal channel combination scheme for the current frame is
[0997]
number
[0998] Meet the following.
[0999] In addition, a fourth method is to modify unquantized channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame based on the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the previous frame, use the modified channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme as the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame, and perform quantization encoding on the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame to obtain encoded indexes of the channel combination ratio coefficients corresponding to the anti-correlated signal channel combination scheme for the current frame.
[1000] In addition to the above-mentioned methods, there may be many ways to convert the amplitude correlation difference parameters between the left channel and the right channel into channel combination ratio coefficients and perform encoding and quantization. Similarly, there may be many different ways to determine the channel combination ratio coefficients and the encoded indexes of the channel combination ratio coefficients corresponding to the decorrelated signal channel combination schemes for the current frame, which is not limited in this application.
[1001] 909. To determine the coding mode of the current frame, perform coding mode decision 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 may be denoted as tmd_SM_flag, the channel combination scheme flag of the previous frame may be denoted as tmd_last_SM_flag, and the joint flag of the channel combination scheme flag of the previous frame and the channel combination scheme flag of the current frame may be denoted as (tmd_last_SM_flag, tmd_SM_flag). The coding mode decision may be performed based on the joint flags. Details are given in the following examples.
[1003] It is assumed that the correlated signal channel combination scheme is represented by 0, and the anti-correlated 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 correlated signal coding mode, the anti-correlated signal coding mode, the switching mode from correlated to anti-correlated signal coding, and the switching mode from anti-correlated to correlated signal coding. For example, Previous frames and If 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 a correlated signal coding mode. Previous frames and If 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 a decorrelated signal coding mode. Previous frames and If 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 a switching mode from correlation to anti-correlation signal coding; or Previous frames and If 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 a switching mode from anti-correlation to correlation signal coding.
[1004] 910. After obtaining the coding mode stereo_tdm_coder_type of the current frame, the encoding apparatus performs a 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, to obtain 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 correlation to anti-correlation signal coding switching mode, an anti-correlation to correlation signal coding switching mode, a correlation signal coding mode, and an anti-correlation signal coding mode. For the implementation of the time-domain downmix process in different coding modes, please refer to the relevant description of the examples in the above-mentioned embodiment. The details will not be described again in this specification.
[1006] 911. An encoding device separately encodes the primary channel signal and the secondary channel signal to obtain an encoded primary channel signal and an encoded secondary channel signal.
[1007] Specifically, bit allocation may be first performed for encoding the primary channel signal and encoding the secondary channel signal based on the parameter information obtained in encoding the primary channel signal and / or the secondary channel signal in the previous frame and the total amount of bits for encoding the primary and secondary channel signals. Then, the primary channel signal and the secondary channel signal are separately encoded based on the result of the bit allocation to obtain an encoded index of the primary channel encoding and an encoded index of the secondary channel encoding. The primary channel encoding and the secondary channel encoding may be implemented by using any mono audio encoding technique, which will not be further described in this specification.
[1008] 912. The encoding device selects a 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, if the channel combination scheme flag tdm_SM_flag of the current frame corresponds to a correlated signal channel combination scheme, the encoded index ratio_idx of the channel combination ratio coefficient corresponding to the correlated signal channel combination scheme for the current frame is written into the bitstream. Or, if the channel combination scheme flag tdm_SM_flag of the current frame corresponds to an anti-correlated signal channel combination scheme, the encoded index ratio_idx_SM of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame is written into the bitstream. For example, if tdm_SM_flag=0, the encoded index ratio_idx of the channel combination ratio coefficient corresponding to the correlated signal channel combination scheme for the current frame is written into the bitstream. Or, if tdm_SM_flag=1, the encoded index ratio_idx_SM of the channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame is written into the bitstream.
[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 bitstream. It can be understood that there is no order for performing the bitstream write operations.
[1011] Correspondingly, the following describes a time-domain stereo decoding scenario by using an example.
[1012] Referring to Figure 10, the following further provides an audio decoding method. The relevant steps of the audio decoding method may be specifically implemented by a decoding device, and the method may specifically include the following steps:
[1013] 1001. Perform decoding based on a bitstream to obtain decoded primary and secondary channel signals in a current frame.
[1014] 1002. Perform decoding based on the bitstream to obtain time-domain stereo parameters of the current frame.
[1015] The time-domain stereo parameters of the current frame include channel combination ratio coefficients of the current frame (the bitstream includes encoded indices of the channel combination ratio coefficients of the current frame, and the decoding may be performed based on the encoded indices of the channel combination ratio coefficients of the current frame to obtain the channel combination ratio coefficients of the current frame), and may further include inter-channel time differences of the current frame, etc. (e.g., the bitstream includes encoded indices of inter-channel time differences of the current frame, and the decoding may be performed based on the encoded indices of the inter-channel time differences of the current frame to obtain the inter-channel time differences of the current frame; or the bitstream includes encoded indices of absolute values of inter-channel time differences of the current frame, and the decoding may be performed based on the encoded indices of absolute values of inter-channel time differences of the current frame to obtain the absolute values of inter-channel time differences of the current frame).
[1016] 1003. Based on the bitstream, obtain a channel combining scheme flag of a current frame included in the bitstream, and determine a channel combining scheme for the current frame.
[1017] 1004. Determine a decoding mode for the current frame based on the channel combining scheme for the current frame and the channel combining scheme for the previous 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, see the method for determining the coding mode of the current frame in step 909. The decoding mode of the current frame is one of a plurality of decoding modes. For example, the plurality of decoding modes may include a switching mode from correlated to anti-correlated signal decoding, a switching mode from anti-correlated to correlated signal decoding, and a switching mode from correlated signal decoding. Decoding The coding modes may include a coding mode and a decorrelated signal decoding mode, where the coding modes and the decoding modes have a one-to-one correspondence.
[1019] for example, Previous frames 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 a correlation signal decoding mode. Previous frames 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 a decorrelated signal decoding mode. Previous frames 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 a switching mode from correlation to anti-correlated signal decoding; or Previous frames 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 a switching mode from anti-correlation to correlation signal decoding.
[1020] It may be understood that there is no necessary order for performing steps 1001, 1002, and steps 1003 and 1004.
[1021] 1005. Perform 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 determined decoding mode of the current frame, so as to obtain reconstructed left and right channel signals in the current frame.
[1022] For related implementations of the time-domain upmix process in different decoding modes, please refer to the related descriptions of the examples in the above embodiments, and the details will not be described again in this specification.
[1023] The upmix matrix used for the time-domain upmix processing is constructed based on the obtained channel combination ratio coefficients 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, and 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 delay-adjusted reconstructed left and right channel signals in the current frame, and the delay-adjusted 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. Alternatively, and further, time-domain post-processing may be performed on the delay-adjusted reconstructed left and right channel signals in the current frame, and the time-domain post-processed 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.
[1026] The above describes in detail the method in the embodiment of the present application. The following describes the apparatus in the embodiment of the present application.
[1027] 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, the processor 1110 being configured to execute some or all steps of any method provided in the embodiments of the present application. It may include:
[1028] The memory 1120 may be, but is not limited to, a random access memory. ( Random Access Memory 、 RAM), read-only memory ( Read-Only Memory 、 ROM), erasable programmable read-only memory ( Erasable Programmable Read Only Memory 、 EPROM, or Compact Disc Read Only Memory ( Compact Disc Read-Only Memory 、 The memory 1102 may include a hard disk drive (such as a hard disk drive or a CD-ROM) configured to store relevant instructions and relevant data.
[1029] Of course, the device 1100 may further include a transceiver 1130 configured to receive and transmit data.
[1030] The processor 1110 may include one or more central processing units. ( Central Processing Unit 、 When the processor 1110 is a single CPU, the CPU may be a single-core CPU or a multi-core CPU. The processor 1110 may be, specifically, a digital signal processor.
[1031] In the implementation process, the steps in the above-mentioned method can be implemented by using hardware integrated logic circuitry 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, the processor may be any conventional processor, and so on. The steps of the methods disclosed in the embodiments of the present invention may be directly performed or accomplished by using a hardware decoding processor, or may be performed or accomplished by using a combination of hardware modules and software modules in the decoding processor.
[1032] The software module may be located in a storage medium that is mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory 1120. For example, the processor 1110 may read information in the memory 1120 and complete steps in the above-mentioned method in combination with the hardware of the processor 1110.
[1033] Additionally, the device 1100 may further include a transceiver 1130. The transceiver 1130 may be configured to receive and transmit relevant data (e.g., instructions, channel signals, or bit streams), for example. For example, the device 1100 may perform some or all of the steps of the corresponding method in any of the embodiments shown in Figures 2 to 9-D.
[1034] Specifically, for example, when the device 1100 performs the encoding-related steps described above, the device 1100 may be called an encoding device (or an audio encoding device). When the device 1100 performs the decoding-related steps described above, the device 1100 may be called a decoding device (or an audio decoding device).
[1035] Referring to FIG. 11-B, when the device 1100 is an encoding device, for example, the device 1100 may further include a microphone 1140, an analog-to-digital converter 1150, and the like.
[1036] For example, the microphone 1140 may be configured to perform sampling to obtain an analog audio signal.
[1037] For example, the analog-to-digital converter 1150 may be configured to convert an analog audio signal to a digital audio signal.
[1038] Referring to FIG. 11-C, when the device 1100 is an encoding device, for example, the device 1100 may further include a speaker 1160, a digital-to-analog converter 1170, and the like.
[1039] For example, the digital-to-analog converter 1170 may be configured to convert a digital audio signal to 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, an embodiment of the present application provides an apparatus 1200 including several functional units configured to perform any of the methods provided in the embodiments of the present application.
[1042] For example, when the apparatus 1200 executes the corresponding method in the embodiment shown in FIG. 2, the apparatus 1200: a first determining unit 1210 configured to determine a channel combination scheme for a current frame, and to determine a coding mode for the current frame based on the channel combination scheme for the previous frame and the channel combination scheme for the current frame; an encoding unit 1220 configured to perform a time-domain downmix process on the left and right channel signals in the current frame according to a time-domain downmix process corresponding to a coding mode of the current frame to obtain primary and secondary channel signals in the current frame; It may contain.
[1043] 12-B, the apparatus 1200 may further include a second determining unit 1230 configured to determine a time-domain stereo parameter of the current frame. The encoding unit 1220 may be further configured to encode the time-domain stereo parameter of the current frame.
[1044] In another example, referring to FIG. 12-C, when the apparatus 1200 executes the corresponding method in the embodiment shown in FIG. 3, the apparatus 1200: a third determining unit 1240 configured to determine a channel combination scheme for the current frame based on a channel combination scheme flag of the current frame in the bitstream, and to determine a decoding mode for 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 the bitstream to obtain decoded primary and secondary channel signals in the current frame, and to perform a time-domain up-mix process on the decoded primary and secondary channel signals in the current frame based on a time-domain up-mix process corresponding to a decoding mode of the current frame to obtain reconstructed left and right channel signals in the current frame; It may include:
[1045] Cases in which the device performs other methods are inferred by analogy.
[1046] An embodiment of the present application provides a computer-readable storage medium, which stores program code, and the program code may include instructions for performing some or all of the steps of any method provided in the embodiment of the present application.
[1047] An embodiment of the present application provides a computer program product, which, when run on a computer, is capable of causing the computer to execute some or all of the steps of any method provided in the embodiments of the present application.
[1048] In the above embodiments, the description of each embodiment has its own focus. For the parts not described in detail in the embodiments, please refer to the related description in another embodiment.
[1049] In some embodiments provided in the present application, it should be understood that the disclosed device may be implemented in other ways. For example, the described device embodiment is only an example. For example, the unit division may be only a logical function division, or other division in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. In addition, the indirect or direct coupling or communication connection between devices or units shown or described may be implemented by using some interfaces. The indirect coupling or communication connection between devices or units may be implemented in electronic form or other form.
[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, the components may be located in one location or distributed over multiple 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 understanding, the technical solution of the present invention may be essentially implemented in the form of a software product, or the part that contributes to the prior art, or all or part of the technical solution. The computer software product is stored in a storage medium and includes some 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 code, 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. obtaining a current frame of an audio signal including a left channel signal and a right channel signal; obtaining a signal type of the current frame, the signal type of the current frame being a near-anti-phase signal or a not-near-anti-phase signal, the near-anti-phase signal representing that the phase difference between the left channel signal and the right channel signal is in the range of [180-θ, 180+θ], where θ is any angle between 0° and 90°; determining a coding mode of the current frame, the coding mode of the current frame being either an anti-correlated signal coding mode or not an anti-correlated signal coding mode, the anti-correlated signal coding mode corresponding to an anti-correlated signal channel combining scheme, the anti-correlated signal channel combining scheme corresponding to the near anti-phase signals; in response to the coding mode of the current frame being the decorrelated signal coding mode, performing a time-domain downmix process on the left channel signal and the right channel signal to obtain a primary channel signal and a secondary channel signal of the current frame; encoding the obtained primary channel signal and the secondary channel signal into a bitstream; storing or transmitting said bitstream; Including, The step of performing a time-domain downmix process on the left channel signal and the right channel signal to obtain a primary channel signal and a secondary channel signal of the current frame includes:
2. An audio encoding method comprising: performing a time-domain downmix process on the left channel signal and the right channel signal in the current frame based on a first channel combination ratio coefficient corresponding to the anti-correlated signal channel combination scheme for the current frame and a second channel combination ratio coefficient of an anti-correlated signal channel combination scheme for a previous frame to obtain the primary channel signal and the secondary channel signal in the current frame.
2. When the time-domain downmix process is performed based on the first channel combination ratio coefficient, the following formula: [0010] is fulfilled, X L (n) represents the left channel signal in the current frame, and X R (n) denotes the right channel signal in the current frame, Y(n) represents the primary channel signal, and X(n) represents the secondary channel signal; n indicates the number of the sampling point, and M 22 represents a downmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, and M 22 is constructed based on the first channel combining ratio coefficient; 2. The audio encoding method according to claim 1.
3. When the time-domain downmix process is performed based on the first channel combination ratio coefficient and the second channel combination ratio coefficient, [0025] or [0030] is fulfilled, 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 in the current frame, and X(n) represents the secondary channel signal in the current frame; n indicates the number of sampling points, delay_com indicates the encoding delay compensation, and M 22 represents a downmix matrix corresponding to the decorrelated signal channel combination scheme for the current frame, and M 22 is constructed based on the first channel combination ratio coefficient, and M 12 represents a downmix matrix corresponding to the decorrelated signal channel combination scheme for the previous frame, and M 12 is constructed based on the second channel combining ratio coefficient; 2. The audio encoding method according to claim 1.
4. 1. An encoder comprising: At least one processor; one or more memories coupled to said at least one processor, storing program instructions for execution by said at least one processor, causing said encoder to perform a method according to any one of claims 1 to 3; An encoder comprising:
5. A computer readable storage medium having a program recorded thereon, said program causing a computer to carry out the method of any one of claims 1 to 3.
6. A computer program stored on a medium adapted to cause a computer to carry out the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
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