From c43629f08bc03cc1b169731236d96c11a6a81ac1 Mon Sep 17 00:00:00 2001 From: Marcoen Hirschberg Date: Mon, 6 Aug 2007 23:34:28 +0000 Subject: use the full resolution we get from the WMA decoder and let the DSP code do the rest git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14224 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwma/wmadeci.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'apps/codecs/libwma/wmadeci.c') diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c index b867e5c6f1..dfce09aa01 100644 --- a/apps/codecs/libwma/wmadeci.c +++ b/apps/codecs/libwma/wmadeci.c @@ -1619,10 +1619,10 @@ next: } /* decode a frame of frame_len samples */ -static int wma_decode_frame(WMADecodeContext *s, int16_t *samples) +static int wma_decode_frame(WMADecodeContext *s, int32_t *samples) { - int ret, i, n, a, ch, incr; - int16_t *ptr; + int ret, i, n, ch, incr; + int32_t *ptr; fixed32 *iptr; // rb->splash(HZ, "in wma_decode_frame"); @@ -1646,7 +1646,7 @@ static int wma_decode_frame(WMADecodeContext *s, int16_t *samples) } } - /* convert frame to integer */ + /* return frame with full 30-bit precision */ n = s->frame_len; incr = s->nb_channels; for(ch = 0; ch < s->nb_channels; ++ch) @@ -1656,17 +1656,7 @@ static int wma_decode_frame(WMADecodeContext *s, int16_t *samples) for (i=0;i 32767) - { - a = 32767; - } - else if (a < -32768) - { - a = -32768; - } - *ptr = a; + *ptr = (*iptr++); ptr += incr; } /* prepare for next block */ @@ -1719,7 +1709,7 @@ int wma_decode_superframe_init(WMADecodeContext* s, */ int wma_decode_superframe_frame(WMADecodeContext* s, - int16_t* samples, /*output*/ + int32_t* samples, /*output*/ uint8_t *buf, /*input*/ int buf_size) { -- cgit v1.2.3