Android AudioResamplerFirProcess.h中int和float的不同算术插值函数

Android AudioResamplerFirProcess.h中int和float的不同算术插值函数,android,audio,Android,Audio,目前我正在尝试对AudioResamplerDyn进行一些SSE优化,看起来只有ARM neon优化 在我的实现过程中,我对AudioResamplerFirProcess中的插值函数有一个问题。h: template<typename TC, typename TINTERP> inline TC interpolate(TC coef_0, TC coef_1, TINTERP lerp) { return lerp * (coef_1 - coef_0) + coef_

目前我正在尝试对AudioResamplerDyn进行一些SSE优化,看起来只有ARM neon优化

在我的实现过程中,我对AudioResamplerFirProcess中的插值函数有一个问题。h:

template<typename TC, typename TINTERP>
inline
TC interpolate(TC coef_0, TC coef_1, TINTERP lerp)
{
    return lerp * (coef_1 - coef_0) + coef_0;
}

template<>
inline int16_t interpolate<int16_t, uint32_t>(int16_t coef_0, int16_t coef_1, uint32_t lerp)
{   // in some CPU architectures 16b x 16b multiplies are faster.
    return (static_cast<int16_t>(lerp) * static_cast<int16_t>(coef_1 - coef_0) >> 15) + coef_0;
}
模板
内联
TC插值(TC系数0、TC系数1、TINTERP)
{
返回lerp*(coef_1-coef_0)+coef_0;
}
模板
内联内插(内插系数0、内插系数1、内插系数32)
{//在某些CPU体系结构中,16b x 16b的倍数更快。
返回(静态施法(lerp)*静态施法(coef_1-coef_0)>>15)+coef_0;
}

(int16_t,uint32_t)的代码让我很困惑,因为它看起来不是用于(float,float)的lerp*(coef_1-coef_0)+coef_0的实现。如果有人知道为什么float和int使用不同的算法

该如何准确地使用?一点也不明显。我理解这是因为coefs现在由Q15格式表示。