diff options
author | Koen Vos <koen.vos@skype.net> | 2011-12-14 11:39:29 -0500 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-12-14 11:41:18 -0500 |
commit | a51ebd6831e839551255999f501dbf635c0f1943 (patch) | |
tree | 539dc5d16fcf06e5dbb96561dfb08673c6183a40 /silk/log2lin.c | |
parent | 5609cec9a5e1ea8fcb056f2306a115cb3b61c4c9 (diff) | |
download | opus-a51ebd6831e839551255999f501dbf635c0f1943.tar.gz |
Accuracy improvements to help float implementations
Also clamps the gain to avoid forcing a float decoder to emulate the
state rescaling.
Diffstat (limited to 'silk/log2lin.c')
-rw-r--r-- | silk/log2lin.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/silk/log2lin.c b/silk/log2lin.c index 1a78de59..0a3d90be 100644 --- a/silk/log2lin.c +++ b/silk/log2lin.c @@ -47,10 +47,10 @@ opus_int32 silk_log2lin( frac_Q7 = inLog_Q7 & 0x7F; if( inLog_Q7 < 2048 ) { /* Piece-wise parabolic approximation */ - out = silk_ADD_RSHIFT( out, silk_MUL( out, silk_SMLAWB( frac_Q7, silk_MUL( frac_Q7, 128 - frac_Q7 ), -174 ) ), 7 ); + out = silk_ADD_RSHIFT( out, silk_MUL( out, silk_SMLAWB( frac_Q7, silk_SMULBB( frac_Q7, 128 - frac_Q7 ), -174 ) ), 7 ); } else { /* Piece-wise parabolic approximation */ - out = silk_MLA( out, silk_RSHIFT( out, 7 ), silk_SMLAWB( frac_Q7, silk_MUL( frac_Q7, 128 - frac_Q7 ), -174 ) ); + out = silk_MLA( out, silk_RSHIFT( out, 7 ), silk_SMLAWB( frac_Q7, silk_SMULBB( frac_Q7, 128 - frac_Q7 ), -174 ) ); } return out; } |