Commit 5df3c0ce authored by David Reid's avatar David Reid

SRC: Add APIs for querying required input and expected output frames.

  * ma_resampler_get_required_input_frame_count()
  * ma_resampler_get_expected_output_frame_count()

These have not yet been implemented for the Speex backend.

This commit also adds an APIs for setting changing the rate:

  * ma_resampler_set_rate()
  * ma_resampler_set_rate_ratio()
parent 8fabcc44
...@@ -4331,6 +4331,25 @@ static MA_INLINE float ma_scale_to_range_f32(float x, float lo, float hi) ...@@ -4331,6 +4331,25 @@ static MA_INLINE float ma_scale_to_range_f32(float x, float lo, float hi)
} }
/*
Greatest common factor using Euclid's algorithm iteratively.
*/
static MA_INLINE ma_uint32 ma_gcf_u32(ma_uint32 a, ma_uint32 b)
{
for (;;) {
if (b == 0) {
break;
} else {
ma_uint32 t = a;
a = b;
b = t % a;
}
}
return a;
}
/* /*
Random Number Generation Random Number Generation
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment