mirror of https://github.com/thesofproject/sof.git
sof: drc: fix drc_pow_fixed function
The proposed calculation doesn't take negative or zero input-x into consideration, and we also don't need such use cases. Just return 0 for those input-x. Signed-off-by: Pin-chih Lin <johnylin@google.com>
This commit is contained in:
parent
90f7ac47b2
commit
5f2de711a0
|
@ -183,6 +183,10 @@ inline int32_t drc_asin_fixed(int32_t x)
|
|||
*/
|
||||
inline int32_t drc_pow_fixed(int32_t x, int32_t y)
|
||||
{
|
||||
/* Negative or zero input x is not supported, just return 0. */
|
||||
if (x <= 0)
|
||||
return 0;
|
||||
|
||||
/* x^y = expf(y * log(x)) */
|
||||
return exp_fixed(q_mult(y, drc_log_fixed(x), 30, 26, 27));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue