[FFmpeg-devel] [PATCH] libavcodec/wmavoice.c: local variable pow might mask pow function
Axel Holzinger
aholzinger
Sun Jul 25 19:34:25 CEST 2010
Hi,
in libavcodec/wmavoice.c local variable float pow (line 585) can mask
pow function if powf (line 595) is a #define and defined for example
like
#define powf(x,y) ((float)pow((double)(x), (double)(y)))
The attached patch reduces ambiguity by renaming the local variable
with pwr:
Index: wmavoice.c
===================================================================
--- wmavoice.c (revision 24500)
+++ wmavoice.c (working copy)
@@ -582,14 +582,14 @@
(5.0 /
14.7));
angle_mul = gain_mul * (8.0 * M_LN10 / M_PI);
for (n = 0; n <= 64; n++) {
- float pow;
+ float pwr;
idx = FFMAX(0, lrint((max - lpcs[n]) * irange) - 1);
- pow = wmavoice_denoise_power_table[s->denoise_strength][idx];
- lpcs[n] = angle_mul * pow;
+ pwr = wmavoice_denoise_power_table[s->denoise_strength][idx];
+ lpcs[n] = angle_mul * pwr;
/* 70.57 =~ 1/log10(1.0331663) */
- idx = (pow * gain_mul - 0.0295) * 70.570526123;
+ idx = (pwr * gain_mul - 0.0295) * 70.570526123;
if (idx > 127) { // fallback if index falls outside table
range
coeffs[n] = wmavoice_energy_table[127] *
powf(1.0331663, idx - 127);
Regards
Axel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pow-to-pwr.patch
Type: application/octet-stream
Size: 985 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100725/939237ad/attachment.obj>
More information about the ffmpeg-devel
mailing list