FFmpeg
Macros | Functions | Variables
dcadec.c File Reference
#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 31 of file dcadec.c.

◆ MAX_PACKET_SIZE

#define MAX_PACKET_SIZE   0x104000

Definition at line 32 of file dcadec.c.

◆ OFFSET

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

Definition at line 384 of file dcadec.c.

◆ PARAM

Definition at line 385 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 34 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 85 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 116 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 150 of file dcadec.c.

◆ dcadec_flush()

static av_cold void dcadec_flush ( AVCodecContext avctx)
static

Definition at line 300 of file dcadec.c.

◆ dcadec_close()

static av_cold int dcadec_close ( AVCodecContext avctx)
static

Definition at line 311 of file dcadec.c.

◆ dcadec_init_static()

static av_cold void dcadec_init_static ( void  )
static

Definition at line 325 of file dcadec.c.

Referenced by dcadec_init().

◆ dcadec_init()

static av_cold int dcadec_init ( AVCodecContext avctx)
static

Definition at line 331 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, "channel_order" },
{ "default", "normal libavcodec channel order", 0, AV_OPT_TYPE_CONST,
{ .i64 = CHANNEL_ORDER_DEFAULT }, .flags = PARAM, "channel_order" },
{ "coded", "order in which the channels are coded in the bitstream",
0, AV_OPT_TYPE_CONST, { .i64 = CHANNEL_ORDER_CODED }, .flags = PARAM, "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 387 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 404 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 412 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:311
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:42
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:331
ff_dca_profiles
const AVProfile ff_dca_profiles[]
Definition: profiles.c:38
dcadec_flush
static av_cold void dcadec_flush(AVCodecContext *avctx)
Definition: dcadec.c:300
dcadec_decode_frame
static int dcadec_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: dcadec.c:150
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
dcadec_options
static const AVOption dcadec_options[]
Definition: dcadec.c:387
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
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:384
AV_OPT_TYPE_CHLAYOUT
@ AV_OPT_TYPE_CHLAYOUT
Definition: opt.h:245
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
CHANNEL_ORDER_CODED
@ CHANNEL_ORDER_CODED
Definition: aac.h:290
CHANNEL_ORDER_DEFAULT
@ CHANNEL_ORDER_DEFAULT
Definition: aac.h:289
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:106
PARAM
#define PARAM
Definition: dcadec.c:385
AV_CODEC_ID_DTS
@ AV_CODEC_ID_DTS
Definition: codec_id.h:446
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
DCAContext
Definition: dcadec.h:53
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
dcadec_class
static const AVClass dcadec_class
Definition: dcadec.c:404
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234