Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/libavcodec/libdcadec.c b/libavcodec/libdcadec.c
- index a28b983..ddadced 100644
- --- a/libavcodec/libdcadec.c
- +++ b/libavcodec/libdcadec.c
- @@ -31,9 +31,11 @@
- #include "internal.h"
- typedef struct DCADecContext {
- + const AVClass *class;
- struct dcadec_context *ctx;
- uint8_t *buffer;
- int buffer_size;
- + int flags;
- } DCADecContext;
- static int dcadec_decode_frame(AVCodecContext *avctx, void *data,
- @@ -160,7 +162,7 @@ static av_cold int dcadec_init(AVCodecContext *avctx)
- {
- DCADecContext *s = avctx->priv_data;
- - s->ctx = dcadec_context_create(0);
- + s->ctx = dcadec_context_create(s->flags);
- if (!s->ctx)
- return AVERROR(ENOMEM);
- @@ -170,6 +172,27 @@ static av_cold int dcadec_init(AVCodecContext *avctx)
- return 0;
- }
- +#define OFFSET(x) offsetof(DCADecContext, x)
- +#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
- +static const AVOption options[] = {
- + { "libdcadec_flags", "Decode DTS core only without extensions", OFFSET(flags), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, (DCADEC_FLAG_NATIVE_LAYOUT << 1) - 1, AD, "libdcadec_flags" },
- + { "core", "Decode DTS core only without extensions", 0, AV_OPT_TYPE_CONST, { .i64 = DCADEC_FLAG_CORE_ONLY }, INT_MIN, INT_MAX, AD, "libdcadec_flags" },
- + { "bitexact", "Force bit exact DTS core decoding", 0, AV_OPT_TYPE_CONST, { .i64 = DCADEC_FLAG_CORE_BIT_EXACT }, INT_MIN, INT_MAX, AD, "libdcadec_flags" },
- + { "synth_x96", "Force DTS core synthesis using X96 filter", 0, AV_OPT_TYPE_CONST, { .i64 = DCADEC_FLAG_CORE_SYNTH_X96 }, INT_MIN, INT_MAX, AD, "libdcadec_flags" },
- + { "source_pcm_res", "Force DTS core bit width reducion to source PCM resolution", 0, AV_OPT_TYPE_CONST, { .i64 = DCADEC_FLAG_CORE_SOURCE_PCM_RES }, INT_MIN, INT_MAX, AD, "libdcadec_flags" },
- + { "core_lfe_fir", "Use FIR filter for floating point DTS core LFE channel interpolation", 0, AV_OPT_TYPE_CONST, { .i64 = DCADEC_FLAG_CORE_LFE_FIR }, INT_MIN, INT_MAX, AD, "libdcadec_flags" },
- + { "native_layout", "Output native DTS channel layout, not WAVEFORMATEX layout", 0, AV_OPT_TYPE_CONST, { .i64 = DCADEC_FLAG_NATIVE_LAYOUT }, INT_MIN, INT_MAX, AD, "libdcadec_flags" },
- + { NULL },
- +};
- +
- +static const AVClass libdcadec_class = {
- + .class_name = "libdcadec decoder",
- + .item_name = av_default_item_name,
- + .option = options,
- + .version = LIBAVUTIL_VERSION_INT,
- + .category = AV_CLASS_CATEGORY_DECODER,
- +};
- +
- static const AVProfile profiles[] = {
- { FF_PROFILE_DTS, "DTS" },
- { FF_PROFILE_DTS_ES, "DTS-ES" },
- @@ -193,5 +216,6 @@ AVCodec ff_libdcadec_decoder = {
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_CHANNEL_CONF,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P,
- AV_SAMPLE_FMT_NONE },
- + .priv_class = &libdcadec_class,
- .profiles = NULL_IF_CONFIG_SMALL(profiles),
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement