Stereo signal processing method and apparatus

By performing delayed alignment processing on both channels of a stereo signal based on the actual inter-channel time difference, the method addresses the issue of unaligned delays, ensuring better alignment and maintaining encoding quality.

JP7571984B2Active Publication Date: 2024-10-23HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023041599
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2017-05-16
Filing Date
2023-03-16
Publication Date
2024-10-23
Estimated Expiration
2037-12-14

AI Technical Summary

Technical Problem

Existing stereo encoding methods fail to effectively align inter-channel delays when the sign of the inter-channel time difference between two frames changes, leading to increased energy in the side channel signal and reduced encoding quality.

Method used

Perform delayed alignment processing on both channels of a stereo signal based on the actual inter-channel time difference, adjusting the alignment process to ensure that the inter-channel time difference of the current frame is set to zero, thereby maintaining proper alignment and reducing energy in the side channel signal.

Benefits of technology

This approach ensures better alignment of stereo signals, preventing the increase in energy of the side channel signal and maintaining overall encoding quality by addressing the issue of unaligned inter-channel delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007571984000036
    Figure 0007571984000036
  • Figure 0007571984000037
    Figure 0007571984000037
  • Figure 0007571984000038
    Figure 0007571984000038
Patent Text Reader

Abstract

To provide a stereo signal processing method and device.SOLUTION: A method includes the steps of: acquiring a PCM signal including a first channel signal and a second channel signal of a multi-channel signal of a current frame including a stereo signal; acquiring first ITD representing a time difference between the first channel signal and the second channel signal; determining whether the sign of the first ITD is the same as the sign of second ITD representing a time difference between two channel signals of the last frame; executing first delay alignment processing on the first channel signal based upon the first ITD when the sign of the first ITD is different from the sign of the second ITD, and executing second delay alignment processing on the second channel signal based upon the second ITD.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] [CROSS-REFERENCE TO RELATED APPLICATIONS] This application claims priority to Chinese Patent Application No. 201710344704.4, entitled "STEREO SIGNAL PROCESSING METHOD AND APPARATUS," filed with the China Patent Office on May 16, 2017, the entire contents of which are incorporated by reference.

[0002] [Technical field] This application relates to the field of information technology, and in particular to a stereo signal processing method and apparatus. [Background technology]

[0003] As the quality of life improves, people have an increasing demand for high quality audio. Compared with mono audio, stereo audio provides a sense of direction and distribution for each sound source, and provides improved clarity, comprehensibility, and locality of information. Therefore, stereo audio is very popular. In the existing time domain stereo coding technology, the left channel signal and the right channel signal are usually downmixed into a mid channel signal and a side channel signal in the time domain. The downmixed mid channel signal may be denoted as 0.5×(L+R), which represents the relative information between the left channel signal and the right channel signal. The downmixed side channel signal may be denoted as 0.5×(LR), which represents the differential information between the left channel signal and the right channel signal. L denotes the left channel signal, and R denotes the right channel signal. Then, the mid channel signal and the side channel signal are separately coded by using a mono channel coding method. The mid-channel signal is typically encoded using a relatively large number of bits, and the side-channel signal is typically encoded using a relatively small number of bits.

[0004] In order to improve the coding efficiency, the mid channel signal needs to be larger and the side channel signal needs to be smaller. Currently, in time domain stereo coding, before the mid channel signal and the side channel signal are obtained, a matching algorithm is used to perform delay estimation on the left channel signal and the right channel signal to obtain the inter-channel time difference, and a delay alignment process is performed on the left channel signal and the right channel signal based on the inter-channel time difference, so that the downmixed mid channel signal is larger and the downmixed side channel signal is smaller. In the algorithm for performing delay alignment based on the inter-channel time difference, usually, one channel is selected from the left channel and the right channel, and a delay alignment process is performed on the signal of the channel. This channel is called a target channel. The delay adjustment is not performed on the signal of the other channel, and the other channel is used as a reference for delay adjustment to the target channel. This channel is called a reference channel.

[0005] In the existing method, if the sign of the inter-channel time difference of the current frame obtained through delay estimation is found to be different from the sign of the inter-channel time difference of the previous frame, the selection of the target channel of the current frame is kept the same as the selection of the target channel of the previous frame. Furthermore, regardless of the estimated value of the inter-channel time difference of the current frame, the inter-channel time difference of the current frame is forced to be set to zero. Then, a delay alignment process is performed on the target channel of the current frame based on the inter-channel time difference set to zero to ensure that the delay between the target channel of the current frame and the reference channel after the delay alignment process is zero.

[0006] In the above method, when the sign of the inter-channel time difference of two frames of a stereo signal changes, this indicates that the arrival order of the left and right channel signals changes, and the right channel signal may arrive first instead of the left channel signal that originally arrived first, or the left channel signal may arrive first instead of the right channel signal that originally arrived first. If the inter-channel time difference of the current frame is forced to be set to zero, the left and right channels are adjusted based on the zero time difference, not the actual time difference between the left and right channels, and the time-domain downmix process is performed on the left and right channel signals thus obtained and obtained after delay adjustment. However, in practice, the actual delay alignment is not realized for the two channel signals. Therefore, there is no effective method for offsetting the correlation components between the two channels, which results in an increase in the energy of the side channel signal of the current frame after the time-domain downmix, and the overall stereo coding quality is reduced. Summary of the Invention

[0007] This application provides a stereo signal processing method and apparatus for solving the problem of poor encoding quality in stereo encoding caused by inter-channel delay not being aligned when the sign of the inter-channel time difference between two frames of a stereo signal is changed.

[0008] An embodiment of the present application provides a stereo signal processing method applied to an encoder side of a stereo codec, the method comprising: performing delay estimation on the stereo signal of the current frame to determine an inter-channel time difference of the current frame, the inter-channel time difference of the current frame being a time difference between a first channel signal of the current frame and a second channel signal of the current frame; performing a delay alignment process on a first channel signal of the current frame based on the inter-channel time difference of the current frame when the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, and performing a delay alignment process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame, where the first channel signal is a target channel signal of the current frame and the second channel signal is on the same channel as the target channel signal of the previous frame; Includes.

[0009] According to the method provided in this application, when it is determined that the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, a delay alignment process is performed on the first channel signal of the current frame based on the inter-channel time difference of the current frame, and a delay alignment process is performed on the second channel signal of the current frame based on the inter-channel time difference of the previous frame. Therefore, the delay alignment process of the current frame can be performed based on the actual inter-channel time difference, thereby ensuring a better alignment effect, and avoiding the problem in the prior art that the inter-channel time difference of the current frame is forcibly set to zero, so that the correlation components between the two channels of the current frame after the delay alignment process cannot be offset, resulting in an increase in the energy of the secondary channel signal of the current frame after the time-domain downmix, which affects the overall encoding quality.

[0010] Optionally, performing a delay alignment process on the first channel signal of the current frame based on an inter-channel time difference of the current frame includes: Compress a signal of a first processing length in the first channel signal of the current frame into a signal of a first alignment processing length to obtain a first channel signal of the current frame after the delay alignment processing; The first processing length is determined based on an inter-channel time difference of the current frame and a first alignment processing length, the first processing length being greater than the first alignment processing length.

[0011] Optionally, the first processing length is the sum of the absolute value of the inter-channel time difference of the current frame and the first alignment processing length.

[0012] Optionally, the start point of the first processing length signal is located before the start point of the first alignment processing length signal, and the length between the start point of the first processing length signal and the start point of the first alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0013] Optionally, the starting point of the first alignment processing length signal is located at or after the starting point of the first channel signal of the current frame, and the length between the starting point of the first alignment processing length signal and the ending point of the first channel signal of the current frame is equal to or greater than the first alignment processing length.

[0014] Optionally, the start point of the signal of the first alignment processing length is located before the start point of the first channel signal of the current frame, and the length between the start point of the signal of the first alignment processing length and the start point of the first channel signal of the current frame is a transition section The length between the start of the first alignment processing length signal and the end of the first channel signal of the current frame is less than or equal to the first alignment processing length. section The sum of the length and the transition section Length is the absolute inter-channel time difference of the current frame. Value Below.

[0015] Optionally, performing a delay alignment process on the second channel signal of the current frame based on an inter-channel time difference of a previous frame includes: Extending a signal of a second processing length in the second channel signal of the current frame to a signal of a second alignment processing length to obtain a second channel signal of the current frame after the delay alignment processing; The second processing length is determined based on the inter-channel time difference of the previous frame and the second alignment processing length, the second processing length being less than the second alignment processing length.

[0016] Optionally, the second processing length is the difference between the second alignment processing length and the absolute value of the inter-channel time difference of the previous frame.

[0017] Optionally, the start point of the second processing length signal is located after the start point of the second alignment processing length signal, and the length between the start point of the second processing length signal and the start point of the second alignment processing length signal is the absolute value of the inter-channel time difference of the previous frame.

[0018] Optionally, the starting point of the signal of the second alignment processing length is located at or after the starting point of the second channel signal of the current frame, and the length between the starting point of the signal of the second alignment processing length and the ending point of the second channel signal of the current frame is equal to or greater than the second alignment processing length.

[0019] Optionally, the length between the start point of the signal of the second alignment processing length and the start point of the second channel signal of the current frame is equal to a second preset length, and the length between the start point of the signal of the first alignment processing length and the start point of the first channel signal of the current frame is equal to the sum of the second preset length and the second alignment processing length.

[0020] Optionally, the first alignment processing length is less than or equal to a frame length of the current frame, the first alignment processing length is a preset length, or the first alignment processing length satisfies the following formula:

number

[0021] Optionally, the second alignment processing length is less than or equal to a frame length of the current frame; the second alignment processing length is a preset length; or the second alignment processing length satisfies the following formula:

number

[0022] Optionally, a processing length of the delay alignment process is less than or equal to a frame length of the current frame, the processing length of the delay alignment process is a preset length, or the processing length of the delay alignment process satisfies the following formula:

number

[0023] An embodiment of the present application provides a stereo signal processing apparatus capable of performing and realizing any of the stereo signal processing methods provided in the above methods.

[0024] In a possible design, the stereo signal processing device includes a plurality of functional modules, for example, includes a processing unit and a transceiver unit configured to realize any of the stereo signal processing methods provided above. Thus, when it is determined that the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, a delay alignment process is performed on the first channel signal of the current frame based on the inter-channel time difference of the current frame, and a delay alignment process is performed on the second channel signal of the current frame based on the inter-channel time difference of the previous frame. Thus, the delay alignment process of the current frame can be performed based on the actual inter-channel time difference, thereby ensuring a better alignment effect, and avoiding the problem in the prior art that the inter-channel time difference of the current frame is forced to be set to zero, so that the correlation components between the two channels of the current frame after the delay alignment process cannot be offset, resulting in an increase in the energy of the secondary channel signal of the current frame after the time-domain downmix, which affects the overall encoding quality.

[0025] An embodiment of the present application provides a stereo signal processing apparatus, the apparatus including a processor and a memory, the memory storing executable instructions, the executable instructions causing the processor to perform the following steps: performing delay estimation on the stereo signal of the current frame to determine an inter-channel time difference of the current frame, the inter-channel time difference of the current frame being a time difference between a first channel signal of the current frame and a second channel signal of the current frame; performing a delay alignment process on a first channel signal of the current frame based on the inter-channel time difference of the current frame when the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, and performing a delay alignment process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame, where the first channel signal is a target channel signal of the current frame and the second channel signal is on the same channel as the target channel signal of the previous frame; is used to command the

[0026] Optionally, the executable instructions, when performing a delay alignment process on the first channel signal of the current frame based on an inter-channel time difference of the current frame, cause the processor to perform the following steps: compressing a signal of a first processing length in the first channel signal of the current frame into a signal of a first alignment processing length to obtain a first channel signal of the current frame after the delay alignment processing; The first processing length is determined based on the inter-channel time difference of the current frame and the first alignment processing length, and the first processing length is greater than the first alignment processing length; is used to command the

[0027] Optionally, the first processing length is the sum of the absolute value of the inter-channel time difference of the current frame and the first alignment processing length.

[0028] Optionally, the start point of the first processing length signal is located before the start point of the first alignment processing length signal, and the length between the start point of the first processing length signal and the start point of the first alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0029] Optionally, the starting point of the first alignment processing length signal is located at or after the starting point of the first channel signal of the current frame, and the length between the starting point of the first alignment processing length signal and the ending point of the first channel signal of the current frame is equal to or greater than the first alignment processing length.

[0030] Optionally, the start point of the signal of the first alignment processing length is located before the start point of the first channel signal of the current frame, and the length between the start point of the signal of the first alignment processing length and the start point of the first channel signal of the current frame is a transition section The length between the start of the first alignment processing length signal and the end of the first channel signal of the current frame is less than or equal to the first alignment processing length. section The sum of the length and the transition section Length is the absolute inter-channel time difference of the current frame. Value Below.

[0031] Optionally, the executable instructions cause the processor, when performing a delay alignment process on the second channel signal of the current frame based on an inter-channel time difference of the previous frame, to perform the following steps: Extending a signal of a second processing length in the second channel signal of the current frame to a signal of a second alignment processing length to obtain a second channel signal of the current frame after the delay alignment processing; A second processing length is determined based on the inter-channel time difference of the previous frame and the second alignment processing length, and the second processing length is less than the second alignment processing length. is used to command the

[0032] Optionally, the second processing length is the difference between the second alignment processing length and the absolute value of the inter-channel time difference of the previous frame.

[0033] Optionally, the start point of the second processing length signal is located after the start point of the second alignment processing length signal, and the length between the start point of the second processing length signal and the start point of the second alignment processing length signal is the absolute value of the inter-channel time difference of the previous frame.

[0034] Optionally, the starting point of the signal of the second alignment processing length is located at or after the starting point of the second channel signal of the current frame, and the length between the starting point of the signal of the second alignment processing length and the ending point of the second channel signal of the current frame is equal to or greater than the second alignment processing length.

[0035] Optionally, the length between the start point of the signal of the second alignment processing length and the start point of the second channel signal of the current frame is equal to a second preset length, and the length between the start point of the signal of the first alignment processing length and the start point of the first channel signal of the current frame is equal to the sum of the second preset length and the second alignment processing length.

[0036] Optionally, the first alignment processing length is less than or equal to a frame length of the current frame, the first alignment processing length is a preset length, or the first alignment processing length satisfies the following formula:

number

[0037] Optionally, the second alignment processing length is less than or equal to a frame length of the current frame; the second alignment processing length is a preset length; or the second alignment processing length satisfies the following formula:

number

[0038] Optionally, a processing length of the delay alignment process is less than or equal to a frame length of the current frame, the processing length of the delay alignment process is a preset length, or the processing length of the delay alignment process satisfies the following formula:

number

[0039] An embodiment of this application provides a stereo signal processing method applied on a decoder side of a stereo codec, the method comprising: determining an inter-channel time difference of a current frame based on the received codestream, where the inter-channel time difference of the current frame is a time difference between a first channel signal of the current frame and a second channel signal of the current frame; performing a delay recovery process on a first channel signal of the current frame based on the inter-channel time difference of the current frame when the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, and performing a delay recovery process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame, where the first channel signal is a target channel signal of the current frame and the second channel signal is on the same channel as the target channel signal of the previous frame; Includes.

[0040] According to the method provided in this application, when it is determined that the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, a delay recovery process is performed on the first channel signal of the current frame based on the inter-channel time difference of the current frame, and a delay recovery process is performed on the second channel signal of the current frame based on the inter-channel time difference of the previous frame. Therefore, the delay recovery process of the current frame can be performed based on the actual inter-channel time difference, thereby ensuring a better alignment effect, and avoiding the problem in the prior art that the inter-channel time difference of the current frame is forcibly set to zero, so that the correlation components between the two channels of the current frame after the delay recovery process cannot be offset, resulting in an increase in the energy of the secondary channel signal of the current frame after the time-domain downmix, which affects the decoded signal quality.

