mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
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
1 changed files with 5 additions and 0 deletions
|
@ -1276,6 +1276,11 @@ resampler_calculate_taps (GstAudioResampler * resampler)
|
|||
resampler->filter_mode = GST_AUDIO_RESAMPLER_FILTER_MODE_FULL;
|
||||
GST_DEBUG ("automatically selected full filter, %d <= %d", out_rate,
|
||||
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 {
|
||||
GST_DEBUG ("automatically selected interpolated filter");
|
||||
resampler->filter_mode = GST_AUDIO_RESAMPLER_FILTER_MODE_INTERPOLATED;
|
||||
|
|
Loading…
Reference in a new issue