diff options
Diffstat (limited to 'apps/codecs/libwma/wmadeci.c')
-rw-r--r-- | apps/codecs/libwma/wmadeci.c | 22 |
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 */ |
1622 | static int wma_decode_frame(WMADecodeContext *s, int16_t *samples) | 1622 | static 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 | ||
1721 | int wma_decode_superframe_frame(WMADecodeContext* s, | 1711 | int 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 | { |