diff options
author | Yoshihisa Uchida <uchida@rockbox.org> | 2010-02-24 11:30:16 +0000 |
---|---|---|
committer | Yoshihisa Uchida <uchida@rockbox.org> | 2010-02-24 11:30:16 +0000 |
commit | aa58715a54cb62638b263b7942c46e25ec928534 (patch) | |
tree | 39f213b28d3f8de4460407ec358476a7beed4464 | |
parent | 31fb4f6ff65db32a23217c097d4848fd9292973b (diff) | |
download | rockbox-aa58715a54cb62638b263b7942c46e25ec928534.tar.gz rockbox-aa58715a54cb62638b263b7942c46e25ec928534.zip |
libpcm: deletes PCM_CHUNK_SIZE.
aiif.c/wav.c: deletes #include <inttypes.h>.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24877 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/aiff.c | 9 | ||||
-rw-r--r-- | apps/codecs/libpcm/pcm_common.h | 7 | ||||
-rw-r--r-- | apps/codecs/wav.c | 9 |
3 files changed, 10 insertions, 15 deletions
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c index 4b870386c1..fbe814a645 100644 --- a/apps/codecs/aiff.c +++ b/apps/codecs/aiff.c | |||
@@ -21,7 +21,6 @@ | |||
21 | ****************************************************************************/ | 21 | ****************************************************************************/ |
22 | 22 | ||
23 | #include "codeclib.h" | 23 | #include "codeclib.h" |
24 | #include <inttypes.h> | ||
25 | #include "codecs/libpcm/support_formats.h" | 24 | #include "codecs/libpcm/support_formats.h" |
26 | 25 | ||
27 | CODEC_HEADER | 26 | CODEC_HEADER |
@@ -50,7 +49,9 @@ static const struct pcm_entry pcm_codecs[] = { | |||
50 | 49 | ||
51 | #define NUM_FORMATS 6 | 50 | #define NUM_FORMATS 6 |
52 | 51 | ||
53 | static int32_t samples[PCM_CHUNK_SIZE] IBSS_ATTR; | 52 | #define PCM_SAMPLE_SIZE (1024*2) |
53 | |||
54 | static int32_t samples[PCM_SAMPLE_SIZE] IBSS_ATTR; | ||
54 | 55 | ||
55 | static const struct pcm_codec *get_codec(uint32_t formattag) | 56 | static const struct pcm_codec *get_codec(uint32_t formattag) |
56 | { | 57 | { |
@@ -266,8 +267,8 @@ next_track: | |||
266 | 267 | ||
267 | /* check chunksize */ | 268 | /* check chunksize */ |
268 | if ((format.chunksize / format.blockalign) * format.samplesperblock * format.channels | 269 | if ((format.chunksize / format.blockalign) * format.samplesperblock * format.channels |
269 | > PCM_CHUNK_SIZE) | 270 | > PCM_SAMPLE_SIZE) |
270 | format.chunksize = (PCM_CHUNK_SIZE / format.blockalign) * format.blockalign; | 271 | format.chunksize = (PCM_SAMPLE_SIZE / format.blockalign) * format.blockalign; |
271 | if (format.chunksize == 0) | 272 | if (format.chunksize == 0) |
272 | { | 273 | { |
273 | DEBUGF("CODEC_ERROR: chunksize is 0\n"); | 274 | DEBUGF("CODEC_ERROR: chunksize is 0\n"); |
diff --git a/apps/codecs/libpcm/pcm_common.h b/apps/codecs/libpcm/pcm_common.h index d490a85e9f..7dcacbd19a 100644 --- a/apps/codecs/libpcm/pcm_common.h +++ b/apps/codecs/libpcm/pcm_common.h | |||
@@ -25,13 +25,6 @@ | |||
25 | #include <stdbool.h> | 25 | #include <stdbool.h> |
26 | #include <inttypes.h> | 26 | #include <inttypes.h> |
27 | 27 | ||
28 | /* | ||
29 | * PCM_CHUNK_SIZE has the size only of storing the sample at 1/50 seconds. | ||
30 | * But it might not be 1/50 seconds according to the format. | ||
31 | * Please confirm the source file of each format. | ||
32 | */ | ||
33 | #define PCM_CHUNK_SIZE (4096*2) | ||
34 | |||
35 | /* Macro that sign extends an unsigned byte */ | 28 | /* Macro that sign extends an unsigned byte */ |
36 | #define SE(x) ((int32_t)((int8_t)(x))) | 29 | #define SE(x) ((int32_t)((int8_t)(x))) |
37 | 30 | ||
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c index 293089a737..c2564231c1 100644 --- a/apps/codecs/wav.c +++ b/apps/codecs/wav.c | |||
@@ -21,7 +21,6 @@ | |||
21 | ****************************************************************************/ | 21 | ****************************************************************************/ |
22 | 22 | ||
23 | #include "codeclib.h" | 23 | #include "codeclib.h" |
24 | #include "inttypes.h" | ||
25 | #include "codecs/libpcm/support_formats.h" | 24 | #include "codecs/libpcm/support_formats.h" |
26 | 25 | ||
27 | CODEC_HEADER | 26 | CODEC_HEADER |
@@ -38,7 +37,9 @@ CODEC_HEADER | |||
38 | * | 37 | * |
39 | */ | 38 | */ |
40 | 39 | ||
41 | static int32_t samples[PCM_CHUNK_SIZE] IBSS_ATTR; | 40 | #define PCM_SAMPLE_SIZE (4096*2) |
41 | |||
42 | static int32_t samples[PCM_SAMPLE_SIZE] IBSS_ATTR; | ||
42 | 43 | ||
43 | /* This codec support WAVE files with the following formats: */ | 44 | /* This codec support WAVE files with the following formats: */ |
44 | enum | 45 | enum |
@@ -350,8 +351,8 @@ next_track: | |||
350 | 351 | ||
351 | /* check chunksize */ | 352 | /* check chunksize */ |
352 | if ((format.chunksize / format.blockalign) * format.samplesperblock * format.channels | 353 | if ((format.chunksize / format.blockalign) * format.samplesperblock * format.channels |
353 | > PCM_CHUNK_SIZE) | 354 | > PCM_SAMPLE_SIZE) |
354 | format.chunksize = (PCM_CHUNK_SIZE / format.blockalign) * format.blockalign; | 355 | format.chunksize = (PCM_SAMPLE_SIZE / format.blockalign) * format.blockalign; |
355 | if (format.chunksize == 0) | 356 | if (format.chunksize == 0) |
356 | { | 357 | { |
357 | DEBUGF("CODEC_ERROR: chunksize is 0\n"); | 358 | DEBUGF("CODEC_ERROR: chunksize is 0\n"); |