#endif /* GST_DISABLE_GST_DEBUG */
-#define INT_MATRIX_FACTOR_EXPONENT 10
+#define PRECISION_INT 10
typedef void (*MixerFunc) (GstAudioChannelMixer * mix, const gpointer src,
gpointer dst, gint samples);
{
gint i, j;
gfloat tmp;
- gfloat factor = (1 << INT_MATRIX_FACTOR_EXPONENT);
+ gfloat factor = (1 << PRECISION_INT);
mix->matrix_int = g_new0 (gint *, mix->in_channels);
res += in_data[n * inchannels + in] * mix->matrix_int[in][out];
/* remove factor from int matrix */
- res = res >> INT_MATRIX_FACTOR_EXPONENT;
+ res = (res + (1 << (PRECISION_INT - 1))) >> PRECISION_INT;
out_data[n * outchannels + out] = CLAMP (res, G_MININT16, G_MAXINT16);
}
}
res += in_data[n * inchannels + in] * (gint64) mix->matrix_int[in][out];
/* remove factor from int matrix */
- res = res >> INT_MATRIX_FACTOR_EXPONENT;
+ res = (res + (1 << (PRECISION_INT - 1))) >> PRECISION_INT;
out_data[n * outchannels + out] = CLAMP (res, G_MININT32, G_MAXINT32);
}
}