Showing the changes to libavfilter (1 of 2 files). Show all
Unified · Split
| @@ -39,6 +39,20 @@ typedef struct AudioSurroundContext { · 38 unmodified lines | ||
| 39 | 39 | float level_out; |
| 40 | 40 | float fc_in; |
| 41 | 41 | float fc_out; |
| 42 | + float fl_in; | |
| 43 | + float fl_out; | |
| 44 | + float fr_in; | |
| 45 | + float fr_out; | |
| 46 | + float sl_in; | |
| 47 | + float sl_out; | |
| 48 | + float sr_in; | |
| 49 | + float sr_out; | |
| 50 | + float bl_in; | |
| 51 | + float bl_out; | |
| 52 | + float br_in; | |
| 53 | + float br_out; | |
| 54 | + float bc_in; | |
| 55 | + float bc_out; | |
| 42 | 56 | float lfe_in; |
| 43 | 57 | float lfe_out; |
| 44 | 58 | int lfe_mode; |
| @@ -202,6 +216,27 @@ static int config_input(AVFilterLink *inlink) · 157 unmodified lines | ||
| 202 | 216 | ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_FRONT_CENTER); |
| 203 | 217 | if (ch >= 0) |
| 204 | 218 | s->input_levels[ch] *= s->fc_in; |
| 219 | + ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_FRONT_LEFT); | |
| 220 | + if (ch >= 0) | |
| 221 | + s->input_levels[ch] *= s->fl_in; | |
| 222 | + ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_FRONT_RIGHT); | |
| 223 | + if (ch >= 0) | |
| 224 | + s->input_levels[ch] *= s->fr_in; | |
| 225 | + ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_SIDE_LEFT); | |
| 226 | + if (ch >= 0) | |
| 227 | + s->input_levels[ch] *= s->sl_in; | |
| 228 | + ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_SIDE_RIGHT); | |
| 229 | + if (ch >= 0) | |
| 230 | + s->input_levels[ch] *= s->sr_in; | |
| 231 | + ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_BACK_LEFT); | |
| 232 | + if (ch >= 0) | |
| 233 | + s->input_levels[ch] *= s->bl_in; | |
| 234 | + ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_BACK_RIGHT); | |
| 235 | + if (ch >= 0) | |
| 236 | + s->input_levels[ch] *= s->br_in; | |
| 237 | + ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_BACK_CENTER); | |
| 238 | + if (ch >= 0) | |
| 239 | + s->input_levels[ch] *= s->bc_in; | |
| 205 | 240 | ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_LOW_FREQUENCY); |
| 206 | 241 | if (ch >= 0) |
| 207 | 242 | s->input_levels[ch] *= s->lfe_in; |
| @@ -244,6 +279,27 @@ static int config_output(AVFilterLink *outlink) · 36 unmodified lines | ||
| 244 | 279 | ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_FRONT_CENTER); |
| 245 | 280 | if (ch >= 0) |
| 246 | 281 | s->output_levels[ch] *= s->fc_out; |
| 282 | + ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_FRONT_LEFT); | |
| 283 | + if (ch >= 0) | |
| 284 | + s->output_levels[ch] *= s->fl_out; | |
| 285 | + ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_FRONT_RIGHT); | |
| 286 | + if (ch >= 0) | |
| 287 | + s->output_levels[ch] *= s->fr_out; | |
| 288 | + ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_SIDE_LEFT); | |
| 289 | + if (ch >= 0) | |
| 290 | + s->output_levels[ch] *= s->sl_out; | |
| 291 | + ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_SIDE_RIGHT); | |
| 292 | + if (ch >= 0) | |
| 293 | + s->output_levels[ch] *= s->sr_out; | |
| 294 | + ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_BACK_LEFT); | |
| 295 | + if (ch >= 0) | |
| 296 | + s->output_levels[ch] *= s->bl_out; | |
| 297 | + ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_BACK_RIGHT); | |
| 298 | + if (ch >= 0) | |
| 299 | + s->output_levels[ch] *= s->br_out; | |
| 300 | + ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_BACK_CENTER); | |
| 301 | + if (ch >= 0) | |
| 302 | + s->output_levels[ch] *= s->bc_out; | |
| 247 | 303 | ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_LOW_FREQUENCY); |
| 248 | 304 | if (ch >= 0) |
| 249 | 305 | s->output_levels[ch] *= s->lfe_out; |
| @@ -1620,6 +1676,20 @@ static const AVOption surround_options[] = { · 1370 unmodified lines | ||
| 1620 | 1676 | { "sub", "substract LFE channel with others", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 1, FLAGS, "lfe_mode" }, |
| 1621 | 1677 | { "fc_in", "set front center channel input level", OFFSET(fc_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, |
| 1622 | 1678 | { "fc_out", "set front center channel output level", OFFSET(fc_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, |
| 1679 | + { "fl_in", "set front left channel input level", OFFSET(fl_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1680 | + { "fl_out", "set front left channel output level", OFFSET(fl_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1681 | + { "fr_in", "set front right channel input level", OFFSET(fr_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1682 | + { "fr_out", "set front right channel output level", OFFSET(fr_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1683 | + { "sl_in", "set side left channel input level", OFFSET(sl_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1684 | + { "sl_out", "set side left channel output level", OFFSET(sl_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1685 | + { "sr_in", "set side right channel input level", OFFSET(sr_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1686 | + { "sr_out", "set side right channel output level", OFFSET(sr_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1687 | + { "bl_in", "set back left channel input level", OFFSET(bl_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1688 | + { "bl_out", "set back left channel output level", OFFSET(bl_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1689 | + { "br_in", "set back right channel input level", OFFSET(br_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1690 | + { "br_out", "set back right channel output level", OFFSET(br_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1691 | + { "bc_in", "set back center channel input level", OFFSET(bc_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1692 | + { "bc_out", "set back center channel output level", OFFSET(bc_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, | |
| 1623 | 1693 | { "lfe_in", "set lfe channel input level", OFFSET(lfe_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, |
| 1624 | 1694 | { "lfe_out", "set lfe channel output level", OFFSET(lfe_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, |
| 1625 | 1695 | { "allx", "set all channel's x spread", OFFSET(all_x), AV_OPT_TYPE_FLOAT, {.dbl=-1}, -1, 15, FLAGS }, |