summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2005-11-02 19:43:52 +0000
committerThom Johansen <thomj@rockbox.org>2005-11-02 19:43:52 +0000
commit0263ece7f8a69fc34034860a9bc959d61314dc65 (patch)
treef001be80b46e9cff680f79d425e5079f9c6bac72
parent36612151349302d637ee22131761a60df9f7a2f7 (diff)
downloadrockbox-0263ece7f8a69fc34034860a9bc959d61314dc65.tar.gz
rockbox-0263ece7f8a69fc34034860a9bc959d61314dc65.zip
Use direct non-interleaved full precision output data instead of converting to 16 bit interleaved data.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7734 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/aac.c13
-rw-r--r--apps/codecs/libfaad/decoder.c3
2 files changed, 10 insertions, 6 deletions
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c
index 9b07fb8d64..5bb9241d3b 100644
--- a/apps/codecs/aac.c
+++ b/apps/codecs/aac.c
@@ -66,8 +66,8 @@ enum codec_status codec_start(struct codec_api* api)
66 66
67 ci->configure(CODEC_DSP_ENABLE, (bool *)true); 67 ci->configure(CODEC_DSP_ENABLE, (bool *)true);
68 ci->configure(DSP_DITHER, (bool *)false); 68 ci->configure(DSP_DITHER, (bool *)false);
69 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_INTERLEAVED); 69 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_NONINTERLEAVED);
70 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(16)); 70 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(29));
71 71
72 next_track: 72 next_track:
73 73
@@ -100,7 +100,7 @@ enum codec_status codec_start(struct codec_api* api)
100 } 100 }
101 101
102 NeAACDecConfigurationPtr conf = NeAACDecGetCurrentConfiguration(hDecoder); 102 NeAACDecConfigurationPtr conf = NeAACDecGetCurrentConfiguration(hDecoder);
103 conf->outputFormat = 1; // 16-bit integers 103 conf->outputFormat = FAAD_FMT_24BIT; /* irrelevant, we don't convert */
104 NeAACDecSetConfiguration(hDecoder, conf); 104 NeAACDecSetConfiguration(hDecoder, conf);
105 105
106 unsigned long s=0; 106 unsigned long s=0;
@@ -147,7 +147,8 @@ enum codec_status codec_start(struct codec_api* api)
147 /* Decode one block - returned samples will be host-endian */ 147 /* Decode one block - returned samples will be host-endian */
148 rb->yield(); 148 rb->yield();
149 decodedbuffer = NeAACDecDecode(hDecoder, &frameInfo, buffer, n); 149 decodedbuffer = NeAACDecDecode(hDecoder, &frameInfo, buffer, n);
150 150 /* ignore decodedbuffer return value, we access samples in the
151 decoder struct directly */
151 if (frameInfo.error > 0) { 152 if (frameInfo.error > 0) {
152 LOGF("FAAD: decoding error \"%s\"\n", NeAACDecGetErrorMessage(frameInfo.error)); 153 LOGF("FAAD: decoding error \"%s\"\n", NeAACDecGetErrorMessage(frameInfo.error));
153 return CODEC_ERROR; 154 return CODEC_ERROR;
@@ -161,7 +162,9 @@ enum codec_status codec_start(struct codec_api* api)
161 162
162 /* Output the audio */ 163 /* Output the audio */
163 rb->yield(); 164 rb->yield();
164 while (!rb->pcmbuf_insert((char*)decodedbuffer, frameInfo.samples << 1)) 165 while (!rb->pcmbuf_insert_split(hDecoder->time_out[0],
166 hDecoder->time_out[1],
167 frameInfo.samples*2))
165 rb->yield(); 168 rb->yield();
166 169
167 /* Update the elapsed-time indicator */ 170 /* Update the elapsed-time indicator */
diff --git a/apps/codecs/libfaad/decoder.c b/apps/codecs/libfaad/decoder.c
index 10d97952bd..145247784f 100644
--- a/apps/codecs/libfaad/decoder.c
+++ b/apps/codecs/libfaad/decoder.c
@@ -982,9 +982,10 @@ static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
982 } 982 }
983#endif 983#endif
984 984
985 /* we don't need sample conversion in rockbox.
985 sample_buffer = output_to_PCM(hDecoder, hDecoder->time_out, sample_buffer, 986 sample_buffer = output_to_PCM(hDecoder, hDecoder->time_out, sample_buffer,
986 output_channels, frame_len, hDecoder->config.outputFormat); 987 output_channels, frame_len, hDecoder->config.outputFormat);
987 988 */
988 989
989 hDecoder->postSeekResetFlag = 0; 990 hDecoder->postSeekResetFlag = 0;
990 991