12 #ifndef ROC_AUDIO_BUILTIN_RESAMPLER_H_
13 #define ROC_AUDIO_BUILTIN_RESAMPLER_H_
60 virtual bool set_scaling(
size_t input_rate,
size_t output_rate,
float multiplier);
75 typedef uint32_t fixedpoint_t;
76 typedef uint64_t long_fixedpoint_t;
77 typedef int32_t signed_fixedpoint_t;
78 typedef int64_t signed_long_fixedpoint_t;
80 inline size_t channelize_index(
const size_t i,
const size_t ch_offset)
const {
86 bool check_config_()
const;
89 sample_t sinc_(fixedpoint_t x,
float fract_x);
94 sample_t resample_(
size_t channel_offset);
100 size_t n_ready_frames_;
108 const size_t window_size_;
109 const fixedpoint_t qt_half_sinc_window_size_;
111 const size_t window_interp_;
112 const size_t window_interp_bits_;
114 const size_t frame_size_ch_;
115 const size_t frame_size_;
121 fixedpoint_t qt_half_window_size_;
122 const fixedpoint_t qt_epsilon_;
124 const fixedpoint_t qt_frame_size_;
128 fixedpoint_t qt_sample_;
134 fixedpoint_t qt_sinc_step_;
virtual void end_push_input()
Commit buffer with input data.
virtual bool set_scaling(size_t input_rate, size_t output_rate, float multiplier)
Set new resample factor.
virtual size_t pop_output(sample_t *out_data, size_t out_size)
Read samples from input frame and fill output frame.
BuiltinResampler(core::IArena &arena, FrameFactory &frame_factory, ResamplerProfile profile, const SampleSpec &in_spec, const SampleSpec &out_spec)
Initialize.
virtual float n_left_to_process() const
How many samples were pushed but not processed yet.
virtual bool is_valid() const
Check if object is successfully constructed.
virtual const core::Slice< sample_t > & begin_push_input()
Get buffer to be filled with input data.
Sample specification. Describes sample rate and channels.
size_t num_channels() const
Get number enabled channels in channel set.
IArena & arena() const
Get arena.
Base class for non-copyable objects.
Audio resampler interface.
float sample_t
Raw audio sample.
ResamplerProfile
Resampler parameters presets.
Commonly used types and functions.
Various units used in packets.