FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
dcadec.c File Reference
#include "libavutil/opt.h"
#include "libavutil/channel_layout.h"
#include "dcadec.h"
#include "dcamath.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)
 
static uint16_t crc16 (const uint8_t *data, int size)
 
int ff_dca_check_crc (GetBitContext *s, int p1, int p2)
 
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 convert_bitstream (const uint8_t *src, int src_size, uint8_t *dst, int max_size)
 
static int dcadec_decode_frame (AVCodecContext *avctx, void *data, 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 int dcadec_init (AVCodecContext *avctx)
 

Variables

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

Macro Definition Documentation

#define MIN_PACKET_SIZE   16

Definition at line 29 of file dcadec.c.

Referenced by dcadec_decode_frame().

#define MAX_PACKET_SIZE   0x104000

Definition at line 30 of file dcadec.c.

Referenced by dcadec_decode_frame().

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

Definition at line 385 of file dcadec.c.

Definition at line 386 of file dcadec.c.

Function Documentation

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

Definition at line 32 of file dcadec.c.

Referenced by ff_dca_core_filter_frame(), and ff_dca_xll_filter_frame().

static uint16_t crc16 ( const uint8_t data,
int  size 
)
static

Definition at line 79 of file dcadec.c.

Referenced by ff_dca_check_crc().

int ff_dca_check_crc ( GetBitContext s,
int  p1,
int  p2 
)
void ff_dca_downmix_to_stereo_fixed ( DCADSPContext dcadsp,
int32_t **  samples,
int *  coeff_l,
int  nsamples,
int  ch_mask 
)

Definition at line 106 of file dcadec.c.

Referenced by ff_dca_xll_filter_frame(), and filter_frame_fixed().

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

Definition at line 137 of file dcadec.c.

Referenced by filter_frame_float().

static int convert_bitstream ( const uint8_t src,
int  src_size,
uint8_t dst,
int  max_size 
)
static

Definition at line 171 of file dcadec.c.

Referenced by dcadec_decode_frame().

static int dcadec_decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 187 of file dcadec.c.

static av_cold void dcadec_flush ( AVCodecContext avctx)
static

Definition at line 321 of file dcadec.c.

static av_cold int dcadec_close ( AVCodecContext avctx)
static

Definition at line 331 of file dcadec.c.

static av_cold int dcadec_init ( AVCodecContext avctx)
static

Definition at line 344 of file dcadec.c.

Variable Documentation

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 },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: dcadec.c:385
#define PARAM
Definition: dcadec.c:386

Definition at line 388 of file dcadec.c.

const AVClass dcadec_class
static
Initial value:
= {
.class_name = "DCA decoder",
.item_name = av_default_item_name,
.option = dcadec_options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:70
static const AVOption dcadec_options[]
Definition: dcadec.c:388
av_default_item_name

Definition at line 393 of file dcadec.c.

AVCodec ff_dca_decoder
Initial value:
= {
.name = "dca",
.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
.priv_data_size = sizeof(DCAContext),
.close = dcadec_close,
.priv_class = &dcadec_class,
.caps_internal = 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: internal.h:48
float, planar
Definition: samplefmt.h:70
static const AVClass dcadec_class
Definition: dcadec.c:393
static void flush(AVCodecContext *avctx)
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int dcadec_init(AVCodecContext *avctx)
Definition: dcadec.c:344
static av_cold int dcadec_close(AVCodecContext *avctx)
Definition: dcadec.c:331
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: avcodec.h:915
static av_cold void dcadec_flush(AVCodecContext *avctx)
Definition: dcadec.c:321
static int dcadec_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: dcadec.c:187
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
signed 32 bits, planar
Definition: samplefmt.h:69
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:59
const AVProfile ff_dca_profiles[]
Definition: profiles.c:40
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:572
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:701
signed 16 bits, planar
Definition: samplefmt.h:68
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:856

Definition at line 401 of file dcadec.c.