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
45 COLOR,45 COLOR,
46 ACOLOR,46 ACOLOR,
47 XFLAT,47 XFLAT,
48 YFLAT,
48 NB_FILTERS49 NB_FILTERS
49};50};
50 51
@@ -158,6 +159,7 @@ static const AVOption waveform_options[] = { · 107 unmodified lines
158 { "color", NULL, 0, AV_OPT_TYPE_CONST, {.i64=COLOR}, 0, 0, FLAGS, "filter" },159 { "color", NULL, 0, AV_OPT_TYPE_CONST, {.i64=COLOR}, 0, 0, FLAGS, "filter" },
159 { "acolor", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ACOLOR}, 0, 0, FLAGS, "filter" },160 { "acolor", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ACOLOR}, 0, 0, FLAGS, "filter" },
160 { "xflat", NULL, 0, AV_OPT_TYPE_CONST, {.i64=XFLAT}, 0, 0, FLAGS, "filter" },161 { "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" },
161 { "graticule", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_GRATICULES-1, FLAGS, "graticule" },163 { "graticule", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_GRATICULES-1, FLAGS, "graticule" },
162 { "g", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_GRATICULES-1, FLAGS, "graticule" },164 { "g", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_GRATICULES-1, FLAGS, "graticule" },
163 { "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=GRAT_NONE}, 0, 0, FLAGS, "graticule" },165 { "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
317 case LOWPASS: in_pix_fmts = in_lowpass_pix_fmts; break;319 case LOWPASS: in_pix_fmts = in_lowpass_pix_fmts; break;
318 case CHROMA:320 case CHROMA:
319 case XFLAT:321 case XFLAT:
322 case YFLAT:
320 case AFLAT:323 case AFLAT:
321 case FLAT: in_pix_fmts = in_flat_pix_fmts; break;324 case FLAT: in_pix_fmts = in_flat_pix_fmts; break;
322 case ACOLOR:325 case ACOLOR:
@@ -1412,6 +1415,10 @@ AFLAT16(xflat16_row, update16, update16_cr, 0, 0) · 1089 unmodified lines
1412AFLAT16(xflat16_row_mirror, update16, update16_cr, 0, 1)1415AFLAT16(xflat16_row_mirror, update16, update16_cr, 0, 1)
1413AFLAT16(xflat16_column, update16, update16_cr, 1, 0)1416AFLAT16(xflat16_column, update16, update16_cr, 1, 0)
1414AFLAT16(xflat16_column_mirror, update16, update16_cr, 1, 1)1417AFLAT16(xflat16_column_mirror, update16, update16_cr, 1, 1)
1418AFLAT16(yflat16_row, update16_cr, update16_cr, 0, 0)
1419AFLAT16(yflat16_row_mirror, update16_cr, update16_cr, 0, 1)
1420AFLAT16(yflat16_column, update16_cr, update16_cr, 1, 0)
1421AFLAT16(yflat16_column_mirror, update16_cr, update16_cr, 1, 1)
1415 1422
1416AFLAT(aflat_row, update, update, 0, 0)1423AFLAT(aflat_row, update, update, 0, 0)
1417AFLAT(aflat_row_mirror, update, update, 0, 1)1424AFLAT(aflat_row_mirror, update, update, 0, 1)
@@ -1421,6 +1428,10 @@ AFLAT(xflat_row, update, update_cr, 0, 0) · 3 unmodified lines
1421AFLAT(xflat_row_mirror, update, update_cr, 0, 1)1428AFLAT(xflat_row_mirror, update, update_cr, 0, 1)
1422AFLAT(xflat_column, update, update_cr, 1, 0)1429AFLAT(xflat_column, update, update_cr, 1, 0)
1423AFLAT(xflat_column_mirror, update, update_cr, 1, 1)1430AFLAT(xflat_column_mirror, update, update_cr, 1, 1)
1431AFLAT(yflat_row, update_cr, update_cr, 0, 0)
1432AFLAT(yflat_row_mirror, update_cr, update_cr, 0, 1)
1433AFLAT(yflat_column, update_cr, update_cr, 1, 0)
1434AFLAT(yflat_column_mirror, update_cr, update_cr, 1, 1)
1424 1435
1425static av_always_inline void chroma16(WaveformContext *s,1436static av_always_inline void chroma16(WaveformContext *s,
1426 AVFrame *in, AVFrame *out,1437 AVFrame *in, AVFrame *out,
@@ -2957,6 +2968,7 @@ static int config_input(AVFilterLink *inlink) · 1530 unmodified lines
2957 2968
2958 switch (s->filter) {2969 switch (s->filter) {
2959 case XFLAT:2970 case XFLAT:
2971 case YFLAT:
2960 case AFLAT: s->size = 256 * 2; break;2972 case AFLAT: s->size = 256 * 2; break;
2961 case FLAT: s->size = 256 * 3; break;2973 case FLAT: s->size = 256 * 3; break;
2962 default: s->size = 256; break;2974 default: s->size = 256; break;
@@ -3020,6 +3032,14 @@ static int config_input(AVFilterLink *inlink) · 57 unmodified lines
3020 case 0x1016: s->waveform_slice = xflat16_row_mirror; break;3032 case 0x1016: s->waveform_slice = xflat16_row_mirror; break;
3021 case 0x0116: s->waveform_slice = xflat16_column; break;3033 case 0x0116: s->waveform_slice = xflat16_column; break;
3022 case 0x0016: s->waveform_slice = xflat16_row; break;3034 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;
3023 }3043 }
3024 3044
3025 s->grat_yuva_color[0] = 255;3045 s->grat_yuva_color[0] = 255;
@@ -3048,6 +3068,7 @@ static int config_input(AVFilterLink *inlink) · 22 unmodified lines
3048 case CHROMA:3068 case CHROMA:
3049 case AFLAT:3069 case AFLAT:
3050 case XFLAT:3070 case XFLAT:
3071 case YFLAT:
3051 case FLAT:3072 case FLAT:
3052 if (s->graticule > GRAT_NONE && s->mode == 1)3073 if (s->graticule > GRAT_NONE && s->mode == 1)
3053 s->graticulef = s->bits > 8 ? graticule16_column : graticule_column;3074 s->graticulef = s->bits > 8 ? graticule16_column : graticule_column;
@@ -3116,6 +3137,7 @@ static int config_input(AVFilterLink *inlink) · 62 unmodified lines
3116 }3137 }
3117 break;3138 break;
3118 case XFLAT:3139 case XFLAT:
3140 case YFLAT:
3119 case AFLAT:3141 case AFLAT:
3120 switch (s->scale) {3142 switch (s->scale) {
3121 case DIGITAL:3143 case DIGITAL:
@@ -3332,6 +3354,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 210 unmodified lines
3332 break;3354 break;
3333 case AFLAT:3355 case AFLAT:
3334 case XFLAT:3356 case XFLAT:
3357 case YFLAT:
3335 if (s->bits <= 8) {3358 if (s->bits <= 8) {
3336 envelope(s, out, plane, (plane + 0) % s->ncomp, s->mode ? offset_x : offset_y);3359 envelope(s, out, plane, (plane + 0) % s->ncomp, s->mode ? offset_x : offset_y);
3337 envelope(s, out, plane, (plane + 1) % s->ncomp, s->mode ? offset_x : offset_y);3360 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