+#define MAKE_COEFF_CUBIC_FLOAT_FUNC(type) \
+static inline void \
+make_coeff_##type##_cubic (gint frac, gint out_rate, type *icoeff) \
+{ \
+ type x = (type) frac / out_rate, x2 = x * x, x3 = x2 * x; \
+ icoeff[0] = 0.16667f * (x3 - x); \
+ icoeff[1] = x + 0.5f * (x2 - x3); \
+ icoeff[3] = -0.33333f * x + 0.5f * x2 - 0.16667f * x3; \
+ icoeff[2] = 1. - icoeff[0] - icoeff[1] - icoeff[3]; \
+}
+#define MAKE_COEFF_CUBIC_INT_FUNC(type,type2,prec) \
+static inline void \
+make_coeff_##type##_cubic (gint frac, gint out_rate, type *icoeff) \
+{ \
+ type x = ((type2) frac << prec) / out_rate; \
+ type one = 1 << prec; \
+ type x2 = ((type2) x * (type2) x) >> prec; \
+ type x3 = ((type2) x2 * (type2) x) >> prec; \
+ icoeff[0] = (((type2) (x3 - x) << prec) / 6) >> prec; \
+ icoeff[1] = x + ((x2 - x3) >> 1); \
+ icoeff[3] = -((((type2) x << prec) / 3) >> prec) + \
+ (x2 >> 1) - ((((type2) x3 << prec) / 6) >> prec); \
+ icoeff[2] = one - icoeff[0] - icoeff[1] - icoeff[3]; \
+}
+
+MAKE_COEFF_CUBIC_INT_FUNC (gint16, gint32, PRECISION_S16);
+MAKE_COEFF_CUBIC_INT_FUNC (gint32, gint64, PRECISION_S32);
+MAKE_COEFF_CUBIC_FLOAT_FUNC (gfloat);
+MAKE_COEFF_CUBIC_FLOAT_FUNC (gdouble);
+
+#define GET_TAPS_INTERPOLATE_FUNC(type,inter) \