[0041] Optionally, performing a delay recovery process on the first channel signal of the current frame based on an inter-channel time difference of the current frame includes: Extending a signal of a third processing length in the first channel signal of the current frame to a signal of a third alignment processing length to obtain a first channel signal of the current frame after a delay recovery processing; The third processing length is determined based on the inter-channel time difference of the current frame and the third alignment processing length, the third processing length being less than the third alignment processing length.

[0042] Optionally, the third processing length is a difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame.

[0043] Optionally, the starting point of the third processing length signal is located after the starting point of the third alignment processing length signal, and the length between the starting point of the third processing length signal and the starting point of the third alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0044] Optionally, the starting point of the signal of the third processing length is located at or after the starting point of the first channel signal of the current frame, and the length between the starting point of the signal of the third processing length and the ending point of the first channel signal of the current frame is greater than or equal to the difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame.

[0045] Optionally, performing a delay recovery process on the second channel signal of the current frame based on an inter-channel time difference of a previous frame includes: Compress a signal of a fourth processing length in the second channel signal of the current frame into a signal of a fourth alignment processing length to obtain a second channel signal of the current frame after a delay recovery processing; The fourth processing length is determined based on the inter-channel time difference of the previous frame and the fourth alignment processing length, the fourth processing length being greater than the fourth alignment processing length.

[0046] Optionally, the fourth processing length is the sum of the absolute value of the inter-channel time difference of the previous frame and the fourth alignment processing length.

[0047] Optionally, the starting point of the fourth processing length signal is located before the starting point of the fourth alignment processing length signal, and the length between the starting point of the fourth processing length signal and the starting point of the fourth alignment processing length signal is the absolute value of the inter-channel time difference of the previous frame.

[0048] Optionally, the starting point of the signal of the fourth alignment processing length is located at or after the starting point of the second channel signal of the current frame, and the length between the starting point of the signal of the fourth alignment processing length and the ending point of the second channel signal of the current frame is equal to or greater than the fourth alignment processing length.

[0049] Optionally, the length between the start point of the signal of the fourth alignment processing length and the start point of the second channel signal of the current frame is equal to a fourth preset length, and the length between the start point of the signal of the third alignment processing length and the start point of the first channel signal of the current frame is equal to the sum of the fourth preset length and the fourth alignment processing length.

[0050] Optionally, the third alignment processing length is a preset length, or the third alignment processing length satisfies the following formula:

number

[0051] Optionally, the fourth alignment processing length is a preset length, or the fourth alignment processing length satisfies the following formula:

number

[0052] Optionally, the processing length of the delay alignment process is a preset length, or the processing length of the delay alignment process satisfies the following formula:

number

[0053] An embodiment of the present application provides a stereo signal processing apparatus capable of performing and realizing any of the stereo signal processing methods provided in the above methods.

[0054] In a possible design, the stereo signal processing device includes a plurality of functional modules, for example, includes a processing unit and a transceiver unit configured to realize any of the stereo signal processing methods provided above. Thus, when it is determined that the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, a delay recovery process is performed on the first channel signal of the current frame based on the inter-channel time difference of the current frame, and a delay recovery process is performed on the second channel signal of the current frame based on the inter-channel time difference of the previous frame. Thus, the delay recovery process of the current frame can be performed based on the actual inter-channel time difference, thereby ensuring a better alignment effect, and avoiding the problem in the prior art that the inter-channel time difference of the current frame is forced to be set to zero, so that the correlation components between the two channels of the current frame after the delay recovery process cannot be offset, resulting in an increase in the energy of the secondary channel signal of the current frame after the time-domain downmix, which affects the decoded signal quality.

[0055] An embodiment of the present application provides a stereo signal processing apparatus, the apparatus including a processor and a memory, the memory storing executable instructions, the executable instructions causing the processor to perform the following steps: determining an inter-channel time difference of a current frame based on the received codestream, where the inter-channel time difference of the current frame is a time difference between a first channel signal of the current frame and a second channel signal of the current frame; performing a delay recovery process on a first channel signal of the current frame based on the inter-channel time difference of the current frame when the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, and performing a delay recovery process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame, where the first channel signal is a target channel signal of the current frame and the second channel signal is on the same channel as the target channel signal of the previous frame; is used to command the

[0056] Optionally, the executable instructions, when performing delay recovery processing on the first channel signal of the current frame based on an inter-channel time difference of the current frame, cause the processor to perform the following steps: Extending a signal of a third processing length in the first channel signal of the current frame to a signal of a third alignment processing length to obtain a first channel signal of the current frame after the delay recovery processing; A third processing length is determined based on the inter-channel time difference of the current frame and a third alignment processing length, and the third processing length is less than the third alignment processing length. is used to command the

[0057] Optionally, the third processing length is a difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame.

[0058] Optionally, the starting point of the third processing length signal is located after the starting point of the third alignment processing length signal, and the length between the starting point of the third processing length signal and the starting point of the third alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0059] Optionally, the starting point of the signal of the third processing length is located at or after the starting point of the first channel signal of the current frame, and the length between the starting point of the signal of the third processing length and the ending point of the first channel signal of the current frame is greater than or equal to the difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame.

[0060] Optionally, the executable instructions, when performing delay recovery processing on the second channel signal of the current frame based on the inter-channel time difference of the previous frame, cause the processor to perform the following steps: compressing a signal of a fourth processing length in the second channel signal of the current frame into a signal of a fourth alignment processing length to obtain a second channel signal of the current frame after a delay recovery processing; The fourth processing length is determined based on the inter-channel time difference of the previous frame and the fourth alignment processing length, and the fourth processing length is greater than the fourth alignment processing length; step is used to command the

[0061] Optionally, the fourth processing length is the sum of the absolute value of the inter-channel time difference of the previous frame and the fourth alignment processing length.

[0062] An embodiment of the present application further provides a computer storage medium, which stores a software program, which, when read and executed by one or more processors, can realize the stereo signal processing method provided in any one of the above designs.

[0063] An embodiment of this application further provides a system, which includes the stereo signal processing device provided in any one of the above designs. Optionally, the system may further include other devices that interact with the stereo signal processing device in the solution provided in the embodiment of this application.

[0064] An embodiment of the present application further provides a computer program product comprising instructions, which when run on a computer, cause the computer to perform the method in the above aspect. [Brief description of the drawings]

[0065] [Figure 1] 1 is a schematic flowchart of a stereo signal processing method according to an embodiment of the present application. [Diagram 2] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Diagram 3] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 4] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Diagram 5] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 6] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 7(a)] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 7(b)] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 8] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 9] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 10] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 11] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 12] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 13] FIG. 2 is a schematic diagram of a stereo signal processing method according to an embodiment of the present application; [Figure 14]FIG. 1 is a schematic structural diagram of a stereo signal processing device according to an embodiment of this application; [Figure 15] FIG. 1 is a schematic structural diagram of a stereo signal processing device according to an embodiment of this application; [Figure 16] FIG. 1 is a schematic structural diagram of a stereo signal processing device according to an embodiment of this application; [Figure 17] FIG. 1 is a schematic structural diagram of a stereo signal processing device according to an embodiment of this application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0066] Hereinafter, this application will be further described in detail with reference to the accompanying drawings.

[0067] The embodiments of this application are applicable to the encoding and decoding of audio signals, especially stereo signals. At present, stereo signal encoding mainly includes the following processes: time-domain pre-processing, delay estimation and encoding, delay alignment, time-domain analysis, downmix parameter extraction and encoding, time-domain downmix processing, downmix signal encoding, etc. The decoding process of an audio signal may be the opposite of the encoding process of an audio signal, and the details will not be described here.

[0068] The encoding process is merely an example, and the actual encoding process may change. This is not limited in the embodiment of this application. In the embodiment of this application, delay alignment is mainly processed. In the following, delay alignment is described in detail. In addition, for other steps of the encoding process, refer to the description in the prior art. Details are not described one by one here.

[0069] In the embodiment of this application, each frame of the stereo signal includes a left channel signal and a right channel signal, and the frame length is N, where N is a positive integer greater than 0.

[0070] FIG. 1 is a schematic flowchart of a stereo signal processing method according to an embodiment of this application.

[0071] Referring to FIG. 1, the method includes the following steps.

[0072] Step 101: Perform delay estimation on the stereo signal of the current frame to determine an inter-channel time difference of the current frame, where the inter-channel time difference of the current frame is the time difference between the first channel signal of the current frame and the second channel signal of the current frame.

[0073] Step 102: If the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, perform a delay alignment process on a first channel signal of the current frame based on the inter-channel time difference of the current frame, and perform a delay alignment process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame, where the first channel signal is a target channel signal of the current frame, and the second channel signal is on the same channel as the target channel signal of the previous frame.

[0074] The frame before the current frame and the current frame are two adjacent frames, successive in time sequence.

[0075] In step 101, the process of performing delay estimation for the current frame may be as follows.

[0076] Step 1: Perform time-domain pre-processing on the left and right channel signals of the current frame.

[0077] If the sampling rate of the stereo signal is 16KHz, the duration of one frame of the stereo signal is 20ms, and the frame length is denoted as N, where N=320, that is, the frame length is 320 sampling points. The stereo signal of the current frame includes the left channel signal of the current frame and the right channel signal of the current frame, and the left channel signal of the current frame is xL (n), and the right channel signal of the current frame is denoted as x R It is noted as (n), where n is the sampling point sequence number, n=0, 1, ..., N-1.

[0078] Performing time-domain pre-processing on the left channel signal and the right channel signal of the current frame includes performing high-pass filtering on the left channel signal and the right channel signal of the current frame to obtain a pre-processed left channel signal and a pre-processed right channel signal of the current frame, and the pre-processed left channel signal of the current frame is x L_HP (n), and the processed right channel signal of the current frame is denoted as x R_HP (n), where n is the sampling point sequence number, specifically including n=0, 1, ..., N-1. The high-pass filtering process may be an Infinite Impulse Response (IIR) filter with a cut-off frequency of 20 Hz, or may be performed by other types of filters. For example, the transfer function of a high-pass filter with a sampling rate of 16 KHz and a corresponding cut-off frequency of 20 Hz is as follows:

number

number

[0079] It should be noted that the time domain pre-processing for the left channel signal and the right channel signal of the current frame is not mandatory. If there is no time domain pre-processing step, the left channel signal and the right channel signal used for delay estimation and delay alignment processing are the left channel signal and the right channel signal in the original stereo signal. Here, the left channel signal and the right channel signal in the original stereo signal are collected Pulse Code Modulation (PCM) signals obtained after Analog to Digital (A / D) conversion. Furthermore, in this embodiment of the application, the sampling rate of the signal may further be 8KHz, 16KHz, 32KHz, 44.1KHz, 48KHz, etc. This is not limited in this embodiment of the application.

[0080] The preprocessed left channel signal of the current frame is

number

number

[0081] Furthermore, in addition to the high-pass filtering process described in this embodiment of the present application, the pre-processing may be other processing methods such as pre-emphasis processing, which is not limited in this embodiment of the present application.

[0082] Step 2: Perform delay estimation based on the preprocessed left channel signal and the preprocessed right channel signal of the current frame to obtain the inter-channel time difference of the current frame.

[0083] For example, a cross-correlation coefficient between the left channel and the right channel may be calculated based on the pre-processed left channel signal and the pre-processed right channel signal of the current frame, and then a maximum value of the cross-correlation coefficient is determined, and an inter-channel time difference of the current frame is determined based on the maximum value of the cross-correlation coefficient.

[0084] Specifically, T max corresponds to the maximum interchannel time difference at the current sampling rate, and T min corresponds to the minimum inter-channel time difference at the current sampling rate. T max and T min is a preset real number, and T max is T min In this embodiment of the application, when the sampling rate is 16KHz, T max = 40, and T min =-40. When the sampling rate is 32KHz, T max = 80, and T min =-80. For other sampling rates, T max and T min The value of is not further specified.

[0085] The cross-correlation coefficient between the left and right channels may be calculated in the following manner:

[0086] T min is less than or equal to 0, and T max If is greater than 0, T min Within the range of ≦i≦0, the cross-correlation coefficient between the left and right channels satisfies the following equation:

number

[0087] 0 <i≦T max Within the range, the cross-correlation coefficient between the left and right channels satisfies the following formula:

number

number

number

[0088] T min is less than or equal to 0, and T max If is less than or equal to 0, T min ≦i≦T max Within the range, the cross-correlation coefficient between the left and right channels satisfies the following formula:

number

number

number

[0089] Set T min is greater than 0 and the set T max If is greater than 0, T min <i≦T max Within the range, the cross-correlation coefficient between the left and right channels satisfies the following formula:

number

number

number

[0090] Finally, the index value corresponding to the obtained maximum value of the cross-correlation coefficient is used as the inter-channel time difference for the current frame.

[0091] With reference to the above description, in this embodiment of the application, T max is equal to 40, T min When is equal to -40, the maximum value of the cross-correlation coefficient c(i) between the left and right channels is T min ≦i≦T max and the index value corresponding to the obtained maximum value of the cross-correlation coefficient is used as the inter-channel time difference of the current frame, which is denoted as cur_itd.

[0092] After the inter-channel time difference of the current frame is estimated, quantization and encoding are performed on the estimated inter-channel time difference of the current frame, the quantized code index is written into the code stream, and the code stream is sent to the decoder side. Optionally, the quantized and encoded value is used as the inter-channel time difference of the current frame.

[0093] In addition to the above delay estimation methods, the inter-channel time difference of the current frame may alternatively be determined according to other delay estimation methods. For example, the cross-correlation coefficient between the left channel and the right channel is calculated based on the pre-processed left channel signal and the pre-processed right channel signal of the current frame or the left channel signal and the right channel signal of the current frame. Then, a long-term smoothing process is performed based on the cross-correlation coefficient between the left channel and the right channel of the first M1 audio frames (M1 is an integer equal to or greater than 1) and the calculated cross-correlation coefficient between the left channel and the right channel of the current frame to obtain a smoothed cross-correlation coefficient between the left channel and the right channel. Then, the maximum value of the smoothed cross-correlation coefficient between the left channel and the right channel is calculated as T min ≦i≦T max and the index value corresponding to the maximum value is obtained and used as the inter-channel time difference of the current frame. In another example, the inter-frame smoothing process may alternatively be performed based on the inter-channel time differences of the first M2 audio frames (M2 is an integer equal to or greater than 1) and the estimated inter-channel time difference of the current frame, and the smoothed inter-channel time difference is used as the inter-channel time difference of the current frame.

[0094] In this embodiment of the application, the estimated inter-channel time difference of the current frame is used as the final determined inter-channel time difference of the current frame, but it should be noted that the method for estimating the inter-channel time difference of the current frame includes, but is not limited to, the above-mentioned methods.

[0095] In step 102, the sign may indicate a positive sign (+) or a negative sign (-). In this embodiment of the application, the previous frame is located before the current frame and adjacent to the current frame.

[0096] When it is determined that the sign of the inter-channel time difference of the current frame is different from that of the previous frame, the delay alignment process may be performed separately on the first channel signal and the second channel signal of the current frame. For ease of explanation, in the following, the channel corresponding to the first channel signal of the current frame is called the first channel, and the channel corresponding to the second channel signal of the current frame is called the second channel. It should be noted that the first channel is the target channel of the current frame, and may also be called the target channel of the next frame, or may also be called the designated target channel of the current frame, or may also be called other channels other than the target channel of the previous frame of the current frame. Correspondingly, the second channel is the reference channel of the current frame, and the second channel is a channel that is within the two channels of the stereo signal and is the same as the target channel of the previous frame, and may also be called the target channel of the previous frame, or may also be called the designated reference channel of the current frame, or may also be called other channels other than the target channel of the current frame. For example, if the target channel of the previous frame is the left channel, the first channel signal is the right channel signal in the current frame and the second channel signal is the left channel signal in the current frame. If the target channel of the previous frame is the right channel, the first channel signal is the left channel signal in the current frame and the second channel signal is the right channel signal in the current frame.

