86 for (m = 0; m < order; m++) {
88 for (i = 0; i <
m; i++)
89 next[i] = cur[i] + refl[m] * cur[m - i - 1];
93 memcpy(lpc, cur,
sizeof(*lpc) * order);
103 int *got_frame_ptr,
AVPacket *avpkt)
107 int buf_size = avpkt->
size;
114 int dbov = -avpkt->
data[0];
124 for (i = 0; i < p->
order; i++)
133 for (i = 0; i < p->
order; i++)
136 scaling = sqrt(e * p->
energy / 1081109975);
147 buf_out = (int16_t *)frame->
data[0];
159 .
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 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
enum AVSampleFormat sample_fmt
audio sample format
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#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.
Libavcodec external API header.
static void flush(AVCodecContext *avctx)
int frame_size
Number of samples per channel in an audio frame.
static void cng_decode_flush(AVCodecContext *avctx)
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[]
#define FFSWAP(type, a, b)
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
static av_cold int cng_decode_init(AVCodecContext *avctx)