summaryrefslogtreecommitdiffstats
path: root/lib/rbcodec/codecs/libwma/wmadata.h
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2012-04-30 23:28:57 -0400
committerMichael Giacomelli <giac2000@hotmail.com>2012-05-01 05:42:38 +0200
commit87d3dde15a1f0af6eaac21107d74aa240515fd0c (patch)
treef0148dd45df72e22b610b9069d5d1563adc715b7 /lib/rbcodec/codecs/libwma/wmadata.h
parentf5d9a45e3ffb1326dced431025cc10814ea4b7d8 (diff)
downloadrockbox-87d3dde15a1f0af6eaac21107d74aa240515fd0c.tar.gz
rockbox-87d3dde15a1f0af6eaac21107d74aa240515fd0c.zip
Fix corrupt when repeatidly playing very low bitrate WMA files.
The LSP feature in WMA requires that the noise table values be doubled verses when it is not used. Unfortunately, the previous code would double the same values every time a LSP file was decoded without first resetting them to their original values. Change the code to check if the values are already doubled, and then double/halve them as needed. This is still a bit ugly, in the future consider using the built in rockbox dither instead of a lookup table. Fixes playback when skipping back and forth between low and high bitrate WMA. Change-Id: I4c393092e4a789bc8f98d74274fe207400b9550e Reviewed-on: http://gerrit.rockbox.org/226 Reviewed-by: Michael Giacomelli <giac2000@hotmail.com> Tested-by: Michael Giacomelli <giac2000@hotmail.com>
Diffstat (limited to 'lib/rbcodec/codecs/libwma/wmadata.h')
-rwxr-xr-x[-rw-r--r--]lib/rbcodec/codecs/libwma/wmadata.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rbcodec/codecs/libwma/wmadata.h b/lib/rbcodec/codecs/libwma/wmadata.h
index 07a55df19a..7f97a75676 100644..100755
--- a/lib/rbcodec/codecs/libwma/wmadata.h
+++ b/lib/rbcodec/codecs/libwma/wmadata.h
@@ -1578,7 +1578,8 @@ const fixed64 lsp_pow_e_table[] ICONST_ATTR_WMA_XL_IRAM =
0x0LL
};
-/* table of exp noise values multiplied by 16 in order to reduce rounding error */
+/* table of exp noise values multiplied by 16 in order to reduce rounding error,
+ * note that that first value (0x5) is used as a magic number in the init code*/
fixed32 noisetable_exp[] =
{
0x5, 0xfffffa2e, 0xc2c, 0xb47, 0xffffaebe, 0xfffffa63, 0xfffff7ff, 0x16bd,