[0097] In this embodiment of this application, the target channel and the reference channel are technical terms. Specifically, in the existing algorithm for performing delay alignment based on inter-channel time difference, one channel needs to be selected from the left channel and the right channel, and the delay alignment process is performed on the signal of the selected channel. This channel is called the target channel. The other channel is used as a reference for performing delay alignment process on the target channel, and is called the reference channel. In the method proposed in this embodiment of this application, when it is determined that the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the previous frame, the delay alignment process needs to be performed on both channels. Therefore, when it is determined that the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the previous frame, the first channel is the target channel of the current frame in a broad sense, and the delay alignment process needs to be performed on the target channel of the current frame, and the second channel is the reference channel of the current frame in a broad sense, and the delay alignment process also needs to be performed on the reference channel of the current frame.

[0098] Optionally, in this embodiment of the application, the target channel and the reference channel of the previous frame may be determined in the following manner to determine the first channel and the second channel: If the inter-channel time difference of the previous frame is less than 0, the target channel of the previous frame may be considered to be the left channel. Since the second channel is the same channel as the target channel of the previous frame in the two channels of the stereo signal, the second channel is the left channel and the first channel is the right channel. If the inter-channel time difference of the previous frame is equal to or greater than 0, the target channel of the previous frame may be considered to be the right channel. Since the second channel is the same channel as the target channel of the previous frame in the two channels of the stereo signal, the second channel is the right channel and the first channel is the left channel.

[0099] Optionally, in this embodiment of the application, the target channel and the reference channel of the current frame may alternatively be determined in the following manner to determine the first channel and the second channel: When it is determined that the inter-channel time difference of the current frame is equal to or greater than 0, the target channel of the current frame may be considered to be the right channel, i.e., the first channel is the right channel, and the second channel is the left channel; When it is determined that the inter-channel time difference of the current frame is less than 0, the target channel of the current frame may be considered to be the left channel, i.e., the first channel is the left channel, and the second channel is the right channel.

[0100] Optionally, in this embodiment of the application, the target channel and reference channel of the previous frame may be directly determined based on the obtained target channel index or reference channel index of the previous frame to determine the first channel and the second channel.

[0101] In this embodiment of the application, there are several ways to perform delay alignment processing on the first channel signal and the second channel signal, which are described separately below.

[0102] 1. Perform a delay alignment process on the first channel signal of the current frame based on the inter-channel time difference of the current frame.

[0103] Specifically, a signal of a first processing length in the first channel signal of a current frame is compressed to a signal of a first alignment processing length to obtain a first channel signal of a current frame after a delay alignment processing, the first processing length is determined based on an inter-channel time difference of the current frame and a first alignment processing length, and the first processing length is greater than the first alignment processing length.

[0104] In this embodiment of the application, the first processing length may be the sum of the absolute value of the inter-channel time difference of the current frame and the first alignment processing length.

[0105] In this embodiment of the application, the first alignment processing length may be represented by L_next_target. The first alignment processing length is equal to or less than the frame length of the current frame, and the first alignment processing length may be a preset length, or may be determined in other manners. When the first alignment processing length is a preset length, the first alignment processing length may be equal to or less than L, L / 2, L / 3, or L, where L is the processing length of the delay alignment processing. The processing length of the delay alignment processing is equal to or less than the frame length of the current frame, that is, L is equal to or less than the corresponding frame length N in the current sampling rate and is equal to or greater than the maximum absolute value of the inter-channel time difference. For example, L=290 or L=200. In this embodiment of the application, L may be set to different values ​​for different sampling rates, or may be a uniform value. In general, the value may be preset based on the experience of those skilled in the art. For example, when the sampling rate is 16KHz, L is set to 290. In this case, in this embodiment of this application, L_next_target=L / 2=145.

[0106] Further, in this embodiment of the application, the starting point of the first processing length signal is located before the starting point of the first alignment processing length signal, and the length between the starting point of the first processing length signal and the starting point of the first alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0107] In this embodiment of the application, the inter-channel time difference of the current frame is cur_itd, and abs(cur_itd) represents the absolute value of the inter-channel time difference of the current frame. For ease of explanation, abs(cur_itd) is referred to as the first delay length in the following description. The inter-channel time difference of the previous frame is prev_itd, and abs(prev_itd) represents the absolute value of the inter-channel time difference of the previous frame. For ease of explanation, abs(prev_itd) is referred to as the second delay length in the following description.

[0108] The specific location of the signal in the first processing length may be determined based on different practical conditions, which will be described separately below.

[0109] First possible case:

[0110] Fig. 2 is a schematic diagram of a delay alignment process according to an embodiment of this application. In Fig. 2, for ease of explanation, a point in the first channel signal before the delay alignment process and a point in the first channel signal after the compression process at the same position are marked by using the same coordinates, but this does not mean that the signals of the points with the same coordinates are the same. For example, the coordinates of both the start points of the first channel signal of the current frame are marked as B1 before the delay alignment process and after the compression process.

[0111] 2, the start point of the first alignment processing length signal is located at the start point B1 of the first channel signal of the current frame, the end point of the first alignment processing length signal is C1, and the length from the start point B1 to the end point C1 is equal to the first alignment processing length, B1=0, and C1=B1+L_next_target-1.

[0112] The start point A1 of the first processing length signal is located before the start point B1 of the first alignment processing length signal, and the length between the start point A1 of the first processing length signal and the start point B1 of the first alignment processing length signal is the absolute value of the inter-channel time difference of the current frame, i.e., A1=B1-abs(cur_itd). The end point of the first processing length signal is C1, which is the same as the coordinate of the end point of the first alignment processing length signal.

[0113] In the process of delay alignment processing, the signal from point A1 to point C1 in the first channel signal is compressed into a signal of a first alignment processing length, and the compressed signal of the first alignment processing length is used as the signal of the first alignment processing length starting from the starting point B1 in the first channel signal after compression processing. Furthermore, the uncompressed signal in the first channel signal of the current frame remains unchanged, that is, the signal from point C1+1 to point E1 in the first channel signal before delay alignment processing is directly used as the signal from point C1+1 to point E1 in the first channel signal after compression processing. E1 is the end point of the first channel signal of the current frame, the frame length of the current frame is N, and E1=N-1.

[0114] In this embodiment of the application, the signal of the first delay length may be manually reconstructed based on the signal from point E2-abs(cur_itd)+1 to point E2 in the second channel signal of the current frame, and the reconstructed signal of the first delay length is used as the signal from point E1+1 to point G1 in the first channel signal after compression processing, where E2 is the end point of the second channel signal of the current frame, E2=E1, and G1=E1+abs(cur_itd).

[0115] It should be noted that how to specifically reconstruct the signal of the first delay length is not limited in this embodiment of this application. For example, the signal from point E1-abs(cur_itd)+1 to point E1 in the second channel signal of the current frame may be directly used as the reconstructed signal of the first delay length.

[0116] Finally, in the first channel signal after the compression process, N sampling points starting from the point F1 are used as the first channel signal of the current frame after the delay alignment process. That is, the start point of the first channel signal of the current frame after the delay alignment process is the point F1, and the end point is the point G1. The point F1 is located after the start point of the first channel signal of the current frame, and the length between the point F1 and the start point of the first channel signal of the current frame is the first delay length. The point G1 is located after the end point of the first channel signal of the current frame, and the length between the point G1 and the end point of the first channel signal of the current frame is the first delay length. That is, F1=B1+abs(cur_itd).

[0117] For example, referring to Fig. 2, if the first channel of the current frame is the left channel and the second channel is the right channel, the signal from point A1 to point C1 on the left channel is compressed to a signal of the first alignment processing length, and the compressed signal of the first alignment processing length is used as the signal of the first alignment processing length in the left channel signal after the compression processing (i.e., the signal from point B1 to point C1 in the left channel signal after the compression processing). Then, the signal from point C1+1 to point E1 in the left channel signal before the compression processing is directly used as the signal from point C1+1 to point E1 in the left channel signal of the current frame after the compression processing. Then, the first delay length signal is reconstructed based on the first delay length signal before the end point in the right channel signal of the current frame (i.e., the signal from point E1-abs(cur_itd)+1 to point E1 in the right channel signal of the current frame), and the reconstructed signal of the first delay length is used as the first delay length signal after the end point in the left channel signal after the compression process (i.e., the signal from point E1+1 to point G1 in the left channel signal after the compression process). Finally, the signal from point F1 to point G1 in the signal obtained after the compression process is used as the left channel signal of the current frame after the delay alignment process.

[0118] When the first channel of the current frame is the right channel and the second channel is the left channel, please refer to the above description, and the details will not be described here.

[0119] Second possible case:

[0120] Fig. 3 is a schematic diagram of stereo signal processing according to an embodiment of this application. In Fig. 3, for ease of explanation, a point in the first channel signal before delay alignment processing and a point in the first channel signal after compression processing at the same position are marked by using the same coordinates, but this does not mean that the signals of the points with the same coordinates are the same. For example, the coordinates of both the start points of the first channel signal of the current frame are marked as B1 before delay alignment processing and after compression processing.

[0121] 3, the start point D1 of the first alignment processing length signal is located after the start point B1 of the first channel signal of the current frame, and the length between the start point D1 of the first alignment processing length signal and the end point E1 of the first channel signal of the current frame is equal to or greater than the first alignment processing length. The end point of the first alignment processing length signal is C1, and the length from the start point D1 to the end point C1 is equal to the first alignment processing length, which is C1=D1+L_next_target-1.

[0122] In FIG. 3, the frame length of the current frame is N, the start point of the first channel signal of the current frame is B1=0, and the end point of the first channel signal of the current frame is E1=N-1. The start point D1 of the first alignment processing length is located after the start point B1 of the first channel signal of the current frame, and the length between the start point D1 of the signal of the first alignment processing length and the end point E1 of the first channel signal of the current frame is equal to or greater than the first alignment processing length. For ease of description, the length between the start point D1 of the signal of the first alignment processing length and the start point B1 of the first channel signal is hereinafter referred to as the first preset length. The first preset length is greater than 0 and equal to or less than the difference value between the frame length of the current frame and the first alignment processing length, and may be specifically set based on the actual situation. Details will not be described here.

[0123] The start point A1 of the first processing length signal is located before the start point D1 of the first alignment processing length signal, and the length between the start point A1 of the first processing length signal and the start point D1 of the first alignment processing length signal is the absolute value of the inter-channel time difference of the current frame, that is, the start point of the first processing length signal is A1=D1-abs(cur_itd), and the end point of the first processing length signal is C1, which is the same as the coordinate of the end point of the first alignment processing length signal.

[0124] In this embodiment of this application, in the process of delay alignment processing, during signal compression, the first preset length signal in the first channel signal and located before the starting point of the first processing length signal may be directly used as the first preset length signal starting from the starting point of the first channel signal after compression processing, that is, the signal from point H1 to point A1-1 in the first channel signal is used as the signal from point B1 to point D1-1 in the compressed first channel signal, where H1=B1-abs(cur_itd).

[0125] In the signal compression process, the signal from point A1 to point C1 in the first channel signal is compressed into a first alignment processing length signal, and the compressed signal of the first alignment processing length is used as the first alignment processing length signal starting from point D1 in the first channel signal after compression processing, i.e., the compressed signal of the first alignment processing length is directly used as the signal from point D1 to point C1 in the first channel signal after compression processing.

[0126] Furthermore, the uncompressed signal in the first channel signal of the current frame remains unchanged, i.e., the signal from point C1+1 to point E1 in the first channel signal of the current frame before the delay alignment process is directly used as the signal from point C1+1 to point E1 in the first channel signal after the compression process, where E1 is the end point of the first channel signal of the current frame, the frame length of the current frame is N, and E1=N-1.

[0127] In this embodiment of the application, the signal of the first delay length may be manually reconstructed based on the signal from point E2-abs(cur_itd)+1 to point E2 in the second channel signal of the current frame, and the reconstructed signal of the first delay length is used as the signal from point E1+1 to point G1 in the first channel signal after compression processing, where E2 is the end point of the second channel signal of the current frame, E2=E1, and G1=E1+abs(cur_itd).

[0128] It should be noted that how to specifically reconstruct the signal of the first delay length is not limited in this embodiment of this application. For example, the signal from point E2-abs(cur_itd)+1 to point E2 in the second channel signal of the current frame may be directly used as the reconstructed signal of the first delay length.

[0129] Finally, in the first channel signal after compression processing, N sampling points starting from point F1 are used as the first channel signal of the current frame after delay alignment processing, that is, the start point of the first channel signal of the current frame after delay alignment processing is point F1, and the end point is G1, where F1=B1+abs(cur_itd), and G1=E1+abs(cur_itd).

[0130] For example, referring to FIG. 3, the first channel of the current frame is the left channel, and the second channel is the right channel. The signal from point H1 to point A1-1 in the left channel signal is directly used as the signal from point B1 to point D1-1 in the left channel signal after compression processing. The signal from point A1 to point C1 in the left channel signal is compressed into a signal of a first alignment processing length, and the compressed signal of the first alignment processing length is used as the signal from point D1 to point C1 in the left channel signal after compression processing. Then, the signal from point C1+1 to point E1 in the left channel signal of the current frame is directly used as the signal from point C1+1 to point E1 in the left channel signal after compression processing. Then, a signal of a first delay length is manually reconstructed based on the signal from point E2-abs(cur_itd)+1 to point E2 in the right channel signal of the current frame, and the reconstructed signal of the first delay length is used as the signal from point E1+1 to point G1 in the left channel signal after the compression process. Finally, the signal from point F1 to point G1 in the signal obtained after the compression process is used as the left channel signal of the current frame after the delay alignment process.

[0131] When the first channel of the current frame is the right channel and the second channel is the left channel, please refer to the above description, and the details will not be described here.

[0132] Third possible case:

[0133] Fig. 4 is a schematic diagram of stereo signal processing according to an embodiment of this application. In Fig. 4, for ease of explanation, a point in the first channel signal before delay alignment processing and a point in the first channel signal after compression processing at the same position are marked by using the same coordinates, but this does not mean that the signals of the points with the same coordinates are the same. For example, the coordinates of both the end points of the first channel signal of the current frame are marked as E1 before delay alignment processing and after compression processing.

[0134] In FIG. 4, the frame length of the current frame is N, the start point of the first channel signal of the current frame is B1=0, and the end point of the first channel signal of the current frame is E1=N-1. The start point D1 of the first alignment processing length is located before the start point B1 of the first channel signal of the current frame, and the length between the start point D1 of the first alignment processing length signal and the start point B1 of the first channel signal of the current frame is the transition section The length between the start point D1 of the first alignment processing length signal and the end point E1 of the first channel signal of the current frame is less than or equal to the first alignment processing length. section The transition section length is equal to or greater than the sum of the length of the first alignment process and the length of the second alignment process. For ease of explanation, in this embodiment of this application and in FIG. 4, the transition section length is represented by ts. In this case, D1=B1-ts. The end point of the signal of the first alignment process length is C1, and the length from the start point D1 to the end point C1 is equal to the first alignment process length, C1=D1+L_next_target-1.

[0135] In this embodiment of the present application, the transition section length may be a preset positive integer, and the preset positive integer may be set based on experience by those skilled in the art. The transition section length is usually less than or equal to the maximum absolute value of the inter-channel time difference of the current frame. Alternatively, the transition section length may be calculated based on the inter-channel time difference of the current frame. For example, the transition section length is abs(cur_itd) / 2.

[0136] The start point A1 of the first processing length signal is located before the start point D1 of the first alignment processing length signal, and the length between the start point A1 of the first processing length signal and the start point D1 of the first alignment processing length signal is the absolute value of the inter-channel time difference of the current frame, that is, the start point of the first processing length signal is A1=D1-abs(cur_itd), and the end point of the first processing length signal is C1, which is the same as the coordinate of the end point of the first alignment processing length signal.

