FFmpeg
Macros | Functions | Variables
dcadec.c File Reference
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/channel_layout.h"
#include "libavutil/thread.h"
#include "codec_internal.h"
#include "dcadec.h"
#include "dcahuff.h"
#include "dca_syncwords.h"
#include "profiles.h"

Go to the source code of this file.

Macros

#define MIN_PACKET_SIZE   16
 
#define MAX_PACKET_SIZE   0x104000
 
#define OFFSET(x)   offsetof(DCAContext, x)
 
#define PARAM   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

int ff_dca_set_channel_layout (AVCodecContext *avctx, int *ch_remap, int dca_mask)
 
void ff_dca_downmix_to_stereo_fixed (DCADSPContext *dcadsp, int32_t **samples, int *coeff_l, int nsamples, int ch_mask)
 
void ff_dca_downmix_to_stereo_float (AVFloatDSPContext *fdsp, float **samples, int *coeff_l, int nsamples, int ch_mask)
 
static int dcadec_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold void dcadec_flush (AVCodecContext *avctx)
 
static av_cold int dcadec_close (AVCodecContext *avctx)
 
static av_cold void dcadec_init_static (void)
 
static av_cold int dcadec_init (AVCodecContext *avctx)
 

Variables

static const AVOption dcadec_options []
 
static const AVClass dcadec_class
 
const FFCodec ff_dca_decoder
 

Macro Definition Documentation

◆ MIN_PACKET_SIZE

#define MIN_PACKET_SIZE   16

Definition at line 32 of file dcadec.c.

◆ MAX_PACKET_SIZE

#define MAX_PACKET_SIZE   0x104000

Definition at line 33 of file dcadec.c.

◆ OFFSET

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

Definition at line 380 of file dcadec.c.

◆ PARAM

Definition at line 381 of file dcadec.c.

Function Documentation

◆ ff_dca_set_channel_layout()

int ff_dca_set_channel_layout ( AVCodecContext avctx,
int *  ch_remap,
int  dca_mask 
)

Definition at line 35 of file dcadec.c.

Referenced by ff_dca_core_filter_frame(), and ff_dca_xll_filter_frame().

◆ ff_dca_downmix_to_stereo_fixed()

void ff_dca_downmix_to_stereo_fixed ( DCADSPContext dcadsp,
int32_t **  samples,
int *  coeff_l,
int  nsamples,
int  ch_mask 
)

Definition at line 86 of file dcadec.c.

Referenced by ff_dca_xll_filter_frame(), and filter_frame_fixed().

◆ ff_dca_downmix_to_stereo_float()

void ff_dca_downmix_to_stereo_float ( AVFloatDSPContext fdsp,
float **  samples,
int *  coeff_l,
int  nsamples,
int  ch_mask 
)

Definition at line 117 of file dcadec.c.

Referenced by filter_frame_float().

◆ dcadec_decode_frame()

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

Definition at line 151 of file dcadec.c.

◆ dcadec_flush()

static av_cold void dcadec_flush ( AVCodecContext avctx)
static

Definition at line 301 of file dcadec.c.

◆ dcadec_close()

static av_cold int dcadec_close ( AVCodecContext avctx)
static

Definition at line 312 of file dcadec.c.

◆ dcadec_init_static()

static av_cold void dcadec_init_static ( void  )
static

Definition at line 326 of file dcadec.c.

Referenced by dcadec_init().

◆ dcadec_init()

static av_cold int dcadec_init ( AVCodecContext avctx)
static

Definition at line 332 of file dcadec.c.

Variable Documentation

◆ dcadec_options

const AVOption dcadec_options[]
static
Initial value:
= {
{ "core_only", "Decode core only without extensions", OFFSET(core_only), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, PARAM },
{ "channel_order", "Order in which the channels are to be exported",
OFFSET(output_channel_order), AV_OPT_TYPE_INT,
{ .i64 = CHANNEL_ORDER_DEFAULT }, 0, 1, PARAM, .unit = "channel_order" },
{ "default", "normal libavcodec channel order", 0, AV_OPT_TYPE_CONST,
{ .i64 = CHANNEL_ORDER_DEFAULT }, .flags = PARAM, .unit = "channel_order" },
{ "coded", "order in which the channels are coded in the bitstream",
0, AV_OPT_TYPE_CONST, { .i64 = CHANNEL_ORDER_CODED }, .flags = PARAM, .unit = "channel_order" },
{ "downmix", "Request a specific channel layout from the decoder", OFFSET(downmix_layout),
AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, .flags = PARAM },
{ NULL }
}

Definition at line 383 of file dcadec.c.

◆ dcadec_class

const AVClass dcadec_class
static
Initial value:
= {
.class_name = "DCA decoder",
.item_name = av_default_item_name,
.option = dcadec_options,
}

Definition at line 400 of file dcadec.c.

◆ ff_dca_decoder

const FFCodec ff_dca_decoder
Initial value:
= {
.p.name = "dca",
CODEC_LONG_NAME("DCA (DTS Coherent Acoustics)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_DTS,
.priv_data_size = sizeof(DCAContext),
.close = dcadec_close,
.flush = dcadec_flush,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P,
.p.priv_class = &dcadec_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 408 of file dcadec.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
dcadec_close
static av_cold int dcadec_close(AVCodecContext *avctx)
Definition: dcadec.c:312
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
AV_CLASS_CATEGORY_DECODER
@ AV_CLASS_CATEGORY_DECODER
Definition: log.h:35
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:65
dcadec_init
static av_cold int dcadec_init(AVCodecContext *avctx)
Definition: dcadec.c:332
ff_dca_profiles
const AVProfile ff_dca_profiles[]
Definition: profiles.c:40
dcadec_flush
static av_cold void dcadec_flush(AVCodecContext *avctx)
Definition: dcadec.c:301
dcadec_decode_frame
static int dcadec_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: dcadec.c:151
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
dcadec_options
static const AVOption dcadec_options[]
Definition: dcadec.c:383
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
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
OFFSET
#define OFFSET(x)
Definition: dcadec.c:380
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
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
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
PARAM
#define PARAM
Definition: dcadec.c:381
AV_CODEC_ID_DTS
@ AV_CODEC_ID_DTS
Definition: codec_id.h:451
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:64
CHANNEL_ORDER_CODED
@ CHANNEL_ORDER_CODED
Definition: aacdec.h:62
DCAContext
Definition: dcadec.h:53
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
CHANNEL_ORDER_DEFAULT
@ CHANNEL_ORDER_DEFAULT
Definition: aacdec.h:61
dcadec_class
static const AVClass dcadec_class
Definition: dcadec.c:400
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299