From 50a6ca39ad4ed01922aa4f755f0ca579788226cf Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 6 May 2010 21:04:40 +0000 Subject: Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes). This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libpcm/adpcm_seek.h | 2 +- apps/codecs/libpcm/ima_adpcm_common.c | 16 ++++++++-------- apps/codecs/libpcm/ima_adpcm_common.h | 1 - apps/codecs/libpcm/pcm_common.h | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'apps/codecs/libpcm') diff --git a/apps/codecs/libpcm/adpcm_seek.h b/apps/codecs/libpcm/adpcm_seek.h index 66ec390097..2dd3f000b1 100644 --- a/apps/codecs/libpcm/adpcm_seek.h +++ b/apps/codecs/libpcm/adpcm_seek.h @@ -21,9 +21,9 @@ #ifndef CODEC_LIBPCM_ADPCM_SEEK_H #define CODEC_LIBPCM_ADPCM_SEEK_H -#include #include #include +#include struct adpcm_data { int16_t pcmdata[2]; diff --git a/apps/codecs/libpcm/ima_adpcm_common.c b/apps/codecs/libpcm/ima_adpcm_common.c index ff5051f166..724cce31b0 100644 --- a/apps/codecs/libpcm/ima_adpcm_common.c +++ b/apps/codecs/libpcm/ima_adpcm_common.c @@ -63,7 +63,7 @@ static const int index_tables[4][16] ICONST_ATTR = { }; static int32_t pcmdata[2]; -static int8_t index[2]; +static int8_t indices[2]; static int adpcm_data_size; static uint8_t step_mask; @@ -107,7 +107,7 @@ void set_decode_parameters(int channels, int32_t *init_pcmdata, int8_t *init_ind for (ch = 0; ch < channels; ch++) { pcmdata[ch] = init_pcmdata[ch]; - index[ch] = init_index[ch]; + indices[ch] = init_index[ch]; } } @@ -121,7 +121,7 @@ int16_t create_pcmdata(int ch, uint8_t nibble) { int check_bit = 1 << step_shift; int32_t delta = 0; - int16_t step = step_table[index[ch]]; + int16_t step = step_table[indices[ch]]; do { if (nibble & check_bit) @@ -136,8 +136,8 @@ int16_t create_pcmdata(int ch, uint8_t nibble) else pcmdata[ch] += delta; - index[ch] += use_index_table[nibble & step_mask]; - CLIP(index[ch], 0, 88); + indices[ch] += use_index_table[nibble & step_mask]; + CLIP(indices[ch], 0, 88); CLIP(pcmdata[ch], -32768, 32767); @@ -150,7 +150,7 @@ int16_t create_pcmdata(int ch, uint8_t nibble) int16_t create_pcmdata_size4(int ch, uint8_t nibble) { int32_t delta; - int16_t step = step_table[index[ch]]; + int16_t step = step_table[indices[ch]]; delta = (step >> 3); if (nibble & 4) delta += step; @@ -162,8 +162,8 @@ int16_t create_pcmdata_size4(int ch, uint8_t nibble) else pcmdata[ch] += delta; - index[ch] += use_index_table[nibble & 0x07]; - CLIP(index[ch], 0, 88); + indices[ch] += use_index_table[nibble & 0x07]; + CLIP(indices[ch], 0, 88); CLIP(pcmdata[ch], -32768, 32767); diff --git a/apps/codecs/libpcm/ima_adpcm_common.h b/apps/codecs/libpcm/ima_adpcm_common.h index 0a2129bdf2..46fd6083ec 100644 --- a/apps/codecs/libpcm/ima_adpcm_common.h +++ b/apps/codecs/libpcm/ima_adpcm_common.h @@ -21,7 +21,6 @@ #ifndef CODEC_LIBPCM_IMA_ADPCM_COMMON_H #define CODEC_LIBPCM_IMA_ADPCM_COMMON_H -#include #include #include diff --git a/apps/codecs/libpcm/pcm_common.h b/apps/codecs/libpcm/pcm_common.h index 91c3ab7f1e..90e29c98ee 100644 --- a/apps/codecs/libpcm/pcm_common.h +++ b/apps/codecs/libpcm/pcm_common.h @@ -21,9 +21,9 @@ #ifndef CODEC_LIBPCM_PCM_COMMON_H #define CODEC_LIBPCM_PCM_COMMON_H -#include #include #include +#include /* decoded pcm sample depth (sample 28bit + sign 1bit) */ #define PCM_OUTPUT_DEPTH 29 -- cgit v1.2.3