30 a = M_SQRT2 - cos(2.0 * M_PI * cutoff / sample_rate);
32 c = (a - sqrt((a + b) * (a - b))) / b;
34 coeff[0] =
lrintf(c * 2.0 * (1 << bits));
35 coeff[1] =
lrintf(-(c * c) * (1 << bits));
39 int bufsize,
int *header_size,
int *coeff)
51 if (bufsize >= offset && memcmp(buf + offset - 6,
"(c)CRI", 6))
55 if (buf[4] != 3 || buf[5] != 18 || buf[6] != 4) {
80 *header_size = offset;
void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff)
Calculate LPC coefficients based on cutoff frequency and sample rate.
void av_log_ask_for_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message asking for a sample.
int bit_rate
the average bitrate
static av_always_inline av_const long int lrintf(float x)
int sample_rate
samples per second
main external API structure.
int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, int bufsize, int *header_size, int *coeff)
Decode ADX stream header.
common internal and external API header
#define AVERROR_INVALIDDATA
#define AVERROR_PATCHWELCOME
int channels
number of audio channels