You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

523 lines
19KB

  1. /*
  2. * Copyright (c) 2012-2013 Paul B Mahol
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include "libavutil/avassert.h"
  21. #include "libavutil/opt.h"
  22. #include "libavutil/parseutils.h"
  23. #include "libavutil/pixdesc.h"
  24. #include "libavutil/imgutils.h"
  25. #include "libavutil/intreadwrite.h"
  26. #include "avfilter.h"
  27. #include "formats.h"
  28. #include "internal.h"
  29. #include "video.h"
  30. enum HistogramMode {
  31. MODE_LEVELS,
  32. MODE_WAVEFORM,
  33. MODE_COLOR,
  34. MODE_COLOR2,
  35. MODE_NB
  36. };
  37. typedef struct HistogramContext {
  38. const AVClass *class; ///< AVClass context for log and options purpose
  39. int mode; ///< HistogramMode
  40. unsigned histogram[256*256];
  41. int histogram_size;
  42. int mult;
  43. int ncomp;
  44. const uint8_t *bg_color;
  45. const uint8_t *fg_color;
  46. int level_height;
  47. int scale_height;
  48. int step;
  49. int waveform_mode;
  50. int waveform_mirror;
  51. int display_mode;
  52. int levels_mode;
  53. const AVPixFmtDescriptor *desc, *odesc;
  54. int components;
  55. int planewidth[4];
  56. int planeheight[4];
  57. } HistogramContext;
  58. #define OFFSET(x) offsetof(HistogramContext, x)
  59. #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
  60. static const AVOption histogram_options[] = {
  61. { "mode", "set histogram mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_LEVELS}, 0, MODE_NB-1, FLAGS, "mode"},
  62. { "levels", "standard histogram", 0, AV_OPT_TYPE_CONST, {.i64=MODE_LEVELS}, 0, 0, FLAGS, "mode" },
  63. { "waveform", "per row/column luminance graph", 0, AV_OPT_TYPE_CONST, {.i64=MODE_WAVEFORM}, 0, 0, FLAGS, "mode" },
  64. { "color", "chroma values in vectorscope", 0, AV_OPT_TYPE_CONST, {.i64=MODE_COLOR}, 0, 0, FLAGS, "mode" },
  65. { "color2", "chroma values in vectorscope", 0, AV_OPT_TYPE_CONST, {.i64=MODE_COLOR2}, 0, 0, FLAGS, "mode" },
  66. { "level_height", "set level height", OFFSET(level_height), AV_OPT_TYPE_INT, {.i64=200}, 50, 2048, FLAGS},
  67. { "scale_height", "set scale height", OFFSET(scale_height), AV_OPT_TYPE_INT, {.i64=12}, 0, 40, FLAGS},
  68. { "step", "set waveform step value", OFFSET(step), AV_OPT_TYPE_INT, {.i64=10}, 1, 255, FLAGS},
  69. { "waveform_mode", "set waveform mode", OFFSET(waveform_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "waveform_mode"},
  70. { "row", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "waveform_mode" },
  71. { "column", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "waveform_mode" },
  72. { "waveform_mirror", "set waveform mirroring", OFFSET(waveform_mirror), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "waveform_mirror"},
  73. { "display_mode", "set display mode", OFFSET(display_mode), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "display_mode"},
  74. { "parade", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "display_mode" },
  75. { "overlay", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "display_mode" },
  76. { "levels_mode", "set levels mode", OFFSET(levels_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "levels_mode"},
  77. { "linear", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "levels_mode" },
  78. { "logarithmic", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "levels_mode" },
  79. { "components", "set color components to display", OFFSET(components), AV_OPT_TYPE_INT, {.i64=7}, 1, 15, FLAGS},
  80. { NULL }
  81. };
  82. AVFILTER_DEFINE_CLASS(histogram);
  83. static const enum AVPixelFormat color_pix_fmts[] = {
  84. AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVJ444P,
  85. AV_PIX_FMT_NONE
  86. };
  87. static const enum AVPixelFormat levels_in_pix_fmts[] = {
  88. AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
  89. AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
  90. AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUVJ411P,
  91. AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV410P,
  92. AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
  93. AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
  94. AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9,
  95. AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
  96. AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10,
  97. AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRP,
  98. AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
  99. AV_PIX_FMT_GRAY8,
  100. AV_PIX_FMT_NONE
  101. };
  102. static const enum AVPixelFormat levels_out_yuv8_pix_fmts[] = {
  103. AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P,
  104. AV_PIX_FMT_NONE
  105. };
  106. static const enum AVPixelFormat levels_out_yuv9_pix_fmts[] = {
  107. AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUV444P9,
  108. AV_PIX_FMT_NONE
  109. };
  110. static const enum AVPixelFormat levels_out_yuv10_pix_fmts[] = {
  111. AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUV444P10,
  112. AV_PIX_FMT_NONE
  113. };
  114. static const enum AVPixelFormat levels_out_rgb8_pix_fmts[] = {
  115. AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRP,
  116. AV_PIX_FMT_NONE
  117. };
  118. static const enum AVPixelFormat levels_out_rgb9_pix_fmts[] = {
  119. AV_PIX_FMT_GBRP9,
  120. AV_PIX_FMT_NONE
  121. };
  122. static const enum AVPixelFormat levels_out_rgb10_pix_fmts[] = {
  123. AV_PIX_FMT_GBRP10,
  124. AV_PIX_FMT_NONE
  125. };
  126. static const enum AVPixelFormat waveform_pix_fmts[] = {
  127. AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
  128. AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
  129. AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
  130. AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
  131. AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
  132. AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
  133. AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
  134. AV_PIX_FMT_GRAY8,
  135. AV_PIX_FMT_NONE
  136. };
  137. static int query_formats(AVFilterContext *ctx)
  138. {
  139. HistogramContext *h = ctx->priv;
  140. const enum AVPixelFormat *pix_fmts;
  141. AVFilterFormats *fmts_list;
  142. switch (h->mode) {
  143. case MODE_WAVEFORM:
  144. pix_fmts = waveform_pix_fmts;
  145. break;
  146. case MODE_LEVELS:
  147. {
  148. AVFilterFormats *avff;
  149. const AVPixFmtDescriptor *desc;
  150. const enum AVPixelFormat *out_pix_fmts;
  151. int rgb, i, bits;
  152. if (!ctx->inputs[0]->in_formats ||
  153. !ctx->inputs[0]->in_formats->nb_formats) {
  154. return AVERROR(EAGAIN);
  155. }
  156. if (!ctx->inputs[0]->out_formats)
  157. ff_formats_ref(ff_make_format_list(levels_in_pix_fmts), &ctx->inputs[0]->out_formats);
  158. avff = ctx->inputs[0]->in_formats;
  159. desc = av_pix_fmt_desc_get(avff->formats[0]);
  160. rgb = desc->flags & AV_PIX_FMT_FLAG_RGB;
  161. bits = desc->comp[0].depth_minus1;
  162. for (i = 1; i < avff->nb_formats; i++) {
  163. desc = av_pix_fmt_desc_get(avff->formats[i]);
  164. if ((rgb != desc->flags & AV_PIX_FMT_FLAG_RGB) ||
  165. (bits != desc->comp[0].depth_minus1))
  166. return AVERROR(EAGAIN);
  167. }
  168. if (rgb && bits == 7)
  169. out_pix_fmts = levels_out_rgb8_pix_fmts;
  170. else if (rgb && bits == 8)
  171. out_pix_fmts = levels_out_rgb9_pix_fmts;
  172. else if (rgb && bits == 9)
  173. out_pix_fmts = levels_out_rgb10_pix_fmts;
  174. else if (bits == 7)
  175. out_pix_fmts = levels_out_yuv8_pix_fmts;
  176. else if (bits == 8)
  177. out_pix_fmts = levels_out_yuv9_pix_fmts;
  178. else // if (bits == 9)
  179. out_pix_fmts = levels_out_yuv10_pix_fmts;
  180. ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats);
  181. return 0;
  182. }
  183. break;
  184. case MODE_COLOR:
  185. case MODE_COLOR2:
  186. pix_fmts = color_pix_fmts;
  187. break;
  188. default:
  189. av_assert0(0);
  190. }
  191. fmts_list = ff_make_format_list(pix_fmts);
  192. if (!fmts_list)
  193. return AVERROR(ENOMEM);
  194. return ff_set_common_formats(ctx, fmts_list);
  195. }
  196. static const uint8_t black_yuva_color[4] = { 0, 127, 127, 255 };
  197. static const uint8_t black_gbrp_color[4] = { 0, 0, 0, 255 };
  198. static const uint8_t white_yuva_color[4] = { 255, 127, 127, 255 };
  199. static const uint8_t white_gbrp_color[4] = { 255, 255, 255, 255 };
  200. static int config_input(AVFilterLink *inlink)
  201. {
  202. HistogramContext *h = inlink->dst->priv;
  203. h->desc = av_pix_fmt_desc_get(inlink->format);
  204. h->ncomp = h->desc->nb_components;
  205. h->histogram_size = 1 << (h->desc->comp[0].depth_minus1 + 1);
  206. h->mult = h->histogram_size / 256;
  207. switch (inlink->format) {
  208. case AV_PIX_FMT_GBRP10:
  209. case AV_PIX_FMT_GBRP9:
  210. case AV_PIX_FMT_GBRAP:
  211. case AV_PIX_FMT_GBRP:
  212. h->bg_color = black_gbrp_color;
  213. h->fg_color = white_gbrp_color;
  214. break;
  215. default:
  216. h->bg_color = black_yuva_color;
  217. h->fg_color = white_yuva_color;
  218. }
  219. h->planeheight[1] = h->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, h->desc->log2_chroma_h);
  220. h->planeheight[0] = h->planeheight[3] = inlink->h;
  221. h->planewidth[1] = h->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, h->desc->log2_chroma_w);
  222. h->planewidth[0] = h->planewidth[3] = inlink->w;
  223. return 0;
  224. }
  225. static int config_output(AVFilterLink *outlink)
  226. {
  227. AVFilterContext *ctx = outlink->src;
  228. HistogramContext *h = ctx->priv;
  229. int ncomp = 0, i;
  230. switch (h->mode) {
  231. case MODE_LEVELS:
  232. for (i = 0; i < h->ncomp; i++) {
  233. if ((1 << i) & h->components)
  234. ncomp++;
  235. }
  236. outlink->w = h->histogram_size;
  237. outlink->h = (h->level_height + h->scale_height) * FFMAX(ncomp * h->display_mode, 1);
  238. break;
  239. case MODE_WAVEFORM:
  240. av_log(ctx, AV_LOG_WARNING, "This mode is deprecated, please use waveform filter instead.\n");
  241. if (h->waveform_mode)
  242. outlink->h = 256 * FFMAX(h->ncomp * h->display_mode, 1);
  243. else
  244. outlink->w = 256 * FFMAX(h->ncomp * h->display_mode, 1);
  245. break;
  246. case MODE_COLOR:
  247. case MODE_COLOR2:
  248. av_log(ctx, AV_LOG_WARNING, "This mode is deprecated, use vectorscope filter instead.");
  249. outlink->h = outlink->w = 256;
  250. break;
  251. default:
  252. av_assert0(0);
  253. }
  254. h->odesc = av_pix_fmt_desc_get(outlink->format);
  255. outlink->sample_aspect_ratio = (AVRational){1,1};
  256. return 0;
  257. }
  258. static void gen_waveform(HistogramContext *h, AVFrame *inpicref, AVFrame *outpicref,
  259. int component, int intensity, int offset, int col_mode)
  260. {
  261. const int plane = h->desc->comp[component].plane;
  262. const int mirror = h->waveform_mirror;
  263. const int is_chroma = (component == 1 || component == 2);
  264. const int shift_w = (is_chroma ? h->desc->log2_chroma_w : 0);
  265. const int shift_h = (is_chroma ? h->desc->log2_chroma_h : 0);
  266. const int src_linesize = inpicref->linesize[plane];
  267. const int dst_linesize = outpicref->linesize[plane];
  268. const int dst_signed_linesize = dst_linesize * (mirror == 1 ? -1 : 1);
  269. uint8_t *src_data = inpicref->data[plane];
  270. uint8_t *dst_data = outpicref->data[plane] + (col_mode ? (offset >> shift_h) * dst_linesize : offset >> shift_w);
  271. uint8_t * const dst_bottom_line = dst_data + dst_linesize * ((256 >> shift_h) - 1);
  272. uint8_t * const dst_line = (mirror ? dst_bottom_line : dst_data);
  273. const uint8_t max = 255 - intensity;
  274. const int src_h = FF_CEIL_RSHIFT(inpicref->height, shift_h);
  275. const int src_w = FF_CEIL_RSHIFT(inpicref->width, shift_w);
  276. uint8_t *dst, *p;
  277. int y;
  278. if (!col_mode && mirror)
  279. dst_data += 256 >> shift_w;
  280. for (y = 0; y < src_h; y++) {
  281. const uint8_t *src_data_end = src_data + src_w;
  282. dst = dst_line;
  283. for (p = src_data; p < src_data_end; p++) {
  284. uint8_t *target;
  285. if (col_mode) {
  286. target = dst++ + dst_signed_linesize * (*p >> shift_h);
  287. } else {
  288. if (mirror)
  289. target = dst_data - (*p >> shift_w);
  290. else
  291. target = dst_data + (*p >> shift_w);
  292. }
  293. if (*target <= max)
  294. *target += intensity;
  295. else
  296. *target = 255;
  297. }
  298. src_data += src_linesize;
  299. dst_data += dst_linesize;
  300. }
  301. }
  302. static int filter_frame(AVFilterLink *inlink, AVFrame *in)
  303. {
  304. HistogramContext *h = inlink->dst->priv;
  305. AVFilterContext *ctx = inlink->dst;
  306. AVFilterLink *outlink = ctx->outputs[0];
  307. AVFrame *out;
  308. uint8_t *dst;
  309. int i, j, k, l, m;
  310. out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
  311. if (!out) {
  312. av_frame_free(&in);
  313. return AVERROR(ENOMEM);
  314. }
  315. out->pts = in->pts;
  316. for (k = 0; k < 4 && out->data[k]; k++) {
  317. const int is_chroma = (k == 1 || k == 2);
  318. const int dst_h = FF_CEIL_RSHIFT(outlink->h, (is_chroma ? h->odesc->log2_chroma_h : 0));
  319. const int dst_w = FF_CEIL_RSHIFT(outlink->w, (is_chroma ? h->odesc->log2_chroma_w : 0));
  320. if (h->histogram_size <= 256) {
  321. for (i = 0; i < dst_h ; i++)
  322. memset(out->data[h->odesc->comp[k].plane] +
  323. i * out->linesize[h->odesc->comp[k].plane],
  324. h->bg_color[k], dst_w);
  325. } else {
  326. const int mult = h->mult;
  327. for (i = 0; i < dst_h ; i++)
  328. for (j = 0; j < dst_w; j++)
  329. AV_WN16(out->data[h->odesc->comp[k].plane] +
  330. i * out->linesize[h->odesc->comp[k].plane] + j * 2,
  331. h->bg_color[k] * mult);
  332. }
  333. }
  334. switch (h->mode) {
  335. case MODE_LEVELS:
  336. for (m = 0, k = 0; k < h->ncomp; k++) {
  337. const int p = h->desc->comp[k].plane;
  338. const int height = h->planeheight[p];
  339. const int width = h->planewidth[p];
  340. double max_hval_log;
  341. unsigned max_hval = 0;
  342. int start;
  343. if (!((1 << k) & h->components))
  344. continue;
  345. start = m++ * (h->level_height + h->scale_height) * h->display_mode;
  346. if (h->histogram_size <= 256) {
  347. for (i = 0; i < height; i++) {
  348. const uint8_t *src = in->data[p] + i * in->linesize[p];
  349. for (j = 0; j < width; j++)
  350. h->histogram[src[j]]++;
  351. }
  352. } else {
  353. for (i = 0; i < height; i++) {
  354. const uint16_t *src = (const uint16_t *)(in->data[p] + i * in->linesize[p]);
  355. for (j = 0; j < width; j++)
  356. h->histogram[src[j]]++;
  357. }
  358. }
  359. for (i = 0; i < h->histogram_size; i++)
  360. max_hval = FFMAX(max_hval, h->histogram[i]);
  361. max_hval_log = log2(max_hval + 1);
  362. for (i = 0; i < outlink->w; i++) {
  363. int col_height;
  364. if (h->levels_mode)
  365. col_height = round(h->level_height * (1. - (log2(h->histogram[i] + 1) / max_hval_log)));
  366. else
  367. col_height = h->level_height - (h->histogram[i] * (int64_t)h->level_height + max_hval - 1) / max_hval;
  368. if (h->histogram_size <= 256) {
  369. for (j = h->level_height - 1; j >= col_height; j--) {
  370. if (h->display_mode) {
  371. for (l = 0; l < h->ncomp; l++)
  372. out->data[l][(j + start) * out->linesize[l] + i] = h->fg_color[l];
  373. } else {
  374. out->data[p][(j + start) * out->linesize[p] + i] = 255;
  375. }
  376. }
  377. for (j = h->level_height + h->scale_height - 1; j >= h->level_height; j--)
  378. out->data[p][(j + start) * out->linesize[p] + i] = i;
  379. } else {
  380. const int mult = h->mult;
  381. for (j = h->level_height - 1; j >= col_height; j--) {
  382. if (h->display_mode) {
  383. for (l = 0; l < h->ncomp; l++)
  384. AV_WN16(out->data[l] + (j + start) * out->linesize[l] + i * 2, h->fg_color[l] * mult);
  385. } else {
  386. AV_WN16(out->data[p] + (j + start) * out->linesize[p] + i * 2, 255 * mult);
  387. }
  388. }
  389. for (j = h->level_height + h->scale_height - 1; j >= h->level_height; j--)
  390. AV_WN16(out->data[p] + (j + start) * out->linesize[p] + i * 2, i);
  391. }
  392. }
  393. memset(h->histogram, 0, h->histogram_size * sizeof(unsigned));
  394. }
  395. break;
  396. case MODE_WAVEFORM:
  397. for (k = 0; k < h->ncomp; k++) {
  398. const int offset = k * 256 * h->display_mode;
  399. gen_waveform(h, in, out, k, h->step, offset, h->waveform_mode);
  400. }
  401. break;
  402. case MODE_COLOR:
  403. for (i = 0; i < inlink->h; i++) {
  404. const int iw1 = i * in->linesize[1];
  405. const int iw2 = i * in->linesize[2];
  406. for (j = 0; j < inlink->w; j++) {
  407. const int pos = in->data[1][iw1 + j] * out->linesize[0] + in->data[2][iw2 + j];
  408. if (out->data[0][pos] < 255)
  409. out->data[0][pos]++;
  410. }
  411. }
  412. for (i = 0; i < 256; i++) {
  413. dst = out->data[0] + i * out->linesize[0];
  414. for (j = 0; j < 256; j++) {
  415. if (!dst[j]) {
  416. out->data[1][i * out->linesize[0] + j] = i;
  417. out->data[2][i * out->linesize[0] + j] = j;
  418. }
  419. }
  420. }
  421. break;
  422. case MODE_COLOR2:
  423. for (i = 0; i < inlink->h; i++) {
  424. const int iw1 = i * in->linesize[1];
  425. const int iw2 = i * in->linesize[2];
  426. for (j = 0; j < inlink->w; j++) {
  427. const int u = in->data[1][iw1 + j];
  428. const int v = in->data[2][iw2 + j];
  429. const int pos = u * out->linesize[0] + v;
  430. if (!out->data[0][pos])
  431. out->data[0][pos] = FFABS(128 - u) + FFABS(128 - v);
  432. out->data[1][pos] = u;
  433. out->data[2][pos] = v;
  434. }
  435. }
  436. break;
  437. default:
  438. av_assert0(0);
  439. }
  440. av_frame_free(&in);
  441. return ff_filter_frame(outlink, out);
  442. }
  443. static const AVFilterPad inputs[] = {
  444. {
  445. .name = "default",
  446. .type = AVMEDIA_TYPE_VIDEO,
  447. .filter_frame = filter_frame,
  448. .config_props = config_input,
  449. },
  450. { NULL }
  451. };
  452. static const AVFilterPad outputs[] = {
  453. {
  454. .name = "default",
  455. .type = AVMEDIA_TYPE_VIDEO,
  456. .config_props = config_output,
  457. },
  458. { NULL }
  459. };
  460. AVFilter ff_vf_histogram = {
  461. .name = "histogram",
  462. .description = NULL_IF_CONFIG_SMALL("Compute and draw a histogram."),
  463. .priv_size = sizeof(HistogramContext),
  464. .query_formats = query_formats,
  465. .inputs = inputs,
  466. .outputs = outputs,
  467. .priv_class = &histogram_class,
  468. };