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