29 a =
M_SQRT2 - cos(2.0 *
M_PI * cutoff / sample_rate);
31 c = (a - sqrt((a + b) * (a - b))) / b;
33 coeff[0] =
lrintf(c * 2.0 * (1 << bits));
34 coeff[1] =
lrintf(-(c * c) * (1 << bits));
38 int bufsize,
int *header_size,
int *coeff)
50 if (bufsize >= offset && offset >= 6 && memcmp(buf + offset - 6,
"(c)CRI", 6))
54 if (buf[4] != 3 || buf[5] != 18 || buf[6] != 4) {
79 *header_size = offset;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_WB24 AV_RB16
AV_WL32 AV_WL24 AV_WL16 AV_RB32
void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff)
Calculate LPC coefficients based on cutoff frequency and sample rate.
int bit_rate
the average bitrate
static av_always_inline av_const long int lrintf(float x)
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
int sample_rate
samples per second
void av_log_ask_for_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message asking for a sample.
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.
int channels
number of audio channels