ac3dec: export center & suroundmix levels

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-08-13 00:55:11 +02:00
parent c4fd1d34ca
commit 931187e117
2 changed files with 17 additions and 0 deletions

View File

@ -1382,6 +1382,10 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
avctx->channels = s->out_channels;
avctx->channel_layout = s->channel_layout;
s->loro_center_mix_level = gain_levels[ center_levels[s-> center_mix_level]];
s->loro_surround_mix_level = gain_levels[surround_levels[s->surround_mix_level]];
s->ltrt_center_mix_level = LEVEL_MINUS_3DB;
s->ltrt_surround_mix_level = LEVEL_MINUS_3DB;
/* set downmixing coefficients if needed */
if(s->channels != s->out_channels && !((s->output_mode & AC3_OUTPUT_LFEON) &&
s->fbw_channels == s->out_channels)) {
@ -1443,6 +1447,13 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx)
#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
static const AVOption options[] = {
{ "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, {1.0}, 0.0, 1.0, PAR },
{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 2, 0, "dmix_mode"},
{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
{ NULL},
};

View File

@ -88,6 +88,12 @@ typedef struct {
int eac3; ///< indicates if current frame is E-AC-3
///@}
int preferred_stereo_downmix;
float ltrt_center_mix_level;
float ltrt_surround_mix_level;
float loro_center_mix_level;
float loro_surround_mix_level;
///@name Frame syntax parameters
int snr_offset_strategy; ///< SNR offset strategy (snroffststr)
int block_switch_syntax; ///< block switch syntax enabled (blkswe)