diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2010-05-06 21:04:40 +0000 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2010-05-06 21:04:40 +0000 |
| commit | 50a6ca39ad4ed01922aa4f755f0ca579788226cf (patch) | |
| tree | c7881b015b220558167310345b162324c96be15a /apps/codecs/libpcm | |
| parent | adb506df14aded06ed6e9ebf8540e6fd383ffd6a (diff) | |
| download | rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.zip rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.gz rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.bz2 rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.xz | |
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
Diffstat (limited to 'apps/codecs/libpcm')
| -rw-r--r-- | apps/codecs/libpcm/adpcm_seek.h | 2 | ||||
| -rw-r--r-- | apps/codecs/libpcm/ima_adpcm_common.c | 16 | ||||
| -rw-r--r-- | apps/codecs/libpcm/ima_adpcm_common.h | 1 | ||||
| -rw-r--r-- | apps/codecs/libpcm/pcm_common.h | 2 |
4 files changed, 10 insertions, 11 deletions
diff --git a/apps/codecs/libpcm/adpcm_seek.h b/apps/codecs/libpcm/adpcm_seek.h index 66ec390..2dd3f00 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 <sys/types.h> #include <stdbool.h> #include <inttypes.h> +#include <string.h> 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 ff5051f..724cce3 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 0a2129b..46fd608 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 <sys/types.h> #include <stdbool.h> #include <inttypes.h> diff --git a/apps/codecs/libpcm/pcm_common.h b/apps/codecs/libpcm/pcm_common.h index 91c3ab7..90e29c9 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 <sys/types.h> #include <stdbool.h> #include <inttypes.h> +#include <string.h> /* decoded pcm sample depth (sample 28bit + sign 1bit) */ #define PCM_OUTPUT_DEPTH 29 |