av_freep(f);
}
-int ff_celt_init(AVCodecContext *avctx, CeltFrame **f, int output_channels)
+int ff_celt_init(AVCodecContext *avctx, CeltFrame **f, int output_channels,
+ int apply_phase_inv)
{
CeltFrame *frm;
int i, ret;
frm->avctx = avctx;
frm->output_channels = output_channels;
+ frm->apply_phase_inv = apply_phase_inv;
for (i = 0; i < FF_ARRAY_ELEMS(frm->imdct); i++)
if ((ret = ff_mdct15_init(&frm->imdct[i], 1, i + 3, -1.0f/32768)) < 0)
CeltPVQ *pvq;
int channels;
int output_channels;
+ int apply_phase_inv;
enum CeltBlockSize size;
int start_band;
X[i] *= g;
}
-int ff_celt_init(AVCodecContext *avctx, CeltFrame **f, int output_channels);
+int ff_celt_init(AVCodecContext *avctx, CeltFrame **f, int output_channels,
+ int apply_phase_inv);
void ff_celt_free(CeltFrame **f);
if (ret < 0)
goto fail;
- ret = ff_celt_init(avctx, &s->celt, s->output_channels);
+ ret = ff_celt_init(avctx, &s->celt, s->output_channels, c->apply_phase_inv);
if (ret < 0)
goto fail;
return ret;
}
+#define OFFSET(x) offsetof(OpusContext, x)
+#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+static const AVOption opus_options[] = {
+ { "apply_phase_inv", "Apply intensity stereo phase inversion", OFFSET(apply_phase_inv), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, AD },
+ { NULL },
+};
+
+static const AVClass opus_class = {
+ .class_name = "Opus Decoder",
+ .item_name = av_default_item_name,
+ .option = opus_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_opus_decoder = {
.name = "opus",
.long_name = NULL_IF_CONFIG_SMALL("Opus"),
+ .priv_class = &opus_class,
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_OPUS,
.priv_data_size = sizeof(OpusContext),