diff options
| author | Yoshihisa Uchida <uchida@rockbox.org> | 2010-03-12 11:34:09 +0000 |
|---|---|---|
| committer | Yoshihisa Uchida <uchida@rockbox.org> | 2010-03-12 11:34:09 +0000 |
| commit | 2a9c42d1ed265f67d5dfb15b01c3ca1235127197 (patch) | |
| tree | 70a1dd858a8aa85e9e12157cdce71ac5b196c3d9 /apps/codecs | |
| parent | c7517f5662eda9af236e6206af6f8b02e77bf118 (diff) | |
| download | rockbox-2a9c42d1ed265f67d5dfb15b01c3ca1235127197.zip rockbox-2a9c42d1ed265f67d5dfb15b01c3ca1235127197.tar.gz rockbox-2a9c42d1ed265f67d5dfb15b01c3ca1235127197.tar.bz2 rockbox-2a9c42d1ed265f67d5dfb15b01c3ca1235127197.tar.xz | |
libpcm: output depth corrects for the sign 1bit. linear pcm corrects bits shift.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25131 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
| -rw-r--r-- | apps/codecs/aiff.c | 2 | ||||
| -rw-r--r-- | apps/codecs/libpcm/linear_pcm.c | 4 | ||||
| -rw-r--r-- | apps/codecs/libpcm/pcm_common.h | 4 | ||||
| -rw-r--r-- | apps/codecs/smaf.c | 2 | ||||
| -rw-r--r-- | apps/codecs/vox.c | 2 | ||||
| -rw-r--r-- | apps/codecs/wav.c | 2 | ||||
| -rw-r--r-- | apps/codecs/wav64.c | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c index 18a48a3..62d79ac 100644 --- a/apps/codecs/aiff.c +++ b/apps/codecs/aiff.c @@ -87,7 +87,7 @@ enum codec_status codec_main(void) uint32_t size; /* Generic codec initialisation */ - ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH); + ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); next_track: if (codec_init()) { diff --git a/apps/codecs/libpcm/linear_pcm.c b/apps/codecs/libpcm/linear_pcm.c index 2a37f3d..82c70eb 100644 --- a/apps/codecs/libpcm/linear_pcm.c +++ b/apps/codecs/libpcm/linear_pcm.c @@ -95,7 +95,7 @@ static inline void decode_s16le(const uint8_t *inbuf, size_t inbufsize, int32_t size_t i = 0; for ( ; i < inbufsize; i += 2) - outbuf[i/2] = (inbuf[i] << INC_DEPTH_16)|(SE(inbuf[i+1]) << INC_DEPTH_16); + outbuf[i/2] = (inbuf[i] << INC_DEPTH_16)|(SE(inbuf[i+1]) << INC_DEPTH_8); } static inline void decode_u16le(const uint8_t *inbuf, size_t inbufsize, int32_t *outbuf) @@ -155,7 +155,7 @@ static inline void decode_u24be(const uint8_t *inbuf, size_t inbufsize, int32_t size_t i = 0; for ( ; i < inbufsize; i += 3) - outbuf[i/3] = (inbuf[i+2] << INC_DEPTH_24)|(inbuf[i+1] << INC_DEPTH_8)| + outbuf[i/3] = (inbuf[i+2] << INC_DEPTH_24)|(inbuf[i+1] << INC_DEPTH_16)| (SFT(inbuf[i]) << INC_DEPTH_8); } diff --git a/apps/codecs/libpcm/pcm_common.h b/apps/codecs/libpcm/pcm_common.h index b303273..412ffbc 100644 --- a/apps/codecs/libpcm/pcm_common.h +++ b/apps/codecs/libpcm/pcm_common.h @@ -25,8 +25,8 @@ #include <stdbool.h> #include <inttypes.h> -/* decoded pcm sample depth */ -#define PCM_OUTPUT_DEPTH 28 +/* decoded pcm sample depth (sample 28bit + sign 1bit) */ +#define PCM_OUTPUT_DEPTH 29 /* Macro that sign extends an unsigned byte */ #define SE(x) ((int32_t)((int8_t)(x))) diff --git a/apps/codecs/smaf.c b/apps/codecs/smaf.c index 9309937..8349d39 100644 --- a/apps/codecs/smaf.c +++ b/apps/codecs/smaf.c @@ -284,7 +284,7 @@ enum codec_status codec_main(void) const struct pcm_codec *codec; /* Generic codec initialisation */ - ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH); + ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); next_track: if (codec_init()) { diff --git a/apps/codecs/vox.c b/apps/codecs/vox.c index f306d8e..21742e1 100644 --- a/apps/codecs/vox.c +++ b/apps/codecs/vox.c @@ -57,7 +57,7 @@ enum codec_status codec_main(void) int offset = 0; /* Generic codec initialisation */ - ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH); + ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); next_track: if (codec_init()) { diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c index f4e7f77..14d7136 100644 --- a/apps/codecs/wav.c +++ b/apps/codecs/wav.c @@ -165,7 +165,7 @@ enum codec_status codec_main(void) uint32_t size; /* Generic codec initialisation */ - ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH); + ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); next_track: if (codec_init()) { diff --git a/apps/codecs/wav64.c b/apps/codecs/wav64.c index f70fb53..1913daf 100644 --- a/apps/codecs/wav64.c +++ b/apps/codecs/wav64.c @@ -173,7 +173,7 @@ enum codec_status codec_main(void) uint64_t size; /* Generic codec initialisation */ - ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH); + ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); next_track: if (codec_init()) { |