summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Bryant <bryant@rockbox.org>2005-09-30 21:11:31 +0000
committerDave Bryant <bryant@rockbox.org>2005-09-30 21:11:31 +0000
commitf0fe3c94772ddf971810e5082dcfb9b0ac462ae4 (patch)
tree3ee8e43a93fd3441bbb9b71a094406a83e4435a8
parenta1de081a1b22fdcb8c5530f702866ca658cc68c2 (diff)
downloadrockbox-f0fe3c94772ddf971810e5082dcfb9b0ac462ae4.tar.gz
rockbox-f0fe3c94772ddf971810e5082dcfb9b0ac462ae4.zip
Fix some WavPack bugs by forcing DSP use even when not needed for sampling rate
conversion or ReplayGain. Costs about 12% boost ratio when DSP would not have been used before. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7573 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/wavpack.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/codecs/wavpack.c b/apps/codecs/wavpack.c
index 12a05bbe37..e97724a94e 100644
--- a/apps/codecs/wavpack.c
+++ b/apps/codecs/wavpack.c
@@ -26,6 +26,9 @@
26 26
27static struct codec_api *ci; 27static struct codec_api *ci;
28 28
29#define FORCE_DSP_USE /* fixes some WavPack bugs; adds about 12% to boost ratio
30 (when DSP would not have been used) */
31
29#define BUFFER_SIZE 4096 32#define BUFFER_SIZE 4096
30 33
31static long temp_buffer [BUFFER_SIZE] IDATA_ATTR; 34static long temp_buffer [BUFFER_SIZE] IDATA_ATTR;
@@ -75,6 +78,11 @@ enum codec_status codec_start(struct codec_api* api)
75 while (!*ci->taginfo_ready && !ci->stop_codec) 78 while (!*ci->taginfo_ready && !ci->stop_codec)
76 ci->sleep(1); 79 ci->sleep(1);
77 80
81#ifdef FORCE_DSP_USE
82 ci->configure(CODEC_DSP_ENABLE, (bool *)true);
83 ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency));
84 codec_set_replaygain(ci->id3);
85#else
78 if (ci->id3->frequency != NATIVE_FREQUENCY || 86 if (ci->id3->frequency != NATIVE_FREQUENCY ||
79 ci->global_settings->replaygain) { 87 ci->global_settings->replaygain) {
80 ci->configure(CODEC_DSP_ENABLE, (bool *)true); 88 ci->configure(CODEC_DSP_ENABLE, (bool *)true);
@@ -83,7 +91,8 @@ enum codec_status codec_start(struct codec_api* api)
83 } 91 }
84 else 92 else
85 ci->configure(CODEC_DSP_ENABLE, (bool *)false); 93 ci->configure(CODEC_DSP_ENABLE, (bool *)false);
86 94#endif
95
87 /* Create a decoder instance */ 96 /* Create a decoder instance */
88 wpc = WavpackOpenFileInput (read_callback, error); 97 wpc = WavpackOpenFileInput (read_callback, error);
89 98