Method and apparatus for determining inter-channel time difference parameter

A method for determining an inter-channel time difference (ITD) parameter includes determining a reference parameter according to a time-domain signal on a first sound channel and a time-domain signal on a second sound channel, where the reference parameter corresponds to a sequence of obtaining the time-domain signal on the first sound channel and the time-domain signal on the second sound channel, determining a search range according to the reference parameter and a limiting value (Tmax), where the Tmax is determined according to a sampling rate of the time-domain signal on the first sound channel, and performing search processing within the search range based on a frequency-domain signal on the first sound channel and a frequency-domain signal on the second sound channel to determine a first ITD parameter corresponding to the first sound channel and the second sound channel.

TECHNICAL FIELD

The present disclosure relates to the audio processing field, and in particular, to a method and an apparatus for determining an inter-channel time difference (ITD) parameter.

BACKGROUND

Improvement in quality of life is accompanied with people's ever-increasing requirements for high-quality audio. Compared with mono audio, stereo audio provides sense of direction and sense of distribution of sound sources and can improve clarity and intelligibility of information, and is therefore highly favored by people.

Currently, there is a known technology for transmitting a stereo audio signal. An encoder converts a stereo signal into a mono audio signal and a parameter such as an ITD, separately encodes the mono audio signal and the parameter, and transmits an encoded mono audio signal and an encoded parameter to a decoder. After obtaining the mono audio signal, the decoder further restores the stereo signal according to the parameter such as the ITD. Therefore, low-bit and high-quality transmission of the stereo signal can be implemented.

In the foregoing technology, based on a sampling rate of a time-domain signal on mono audio, the encoder can determine a limiting value Tmaxof an ITD parameter at the sampling rate, and therefore may perform searching and calculation subband by subband within a range [−Tmax, Tmax] based on a frequency-domain signal, to obtain the ITD parameter.

However, the foregoing relatively large search range causes a large calculation amount in a process of determining an ITD parameter in a frequency domain in other approaches. Consequently, a performance requirement for an encoder increases, and processing efficiency is affected.

Therefore, a technology is expected to be provided such that a calculation amount in a process of searching for and calculating an ITD parameter can be reduced while accuracy of the ITD parameter is ensured.

SUMMARY

Embodiments of the present disclosure provide a method and an apparatus for determining an ITD parameter to reduce a calculation amount in a process of searching for and calculating an ITD parameter in a stereo encoding process.

According to a first aspect, a method for determining an ITD parameter is provided, where the method includes determining a reference parameter according to a time-domain signal on a first sound channel and a time-domain signal on a second sound channel, where the reference parameter corresponds to a sequence of obtaining the time-domain signal on the first sound channel and the time-domain signal on the second sound channel, and the time-domain signal on the first sound channel and the time-domain signal on the second sound channel correspond to a same time period, determining a search range according to the reference parameter and a limiting value Tmax, where the limiting value Tmaxis determined according to a sampling rate of the time-domain signal on the first sound channel, and the search range falls within [−Tmax, 0], or the search range falls within [0, Tmax], and performing search processing within the search range based on a frequency-domain signal on the first sound channel and a frequency-domain signal on the second sound channel to determine a first ITD parameter corresponding to the first sound channel and the second sound channel.

With reference to the first aspect, in a first implementation of the first aspect, determining the reference parameter according to a time-domain signal on a first sound channel and a time-domain signal on a second sound channel includes performing cross-correlation processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel to determine a first cross-correlation processing value and a second cross-correlation processing value, where the first cross-correlation processing value is a maximum function value, within a preset range, of a cross-correlation function of the time-domain signal on the first sound channel relative to the time-domain signal on the second sound channel, and the second cross-correlation processing value is a maximum function value, within the preset range, of a cross-correlation function of the time-domain signal on the second sound channel relative to the time-domain signal on the first sound channel, and determining the reference parameter according to a value relationship between the first cross-correlation processing value and the second cross-correlation processing value.

With reference to the first aspect and the foregoing implementation of the first aspect, in a second implementation of the first aspect, the reference parameter is an index value corresponding to a larger one of the first cross-correlation processing value and the second cross-correlation processing value, or an opposite number of the index value.

With reference to the first aspect and the foregoing implementation of the first aspect, in a third implementation of the first aspect, determining the reference parameter according to a time-domain signal on a first sound channel and a time-domain signal on a second sound channel includes performing peak detection processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel to determine a first index value and a second index value, where the first index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the first sound channel within a preset range, and the second index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the second sound channel within the preset range, and determining the reference parameter according to a value relationship between the first index value and the second index value.

