[FFmpeg-soc] [soc]: r5551 - amr/amrnbdec.c
vitor
subversion at mplayerhq.hu
Fri Jan 1 20:50:23 CET 2010
Author: vitor
Date: Fri Jan 1 20:50:23 2010
New Revision: 5551
Log:
Instead of divising by a constant, multiply by its inverse.
Modified:
amr/amrnbdec.c
Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c Fri Jan 1 16:32:44 2010 (r5550)
+++ amr/amrnbdec.c Fri Jan 1 20:50:23 2010 (r5551)
@@ -600,8 +600,10 @@ static void decode_gains(AMRContext *p,
float *fixed_gain_factor)
{
if (mode == MODE_12k2 || mode == MODE_7k95) {
- p->pitch_gain[4] = qua_gain_pit [amr_subframe->p_gain ] / 16384.0;
- *fixed_gain_factor = qua_gain_code[amr_subframe->fixed_gain] / 2048.0;
+ p->pitch_gain[4] = qua_gain_pit [amr_subframe->p_gain ]
+ * (1.0 / 16384.0);
+ *fixed_gain_factor = qua_gain_code[amr_subframe->fixed_gain]
+ * (1.0 / 2048.0);
} else {
const uint16_t *gains;
@@ -614,8 +616,8 @@ static void decode_gains(AMRContext *p,
gains = gains_MODE_4k75[(p->frame.subframe[subframe & 2].p_gain << 1) + (subframe & 1)];
}
- p->pitch_gain[4] = gains[0] / 16384.0;
- *fixed_gain_factor = gains[1] / 4096.0;
+ p->pitch_gain[4] = gains[0] * (1.0 / 16384.0);
+ *fixed_gain_factor = gains[1] * (1.0 / 4096.0);
}
}
More information about the FFmpeg-soc
mailing list