From b237248e297760648307356efa5fcbfe16844829 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sun, 20 Nov 2011 14:21:32 -0500 Subject: adx: calculate correct LPC coeffs Instead of using fixed coefficients, the correct way is to calculate the coefficients using the highpass cutoff frequency from the ADX stream header and the sample rate. --- libavcodec/adx.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libavcodec/adx.h') diff --git a/libavcodec/adx.h b/libavcodec/adx.h index ae5eb6a434..cd8c45bf6d 100644 --- a/libavcodec/adx.h +++ b/libavcodec/adx.h @@ -41,10 +41,20 @@ typedef struct { int header_parsed; unsigned char dec_temp[18*2]; int in_temp; + int cutoff; + int coeff[2]; } ADXContext; #define COEFF_BITS 12 -#define COEFF1 0x1CA6 -#define COEFF2 0x0CD4 + +/** + * Calculate LPC coefficients based on cutoff frequency and sample rate. + * + * @param cutoff cutoff frequency + * @param sample_rate sample rate + * @param bits number of bits used to quantize coefficients + * @param[out] coeff 2 quantized LPC coefficients + */ +void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff); #endif /* AVCODEC_ADX_H */ -- cgit v1.2.3