[0137] In FIG. 4, the transition length between the start point D1 of the first alignment processing signal and the start point B1 of the first channel signal of the current frame is section It should be noted that the length between the start point D1 of the first alignment processing signal and the start point B1 of the first channel signal of the current frame is equal to the transition length. section It may be less than D1<B1であり、D1> B1. Transition section For the case where the length is less than the length, see the explanation here. No further details will be given.

[0138] In the process of delay alignment processing, the signal from point A1 to point C1 in the first channel signal is compressed into a signal of a first alignment processing length, and the compressed signal of the first alignment processing length is used as the signal of the first alignment processing length starting from point D1 in the first channel signal after compression processing, i.e., the compressed signal of the first alignment processing length is used as the signal from point D1 to point C1 in the first channel signal after compression processing.

[0139] Furthermore, the uncompressed signal in the first channel signal of the current frame remains unchanged, i.e., the signal from point C1+1 to point E1 in the first channel signal of the current frame before the delay alignment process is directly used as the signal from point C1+1 to point E1 in the first channel signal after the compression process, where E1 is the end point of the first channel signal of the current frame, the frame length of the current frame is N, and E1=N-1.

[0140] In this embodiment of the application, the signal of the first delay length may be manually reconstructed based on the signal from point E2-abs(cur_itd)+1 to point E2 in the second channel signal of the current frame, and the reconstructed signal of the first delay length is used as the signal from point E1+1 to point G1 in the first channel signal after compression processing, where E2 is the end point of the second channel signal of the current frame, E2=E1, and G1=E1+abs(cur_itd).

[0141] It should be noted that how to specifically reconstruct the signal of the first delay length is not limited in this embodiment of the application.

[0142] Finally, in the first channel signal after compression processing, N sampling points starting from point F1 are used as the first channel signal of the current frame after delay alignment processing, that is, the start point of the first channel signal of the current frame after delay alignment processing is point F1, and the end point is G1, where F1=B1+abs(cur_itd).

[0143] For example, referring to FIG. 4, the first channel of the current frame is the left channel, and the second channel is the right channel. The signal from point A1 to point C1 in the left channel signal is compressed to a signal of a first alignment processing length, and the compressed signal of the first alignment processing length is used as the signal from point D1 to point C1 in the left channel signal after compression processing. Then, the signal from point C1+1 to point E1 in the left channel signal of the current frame is directly used as the signal from point C1+1 to point E1 in the left channel signal after compression processing. Then, the signal of the first delay length is manually reconstructed based on the signal from point E2-abs(cur_itd)+1 to point E2 in the right channel signal of the current frame, and the reconstructed signal of the first delay length is used as the signal from point E1+1 to point G1 in the left channel signal after compression processing. E2 is the end point of the right channel signal of the current frame. Finally, the signal from point F1 to point G1 in the signal obtained after the compression process is used as the left channel signal of the current frame after the delay alignment process.

[0144] When the first channel of the current frame is the right channel and the second channel is the left channel, please refer to the above description, and the details will not be described here.

[0145] Optionally, a smooth transition section may be further set to add smoothing between the actual signal and the manually reconstructed signal, and the length of the smooth transition section is Ts2. The length of the smooth transition section may be set to a preset positive integer, and the difference between the length of the smooth transition section and the transition section length is less than or equal to the difference between the frame length and the first alignment process length. For example, Ts2 is set to 10.

[0146] In this case, in the process of delay alignment processing, the signal from point A1 to point C1 in the first channel signal is compressed into a signal of a first alignment processing length, and the compressed signal of the first alignment processing length is used as the signal of the first alignment processing length starting from point D1 in the first channel signal after compression processing, i.e., the compressed signal of the first alignment processing length is used as the signal from point D1 to point C1 in the first channel signal after compression processing.

[0147] Furthermore, the signal from point C1+1 to point E1-Ts2 in the first channel signal of the current frame before the delay alignment process is directly used as the signal from point C1+1 to point E1-Ts2 in the first channel signal after the compression process, where E1 is the end point of the first channel signal of the current frame, the frame length of the current frame is N, and E1=N-1. The signal of the length of the smooth transition section is manually reconstructed based on the signal from point E2-abs(cur_itd)-Ts2+1 to point E2-abs(cur_itd) in the second channel signal of the current frame, and the reconstructed signal of the length of the smooth transition section is used as the signal from point E1-Ts2+1 to point E1 of the first channel signal after the compression process.

[0148] In this embodiment of the application, the signal of the first delay length may be manually reconstructed based on the signal from point E2-abs(cur_itd)+1 to point E2 in the second channel signal of the current frame, and the reconstructed signal of the first delay length is used as the signal from point E1+1 to point G1 in the first channel signal after compression processing, where E2 is the end point of the second channel signal of the current frame, E2=E1, and G1=E1+abs(cur_itd).

[0149] It should be noted that how the first delay length signal and the smooth transition length signal are specifically reconstructed is not limited in this embodiment of the application.

[0150] It should be noted that in the second possible case, the transition section length may also be set. For specific methods and steps for setting the transition section length, and the process of performing delay alignment processing on the first channel signal of the current frame after the transition section length is set, please refer to the above description. Details will not be described here. In the second possible case, the transition section length and the length of the smooth transition section may further be set. For specific methods and steps for setting the transition section length and the length of the smooth transition section, and the process of performing delay alignment processing on the first channel signal of the current frame after the transition section length and the length of the smooth transition section are set, please refer to the above description.

[0151] In the above method, smoothing between frames is added by adding the transition section length or adding the transition section length and the length of the smoothed transition section, which improves the alignment accuracy between the two channel signals in the current frame after the delay alignment process, and improves the coding quality.

[0152] It should be noted that in this embodiment of the application, the method for compressing the signal of the first processing length may be to compress the signal by using a cubic spline interpolation method, may be to compress the signal by using a quadratic spline interpolation method, may be to compress the signal by using a linear interpolation method, or may be to compress the signal by using a B-spline interpolation method, such as a quadratic B-spline interpolation method or a cubic B-spline interpolation method. The specific compression method is not limited in this embodiment of the application, and the compression may be processed by using any technique.

[0153] 2. Perform delay alignment processing on the second channel signal of the current frame based on the inter-channel time difference of the previous frame.

[0154] Specifically, a signal of a second processing length in the second channel signal is extended to a signal of a second alignment processing length to obtain a second channel signal of a current frame after a delay alignment processing, the second processing length is determined based on the inter-channel time difference of the previous frame and the second alignment processing length, and the second processing length is less than the second alignment processing length.

[0155] In this embodiment of the present application, the second processing length is the difference between the second alignment processing length and the absolute value of the inter-channel time difference of the previous frame. In this embodiment of the present application, the second alignment processing length may be represented by L_pre_target.

[0156] The second alignment processing length may be a preset length or may be determined in other manners. The second alignment processing length is equal to or less than the frame length of the current frame. When the second alignment processing length is a preset length, the second alignment processing length may be equal to or less than L, L / 2, L / 3, or L. L is any preset positive integer equal to or less than the corresponding frame length N in the current sampling rate and greater than the maximum absolute value of the inter-channel time difference. For example, L=290 or L=200. In this embodiment of the application, L may be set to different values ​​for different sampling rates, or may be a uniform value. In general, the value may be preset based on the experience of those skilled in the art. For example, when the sampling rate is 16KHz, L is set to 290. In this embodiment of the application, L_pre_target=L / 2=145.

[0157] Furthermore, the starting point of the second processing length signal is located after the starting point of the second alignment processing length signal, and the length between the starting point of the second processing length signal and the starting point of the second alignment processing length signal is the absolute value of the inter-channel time difference of the previous frame.

[0158] The specific location of the signal in the second processing length may be determined based on different practical conditions, which will be described separately below.

[0159] First possible case:

[0160] 5 is a schematic diagram of stereo signal processing according to an embodiment of this application. In FIG. 5, for ease of explanation, a point in the second channel signal before delay alignment processing and a point in the second channel signal after expansion processing at the same position are marked by using the same coordinates, but this does not mean that the signals of the points having the same coordinates are the same. For example, the coordinates of both the start points of the second channel signal of the current frame are the same before delay alignment processing and after expansion processing. stretching After processing it is marked as B2.

[0161] 5, the frame length of the current frame is N, the start point of the second channel signal of the current frame is B2=0, and the end point of the second channel signal of the current frame is E2=N-1. The start point of the second alignment processing length is located at the start point B2 of the second channel signal of the current frame. The end point of the signal of the second alignment processing length is C2, and the length from the start point B2 to the end point C2 is equal to the second alignment processing length, which is C2=B2+L_pre_target-1.

[0162] The start point A2 of the second processing length signal is located after the start point B2 of the second alignment processing length, and the length between the start point A2 of the second processing length signal and the start point B2 of the second alignment processing length is the absolute value of the inter-channel time difference of the previous frame. The start point of the second processing length signal is A2=B2+abs(prev_itd), and the end point of the second processing length signal is C2, which is the same as the coordinate of the end point of the second alignment processing length signal.

[0163] In the process of delay alignment, the signal from point A2 to point C2 in the second channel signal is stretched to a second alignment length signal, and the stretched signal of the second alignment length is used as the second alignment length signal starting from point B2 in the second channel signal after stretching, i.e., the stretched signal of the second alignment length is used as the signal from starting point B2 to point C2 in the second channel signal after stretching.

[0164] In this embodiment of the application, during signal expansion, the unexpanded signal of the second channel signal of the current frame may remain unchanged, i.e., the signal from point C2+1 to point E2 in the second channel signal of the current frame is directly used as the signal from point C2+1 to point E2 in the second channel signal after expansion processing, where E2 is the end point of the second channel signal of the current frame, the frame length of the current frame is N, and E2=N-1.

[0165] Finally, in the second channel signal after the expansion process, N sampling points starting from the starting point B2 are used as the second channel signal of the current frame after the delay alignment process, i.e., the starting point of the second channel signal of the current frame after the delay alignment process is point B2, and the ending point is E2.

[0166] For example, referring to Fig. 5, the first channel of the current frame is the left channel, and the second channel is the right channel. The signal from point A2 to point C2 in the right channel signal of the current frame is extended to a signal of a second alignment processing length, and the extended signal of the second alignment processing length is used as the signal from point B2 to point C2 in the right channel signal after the extension processing. Then, the signal from point C2+1 to point E2 in the right channel signal of the current frame is directly used as the signal from point C2+1 to point E2 in the right channel signal after the extension processing. Finally, the signal from point B2 to point E2 in the signal obtained after the extension processing is used as the right channel signal of the current frame after the delay alignment processing.

[0167] When the first channel of the current frame is the right channel and the second channel is the left channel, please refer to the above description, and the details will not be described here.

[0168] Second possible case:

[0169] Fig. 6 is a schematic diagram of stereo signal processing according to an embodiment of this application. In Fig. 6, for ease of explanation, a point in the second channel signal before delay alignment processing and a point in the second channel signal after expansion processing at the same position are marked by using the same coordinates, but this does not mean that the signals of the points having the same coordinates are the same.

[0170] Referring to FIG. 6, the frame length of the current frame is N, the start point of the second channel signal of the current frame is B2=0, and the end point of the second channel signal of the current frame is E2=N-1. The start point of the second alignment processing length is located after the start point B2 of the second channel signal of the current frame, and the length between the start point D2 of the signal of the second alignment processing length and the end point E2 of the second channel signal of the current frame is equal to or greater than the second alignment processing length. The end point of the signal of the second alignment processing length is C2=D2+L_pre_target-1. For ease of description, the length between the start point D2 of the signal of the second alignment processing length and the start point B2 of the second channel signal is hereinafter referred to as the second preset length. The second preset length may be greater than 0 and less than or equal to the difference value between the frame length of the current frame and the second alignment processing length, and may be specifically set based on the actual situation. Details will not be described here.

[0171] The start point A2 of the second processing length signal is located before the start point B2 of the second alignment processing length, and the length between the start point A2 of the second processing length signal and the start point B2 of the second alignment processing length is the absolute value of the inter-channel time difference of the previous frame. The start point of the second processing length signal is A2=D2+abs(prev_itd), and the coordinates of the end point of the second processing length signal are the same as the coordinates of the end point of the second alignment processing length signal, that is, C2=D2+L_pre_target-1.

[0172] In the process of delay alignment, the second preset length signal starting from H2=B2+abs(prev_itd) in the second channel signal is directly used as the second preset length signal starting from the starting point B2 in the second channel signal after expansion, that is, referring to Fig. 6, the signal from point H2 to point A2-1 in the second channel signal of the current frame is directly used as the signal from point B2 to point D2-1 in the second channel signal after expansion.

[0173] Furthermore, the signal from point A2 to point C2 in the second channel signal is expanded to a signal of a second alignment processing length, and the expanded signal of the second alignment processing length is used as the signal of the second alignment processing length starting from point D2 in the second channel signal after the expansion processing, i.e., the expanded signal of the second alignment processing length is used as the signal from point D2 to point C2 in the second channel signal after the expansion processing.

[0174] In this embodiment of the application, during signal expansion, the non-expanded signal in the second channel signal of the current frame may remain unchanged, i.e., the signal from point C2+1 to point E2 in the second channel signal of the current frame is directly used as the signal from point C2+1 to point E2 in the second channel signal after expansion processing, where E2 is the end point of the second channel signal of the current frame, the frame length of the current frame is N, and E2=N-1.

[0175] Finally, in the second channel signal after the expansion process, N sampling points starting from the starting point B2 are used as the second channel signal of the current frame after the delay alignment process. Second The start point of the channel signal is point B2 and the end point is E2.

[0176] For example, referring to FIG. 6, the first channel of the current frame is the left channel, and the second channel is the right channel. In the process of delay alignment processing, the signal from point H2 to point A2-1 in the right channel signal of the current frame is directly used as the signal from point B2 to point D2-1 in the right channel signal after the extension processing. The signal from point A2 to point C2 in the right channel signal of the current frame is extended to a signal of a second alignment processing length, and the extended signal of the second alignment processing length is used as the signal from point D2 to point C2 in the right channel signal after the new line processing. Then, the signal from point C2+1 to point E2 in the right channel signal of the current frame is directly used as the signal from point C2+1 to point E2 in the right channel signal after the extension processing. Finally, the signal from point B2 to point E2 in the signal obtained after the extension processing is used as the right channel signal of the current frame after the delay alignment processing.

[0177] When the first channel of the current frame is the right channel and the second channel is the left channel, please refer to the above description, and the details will not be described here.

[0178] It should be noted that in this embodiment of the application, the method for expanding the signal of the second processing length may be to expand the signal by using a cubic spline interpolation method, may be to expand the signal by using a quadratic spline interpolation method, may be to expand the signal by using a linear interpolation method, or may be to expand the signal by using a B-spline interpolation method, such as a quadratic B-spline interpolation method or a cubic B-spline interpolation method. The specific expansion method is not limited in this embodiment of the application, and the expansion may be processed by using any technique.

[0179] In this embodiment of the application, after the delay alignment process is performed, the inter-channel time difference of the current frame may be further quantized and coded to obtain a code index of the inter-channel time difference of the current frame, and the code index is written into the code stream. It should be noted that the inter-channel time difference of the current frame may alternatively be quantized and coded in step 101, or may be quantized and coded here, which is not limited in this embodiment of the application.

[0180] Specifically, there may be many ways to write the code index into the code stream, which is not limited in this embodiment of this application. For example, after the absolute value of the inter-channel time difference of the current frame is quantized and coded, the code index of the absolute value of the inter-channel time difference of the current frame is written into the code stream, and the code stream is sent to the decoder side. Furthermore, the index of the target channel of the current frame is written into the code stream as the target channel index, or the index of the reference channel of the current frame is written into the code stream as the reference channel index, and the code stream is sent to the decoder side.

