static inline T ResampleBiLinear(T src[], int oH, int oV, float xf, float yf) { // Resample a pixel using bilinear interpolation float h1 = ResampleLinear(src[0 ], src[ oH], xf); float h2 = ResampleLinear(src[oV], src[oV+oH], xf); float v = ResampleLinear(h1, h2, yf); return (T) v; }
static void inline add_to_buffer(void* stream, unsigned int length) { unsigned int lengthLeft; unsigned int rlengthLeft; lengthLeft = length >> 2; rlengthLeft = ceil(lengthLeft * freq_ratio); // copy_to_buffer((int *)buffer, stream , rlengthLeft, lengthLeft); ResampleLinear((s16 *) stream, lengthLeft, (s16 *) buffer, rlengthLeft); buffer_size = rlengthLeft << 2; play_buffer(); }