With reference to the first aspect or any one of the foregoing implementations of the first aspect, in a fourth implementation of the first aspect, the method further includes performing smoothing processing on the first ITD parameter based on a second ITD parameter, where the first ITD parameter is an ITD parameter in a first time period, the second ITD parameter is a smoothed value of an ITD parameter in a second time period, and the second time period is before the first time period.

According to a second aspect, an apparatus for determining an ITD parameter is provided, where the apparatus includes a determining unit configured to determine a reference parameter according to a time-domain signal on a first sound channel and a time-domain signal on a second sound channel, where the reference parameter corresponds to a sequence of obtaining the time-domain signal on the first sound channel and the time-domain signal on the second sound channel, and the time-domain signal on the first sound channel and the time-domain signal on the second sound channel correspond to a same time period, and determine a search range according to the reference parameter and a limiting value Tmax, where the limiting value Tmaxis determined according to a sampling rate of the time-domain signal on the first sound channel, and the search range falls within [−Tmax, 0], or the search range falls within [0, Tmax], and a processing unit configured to perform search processing within the search range based on a frequency-domain signal on the first sound channel and a frequency-domain signal on the second sound channel to determine a first ITD parameter corresponding to the first sound channel and the second sound channel.

With reference to the second aspect, in a first implementation of the second aspect, the determining unit is further configured to perform cross-correlation processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel to determine a first cross-correlation processing value and a second cross-correlation processing value, and determine the reference parameter according to a value relationship between the first cross-correlation processing value and the second cross-correlation processing value, where the first cross-correlation processing value is a maximum function value, within a preset range, of a cross-correlation function of the time-domain signal on the first sound channel relative to the time-domain signal on the second sound channel, and the second cross-correlation processing value is a maximum function value, within the preset range, of a cross-correlation function of the time-domain signal on the second sound channel relative to the time-domain signal on the first sound channel.

With reference to the second aspect and the foregoing implementation of the second aspect, in a second implementation of the second aspect, the determining unit is further configured to determine an index value corresponding to a larger one of the first cross-correlation processing value and the second cross-correlation processing value or an opposite number of the index value as the reference parameter.

With reference to the second aspect and the foregoing implementation of the second aspect, in a third implementation of the second aspect, the determining unit is further configured to perform peak detection processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel to determine a first index value and a second index value, and determine the reference parameter according to a value relationship between the first index value and the second index value, where the first index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the first sound channel within a preset range, and the second index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the second sound channel within the preset range.

With reference to the second aspect or any one of the foregoing implementations of the second aspect, in a fourth implementation of the second aspect, the processing unit is further configured to perform smoothing processing on the first ITD parameter based on a second ITD parameter, where the first ITD parameter is an ITD parameter in a first time period, the second ITD parameter is a smoothed value of an ITD parameter in a second time period, and the second time period is before the first time period.

According to the method and the apparatus for determining an ITD parameter in the embodiments of the present disclosure, a reference parameter corresponding to a sequence of obtaining a time-domain signal on a first sound channel and a time-domain signal on a second sound channel is determined in a time domain, a search range can be determined based on the reference parameter, and search processing on a frequency-domain signal on the first sound channel and a frequency-domain signal on the second sound channel is performed within the search range in a frequency domain to determine an ITD parameter corresponding to the first sound channel and the second sound channel. In the embodiments of the present disclosure, the search range determined according to the reference parameter falls within [−Tmax, 0] or [0, Tmax], and is less than the other approaches search range [−Tmax, Tmax] such that searching and calculation amounts of the ITD parameter can be reduced, a performance requirement for an encoder is reduced, and processing efficiency of the encoder is improved.

DESCRIPTION OF EMBODIMENTS

FIG. 1is a schematic flowchart of a method100for determining an ITD parameter according to an embodiment of the present disclosure. The method100may be performed by an encoder device (or may be referred to as a transmit end device) for transmitting an audio signal. As shown inFIG. 1, the method100includes the following steps.

Step S110: Determine a reference parameter according to a time-domain signal on a first sound channel and a time-domain signal on a second sound channel, where the reference parameter corresponds to a sequence of obtaining the time-domain signal on the first sound channel and the time-domain signal on the second sound channel, and the time-domain signal on the first sound channel and the time-domain signal on the second sound channel correspond to a same time period.

Step S120: Determine a search range according to the reference parameter and a limiting value Tmax, where the limiting value Tmaxis determined according to a sampling rate of the time-domain signal on the first sound channel, and the search range falls within [−Tmax, 0], or the search range falls within [0, Tmax].

