mirror of https://github.com/thesofproject/sof.git
Audio format: Bug fix for erroneous fractional multiplication macro
Due to misplaced parentheses the computation gives half of correct result and omits rounding. Currently this macro is not used by code in SOF git repository. Developers who may use format.h macros should check their code. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
parent
dde493c45b
commit
359af81a8a
|
@ -85,7 +85,8 @@
|
|||
/* Fractional multiplication with shift and round
|
||||
* Note that the parameters px and py must be cast to (int64_t) if other type.
|
||||
*/
|
||||
#define Q_MULTSR_32X32(px, py, qx, qy, qp) (((px) * (py) >> (((qx)+(qy)-(qp)-1) +1) >> 1))
|
||||
#define Q_MULTSR_32X32(px, py, qx, qy, qp) \
|
||||
((((px) * (py) >> ((qx)+(qy)-(qp)-1)) + 1) >> 1)
|
||||
|
||||
/* Saturation */
|
||||
#define SATP_INT32(x) (((x) > INT32_MAX) ? INT32_MAX : (x))
|
||||
|
|
Loading…
Reference in New Issue