From 0f999cfddb0746602288eabddf38679fd25a2ff7 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 15 Mar 2011 22:29:04 -0400 Subject: ac3enc: add float_to_fixed24() with x86-optimized versions to AC3DSPContext and use in scale_coefficients() for the floating-point AC-3 encoder. --- libavcodec/ac3dsp.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'libavcodec/ac3dsp.h') diff --git a/libavcodec/ac3dsp.h b/libavcodec/ac3dsp.h index 31a0af375d..0a2dedf478 100644 --- a/libavcodec/ac3dsp.h +++ b/libavcodec/ac3dsp.h @@ -68,9 +68,22 @@ typedef struct AC3DSPContext { * constraints: range [0,31] */ void (*ac3_rshift_int32)(int32_t *src, unsigned int len, unsigned int shift); + + /** + * Convert an array of float in range [-1.0,1.0] to int32_t with range + * [-(1<<24),(1<<24)] + * + * @param dst destination array of int32_t. + * constraints: 16-byte aligned + * @param src source array of float. + * constraints: 16-byte aligned + * @param len number of elements to convert. + * constraints: multiple of 32 greater than zero + */ + void (*float_to_fixed24)(int32_t *dst, const float *src, unsigned int len); } AC3DSPContext; -void ff_ac3dsp_init (AC3DSPContext *c); -void ff_ac3dsp_init_x86(AC3DSPContext *c); +void ff_ac3dsp_init (AC3DSPContext *c, int bit_exact); +void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact); #endif /* AVCODEC_AC3DSP_H */ -- cgit v1.2.3