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.tar.gz rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.zip |
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 66ec390097..2dd3f000b1 100644 --- a/apps/codecs/libpcm/adpcm_seek.h +++ b/apps/codecs/libpcm/adpcm_seek.h | |||
@@ -21,9 +21,9 @@ | |||
21 | #ifndef CODEC_LIBPCM_ADPCM_SEEK_H | 21 | #ifndef CODEC_LIBPCM_ADPCM_SEEK_H |
22 | #define CODEC_LIBPCM_ADPCM_SEEK_H | 22 | #define CODEC_LIBPCM_ADPCM_SEEK_H |
23 | 23 | ||
24 | #include <sys/types.h> | ||
25 | #include <stdbool.h> | 24 | #include <stdbool.h> |
26 | #include <inttypes.h> | 25 | #include <inttypes.h> |
26 | #include <string.h> | ||
27 | 27 | ||
28 | struct adpcm_data { | 28 | struct adpcm_data { |
29 | int16_t pcmdata[2]; | 29 | 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 = { | |||
63 | }; | 63 | }; |
64 | 64 | ||
65 | static int32_t pcmdata[2]; | 65 | static int32_t pcmdata[2]; |
66 | static int8_t index[2]; | 66 | static int8_t indices[2]; |
67 | 67 | ||
68 | static int adpcm_data_size; | 68 | static int adpcm_data_size; |
69 | static uint8_t step_mask; | 69 | static uint8_t step_mask; |
@@ -107,7 +107,7 @@ void set_decode_parameters(int channels, int32_t *init_pcmdata, int8_t *init_ind | |||
107 | for (ch = 0; ch < channels; ch++) | 107 | for (ch = 0; ch < channels; ch++) |
108 | { | 108 | { |
109 | pcmdata[ch] = init_pcmdata[ch]; | 109 | pcmdata[ch] = init_pcmdata[ch]; |
110 | index[ch] = init_index[ch]; | 110 | indices[ch] = init_index[ch]; |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
@@ -121,7 +121,7 @@ int16_t create_pcmdata(int ch, uint8_t nibble) | |||
121 | { | 121 | { |
122 | int check_bit = 1 << step_shift; | 122 | int check_bit = 1 << step_shift; |
123 | int32_t delta = 0; | 123 | int32_t delta = 0; |
124 | int16_t step = step_table[index[ch]]; | 124 | int16_t step = step_table[indices[ch]]; |
125 | 125 | ||
126 | do { | 126 | do { |
127 | if (nibble & check_bit) | 127 | if (nibble & check_bit) |
@@ -136,8 +136,8 @@ int16_t create_pcmdata(int ch, uint8_t nibble) | |||
136 | else | 136 | else |
137 | pcmdata[ch] += delta; | 137 | pcmdata[ch] += delta; |
138 | 138 | ||
139 | index[ch] += use_index_table[nibble & step_mask]; | 139 | indices[ch] += use_index_table[nibble & step_mask]; |
140 | CLIP(index[ch], 0, 88); | 140 | CLIP(indices[ch], 0, 88); |
141 | 141 | ||
142 | CLIP(pcmdata[ch], -32768, 32767); | 142 | CLIP(pcmdata[ch], -32768, 32767); |
143 | 143 | ||
@@ -150,7 +150,7 @@ int16_t create_pcmdata(int ch, uint8_t nibble) | |||
150 | int16_t create_pcmdata_size4(int ch, uint8_t nibble) | 150 | int16_t create_pcmdata_size4(int ch, uint8_t nibble) |
151 | { | 151 | { |
152 | int32_t delta; | 152 | int32_t delta; |
153 | int16_t step = step_table[index[ch]]; | 153 | int16_t step = step_table[indices[ch]]; |
154 | 154 | ||
155 | delta = (step >> 3); | 155 | delta = (step >> 3); |
156 | if (nibble & 4) delta += step; | 156 | if (nibble & 4) delta += step; |
@@ -162,8 +162,8 @@ int16_t create_pcmdata_size4(int ch, uint8_t nibble) | |||
162 | else | 162 | else |
163 | pcmdata[ch] += delta; | 163 | pcmdata[ch] += delta; |
164 | 164 | ||
165 | index[ch] += use_index_table[nibble & 0x07]; | 165 | indices[ch] += use_index_table[nibble & 0x07]; |
166 | CLIP(index[ch], 0, 88); | 166 | CLIP(indices[ch], 0, 88); |
167 | 167 | ||
168 | CLIP(pcmdata[ch], -32768, 32767); | 168 | CLIP(pcmdata[ch], -32768, 32767); |
169 | 169 | ||
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 @@ | |||
21 | #ifndef CODEC_LIBPCM_IMA_ADPCM_COMMON_H | 21 | #ifndef CODEC_LIBPCM_IMA_ADPCM_COMMON_H |
22 | #define CODEC_LIBPCM_IMA_ADPCM_COMMON_H | 22 | #define CODEC_LIBPCM_IMA_ADPCM_COMMON_H |
23 | 23 | ||
24 | #include <sys/types.h> | ||
25 | #include <stdbool.h> | 24 | #include <stdbool.h> |
26 | #include <inttypes.h> | 25 | #include <inttypes.h> |
27 | 26 | ||
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 @@ | |||
21 | #ifndef CODEC_LIBPCM_PCM_COMMON_H | 21 | #ifndef CODEC_LIBPCM_PCM_COMMON_H |
22 | #define CODEC_LIBPCM_PCM_COMMON_H | 22 | #define CODEC_LIBPCM_PCM_COMMON_H |
23 | 23 | ||
24 | #include <sys/types.h> | ||
25 | #include <stdbool.h> | 24 | #include <stdbool.h> |
26 | #include <inttypes.h> | 25 | #include <inttypes.h> |
26 | #include <string.h> | ||
27 | 27 | ||
28 | /* decoded pcm sample depth (sample 28bit + sign 1bit) */ | 28 | /* decoded pcm sample depth (sample 28bit + sign 1bit) */ |
29 | #define PCM_OUTPUT_DEPTH 29 | 29 | #define PCM_OUTPUT_DEPTH 29 |