FFmpeg
Data Structures | Functions | Variables
cngdec.c File Reference
#include <math.h>
#include "libavutil/common.h"
#include "libavutil/ffmath.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "celp_filters.h"
#include "codec_internal.h"
#include "decode.h"
#include "internal.h"
#include "libavutil/lfg.h"

Go to the source code of this file.

Data Structures

struct  CNGContext
 

Functions

static av_cold int cng_decode_close (AVCodecContext *avctx)
 
static av_cold int cng_decode_init (AVCodecContext *avctx)
 
static void make_lpc_coefs (float *lpc, const float *refl, int order)
 
static void cng_decode_flush (AVCodecContext *avctx)
 
static int cng_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

const FFCodec ff_comfortnoise_decoder
 

Function Documentation

◆ cng_decode_close()

static av_cold int cng_decode_close ( AVCodecContext avctx)
static

Definition at line 45 of file cngdec.c.

◆ cng_decode_init()

static av_cold int cng_decode_init ( AVCodecContext avctx)
static

Definition at line 56 of file cngdec.c.

◆ make_lpc_coefs()

static void make_lpc_coefs ( float lpc,
const float refl,
int  order 
)
static

Definition at line 83 of file cngdec.c.

Referenced by cng_decode_frame().

◆ cng_decode_flush()

static void cng_decode_flush ( AVCodecContext avctx)
static

Definition at line 100 of file cngdec.c.

◆ cng_decode_frame()

static int cng_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int *  got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 106 of file cngdec.c.

Variable Documentation

◆ ff_comfortnoise_decoder

const FFCodec ff_comfortnoise_decoder
Initial value:
= {
.p.name = "comfortnoise",
CODEC_LONG_NAME("RFC 3389 comfort noise generator"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(CNGContext),
.flush = cng_decode_flush,
.close = cng_decode_close,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 166 of file cngdec.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:43
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
cng_decode_frame
static int cng_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: cngdec.c:106
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
CNGContext
Definition: cngdec.c:34
cng_decode_close
static av_cold int cng_decode_close(AVCodecContext *avctx)
Definition: cngdec.c:45
cng_decode_flush
static void cng_decode_flush(AVCodecContext *avctx)
Definition: cngdec.c:100
AV_CODEC_CAP_CHANNEL_CONF
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: codec.h:106
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AV_CODEC_ID_COMFORT_NOISE
@ AV_CODEC_ID_COMFORT_NOISE
Definition: codec_id.h:507
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:58
cng_decode_init
static av_cold int cng_decode_init(AVCodecContext *avctx)
Definition: cngdec.c:56