A joint stereo audio coding and decoding method and device
By coding stereo audio in LC3, the correlation between channels is used to solve the problem of excessive code rate during LC3 encoding, more efficient encoding is achieved, reducing interference and improving user experience.
Patent Information
- Application Number
- CN202210989905.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-08-18
AI Technical Summary
In the prior art, when LC3 encodes stereo audio, its code rate is twice that of mono, and it is impossible to use the correlation between channels to improve compression efficiency.
Using the joint stereo audio encoding method, the standard Bluetooth encoding steps are performed on the Bluetooth audio of the left and right channels, and the left channel spectral coefficient is obtained, and the joint encoding is obtained, and the joint encoding data is obtained, and the final according to the standard. The Bluetooth encoding step performs the remaining encoding step to obtain the code stream.
On the premise of ensuring sound quality, make full use of the correlation between stereo two channels to improve the efficiency of stereo encoding, reduce the code rate, save Bluetooth air bandwidth, reduce interference, and improve user experience.
Smart Images

Figure CN115346540B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio coding and decoding technology, and in particular to a joint stereo audio coding method and device, and a joint stereo audio decoding method and device. Background Art
[0002] In mobile communication systems, in order to effectively utilize radio wave resources, it is required to compress voice signals to a low bit rate for transmission. On the other hand, it is also desired to improve the quality of voice calls and realize call services with a high sense of presence. To achieve this, it is desired to perform high-quality encoding not only for monaural signals but also for multi-channel audio signals, especially stereo audio signals.
[0003] As a method for encoding a stereo signal at a low bit rate, the intensity stereo method is known. In the intensity stereo method, a method is adopted in which a monaural signal is multiplied by a scaling coefficient to generate an L channel signal (left channel signal) and an R channel signal (right channel signal). Such a method is also called amplitude panning. The most basic method of amplitude panning is a method of multiplying a monaural signal in the time domain by a gain coefficient for amplitude panning (panning gain coefficient) to obtain an L channel signal and an R channel signal. In addition, as another method, there is also a method of multiplying a monaural signal in the frequency domain by a panning gain coefficient for each frequency component (or each frequency group) to obtain an L channel signal and an R channel signal.
[0004] In addition, if the phase gain coefficient is used as a coding parameter of parametric stereo, scalable coding of stereo signals (mono-stereo scalable coding) can be achieved. On the other hand, in mobile communication systems, there is a technology of discontinuous transmission (DTX) for the effective use of radio wave resources. DTX is a technology that intermittently transmits information representing background noise at a very low bit rate when no voice is uttered. As a result, the average bit rate during calls can be reduced, and more mobile terminals can be accommodated in the same frequency band.
[0005] Based on the above, it can be known that in stereo coding technology, either independent coding of each channel or joint stereo coding can be adopted, and the latter coding method can improve compression efficiency compared to the former coding method because it utilizes the correlation between channels.
[0006] However, the current stereo encoding method in LC3 (Bluetooth Low Energy) is to encode each mono channel independently, that is, when a stereo signal is input into the encoder, it has two channels. Even if there is a strong correlation between the two channels, LC3 can only encode each channel independently and cannot use the correlation between channels to improve compression efficiency. This results in the bit rate of LC3 encoding stereo audio being twice that of mono. Summary of the invention
[0007] In view of the problem that the code rate of LC3 for stereo audio encoding in the prior art is twice that of mono, the present application mainly provides a joint stereo audio encoding method, device, joint stereo audio decoding method and device. In order to achieve the above purpose, a technical solution adopted by the present application is: to provide a joint stereo audio encoding method, which includes: encoding the Bluetooth audio of the left and right channels to the time domain noise shaping module according to the standard Bluetooth encoding steps, and obtaining the left channel spectral coefficients and the right channel spectral coefficients corresponding to the left and right channels respectively; jointly encoding the left channel spectral coefficients and the right channel spectral coefficients to obtain the left channel joint encoding data corresponding to the left channel and the right channel joint encoding data corresponding to the right channel; and performing the remaining encoding steps on the left channel joint encoding data and the right channel joint encoding data according to the standard Bluetooth encoding steps, respectively, to obtain the code streams corresponding to the left channel and the right channel.
[0008] Another technical solution adopted in the present application is: to provide a joint stereo audio encoding device, which includes: a module for encoding the Bluetooth audio of the left and right channels to the time domain noise shaping module according to the standard Bluetooth encoding steps, and obtaining the left channel spectral coefficients and the right channel spectral coefficients corresponding to the left and right channels respectively; a module for jointly encoding the left channel spectral coefficients and the right channel spectral coefficients to obtain the left channel joint encoding data corresponding to the left channel and the right channel joint encoding data corresponding to the right channel; and a module for performing the remaining encoding steps on the left channel joint encoding data and the right channel joint encoding data according to the standard Bluetooth encoding steps, and obtaining the code streams corresponding to the left channel and the right channel respectively.
[0009] Another technical solution adopted in the present application is: providing a joint stereo audio decoding method, which includes: decoding the code stream obtained by the joint stereo audio encoding method of scheme one to a global gain module according to the standard Bluetooth decoding steps, and obtaining the left channel decoded spectral coefficients and the right channel decoded spectral coefficients corresponding to the left and right channels respectively; performing joint stereo decoding on the left channel decoded spectral coefficients and the right channel decoded spectral coefficients to obtain left channel joint stereo decoding data corresponding to the left channel and right channel decoded encoding data corresponding to the right channel; and performing the remaining decoding steps on the left channel joint stereo decoding data and the right channel joint stereo decoding data according to the standard Bluetooth decoding steps to obtain the target audio corresponding to the left channel and the right channel respectively.
[0010] Another technical solution adopted in the present application is: to provide a joint stereo audio decoding device, which includes: a module for decoding the code stream obtained by the joint stereo audio encoding method of scheme one to a global gain module according to the standard Bluetooth decoding steps, and obtaining the left channel decoded spectral coefficients and the right channel decoded spectral coefficients corresponding to the left and right channels respectively; a module for performing joint stereo decoding on the left channel decoded spectral coefficients and the right channel decoded spectral coefficients, and obtaining the left channel joint stereo decoded data corresponding to the left channel and the right channel decoded encoded data corresponding to the right channel; and a module for performing the remaining decoding steps on the left channel joint stereo decoded data and the right channel joint stereo decoded data according to the standard Bluetooth decoding steps, and obtaining the target audio corresponding to the left channel and the right channel respectively.
[0011] Another technical solution adopted by the present application is: providing a computer-readable storage medium storing computer instructions, which are operated to execute the joint stereo audio encoding method in solution one or the joint stereo audio decoding method in solution three.
[0012] Another technical solution adopted in the present application is: providing a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores computer instructions that can be executed by the at least one processor, and the at least one processor operates the computer instructions to execute the joint stereo audio encoding method in solution one or the joint stereo audio decoding method in solution three.
[0013] The beneficial effects that can be achieved by the technical solution of the present application are: under the premise of ensuring the sound quality, the correlation between the two stereo channels is fully utilized to improve the efficiency of stereo encoding, which greatly reduces the bit rate, saves the Bluetooth air bandwidth, thereby reducing interference and improving the user experience; and the operation of the present solution is simple, and on the basis of standard specifications, it can be implemented by making full use of the existing information and supplemented by a small amount of calculation; it should be noted that the method provided by the present solution can be used for both low-power Bluetooth and classic Bluetooth. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0015] Figure 1 is a schematic diagram of an optional implementation of a joint stereo audio coding method of the present application;
[0016] Figure 2 A schematic diagram showing an optional example of a corresponding relationship between parameter configurations of a transmitting end and a receiving end in a joint stereo audio coding method of the present application;
[0017] Figure 3 A schematic diagram showing an optional example of a coding process of a joint stereo audio coding method of the present application;
[0018] Figure 4 is a schematic diagram of an optional implementation of a joint stereo audio encoding device of the present application;
[0019] Figure 5 is a schematic diagram of an optional implementation of a joint stereo audio decoding method of the present application;
[0020] Figure 6 A schematic diagram showing an optional example of a decoding process of a joint stereo audio decoding method of the present application;
[0021] Figure 7 It is a schematic diagram of an optional implementation of a joint stereo audio decoding device of the present application.
[0022] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0023] The preferred embodiments of the present application are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present application can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present application.
[0024] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0025] In stereo coding technology, either independent coding of each channel or joint stereo coding can be used. Compared with the former, the latter can improve compression efficiency because it utilizes the correlation between channels.
[0026] However, the current stereo encoding method in LC3 (Bluetooth Low Energy) is to encode each mono channel independently, that is, when a stereo signal is input into the encoder, it has two channels. Even if there is a strong correlation between the two channels, LC3 can only encode each channel independently and cannot use the correlation between channels to improve compression efficiency. This results in the bit rate of LC3 encoding stereo audio being twice that of mono.
[0027] In view of the problem that the code rate of LC3 for stereo audio encoding in the prior art is twice that of mono, the present application mainly provides a joint stereo audio encoding method, device, joint stereo audio decoding method and device. The method includes: encoding the Bluetooth audio of the left and right channels to the time domain noise shaping module according to the standard Bluetooth encoding steps, respectively, to obtain the left channel spectral coefficients and the right channel spectral coefficients corresponding to the left and right channels respectively; jointly encoding the left channel spectral coefficients and the right channel spectral coefficients to obtain the left channel joint encoding data corresponding to the left channel and the right channel joint encoding data corresponding to the right channel; and performing the remaining encoding steps on the left channel joint encoding data and the right channel joint encoding data according to the standard Bluetooth encoding steps, respectively, to obtain the code streams corresponding to the left channel and the right channel respectively.
[0028] Under the premise of ensuring the sound quality, the correlation between the two stereo channels is fully utilized to improve the efficiency of stereo coding, which greatly reduces the bit rate and saves the Bluetooth air bandwidth, thereby reducing interference and improving the user experience. In addition, this solution is simple to operate. Based on the standard specifications, it can be implemented by making full use of the existing information and supplemented by a small amount of calculation. It should be noted that the method provided by this solution can be used for both low-power Bluetooth and classic Bluetooth.
[0029] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The specific embodiments described below can be combined with each other to form new embodiments. The same or similar ideas or processes described in one embodiment may not be repeated in other embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0030] Figure 1 An optional implementation of a joint stereo audio coding method of the present application is shown.
[0031] exist Figure 1In the optional implementation shown, the joint stereo audio encoding method mainly includes step S101, encoding the Bluetooth audio of the left and right channels to the time domain noise shaping module according to the standard Bluetooth encoding steps, and obtaining the left channel spectral coefficients and the right channel spectral coefficients corresponding to the left and right channels respectively.
[0032] In this optional implementation, during the Bluetooth stereo encoding process, the encoder of the Bluetooth transmitter is used to perform low-delay improved discrete cosine transform, transform domain noise shaping and time domain noise shaping on the left channel audio data and the right channel audio data, respectively, to obtain frequency domain data corresponding to the left channel audio data and the right channel audio data, respectively; the audio data is directly converted into time-frequency using the low-delay improved discrete cosine transform module in the encoder of the Bluetooth transmitter itself, thereby providing the necessary basis for the subsequent joint encoding step in the frequency domain.
[0033] In an optional embodiment of the present application, before jointly encoding the left channel spectral coefficients and the right channel spectral coefficients to obtain the left channel joint encoded data corresponding to the left channel and the right channel joint encoded data corresponding to the right channel, it also includes: respectively extracting the configuration parameters of the Bluetooth transmitter and the Bluetooth receiver that have a Bluetooth matching relationship for the left and right channels; and jointly encoding the left channel spectral coefficients and the right channel spectral coefficients of the left and right channels corresponding to the configuration parameters that meet the encoding standard according to the relationship between the configuration parameters and the preset joint stereo encoding standard.
[0034] In this optional embodiment, parameter negotiation and configuration are performed on both the Bluetooth transmitter and the Bluetooth receiver, that is, when the application is started, the Bluetooth transmitter and the Bluetooth receiver perform the step of negotiating parameters, that is, judging whether the Bluetooth transmitter and the Bluetooth receiver can support joint stereo coding and decoding based on the parameters of the Bluetooth transmitter and the Bluetooth receiver; when the parameters of the Bluetooth transmitter and the Bluetooth receiver both meet the preset joint stereo coding standard, it indicates that the Bluetooth transmitter and the Bluetooth receiver support joint stereo coding and decoding, that is, the left channel spectral coefficients and the right channel spectral coefficients of the left and right channels are jointly encoded.
[0035] Figure 2 An optional example of the corresponding relationship between the parameter configurations of the transmitting end and the receiving end in a joint stereo audio coding method of the present application is shown.
[0036] according to Figure 2In the example shown, when music starts playing, the parameters are first negotiated between the Bluetooth transmitter and the Bluetooth receiver, that is, the audio format, sampling rate, and bit rate range are compared with the preset joint stereo encoding standard to determine whether the above parameters meet the preset joint stereo encoding standard, so as to find out whether the Bluetooth transmitter and the Bluetooth receiver support joint stereo encoding; if both the Bluetooth transmitter and the Bluetooth receiver support joint stereo, joint stereo encoding is selected at the Bluetooth transmitter and joint stereo decoding is selected at the Bluetooth receiver, otherwise, normal mode encoding and decoding are selected.
[0037] In an optional embodiment of the present application, the left channel spectral coefficients and the right channel spectral coefficients of the left and right channels corresponding to the configuration parameters that meet the encoding standard are jointly encoded, further including: setting an enable flag for the left channel spectral coefficients and the right channel spectral coefficients of the left and right channels corresponding to the configuration parameters that meet the encoding standard for each frame; and jointly encoding the left channel spectral coefficients and the right channel spectral coefficients with the enable flag.
[0038] In this optional embodiment, when judging whether to perform joint stereo encoding, each frame of audio data is judged, and joint stereo encoding is performed at the frame level; after the judgment, an enable flag is added to the frame of audio data as a flag that the frame meets the configuration parameters of the encoding standard, and at the subsequent Bluetooth receiving end, it is determined whether to perform joint stereo decoding based on whether the frame data has the enable flag, and there is no need to perform a second parameter judgment, thereby reducing the system's computational workload and improving computational efficiency.
[0039] In an optional example of the present application, when joint stereo coding is globally enabled, a bit indication is added to the output bitstream of each frame, located after the bitstream of time domain noise shaping, 1: indicates that the current frame is enabled, 0: indicates that the current frame is not enabled; the above bit can be written to the end of the side information (auxiliary information); wherein the Side information (auxiliary information) is part of the Bluetooth encoding output bitstream, mainly used to store some frame-level information, such as bandwidth, global gain and TNS activation flag.
[0040] exist Figure 1 In the optional implementation shown, the joint stereo audio encoding method further includes step S102, jointly encoding the left channel spectral coefficients and the right channel spectral coefficients to obtain left channel joint encoded data corresponding to the left channel and right channel joint encoded data corresponding to the right channel.
[0041] In this optional implementation, the left channel spectral coefficients and the right channel spectral coefficients with an enable flag are jointly encoded to obtain left channel joint encoded data corresponding to the left channel and right channel joint encoded data corresponding to the right channel, so that the compression efficiency of the encoding process is improved and the bit rate is reduced.
[0042] In an optional embodiment of the present application, the left channel spectral coefficients and the right channel spectral coefficients are jointly encoded to obtain left channel joint encoded data corresponding to the left channel and right channel joint encoded data corresponding to the right channel, further including: respectively calculating the flatness of the left channel spectral coefficients and the right channel spectral coefficients; comparing the spectral flatness difference between the left and right channels with a preset threshold value; when the spectral flatness difference is less than or equal to the preset threshold value, eliminating the redundancy corresponding to the spectral flatness difference to obtain the left channel joint encoded data and the right channel joint encoded data; wherein the spectral flatness difference and the redundancy are a pair of inversely proportional parameters, that is, the smaller the difference, the greater the redundancy.
[0043] In this optional embodiment, the joint stereo coding of this scheme is to calculate the flatness of the left channel spectral coefficient and the right channel spectral coefficient, and make a joint stereo decision according to the correlation between the flatness of the left channel and the right channel. When the two flatnesses are closer, the correlation between them is higher, that is, the redundancy between the two channels is more. The redundancy is eliminated by joint stereo processing to obtain the left channel joint coding data and the right channel joint coding data. Preferably, the flatness and redundancy are judged by a threshold value, wherein the threshold value can be in the range of 0.05 to 0.1.
[0044] In an optional example of the present application, the joint stereo decision formula is as follows:
[0045]
[0046] Where abs(k) is the spectral flatness difference, It is the flatness of the left channel, Pseudo_spec_flatness_Right is the flatness of the right channel, and Joint_stereo_threshold is the preset threshold value.
[0047] Calculate the difference between the left and right channel spectral coefficients. The calculation formula is as follows:
[0048]
[0049]
[0050] Among them, X f,Left-Joint (k) is the difference between the left and right channel spectral coefficients calculated based on the left channel, X f,Right-Joint (k) is the difference between the left and right channel spectral coefficients calculated based on the right channel, X f,Left (k) is the left channel spectral coefficient, X f,Right (k) is the right channel spectral coefficient, N E That is the number of effective coding spectral lines.
[0051] When the flatness difference of the spectrum coefficient is very small, most of its values are 0 or close to 0. When allocating the bit rate, a lower bit rate can be allocated to ensure the sound quality. For example, the total bit rate of two channels is 240kbps. The existing technology will evenly allocate 120kbps to each left and right channel. After joint stereo coding, the new left channel X f,Left-Joint You can continue to allocate 120kpbs, and the new right channel X f,Right-Joint Only a lower bit rate needs to be allocated, such as 64kbps or lower, which saves bit rate and thus saves air transmission bandwidth, reduces interference and improves user experience.
[0052] However, if the audio data of this frame cannot be encoded using joint stereo, the value is directly copied and assigned:
[0053] X f,Left-Joint (k) = X f,Left (k), k=0...N E -1
[0054] X f,Right-Joint (k) = X f,Right (k), k=0...N E -1
[0055] Among them, X f,Left-Joint (k) is the difference between the left and right channel spectral coefficients calculated based on the left channel, X f,Right-Joint (k) is the difference between the left and right channel spectral coefficients calculated based on the right channel, X f,Left (k) is the left channel spectral coefficient, X f,Right (k) is the right channel spectral coefficient, N E That is the number of effective coding spectral lines.
[0056] In an optional embodiment of the present application, respectively calculating the flatness of the left channel spectral coefficients and the right channel spectral coefficients, further includes: respectively calculating the pseudo-spectra of the left channel spectral coefficients and the right channel spectral coefficients to obtain the left channel pseudo-spectra corresponding to the left channel and the right channel pseudo-spectra corresponding to the right channel spectral coefficients; respectively calculating the flatness of the left channel pseudo-spectra and the right channel pseudo-spectra to obtain the left channel flatness and the right channel flatness.
[0057] In this optional embodiment, since this solution directly performs joint stereo encoding on the spectral coefficients before the low-delay improved inverse discrete cosine transform in the Bluetooth decoding process, the accuracy of the flatness calculated by directly using the spectral coefficients obtained by the low-delay improved discrete cosine transform is not very high, which makes it easy to cause misjudgment in the joint stereo judgment. Taking the sine wave as an example, the spectral coefficients obtained by discrete Fourier transform have a relatively accurate correspondence with the frequency of the sine wave, and the calculated flatness can more accurately express the gain of the frame of audio data; while the spectral coefficients obtained by low-delay improved discrete cosine transform have a deviation from the frequency of the sine wave, so the accuracy of the calculated flatness is not very high, so this solution adds a pseudo-spectrum calculation process, and then calculates the flatness of the pseudo-spectrum, so as to achieve a more accurate expression of the gain of the frame of audio data.
[0058] In an optional embodiment of the present application, flatness calculation is performed on the left channel pseudo spectrum and the right channel pseudo spectrum respectively to obtain the left channel flatness and the right channel flatness, further comprising: calculating the geometric mean of the left channel pseudo spectrum and the right channel pseudo spectrum respectively; calculating the arithmetic mean of the left channel pseudo spectrum and the right channel pseudo spectrum respectively; and obtaining the left channel flatness and the right channel flatness according to the geometric mean and the arithmetic mean.
[0059] In this optional embodiment, according to the left channel spectral coefficient and the right channel spectral coefficient obtained by the above-mentioned time domain noise shaping module, the pseudo spectrum of the left channel spectral coefficient and the right channel spectral coefficient is calculated, and the calculation formula is as follows:
[0060]
[0061] Where X(k) = 0, when k = -1 or N F hour
[0062] Among them, X pseudo (k) is the pseudo-spectrum of the spectral coefficient, X(k) is the spectral coefficient, N F This is the serial number of the spectral coefficient.
[0063] According to the pseudo spectrum obtained by the above calculation, the geometric mean of the pseudo spectrum is calculated, and the calculation formula is as follows:
[0064]
[0065] Among them, Psuedo_geo_mrean is the geometric mean, X pseudo (k) is the pseudo spectrum, N F This is the serial number of the spectral coefficient.
[0066] According to the pseudo spectrum obtained by the above calculation, the arithmetic mean of the pseudo spectrum is calculated, and the calculation formula is as follows:
[0067]
[0068] Among them, Psuedo_algo_mean is the arithmetic mean, X pseudo (k) is the pseudo spectrum, N F This is the serial number of the spectral coefficient.
[0069] The flatness of the left and right channels is calculated based on the geometric mean and arithmetic mean obtained by the above calculations. The calculation formula is as follows:
[0070]
[0071] Among them, Pseudo_spec_flatness is flatness, Psuedo_geo_mean is the geometric mean, and Psuedo_algo_mean is the arithmetic mean.
[0072] exist Figure 1 In the optional implementation shown, the joint stereo audio encoding method further includes step S103, performing the remaining encoding steps on the left channel joint encoding data and the right channel joint encoding data according to the standard Bluetooth encoding steps, to obtain the code streams corresponding to the left channel and the right channel respectively.
[0073] In this optional implementation, the remaining encoding steps are performed on the above-determined left channel joint encoding data and right channel joint encoding data until the bit stream encapsulation step obtains the bit stream corresponding to the joint stereo, and the bit stream is output to the Bluetooth receiving end.
[0074] Figure 3 An optional example of a coding process of a joint stereo audio coding method of the present application is shown.
[0075] At the Bluetooth transmitter, first, according to the standard encoding process, low-latency improved discrete cosine transform, transform domain noise shaping and time domain noise shaping are performed on the left channel audio data and the right channel audio data respectively to obtain the corresponding frequency domain data, and the left and right channels are jointly stereo encoded in the frequency domain to obtain the left channel joint encoded data and the right channel joint encoded data. Then, according to the standard encoding process, quantization, noise level estimation, arithmetic and residual coding, bit stream encapsulation and other steps are continued until the encoding is completed.
[0076] Figure 4 An optional implementation of a joint stereo audio encoding device of the present application is shown.
[0077] exist Figure 4In the optional implementation shown, the joint stereo audio encoding device mainly includes: a module for encoding the Bluetooth audio of the left and right channels according to the standard Bluetooth encoding steps to the time domain noise shaping module 401, and obtaining the left channel spectral coefficients and the right channel spectral coefficients corresponding to the left and right channels respectively; a module 402 for jointly encoding the left channel spectral coefficients and the right channel spectral coefficients to obtain the left channel joint encoding data corresponding to the left channel and the right channel joint encoding data corresponding to the right channel; and a module 403 for performing the remaining encoding steps on the left channel joint encoding data and the right channel joint encoding data according to the standard Bluetooth encoding steps, and obtaining the code streams corresponding to the left channel and the right channel respectively.
[0078] In an optional embodiment of the present application, each functional module in a joint stereo audio encoding device of the present application may be directly in hardware, in a software module executed by a processor, or in a combination of the two.
[0079] The software modules may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from and write information to the storage medium.
[0080] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, or any combination thereof. A general-purpose processor may be a microprocessor, but in an alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration. In an alternative, the storage medium may be integrated with the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside in a user terminal as discrete components.
[0081] The joint stereo audio encoding device provided in the present application can be used to execute the joint stereo audio encoding method described in any of the above embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0082] Figure 5 An optional implementation of a joint stereo audio decoding method of the present application is shown.
[0083] exist Figure 5 In the optional implementation manner shown, the joint stereo audio decoding method includes step S501, decoding the code stream obtained by the joint stereo audio encoding method to the global gain module according to the standard Bluetooth decoding steps, and obtaining the left channel decoded spectral coefficients and the right channel decoded spectral coefficients corresponding to the left and right channels respectively; step S502, performing joint stereo decoding on the left channel decoded spectral coefficients and the right channel decoded spectral coefficients to obtain the left channel joint stereo decoding data corresponding to the left channel and the right channel decoded encoding data corresponding to the right channel; and step S503, performing the remaining decoding steps on the left channel joint stereo decoding data and the right channel joint stereo decoding data according to the standard Bluetooth decoding steps, respectively, to obtain the target audio corresponding to the left channel and the right channel respectively.
[0084] In an optional embodiment of the present application, before performing joint stereo decoding on the left channel decoded spectral coefficients and the right channel decoded spectral coefficients to obtain left channel joint stereo decoded data corresponding to the left channel and right channel decoded encoded data corresponding to the right channel, it also includes: respectively detecting whether there are enable flags for the left channel decoded spectral coefficients and the right channel decoded spectral coefficients; and performing joint stereo decoding on the left channel decoded spectral coefficients and the right channel decoded spectral coefficients for which the enable flags exist.
[0085] In this optional embodiment, it is first determined whether there is an enable flag for the single-frame code stream received by the Bluetooth receiving end. When there is an enable flag or it can be enabled, it means that the frame code stream can be jointly stereo decoded, and the decoding formula is as follows:
[0086]
[0087]
[0088] Among them, That is the left channel joint stereo decoding data, is the decoded spectrum coefficient of the left channel, is the right channel decoded spectral coefficient, That is the right channel joint stereo decoding data, N E That is the number of effective coding spectral lines.
[0089] When there is no enable flag or it cannot be enabled, it means that the frame code stream cannot be decoded by joint stereo, and the frame frequency domain data is not processed. The decoding formula is as follows:
[0090]
[0091]
[0092] Among them, That is the left channel joint stereo decoding data, is the decoded spectrum coefficient of the left channel, is the right channel decoded spectral coefficient, That is the right channel joint stereo decoding data, N E That is the number of effective coding spectral lines.
[0093] Figure 6 An optional example of a decoding process of a joint stereo audio decoding method of the present application is shown.
[0094] At the Bluetooth receiving end, first, according to the standard decoding process, the left channel bitstream and the right channel bitstream are subjected to bitstream analysis, arithmetic and residual decoding, noise filling and global gain decoding steps, and the corresponding frequency domain data is obtained. The left and right channels are jointly stereo decoded in the frequency domain to obtain the left channel joint decoding data and the right channel joint decoding data. Then, according to the standard encoding process, time domain noise shaping decoding, transform domain noise shaping decoding, transform domain noise shaping decoding, low-delay improved inverse discrete cosine transform and other steps are continued until the decoding is completed.
[0095] The joint stereo audio decoding method provided in the present application can be used to execute the decoding method corresponding to the joint stereo audio encoding method described in any of the above embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0096] Figure 7 An optional implementation of a joint stereo audio decoding device of the present application is shown.
[0097] exist Figure 7In the optional implementation shown, the joint stereo audio decoding device mainly includes: a module 701 for decoding the code stream obtained by the joint stereo audio encoding method to a global gain module according to the standard Bluetooth decoding steps, and obtaining the left channel decoded spectral coefficients and the right channel decoded spectral coefficients corresponding to the left and right channels respectively; a module 702 for performing joint stereo decoding on the left channel decoded spectral coefficients and the right channel decoded spectral coefficients to obtain the left channel joint stereo decoded data corresponding to the left channel and the right channel decoded encoded data corresponding to the right channel; and a module 703 for performing the remaining decoding steps on the left channel joint stereo decoded data and the right channel joint stereo decoded data according to the standard Bluetooth decoding steps, and obtaining the target audio corresponding to the left channel and the right channel respectively.
[0098] The joint stereo audio decoding device provided in the present application can be used to execute the joint stereo audio encoding method or the joint stereo audio decoding method described in any of the above embodiments. Its implementation principles and technical effects are similar and will not be repeated here.
[0099] In another optional implementation of the present application, a computer-readable storage medium stores computer instructions, and the computer instructions are operated to execute the joint stereo audio encoding method or the joint stereo audio decoding method described in the above embodiments.
[0100] In an optional embodiment of the present application, a computer device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores computer instructions executable by the at least one processor, and the at least one processor operates the computer instructions to execute the joint stereo audio encoding method or the joint stereo audio decoding method described in the above embodiments.
[0101] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0102] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0103] The above description is only an embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structural transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A joint stereo audio coding method, characterized in that: include: Encode the Bluetooth audio of the left and right channels to the time domain noise shaping module according to the standard Bluetooth encoding steps, and obtain the left channel spectral coefficient and the right channel spectral coefficient corresponding to the left and right channels respectively; The left channel spectral coefficient and the right channel spectral coefficient are jointly encoded to obtain left channel joint encoded data corresponding to the left channel and right channel joint encoded data corresponding to the right channel; as well as The remaining encoding steps are performed on the left channel joint encoding data and the right channel joint encoding data respectively according to the standard Bluetooth encoding steps to obtain code streams corresponding to the left channel and the right channel respectively.
2. The joint stereo audio coding method according to claim 1, characterized in that: The step of jointly encoding the left channel spectral coefficients and the right channel spectral coefficients to obtain left channel jointly encoded data corresponding to the left channel and right channel jointly encoded data corresponding to the right channel further comprises: Calculating the flatness of the left channel spectral coefficient and the right channel spectral coefficient respectively; Comparing the spectral flatness difference between the left and right channels with a preset threshold value; When the spectral flatness difference is less than or equal to the preset threshold value, redundancy corresponding to the spectral flatness difference is eliminated to obtain the left channel joint coded data and the right channel joint coded data.
3. The joint stereo audio coding method according to claim 2, characterized in that: The respectively calculating the flatness of the left channel spectral coefficient and the right channel spectral coefficient further comprises: Calculating the pseudo-spectra of the left channel spectral coefficient and the right channel spectral coefficient respectively, and obtaining the left channel pseudo-spectra corresponding to the left channel and the right channel pseudo-spectra corresponding to the right channel spectral coefficient; Flatness calculation is performed on the left channel pseudo spectrum and the right channel pseudo spectrum respectively to obtain the left channel flatness and the right channel flatness.
4. The joint stereo audio coding method according to claim 3, characterized in that: The step of calculating the flatness of the left channel pseudo spectrum and the right channel pseudo spectrum respectively to obtain the left channel flatness and the right channel flatness further includes: Calculating the geometric mean of the left channel pseudo spectrum and the right channel pseudo spectrum respectively; Calculating the arithmetic mean of the left channel pseudo spectrum and the right channel pseudo spectrum respectively; The left channel flatness and the right channel flatness are obtained by calculation according to the geometric mean and the arithmetic mean.
5. The joint stereo audio coding method according to claim 1, characterized in that: Before jointly encoding the left channel spectral coefficients and the right channel spectral coefficients to obtain left channel jointly encoded data corresponding to the left channel and right channel jointly encoded data corresponding to the right channel, the method further includes: Respectively extracting configuration parameters of a Bluetooth transmitter and a Bluetooth receiver having a Bluetooth matching relationship between the left and right channels; According to the relationship between the configuration parameters and a preset joint stereo coding standard, the left channel spectral coefficients and the right channel spectral coefficients corresponding to the left and right channels of the configuration parameters that meet the coding standard are jointly encoded.
6. The joint stereo audio coding method according to claim 5, characterized in that: The jointly encoding the left channel spectral coefficient and the right channel spectral coefficient corresponding to the left and right channels of the configuration parameters conforming to the encoding standard further comprises: For each frame, the configuration parameters that meet the coding standard correspond to the left channel spectral coefficients and the right channel spectral coefficients of the left and right channels, setting an enable flag; The left channel spectral coefficient and the right channel spectral coefficient having the enable flag are jointly encoded.
7. A joint stereo audio decoding method, characterized in that: include: Decode the code stream obtained by the joint stereo audio encoding method according to claim 1 to a global gain module according to a standard Bluetooth decoding step, and obtain the left channel decoded spectral coefficients and the right channel decoded spectral coefficients corresponding to the left and right channels respectively; Performing joint stereo decoding on the left channel decoded spectral coefficients and the right channel decoded spectral coefficients to obtain left channel joint stereo decoded data corresponding to the left channel and right channel decoded coded data corresponding to the right channel; as well as The left channel joint stereo decoded data and the right channel joint stereo decoded data are respectively subjected to the remaining decoding steps according to the standard Bluetooth decoding steps to obtain the target audio corresponding to the left channel and the right channel respectively.
8. The joint stereo audio decoding method according to claim 7, characterized in that: Before performing joint stereo decoding on the left channel decoded spectral coefficients and the right channel decoded spectral coefficients to obtain left channel joint stereo decoded data corresponding to the left channel and right channel decoded coded data corresponding to the right channel, the method further includes: respectively detecting whether the left channel decoded spectral coefficient and the right channel decoded spectral coefficient have an enable flag; Joint stereo decoding is performed on the left channel decoded spectral coefficient and the right channel decoded spectral coefficient for which the enable flag exists.
9. A joint stereo audio coding device, characterized in that: include: A module for encoding the Bluetooth audio of the left and right channels into a time domain noise shaping module according to a standard Bluetooth encoding step, and obtaining a left channel spectral coefficient and a right channel spectral coefficient corresponding to the left and right channels respectively; A module for jointly encoding the left channel spectral coefficient and the right channel spectral coefficient to obtain left channel joint encoded data corresponding to the left channel and right channel joint encoded data corresponding to the right channel; as well as A module for performing the remaining encoding steps on the left channel joint encoding data and the right channel joint encoding data according to the standard Bluetooth encoding steps to obtain the code streams corresponding to the left channel and the right channel respectively.
10. A joint stereo audio decoding device, characterized in that: include: A module for decoding the code stream obtained by the joint stereo audio encoding method according to claim 1 into a global gain module according to a standard Bluetooth decoding step, and obtaining a left channel decoded spectral coefficient and a right channel decoded spectral coefficient corresponding to the left and right channels respectively; A module for performing joint stereo decoding on the left channel decoded spectral coefficients and the right channel decoded spectral coefficients to obtain left channel joint stereo decoded data corresponding to the left channel and right channel decoded coded data corresponding to the right channel; as well as A module for performing the remaining decoding steps on the left channel joint stereo decoded data and the right channel joint stereo decoded data according to the standard Bluetooth decoding steps to obtain the target audio corresponding to the left channel and the right channel respectively.
Citation Information
Patent Citations
Voice noise reduction method, device and system, medium and equipment
CN114743559A
Noise filling in multichannel audio coding
EP2830060A1