[0181] After delay alignment processing, the left channel signal of the current frame is x' L (n), and the right channel signal of the current frame after the delay alignment process is denoted as x' R (n), where n is the sampling point sequence number, n=0, 1, ..., N-1. According to the sign of the inter-channel time difference of the current frame and the sign of the inter-channel time difference of the previous frame, the first channel signal after the delay alignment process may be the left channel signal of the current frame after the delay alignment process, and x' L (n), or the second channel signal after the delay alignment process may be the left channel signal of the current frame after the delay alignment process, and x' L Similarly, the first channel signal after the delay alignment process may be the right channel signal of the current frame after the delay alignment process, and is denoted as x' R (n), or the second channel signal after the delay alignment process may be the right channel signal of the current frame after the delay alignment process, and x' R It is written as (n).

[0182] Finally, the first channel signal after the delay alignment process and the second channel signal after the delay alignment process are encoded.

[0183] Specifically, the first channel signal after delay alignment processing and the second channel signal after delay alignment processing may be encoded by using an existing stereo encoding method, and the encoded code stream is sent to the decoder side. The specific encoding method is not limited in this embodiment of this application.

[0184] Optionally, in this embodiment of the application, when the first alignment processing length is not a preset length, the following formula may be satisfied:

number

[0185] When the second alignment processing length is not the preset length, the following formula may be satisfied:

number

[0186] Optionally, in this embodiment of this application, when the processing length of the delay alignment process is not a preset length, the following formula may be satisfied:

number

[0187] MAX_DELAY_CHANGE is a positive integer greater than 0 and |T max -T min | Less than or equal is also acceptable. T maxcorresponds to the maximum interchannel time difference at the current sampling rate, and T min corresponds to the minimum inter-channel time difference at the current sampling rate. For example, MAX_DELAY_CHANGE is equal to 80, 40, or 20. Embodiment Then MAX_DELAY_CHANGE can be 20.

[0188] The following provides an explanation by using specific embodiments.

[0189] Step 1: To determine the inter-channel time difference of the current frame, delay estimation is performed based on the stereo signal of the current frame.

[0190] For the specific content of this step, please refer to step 101. The details will not be described again here.

[0191] Step 2: If the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the previous frame, perform a delay alignment process on the first channel signal of the current frame based on the inter-channel time difference of the current frame.

[0192] Step 3: If the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the previous frame, perform a delay alignment process on the second channel signal of the current frame based on the inter-channel time difference of the previous frame.

[0193] Referring to step 2 and step 3, the length between the start point of the signal of the second alignment processing length and the start point of the second channel signal of the current frame is equal to the second preset length, and the length between the start point of the signal of the first alignment processing length and the start point of the first channel signal of the current frame is equal to the sum of the second preset length and the second alignment processing length. Furthermore, the first alignment processing length satisfies formula (8), and the second alignment processing length satisfies formula (9).

[0194] Fig. 7(a) is a schematic diagram of stereo signal processing according to an embodiment of this application. In Fig. 7(a), for ease of explanation, a point in a first channel signal before delay alignment processing and a point in the first channel signal after delay alignment processing at the same position are marked by using the same coordinates, and a point in a second channel signal before delay alignment processing and a point in the second channel signal after delay alignment processing at the same position are marked by using the same coordinates.

[0195] The frame length of the current frame is N, the start point of the first channel signal of the current frame is B1=0, the end point of the first channel signal of the current frame is E1=N-1, the start point of the second channel signal of the current frame is B2=0, and the end point of the second channel signal of the current frame is E2=N-1. The start point of the signal of the first alignment processing length is D1=D2+L_pre_target, the end point of the signal of the first alignment processing length is C1=D1+L_next_target-1, the start point of the signal of the first processing length is A1=D1-abs(cur_itd), and the coordinate of the end point of the signal of the first processing length is the same as the coordinate of the end point of the signal of the first alignment processing length, i.e., C1=D1+L_next_target-1. The start point of the second alignment processing length is D2, and the end point of the second alignment processing length is C2=D2+L_pre_target-1. The start point of the signal of the second processing length is A2=D2+abs(prev_itd), and the end point of the signal of the second processing length is C2=D2+L_pre_target-1. For ease of explanation, in the following, the length between the start point D2 of the signal of the second alignment processing length and the start point B2 of the second channel signal is called the second preset length. The second preset length may be greater than 0 and less than or equal to the difference value between the frame length of the current frame and the second alignment processing length, and may be specifically set based on the actual situation. Details will not be described here. In this case, as shown in FIG. 7(a), the signal of the first processing length is compressed, and the signal of the second processing length is expanded.

[0196] 7(a), in the process of performing delay alignment processing on the first channel signal, the signal from point H1 to point A1-1 in the first channel signal is directly used as the signal from point B1 to point D1-1 in the first channel signal after compression processing, where H1=B1-abs(cur_itd). The signal from point A1 to point C1 in the first channel signal of the current frame is compressed into a signal of a first alignment processing length, and the compressed signal of the first alignment processing length is used as the signal from point D1 to point C1 in the first channel signal after compression processing. Then, the signal from point C1+1 to point E1 in the first channel signal of the current frame is directly used as the signal from point C1+1 to point E1 in the first channel signal after compression processing. Then, the signal of the first delay length is manually reconstructed based on the signal of the first delay length before the end point E2 in the second channel signal of the current frame, and the reconstructed signal of the first delay length is used as the signal from point E1+1 to point G1 in the first channel signal after the compression process, where G1=E1+abs(cur_itd)-1. Finally, the signal from point F1 to point G1 in the signal obtained after the delay alignment process is used as the first channel signal of the current frame after the delay alignment process, where F1=B1+abs(cur_itd).

[0197] In the process of performing delay alignment processing on the second channel signal, the second preset length signal starting from H2=B2+abs(prev_itd) in the second channel signal is directly used as the second preset length signal starting from the starting point B2 in the second channel signal after the expansion processing. That is, referring to Fig. 7(a), the signal from point H2 to point A2-1 in the second channel signal of the current frame is directly used as the signal from point B2 to point D2-1 in the second channel signal after the expansion processing. The signal from point A2 to point C2 in the second channel signal of the current frame is expanded to a signal of the second alignment processing length, and the expanded signal of the second alignment processing length is used as the signal from point D2 to point C2 in the second channel signal after the expansion processing. Then, the signal from point C2+1 to point E2 in the second channel of the current frame is directly used as the signal from point C2+1 to point E2 in the second channel signal after the expansion process. Finally, the signal from point B2 to point E2 in the signal obtained after the delay alignment process is used as the second channel signal of the current frame after the delay alignment process.

[0198] Referring to Fig. 7(a), in this embodiment of this application, the start point of the second alignment processing length may also be the start point of the second channel signal, i.e., D2=B2 and D1=B1+L_pre_target. In this case, the signal of the first processing length is compressed and the signal of the second processing length is expanded, as shown in Fig. 7(b).

[0199] Fig. 7(b) is a schematic diagram of stereo signal processing according to an embodiment of this application. In Fig. 7(b), for ease of explanation, a point in a first channel signal before delay alignment processing and a point in the first channel signal after delay alignment processing at the same position are marked by using the same coordinates, and a point in a second channel signal before delay alignment processing and a point in the second channel signal after delay alignment processing at the same position are marked by using the same coordinates.

[0200] In Fig. 7(b), the frame length of the current frame is N, the start point of the first channel signal of the current frame is B1=0, and the end point of the first channel signal of the current frame is E1=N-1. The start point of the signal of the first alignment processing length is D1=B1+L_pre_target, the end point of the signal of the first alignment processing length is C1=B1+L_pre_target+L_next_target-1, the start point of the signal of the first processing length is A1=B1+L_pre_target-abs(cur_itd), and the coordinate of the end point of the signal of the first processing length is the same as the coordinate of the end point of the signal of the first alignment processing length, i.e., C1=B1+L_pre_target+L_next_target-1.

[0201] The start point of the second channel signal of the current frame is B2=0, and the end point of the second channel signal of the current frame is E2=N-1. The start point of the second alignment processing length is the start point B2 of the second channel signal, and the end point of the second alignment processing length is C2=B2+L_pre_target-1. The start point of the second processing length signal is A2=B2+abs(prev_itd), and the end point of the second processing length signal is C2=B2+L_pre_target-1.

[0202] 7(b), in the process of performing delay alignment processing on the first channel signal, the signal from point H1 to point A1-1 in the first channel signal is directly used as the signal from point B1 to point D1-1 in the first channel signal after compression processing, where H1=B1-abs(cur_itd). The signal from point A1 to point C1 in the first channel signal of the current frame is compressed into a signal of a first alignment processing length, and the compressed signal of the first alignment processing length is used as the signal from point D1 to point C1 in the first channel signal after compression processing. Then, the signal from point C1+1 to point E1 in the first channel signal of the current frame is directly used as the signal from point C1+1 to point E1 in the first channel signal after compression processing. Then, the signal of the first delay length is manually reconstructed based on the signal of the first delay length before the end point E2 in the second channel signal of the current frame, and the reconstructed signal of the first delay length is used as the signal from point E1+1 to point G1 in the first channel signal after the compression process, where G1=E1+abs(cur_itd)-1. Finally, the signal from point F1 to point G1 in the signal obtained after the delay alignment process is used as the first channel signal of the current frame after the delay alignment process, where F1=B1+abs(cur_itd).

[0203] In the process of performing delay alignment processing on the second channel signal, the signal from point A2 to point C2 in the second channel signal of the current frame is stretched to a signal of a second alignment processing length, and the stretched signal of the second alignment processing length is used as the signal from point B2 to point C2 in the second channel signal after stretching processing. Then, the signal from point C2+1 to point E2 in the second channel of the current frame is directly used as the signal from point C2+1 to point E2 in the second channel signal after stretching processing. Finally, the signal from point B2 to point E2 in the signal obtained after delay alignment processing is used as the second channel signal of the current frame after delay alignment processing.

[0204] In order to add smoothing between frames, a transition section may also be set, and the transition section length is ts. Optionally, the length of a smooth transition section may be further set, and the length of the smooth transition section is Ts2. For specific methods, please refer to the above description. Details will not be described here.

[0205] In this embodiment of the application, if it is determined that the sign of the inter-channel time difference of the current frame is the same as the sign of the inter-channel time difference of the previous frame, a delay alignment process may be performed on the signal of the target channel of the current frame according to the inter-channel time difference of the current frame and the inter-channel time difference of the previous frame. In this case, the target channel of the current frame and the target channel of the previous frame are the same channel. The specific delay alignment process method is not limited in this embodiment of the application.

[0206] For example, possible processing methods are as follows:

[0207] Step 1: Use the estimated inter-channel time difference of the current frame as the inter-channel time difference of the current frame.

[0208] Step 2: Select a target channel and a reference channel of the current frame based on the inter-channel time difference of the current frame and the inter-channel time difference of the previous frame. The inter-channel time difference of the current frame is denoted as cur_itd, and the inter-channel time difference of the previous frame is denoted as prev_itd. Specifically, if cur_itd=0, the target channel of the current frame is consistent with the target channel of the previous frame. For example, the target channel index of the current frame is denoted as target_idx, the target channel index of the previous frame is denoted as prev_target_idx, and target_idx=prev_target_idx. If cur_itd<0, the target channel of the current frame is the left channel. For example, the target channel index of the current frame is denoted as target_idx, and target_idx=0. If cur_itd>0, the target channel of the current frame is the right channel. For example, the target channel index of the current frame is denoted as target_idx, and target_idx=1.

[0209] Moreover, the target channel index of the current frame may be further encoded and written into the codestream, and the codestream is transmitted to the decoder side.

[0210] Step 3: Perform a delay alignment process on the signal of the selected target channel according to the inter-channel time difference of the current frame and the inter-channel time difference of the previous frame. Specifically, this step may be as follows:

[0211] The pre-processed time domain signal of the channel corresponding to the target channel is used as the target channel signal, and the pre-processed time domain signal of the channel corresponding to the reference channel is used as the reference channel signal. For example, if the target channel is the left channel, the pre-processed time domain signal of the left channel is used as the target channel signal, and if the reference channel is the right channel, the pre-processed time domain signal of the right channel is used as the reference channel signal. If the target channel is the right channel, the pre-processed time domain signal of the right channel is used as the target channel signal, and if the reference channel is the left channel, the pre-processed time domain signal of the left channel is used as the reference channel signal.

[0212] If abs(cur_itd) is equal to abs(prev_itd), the target channel signal is not compressed or expanded. The signal at point abs(cur_itd) is manually reconstructed based on the reference channel signal and used as the signal from point B+N to point B+N+abs(cur_itd)-1 of the target channel signal of the current frame. The target channel signal of the current frame is directly delayed by abs(cur_itd) sampling points and used as the target channel signal of the current frame after the delay alignment process. B represents the coordinate of the starting point in the target channel signal of the current frame, N represents the frame length of the current frame, and abs() represents the absolute value calculation. The reference channel signal of the current frame is directly used as the reference channel signal of the current frame after the delay alignment process.

[0213] If abs(cur_itd) is less than abs(prev_itd), the buffered target channel signal from point B+abs(prev_itd)-abs(cur_itd) to point B+L-1 is stretched to a signal with a length of L points, which is the target channel signal after the stretching process. signalThe signal from point B+L to point B+N-1 in the target channel signal is directly used as the signal from point B+L to point B+N-1 in the target channel signal after the decompression process. The signal at point abs(cur_itd) is manually reconstructed based on the reference channel signal and used as the signal for the target channel signal after the decompression process. signal The signal from point B+N to point B+N+abs(cur_itd)-1 in the target channel signal after the expansion process is used as the target channel signal of the current frame after the delay alignment process. The signal of N points starting from point B+abs(cur_itd) in the target channel signal after the expansion process is used as the target channel signal of the current frame after the delay alignment process. The reference channel signal of the current frame is directly used as the reference channel signal of the current frame after the delay alignment process. B represents the coordinate of the starting point in the target channel signal of the current frame, N represents the frame length of the current frame, and L represents the processing length of the delay alignment process.

[0214] If abs(cur_itd) is greater than abs(prev_itd), the signal from point B+abs(prev_itd)-abs(cur_itd) to point B+L-1 in the buffered target channel signal is compressed into a signal with a length of L points, which is the target channel signal after the compression process. signal The signal from point B+L to point B+N-1 in the target channel signal is directly used as the signal from point B+L to point B+N-1 in the target channel signal after compression. The signal at point abs(cur_itd) is manually reconstructed based on the reference channel signal and used as the signal at the target channel signal after compression. signal The signal from point B+N to point B+N+abs(cur_itd)-1 is used as the target channel after compression. signalThe signal of N points starting from point B+abs(cur_itd) in is used as the target channel signal of the current frame after delay alignment processing. The reference channel signal of the current frame is directly used as the reference channel signal of the current frame after delay alignment processing. B represents the coordinate of the starting point in the target channel signal of the current frame, N represents the frame length of the current frame, and L represents the processing length of the delay alignment processing.

[0215] In order to add smoothing between frames, a transition section may be set here, and the transition section length is ts. The first transition section length may be set to a preset positive integer, and the preset positive integer may be set based on experience by a person skilled in the art. For example, the first transition section length may alternatively be calculated based on the inter-channel time difference of the current frame. For example, ts=abs(cur_itd) / 2. Similarly, in order to add smoothing between the actual signal and the reconstructed signal, a smooth transition section may be further set, and the length of the smooth transition section is Ts2. The length of the smooth transition section may be set to a preset positive integer. For example, Ts2 is set to 10. Then, step 3 of performing a delay alignment process on the signal of the selected target channel based on the inter-channel time difference of the current frame and the inter-channel time difference of the previous frame may be modified as follows:

[0216] If abs(cur_itd) is less than abs(prev_itd), the buffered target channel signal from point B-ts+abs(prev_itd)-abs(cur_itd) to point B+L-ts-1 is stretched to a signal of length L, which is the target channel signal after the stretching process. signalThe signal from point B-ts to point B+N-Ts2-1 in the target channel signal is directly used as the signal from point B+L-ts to point B+N-Ts2-1 in the target channel signal after the expansion process. The signal at point Ts2 is generated based on the reference channel signal and the target channel signal, and is used as the target channel signal after the expansion process. signal The signal at point abs(cur_itd) is manually reconstructed based on the reference channel signal and used as the target channel signal after the decompression process. signal The signal from point B+N to point B+N+abs(cur_itd)-1 is used as the target channel after the decompression process. signal The signal of N points starting from point B+abs(cur_itd) in is used as the target channel signal of the current frame after delay alignment processing. The reference channel signal of the current frame is directly used as the reference channel signal of the current frame after delay alignment processing. B represents the coordinate of the starting point in the target channel signal of the current frame, N represents the frame length of the current frame, and L represents the processing length of the delay alignment processing.

