From db2eadb2f57ad5a580c9ad5b2d288c4f6a2eeecb Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 10 Apr 2012 19:52:42 +0200 Subject: swr: add dither support. Signed-off-by: Michael Niedermayer --- libswresample/swresample_internal.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libswresample/swresample_internal.h') diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h index 618afc11ff..ebc275913d 100644 --- a/libswresample/swresample_internal.h +++ b/libswresample/swresample_internal.h @@ -49,6 +49,7 @@ struct SwrContext { float rematrix_volume; ///< rematrixing volume coefficient const int *channel_map; ///< channel index (or -1 if muted channel) map int used_ch_count; ///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count) + enum SwrDitherType dither_method; int int_bps; ///< internal bytes per sample int resample_first; ///< 1 if resampling must come first, 0 if rematrixing @@ -61,6 +62,7 @@ struct SwrContext { AudioData preout; ///< pre-output audio data: used for rematrix/resample AudioData out; ///< converted output audio data AudioData in_buffer; ///< cached audio data (convert and resample purpose) + AudioData dither; ///< cached audio data (convert and resample purpose) int in_buffer_index; ///< cached buffer position int in_buffer_count; ///< cached buffer length int resample_in_constraint; ///< 1 if the input end was reach before the output end, 0 otherwise @@ -89,5 +91,8 @@ int swri_resample_double(struct ResampleContext *c,double *dst, const double * int swri_rematrix_init(SwrContext *s); int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mustcopy); +void swri_sum2(enum AVSampleFormat format, void *dst, const void *src0, const void *src1, float coef0, float coef1, int len); + +void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, enum SwrDitherType type); #endif -- cgit v1.2.3