21 #include "libavutil/common.h"
22 #include "libavutil/intreadwrite.h"
23 #include "libavutil/mathematics.h"
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)
56 if (bufsize >= offset && memcmp(buf + offset - 6,
"(c)CRI", 6))
60 if (buf[4] != 3 || buf[5] != 18 || buf[6] != 4) {
#define AVERROR_PATCHWELCOME
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
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 void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static const uint8_t offset[511][2]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int bit_rate
the average bitrate
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.
#define AVERROR_INVALIDDATA
int channels
number of audio channels
static const double coeff[2][5]