FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
libfdk-aacdec.c File Reference
#include <fdk-aac/aacdecoder_lib.h>
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"

Go to the source code of this file.

Data Structures

struct  FDKAACDecContext
 

Macros

#define FDKDEC_VER_AT_LEAST(vl0, vl1)   0
 
#define AAC_PCM_MAX_OUTPUT_CHANNELS   AAC_PCM_OUTPUT_CHANNELS
 
#define DMX_ANC_BUFFSIZE   128
 
#define DECODER_MAX_CHANNELS   8
 
#define DECODER_BUFFSIZE   2048 * sizeof(INT_PCM)
 
#define OFFSET(x)   offsetof(FDKAACDecContext, x)
 
#define AD   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Enumerations

enum  ConcealMethod { CONCEAL_METHOD_SPECTRAL_MUTING = 0, CONCEAL_METHOD_NOISE_SUBSTITUTION = 1, CONCEAL_METHOD_ENERGY_INTERPOLATION = 2, CONCEAL_METHOD_NB }
 

Functions

static int get_stream_info (AVCodecContext *avctx)
 
static av_cold int fdk_aac_decode_close (AVCodecContext *avctx)
 
static av_cold int fdk_aac_decode_init (AVCodecContext *avctx)
 
static int fdk_aac_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold void fdk_aac_decode_flush (AVCodecContext *avctx)
 

Variables

static const AVOption fdk_aac_dec_options []
 
static const AVClass fdk_aac_dec_class
 
const FFCodec ff_libfdk_aac_decoder
 

Macro Definition Documentation

◆ FDKDEC_VER_AT_LEAST

#define FDKDEC_VER_AT_LEAST (   vl0,
  vl1 
)    0

Definition at line 35 of file libfdk-aacdec.c.

◆ AAC_PCM_MAX_OUTPUT_CHANNELS

#define AAC_PCM_MAX_OUTPUT_CHANNELS   AAC_PCM_OUTPUT_CHANNELS

Definition at line 39 of file libfdk-aacdec.c.

◆ DMX_ANC_BUFFSIZE

#define DMX_ANC_BUFFSIZE   128

Definition at line 72 of file libfdk-aacdec.c.

◆ DECODER_MAX_CHANNELS

#define DECODER_MAX_CHANNELS   8

Definition at line 73 of file libfdk-aacdec.c.

◆ DECODER_BUFFSIZE

#define DECODER_BUFFSIZE   2048 * sizeof(INT_PCM)

Definition at line 74 of file libfdk-aacdec.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(FDKAACDecContext, x)

Definition at line 76 of file libfdk-aacdec.c.

◆ AD

Definition at line 77 of file libfdk-aacdec.c.

Enumeration Type Documentation

◆ ConcealMethod

Enumerator
CONCEAL_METHOD_SPECTRAL_MUTING 
CONCEAL_METHOD_NOISE_SUBSTITUTION 
CONCEAL_METHOD_ENERGY_INTERPOLATION 
CONCEAL_METHOD_NB 

Definition at line 42 of file libfdk-aacdec.c.

Function Documentation

◆ get_stream_info()

static int get_stream_info ( AVCodecContext avctx)
static

Definition at line 114 of file libfdk-aacdec.c.

Referenced by fdk_aac_decode_frame().

◆ fdk_aac_decode_close()

static av_cold int fdk_aac_decode_close ( AVCodecContext avctx)
static

Definition at line 231 of file libfdk-aacdec.c.

◆ fdk_aac_decode_init()

static av_cold int fdk_aac_decode_init ( AVCodecContext avctx)
static

Definition at line 243 of file libfdk-aacdec.c.

◆ fdk_aac_decode_frame()

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

Definition at line 373 of file libfdk-aacdec.c.

◆ fdk_aac_decode_flush()

static av_cold void fdk_aac_decode_flush ( AVCodecContext avctx)
static

Definition at line 459 of file libfdk-aacdec.c.

Variable Documentation

◆ fdk_aac_dec_options