[0217] If abs(cur_itd) is greater than abs(prev_itd), the signal from point B-ts+abs(prev_itd)-abs(cur_itd) to point B+L-ts-1 in the buffered target channel signal is compressed into a signal with a length of L points, which is the target channel signal after the compression process. signal The signal from point B-ts to point B+L-ts-1 in the target channel signal is used as the target channel signal after compression processing. signal The signal at point Ts2 is generated based on the reference channel signal and the target channel signal, and is used directly as the target channel signal after compression processing. signalThe signal at point abs(cur_itd) is manually reconstructed based on the reference channel signal and used as the signal from point B+N to point B+N+abs(cur_itd)-1 of the target channel after compression. signal The signal of N points starting from point B+abs(cur_itd) in is used as the target channel signal of the current frame after delay alignment processing. The reference channel signal of the current frame is directly used as the reference channel signal of the current frame after delay alignment processing. B represents the coordinate of the starting point in the target channel signal of the current frame, N represents the frame length of the current frame, and L represents the processing length of the delay alignment processing.

[0218] A signal at point Ts is generated based on the reference channel signal and the target channel signal, and the target channel signal after compression or expansion processing is signal Specifically, the signal at point Ts2 may be used as the signal from point B+N-Ts2 to point B+N-1 of the target channel, and the signal from point B+N-abs(cur_itd)-Ts2 to point B+N-abs(cur_itd)-1 of the reference channel. signal The signal at point abs(cur_itd) is manually reconstructed based on the reference channel signal and used as the signal from point B+N to point B+N+abs(cur_itd)-1 of the target channel after compression or expansion processing. Specifically, the signal at point abs(cur_itd) is generated based on the signal from point B+N-abs(cur_itd) to point B+N-1 of the reference channel and used as the signal from point B+N to point B+N+abs(cur_itd)-1 of the target channel after compression or expansion processing. signal is used as the signal from point B+N to point B+N+abs(cur_itd)-1.

[0219] After delay alignment processing, the left channel signal of the current frame is x' L (n), and the right channel signal of the current frame after the delay alignment process is denoted as x' R (n), where n is the sampling point sequence number, n=0, 1,..., N-1. According to the sign of the inter-channel time difference of the current frame, the target channel signal after the delay alignment process may be the left channel signal of the current frame after the delay alignment process, and x' L (n), or the target channel signal after delay alignment processing may be the right channel signal of the current frame after delay alignment processing, and x' R Similarly, the reference channel signal after delay alignment processing may be the left channel signal of the current frame after delay alignment processing, and x' L (n), or the reference channel signal after delay alignment processing may be the right channel signal of the current frame after delay alignment processing, and x' R It is written as (n).

[0220] The finally obtained signal after the delay alignment process is used in a time-domain down-mix process to obtain a primary channel signal and a secondary channel signal after a time-domain down-mix process, which are coded separately to code the input stereo signal.

[0221] The embodiments of this application may be further applicable to a decoding process, which may be considered as the inverse process of the encoding process, and will be described in detail below.

[0222] FIG. 8 shows a stereo signal processing method according to an embodiment of this application, which includes:

[0223] Step 801: Determine an inter-channel time difference of a current frame based on a received codestream, where the inter-channel time difference of the current frame is a time difference between a first channel signal of the current frame and a second channel signal of the current frame.

[0224] In step 801, the first channel signal of the current frame and the second channel signal of the current frame may further be obtained through decoding based on the received codestream.

[0225] This embodiment of the application does not set any limitation on the method for decoding the first channel signal of the current frame and the second channel signal of the current frame, provided that the method corresponds to an encoding method for encoding the first channel signal after the delay alignment processing by the encoder side and the second channel signal after the delay alignment processing. The decoded first channel signal of the current frame, i.e., the first channel signal before the delay recovery processing, corresponds to the encoded first channel signal after the delay alignment processing by the encoder side. The decoded second channel signal of the current frame, i.e., the second channel signal before the delay recovery processing, corresponds to the encoded second channel signal after the delay alignment processing by the encoder side.

[0226] In step 801, the method for decoding the inter-channel time difference of the current frame needs to correspond to the encoding method at the encoder side. For example, if the encoder side writes the code index of the absolute value of the inter-channel time difference of the current frame and the reference channel index into the code stream and sends the code stream to the decoder side, the decoder side decodes the absolute value of the inter-channel time difference of the current frame and the reference channel index according to the received code stream.

[0227] Alternatively, when the encoder side writes a code index of the absolute value of the inter-channel time difference of the current frame and a target channel index into a code stream and transmits the code stream to the decoder side, the decoder side decodes the absolute value of the inter-channel time difference of the current frame and the target channel index based on the received code stream.

[0228] Alternatively, if the encoder side writes a code index of the inter-channel time difference of the current frame into a code stream and sends the code stream to the decoder side, the decoder side decodes the inter-channel time difference of the current frame based on the received code stream.

[0229] For the scheme for determining the inter-channel time difference of the previous frame, please refer to the description herein, and the details will not be described further.

[0230] Step 802: If the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, perform a delay recovery process on a first channel signal of the current frame based on the inter-channel time difference of the current frame, and perform a delay recovery process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame, where the first channel signal is a target channel signal of the current frame, and the second channel signal is on the same channel as the target channel signal of the previous frame.

[0231] In step 802, the sign may indicate a plus sign (+) or a minus sign (-). In this embodiment of the application, the previous frame is located before the current frame and adjacent to the current frame. For ease of explanation, in the following, the channel corresponding to the first channel signal of the current frame is called the first channel, and the channel corresponding to the second channel signal of the current frame is called the second channel. It should be noted that the first channel is the target channel of the current frame, and may also be called the target channel of the next frame, or may also be called the designated target channel of the current frame, or may also be called other channels other than the target channel of the frame previous to the current frame. Correspondingly, the second channel is the reference channel of the current frame, and the second channel is a channel that is within the two channels of the stereo signal and is the same as the target channel of the previous frame, and may also be called the target channel of the previous frame, or may also be called the designated reference channel of the current frame, or may also be called other channels other than the target channel of the current frame. For example, if the target channel of the previous frame is the left channel, the first channel signal is the right channel signal in the current frame and the second channel signal is the left channel signal in the current frame. If the target channel of the previous frame is the right channel, the first channel signal is the left channel signal in the current frame and the second channel signal is the right channel signal in the current frame.

[0232] In step 802, when the decoder side decodes the inter-channel time difference of the current frame based on the received code stream, the decoder side may directly determine whether the sign of the inter-channel time difference of the current frame is the same as the sign of the inter-channel time difference of the previous frame.

[0233] When the decoder side decodes the absolute value of the inter-channel time difference of the current frame and the reference channel of the current frame, or the absolute value of the inter-channel time difference of the current frame and the target channel index of the current frame based on the received code stream, the decoder side needs to determine whether the sign of the inter-channel time difference of the current frame is the same as the sign of the inter-channel time difference of the previous frame based on the reference channel of the current frame and the reference channel index of the previous frame, or based on the target channel of the current frame and the reference channel index of the previous frame.

[0234] Here, it is used as an example that the absolute value of the inter-channel time difference of the current frame and the reference channel index are decoded. Specifically, if the reference channel index of the current frame is not equal to the reference channel index of the previous frame, it is determined that the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the previous frame. If the reference channel index of the current frame is equal to the reference channel index of the previous frame, it is determined that the sign of the inter-channel time difference of the current frame is the same as the sign of the inter-channel time difference of the previous frame. For other cases, please refer to the description herein. Details will not be described further.

[0235] The delay recovery process on the decoder side corresponds to the delay alignment process on the encoder side: if the encoder side performs compression, the decoder side needs to decompress the compressed signal. Similarly, if the encoder side performs decompression, the decoder side needs to compress the decompressed signal.

[0236] In this embodiment of the application, there are several ways to perform delay recovery processing on the first channel signal and the second channel signal in the decoding process, which will be described separately below.

[0237] 1. Perform delay recovery processing on the first channel signal of the current frame based on the inter-channel time difference of the current frame.

[0238] Specifically, a signal of a third processing length in the first channel signal of the current frame is extended to a signal of a third alignment processing length to obtain the first channel signal of the current frame after delay recovery processing, the third processing length is determined according to the inter-channel time difference of the current frame and the third alignment processing length, and the third processing length is less than the third alignment processing length.

[0239] In the decoding process, the third processing length may be the difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame, and the third alignment processing length may be a preset length, or may be determined in other manners, for example, according to formula (8). In this embodiment of the application, the third alignment processing length is equal to or less than the frame length of the current frame. When the third alignment processing length is preset, the third alignment processing length may be any length equal to or less than L, L / 2, L / 3 or L. L is any preset positive integer that is equal to or less than the corresponding frame length N in the current sampling rate and is greater than the maximum absolute value of the inter-channel time difference. For example, L=290 or L=200. In this embodiment of the application, L may be set to different values ​​for different sampling rates, or may be a uniform value. In general, the value may be preset based on the experience of those skilled in the art. For example, when the sampling rate is 16KHz, L is set to 290. In this case, the third alignment processing length is L / 2=145.

[0240] In this embodiment of the application, the starting point of the third processing length signal is located after the starting point of the third alignment processing length signal, and the length between the starting point of the third processing length signal and the starting point of the third alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0241] In this embodiment of the application, the third alignment processing length may be represented by L2_next_target, and the fourth alignment processing length may be represented by L2_pre_target. It should be noted that the first alignment processing length on the encoder side is actually equal to the third alignment processing length on the decoder side corresponding to the encoder side. Correspondingly, the second alignment processing length on the encoder side is actually equal to the fourth alignment processing length on the decoder side corresponding to the encoder side. For ease of explanation, different notations are used here to represent the lengths. The inter-channel time difference of the current frame is cur_itd, and abs(cur_itd) represents the absolute value of the inter-channel time difference of the current frame. For ease of explanation, abs(cur_itd) is referred to as the first delay length in the following description. The inter-channel time difference of the previous frame is prev_itd, and abs(prev_itd) represents the absolute value of the inter-channel time difference of the previous frame. For ease of explanation, abs(prev_itd) is referred to as the second delay length in the following description.

[0242] In the decoding process, the specific position of the signal of the third processing length may be determined based on different actual conditions, which will be described separately below.

[0243] First possible case:

[0244] Fig. 9 is a schematic diagram of stereo signal processing according to an embodiment of this application. In Fig. 9, for ease of explanation, a point in the first channel signal before delay recovery processing and a point in the first channel signal after expansion processing at the same position are marked by using the same coordinates, but this does not mean that the signals of the points having the same coordinates are the same.

[0245] 9, the frame length of the current frame is N, the start point of the first channel signal of the current frame is B3=0, and the end point of the first channel signal of the current frame is E3=N-1. The start point of the signal of the third processing length is located at the start point B3 of the first channel signal of the current frame, and the end point of the signal of the third processing length is C3=B3-abs(cur_itd)+L2_next_target-1.

[0246] In Figure 9, the start point of the third alignment processing length is A3 = B3 - abs (cur_itd), and the end point of the signal of the third alignment processing length is C3, which is the same as the coordinates of the end point of the signal of the third processing length.

[0247] In the process of delay recovery processing, referring to FIG. 9, the signal from point B3 to point C3 in the first channel signal of the current frame is extended to a signal of a third alignment processing length, and the extended signal of the third alignment processing length is used as the signal of the third alignment processing length starting from the starting point A3 of the third alignment processing length in the first channel signal after the extension processing, i.e., used as the signal from the starting point A3 to point C3 of the third alignment processing length in the first channel signal after the extension processing.

[0248] In this embodiment of the application, during signal expansion, the signal from point C3+1 to point E3 in the first channel signal of the current frame may be directly used as the signal from point C3+1 to point E3 in the first channel signal after the expansion process.

[0249] Finally, in the first channel signal after the decompression process, N sampling points starting from the starting point A3 are used as the first channel signal of the current frame after the delayed recovery process, that is, the starting point of the first channel signal of the current frame after the delayed recovery process is point G3, where G3=E3-abs(cur_itd).

[0250] In general, the start point of the signal of the third processing length may be located after the start point of the first channel signal, but when the start point of the signal of the third processing length is located after the start point of the first channel signal, it is necessary to ensure that the length between the start point of the signal of the third processing length and the end point of the first channel signal of the current frame is equal to or greater than the difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame, which will be described in detail below.

[0251] Second possible case:

[0252] Fig. 10 is a schematic diagram of stereo signal processing according to an embodiment of this application. In Fig. 10, for ease of explanation, a point in the first channel signal before delay recovery processing and a point in the first channel signal after expansion processing at the same position are marked by using the same coordinates, but this does not mean that the signals of the points having the same coordinates are the same.

[0253] In FIG. 10, the frame length of the current frame is N, the start point of the first channel signal of the current frame is B3=0, and the end point of the first channel signal of the current frame is E3=N-1.

[0254] In FIG. 10, the start point of the third processing length is D3, and the end point of the signal of the third processing length is C3=D3-abs(cur_itd)+L2_next_target-1. A3 is the start point of the signal of the third alignment processing length, and A3=D3-abs(cur_itd). The coordinates of the end point of the signal of the third alignment processing length are the same as the coordinates of the end point C3 of the signal of the third processing length, that is, C3=A3+L2_next_target-1=D3-abs(cur_itd)+L2_next_target-1. The start point D3 of the signal of the third processing length is located after the start point B3 of the first channel signal of the current frame, and the length between the start point of the signal of the third processing length and the end point of the first channel signal of the current frame is greater than or equal to the difference between the absolute value of the inter-channel time difference of the third alignment processing length and the current frame. The length between the start point D3 of the signal of the third processing length and the start point B3 of the first channel signal of the current frame is the third preset length. The third preset length may be determined based on the actual situation, and the third preset length is greater than 0 and less than or equal to the difference between the frame length of the current frame and the third processing length. In FIG. 10, the third preset length is greater than the absolute value of the inter-channel time difference of the current frame is used as an example for explanation. For other cases of the third preset length, please refer to the description herein.

[0255] In FIG. 10, the length between the start point D3 of the signal of the third processing length and the start point B3 of the first channel signal of the current frame is the third preset length, and the start point of the signal of the third alignment processing length is A3. 、A H3 is located before the start point B3 of the first channel signal of the current frame, the length between H3 and A3 is the third preset length, and the length between H3 and B3 is the absolute value of the inter-channel time difference of the current frame, that is, H3=B3-abs(cur_itd).

[0256] It should be noted that the point A3 may be located before the start point B3 of the first channel signal of the current frame, and the length between the point A3 and the start point B3 of the first channel signal of the current frame is equal to or less than the absolute value of the inter-channel time difference of the current frame. The point A3 may be located at the start point B3 of the first channel signal of the current frame. Alternatively, the point A3 may be located after the start point B3 of the first channel signal of the current frame, and the length between the point A3 and the start point B3 of the first channel signal of the current frame is equal to or less than the difference between the frame length of the current frame and the third alignment processing length. For the case where the point A3 is located at the above position, please refer to the description herein. Details will not be described further.

[0257] In the process of delay recovery processing, the signal of the third preset length starting from the starting point B3 of the first channel signal of the current frame may be used as the signal of the third preset length before the starting point A3 of the third alignment processing length. Referring to Figure 10, the signal from point B3 to point D3-1 in the first channel signal of the current frame is used as the signal from point H3 to point A3-1 in the first channel signal after delay recovery processing.

