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.

526 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. int ret;
  143. switch (h->mode) {
  144. case MODE_WAVEFORM:
  145. pix_fmts = waveform_pix_fmts;
  146. break;
  147. case MODE_LEVELS:
  148. {
  149. AVFilterFormats *avff;
  150. const AVPixFmtDescriptor *desc;
  151. const enum AVPixelFormat *out_pix_fmts;
  152. int rgb, i, bits;
  153. if (!ctx->inputs[0]->in_formats ||
  154. !ctx->inputs[0]->in_formats->nb_formats) {
  155. return AVERROR(EAGAIN);
  156. }
  157. if (!ctx->inputs[0]->out_formats)
  158. if ((ret = ff_formats_ref(ff_make_format_list(levels_in_pix_fmts), &ctx->inputs[0]->out_formats)) < 0)
  159. return ret;
  160. avff = ctx->inputs[0]->in_formats;
  161. desc = av_pix_fmt_desc_get(avff->formats[0]);
  162. rgb = desc->flags & AV_PIX_FMT_FLAG_RGB;
  163. bits = desc->comp[0].depth;
  164. for (i = 1; i < avff->nb_formats; i++) {
  165. desc = av_pix_fmt_desc_get(avff->formats[i]);
  166. if ((rgb != (desc->flags & AV_PIX_FMT_FLAG_RGB)) ||
  167. (bits != desc->comp[0].depth))
  168. return AVERROR(EAGAIN);
  169. }
  170. if (rgb && bits == 8)
  171. out_pix_fmts = levels_out_rgb8_pix_fmts;
  172. else if (rgb && bits == 9)
  173. out_pix_fmts = levels_out_rgb9_pix_fmts;
  174. else if (rgb && bits == 10)
  175. out_pix_fmts = levels_out_rgb10_pix_fmts;
  176. else if (bits == 8)
  177. out_pix_fmts = levels_out_yuv8_pix_fmts;
  178. else if (bits == 9)
  179. out_pix_fmts = levels_out_yuv9_pix_fmts;
  180. else // if (bits == 10)
  181. out_pix_fmts = levels_out_yuv10_pix_fmts;
  182. if ((ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats)) < 0)
  183. return ret;
  184. return 0;
  185. }
  186. break;
  187. case MODE_COLOR:
  188. case MODE_COLOR2:
  189. pix_fmts = color_pix_fmts;
  190. break;
  191. default:
  192. av_assert0(0);
  193. }
  194. fmts_list = ff_make_format_list(pix_fmts);
  195. if (!fmts_list)
  196. return AVERROR(ENOMEM);
  197. return ff_set_common_formats(ctx, fmts_list);
  198. }
  199. static const uint8_t black_yuva_color[4] = { 0, 127, 127, 255 };
  200. static const uint8_t black_gbrp_color[4] = { 0, 0, 0, 255 };
  201. static const uint8_t white_yuva_color[4] = { 255, 127, 127, 255 };
  202. static const uint8_t white_gbrp_color[4] = { 255, 255, 255, 255 };
  203. static int config_input(AVFilterLink *inlink)
  204. {
  205. HistogramContext *h = inlink->dst->priv;
  206. h->desc = av_pix_fmt_desc_get(inlink->format);
  207. h->ncomp = h->desc->nb_components;
  208. h->histogram_size = 1 << h->desc->comp[0].depth;
  209. h->mult = h->histogram_size / 256;
  210. switch (inlink->format) {
  211. case AV_PIX_FMT_GBRP10:
  212. case AV_PIX_FMT_GBRP9:
  213. case AV_PIX_FMT_GBRAP:
  214. case AV_PIX_FMT_GBRP:
  215. h->bg_color = black_gbrp_color;
  216. h->fg_color = white_gbrp_color;
  217. break;
  218. default:
  219. h->bg_color = black_yuva_color;
  220. h->fg_color = white_yuva_color;
  221. }
  222. h->planeheight[1] = h->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, h->desc->log2_chroma_h);
  223. h->planeheight[0] = h->planeheight[3] = inlink->h;
  224. h->planewidth[1] = h->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, h->desc->log2_chroma_w);
  225. h->planewidth[0] = h->planewidth[3] = inlink->w;
  226. return 0;
  227. }
  228. static int config_output(AVFilterLink *outlink)
  229. {
  230. AVFilterContext *ctx = outlink->src;
  231. HistogramContext *h = ctx->priv;
  232. int ncomp = 0, i;
  233. switch (h->mode) {
  234. case MODE_LEVELS:
  235. for (i = 0; i < h->ncomp; i++) {
  236. if ((1 << i) & h->components)
  237. ncomp++;
  238. }
  239. outlink->w = h->histogram_size;
  240. outlink->h = (h->level_height + h->scale_height) * FFMAX(ncomp * h->display_mode, 1);
  241. break;
  242. case MODE_WAVEFORM:
  243. av_log(ctx, AV_LOG_WARNING, "This mode is deprecated, please use waveform filter instead.\n");
  244. if (h->waveform_mode)
  245. outlink->h = 256 * FFMAX(h->ncomp * h->display_mode, 1);
  246. else
  247. outlink->w = 256 * FFMAX(h->ncomp * h->display_mode, 1);
  248. break;
  249. case MODE_COLOR:
  250. case MODE_COLOR2:
  251. av_log(ctx, AV_LOG_WARNING, "This mode is deprecated, use vectorscope filter instead.");
  252. outlink->h = outlink->w = 256;
  253. break;
  254. default:
  255. av_assert0(0);
  256. }
  257. h->odesc = av_pix_fmt_desc_get(outlink->format);
  258. outlink->sample_aspect_ratio = (AVRational){1,1};
  259. return 0;
  260. }
  261. static void gen_waveform(HistogramContext *h, AVFrame *inpicref, AVFrame *outpicref,
  262. int component, int intensity, int offset, int col_mode)
  263. {
  264. const int plane = h->desc->comp[component].plane;
  265. const int mirror = h->waveform_mirror;
  266. const int is_chroma = (component == 1 || component == 2);
  267. const int shift_w = (is_chroma ? h->desc->log2_chroma_w : 0);
  268. const int shift_h = (is_chroma ? h->desc->log2_chroma_h : 0);
  269. const int src_linesize = inpicref->linesize[plane];
  270. const int dst_linesize = outpicref->linesize[plane];
  271. const int dst_signed_linesize = dst_linesize * (mirror == 1 ? -1 : 1);
  272. uint8_t *src_data = inpicref->data[plane];
  273. uint8_t *dst_data = outpicref->data[plane] + (col_mode ? (offset >> shift_h) * dst_linesize : offset >> shift_w);
  274. uint8_t * const dst_bottom_line = dst_data + dst_linesize * ((256 >> shift_h) - 1);
  275. uint8_t * const dst_line = (mirror ? dst_bottom_line : dst_data);
  276. const uint8_t max = 255 - intensity;
  277. const int src_h = FF_CEIL_RSHIFT(inpicref->height, shift_h);
  278. const int src_w = FF_CEIL_RSHIFT(inpicref->width, shift_w);
  279. uint8_t *dst, *p;
  280. int y;
  281. if (!col_mode && mirror)
  282. dst_data += 256 >> shift_w;
  283. for (y = 0; y < src_h; y++) {
  284. const uint8_t *src_data_end = src_data + src_w;
  285. dst = dst_line;
  286. for (p = src_data; p < src_data_end; p++) {
  287. uint8_t *target;
  288. if (col_mode) {
  289. target = dst++ + dst_signed_linesize * (*p >> shift_h);
  290. } else {
  291. if (mirror)
  292. target = dst_data - (*p >> shift_w);
  293. else
  294. target = dst_data + (*p >> shift_w);
  295. }
  296. if (*target <= max)
  297. *target += intensity;
  298. else
  299. *target = 255;
  300. }
  301. src_data += src_linesize;
  302. dst_data += dst_linesize;
  303. }
  304. }
  305. static int filter_frame(AVFilterLink *inlink, AVFrame *in)
  306. {
  307. HistogramContext *h = inlink->dst->priv;
  308. AVFilterContext *ctx = inlink->dst;
  309. AVFilterLink *outlink = ctx->outputs[0];
  310. AVFrame *out;
  311. uint8_t *dst;
  312. int i, j, k, l, m;
  313. out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
  314. if (!out) {
  315. av_frame_free(&in);
  316. return AVERROR(ENOMEM);
  317. }
  318. out->pts = in->pts;
  319. for (k = 0; k < 4 && out->data[k]; k++) {
  320. const int is_chroma = (k == 1 || k == 2);
  321. const int dst_h = FF_CEIL_RSHIFT(outlink->h, (is_chroma ? h->odesc->log2_chroma_h : 0));
  322. const int dst_w = FF_CEIL_RSHIFT(outlink->w, (is_chroma ? h->odesc->log2_chroma_w : 0));
  323. if (h->histogram_size <= 256) {
  324. for (i = 0; i < dst_h ; i++)
  325. memset(out->data[h->odesc->comp[k].plane] +
  326. i * out->linesize[h->odesc->comp[k].plane],
  327. h->bg_color[k], dst_w);
  328. } else {
  329. const int mult = h->mult;
  330. for (i = 0; i < dst_h ; i++)
  331. for (j = 0; j < dst_w; j++)
  332. AV_WN16(out->data[h->odesc->comp[k].plane] +
  333. i * out->linesize[h->odesc->comp[k].plane] + j * 2,
  334. h->bg_color[k] * mult);
  335. }
  336. }
  337. switch (h->mode) {
  338. case MODE_LEVELS:
  339. for (m = 0, k = 0; k < h->ncomp; k++) {
  340. const int p = h->desc->comp[k].plane;
  341. const int height = h->planeheight[p];
  342. const int width = h->planewidth[p];
  343. double max_hval_log;
  344. unsigned max_hval = 0;
  345. int start;
  346. if (!((1 << k) & h->components))
  347. continue;
  348. start = m++ * (h->level_height + h->scale_height) * h->display_mode;
  349. if (h->histogram_size <= 256) {
  350. for (i = 0; i < height; i++) {
  351. const uint8_t *src = in->data[p] + i * in->linesize[p];
  352. for (j = 0; j < width; j++)
  353. h->histogram[src[j]]++;
  354. }
  355. } else {
  356. for (i = 0; i < height; i++) {
  357. const uint16_t *src = (const uint16_t *)(in->data[p] + i * in->linesize[p]);
  358. for (j = 0; j < width; j++)
  359. h->histogram[src[j]]++;
  360. }
  361. }
  362. for (i = 0; i < h->histogram_size; i++)
  363. max_hval = FFMAX(max_hval, h->histogram[i]);
  364. max_hval_log = log2(max_hval + 1);
  365. for (i = 0; i < outlink->w; i++) {
  366. int col_height;
  367. if (h->levels_mode)
  368. col_height = round(h->level_height * (1. - (log2(h->histogram[i] + 1) / max_hval_log)));
  369. else
  370. col_height = h->level_height - (h->histogram[i] * (int64_t)h->level_height + max_hval - 1) / max_hval;
  371. if (h->histogram_size <= 256) {
  372. for (j = h->level_height - 1; j >= col_height; j--) {
  373. if (h->display_mode) {
  374. for (l = 0; l < h->ncomp; l++)
  375. out->data[l][(j + start) * out->linesize[l] + i] = h->fg_color[l];
  376. } else {
  377. out->data[p][(j + start) * out->linesize[p] + i] = 255;
  378. }
  379. }
  380. for (j = h->level_height + h->scale_height - 1; j >= h->level_height; j--)
  381. out->data[p][(j + start) * out->linesize[p] + i] = i;
  382. } else {
  383. const int mult = h->mult;
  384. for (j = h->level_height - 1; j >= col_height; j--) {
  385. if (h->display_mode) {
  386. for (l = 0; l < h->ncomp; l++)
  387. AV_WN16(out->data[l] + (j + start) * out->linesize[l] + i * 2, h->fg_color[l] * mult);
  388. } else {
  389. AV_WN16(out->data[p] + (j + start) * out->linesize[p] + i * 2, 255 * mult);
  390. }
  391. }
  392. for (j = h->level_height + h->scale_height - 1; j >= h->level_height; j--)
  393. AV_WN16(out->data[p] + (j + start) * out->linesize[p] + i * 2, i);
  394. }
  395. }
  396. memset(h->histogram, 0, h->histogram_size * sizeof(unsigned));
  397. }
  398. break;
  399. case MODE_WAVEFORM:
  400. for (k = 0; k < h->ncomp; k++) {
  401. const int offset = k * 256 * h->display_mode;
  402. gen_waveform(h, in, out, k, h->step, offset, h->waveform_mode);
  403. }
  404. break;
  405. case MODE_COLOR:
  406. for (i = 0; i < inlink->h; i++) {
  407. const int iw1 = i * in->linesize[1];
  408. const int iw2 = i * in->linesize[2];
  409. for (j = 0; j < inlink->w; j++) {
  410. const int pos = in->data[1][iw1 + j] * out->linesize[0] + in->data[2][iw2 + j];
  411. if (out->data[0][pos] < 255)
  412. out->data[0][pos]++;
  413. }
  414. }
  415. for (i = 0; i < 256; i++) {
  416. dst = out->data[0] + i * out->linesize[0];
  417. for (j = 0; j < 256; j++) {
  418. if (!dst[j]) {
  419. out->data[1][i * out->linesize[0] + j] = i;
  420. out->data[2][i * out->linesize[0] + j] = j;
  421. }
  422. }
  423. }
  424. break;
  425. case MODE_COLOR2:
  426. for (i = 0; i < inlink->h; i++) {
  427. const int iw1 = i * in->linesize[1];
  428. const int iw2 = i * in->linesize[2];
  429. for (j = 0; j < inlink->w; j++) {
  430. const int u = in->data[1][iw1 + j];
  431. const int v = in->data[2][iw2 + j];
  432. const int pos = u * out->linesize[0] + v;
  433. if (!out->data[0][pos])
  434. out->data[0][pos] = FFABS(128 - u) + FFABS(128 - v);
  435. out->data[1][pos] = u;
  436. out->data[2][pos] = v;
  437. }
  438. }
  439. break;
  440. default:
  441. av_assert0(0);
  442. }
  443. av_frame_free(&in);
  444. return ff_filter_frame(outlink, out);
  445. }
  446. static const AVFilterPad inputs[] = {
  447. {
  448. .name = "default",
  449. .type = AVMEDIA_TYPE_VIDEO,
  450. .filter_frame = filter_frame,
  451. .config_props = config_input,
  452. },
  453. { NULL }
  454. };
  455. static const AVFilterPad outputs[] = {
  456. {
  457. .name = "default",
  458. .type = AVMEDIA_TYPE_VIDEO,
  459. .config_props = config_output,
  460. },
  461. { NULL }
  462. };
  463. AVFilter ff_vf_histogram = {
  464. .name = "histogram",
  465. .description = NULL_IF_CONFIG_SMALL("Compute and draw a histogram."),
  466. .priv_size = sizeof(HistogramContext),
  467. .query_formats = query_formats,
  468. .inputs = inputs,
  469. .outputs = outputs,
  470. .priv_class = &histogram_class,
  471. };