summaryrefslogtreecommitdiff
path: root/firmware/sound.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-04-15 16:11:28 -0400
committerMichael Sevakis <jethead71@rockbox.org>2013-04-15 16:11:28 -0400
commit540e5d103f803cfd508297f483c054328c59375f (patch)
tree08f109fe67dcb263d07b0c227a79fc0b44143e0f /firmware/sound.c
parent333f4f52bebab0140b7ee5cf154cb0739379a20f (diff)
downloadrockbox-540e5d103f803cfd508297f483c054328c59375f.tar.gz
rockbox-540e5d103f803cfd508297f483c054328c59375f.zip
Forget about fixedpoint.c in any HWCODEC bin.
It bloats to much just for one simple use. Just use a simple function for shifting sound setting decimal places. Change-Id: I1a7d37cce6ada3c6e6600dc0d301f354ffeff231
Diffstat (limited to 'firmware/sound.c')
-rw-r--r--firmware/sound.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/sound.c b/firmware/sound.c
index e6cfe57cf5..f8358c690d 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -25,7 +25,6 @@
25#include "config.h" 25#include "config.h"
26#include "system.h" 26#include "system.h"
27#include "sound.h" 27#include "sound.h"
28#include "fixedpoint.h"
29#ifdef HAVE_SW_VOLUME_CONTROL 28#ifdef HAVE_SW_VOLUME_CONTROL
30#include "pcm_sw_volume.h" 29#include "pcm_sw_volume.h"
31#endif /* HAVE_SW_VOLUME_CONTROL */ 30#endif /* HAVE_SW_VOLUME_CONTROL */
@@ -128,8 +127,10 @@ static int current_eq_band_gain[AUDIOHW_EQ_BAND_NUM]; /* tenth dB */
128/* Return the sound value scaled to centibels (tenth-decibels) */ 127/* Return the sound value scaled to centibels (tenth-decibels) */
129static int sound_value_to_cb(int setting, int value) 128static int sound_value_to_cb(int setting, int value)
130{ 129{
131 long e = (1 - sound_numdecimals(setting)) << 16; 130 int shift = 1 - sound_numdecimals(setting);
132 return fp_mul(value, fp_exp10(e, 16), 16); 131 if (shift < 0) do { value /= 10; } while (++shift);
132 if (shift > 0) do { value *= 10; } while (--shift);
133 return value;
133} 134}
134 135
135static void set_prescaled_volume(void) 136static void set_prescaled_volume(void)