History

avfilter/af_surround: export more channel's in/out gains

Paul B Mahol committed 7 years ago

Commit 4a69b181 parent ce15c3a2 files · +112 −0Browse files

Showing the changes to libavfilter (1 of 2 files). Show all

Unified · Split

libavfilter/af_surround.c+70−0
@@ -39,6 +39,20 @@ typedef struct AudioSurroundContext { · 38 unmodified lines
3939 float level_out;
4040 float fc_in;
4141 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;
4256 float lfe_in;
4357 float lfe_out;
4458 int lfe_mode;
@@ -202,6 +216,27 @@ static int config_input(AVFilterLink *inlink) · 157 unmodified lines
202216 ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_FRONT_CENTER);
203217 if (ch >= 0)
204218 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;
205240 ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_LOW_FREQUENCY);
206241 if (ch >= 0)
207242 s->input_levels[ch] *= s->lfe_in;
@@ -244,6 +279,27 @@ static int config_output(AVFilterLink *outlink) · 36 unmodified lines
244279 ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_FRONT_CENTER);
245280 if (ch >= 0)
246281 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;
247303 ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_LOW_FREQUENCY);
248304 if (ch >= 0)
249305 s->output_levels[ch] *= s->lfe_out;
@@ -1620,6 +1676,20 @@ static const AVOption surround_options[] = { · 1370 unmodified lines
16201676 { "sub", "substract LFE channel with others", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 1, FLAGS, "lfe_mode" },
16211677 { "fc_in", "set front center channel input level", OFFSET(fc_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
16221678 { "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 },
16231693 { "lfe_in", "set lfe channel input level", OFFSET(lfe_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
16241694 { "lfe_out", "set lfe channel output level", OFFSET(lfe_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
16251695 { "allx", "set all channel's x spread", OFFSET(all_x), AV_OPT_TYPE_FLOAT, {.dbl=-1}, -1, 15, FLAGS },

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t