Efficient scalefactor estimation in advanced audio coding and MP3 encoder
View Patent ↗An efficient approach for estimating scalefactors for use in the quantization of audio signal spectrum values is described. The scalefactor estimation approach can be implemented in multiple stages. A first stage estimates a distortion level for a selected scalefactor band spectrum value based on a received maximum tolerant distortion threshold and the spectrum values in the scalefactor band. A second stage determines an interim process value based on the previously estimated distortion level and generates a scalefactor for a selected scalefactor band spectrum value based on the generated interim process value and a statistically predetermined fraction. A third stage generates a scalefactor that applies to the whole scalefactor band based on the scalefactor generated for the selected scalefactor band spectrum value. The approach provides a performance gain of 40% over previous techniques, thereby reducing device power requirements and audio encoder bottlenecks.
1. An audio encoder that includes a scalefactor estimation module, the scalefactor estimation module comprising:
a difference generating module that determines a distortion level for a spectrum value selected from a set of spectrum values in a scalefactor band, the distortion level based on a threshold for the scalefactor band, and the set of spectrum values within the scalefactor band, the distortion level being inversely proportional to a function of the set of spectrum values;
a spectrum value scalefactor generating module that generates a scalefactor for the selected spectrum value based in part on the determined distortion level and the selected spectrum value; and
a spectrum band scalefactor generating module that generates a scalefactor for the scalefactor band based on the scalefactor generated for the selected spectrum value.
2. The audio encoder of claim 1 , wherein the function of the set of spectrum values is a sum of the set of spectrum values.
3. The audio encoder of claim 1 , wherein the function of the set of spectrum values is a weighted sum of the set of spectrum values.
4. The audio encoder of claim 1 , wherein the threshold is indicative of a maximum distortion level that can be introduced to the spectrum values in the scalefactor band without substantially degrading quality of a quantized signal.
5. The audio encoder of claim 1 , wherein the spectrum value scalefactor generating module generates the scalefactor for the selected spectrum value further based on a predetermined fraction.
6. The audio encoder of claim 5 , wherein the predetermined fraction is based on a statistical analysis of the set of spectrum values in the scalefactor band.
7. The audio encoder of claim 1 , wherein the difference generating module determines the distortion level based on the relationship
Diff
k
2
=
Distortion
sfb
*
X
(
k
)
1
2
/
∑
k
=
1
n
X
(
k
)
1
2
X
(
k
)
≠
0
,
wherein Diff k is the distortion level at the selected spectrum value,
wherein Distortion sfb is the threshold,
wherein X(k) is a spectrum value within the set of spectrum values, and
wherein n is a number of spectrum values in the set of spectrum values.
8. The audio encoder of claim 1 , wherein the spectrum value scalefactor generating module generates the scalefactor for the selected spectrum value based on the relationship
Scf
1
=
X
(
k
)
*
(
a
fraction
)
4
3
wherein Scf1 is the scalefactor for the selected spectrum value,
wherein X(k) is the selected spectrum value,
wherein
a
=
3
*
(
(
1
+
0.5
*
Diff
k
X
(
k
)
)
1
2
-
1
)
,
wherein fraction is the predetermined fraction, and
wherein Diff k is the distortion level at the selected spectrum value.
9. The audio encoder of claim 1 , wherein the spectrum band scalefactor generating module generates the scalefactor for the scalefactor band based on the relationship Scf=4*log 2 (Scf1), wherein Scf is the scalefactor for the scalefactor band and Scf1 is the scalefactor generated for the selected spectrum value.
10. The audio encoder of claim 1 , further comprising:
a quantization module that quantizes the set of spectrum values within the scalefactor band based on the scalefactor generated for the scalefactor band.
11. A method of generating a scalefactor for a scalefactor band, the method comprising:
generating, by an encoder, a distortion level for a spectrum value selected from a set of spectrum values in the scalefactor band, the distortion level based on a threshold for the scalefactor band, and the set of spectrum values within the scalefactor band, the distortion level being inversely proportional to a function of the set of spectrum values;
generating a scalefactor for the selected spectrum value based in part on the distortion level and the selected spectrum value; and
generating the scalefactor for the scalefactor band based on the scalefactor generated for the selected spectrum value.
12. The method of claim 11 , wherein the function of the set of spectrum values comprises summing the set of spectrum values.
13. The method of claim 11 , wherein the function of the set of spectrum values comprises weighting the set of spectrum values and summing the weighted set of spectrum values.
14. The method of claim 11 , wherein generating the distortion level is based on the threshold being indicative of a maximum distortion level that can be introduced to the spectrum values in the scalefactor band without substantially degrading quality of a quantized signal.
15. The method of claim 11 , wherein generating the scalefactor for the selected spectrum value is further based on a predetermined fraction.
16. The method of claim 15 , wherein the predetermined fraction is based on a statistical analysis of the set of spectrum values in the scalefactor band.
17. The method of claim 11 , wherein the distortion level is generated based on the relationship
Diff
k
2
=
Distortion
sfb
*
X
(
k
)
1
2
/
∑
k
=
1
n
X
(
k
)
1
2
X
(
k
)
≠
0
,
wherein Diff k is the distortion level at the selected spectrum value,
wherein Distortion sfb is the threshold,
wherein X(k) is a spectrum value within the set of spectrum values, and
wherein n is a number of spectrum values in the set of spectrum values.
18. The method of claim 11 , wherein the scalefactor for the selected spectrum value is generated based on the relationship
Scf
1
=
X
(
k
)
*
(
a
fraction
)
4
3
wherein Scf1 is the scalefactor for the selected spectrum value,
wherein X(k) is the selected spectrum value,
wherein
a
=
3
⋆
(
(
1
+
0.5
⋆
Diff
k
X
(
k
)
)
1
2
-
1
)
,
wherein fraction is the predetermined fraction, and
wherein Diff k is the distortion level at the selected spectrum value.
19. The method of claim 11 , wherein the scalefactor for the scalefactor band is generated based on the relationship Scf=4*log 2 (Scf1), wherein Scf is the scalefactor for the scalefactor band and Scf1 is the scalefactor generated for the selected spectrum value.
20. The method of claim 11 , further comprising:
quantizing the set of spectrum values within the scalefactor band based on the scalefactor generated for the scalefactor band to produce quantized spectrum values; and
encoding the quantized spectrum values.