Step S130: Perform search processing within the search range based on a frequency-domain signal on the first sound channel and a frequency-domain signal on the second sound channel to determine a first ITD parameter corresponding to the first sound channel and the second sound channel.

The method100for determining an ITD parameter in this embodiment of the present disclosure may be applied to an audio system that has at least two sound channels. In the audio system, mono signals from the at least two sound channels (that is, including a first sound channel and a second sound channel) are synthesized into a stereo signal. For example, a mono signal from an audio-left channel (that is, an example of the first sound channel) and a mono signal from an audio-right channel (that is, an example of the second sound channel) are synthesized into a stereo signal.

A parametric stereo (PS) technology may be used as an example of a method for transmitting the stereo signal. In the technology, an encoder converts the stereo signal into a mono signal and a spatial perception parameter according to a spatial perception feature, and separately encodes the mono signal and the spatial perception parameter. After obtaining mono audio, a decoder further restores the stereo signal according to the spatial perception parameter. In the technology, low-bit and high-quality transmission of the stereo signal can be implemented. An ITD parameter is a spatial perception parameter indicating a horizontal location of a sound source, and is an important part of the spatial perception parameter. This embodiment of the present disclosure is mainly related to a process of determining the ITD parameter. In addition, in this embodiment of the present disclosure, a process of encoding and decoding the stereo signal and the mono signal according to the ITD parameter is similar to that in the other approaches. To avoid repetition, a detailed description thereof is omitted herein.

It should be understood that the foregoing quantity of sound channels included in the audio system is merely an example for description, and the present disclosure is not limited thereto. For example, the audio system may have three or more sound channels, and mono signals from any two sound channels can be synthesized into a stereo signal. For ease of understanding, in an example for description below, the method100is applied to an audio system that has two sound channels (that is, an audio-left channel and an audio-right channel). In addition, for ease of differentiation, the audio-left channel is used as the first sound channel, and the audio-right channel is used as the second sound channel for description.