[0258] Then, the signal of the third processing length starting from the starting point in the first channel signal of the current frame may be stretched to a signal of the third alignment processing length, and the stretched signal of the third alignment processing length is used as the signal of the third alignment processing length starting from the starting point of the third alignment processing length in the first channel signal after the stretching process. Referring to Figure 10, the signal from the starting point D3 to point C3 in the first channel signal of the current frame is stretched to a signal of the third alignment processing length, and is used as the signal from point A3 to point C3 in the first channel signal after the stretching process.

[0259] Then, the signal from point C3+1 to point E3 in the first channel signal of the current frame is used as the signal from point C3+1 to point E3 in the first channel signal after the decompression process.

[0260] Finally, the signal of N points starting from the starting point H3 in the first channel signal after the expansion process is used as the first channel signal of the current frame after the delay recovery process. The starting point of the first channel signal of the current frame after the delay recovery process is point G3, where G3=E3-abs(cur_itd).

[0261] 2. Perform delay recovery processing on the second channel signal of the current frame based on the inter-channel time difference of the previous frame.

[0262] Specifically, a signal of a fourth processing length in the second channel signal of the current frame is compressed to a signal of a fourth alignment processing length to obtain a second channel signal of the current frame after delay recovery processing, the fourth processing length is determined according to the inter-channel time difference of the previous frame and the fourth alignment processing length, and the fourth processing length is greater than the fourth alignment processing length.

[0263] In this embodiment of the application, the fourth processing length may be the sum of the absolute value of the inter-channel time difference of the previous frame and the fourth alignment processing length. Furthermore, the start point of the signal of the fourth processing length is located before the start point of the signal of the fourth alignment processing length, and the length between the start point of the signal of the fourth processing length and the start point of the signal of the fourth alignment processing length is the absolute value of the inter-channel time difference of the previous frame.

[0264] It should be noted that the fourth alignment processing length may be a preset length, or may be determined in other manners, for example, according to equation (9). In this embodiment of this application, the fourth alignment processing length is equal to or less than the frame length of the current frame, and when the fourth alignment processing length is preset, the fourth alignment processing length may be any length equal to or less than L, L / 2, L / 3, or L.

[0265] In this embodiment of the application, the start point of the fourth alignment processing length signal may be located at the start point of the second channel signal of the current frame, or may be located after the start point of the second channel signal of the current frame, but in either case, the length between the start point of the fourth alignment processing length signal and the end point of the second channel signal of the current frame is equal to or greater than the fourth alignment processing length, which are described separately below.

[0266] First possible case:

[0267] Fig. 11 is a schematic diagram of stereo signal processing according to an embodiment of this application. In Fig. 11, for ease of explanation, a point in the second channel signal before delay recovery processing and a point in the second channel signal after compression processing at the same position are marked by using the same coordinates, but this does not mean that the signals of the points having the same coordinates are the same.

[0268] In FIG. 11, the frame length of the current frame is N, the start point of the second channel signal of the current frame is B4=0, and the end point of the second channel signal of the current frame is E4=N-1.

[0269] The start point of the fourth alignment processing length is located at the start point B4 of the second channel signal of the current frame, and the end point of the signal of the fourth alignment processing length is C4=B4+L2_pre_target-1. The start point of the signal of the fourth processing length is A4=B4-abs(prev_itd), and the end point of the signal of the fourth processing length is C4, which is the same as the coordinate of the start point of the signal of the fourth alignment processing length.

[0270] In the process of delay recovery processing, the fourth processing length signal starting from the start point of the fourth processing length signal may be compressed into a fourth alignment processing length signal, and the compressed signal of the fourth alignment processing length is used as the fourth alignment processing length signal starting from point B4 in the second channel signal after compression processing. Referring to Figure 11, the signal from point A4 to point C4 is compressed into a fourth alignment processing length signal, and the compressed signal of the fourth alignment processing length is used as the signal from point B4 to point C4 in the second channel signal after compression processing.

[0271] Then, the signal from point C4+1 to point E4 in the second channel signal of the current frame is used as the signal from point C4+1 to point E4 in the second channel signal after the compression process.

[0272] Finally, the signal of N points starting from the starting point B4 in the second channel signal after the compression process is used as the second channel signal of the current frame after the delay recovery process, i.e., the starting point of the second channel signal of the current frame after the delay alignment process is point B4 and the ending point is E4.

[0273] Second possible case:

[0274] Fig. 12 is a schematic diagram of stereo signal processing according to an embodiment of this application. In Fig. 12, for ease of explanation, a point in the second channel signal of the current frame before delay recovery processing and a point in the second channel signal of the current frame after compression processing at the same position are marked by using the same coordinates, but this does not mean that the signals of the points having the same coordinates are the same.

[0275] In FIG. 12, the frame length of the current frame is N, the start point of the first channel signal of the current frame is B4=0, and the end point of the first channel signal of the current frame is E4=N-1.

[0276] The start point of the fourth alignment processing length is D4, and the end point of the fourth alignment processing length signal is C4=D4+L2_pre_target-1. The start point D4 of the fourth alignment processing length signal is located after the start point B4 of the second channel signal of the current frame, and the length between the start point D4 of the fourth alignment processing length signal and the end point E4 of the second channel signal of the current frame is equal to or greater than the fourth alignment processing length.

[0277] For ease of explanation, the length between the start point D4 of the fourth alignment processing length signal and the start point B4 of the second channel signal of the current frame is a fourth preset length, and the fourth preset length is greater than 0 and less than or equal to the difference between the frame length of the current frame and the fourth alignment processing length.

[0278] The starting point of the fourth processing length signal is A4=D4-abs(prev_itd), and the ending point of the fourth processing length signal is C4, which is the same as the coordinates of the starting point of the fourth alignment processing length signal.

[0279] In FIG. 12, the length between points H4 and A4 is the fourth preset length, and the length between points H4 and B4 is the absolute value of the inter-channel time difference of the previous frame, i.e., H4=B4-abs(prev_itd).

[0280] In the process of delay recovery processing, the fourth preset length signal before the start point of the fourth processing length signal in the second channel signal of the current frame may be used as the fourth preset length signal starting from point B4 in the second channel signal after compression processing. Referring to Figure 12, the signal from point H4 to point A4-1 is used as the signal from point B4 to point D4-1 in the second channel signal after compression processing.

[0281] Then, the fourth processing length signal starting from the start point of the fourth processing length signal in the second channel signal of the current frame may be compressed into a fourth alignment processing length signal, and the compressed fourth alignment processing length signal is used as the fourth alignment processing length signal starting from the start point of the fourth alignment processing length signal in the second channel signal after the compression processing. Referring to Figure 12, the signal from point A4 to point C4 in the second channel signal of the current frame is compressed into a fourth alignment processing length signal, and the compressed fourth alignment processing length signal is used as the signal from point D4 to point C4 in the second channel signal after the compression processing.

[0282] Then, the uncompressed signal in the second channel signal of the current frame remains unchanged, i.e., the signal from point C4+1 to point E4 in the second channel signal of the current frame is used as the signal from point C4+1 to point E4 in the second channel signal after the compression process.

[0283] Finally, the signal of N points starting from the starting point B4 in the second channel signal after the compression process is used as the second channel signal of the current frame after the delayed recovery process.

[0284] The following provides an explanation by using specific embodiments.

[0285] Step 1: Determine the inter-channel time difference of the current frame based on the received codestream.

[0286] For the specific content of this step, refer to step 801. The details will not be described again here.

[0287] Step 2: If the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the previous frame, perform a delay recovery process on the first channel signal of the current frame based on the inter-channel time difference of the current frame.

[0288] Step 3: If the sign of the inter-channel time difference of the current frame is different from that of the previous frame, perform delay recovery processing on the second channel signal of the current frame based on the inter-channel time difference of the previous frame.

[0289] In step 2 and step 3, the length between the start point of the signal of the fourth alignment processing length and the start point of the second channel signal of the current frame is equal to the fourth preset length, and the length between the start point of the signal of the third alignment processing length and the start point of the first channel signal of the current frame is equal to the sum of the fourth preset length and the fourth alignment processing length. Furthermore, the third alignment processing length satisfies formula (8), and the fourth alignment processing length satisfies formula (9). In this case, as shown in FIG. 13, the signal of the third processing length is expanded, and the signal of the fourth processing length is compressed. In FIG. 13, an example in which the start point of the fourth alignment processing length is located at the start point of the first channel signal of the current frame is used for explanation. When the starting point of the fourth alignment processing length is located at another position, please refer to the description of the delay recovery processing performed on the second channel signal when the starting point of the fourth alignment processing length is located after the starting point B4 of the second channel signal of the current frame, and the description of the delay recovery processing performed on the first channel signal in this case, which will not be described in detail here.

[0290] In FIG. 13, the frame length of the current frame is N, the start point of the second channel signal of the current frame is B4=0, and the end point of the second channel signal of the current frame is E4=N-1. The start point of the signal of the fourth alignment processing length is located at the start point B4 of the second channel signal of the current frame, and the end point of the signal of the fourth alignment processing length is C4=B4+L2_pre_target-1. The start point of the signal of the fourth processing length is A4=B4-abs(prev_itd), and the end point of the signal of the fourth processing length is C4=B4+L2_pre_target-1.

[0291] The start point of the first channel signal of the current frame is B3=0, and the end point of the first channel signal of the current frame is E3=N-1. The start point of the signal of the third processing length is D3=B4+L2_pre_target, and D3=C4+1. The end point of the signal of the third processing length is C3=A3+L2_next_target-1, and the start point of the signal of the third processing length is A3=D3-abs(cur_itd), and the end point of the signal of the third processing length is C3=A3+L_next_target-1.

[0292] In the process of delay recovery processing, for the first channel signal, the signal from point B3 to point D3-1 in the first channel signal of the current frame is directly used as the signal from point H3 to point A3-1 in the first channel signal after expansion processing, and H3=A3-L2_pre_target.

[0293] Then, the signal from point D3 to point C3 in the first channel signal of the current frame is expanded to a signal of a third alignment processing length, and the expanded signal of the third alignment processing length is used as the signal from point A3 to point C3 in the first channel signal after the expansion processing.

[0294] Then, the signal from point C3+1 to point E3 in the first channel signal of the current frame is used as the signal from point C3+1 to point E3 in the first channel signal after the decompression process.

[0295] Finally, the signal of N points starting from the starting point A3 in the first channel signal after the extension process is used as the first channel signal of the current frame after the delay recovery process. The starting point of the first channel signal of the current frame after the delay recovery process is point A3, and the ending point is point G3, where G3=E3-abs(cur_itd).

[0296] In the process of delay recovery processing, for the second channel signal, the signal from point A4 to point C4 is compressed to a signal of a fourth alignment processing length, and the compressed signal of the fourth alignment processing length is used as the signal from point B4 to point C4 in the second channel signal after the compression processing.

[0297] Then, the signal from point C4+1 to point E4 in the second channel signal of the current frame is used as the signal from point C4+1 to point E4 in the second channel signal after the compression process.

[0298] Finally, the signal of N points starting from the starting point B4 in the second channel signal after the compression process is used as the second channel signal of the current frame after the delayed recovery process, i.e., the starting point of the second channel signal of the current frame after the delayed recovery process is point B4, and the ending point is point E4.

[0299] It should be noted that in this embodiment of this application, the method of expanding or compressing the signal is not limited. For details, please refer to the description in step 101 and step 102. The details will not be described again here.

[0300] In this embodiment of the application, when there is a transition interval length between frames, we refer to the above description, and the details are not described here.

[0301] Based on the same technical concept, an embodiment of this application further provides a stereo signal processing device, which may perform the steps of the method in FIG.

[0302] As shown in FIG. 14, an embodiment of this application provides a schematic structural diagram of a stereo signal processing device.

[0303] Referring to FIG. 14, a stereo signal processing apparatus 1400 includes: a delay estimation unit 1401 configured to perform delay estimation based on the stereo signal of the current frame to determine an inter-channel time difference of the current frame; a processing unit 1402 configured to perform a delay alignment process on a first channel signal of the current frame based on the inter-channel time difference of the current frame and a delay alignment process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame when it is determined that the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the previous frame, wherein the first channel signal is a target channel signal of the current frame, and the second channel signal is within the stereo signal of the current frame and is a target channel signal of the previous frame. signal A processing unit 1042 and Includes.

[0304] Optionally, the processing unit 1402 is Specifically configured to compress a signal of a first processing length in the first channel signal of the current frame into a signal of a first alignment processing length, so as to obtain a first channel signal of the current frame after the delay alignment processing; A first processing length is determined based on the inter-channel time difference of the current frame and the first alignment processing length, and the first processing length is greater than the first alignment processing length.

[0305] Optionally, the first processing length is the sum of the absolute value of the inter-channel time difference of the current frame and the first alignment processing length.

[0306] Optionally, the start point of the first processing length signal is located before the start point of the first alignment processing length signal, and the length between the start point of the first processing length signal and the start point of the first alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0307] Optionally, the starting point of the first alignment processing length signal is located at or after the starting point of the first channel signal of the current frame, and the length between the starting point of the first alignment processing length signal and the ending point of the first channel signal of the current frame is equal to or greater than the first alignment processing length.

[0308] Optionally, the start point of the signal of the first alignment processing length is located before the start point of the first channel signal of the current frame, and the length between the start point of the signal of the first alignment processing length and the start point of the first channel signal of the current frame is a transition section The length between the start of the first alignment processing length signal and the end of the first channel signal of the current frame is less than or equal to the first alignment processing length. section The sum of the length and the transition section Length is the absolute inter-channel time difference of the current frame. Value Below.

[0309] Optionally, the processing unit 1402 is Specifically configured to extend a signal of a second processing length in the second channel signal of the current frame to a signal of a second alignment processing length, so as to obtain a second channel signal of the current frame after the delay alignment processing; A second processing length is determined based on the inter-channel time difference of the previous frame and the second alignment processing length, and the second processing length is less than the second alignment processing length.

[0310] Optionally, the second processing length is the difference between the second alignment processing length and the absolute value of the inter-channel time difference of the previous frame.

[0311] Optionally, the start point of the second processing length signal is located after the start point of the second alignment processing length signal, and the length between the start point of the second processing length signal and the start point of the second alignment processing length signal is the absolute value of the inter-channel time difference of the previous frame.

[0312] Optionally, the starting point of the signal of the second alignment processing length is located at or after the starting point of the second channel signal of the current frame, and the length between the starting point of the signal of the second alignment processing length and the ending point of the second channel signal of the current frame is equal to or greater than the second alignment processing length.

[0313] Optionally, the length between the start point of the signal of the second alignment processing length and the start point of the second channel signal of the current frame is equal to a second preset length, and the length between the start point of the signal of the first alignment processing length and the start point of the first channel signal of the current frame is equal to the sum of the second preset length and the second alignment processing length.

[0314] Optionally, the first alignment processing length is less than or equal to a frame length of the current frame, the first alignment processing length is a preset length, or the first alignment processing length satisfies the following formula:

number

[0315] Optionally, the second alignment processing length is less than or equal to a frame length of the current frame; the second alignment processing length is a preset length; or the second alignment processing length satisfies the following formula:

number

[0316] Optionally, a processing length of the delay alignment process is less than or equal to a frame length of the current frame, the processing length of the delay alignment process is a preset length, or the processing length of the delay alignment process satisfies the following formula:

number

[0317] Based on the same technical concept, an embodiment of this application further provides a stereo signal processing device, which may perform the steps of the method in FIG.

[0318] As shown in FIG. 15, an embodiment of this application provides a schematic structural diagram of a stereo signal processing device.

[0319] Referring to FIG. 15, a stereo signal processing apparatus 1500 includes a processor 1501 and a memory 1502 .

[0320] The memory 1052 stores executable instructions that cause the processor 1501 to perform the following steps: performing delay estimation on the stereo signal of the current frame to determine an inter-channel time difference of the current frame, the inter-channel time difference of the current frame being a time difference between a first channel signal of the current frame and a second channel signal of the current frame; performing a delay alignment process on a first channel signal of the current frame based on the inter-channel time difference of the current frame when the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, and performing a delay alignment process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame, where the first channel signal is a target channel signal of the current frame and the second channel signal is on the same channel as the target channel signal of the previous frame; is used to command the

