Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: 540e5d1: Forget about fixedpoint.c in any HWCODEC bin.

540e5d1: Forget about fixedpoint.c in any HWCODEC bin.

From: Thomas Martitz <kugel_at_rockbox.org>
Date: Mon, 15 Apr 2013 23:43:45 +0200

> From: Michael Sevakis <jethead71_at_rockbox.org>
> Date: Mon, 15 Apr 2013 20:11:28 +0000 (-0400)
> Subject: Forget about fixedpoint.c in any HWCODEC bin.
> X-Git-Url: http://git.rockbox.org/?p=rockbox.git;a=commitdiff_plain;h=540e5d1
>
> 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
> ---
>
> diff --git a/apps/SOURCES b/apps/SOURCES
> index d34d7b8..6005460 100644
> --- a/apps/SOURCES
> +++ b/apps/SOURCES
> _at__at_ -159,12 +159,11 _at__at_ radio/radioart.c
> #endif
> #endif
>
> -fixedpoint.c
> -
> #if CONFIG_CODEC == SWCODEC
> #if INPUT_SRC_CAPS != 0
> audio_path.c
> #endif /* INPUT_SRC_CAPS != 0 */
> +fixedpoint.c
> pcmbuf.c
> codec_thread.c
> playback.c
> diff --git a/firmware/sound.c b/firmware/sound.c
> index e6cfe57..f8358c6 100644
> --- a/firmware/sound.c
> +++ b/firmware/sound.c
> _at__at_ -25,7 +25,6 _at__at_
> #include "config.h"
> #include "system.h"
> #include "sound.h"
> -#include "fixedpoint.h"
> #ifdef HAVE_SW_VOLUME_CONTROL
> #include "pcm_sw_volume.h"
> #endif /* HAVE_SW_VOLUME_CONTROL */
> _at__at_ -128,8 +127,10 _at__at_ static int current_eq_band_gain[AUDIOHW_EQ_BAND_NUM]; /* tenth dB */
> /* Return the sound value scaled to centibels (tenth-decibels) */
> static int sound_value_to_cb(int setting, int value)
> {
> - long e = (1 - sound_numdecimals(setting)) << 16;
> - return fp_mul(value, fp_exp10(e, 16), 16);
> + int shift = 1 - sound_numdecimals(setting);
> + if (shift < 0) do { value /= 10; } while (++shift);
> + if (shift > 0) do { value *= 10; } while (--shift);
> + return value;
> }
>
> static void set_prescaled_volume(void)



Calling apps/ code from firmware? That's bad!

Why not move fixedpoint to firmware (or into the top level lib folder)?

Best regards
Received on 2013-04-15

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy