avfilter/af_stereotools: add 2 more modes

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2017-06-19 18:59:33 +02:00
parent 1a4236e025
commit ef178f630f
2 changed files with 18 additions and 1 deletions

View File

@ -3743,6 +3743,12 @@ Left/Right to Left + Right.
@item lr>rl
Left/Right to Right/Left.
@item ms>ll
Mid/Side to Left/Left.
@item ms>rr
Mid/Side to Right/Right.
@end table
@item slev

View File

@ -69,7 +69,7 @@ static const AVOption stereotools_options[] = {
{ "muter", "mute R", OFFSET(mute_r), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
{ "phasel", "phase L", OFFSET(phase_l), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
{ "phaser", "phase R", OFFSET(phase_r), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
{ "mode", "set stereo mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 6, A, "mode" },
{ "mode", "set stereo mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 8, A, "mode" },
{ "lr>lr", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, "mode" },
{ "lr>ms", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, "mode" },
{ "ms>lr", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, A, "mode" },
@ -77,6 +77,8 @@ static const AVOption stereotools_options[] = {
{ "lr>rr", 0, 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, A, "mode" },
{ "lr>l+r", 0, 0, AV_OPT_TYPE_CONST, {.i64=5}, 0, 0, A, "mode" },
{ "lr>rl", 0, 0, AV_OPT_TYPE_CONST, {.i64=6}, 0, 0, A, "mode" },
{ "ms>ll", 0, 0, AV_OPT_TYPE_CONST, {.i64=7}, 0, 0, A, "mode" },
{ "ms>rr", 0, 0, AV_OPT_TYPE_CONST, {.i64=8}, 0, 0, A, "mode" },
{ "slev", "set side level", OFFSET(slev), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
{ "sbal", "set side balance", OFFSET(sbal), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
{ "mlev", "set middle level", OFFSET(mlev), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
@ -246,6 +248,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
r = m * mlev * FFMIN(1., mpan) - S * slev * FFMIN(1., sbal);
L = l;
R = r;
case 7:
l = L * mlev * FFMIN(1., 2. - mpan) + R * slev * FFMIN(1., 2. - sbal);
L = l;
R = l;
break;
case 8:
r = L * mlev * FFMIN(1., mpan) - R * slev * FFMIN(1., sbal);
L = r;
R = r;
break;
}