const AVOption fdk_aac_dec_options[]
static
Initial value:
= {
{ "conceal", "Error concealment method", OFFSET(conceal_method), AV_OPT_TYPE_INT, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, CONCEAL_METHOD_SPECTRAL_MUTING, CONCEAL_METHOD_NB - 1, AD, .unit = "conceal" },
{ "spectral", "Spectral muting", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_SPECTRAL_MUTING }, INT_MIN, INT_MAX, AD, .unit = "conceal" },
{ "noise", "Noise Substitution", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, INT_MIN, INT_MAX, AD, .unit = "conceal" },
{ "energy", "Energy Interpolation", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_ENERGY_INTERPOLATION }, INT_MIN, INT_MAX, AD, .unit = "conceal" },
{ "drc_boost", "Dynamic Range Control: boost, where [0] is none and [127] is max boost",
OFFSET(drc_boost), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, .unit = NULL },
{ "drc_cut", "Dynamic Range Control: attenuation factor, where [0] is none and [127] is max compression",
OFFSET(drc_cut), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, .unit = NULL },
{ "drc_level", "Dynamic Range Control: reference level, quantized to 0.25dB steps where [0] is 0dB and [127] is -31.75dB, -1 for auto, and -2 for disabled",
OFFSET(drc_level), AV_OPT_TYPE_INT, { .i64 = -1}, -2, 127, AD, .unit = NULL },
{ "drc_heavy", "Dynamic Range Control: heavy compression, where [1] is on (RF mode) and [0] is off",
OFFSET(drc_heavy), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, .unit = NULL },
{ "downmix", "Request a specific channel layout from the decoder", OFFSET(downmix_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, .flags = AD },
{ NULL }
}

Definition at line 78 of file libfdk-aacdec.c.

◆ fdk_aac_dec_class

const AVClass fdk_aac_dec_class
static
Initial value:
= {
.class_name = "libfdk-aac decoder",
.item_name = av_default_item_name,
}

Definition at line 107 of file libfdk-aacdec.c.

◆ ff_libfdk_aac_decoder

const FFCodec ff_libfdk_aac_decoder
Initial value:
= {
.p.name = "libfdk_aac",
CODEC_LONG_NAME("Fraunhofer FDK AAC"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(FDKAACDecContext),
,
.p.priv_class = &fdk_aac_dec_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.wrapper_name = "libfdk",
}

Definition at line 472 of file libfdk-aacdec.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
AD
#define AD
Definition: libfdk-aacdec.c:77
FDKAACDecContext
Definition: libfdk-aacdec.c:49
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
OFFSET
#define OFFSET(x)
Definition: libfdk-aacdec.c:76
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
fdk_aac_decode_flush
static av_cold void fdk_aac_decode_flush(AVCodecContext *avctx)
Definition: libfdk-aacdec.c:459
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_OPT_TYPE_CHLAYOUT
@ AV_OPT_TYPE_CHLAYOUT
Underlying C type is AVChannelLayout.
Definition: opt.h:331
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
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: codec_id.h:448
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
fdk_aac_dec_options
static const AVOption fdk_aac_dec_options[]
Definition: libfdk-aacdec.c:78
fdk_aac_dec_class
static const AVClass fdk_aac_dec_class
Definition: libfdk-aacdec.c:107
CONCEAL_METHOD_ENERGY_INTERPOLATION
@ CONCEAL_METHOD_ENERGY_INTERPOLATION
Definition: libfdk-aacdec.c:45
CONCEAL_METHOD_SPECTRAL_MUTING
@ CONCEAL_METHOD_SPECTRAL_MUTING
Definition: libfdk-aacdec.c:43
CONCEAL_METHOD_NOISE_SUBSTITUTION
@ CONCEAL_METHOD_NOISE_SUBSTITUTION
Definition: libfdk-aacdec.c:44
fdk_aac_decode_close
static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
Definition: libfdk-aacdec.c:231
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
fdk_aac_decode_frame
static int fdk_aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: libfdk-aacdec.c:373
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
CONCEAL_METHOD_NB
@ CONCEAL_METHOD_NB
Definition: libfdk-aacdec.c:46
fdk_aac_decode_init
static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
Definition: libfdk-aacdec.c:243