summaryrefslogtreecommitdiff
path: root/apps/codecs/libwma/wmadeci.c
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2007-08-06 23:34:28 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2007-08-06 23:34:28 +0000
commitc43629f08bc03cc1b169731236d96c11a6a81ac1 (patch)
tree046592ddcb6c6200eecd172940d7bda67172133a /apps/codecs/libwma/wmadeci.c
parent0ee44031f0b5ab7539886b43685b67b3a14159a1 (diff)
downloadrockbox-c43629f08bc03cc1b169731236d96c11a6a81ac1.tar.gz
rockbox-c43629f08bc03cc1b169731236d96c11a6a81ac1.zip
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
Diffstat (limited to 'apps/codecs/libwma/wmadeci.c')
-rw-r--r--apps/codecs/libwma/wmadeci.c22
1 files changed, 6 insertions, 16 deletions
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:
1619} 1619}
1620 1620
1621/* decode a frame of frame_len samples */ 1621/* decode a frame of frame_len samples */
1622static int wma_decode_frame(WMADecodeContext *s, int16_t *samples) 1622static int wma_decode_frame(WMADecodeContext *s, int32_t *samples)
1623{ 1623{
1624 int ret, i, n, a, ch, incr; 1624 int ret, i, n, ch, incr;
1625 int16_t *ptr; 1625 int32_t *ptr;
1626 fixed32 *iptr; 1626 fixed32 *iptr;
1627 // rb->splash(HZ, "in wma_decode_frame"); 1627 // rb->splash(HZ, "in wma_decode_frame");
1628 1628
@@ -1646,7 +1646,7 @@ static int wma_decode_frame(WMADecodeContext *s, int16_t *samples)
1646 } 1646 }
1647 } 1647 }
1648 1648
1649 /* convert frame to integer */ 1649 /* return frame with full 30-bit precision */
1650 n = s->frame_len; 1650 n = s->frame_len;
1651 incr = s->nb_channels; 1651 incr = s->nb_channels;
1652 for(ch = 0; ch < s->nb_channels; ++ch) 1652 for(ch = 0; ch < s->nb_channels; ++ch)
@@ -1656,17 +1656,7 @@ static int wma_decode_frame(WMADecodeContext *s, int16_t *samples)
1656 1656
1657 for (i=0;i<n;++i) 1657 for (i=0;i<n;++i)
1658 { 1658 {
1659 a = fixtoi32(*iptr++)<<1; //ugly but good enough for now 1659 *ptr = (*iptr++);
1660
1661 if (a > 32767)
1662 {
1663 a = 32767;
1664 }
1665 else if (a < -32768)
1666 {
1667 a = -32768;
1668 }
1669 *ptr = a;
1670 ptr += incr; 1660 ptr += incr;
1671 } 1661 }
1672 /* prepare for next block */ 1662 /* prepare for next block */
@@ -1719,7 +1709,7 @@ int wma_decode_superframe_init(WMADecodeContext* s,
1719*/ 1709*/
1720 1710
1721int wma_decode_superframe_frame(WMADecodeContext* s, 1711int wma_decode_superframe_frame(WMADecodeContext* s,
1722 int16_t* samples, /*output*/ 1712 int32_t* samples, /*output*/
1723 uint8_t *buf, /*input*/ 1713 uint8_t *buf, /*input*/
1724 int buf_size) 1714 int buf_size)
1725{ 1715{