|
|
|
@ -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, 8, A, "mode" }, |
|
|
|
|
{ "mode", "set stereo mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 10, 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" }, |
|
|
|
@ -79,6 +79,8 @@ static const AVOption stereotools_options[] = { |
|
|
|
|
{ "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" }, |
|
|
|
|
{ "ms>rl", 0, 0, AV_OPT_TYPE_CONST, {.i64=9}, 0, 0, A, "mode" }, |
|
|
|
|
{ "lr>l-r", 0, 0, AV_OPT_TYPE_CONST, {.i64=10}, 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 }, |
|
|
|
@ -235,7 +237,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) |
|
|
|
|
L = R; |
|
|
|
|
break; |
|
|
|
|
case 5: |
|
|
|
|
L = (L + R) / 2; |
|
|
|
|
L = (L + R) * 0.5; |
|
|
|
|
R = L; |
|
|
|
|
break; |
|
|
|
|
case 6: |
|
|
|
@ -259,6 +261,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) |
|
|
|
|
L = r; |
|
|
|
|
R = r; |
|
|
|
|
break; |
|
|
|
|
case 9: |
|
|
|
|
l = L * mlev * FFMIN(1., 2. - mpan) + R * slev * FFMIN(1., 2. - sbal); |
|
|
|
|
r = L * mlev * FFMIN(1., mpan) - R * slev * FFMIN(1., sbal); |
|
|
|
|
L = r; |
|
|
|
|
R = l; |
|
|
|
|
break; |
|
|
|
|
case 10: |
|
|
|
|
L = (L - R) * 0.5; |
|
|
|
|
R = L; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
L *= 1. - mute_l; |
|
|
|
|