1
/*****************************************************************
5
Copyright (c) 2003 by Burkhard Plaum - plaum@ipf.uni-stuttgart.de
7
http://gmerlin.sourceforge.net
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
18
*****************************************************************/
20
/* Private structures for the video converter */
25
struct gavl_audio_options_s
28
* Quality setting from 1 to 5 (0 means undefined).
29
* 3 means Standard C routines or accellerated version with
30
* equal quality. Lower numbers mean accellerated versions with lower
35
/* Explicit accel_flags are mainly for debugging purposes */
36
uint32_t accel_flags; /* CPU Acceleration flags */
38
/* #defines from above */
40
uint32_t conversion_flags;
43
typedef struct gavl_audio_convert_context_s gavl_audio_convert_context_t;
44
typedef struct gavl_mix_matrix_s gavl_mix_matrix_t;
46
typedef void (*gavl_audio_func_t)(struct gavl_audio_convert_context_s * ctx);
48
typedef struct gavl_samplerate_converter_s gavl_samplerate_converter_t;
50
typedef struct gavl_audio_dither_context_s gavl_audio_dither_context_t;
52
struct gavl_audio_convert_context_s
54
gavl_audio_frame_t * input_frame;
55
gavl_audio_frame_t * output_frame;
57
gavl_audio_format_t input_format;
58
gavl_audio_format_t output_format;
60
/* Conversion function to be called */
62
gavl_audio_func_t func;
66
gavl_mix_matrix_t * mix_matrix;
67
gavl_samplerate_converter_t * samplerate_converter;
68
gavl_audio_dither_context_t * dither_context;
72
struct gavl_audio_convert_context_s * next;
75
gavl_audio_convert_context_t *
76
gavl_audio_convert_context_create(gavl_audio_format_t * input_format,
77
gavl_audio_format_t * output_format);
79
gavl_audio_convert_context_t *
80
gavl_mix_context_create(gavl_audio_options_t * opt,
81
gavl_audio_format_t * input_format,
82
gavl_audio_format_t * output_format);
84
gavl_audio_convert_context_t *
85
gavl_interleave_context_create(gavl_audio_options_t * opt,
86
gavl_audio_format_t * input_format,
87
gavl_audio_format_t * output_format);
89
gavl_audio_convert_context_t *
90
gavl_sampleformat_context_create(gavl_audio_options_t * opt,
91
gavl_audio_format_t * input_format,
92
gavl_audio_format_t * output_format);
94
gavl_audio_convert_context_t *
95
gavl_samplerate_context_create(gavl_audio_options_t * opt,
96
gavl_audio_format_t * input_format,
97
gavl_audio_format_t * output_format);
99
/* Resampling support */
101
gavl_audio_convert_context_t *
102
gavl_samplerate_context_create(gavl_audio_options_t * opt,
103
gavl_audio_format_t * input_format,
104
gavl_audio_format_t * output_format);
107
/* Destroy samplerate converter */
109
void gavl_samplerate_converter_destroy(gavl_samplerate_converter_t * s);
111
/* Destroy dither context */
113
void gavl_audio_dither_context_destroy(gavl_audio_dither_context_t * s);
115
/* Utility function */
117
int gavl_bytes_per_sample(gavl_sample_format_t format);