History

avfilter/vf_waveform: add yflat filter

Paul B Mahol committed 7 years ago

Commit e923e621 parent 33fd82a2 files · +26 −0Browse files

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

Unified · Split

libavfilter/vf_waveform.c+23−0
@@ -45,6 +45,7 @@ enum FilterType { · 44 unmodified lines
4545 COLOR,
4646 ACOLOR,
4747 XFLAT,
48+ YFLAT,
4849 NB_FILTERS
4950 };
5051
@@ -158,6 +159,7 @@ static const AVOption waveform_options[] = { · 107 unmodified lines
158159 { "color", NULL, 0, AV_OPT_TYPE_CONST, {.i64=COLOR}, 0, 0, FLAGS, "filter" },
159160 { "acolor", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ACOLOR}, 0, 0, FLAGS, "filter" },
160161 { "xflat", NULL, 0, AV_OPT_TYPE_CONST, {.i64=XFLAT}, 0, 0, FLAGS, "filter" },
162+ { "yflat", NULL, 0, AV_OPT_TYPE_CONST, {.i64=YFLAT}, 0, 0, FLAGS, "filter" },
161163 { "graticule", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_GRATICULES-1, FLAGS, "graticule" },
162164 { "g", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_GRATICULES-1, FLAGS, "graticule" },
163165 { "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=GRAT_NONE}, 0, 0, FLAGS, "graticule" },
@@ -317,6 +319,7 @@ static int query_formats(AVFilterContext *ctx) · 153 unmodified lines
317319 case LOWPASS: in_pix_fmts = in_lowpass_pix_fmts; break;
318320 case CHROMA:
319321 case XFLAT:
322+ case YFLAT:
320323 case AFLAT:
321324 case FLAT: in_pix_fmts = in_flat_pix_fmts; break;
322325 case ACOLOR:
@@ -1412,6 +1415,10 @@ AFLAT16(xflat16_row, update16, update16_cr, 0, 0) · 1089 unmodified lines
14121415 AFLAT16(xflat16_row_mirror, update16, update16_cr, 0, 1)
14131416 AFLAT16(xflat16_column, update16, update16_cr, 1, 0)
14141417 AFLAT16(xflat16_column_mirror, update16, update16_cr, 1, 1)
1418+AFLAT16(yflat16_row, update16_cr, update16_cr, 0, 0)
1419+AFLAT16(yflat16_row_mirror, update16_cr, update16_cr, 0, 1)
1420+AFLAT16(yflat16_column, update16_cr, update16_cr, 1, 0)
1421+AFLAT16(yflat16_column_mirror, update16_cr, update16_cr, 1, 1)
14151422
14161423 AFLAT(aflat_row, update, update, 0, 0)
14171424 AFLAT(aflat_row_mirror, update, update, 0, 1)
@@ -1421,6 +1428,10 @@ AFLAT(xflat_row, update, update_cr, 0, 0) · 3 unmodified lines
14211428 AFLAT(xflat_row_mirror, update, update_cr, 0, 1)
14221429 AFLAT(xflat_column, update, update_cr, 1, 0)
14231430 AFLAT(xflat_column_mirror, update, update_cr, 1, 1)
1431+AFLAT(yflat_row, update_cr, update_cr, 0, 0)
1432+AFLAT(yflat_row_mirror, update_cr, update_cr, 0, 1)
1433+AFLAT(yflat_column, update_cr, update_cr, 1, 0)
1434+AFLAT(yflat_column_mirror, update_cr, update_cr, 1, 1)
14241435
14251436 static av_always_inline void chroma16(WaveformContext *s,
14261437 AVFrame *in, AVFrame *out,
@@ -2957,6 +2968,7 @@ static int config_input(AVFilterLink *inlink) · 1530 unmodified lines
29572968
29582969 switch (s->filter) {
29592970 case XFLAT:
2971+ case YFLAT:
29602972 case AFLAT: s->size = 256 * 2; break;
29612973 case FLAT: s->size = 256 * 3; break;
29622974 default: s->size = 256; break;
@@ -3020,6 +3032,14 @@ static int config_input(AVFilterLink *inlink) · 57 unmodified lines
30203032 case 0x1016: s->waveform_slice = xflat16_row_mirror; break;
30213033 case 0x0116: s->waveform_slice = xflat16_column; break;
30223034 case 0x0016: s->waveform_slice = xflat16_row; break;
3035+ case 0x1107: s->waveform_slice = yflat_column_mirror; break;
3036+ case 0x1007: s->waveform_slice = yflat_row_mirror; break;
3037+ case 0x0107: s->waveform_slice = yflat_column; break;
3038+ case 0x0007: s->waveform_slice = yflat_row; break;
3039+ case 0x1117: s->waveform_slice = yflat16_column_mirror; break;
3040+ case 0x1017: s->waveform_slice = yflat16_row_mirror; break;
3041+ case 0x0117: s->waveform_slice = yflat16_column; break;
3042+ case 0x0017: s->waveform_slice = yflat16_row; break;
30233043 }
30243044
30253045 s->grat_yuva_color[0] = 255;
@@ -3048,6 +3068,7 @@ static int config_input(AVFilterLink *inlink) · 22 unmodified lines
30483068 case CHROMA:
30493069 case AFLAT:
30503070 case XFLAT:
3071+ case YFLAT:
30513072 case FLAT:
30523073 if (s->graticule > GRAT_NONE && s->mode == 1)
30533074 s->graticulef = s->bits > 8 ? graticule16_column : graticule_column;
@@ -3116,6 +3137,7 @@ static int config_input(AVFilterLink *inlink) · 62 unmodified lines
31163137 }
31173138 break;
31183139 case XFLAT:
3140+ case YFLAT:
31193141 case AFLAT:
31203142 switch (s->scale) {
31213143 case DIGITAL:
@@ -3332,6 +3354,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 210 unmodified lines
33323354 break;
33333355 case AFLAT:
33343356 case XFLAT:
3357+ case YFLAT:
33353358 if (s->bits <= 8) {
33363359 envelope(s, out, plane, (plane + 0) % s->ncomp, s->mode ? offset_x : offset_y);
33373360 envelope(s, out, plane, (plane + 1) % s->ncomp, s->mode ? offset_x : offset_y);

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