|
Packit |
971217 |
/* GStreamer
|
|
Packit |
971217 |
* Copyright (C) <2015> Wim Taymans <wim.taymans@gmail.com>
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
971217 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
971217 |
* License as published by the Free Software Foundation; either
|
|
Packit |
971217 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
971217 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
971217 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
971217 |
* Library General Public License for more details.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
971217 |
* License along with this library; if not, write to the
|
|
Packit |
971217 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Packit |
971217 |
* Boston, MA 02110-1301, USA.
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#ifndef __GST_AUDIO_RESAMPLER_PRIVATE_H__
|
|
Packit |
971217 |
#define __GST_AUDIO_RESAMPLER_PRIVATE_H__
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#include "audio-resampler.h"
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* Contains a collection of all things found in other resamplers:
|
|
Packit |
971217 |
* speex (filter construction, optimizations), ffmpeg (fixed phase filter, blackman filter),
|
|
Packit |
971217 |
* SRC (linear interpolation, fixed precomputed tables),...
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* Supports:
|
|
Packit |
971217 |
* - S16, S32, F32 and F64 formats
|
|
Packit |
971217 |
* - nearest, linear and cubic interpolation
|
|
Packit |
971217 |
* - sinc based interpolation with kaiser or blackman-nutall windows
|
|
Packit |
971217 |
* - fully configurable kaiser parameters
|
|
Packit |
971217 |
* - dynamic linear or cubic interpolation of filter table, this can
|
|
Packit |
971217 |
* use less memory but more CPU
|
|
Packit |
971217 |
* - full filter table, generated from optionally linear or cubic
|
|
Packit |
971217 |
* interpolation of filter table
|
|
Packit |
971217 |
* - fixed filter table size with nearest neighbour phase, optionally
|
|
Packit |
971217 |
* using a precomputed tables
|
|
Packit |
971217 |
* - dynamic samplerate changes
|
|
Packit |
971217 |
* - x86 and neon optimizations
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
typedef void (*ConvertTapsFunc) (gdouble * tmp_taps, gpointer taps,
|
|
Packit |
971217 |
gdouble weight, gint n_taps);
|
|
Packit |
971217 |
typedef void (*InterpolateFunc) (gpointer o, const gpointer a, gint len,
|
|
Packit |
971217 |
const gpointer icoeff, gint astride);
|
|
Packit |
971217 |
typedef void (*ResampleFunc) (GstAudioResampler * resampler, gpointer in[],
|
|
Packit |
971217 |
gsize in_len, gpointer out[], gsize out_len, gsize * consumed);
|
|
Packit |
971217 |
typedef void (*DeinterleaveFunc) (GstAudioResampler * resampler,
|
|
Packit |
971217 |
gpointer * sbuf, gpointer in[], gsize in_frames);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
struct _GstAudioResampler
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
GstAudioResamplerMethod method;
|
|
Packit |
971217 |
GstAudioResamplerFlags flags;
|
|
Packit |
971217 |
GstAudioFormat format;
|
|
Packit |
971217 |
GstStructure *options;
|
|
Packit |
971217 |
gint format_index;
|
|
Packit |
971217 |
gint channels;
|
|
Packit |
971217 |
gint in_rate;
|
|
Packit |
971217 |
gint out_rate;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
gint bps;
|
|
Packit |
971217 |
gint ostride;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GstAudioResamplerFilterMode filter_mode;
|
|
Packit |
971217 |
guint filter_threshold;
|
|
Packit |
971217 |
GstAudioResamplerFilterInterpolation filter_interpolation;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
gdouble cutoff;
|
|
Packit |
971217 |
gdouble kaiser_beta;
|
|
Packit |
971217 |
/* for cubic */
|
|
Packit |
971217 |
gdouble b, c;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* temp taps */
|
|
Packit |
971217 |
gpointer tmp_taps;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* oversampled main filter table */
|
|
Packit |
971217 |
gint oversample;
|
|
Packit |
971217 |
gint n_taps;
|
|
Packit |
971217 |
gpointer taps;
|
|
Packit |
971217 |
gpointer taps_mem;
|
|
Packit |
971217 |
gsize taps_stride;
|
|
Packit |
971217 |
gint n_phases;
|
|
Packit |
971217 |
gint alloc_taps;
|
|
Packit |
971217 |
gint alloc_phases;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* cached taps */
|
|
Packit |
971217 |
gpointer *cached_phases;
|
|
Packit |
971217 |
gpointer cached_taps;
|
|
Packit |
971217 |
gpointer cached_taps_mem;
|
|
Packit |
971217 |
gsize cached_taps_stride;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
ConvertTapsFunc convert_taps;
|
|
Packit |
971217 |
InterpolateFunc interpolate;
|
|
Packit |
971217 |
DeinterleaveFunc deinterleave;
|
|
Packit |
971217 |
ResampleFunc resample;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
gint blocks;
|
|
Packit |
971217 |
gint inc;
|
|
Packit |
971217 |
gint samp_inc;
|
|
Packit |
971217 |
gint samp_frac;
|
|
Packit |
971217 |
gint samp_index;
|
|
Packit |
971217 |
gint samp_phase;
|
|
Packit |
971217 |
gint skip;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
gpointer samples;
|
|
Packit |
971217 |
gsize samples_len;
|
|
Packit |
971217 |
gsize samples_avail;
|
|
Packit |
971217 |
gpointer *sbuf;
|
|
Packit |
971217 |
};
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#endif /* __GST_AUDIO_RESAMPLER_PRIVATE_H__ */
|