mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-12-04 09:34:53 +00:00
avfilter/af_stereotools: add 2 more modes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
1a4236e025
commit
ef178f630f
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user