00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AVRESAMPLE_AUDIO_MIX_H
00022 #define AVRESAMPLE_AUDIO_MIX_H
00023
00024 #include <stdint.h>
00025
00026 #include "libavutil/samplefmt.h"
00027 #include "avresample.h"
00028 #include "audio_data.h"
00029
00030 typedef void (mix_func)(uint8_t **src, void **matrix, int len, int out_ch,
00031 int in_ch);
00032
00033 typedef struct AudioMix {
00034 AVAudioResampleContext *avr;
00035 enum AVSampleFormat fmt;
00036 enum AVMixCoeffType coeff_type;
00037 uint64_t in_layout;
00038 uint64_t out_layout;
00039 int in_channels;
00040 int out_channels;
00041
00042 int ptr_align;
00043 int samples_align;
00044 int has_optimized_func;
00045 const char *func_descr;
00046 const char *func_descr_generic;
00047 mix_func *mix;
00048 mix_func *mix_generic;
00049
00050 int16_t *matrix_q8[AVRESAMPLE_MAX_CHANNELS];
00051 int32_t *matrix_q15[AVRESAMPLE_MAX_CHANNELS];
00052 float *matrix_flt[AVRESAMPLE_MAX_CHANNELS];
00053 void **matrix;
00054 } AudioMix;
00055
00076 void ff_audio_mix_set_func(AudioMix *am, enum AVSampleFormat fmt,
00077 enum AVMixCoeffType coeff_type, int in_channels,
00078 int out_channels, int ptr_align, int samples_align,
00079 const char *descr, void *mix_func);
00080
00090 int ff_audio_mix_init(AVAudioResampleContext *avr);
00091
00097 void ff_audio_mix_close(AudioMix *am);
00098
00102 int ff_audio_mix(AudioMix *am, AudioData *src);
00103
00104
00105
00106 void ff_audio_mix_init_x86(AudioMix *am);
00107
00108 #endif