Signal Processing Method and Device

0Associated
Cases 
0Associated
Defendants 
0Accused
Products 
0Forward
Citations 
0
Petitions 
1
Assignment
First Claim
1. An audio signal processing method implemented by an audio signal encoder, the audio signal processing method comprising:
 obtaining an analog audio signal;
converting the analog audio signal to a digital time domain audio signal;
transforming the digital time domain audio signal to a frequency domain audio signal, wherein a current frame of the frequency domain audio signal comprises a plurality of spectral coefficients, wherein each of N subbands of the current frame comprises at least one of the spectral coefficients, and wherein N is a positive integer greater than 1;
obtaining a total energy of M successive subbands of the N subbands;
determining a largest subband energy among the M successive subbands;
obtaining a total energy of K successive subbands of the N subbands, wherein the M successive subbands and the K successive subbands are separate, wherein M and K are positive integers, and wherein N=M+K;
modifying original envelope values of the M successive subbands individually to obtain modified envelope values of the M successive subbands when the total energy of the M successive subbands is greater than the total energy of the K successive subbands multiplied by a first factor, when the total energy of the M successive subbands is less than the total energy of the K successive subbands multiplied by a second factor and when the energy of a first subband of the N subbands multiplied by a third factor and further multiplied by M is greater than the total energy of the M successive subbands, wherein the first factor is less than the second factor, wherein the modified envelope values of the M successive subbands is a determining factor for allocating encoding bits to the N subbands, and wherein at least one subband of the N subbands has at least one encoding bit allocated;
quantizing spectral coefficients of each subband that has at least one encoding bit allocated using the at least one encoding bit;
writing the spectral coefficients of each subband that has the at least one encoding bit into a bitstream in response to quantizing the spectral coefficients of each subband that has at least one encoding bit; and
sending the bitstream via a network interface.
1 Assignment
0 Petitions
Accused Products
Abstract
A signal processing method and device includes obtaining spectral coefficients of a current frame of an audio signal, in which N subbands of the current frame comprises at least one of the spectral coefficients. A total energy of M successive subbands of the N subbands, a total energy of K successive subbands of the N subbands, and an energy of a first subband are obtained to determine whether to modify original envelope values of the M subbands. When the original envelope values of the M subbands are modified, encoding bits are allocated to each of the N subbands according to the modified envelope values of the M subbands.
0 Citations
No References
No References
20 Claims
 1. An audio signal processing method implemented by an audio signal encoder, the audio signal processing method comprising:
obtaining an analog audio signal; converting the analog audio signal to a digital time domain audio signal; transforming the digital time domain audio signal to a frequency domain audio signal, wherein a current frame of the frequency domain audio signal comprises a plurality of spectral coefficients, wherein each of N subbands of the current frame comprises at least one of the spectral coefficients, and wherein N is a positive integer greater than 1; obtaining a total energy of M successive subbands of the N subbands; determining a largest subband energy among the M successive subbands; obtaining a total energy of K successive subbands of the N subbands, wherein the M successive subbands and the K successive subbands are separate, wherein M and K are positive integers, and wherein N=M+K; modifying original envelope values of the M successive subbands individually to obtain modified envelope values of the M successive subbands when the total energy of the M successive subbands is greater than the total energy of the K successive subbands multiplied by a first factor, when the total energy of the M successive subbands is less than the total energy of the K successive subbands multiplied by a second factor and when the energy of a first subband of the N subbands multiplied by a third factor and further multiplied by M is greater than the total energy of the M successive subbands, wherein the first factor is less than the second factor, wherein the modified envelope values of the M successive subbands is a determining factor for allocating encoding bits to the N subbands, and wherein at least one subband of the N subbands has at least one encoding bit allocated; quantizing spectral coefficients of each subband that has at least one encoding bit allocated using the at least one encoding bit; writing the spectral coefficients of each subband that has the at least one encoding bit into a bitstream in response to quantizing the spectral coefficients of each subband that has at least one encoding bit; and sending the bitstream via a network interface.  View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
 9. An audio signal encoder, comprising:
a microphone configured to obtain an analog audio signal; an analog to digital (A/D) converter coupled to the microphone and configured to convert the analog audio signal to a digital time domain audio signal; a digital signal processor coupled to the A/D converter configured to; transform the digital time domain audio signal to a frequency domain audio signal, wherein a current frame of the frequency domain audio signal comprises a plurality of spectral coefficients, wherein each of N subbands of the current frame comprises at least one of the spectral coefficients, and wherein N is a positive integer greater than 1; obtain a total energy of M successive subbands of the N subbands; determine a largest subband energy among the M successive subbands; obtain a total energy of K successive subbands of the N subbands, wherein the M successive subbands and the K successive subbands are separate and distinct, wherein M and K are positive integers, and wherein N=M+K; modify original envelope values of the M successive subbands individually to obtain modified envelope values of the M successive subbands when the total energy of the M successive subbands is greater than the total energy of the K successive subbands multiplied by a first factor, when the total energy of the M successive subbands is less than the total energy of the K successive subbands multiplied by a second factor, and when the energy of a first subband of the N subbands multiplied by a third factor and further multiplied by M is greater than the total energy of the M successive subbands, wherein the first factor is less than the second factor, wherein the modified envelope values of the M successive subbands is a determining factor for allocating encoding bits to the N subbands, and wherein at least one subband of the N subbands has at least one encoding bit allocated; quantize spectral coefficients of each subband that has at least one encoding bit allocated using the at least one encoding bit; write the spectral coefficients of each subband that has the at least one encoding bit into a bitstream in response to quantizing the spectral coefficients of each subband that has at least one encoding bit; and a network interface configured to send the bitstream via a network interface.  View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
 17. A nontransitory computer readable storage medium, embodying computer program code, which, when executed by a computer processor, causes the computer processor to be configured to:
transform a digital time domain audio signal obtained by an analog to digital converter to a frequency domain audio signal, wherein a current frame of the frequency domain audio signal comprises a plurality of spectral coefficients, wherein each of N subbands of the current frame comprises at least one of the spectral coefficients, and wherein N is a positive integer greater than 1; obtain a total energy of M successive subbands of the N subbands; determine a largest subband energy among the M successive subbands; obtain a total energy of K successive subbands of the N subbands, wherein the M successive subbands and the K successive subbands are separate and distinct, wherein M and K are positive integers, and wherein N=M+K; modify original envelope values of the M successive subbands individually to obtain modified envelope values of the M successive subbands when the total energy of the M successive subbands is greater than the total energy of the K successive subbands multiplied by a first factor, when the total energy of the M successive subbands is less than the total energy of the K successive subbands multiplied by a second factor, and when the energy of a first subband of the N subbands multiplied by a third factor and further multiplied by M is greater than the total energy of the M successive subbands, wherein the first factor is less than the second factor, wherein the modified envelope values of the M successive subbands is a determining factor for allocating encoding bits to the N subbands, and wherein at least one subband of the N subbands has at least one encoding bit allocated; quantize spectral coefficients of each subband that has at least one encoding bit allocated using the at least one encoding bit; write the spectral coefficients of each subband that has the at least one encoding bit into a bitstream in response to quantizing the spectral coefficients of each subband that has at least one encoding bit; and send the bitstream via a network interface.  View Dependent Claims (18, 19, 20)
1 Specification
This application is a continuation of U.S. patent application Ser. No. 16/409,290, filed on May 10, 2019, which is a continuation of U.S. patent application Ser. No. 16/205,246, filed on Nov. 30, 2018, now U.S. Pat. No. 10,347,264, which is a continuation of U.S. patent application Ser. No. 15/686,175, filed on Aug. 25, 2017, now U.S. Pat. No. 10,186,271, which is a continuation of U.S. patent application Ser. No. 15/335,449, filed on Oct. 27, 2016, now U.S. Pat. No. 9,837,088, which is a continuation of International Patent Application No. PCT/CN2014/092695, filed on Dec. 1, 2014, which claims priority to Chinese Patent Application No. 201410177234.3, filed on Apr. 29, 2014. All of the aforementioned patent applications are hereby incorporated by reference in their entireties.
The present disclosure relates to the signal processing field, and specifically, to a signal processing method and device.
In current communication transmission, increasing attention is paid to quality of voice signals or audio signals. Therefore, quality requirements for signal encoding and decoding are increasingly high. In existing frequency domain encoding algorithms, bit allocation is generally performed on each subband of a signal directly according to a size of a frequency envelope, and then each subband is encoded using a quantity of allocated bits. However, practice shows that, in these existing encoding algorithms, subbands of a low frequency band have relatively large impact on signal encoding quality. Therefore, the subbands of the low frequency band generally become a bottleneck of signal encoding performance. The foregoing bit allocation manner cannot well adapt to a bit requirement of each subband, especially that of a subband of a low frequency band, which leads to relatively poor signal encoding performance. Correspondingly, signal decoding performance is also relatively poor.
Embodiments of the present disclosure provide a signal processing method and device, which can improve signal encoding and decoding performance.
According to a first aspect, a signal processing method is provided. The method includes selecting M subbands from N subbands, where the N subbands are obtained by dividing spectral coefficients of a current frame of a signal, a frequency band of each of the M subbands is lower than a frequency band of each of the nonselected K subbands, N is a positive integer greater than 1, both M and K are positive integers, and the sum of M and K is N, determining, according to performance information of the M subbands, whether to modify original envelope values of the M subbands, where the performance information includes an energy attribute and a spectral attribute of the M subbands, modify the original envelope values of the M subbands individually to obtain modified envelope values of the M subbands, and performing a first bit allocation on the N subbands according to the modified envelope values of the M subbands and original envelope values of the K subbands.
With reference to the first aspect, in a first possible implementation manner, the determining, according to performance information of the M subbands, to modify original envelope values of the M subbands includes determining a first parameter according to original envelope values of the N subbands, where the first parameter indicates a concentration degree that is of spectral energy of the signal and that is on the M subbands, determining a second parameter according to the original envelope values of the M subbands, where the second parameter indicates a degree of spectral fluctuation of the M subbands, and determining, if the first parameter falls within a first range and the second parameter falls within a second range, to modify the original envelope values of the M subbands.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the determining a first parameter according to original envelope values of the N subbands includes determining total energy of the M subbands according to the original envelope values of the M subbands, determining total energy of the K subbands according to the original envelope values of the K subbands, and determining a ratio of the total energy of the M subbands to the total energy of the K subbands as the first parameter.
With reference to the first possible implementation manner or the second possible implementation manner of the first aspect, in a third possible implementation manner, the determining a second parameter according to the original envelope values of the M subbands includes determining the total energy of the M subbands and energy of a first subband according to the original envelope values of the M subbands, where the energy of the first subband is the largest in that of the M subbands, and determining a ratio of the energy of the first subband to the total energy of the M subbands as the second parameter.
With reference to the first aspect or any one of the foregoing implementation manners, in a fourth possible implementation manner, the modifying separately on the original envelope values of the M subbands to obtain modified envelope values of the M subbands includes determining the total energy of the M subbands and the energy of the first subband according to the original envelope values of the M subbands, where the energy of the first subband is the largest in that of the M subbands, determining a modification factor according to the total energy of the M subbands and the energy of the first subband, and modifying separately on the original envelope values of the M subbands using the modification factor to obtain the modified envelope values of the M subbands.
With reference to the first aspect or any one of the foregoing implementation manners, in a fifth possible implementation manner, a modified envelope value of each subband in the M subbands is greater than an original envelope value of the same subband.
With reference to the first aspect or any one of the foregoing implementation manners, in a sixth possible implementation manner, the method further includes determining a quantity of redundant bits of each subband in the N subbands according to quantities of bits respectively allocated to the N subbands during the first bit allocation, where the quantity of redundant bits of each subband in the N subbands is less than a quantity of bits required for encoding a single information unit in the same subband, determining a total quantity of redundant bits according to the quantity of redundant bits of each subband in the N subbands, and performing a second bit allocation on the N subbands according to the modified envelope values of the M subbands, the original envelope values of the K subbands, and the total quantity of redundant bits.
According to a second aspect, a signal processing device is provided, including a selection unit, configured to select M subbands from N subbands, where the N subbands are obtained by dividing spectral coefficients of a current frame of a signal, a frequency band of the M subbands is lower than a frequency band of K subbands in the N subbands except the M subbands, N is a positive integer greater than 1, both M and K are positive integers, and the sum of M and K is N, a determining unit, configured to determine, according to performance information of the M subbands, to modify original envelope values of the M subbands, where the performance information is used to indicate an energy attribute and a spectral attribute of the M subbands, a modification unit, configured to perform modification separately on the original envelope values of the M subbands to obtain modified envelope values of the M subbands, and an allocation unit, configured to perform first bit allocation on the N subbands according to the modified envelope values of the M subbands and original envelope values of the K subbands.
With reference to the second aspect, in a first possible implementation manner, the determining unit is configured to determine a first parameter according to original envelope values of the N subbands, where the first parameter indicates a concentration degree that is of spectral energy of the signal and that is on the M subbands, determine a second parameter according to the original envelope values of the M subbands, where the second parameter indicates a degree of spectral fluctuation of the M subbands, and determine, if the first parameter falls within a first range and the second parameter falls within a second range, to modify the original envelope values of the M subbands.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner, the determining unit is configured to determine total energy of the M subbands according to the original envelope values of the M subbands, determine total energy of the K subbands according to the original envelope values of the K subbands, and determine a ratio of the total energy of the M subbands to the total energy of the K subbands as the first parameter.
With reference to the first possible implementation manner or the second possible implementation manner of the second aspect, in a third possible implementation manner, the determining unit is configured to determine the total energy of the M subbands and energy of a first subband according to the original envelope values of the M subbands, where the energy of the first subband is the largest in that of the M subbands, and determine a ratio of the energy of the first subband to the total energy of the M subbands as the second parameter.
With reference to the second aspect or any one of the foregoing implementation manners, in a fourth possible implementation manner, the modification unit is configured to determine the total energy of the M subbands and the energy of the first subband according to the original envelope values of the M subbands, where the energy of the first subband is the largest in that of the M subbands, determine a modification factor according to the total energy of the M subbands and the energy of the first subband, and perform modification separately on the original envelope values of the M subbands using the modification factor to obtain the modified envelope values of the M subbands.
With reference to the second aspect or any one of the foregoing implementation manners, in a fifth possible implementation manner, a modified envelope value of each subband in the M subbands is greater than an original envelope value of the same subband.
With reference to the second aspect or any one of the foregoing implementation manners, in a sixth possible implementation manner, the determining unit is further configured to determine a quantity of redundant bits of each subband in the N subbands according to quantities of bits respectively allocated to the N subbands during the first bit allocation, where the quantity of redundant bits of each subband in the N subbands is less than a quantity of bits required for encoding a single information unit in the same subband, the determining unit is further configured to determine a total quantity of redundant bits according to the quantity of redundant bits of each subband in the N subbands, and the allocation unit is further configured to perform second bit allocation on the N subbands according to the modified envelope values of the M subbands, the original envelope values of the K subbands, and the total quantity of redundant bits.
In the embodiments of the present disclosure, bit allocation is not directly performed according to original envelope values of N subbands, instead, M subbands of a low frequency band are selected from the N subbands, it is determined, according to an energy attribute and a spectral attribute of the M subbands, to modify original envelope values of the M subbands, modification is performed separately on the original envelope values of the M subbands according to the original envelope values of the M subbands, and first bit allocation is performed on the N subbands according to modified envelope values of the M subbands and original envelope values of K subbands such that bit allocation better meets a bit requirement of each subband, and therefore, signal encoding and decoding performance can be improved.
The following briefly describes the accompanying drawings used in describing the embodiments of the present disclosure. The accompanying drawings in the following description show merely some embodiments of the present disclosure, and persons of ordinary skill in the art may still derive other embodiments from these accompanying drawings without creative efforts.
The following describes the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings.
Signal encoding technology and signal decoding technology are widely used in various electronic devices, such as mobile phones, wireless apparatuses, personal data assistants (PDAs), handheld or portable computers, Global Positioning System (GPS) receivers or navigation devices, cameras, audio/video players, video cameras, video recorders, and monitoring devices. Generally, one such electronic device may include a voice or audio encoder, and may further include a voice or audio decoder. The voice or audio encoder and the voice or audio decoder may be directly implemented by a digital circuit or a chip, such as a digital signal processor (DSP) chip, or may be implemented by a software codedriven processor by executing a procedure in software code.
In an encoding process, an encoder side may first transform a timedomain signal into a frequencydomain signal. For example, timefrequency transformation may be performed using an algorithm such as fast Fourier transform (FFT) or modified discrete cosine transform (MDCT). Then, spectral coefficients of the frequencydomain signal are normalized using a global gain, and normalized spectral coefficients are divided to obtain multiple subbands.
In a decoding process, the decoder side may decode a bitstream received from the encoder side to obtain normalized spectral coefficients, and the normalized spectral coefficients are divided to obtain multiple subbands. The method of
110. Dividing spectral coefficients of a current frame of a signal into N subbands, and select M subbands from the N subbands, where N=M+K. The M subbands are lower in frequencies than the frequencies of the nonselected K subbands. N is a positive integer greater than 1, and both M and K are positive integers.
In this embodiment of the present disclosure, the signal may be a voice signal, or may be an audio signal.
120. Determine, according to performance information of the M subbands, to modify original envelope values of the M subbands, where the performance information indicates an energy attribute and a spectral attribute of the M subbands.
130. Modify the original envelope values of the M subbands respectively, to obtain modified envelope values of the M subbands.
140. Perform a first bit allocation on the N subbands according to the modified envelope values of the M subbands and original envelope values of the K subbands.
In this embodiment of the present disclosure, bit allocation is not directly performed according to original envelope values of N subbands. Instead, M low frequency subbands are selected from the N subbands. It is determined, according to an energy attribute and a spectral attribute of the M subbands, to modify original envelope values of the M subbands. The original envelope values of the M subbands are modified respectively, and a first bit allocation is performed on the N subbands according to modified envelope values of the M subbands and original envelope values of K subbands such that the bit allocation better meets bit requirements of the subbands, and therefore, signal encoding and decoding performance can be improved.
In an existing frequency domain encoding algorithm, bit allocation is performed on each subband of a signal directly according to size of the frequency envelope of the subband. As a result, quantity of allocated bits cannot well meet bit requirements of some low frequency subbands. However, in this embodiment of the present disclosure, the M low frequency subbands are first selected from the N subbands of the current frame of the signal. It is determined, according to the energy attribute and the spectral attribute of the M subbands, to modify the original envelope values of the M subbands. Modification is performed on the original envelope values of the M subbands according to the original envelope values of the M subbands, and then the first bit allocation is performed on the N subbands according to the modified envelope values of the M subbands and the original envelope values of the K subbands. It may be learned that, in this embodiment of the present disclosure, bit allocation is not directly performed on the N subbands according to the original envelope values of the N subbands. Instead, the energy attribute and the spectral attribute of the M subbands are used as considerations to determine that modification needs to be performed on the M subbands to obtain the respective modified envelope values of the M subbands. The bit allocation is performed according to the modified envelope values of the low frequency subbands and original envelope values of the other subbands such that the bit allocation on each subband is more proper, especially for the M low frequency subbands, and therefore, signal encoding and decoding performance can be improved.
After the spectral coefficients are divided to obtain the N subbands, an envelope of each subband may be calculated and quantized. Therefore, each subband has a quantized envelope value. It should be understood that an original envelope value is relative to a modified envelope value, and the original envelope value may refer to an initial envelope value of a subband, that is, a quantized envelope value obtained by calculation after subband division. An envelope value obtained after modifying the initial envelope value of the subband is referred to as the modified envelope value. Therefore, in this embodiment of the present disclosure, both the original envelope value and modified envelope value refer to quantized envelope values.
Optionally, in step 110, the M subbands may be selected from the N subbands according to a harmonic attribute of the subbands and energies of the subbands. For example, harmonic strength of each subband of the M subbands may be greater than a preset strength threshold, and a ratio of energy of the subband to total energy of the N subbands is greater than a preset energy threshold. As mentioned above, low frequency subbands are generally a bottleneck of signal encoding performance. In these subbands, a subband that has a relatively strong harmonic attribute with energy that accounts for a specific proportion of total energy of all subbands is particularly a bottleneck of the encoding performance. Therefore, after the M subbands are selected from the N subbands according to the harmonic attribute of the subbands and the energy of the subbands, and the original envelope values of the M subbands are modified, bit allocation on the M subbands is more proper, and therefore, signal encoding and decoding performance can be more effectively improved.
Optionally, as another embodiment, the frequencies of the N subbands may be arranged in ascending order. In this way, in step 110, the first M subbands may be selected from the N subbands. In this embodiment, the M subbands are selected in ascending order of frequency bands, which can simplify an operation and improve signal processing efficiency.
Optionally, as another embodiment, in step 120, a first parameter may be determined according to the original envelope values of the N subbands, where the first parameter indicates a concentration degree of signal spectral energy on the M subbands. A second parameter may be determined according to the original envelope values of the M subbands, where the second parameter indicates a degree of spectral fluctuation of the M subbands. If the first parameter falls within a first range and the second parameter falls within a second range, it may be determined that the original envelope values of the M subbands should be modified.
In an embodiment, the energy attribute of the M subbands may be the concentration degree of the signal spectral energy on the M subbands, and the spectral attribute of the M subbands may be the degree of spectral fluctuation of the M subbands.
The first range is related to energy of a subband, and may be preset. When the concentration degree of the signal spectral energy on the M subbands is relatively low, i.e. lower than the low point of the range, it may indicate that a ratio of the M subbands to the N subbands is small, and the encoding performance is not greatly affected. Therefore, there is no need to modify the original envelope values of the M subbands. When the concentration degree of the signal spectral energy on the M subbands is relatively high, i.e. higher than the high point of the range, it indicates that the original envelope values of the M subbands are also relatively large. Therefore, a quantity of bits allocated to the M subbands is enough for encoding, and there is also no need to modify the original envelope values of the M subbands. The first range may be predetermined by means of experimental simulation. For example, the first range may be preset to [⅙, ⅔].
The second range is related to a degree of spectral fluctuation of subbands, and may be preset. If the degree of spectral fluctuation of the M subbands is lower that the low point of the range, the encoding performance is not greatly affected even if the quantity of bits allocated to the M subband is small. In this way, there is no need to modify the original envelope values of the M subbands. In this case, being in the second range indicates that the degree of spectral fluctuation of the subbands is relatively high. The second range may be predetermined by means of experimental simulation. For example, the second range may be preset to
Generally, if in a signal, bandwidth that can be used for encoding is 0 to 4 Kilohertz (KHz), the second range may be preset to
if in a signal, bandwidth that can be used for encoding is 0 to 8 KHz, the second range may be preset to
When the first parameter falls within the first range and the second parameter falls within the second range, it means that the concentration degree of the signal spectral energy on the M subbands is neither extremely high nor extremely low, and the degree of spectral fluctuation of the M subbands is relatively high. The original envelope values of the M subbands may be modified such that bits allocated to the M subbands during the first bit allocation of the M subbands better meet the bit requirements of the M subbands. For example, for each subband in the M subbands, a modified envelope value is greater than an original envelope value. Then, compared with performing first bit allocation according to the original envelope values of the M subbands, performing the first bit allocation according to the modified envelope values of the M subbands makes a quantity of bits allocated to the M subbands larger, and therefore, encoding performance of the M subbands can be improved.
It may be learned that, in this embodiment, the first parameter and the second parameter that are determined according to the original envelope values of the N subbands may reflect an attribute of each frequency band. In this embodiment, if the first parameter falls within the first range and the second parameter falls within the second range, it is determined to modify the original envelope values of the M subbands. When bit allocation is subsequently performed according to the modified envelope values of the M subbands, quantity of bits allocated to the M subbands better meets bit requirements of the M subbands, and therefore, signal encoding and decoding performance can be improved.
Optionally, as another embodiment, in step 120, total energy of the M subbands may be determined according to the original envelope values of the M subbands. Total energy of the K subbands may be determined according to the original envelope values of the K subbands. A ratio of the total energy of the M subbands to the total energy of the K subbands may be determined as the first parameter.
In an embodiment, the ratio of the total energy of the M subbands to the total energy of the K subbands may be determined as the first parameter.
For example, the first parameter may be obtained by calculation according to the following equations, where the first parameter may be represented by a
where
E_{P}_{M }represents the total energy of the M subbands, E_{P}_{K }represents the total energy of the K subbands, band_width_{i }represents bandwidth of the i^{th }subband, and band_energy_{i }represents energy of the i^{th }subband. band_energy_{i }may also represent an original envelope value of the i^{th }subband. For example, the original envelope value band_energy_{i }of the i^{th }subband may be obtained according to spectral coefficients of the subband. For example, band_energy_{i }may be obtained according to the following equations
In some embodiments, modifications or changes may be made according to the foregoing equations, to obtain the first parameter, and such modifications or changes also fall within a scope of this embodiment of the present disclosure.
Optionally, as another embodiment, in step 120, according to the original envelope values of the M subbands, total energy of the M subbands may be determined, and energy of a first subband may be determined, where the energy of the first subband is the largest in that of the M subbands. A ratio of the energy of the first subband to the total energy of the M subbands may be determined as the second parameter.
In an embodiment, the degree of spectral fluctuation of the M subbands may be indicated using a fluctuation degree of the original envelope values of the M subbands. For example, the second parameter may be obtained by calculation according to the following equations, where the second parameter may be represented by β
where, for calculation manners of E_{P_tmp}_{i }and E_{P}_{M}, reference may be made to the foregoing equations.
It should be understood that various equivalent modifications or changes may be made according to the foregoing equations, to obtain the second parameter, and such modifications or changes also fall within a scope of this embodiment of the present disclosure.
Optionally, as another embodiment, in step 130, total energy of the M subbands and energy of a first subband may be determined according to the original envelope values of the M subbands. The energy of the first subband is the largest in that of the M subbands. A modification factor may be determined according to the total energy of the M subbands and the energy of the first subband. Then, modification may be performed separately on the original envelope values of the M subbands using the modification factor to obtain the modified envelope values of the M subbands.
For example, the modification factor may be determined according to the following equations, where the modification factor may be represented by γ
where, for calculation manners of E_{P_tmp}_{i }and E_{P}_{M}, reference may be made to the foregoing equations.
Modification may be performed on an original envelope value of each subband in the M subbands according to the modification factor γ. For example, the original envelope value of each subband may be multiplied by the modification factor to obtain a modified envelope value of the subband.
It should be understood that various equivalent modifications or changes may be made according to the foregoing equations, to obtain the modification factor, and such modifications or changes also fall within a scope of this embodiment of the present disclosure.
Optionally, as another embodiment, in step 130, a modified envelope value of each subband in the M subbands may be greater than an original envelope value of the subband.
In an embodiment, the modified envelope value of each subband in the M subbands is obtained by modifying the original envelope value of each subband in the M subbands. The modified envelope value of each subband may be greater than the original envelope value of the subband. If the modified envelope value of each subband in the M subbands is greater than the original envelope value of the subband. In step 140, bit allocation is performed according to the modified envelope values of the M subbands. In this way, a quantity of bits allocated to each subband in the M subbands increases such that the bit allocation better meets a bit requirement of each subband, and therefore, signal encoding and decoding performance can be improved.
Optionally, as another embodiment, in step 130, a modified envelope value of each subband in the M subbands may be less than an original envelope value of the subband.
In an embodiment, if the modified envelope value of each subband in the M subbands is less than the original envelope value of the subband, in step 140, bit allocation is performed according to the modified envelope values of the M subbands and original envelope values of the K subbands. In this way, a quantity of bits allocated to each subband in the M subbands is relatively small, and accordingly, quantities of bits respectively allocated to the K subbands increase such that the bit allocation better meets a bit requirement of each subband, and therefore, signal encoding and decoding performance can be improved.
Optionally, as another embodiment, in step 130, a first bit allocation may be performed on the N subbands in descending order of envelope values.
Optionally, as another embodiment, in step 130, a modification factor may be determined according to the second parameter. Then, modification may be performed separately on the original envelope values of the M subbands using the modification factor to obtain the modified envelope values of the M subbands.
In an embodiment, the modification factor may be determined according to the second parameter. Modification may be performed on an original envelope value of each subband in the M subbands according to the modification factor. For example, the original envelope value of each subband may be multiplied by the modification factor to obtain a modified envelope value of the subband such that a quantity of bits allocated to the M subbands better meets bit requirements of the M subbands, and therefore, signal encoding and decoding performance can be improved.
After the first bit allocation is performed, there are redundant bits in bits allocated to each subband. Redundant bits of each subband are not enough for encoding one information unit of the subband. Quantities of redundant bits of all subbands may be counted to obtain a total quantity of redundant bits, and then, a second bit allocation is performed.
Optionally, as another embodiment, after step 140, a quantity of redundant bits of each subband in the N subbands may be determined according to quantities of bits respectively allocated to the N subbands during the first bit allocation. The quantity of redundant bits of each subband in the N subbands is less than a quantity of bits required for encoding in the same subband. A total quantity of redundant bits may be determined according to the quantity of redundant bits of each subband in the N subbands. Then, second bit allocation may be performed on the N subbands according to the total quantity of redundant bits.
In an embodiment, total redundant bits may be equally allocated to the N subbands. In this way, redundant bits may be reused to avoid a waste of bits and further improve signal encoding and decoding performance.
The foregoing describes a process of a first bit allocation and a second bit allocation. If the foregoing method in
If the foregoing method in
The following describes embodiments of the present disclosure in detail with reference to specific examples. It should be understood that, these examples are merely intended to help persons skilled in the art better understand the embodiments of the present disclosure, but are not intended to limit the scope of the embodiments of the present disclosure.
In the following examples, an encoder side is used as an example for description.
201. An encoder side performs timefrequency transformation on a timedomain signal.
202. The encoder side divides spectral coefficients of a frequencydomain signal into N subbands, where N is a positive integer greater than 1.
In an embodiment, the encoder side may calculate a global gain, the global gain is used to perform normalization on original spectral coefficients, then, the normalized spectral coefficients are divided to obtain all subbands.
203. The encoder side obtains an original envelope value of each subband by means of calculation and quantization.
204. The encoder side selects M subbands from the N subbands, where M is a positive integer, and remaining K subbands are nonselected.
A frequency band of the M subbands is lower than a frequency band of K subbands, where K is a positive integer, and the sum of K and M is N.
205. The encoder side determines a first parameter according to original envelope values of the M subbands and original envelope values of K subbands.
The first parameter may indicate a concentration degree that is of spectral energy of the signal and that is on the M subbands. For example, a ratio of total energy of the M subbands to total energy of the K subbands may be used to indicate the first parameter. For a calculation manner of the first parameter, reference may be made to the calculation manner of the first parameter in the embodiment of
206. The encoder side determines a second parameter according to the original envelope values of the M subbands.
The second parameter may indicate a degree of spectral fluctuation of the M subbands. For example, a ratio of energy of a first subband to the total energy of the M subbands may be used to indicate the second parameter, where the energy of the first subband is the largest in that of the M subbands. For a calculation manner of the second parameter, reference may be made to the calculation manner of the second parameter in the embodiment of
207. The encoder side determines whether the first parameter falls within a first range and the second parameter falls within a second range.
The first range and the second range may be preset. For example, the first range may be preset to [⅙, ⅔]. The second range may be preset to
208. If the encoder side determines that the first parameter falls within the first range and the second parameter falls within the second range in step 207, modify the original envelope values of the M subbands according to the original envelope values of the M subbands to obtain modified envelope values of the M subbands.
In an embodiment, the encoder side may determine a modification factor according to the original envelope values of the M subbands. For a calculation manner of the modification factor, reference may be made to the process in the embodiment of
209. The encoder side performs first bit allocation on the N subbands according to the modified envelope values of the M subbands and the original envelope values of the K subbands.
For example, the encoder side may perform first bit allocation on the N subbands in descending order of envelope values. For the M subbands, because the modified envelope value of each subband is greater than the original envelope value of the subband, compared with a quantity of allocated bits before modification, a quantity of bits allocated to each subband in the M subbands increases such that bit allocation better meets a bit requirement of each subband, thereby improving signal encoding and decoding performance.
210. The encoder side performs second bit allocation on the N subbands.
In an embodiment, the encoder side may determine a quantity of redundant bits of each subband according to a quantity of bits allocated to each subband in the N subbands after the first bit allocation and bandwidth of each subband to determine a total quantity of redundant bits of the N subbands. Then, total redundant bits are equally allocated to the N subbands according to the total quantity of redundant bits.
211. The encoder side quantizes spectral coefficients of each subband according to a quantity of bits allocated to each subband in the N subbands.
212. The encoder side writes a bitstream according to a quantized spectral coefficient obtained in step 211 and an original envelope value of each subband.
In an embodiment, the encoder side may write indexes of the quantized spectral coefficient, the original envelope value of each subband, and the like into the bitstream.
213. If the encoder side determines that the first parameter falls outside the first range or the second parameter falls outside the second range in step 207, the encoder side performs a first bit allocation on the N subbands according to original envelope values of the N subbands.
For example, the encoder side may perform first bit allocation on the N subbands in descending order of envelope values.
214. The encoder side performs a second bit allocation on the N subbands.
In an embodiment, the encoder side may determine a quantity of redundant bits of each subband according to a quantity of bits allocated to each subband in the N subbands after the first bit allocation and bandwidth of each subband to determine a total quantity of redundant bits of the N subbands. Then, total redundant bits are equally allocated to the N subbands according to the total quantity of redundant bits.
215. The encoder side quantizes spectral coefficients of each subband according to a quantity of bits allocated to each subband in the N subbands.
216. The encoder side writes a bitstream according to a quantized spectral coefficient obtained in step 215 and an original envelope value of each subband.
In an embodiment, the encoder side may write indexes of the quantized spectral coefficient, the original envelope value of each subband, and the like into the bitstream.
In this embodiment of the present disclosure, if a first parameter falls within a first range and a second parameter falls within a second range, modification is performed on original envelope values of M subbands of a low frequency band according to the original envelope values of the M subbands, and first bit allocation is performed on N subbands according to modified envelope values of the M subbands and original envelope values of K subbands such that bit allocation better meets a bit requirement of each subband, and therefore, signal encoding and decoding performance can be improved.
The selection unit 310 selects M subbands from N subbands. The N subbands are obtained by dividing spectral coefficients of a current frame of a signal. A frequency band of the selected M subbands is lower than a frequency band of nonselected K subbands in the N subbands. N is a positive integer greater than 1, both M and K are positive integers, and the sum of M and K is N. The determining unit 320 determines, according to performance information of the M subbands, to modify original envelope values of the M subbands, where the performance information is used to indicate an energy attribute and a spectral attribute of the M subbands. The modification unit 330 performs modification separately on the original envelope values of the M subbands to obtain modified envelope values of the M subbands. The allocation unit 340 performs first bit allocation on the N subbands according to the modified envelope values of the M subbands and original envelope values of the K subbands.
In this embodiment of the present disclosure, bit allocation is not directly performed according to original envelope values of N subbands. Instead, M subbands of a low frequency band are selected from the N subbands, it is determined, according to an energy attribute and a spectral attribute of the M subbands, to modify original envelope values of the M subbands, modification is performed separately on the original envelope values of the M subbands according to the original envelope values of the M subbands, and first bit allocation is performed on the N subbands according to modified envelope values of the M subbands and original envelope values of K subbands such that bit allocation better meets a bit requirement of each subband, and therefore, signal encoding and decoding performance can be improved.
Optionally, as an embodiment, the determining unit 320 may determine a first parameter according to original envelope values of the N subbands, where the first parameter indicates a concentration degree that is of spectral energy of the signal and that is on the M subbands. The determining unit 320 may determine a second parameter according to the original envelope values of the M subbands, where the second parameter indicates a degree of spectral fluctuation of the M subbands. The determining unit 320 may determine, if the first parameter falls within a first range and the second parameter falls within a second range, to modify the original envelope values of the M subbands.
Optionally, as another embodiment, the determining unit 320 may determine total energy of the M subbands according to the original envelope values of the M subbands. The determining unit 320 may determine total energy of the K subbands according to the original envelope values of the K subbands, and may determine a ratio of the total energy of the M subbands to the total energy of the K subbands as the first parameter.
Optionally, as another embodiment, the determining unit 320 may determine total energy of the M subbands and energy of a first subband according to the original envelope values of the M subbands, where the energy of the first subband is the largest in that of the M subbands. The determining unit 320 may determine a ratio of the energy of the first subband to the total energy of the M subbands as the second parameter.
Optionally, as another embodiment, the modification unit 330 may determine total energy of the M subbands and energy of a first subband according to the original envelope values of the M subbands, where the energy of the first subband is the largest in that of the M subbands. The modification unit 330 may determine a modification factor according to the total energy of the M subbands and the energy of the first subband, and may perform modification separately on the original envelope values of the M subbands using the modification factor to obtain the modified envelope values of the M subbands.
Optionally, as another embodiment, a modified envelope value of each subband in the M subbands may be greater than an original envelope value of the same subband.
Optionally, as another embodiment, the determining unit 320 may further determine a quantity of redundant bits of each subband in the N subbands according to quantities of bits respectively allocated to the N subbands during the first bit allocation. The quantity of redundant bits of each subband in the N subbands is less than a quantity of bits required for encoding a single information unit in the same subband. The determining unit 320 may further determine a total quantity of redundant bits according to the quantity of redundant bits of each subband in the N subbands. The allocation unit 340 may further perform second bit allocation on the N subbands according to the modified envelope values of the M subbands, the original envelope values of the K subbands, and the total quantity of redundant bits.
For other functions and operations of the device 300, reference may be made to the processes of the method embodiments in
The memory 410 may include a random access memory, a flash memory, a readonly memory, a programmable readonly memory, a nonvolatile memory, a register, or the like. The processor 420 may be a central processing unit (CPU).
The memory 410 is configured to store an executable instruction. The processor 420 may execute the executable instruction stored in the memory 410 to select M subbands from N subbands, where the N subbands are obtained by dividing spectral coefficients of a current frame of a signal, a frequency band of the M subbands is lower than a frequency band of K subbands in the N subbands except the M subbands, N is a positive integer greater than 1, both M and K are positive integers, and the sum of M and K is N, determine, according to performance information of the M subbands, to modify original envelope values of the M subbands, where the performance information is used to indicate an energy attribute and a spectral attribute of the M subbands, perform modification separately on the original envelope values of the M subbands to obtain modified envelope values of the M subbands, and perform first bit allocation on the N subbands according to the modified envelope values of the M subbands and original envelope values of the K subbands.
In this embodiment of the present disclosure, bit allocation is not directly performed according to original envelope values of N subbands. Instead, M subbands of a low frequency band are selected from the N subbands, it is determined, according to an energy attribute and a spectral attribute of the M subbands, to modify original envelope values of the M subbands, modification is performed separately on the original envelope values of the M subbands according to the original envelope values of the M subbands, and first bit allocation is performed on the N subbands according to modified envelope values of the M subbands and original envelope values of K subbands such that bit allocation better meets a bit requirement of each subband, and therefore, signal encoding and decoding performance can be improved.
Optionally, as an embodiment, the processor 420 may determine a first parameter according to original envelope values of the N subbands, where the first parameter indicates a concentration degree that is of spectral energy of the signal and that is on the M subbands. The processor 420 may determine a second parameter according to the original envelope values of the M subbands, where the second parameter indicates a degree of spectral fluctuation of the M subbands. The processor 420 may determine, if the first parameter falls within a first range and the second parameter falls within a second range, to modify the original envelope values of the M subbands.
Optionally, as another embodiment, the processor 420 may determine total energy of the M subbands according to the original envelope values of the M subbands. The processor 420 may determine total energy of the K subbands according to the original envelope values of the K subbands, and may determine a ratio of the total energy of the M subbands to the total energy of the K subbands as the first parameter.
Optionally, as another embodiment, the processor 420 may determine total energy of the M subbands and energy of a first subband according to the original envelope values of the M subbands, where the energy of the first subband is the largest in that of the M subbands. The processor 420 may determine a ratio of the energy of the first subband to the total energy of the M subbands as the second parameter.
Optionally, as another embodiment, the processor 420 may determine total energy of the M subbands and energy of a first subband according to the original envelope values of the M subbands, where the energy of the first subband is the largest in that of the M subbands. The processor 420 may determine a modification factor according to the total energy of the M subbands and the energy of the first subband, and may perform modification separately on the original envelope values of the M subbands using the modification factor to obtain the modified envelope values of the M subbands.
Optionally, as another embodiment, a modified envelope value of each subband in the M subbands may be greater than an original envelope value of the same subband.
Optionally, as another embodiment, the processor 420 may further determine a quantity of redundant bits of each subband in the N subbands according to quantities of bits respectively allocated to the N subbands during the first bit allocation The quantity of redundant bits of each subband in the N subbands is less than a quantity of bits required for encoding a single information unit in the same subband. The processor 420 may further determine a total quantity of redundant bits according to the quantity of redundant bits of each subband in the N subbands. The processor 420 may further perform second bit allocation on the N subbands according to the modified envelope values of the M subbands, the original envelope values of the K subbands, and the total quantity of redundant bits.
For other functions and operations of the device 400, reference may be made to the processes of the method embodiments in
Persons of ordinary skill in the art may be aware that, in combination with the examples described in the embodiments disclosed in this specification, units and algorithm steps may be implemented by electronic hardware or a combination of computer software and electronic hardware. Persons skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of the present disclosure.
It may be clearly understood by persons skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, reference may be made to a corresponding process in the foregoing method embodiments, and details are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely exemplary. For example, the unit division is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit.
When the functions are implemented in the form of a software functional unit and sold or used as an independent product, the functions may be stored in a computerreadable storage medium. The foregoing storage medium includes any medium that can store program encode, such as a Universal Serial Bus (USB) flash drive, a removable hard disk, a readonly memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.
The foregoing descriptions are merely specific implementation manners of the present disclosure, but are not intended to limit the protection scope of the present disclosure. Any variation or replacement readily figured out by persons skilled in the art within the technical scope disclosed in the present disclosure shall fall within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.