diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-11-20 14:21:32 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-11-26 16:25:06 -0500 |
commit | b237248e297760648307356efa5fcbfe16844829 (patch) | |
tree | 76ac03216c87ddc68904f9abe3e1e5a89c25604b /libavcodec/adx.h | |
parent | 954d94dd5e13ba7a5e9e049d0f980bddced9644c (diff) | |
download | ffmpeg-b237248e297760648307356efa5fcbfe16844829.tar.gz |
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.
Diffstat (limited to 'libavcodec/adx.h')
-rw-r--r-- | libavcodec/adx.h | 14 |
1 files changed, 12 insertions, 2 deletions
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 */ |