[0321] Optionally, the executable instructions, when performing a delay alignment process on the first channel signal of the current frame based on an inter-channel time difference of the current frame, cause the processor 1501 to perform the following steps: compressing a signal of a first processing length in the first channel signal of the current frame into a signal of a first alignment processing length to obtain a first channel signal of the current frame after the delay alignment processing; The first processing length is determined based on the inter-channel time difference of the current frame and the first alignment processing length, and the first processing length is greater than the first alignment processing length; is used to command the

[0322] Optionally, the first processing length is the sum of the absolute value of the inter-channel time difference of the current frame and the first alignment processing length.

[0323] Optionally, the start point of the first processing length signal is located before the start point of the first alignment processing length signal, and the length between the start point of the first processing length signal and the start point of the first alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0324] Optionally, the starting point of the first alignment processing length signal is located at or after the starting point of the first channel signal of the current frame, and the length between the starting point of the first alignment processing length signal and the ending point of the first channel signal of the current frame is equal to or greater than the first alignment processing length.

[0325] Optionally, the start point of the signal of the first alignment processing length is located before the start point of the first channel signal of the current frame, and the length between the start point of the signal of the first alignment processing length and the start point of the first channel signal of the current frame is a transition section The length between the start of the first alignment processing length signal and the end of the first channel signal of the current frame is less than or equal to the first alignment processing length. section The sum of the length and the transition section Length is the absolute inter-channel time difference of the current frame. Value Below.

[0326] Optionally, the executable instructions, when performing a delay alignment process on the second channel signal of the current frame based on the inter-channel time difference of the previous frame, cause the processor 1501 to perform the following steps: Extending a signal of a second processing length in the second channel signal of the current frame to a signal of a second alignment processing length to obtain a second channel signal of the current frame after the delay alignment processing; A second processing length is determined based on the inter-channel time difference of the previous frame and the second alignment processing length, and the second processing length is less than the second alignment processing length. is used to command the

[0327] Optionally, the second processing length is the difference between the second alignment processing length and the absolute value of the inter-channel time difference of the previous frame.

[0328] Optionally, the start point of the second processing length signal is located after the start point of the second alignment processing length signal, and the length between the start point of the second processing length signal and the start point of the second alignment processing length signal is the absolute value of the inter-channel time difference of the previous frame.

[0329] Optionally, the starting point of the signal of the second alignment processing length is located at or after the starting point of the second channel signal of the current frame, and the length between the starting point of the signal of the second alignment processing length and the ending point of the second channel signal of the current frame is equal to or greater than the second alignment processing length.

[0330] Optionally, the length between the start point of the signal of the second alignment processing length and the start point of the second channel signal of the current frame is equal to a second preset length, and the length between the start point of the signal of the first alignment processing length and the start point of the first channel signal of the current frame is equal to the sum of the second preset length and the second alignment processing length.

[0331] Optionally, the first alignment processing length is less than or equal to a frame length of the current frame, the first alignment processing length is a preset length, or the first alignment processing length satisfies the following formula:

number

[0332] Optionally, the second alignment processing length is less than or equal to a frame length of the current frame; the second alignment processing length is a preset length; or the second alignment processing length satisfies the following formula:

number

[0333] Optionally, a processing length of the delay alignment process is less than or equal to a frame length of the current frame, the processing length of the delay alignment process is a preset length, or the processing length of the delay alignment process satisfies the following formula:

number

[0334] Based on the same technical concept, an embodiment of this application further provides a stereo signal processing device, which may perform the steps of the method in FIG.

[0335] As shown in FIG. 16, an embodiment of this application provides a schematic structural diagram of a stereo signal processing device.

[0336] Referring to FIG. 16, a stereo signal processing apparatus 1600 includes: a transceiver unit 1601 configured to determine an inter-channel time difference of a current frame based on a received code stream; a processing unit 1602 configured to, when a sign of the inter-channel time difference of the current frame is different from a sign of the inter-channel time difference of the previous frame, perform a delay recovery process on a first channel signal of the current frame based on the inter-channel time difference of the current frame, and perform a delay recovery process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame, wherein the first channel signal is a target channel signal of the current frame, and the second channel signal is in the stereo signal of the current frame and is a target channel signal of the previous frame. signal A processing unit 1602 and Includes.

[0337] Optionally, the processing unit 1602 is Specifically configured to extend a signal of a third processing length in the first channel signal of the current frame to a signal of a third alignment processing length, so as to obtain a first channel signal of the current frame after a delay recovery processing; A third processing length is determined based on the inter-channel time difference of the current frame and the third alignment processing length, and the third processing length is less than the third alignment processing length.

[0338] Optionally, the third processing length is a difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame.

[0339] Optionally, the starting point of the third processing length signal is located after the starting point of the third alignment processing length signal, and the length between the starting point of the third processing length signal and the starting point of the third alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0340] Optionally, the starting point of the signal of the third processing length is located at or after the starting point of the first channel signal of the current frame, and the length between the starting point of the signal of the third processing length and the ending point of the first channel signal of the current frame is greater than or equal to the difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame.

[0341] Optionally, the processing unit 1602 is Specifically configured to compress a signal of a fourth processing length in the second channel signal of the current frame into a signal of a fourth alignment processing length, so as to obtain a second channel signal of the current frame after a delay recovery processing; The fourth processing length is determined based on the inter-channel time difference of the previous frame and the fourth alignment processing length, and the fourth processing length is greater than the fourth alignment processing length.

[0342] Optionally, the fourth processing length is the sum of the absolute value of the inter-channel time difference of the previous frame and the fourth alignment processing length.

[0343] Optionally, the starting point of the fourth processing length signal is located before the starting point of the fourth alignment processing length signal, and the length between the starting point of the fourth processing length signal and the starting point of the fourth alignment processing length signal is the absolute value of the inter-channel time difference of the previous frame.

[0344] Optionally, the starting point of the signal of the fourth alignment processing length is located at or after the starting point of the second channel signal of the current frame, and the length between the starting point of the signal of the fourth alignment processing length and the ending point of the second channel signal of the current frame is equal to or greater than the fourth alignment processing length.

[0345] Optionally, the length between the start point of the signal of the fourth alignment processing length and the start point of the second channel signal of the current frame is equal to a fourth preset length, and the length between the start point of the signal of the third alignment processing length and the start point of the first channel signal of the current frame is equal to the sum of the fourth preset length and the fourth alignment processing length.

[0346] Optionally, the third alignment processing length is less than or equal to a frame length of the current frame; the third alignment processing length is a preset length; or the third alignment processing length satisfies the following formula:

number

[0347] Optionally, the fourth alignment processing length is less than or equal to a frame length of the current frame; the fourth alignment processing length is a preset length; or the fourth alignment processing length satisfies the following formula:

number

[0348] Optionally, a processing length of the delay alignment process is less than or equal to a frame length of the current frame, the processing length of the delay alignment process is a preset length, or the processing length of the delay alignment process satisfies the following formula:

number

[0349] Based on the same technical concept, an embodiment of this application further provides a stereo signal processing device, which may perform the steps of the method in FIG.

[0350] As shown in FIG. 17, an embodiment of this application provides a schematic structural diagram of a stereo signal processing device.

[0351] Referring to FIG. 17, a stereo signal processing apparatus 1700 includes a processor 1701 and a memory 1702 .

[0352] The memory 1702 stores executable instructions that cause the processor 1701 to perform the following steps: determining an inter-channel time difference of a current frame based on the received codestream, where the inter-channel time difference of the current frame is a time difference between a first channel signal of the current frame and a second channel signal of the current frame; performing a delay recovery process on a first channel signal of the current frame based on the inter-channel time difference of the current frame when the sign of the inter-channel time difference of the current frame is different from the sign of the inter-channel time difference of the frame previous to the current frame, and performing a delay recovery process on a second channel signal of the current frame based on the inter-channel time difference of the previous frame, where the first channel signal is a target channel signal of the current frame and the second channel signal is on the same channel as the target channel signal of the previous frame; is used to command the

[0353] Optionally, the executable instructions, when performing delay recovery processing on the first channel signal of the current frame based on an inter-channel time difference of the current frame, cause the processor 1701 to perform the following steps: Extending a signal of a third processing length in the first channel signal of the current frame to a signal of a third alignment processing length to obtain a first channel signal of the current frame after the delay recovery processing; A third processing length is determined based on the inter-channel time difference of the current frame and a third alignment processing length, and the third processing length is less than the third alignment processing length. is used to command the

[0354] Optionally, the third processing length is a difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame.

[0355] Optionally, the starting point of the third processing length signal is located after the starting point of the third alignment processing length signal, and the length between the starting point of the third processing length signal and the starting point of the third alignment processing length signal is the absolute value of the inter-channel time difference of the current frame.

[0356] Optionally, the starting point of the signal of the third processing length is located at or after the starting point of the first channel signal of the current frame, and the length between the starting point of the signal of the third processing length and the ending point of the first channel signal of the current frame is greater than or equal to the difference between the third alignment processing length and the absolute value of the inter-channel time difference of the current frame.

[0357] Optionally, the executable instructions, when performing delay recovery processing on the second channel signal of the current frame based on the inter-channel time difference of the previous frame, cause the processor 1701 to perform the following steps: compressing a signal of a fourth processing length in the second channel signal of the current frame into a signal of a fourth alignment processing length to obtain a second channel signal of the current frame after a delay recovery processing; The fourth processing length is determined based on the inter-channel time difference of the previous frame and the fourth alignment processing length, and the fourth processing length is greater than the fourth alignment processing length; step is used to command the

[0358] Optionally, the fourth processing length is the sum of the absolute value of the inter-channel time difference of the previous frame and the fourth alignment processing length.

[0359] Optionally, the starting point of the fourth processing length signal is located before the starting point of the fourth alignment processing length signal, and the length between the starting point of the fourth processing length signal and the starting point of the fourth alignment processing length signal is the absolute value of the inter-channel time difference of the previous frame.

[0360] Optionally, the starting point of the signal of the fourth alignment processing length is located at or after the starting point of the second channel signal of the current frame, and the length between the starting point of the signal of the fourth alignment processing length and the ending point of the second channel signal of the current frame is equal to or greater than the fourth alignment processing length.

[0361] Optionally, the length between the start point of the signal of the fourth alignment processing length and the start point of the second channel signal of the current frame is equal to a fourth preset length, and the length between the start point of the signal of the third alignment processing length and the start point of the first channel signal of the current frame is equal to the sum of the fourth preset length and the fourth alignment processing length.

[0362] An embodiment of the present application further provides a computer-readable storage medium configured to store computer software instructions to be executed by the above processor. The computer software instructions include a program to be executed by the above processor.

[0363] Those skilled in the art should understand that the embodiments of this application may be provided as a method, a system, or a computer program product. Thus, this application may take the form of a hardware-only embodiment, a software-only embodiment, or an embodiment having a combination of software and hardware. Furthermore, this application may take the form of a computer program product embodied on one or more computer-usable storage mediums (including, but not limited to, disk memory, optical memory, etc.) that contain computer-usable program code.

[0364] This application is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to this application. It should be understood that computer program instructions may be used to implement each process and / or each block in the flowcharts and / or block diagrams, and combinations of processes and / or blocks in the flowcharts and / or block diagrams. These computer program instructions may be provided to a processor of a general purpose computer, a special purpose computer, an embedded processor, or any other programmable data processing device to create a machine, whereby the instructions executed by the processor of the computer or any other programmable data processing device create an apparatus for implementing the specified functionality in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.

[0365] These computer program instructions may be stored in a computer readable memory that can instruct a computer or any other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory generate an artifact that includes an instruction apparatus that implements a particular function in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.

[0366] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application, and this application intends to cover these modifications and variations, provided that they fall within the scope of protection defined by the claims.

Claims

1. 1. A method for stereo signal processing, comprising the steps of: obtaining an inter-channel time difference (ITD) of a current frame based on a received bitstream, the ITD of the current frame being a time difference between a first channel signal of the current frame and a second channel signal of the current frame; performing a delay recovery process on the first channel signal of the current frame according to the ITD of the current frame when the code of the ITD of the current frame is different from the code of the ITD of the frame preceding the current frame; performing a delay recovery process on the second channel signal of the current frame based on the ITD of the previous frame when the code of the ITD of the current frame is different from the code of the ITD of the previous frame; 23. A stereo signal processing method comprising:

2. performing a delay recovery process on the first channel signal of the current frame according to the ITD of the current frame, Extending a signal of a third processing length in the first channel signal to a signal of a third alignment processing length to obtain the first channel signal of the current frame after a delay recovery process; 2. The stereo signal processing method of claim 1, wherein the third processing length is obtained based on the ITD of the current frame and the third alignment processing length, and the third processing length is less than the third alignment processing length.

3. The stereo signal processing method according to claim 2 , wherein the third processing length is a difference between the third alignment processing length and an absolute value of the ITD of the current frame.

4. 4. The stereo signal processing method of claim 3, wherein a starting point of the signal of the third processing length is located after a starting point of the signal of the third alignment processing length, and a length between the starting point of the signal of the third processing length and the starting point of the signal of the third alignment processing length is the absolute value of the ITD of the current frame.

5. 5. The stereo signal processing method of claim 4, wherein the starting point of the signal of the third processing length is located at or after the starting point of the first channel signal of the current frame, and a length between the starting point of the signal of the third processing length and an end point of the first channel signal of the current frame is greater than or equal to the difference between the third alignment processing length and the absolute value of the ITD of the current frame.

6. performing a delay recovery process on the second channel signal of the current frame based on the ITD of the previous frame, compressing a signal of a fourth processing length in the second channel signal to a signal of a fourth alignment processing length to obtain the second channel signal of the current frame after a delay recovery process; 6. The stereo signal processing method according to claim 1, wherein the fourth processing length is determined based on the ITD of the previous frame and the fourth alignment processing length, and the fourth processing length is greater than the fourth alignment processing length.

7. The stereo signal processing method according to claim 6 , wherein the fourth processing length is a sum of an absolute value of the ITD of the previous frame and the fourth alignment processing length.

8. 8. The stereo signal processing method of claim 7, wherein a starting point of the signal of the fourth processing length is located before a starting point of the signal of the fourth alignment processing length, and a length between the starting point of the signal of the fourth processing length and the starting point of the signal of the fourth alignment processing length is the absolute value of the ITD of the previous frame.

9. 9. The stereo signal processing method of claim 8, wherein the starting point of the signal of the fourth alignment processing length is located at or after the starting point of the second channel signal of the current frame, and a length between the starting point of the signal of the fourth alignment processing length and an end point of the second channel signal of the current frame is equal to or greater than the fourth alignment processing length.

10. 10. The stereo signal processing method according to claim 8 or 9, wherein a length between the starting point of the signal of the fourth alignment processing length and the starting point of the second channel signal of the current frame is equal to a fourth preset length, and a length between the starting point of the signal of a third alignment processing length and the starting point of the first channel signal of the current frame is equal to the sum of the fourth preset length and the fourth alignment processing length.

11. 1. A stereo signal processing apparatus comprising: At least one processor; one or more memories coupled to said at least one processor for storing programming instructions that are executed by said at least one processor to cause said apparatus to perform the method of any one of claims 1 to 10; 1. A stereo signal processing apparatus comprising:

12. A computer readable storage medium having a program recorded thereon, comprising: A computer-readable storage medium, the program causing a computer to carry out the method according to any one of claims 1 to 10.

13. A computer program arranged to cause a computer to carry out the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Apparatus and method for encoding multi-channel audio signals

    JP2010541007A

  • Encoding of a plurality of audio signals

    JP2018534625A

  • JPP6907341B

  • Stereo acoustic signal encoding apparatus, stereo acoustic signal decoding apparatus, and methods for the same

    WO2010084756A1