ref: 35a44c6100648f62955e5389b2ffdcff77fccffc
parent: c16a96b45886283d23f8bfda5bad115397f21689
author: Jean-Marc Valin <[email protected]>
date: Fri Nov 29 07:21:34 EST 2013
Fixes OPUS_SET_GAIN (was a bug in MULT16_32_P16())
--- a/celt/fixed_generic.h
+++ b/celt/fixed_generic.h
@@ -40,7 +40,7 @@
#define MULT16_32_Q16(a,b) ADD32(MULT16_16((a),SHR((b),16)), SHR(MULT16_16SU((a),((b)&0x0000ffff)),16))
/** 16x32 multiplication, followed by a 16-bit shift right (round-to-nearest). Results fits in 32 bits */
-#define MULT16_32_P16(a,b) ADD32(MULT16_16((a),SHR((b),16)), PSHR(MULT16_16((a),((b)&0x0000ffff)),16))
+#define MULT16_32_P16(a,b) ADD32(MULT16_16((a),SHR((b),16)), PSHR(MULT16_16SU((a),((b)&0x0000ffff)),16))
/** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
#define MULT16_32_Q15(a,b) ADD32(SHL(MULT16_16((a),SHR((b),16)),1), SHR(MULT16_16SU((a),((b)&0x0000ffff)),15))