Further, in step S110, the encoder device may obtain, for example, using an audio input device such as a microphone corresponding to the audio-left channel, an audio signal corresponding to the audio-left channel, and perform sampling processing on the audio signal according to a preset sampling rate α (that is, an example of the sampling rate of the time-domain signal on the first sound channel) to generate a time-domain signal on the audio-left channel (that is, an example of the time-domain signal on the first sound channel, and denoted as a time-domain signal #L below for ease of understanding and differentiation). In addition, in this embodiment of the present disclosure, a process of obtaining the time-domain signal #L may be similar to that in the other approaches. To avoid repetition, a detailed description thereof is omitted herein.

In this embodiment of the present disclosure, the sampling rate of the time-domain signal on the first sound channel is the same as a sampling rate of the time-domain signal on the second sound channel. Therefore, similarly, the encoder device may obtain, for example, using an audio input device such as a microphone corresponding to the audio-right channel, an audio signal corresponding to the audio-right channel, and perform sampling processing on the audio signal according to the sampling rate α, to generate a time-domain signal on the audio-right channel (that is, an example of the time-domain signal on the second sound channel, and denoted as a time-domain signal #R below for ease of understanding and differentiation).

It should be noted that in this embodiment of the present disclosure, the time-domain signal #L and the time-domain signal #R are time-domain signals corresponding to a same time period (or in other words, time-domain signals obtained in a same time period). For example, the time-domain signal #L and the time-domain signal #R may be time-domain signals corresponding to a same frame (that is, 20 milliseconds (ms)). In this case, an ITD parameter corresponding to signals in the frame can be obtained based on the time-domain signal #L and the time-domain signal #R.

For another example, the time-domain signal #L and the time-domain signal #R may be time-domain signals corresponding to a same subframe (that is, 10 ms, 5 ms, or the like) in a same frame. In this case, multiple ITD parameters corresponding to signals in the frame can be obtained based on the time-domain signal #L and the time-domain signal #R. For example, if a subframe corresponding to the time-domain signal #L and the time-domain signal #R is 10 ms, two ITD parameters can be obtained using signals in the frame (that is, 20 ms). For another example, if a subframe corresponding to the time-domain signal #L and the time-domain signal #R is 5 ms, four ITD parameters can be obtained using signals in the frame (that is, 20 ms).

It should be understood that the foregoing lengths of the time period corresponding to the time-domain signal #L and the time-domain signal #R are merely examples for description, and the present disclosure is not limited thereto. A length of the time period may be randomly changed according to a requirement.

Then, the encoder device may determine the reference parameter according to the time-domain signal #L and the time-domain signal #R. The reference parameter may be corresponding to a sequence of obtaining the time-domain signal #L and the time-domain signal #R (for example, a sequence of inputting the time-domain signal #L and the time-domain signal #R into the audio input device). Subsequently, the correspondence is described in detail with reference to a process of determining the reference parameter.

In this embodiment of the present disclosure, the reference parameter may be determined by performing cross-correlation processing on the time-domain signal #L and the time-domain signal #R (that is, in a manner 1), or the reference parameter may be determined by searching for maximum amplitude values of the time-domain signal #L and the time-domain signal #R (that is, in a manner 2). The following separately describes the manner 1 and the manner 2 in detail.

Optionally, determining the reference parameter according to a time-domain signal on a first sound channel and a time-domain signal on a second sound channel includes performing cross-correlation processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel to determine a first cross-correlation processing value and a second cross-correlation processing value, where the first cross-correlation processing value is a maximum function value, within a preset range, of a cross-correlation function of the time-domain signal on the first sound channel relative to the time-domain signal on the second sound channel, and the second cross-correlation processing value is a maximum function value, within the preset range, of a cross-correlation function of the time-domain signal on the second sound channel relative to the time-domain signal on the first sound channel, and determining the reference parameter according to a value relationship between the first cross-correlation processing value and the second cross-correlation processing value.

Further, in this embodiment of the present disclosure, the encoder device may determine, according to the following formula 1, a cross-correlation function cn(i) of the time-domain signal #L relative to the time-domain signal #R, that is:

Tmaxindicates a limiting value of the ITD parameter (or in other words, a maximum value of an obtaining time difference between the time-domain signal #L and the time-domain signal #R), and may be determined according to the sampling rate α. In addition, a method for determining Tmaxmay be similar to that in the other approaches. To avoid repetition, a detailed description thereof is omitted herein. xR(j) indicates a signal value of the time-domain signal #R at a jthsampling point, xL(j+i) indicates a signal value of the time-domain signal #L at a (j+i)thsampling point, and Length indicates a total quantity of sampling points included in the time-domain signal #R, or in other words, a length of the time-domain signal #R. For example, the length may be a length of a frame (that is, 20 ms), or a length of a subframe (that is, 10 ms, 5 ms, or the like).

In addition, the encoder device may determine a maximum value

max0≤i≤Tmax⁢(cn⁡(i))
of the cross-correlation function cn(i).

Similarly, the encoder device may determine, according to the following formula 2, a cross-correlation function cp(i) of the time-domain signal #R relative to the time-domain signal #L, that is:

In addition, the encoder device may determine a maximum value

max0≤i≤Tmax⁢(cp⁡(i))
of the cross-correlation function cp(i).

In this embodiment of the present disclosure, the encoder device may determine a value of the reference parameter according to a relationship between

max0≤i≤Tmax⁢(cn⁡(i))andmax0≤i≤Tmax⁢(cp⁡(i))
in the following manner 1A or manner 1B.

As shown inFIG. 2, determine a cross-correlation function cn(i) of a time-domain signal #L relative to a time-domain signal #R and a cross-correlation function cp(i) of the time-domain signal #R relative to the time-domain signal #L.

Further, as shown inFIG. 2, if

max0≤i≤Tmax⁢(cn⁡(i))≤max0≤i≤Tmax⁢(cp⁡(i)),
the encoder device may determine that the time-domain signal #L is obtained before the time-domain signal #R, that is, the ITD parameter of the audio-left channel and the audio-right channel is a positive number. In this case, the reference parameter T may be set to 1.

Therefore, in a determining process of step S120, the encoder device may determine that the reference parameter is greater than 0, and further determine that the search range is [0, Tmax]. That is, when the time-domain signal #L is obtained before the time-domain signal #R, the ITD parameter is a positive number, and the search range is [0, Tmax] (that is, an example of the search range that falls within [0, Tmax]).

Alternatively, if

max0≤i≤Tmax⁢(cn⁡(i))>max0≤i≤Tmax⁢(cp⁡(i)),
the encoder device may determine that the time-domain signal #L is obtained after the time-domain signal #R, that is, the ITD parameter of the audio-left channel and the audio-right channel is a negative number. In this case, the reference parameter T may be set to 0.

Therefore, in a determining process of step S120, the encoder device may determine that the reference parameter is not greater than 0, and further determine that the search range is [−Tmax, 0]. That is, when the time-domain signal #L is obtained after the time-domain signal #R, the ITD parameter is a negative number, and the search range is [−Tmax, 0] (that is, an example of the search range that falls within [−Tmax, 0]).

Optionally, the reference parameter is an index value corresponding to a larger one of the first cross-correlation processing value and the second cross-correlation processing value, or an opposite number of the index value.

As shown inFIG. 3, determine a cross-correlation function cn(i) of a time-domain signal #L relative to a time-domain signal #R and a cross-correlation function cp(i) of the time-domain signal #R relative to the time-domain signal #L.

Further, as shown inFIG. 3, if

max0≤i≤Tmax⁢(cn⁡(i))≤max0≤i≤Tmax⁢(cp⁡(i)),
the encoder device may determine that the time-domain signal #L is obtained before the time-domain signal #R, that is, the ITD parameter of the audio-left channel and the audio-right channel is a positive number. In this case, the reference parameter T may be set to an index value corresponding to

Therefore, in a subsequent determining process, after determining that the reference parameter T is greater than 0, the encoder device may further determine whether the reference parameter T is greater than or equal to Tmax/2, and determine the search range according to a determining result. For example, when T≥Tmax/2, the search range is [Tmax/2, Tmax] (that is, an example of the search range that falls within [0, Tmax]. When T<Tmax/2, the search range is [0, Tmax/2] (that is, another example of the search range that falls within [0, Tmax]).

Alternatively, if

max0≤i≤Tmax⁢(cn⁡(i))>max0≤i≤Tmax⁢(cp⁡(i)),
the encoder device may determine that the time-domain signal #L is obtained after the time-domain signal #R, that is, the ITD parameter of the audio-left channel and the audio-right channel is a negative number. In this case, the reference parameter T may be set to an opposite number of an index value corresponding to

Therefore, in a determining process of step S120, after determining that the reference parameter T is less than or equal to 0, the encoder device may further determine whether the reference parameter T is less than or equal to −Tmax/2, and determine the search range according to a determining result. For example, when T≤−Tmax/2, the search range is [−Tmax, −Tmax/2] (that is, an example of the search range that falls within [−Tmax, 0]. When T>−Tmax/2, the search range is [−Tmax/2, 0] (that is, another example of the search range that falls within [−Tmax, 0].

Optionally, determining the reference parameter according to a time-domain signal on a first sound channel and a time-domain signal on a second sound channel includes performing peak detection processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel, to determine a first index value and a second index value, where the first index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the first sound channel within a preset range, and the second index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the second sound channel within the preset range, and determining the reference parameter according to a value relationship between the first index value and the second index value.

Further, in this embodiment of the present disclosure, the encoder device may detect a maximum value max(L(j)), j∈[0, Length−1] of an amplitude value (denoted as L(j)) of the time-domain signal #L, and record an index value pleftcorresponding to max(L(j)). Length indicates a total quantity of sampling points included in the time-domain signal #L.

In addition, the encoder device may detect a maximum value max(R(j)), j∈[0, Length−1] of an amplitude value (denoted as R(j)) of the time-domain signal #R, and record an index value prightcorresponding to max(R(j)). Length indicates a total quantity of sampling points included in the time-domain signal #R.

Then, the encoder device may determine a value relationship between pleftand pright.

As shown inFIG. 4, determine an index value Pleftcorresponding to a detected maximum value of an amplitude value of a time-domain signal #L and an index value Prightcorresponding to a detected maximum value of an amplitude value of a time-domain signal #R.

Further, as shown inFIG. 4, if pleft≥pright, the encoder device may determine that the time-domain signal #L is obtained before the time-domain signal #R, that is, the ITD parameter of the audio-left channel and the audio-right channel is a positive number. In this case, the reference parameter T may be set to 1.

Therefore, in a determining process of step S120, the encoder device may determine that the reference parameter is greater than 0, and further determine that the search range is [0, Tmax]. That is, when the time-domain signal #L is obtained before the time-domain signal #R, the ITD parameter is a positive number, and the search range is [0, Tmax] (that is, an example of the search range that falls within [0, Tmax]).

Alternatively, if pleft<pright, the encoder device may determine that the time-domain signal #L is obtained after the time-domain signal #R, that is, the ITD parameter of the audio-left channel and the audio-right channel is a negative number. In this case, the reference parameter T may be set to 0.

Therefore, in a determining process of S120, the encoder device may determine that the reference parameter is not greater than 0, and further determine that the search range is [−Tmax, 0]. That is, when the time-domain signal #L is obtained after the time-domain signal #R, the ITD parameter is a negative number, and the search range is [−Tmax, 0] (that is, an example of the search range that falls within [−Tmax, 0]).

In step S130, the encoder device may perform time-to-frequency transformation processing on the time-domain signal #L to obtain a frequency-domain signal on the audio-left channel (that is, an example of the frequency-domain signal on the first sound channel, and denoted as a frequency-domain signal #L below for ease of understanding and differentiation), and may perform time-to-frequency transformation processing on the time-domain signal #R to obtain a frequency-domain signal on the audio-right channel (that is, an example of the frequency-domain signal on the second sound channel, and denoted as a frequency-domain signal #R below for ease of understanding and differentiation).

For example, in this embodiment of the present disclosure, the time-to-frequency transformation processing may be performed using a Fast Fourier Transformation (FFT) technology based on the following formula 3:

X(k) indicates a frequency-domain signal, FFT_LENGTH indicates a time-to-frequency transformation length, x(n) indicates a time-domain signal (that is, the time-domain signal #L or the time-domain signal #R), and Length indicates a total quantity of sampling points included in the time-domain signal.

It should be understood that the foregoing process of the time-to-frequency transformation processing is merely an example for description, and the present disclosure is not limited thereto. A method and a process of the time-to-frequency transformation processing may be similar to those in the other approaches. For example, a technology such as modified discrete cosine transform (MDCT) may be used.

Therefore, the encoder device may perform search processing on the determined frequency-domain signal #L and frequency-domain signal #R within the determined search range, to determine the ITD parameter of the audio-left channel and the audio-right channel. For example, the following search processing process may be used.

First, the encoder device may classify FFT_LENGTH frequencies of a frequency-domain signal into Nsubbandsubbands (for example, one subband) according to preset bandwidth A. A frequency included in a kthsubband Akmeets Ak−1≤b≤Ak−1.

Within the foregoing search range, a correlation function mag(j) of the frequency-domain signal #L is calculated according to the following formula 4:

XL(b) indicates a signal value of the frequency-domain signal #L on a bthfrequency, XR(b) indicates a signal value of the frequency-domain signal #R on the bthfrequency, FFT_LENGTH indicates a time-to-frequency transformation length, and a value range of j is the determined search range. For ease of understanding and description, the search range is denoted as [a, b].

An ITD parameter value of the kthsubband is

T⁡(k)=argmaxa≤j≤b⁡(mag⁡(j)),
that is, an index value corresponding to a maximum value of mag(j).

Therefore, one or more (corresponding to the determined quantity of subbands) ITD parameter values of the audio-left channel and the audio-right channel may be obtained.

Then, the encoder device may further perform quantization processing and the like on the ITD parameter value, and send the processed ITD parameter value and a mono signal obtained after processing such as downmixing is performed on signals on the audio-left channel and the audio-right channel to a decoder device (or in other words, a receive end device).

The decoder device may restore a stereo audio signal according to the mono audio signal and the ITD parameter value.

Optionally, the method further includes performing smoothing process on the first ITD parameter based on a second ITD parameter, where the first ITD parameter is an ITD parameter in a first time period, the second ITD parameter is a smoothed value of an ITD parameter in a second time period, and the second time period is before the first time period.

Further, in this embodiment of the present disclosure, before performing quantization processing on the ITD parameter value, the encoder device may further perform smoothing processing on the determined ITD parameter value. As an example rather than a limitation, the encoder device may perform the smoothing processing according to the following formula 5:
Tsm(k)=w1*Tsm[−1](k)+w2*T(k)   formula 5.

Tsm(k) indicates an ITD parameter value on which smoothing processing has been performed and that corresponds to a kthframe or a kthsubframe, Tsm[−1]indicates an ITD parameter value on which smoothing processing has been performed and that corresponds to a (k−1)thframe or a (k−1)thsubframe, T(k) indicates an ITD parameter value on which smoothing processing has not been performed and that corresponds to the kthframe or the kthsubframe, w1and w2are smoothing factors, and w1and w2may be set to constants, or w1and w2may be set according to a difference between Tsm[−1]and T(k) provided that w1+w2=1 is met. In addition, when k=1, Tsm[−1]may be a preset value.

It should be noted that in the method for determining an ITD parameter in this embodiment of the present disclosure, the smoothing processing may be performed by the encoder device, or may be performed by the decoder device, and this is not particularly limited in the present disclosure. That is, the encoder device may directly send the obtained ITD parameter value to the decoder device without performing smoothing process, and the decoder device performs smoothing processing on the ITD parameter value. In addition, a method and a process of performing smoothing process by the decoder device may be similar to the foregoing method and process of performing smoothing process by the encoder device. To avoid repetition, a detailed description thereof is omitted herein.

According to the method for determining an ITD parameter in this embodiment of the present disclosure, a reference parameter corresponding to a sequence of obtaining a time-domain signal on a first sound channel and a time-domain signal on a second sound channel is determined in a time domain, a search range can be determined based on the reference parameter, and search processing on a frequency-domain signal on the first sound channel and a frequency-domain signal on the second sound channel is performed within the search range in a frequency domain to determine an ITD parameter corresponding to the first sound channel and the second sound channel. In this embodiment of the present disclosure, the search range determined according to the reference parameter falls within [−Tmax, 0] or [0, Tmax], and is less than the other approaches search range [−Tmax, Tmax] such that searching and calculation amounts of the ITD parameter can be reduced, a performance requirement for an encoder is reduced, and processing efficiency of the encoder is improved.

The method for determining an ITD parameter according to the embodiments of the present disclosure is described above in detail with reference toFIG. 1toFIG. 4. An apparatus for determining an ITD parameter according to an embodiment of the present disclosure is described below in detail with reference toFIG. 5.

FIG. 5is a schematic block diagram of an apparatus200for determining an ITD parameter according to an embodiment of the present disclosure. As shown inFIG. 5, the apparatus200includes a determining unit210configured to determine a reference parameter according to a time-domain signal on a first sound channel and a time-domain signal on a second sound channel, where the reference parameter corresponds to a sequence of obtaining the time-domain signal on the first sound channel and the time-domain signal on the second sound channel, and the time-domain signal on the first sound channel and the time-domain signal on the second sound channel correspond to a same time period, and determine a search range according to the reference parameter and a limiting value Tmax, where the limiting value Tmaxis determined according to a sampling rate of the time-domain signal on the first sound channel, and the search range falls within [−Tmax, 0], or the search range falls within [0, Tmax], and a processing unit220configured to perform search processing within the search range based on a frequency-domain signal on the first sound channel and a frequency-domain signal on the second sound channel, to determine a first ITD parameter corresponding to the first sound channel and the second sound channel.

Optionally, the determining unit210is further configured to perform cross-correlation processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel, to determine a first cross-correlation processing value and a second cross-correlation processing value, and determine the reference parameter according to a value relationship between the first cross-correlation processing value and the second cross-correlation processing value. The first cross-correlation processing value is a maximum function value, within a preset range, of a cross-correlation function of the time-domain signal on the first sound channel relative to the time-domain signal on the second sound channel, and the second cross-correlation processing value is a maximum function value, within the preset range, of a cross-correlation function of the time-domain signal on the second sound channel relative to the time-domain signal on the first sound channel.

Optionally, the determining unit210is further configured to determine an index value corresponding to a larger one of the first cross-correlation processing value and the second cross-correlation processing value or an opposite number of the index value as the reference parameter.

Optionally, the determining unit210is further configured to perform peak detection processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel, to determine a first index value and a second index value, and determine the reference parameter according to a value relationship between the first index value and the second index value. The first index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the first sound channel within a preset range, and the second index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the second sound channel within the preset range.

Optionally, the processing unit220is further configured to perform smoothing processing on the first ITD parameter based on a second ITD parameter. The first ITD parameter is an ITD parameter in a first time period, the second ITD parameter is a smoothed value of an ITD parameter in a second time period, and the second time period is before the first time period.

The apparatus200for determining an ITD parameter according to this embodiment of the present disclosure is configured to perform the method100for determining an ITD parameter in the embodiments of the present disclosure, and may be corresponding to the encoder device in the method in the embodiments of the present disclosure. In addition, units and modules in the apparatus200for determining an ITD parameter and the foregoing other operations and/or functions are separately intended to implement a corresponding procedure in the method100inFIG. 1. For brevity, details are not described herein.

According to the apparatus200for determining an ITD parameter in this embodiment of the present disclosure, a reference parameter corresponding to a sequence of obtaining a time-domain signal on a first sound channel and a time-domain signal on a second sound channel is determined in a time domain, a search range can be determined based on the reference parameter, and search processing on a frequency-domain signal on the first sound channel and a frequency-domain signal on the second sound channel is performed within the search range in a frequency domain, to determine an ITD parameter corresponding to the first sound channel and the second sound channel. In this embodiment of the present disclosure, the search range determined according to the reference parameter falls within [−Tmax, 0] or [0, Tmax], and is less than the other approaches search range [−Tmax, Tmax] such that searching and calculation amounts of the ITD parameter can be reduced, a performance requirement for an encoder is reduced, and processing efficiency of the encoder is improved.

The method for determining an ITD parameter according to the embodiments of the present disclosure is described above in detail with reference toFIG. 1toFIG. 4. A device for determining an ITD parameter according to an embodiment of the present disclosure is described below in detail with reference toFIG. 6.

FIG. 6is a schematic block diagram of a device300for determining an ITD parameter according to an embodiment of the present disclosure. As shown inFIG. 6, the device300may include a bus310, a processor320connected to the bus310, and a memory330connected to the bus310.

Optionally, the processor320is further configured to perform cross-correlation processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel to determine a first cross-correlation processing value and a second cross-correlation processing value, where the first cross-correlation processing value is a maximum function value, within a preset range, of a cross-correlation function of the time-domain signal on the first sound channel relative to the time-domain signal on the second sound channel, and the second cross-correlation processing value is a maximum function value, within the preset range, of a cross-correlation function of the time-domain signal on the second sound channel relative to the time-domain signal on the first sound channel, and determine the reference parameter according to a value relationship between the first cross-correlation processing value and the second cross-correlation processing value.

Optionally, the reference parameter is an index value corresponding to a larger one of the first cross-correlation processing value and the second cross-correlation processing value, or an opposite number of the index value.

Optionally, the processor320is further configured to perform peak detection processing on the time-domain signal on the first sound channel and the time-domain signal on the second sound channel to determine a first index value and a second index value, where the first index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the first sound channel within a preset range, and the second index value is an index value corresponding to a maximum amplitude value of the time-domain signal on the second sound channel within the preset range, and determine the reference parameter according to a value relationship between the first index value and the second index value.

Optionally, the processor320is further configured to perform smoothing process on the first ITD parameter based on a second ITD parameter, the first ITD parameter is an ITD parameter in a first time period, the second ITD parameter is a smoothed value of an ITD parameter in a second time period, and the second time period is before the first time period.

In this embodiment of the present disclosure, components of the device300are coupled together using the bus310. In addition to a data bus, the bus310further includes a power supply bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the bus310in theFIG. 6.

The processor320may implement or perform the steps and the logical block diagrams disclosed in the method embodiments of the present disclosure. The processor320may be a microprocessor, or the processor320may be any conventional processor or decoder, or the like. The steps of the methods disclosed with reference to the embodiments of the present disclosure may be directly performed and completed by means of a hardware processor, or may be performed and completed using a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the art, such as a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable ROM (PROM), an electrically-erasable PROM (EEPROM), or a register. The storage medium is located in the memory330, and the processor320reads information in the memory330and completes the steps in the foregoing methods in combination with hardware of the processor320.

It should be understood that in this embodiment of the present disclosure, the processor320may be a central processing unit (CPU), or the processor320may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), another programmable logical device, a discrete gate or a transistor logical device, a discrete hardware component, or the like. The general-purpose processor may be a microprocessor, or the processor320may be any conventional processor, or the like.

The memory330may include a ROM and a RAM, and provide an instruction and data for the processor320. A part of the memory330may further include a nonvolatile RAM (NVRAM). For example, the memory330may further store information about a device type.

In an implementation process, the steps in the foregoing methods may be completed by an integrated logic circuit of hardware in the processor320or an instruction in a form of software. The steps of the methods disclosed with reference to the embodiments of the present disclosure may be directly performed and completed by means of a hardware processor, or may be performed and completed using a combination of hardware and software modules in the processor. The software module may be located in a mature storage medium in the art, such as a RAM, a flash memory, a ROM, a PROM, an EEPROM, or a register.

The device300for determining an ITD parameter according to this embodiment of the present disclosure is configured to perform the method100for determining an ITD parameter in the embodiments of the present disclosure, and may correspond to the encoder device in the method in the embodiments of the present disclosure. In addition, units and modules in the device300for determining an ITD parameter and the foregoing other operations and/or functions are separately intended to implement a corresponding procedure in the method100inFIG. 1. For brevity, details are not described herein.

According to the device for determining an ITD parameter in this embodiment of the present disclosure, a reference parameter corresponding to a sequence of obtaining a time-domain signal on a first sound channel and a time-domain signal on a second sound channel is determined in a time domain, a search range can be determined based on the reference parameter, and search processing on a frequency-domain signal on the first sound channel and a frequency-domain signal on the second sound channel is performed within the search range in a frequency domain to determine an ITD parameter corresponding to the first sound channel and the second sound channel. In this embodiment of the present disclosure, the search range determined according to the reference parameter falls within [−Tmax, 0] or [0, Tmax], and is less than the other approaches search range [−Tmax, Tmax] such that searching and calculation amounts of the ITD parameter can be reduced, a performance requirement for an encoder is reduced, and processing efficiency of the encoder is improved.