87 for (m = 0; m < order; m++) {
89 for (i = 0; i <
m; i++)
90 next[i] = cur[i] + refl[m] * cur[m - i - 1];
94 memcpy(lpc, cur,
sizeof(*lpc) * order);
104 int *got_frame_ptr,
AVPacket *avpkt)
108 int buf_size = avpkt->
size;
115 int dbov = -avpkt->
data[0];
125 for (i = 0; i < p->
order; i++)
134 for (i = 0; i < p->
order; i++)
137 scaling = sqrt(e * p->
energy / 1081109975);
148 buf_out = (int16_t *)frame->
data[0];
160 .
name =
"comfortnoise",
void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs, const float *in, int buffer_length, int filter_length)
LP synthesis filter.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static void flush(AVCodecContext *avctx)
static av_cold int init(AVCodecContext *avctx)
static int cng_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
AVCodec ff_comfortnoise_decoder
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
enum AVSampleFormat sample_fmt
audio sample format
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
common internal API header
int frame_size
Number of samples per channel in an audio frame.
static void cng_decode_flush(AVCodecContext *avctx)
Libavcodec external API header.
AVSampleFormat
Audio sample formats.
int sample_rate
samples per second
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static void make_lpc_coefs(float *lpc, const float *refl, int order)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
common internal api header.
common internal and external API header
static av_cold int cng_decode_close(AVCodecContext *avctx)
int channels
number of audio channels
static void * av_mallocz_array(size_t nmemb, size_t size)
static enum AVSampleFormat sample_fmts[]
static av_always_inline double ff_exp10(double x)
Compute 10^x for floating point values.
#define FFSWAP(type, a, b)
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static av_cold int cng_decode_init(AVCodecContext *avctx)