88 for (m = 0; m <
order; m++) {
90 for (i = 0; i < m; i++)
91 next[i] = cur[i] + refl[m] * cur[m - i - 1];
95 memcpy(lpc, cur,
sizeof(*lpc) * order);
105 int *got_frame_ptr,
AVPacket *avpkt)
109 int buf_size = avpkt->
size;
116 int dbov = -avpkt->
data[0];
131 for (i = 0; i < p->
order; i++)
140 for (i = 0; i < p->
order; i++)
143 scaling = sqrt(e * p->
energy / 1081109975);
154 buf_out = (int16_t *)frame->
data[0];
166 .
name =
"comfortnoise",
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
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 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)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
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
static av_always_inline double ff_exp10(double x)
Compute 10^x for floating point values.
#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.
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.
int skip_samples
Number of audio samples to skip at the start of the next decoded frame.
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.
internal math functions header
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
struct AVCodecInternal * internal
Private context used for internal data.
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
#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)
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().