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);
149 buf_out = (int16_t *)frame->
data[0];
161 .
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.
static int cng_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
AVCodec ff_comfortnoise_decoder
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
enum AVSampleFormat sample_fmt
audio sample format
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
#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. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
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.
static void close(AVCodecParserContext *s)
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.
common internal api header.
common internal and external API header
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
static av_cold int init(AVCodecParserContext *s)
static av_cold int cng_decode_close(AVCodecContext *avctx)
int channels
number of audio channels
#define FFSWAP(type, a, b)
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static av_cold int cng_decode_init(AVCodecContext *avctx)