audio-resampler: estimate memory usage in auto mode
Estimate the memory usage and use this to decide between full or interpolated filter.
This commit is contained in:
parent
f8e4c801eb
commit
19f7d9ca46
@ -1276,6 +1276,11 @@ resampler_calculate_taps (GstAudioResampler * resampler)
|
|||||||
resampler->filter_mode = GST_AUDIO_RESAMPLER_FILTER_MODE_FULL;
|
resampler->filter_mode = GST_AUDIO_RESAMPLER_FILTER_MODE_FULL;
|
||||||
GST_DEBUG ("automatically selected full filter, %d <= %d", out_rate,
|
GST_DEBUG ("automatically selected full filter, %d <= %d", out_rate,
|
||||||
oversample);
|
oversample);
|
||||||
|
} else if (bps * n_taps * out_rate < resampler->filter_threshold) {
|
||||||
|
/* switch to full filter when memory is below threshold */
|
||||||
|
resampler->filter_mode = GST_AUDIO_RESAMPLER_FILTER_MODE_FULL;
|
||||||
|
GST_DEBUG ("automatically selected full filter, memory %d <= %d",
|
||||||
|
bps * n_taps * out_rate, resampler->filter_threshold);
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG ("automatically selected interpolated filter");
|
GST_DEBUG ("automatically selected interpolated filter");
|
||||||
resampler->filter_mode = GST_AUDIO_RESAMPLER_FILTER_MODE_INTERPOLATED;
|
resampler->filter_mode = GST_AUDIO_RESAMPLER_FILTER_MODE_INTERPOLATED;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user