]> git.sesse.net Git - ffmpeg/blob - libavfilter/avf_showfreqs.c
avcodec: Remove libstagefright
[ffmpeg] / libavfilter / avf_showfreqs.c
1 /*
2  * Copyright (c) 2015 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 <math.h>
22
23 #include "libavcodec/avfft.h"
24 #include "libavutil/audio_fifo.h"
25 #include "libavutil/avassert.h"
26 #include "libavutil/avstring.h"
27 #include "libavutil/channel_layout.h"
28 #include "libavutil/intreadwrite.h"
29 #include "libavutil/opt.h"
30 #include "libavutil/parseutils.h"
31 #include "audio.h"
32 #include "video.h"
33 #include "avfilter.h"
34 #include "internal.h"
35 #include "window_func.h"
36
37 enum DisplayMode    { LINE, BAR, DOT, NB_MODES };
38 enum ChannelMode    { COMBINED, SEPARATE, NB_CMODES };
39 enum FrequencyScale { FS_LINEAR, FS_LOG, FS_RLOG, NB_FSCALES };
40 enum AmplitudeScale { AS_LINEAR, AS_SQRT, AS_CBRT, AS_LOG, NB_ASCALES };
41
42 typedef struct ShowFreqsContext {
43     const AVClass *class;
44     int w, h;
45     int mode;
46     int cmode;
47     int fft_bits;
48     int ascale, fscale;
49     int avg;
50     int win_func;
51     FFTContext *fft;
52     FFTComplex **fft_data;
53     float **avg_data;
54     float *window_func_lut;
55     float overlap;
56     int skip_samples;
57     int nb_channels;
58     int nb_freq;
59     int win_size;
60     float scale;
61     char *colors;
62     AVAudioFifo *fifo;
63     int64_t pts;
64 } ShowFreqsContext;
65
66 #define OFFSET(x) offsetof(ShowFreqsContext, x)
67 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
68
69 static const AVOption showfreqs_options[] = {
70     { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "1024x512"}, 0, 0, FLAGS },
71     { "s",    "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "1024x512"}, 0, 0, FLAGS },
72     { "mode", "set display mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=BAR}, 0, NB_MODES-1, FLAGS, "mode" },
73         { "line", "show lines",  0, AV_OPT_TYPE_CONST, {.i64=LINE},   0, 0, FLAGS, "mode" },
74         { "bar",  "show bars",   0, AV_OPT_TYPE_CONST, {.i64=BAR},    0, 0, FLAGS, "mode" },
75         { "dot",  "show dots",   0, AV_OPT_TYPE_CONST, {.i64=DOT},    0, 0, FLAGS, "mode" },
76     { "ascale", "set amplitude scale", OFFSET(ascale), AV_OPT_TYPE_INT, {.i64=AS_LOG}, 0, NB_ASCALES-1, FLAGS, "ascale" },
77         { "lin",  "linear",      0, AV_OPT_TYPE_CONST, {.i64=AS_LINEAR}, 0, 0, FLAGS, "ascale" },
78         { "sqrt", "square root", 0, AV_OPT_TYPE_CONST, {.i64=AS_SQRT},   0, 0, FLAGS, "ascale" },
79         { "cbrt", "cubic root",  0, AV_OPT_TYPE_CONST, {.i64=AS_CBRT},   0, 0, FLAGS, "ascale" },
80         { "log",  "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=AS_LOG},    0, 0, FLAGS, "ascale" },
81     { "fscale", "set frequency scale", OFFSET(fscale), AV_OPT_TYPE_INT, {.i64=FS_LINEAR}, 0, NB_FSCALES-1, FLAGS, "fscale" },
82         { "lin",  "linear",              0, AV_OPT_TYPE_CONST, {.i64=FS_LINEAR}, 0, 0, FLAGS, "fscale" },
83         { "log",  "logarithmic",         0, AV_OPT_TYPE_CONST, {.i64=FS_LOG},    0, 0, FLAGS, "fscale" },
84         { "rlog", "reverse logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=FS_RLOG},   0, 0, FLAGS, "fscale" },
85     { "win_size", "set window size", OFFSET(fft_bits), AV_OPT_TYPE_INT, {.i64=11}, 4, 16, FLAGS, "fft" },
86         { "w16",    0, 0, AV_OPT_TYPE_CONST, {.i64=4},  0, 0, FLAGS, "fft" },
87         { "w32",    0, 0, AV_OPT_TYPE_CONST, {.i64=5},  0, 0, FLAGS, "fft" },
88         { "w64",    0, 0, AV_OPT_TYPE_CONST, {.i64=6},  0, 0, FLAGS, "fft" },
89         { "w128",   0, 0, AV_OPT_TYPE_CONST, {.i64=7},  0, 0, FLAGS, "fft" },
90         { "w256",   0, 0, AV_OPT_TYPE_CONST, {.i64=8},  0, 0, FLAGS, "fft" },
91         { "w512",   0, 0, AV_OPT_TYPE_CONST, {.i64=9},  0, 0, FLAGS, "fft" },
92         { "w1024",  0, 0, AV_OPT_TYPE_CONST, {.i64=10}, 0, 0, FLAGS, "fft" },
93         { "w2048",  0, 0, AV_OPT_TYPE_CONST, {.i64=11}, 0, 0, FLAGS, "fft" },
94         { "w4096",  0, 0, AV_OPT_TYPE_CONST, {.i64=12}, 0, 0, FLAGS, "fft" },
95         { "w8192",  0, 0, AV_OPT_TYPE_CONST, {.i64=13}, 0, 0, FLAGS, "fft" },
96         { "w16384", 0, 0, AV_OPT_TYPE_CONST, {.i64=14}, 0, 0, FLAGS, "fft" },
97         { "w32768", 0, 0, AV_OPT_TYPE_CONST, {.i64=15}, 0, 0, FLAGS, "fft" },
98         { "w65536", 0, 0, AV_OPT_TYPE_CONST, {.i64=16}, 0, 0, FLAGS, "fft" },
99     { "win_func", "set window function", OFFSET(win_func), AV_OPT_TYPE_INT, {.i64=WFUNC_HANNING}, 0, NB_WFUNC-1, FLAGS, "win_func" },
100         { "rect",     "Rectangular",      0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT},     0, 0, FLAGS, "win_func" },
101         { "bartlett", "Bartlett",         0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BARTLETT}, 0, 0, FLAGS, "win_func" },
102         { "hanning",  "Hanning",          0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HANNING},  0, 0, FLAGS, "win_func" },
103         { "hamming",  "Hamming",          0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HAMMING},  0, 0, FLAGS, "win_func" },
104         { "blackman", "Blackman",         0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BLACKMAN}, 0, 0, FLAGS, "win_func" },
105         { "welch",    "Welch",            0, AV_OPT_TYPE_CONST, {.i64=WFUNC_WELCH},    0, 0, FLAGS, "win_func" },
106         { "flattop",  "Flat-top",         0, AV_OPT_TYPE_CONST, {.i64=WFUNC_FLATTOP},  0, 0, FLAGS, "win_func" },
107         { "bharris",  "Blackman-Harris",  0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHARRIS},  0, 0, FLAGS, "win_func" },
108         { "bnuttall", "Blackman-Nuttall", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BNUTTALL}, 0, 0, FLAGS, "win_func" },
109         { "bhann",    "Bartlett-Hann",    0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHANN},    0, 0, FLAGS, "win_func" },
110         { "sine",     "Sine",             0, AV_OPT_TYPE_CONST, {.i64=WFUNC_SINE},     0, 0, FLAGS, "win_func" },
111         { "nuttall",  "Nuttall",          0, AV_OPT_TYPE_CONST, {.i64=WFUNC_NUTTALL},  0, 0, FLAGS, "win_func" },
112         { "lanczos",  "Lanczos",          0, AV_OPT_TYPE_CONST, {.i64=WFUNC_LANCZOS},  0, 0, FLAGS, "win_func" },
113         { "gauss",    "Gauss",            0, AV_OPT_TYPE_CONST, {.i64=WFUNC_GAUSS},    0, 0, FLAGS, "win_func" },
114         { "tukey",    "Tukey",            0, AV_OPT_TYPE_CONST, {.i64=WFUNC_TUKEY},    0, 0, FLAGS, "win_func" },
115     { "overlap",  "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=1.}, 0., 1., FLAGS },
116     { "averaging", "set time averaging", OFFSET(avg), AV_OPT_TYPE_INT, {.i64=1}, 0, INT32_MAX, FLAGS },
117     { "colors", "set channels colors", OFFSET(colors), AV_OPT_TYPE_STRING, {.str = "red|green|blue|yellow|orange|lime|pink|magenta|brown" }, 0, 0, FLAGS },
118     { "cmode", "set channel mode", OFFSET(cmode), AV_OPT_TYPE_INT, {.i64=COMBINED}, 0, NB_CMODES-1, FLAGS, "cmode" },
119         { "combined", "show all channels in same window",  0, AV_OPT_TYPE_CONST, {.i64=COMBINED}, 0, 0, FLAGS, "cmode" },
120         { "separate", "show each channel in own window",   0, AV_OPT_TYPE_CONST, {.i64=SEPARATE}, 0, 0, FLAGS, "cmode" },
121     { NULL }
122 };
123
124 AVFILTER_DEFINE_CLASS(showfreqs);
125
126 static int query_formats(AVFilterContext *ctx)
127 {
128     AVFilterFormats *formats = NULL;
129     AVFilterChannelLayouts *layouts = NULL;
130     AVFilterLink *inlink = ctx->inputs[0];
131     AVFilterLink *outlink = ctx->outputs[0];
132     static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE };
133     static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE };
134     int ret;
135
136     /* set input audio formats */
137     formats = ff_make_format_list(sample_fmts);
138     if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0)
139         return ret;
140
141     layouts = ff_all_channel_layouts();
142     if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0)
143         return ret;
144
145     formats = ff_all_samplerates();
146     if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0)
147         return ret;
148
149     /* set output video format */
150     formats = ff_make_format_list(pix_fmts);
151     if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0)
152         return ret;
153
154     return 0;
155 }
156
157 static int config_output(AVFilterLink *outlink)
158 {
159     AVFilterContext *ctx = outlink->src;
160     AVFilterLink *inlink = ctx->inputs[0];
161     ShowFreqsContext *s = ctx->priv;
162     float overlap;
163     int i;
164
165     s->nb_freq = 1 << (s->fft_bits - 1);
166     s->win_size = s->nb_freq << 1;
167     av_audio_fifo_free(s->fifo);
168     av_fft_end(s->fft);
169     s->fft = av_fft_init(s->fft_bits, 0);
170     if (!s->fft) {
171         av_log(ctx, AV_LOG_ERROR, "Unable to create FFT context. "
172                "The window size might be too high.\n");
173         return AVERROR(ENOMEM);
174     }
175
176     /* FFT buffers: x2 for each (display) channel buffer.
177      * Note: we use free and malloc instead of a realloc-like function to
178      * make sure the buffer is aligned in memory for the FFT functions. */
179     for (i = 0; i < s->nb_channels; i++) {
180         av_freep(&s->fft_data[i]);
181         av_freep(&s->avg_data[i]);
182     }
183     av_freep(&s->fft_data);
184     av_freep(&s->avg_data);
185     s->nb_channels = inlink->channels;
186
187     s->fft_data = av_calloc(s->nb_channels, sizeof(*s->fft_data));
188     if (!s->fft_data)
189         return AVERROR(ENOMEM);
190     s->avg_data = av_calloc(s->nb_channels, sizeof(*s->avg_data));
191     if (!s->fft_data)
192         return AVERROR(ENOMEM);
193     for (i = 0; i < s->nb_channels; i++) {
194         s->fft_data[i] = av_calloc(s->win_size, sizeof(**s->fft_data));
195         s->avg_data[i] = av_calloc(s->nb_freq, sizeof(**s->avg_data));
196         if (!s->fft_data[i] || !s->avg_data[i])
197             return AVERROR(ENOMEM);
198     }
199
200     /* pre-calc windowing function */
201     s->window_func_lut = av_realloc_f(s->window_func_lut, s->win_size,
202                                       sizeof(*s->window_func_lut));
203     if (!s->window_func_lut)
204         return AVERROR(ENOMEM);
205     ff_generate_window_func(s->window_func_lut, s->win_size, s->win_func, &overlap);
206     if (s->overlap == 1.)
207         s->overlap = overlap;
208     s->skip_samples = (1. - s->overlap) * s->win_size;
209     if (s->skip_samples < 1) {
210         av_log(ctx, AV_LOG_ERROR, "overlap %f too big\n", s->overlap);
211         return AVERROR(EINVAL);
212     }
213
214     for (s->scale = 0, i = 0; i < s->win_size; i++) {
215         s->scale += s->window_func_lut[i] * s->window_func_lut[i];
216     }
217
218     outlink->frame_rate = av_make_q(inlink->sample_rate, s->win_size * (1.-s->overlap));
219     outlink->sample_aspect_ratio = (AVRational){1,1};
220     outlink->w = s->w;
221     outlink->h = s->h;
222
223     s->fifo = av_audio_fifo_alloc(inlink->format, inlink->channels, s->win_size);
224     if (!s->fifo)
225         return AVERROR(ENOMEM);
226     return 0;
227 }
228
229 static inline void draw_dot(AVFrame *out, int x, int y, uint8_t fg[4])
230 {
231
232     uint32_t color = AV_RL32(out->data[0] + y * out->linesize[0] + x * 4);
233
234     if ((color & 0xffffff) != 0)
235         AV_WL32(out->data[0] + y * out->linesize[0] + x * 4, AV_RL32(fg) | color);
236     else
237         AV_WL32(out->data[0] + y * out->linesize[0] + x * 4, AV_RL32(fg));
238 }
239
240 static int get_sx(ShowFreqsContext *s, int f)
241 {
242     switch (s->fscale) {
243     case FS_LINEAR:
244         return (s->w/(float)s->nb_freq)*f;
245     case FS_LOG:
246         return s->w-pow(s->w, (s->nb_freq-f-1)/(s->nb_freq-1.));
247     case FS_RLOG:
248         return pow(s->w, f/(s->nb_freq-1.));
249     }
250
251     return 0;
252 }
253
254 static float get_bsize(ShowFreqsContext *s, int f)
255 {
256     switch (s->fscale) {
257     case FS_LINEAR:
258         return s->w/(float)s->nb_freq;
259     case FS_LOG:
260         return pow(s->w, (s->nb_freq-f-1)/(s->nb_freq-1.))-
261                pow(s->w, (s->nb_freq-f-2)/(s->nb_freq-1.));
262     case FS_RLOG:
263         return pow(s->w, (f+1)/(s->nb_freq-1.))-
264                pow(s->w,  f   /(s->nb_freq-1.));
265     }
266
267     return 1.;
268 }
269
270 static inline void plot_freq(ShowFreqsContext *s, int ch,
271                              double a, int f, uint8_t fg[4], int *prev_y,
272                              AVFrame *out, AVFilterLink *outlink)
273 {
274     const int w = s->w;
275     const float avg = s->avg_data[ch][f];
276     const float bsize = get_bsize(s, f);
277     const int sx = get_sx(s, f);
278     int end = outlink->h;
279     int x, y, i;
280
281     switch(s->ascale) {
282     case AS_SQRT:
283         a = 1.0 - sqrt(a);
284         break;
285     case AS_CBRT:
286         a = 1.0 - cbrt(a);
287         break;
288     case AS_LOG:
289         a = log(av_clipd(a, 1e-6, 1)) / log(1e-6);
290         break;
291     case AS_LINEAR:
292         a = 1.0 - a;
293         break;
294     }
295
296     switch (s->cmode) {
297     case COMBINED:
298         y = a * outlink->h - 1;
299         break;
300     case SEPARATE:
301         end = (outlink->h / s->nb_channels) * (ch + 1);
302         y = (outlink->h / s->nb_channels) * ch + a * (outlink->h / s->nb_channels) - 1;
303         break;
304     }
305     if (y < 0)
306         return;
307
308     switch (s->avg) {
309     case 0:
310         y = s->avg_data[ch][f] = !outlink->frame_count ? y : FFMIN(avg, y);
311         break;
312     case 1:
313         break;
314     default:
315         s->avg_data[ch][f] = avg + y * (y - avg) / (FFMIN(outlink->frame_count + 1, s->avg) * y);
316         y = s->avg_data[ch][f];
317         break;
318     }
319
320     switch(s->mode) {
321     case LINE:
322         if (*prev_y == -1) {
323             *prev_y = y;
324         }
325         if (y <= *prev_y) {
326             for (x = sx + 1; x < sx + bsize && x < w; x++)
327                 draw_dot(out, x, y, fg);
328             for (i = y; i <= *prev_y; i++)
329                 draw_dot(out, sx, i, fg);
330         } else {
331             for (i = *prev_y; i <= y; i++)
332                 draw_dot(out, sx, i, fg);
333             for (x = sx + 1; x < sx + bsize && x < w; x++)
334                 draw_dot(out, x, i - 1, fg);
335         }
336         *prev_y = y;
337         break;
338     case BAR:
339         for (x = sx; x < sx + bsize && x < w; x++)
340             for (i = y; i < end; i++)
341                 draw_dot(out, x, i, fg);
342         break;
343     case DOT:
344         for (x = sx; x < sx + bsize && x < w; x++)
345             draw_dot(out, x, y, fg);
346         break;
347     }
348 }
349
350 static int plot_freqs(AVFilterLink *inlink, AVFrame *in)
351 {
352     AVFilterContext *ctx = inlink->dst;
353     AVFilterLink *outlink = ctx->outputs[0];
354     ShowFreqsContext *s = ctx->priv;
355     const int win_size = s->win_size;
356     char *colors, *color, *saveptr = NULL;
357     AVFrame *out;
358     int ch, n;
359
360     out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
361     if (!out)
362         return AVERROR(ENOMEM);
363
364     for (n = 0; n < outlink->h; n++)
365         memset(out->data[0] + out->linesize[0] * n, 0, outlink->w * 4);
366
367     /* fill FFT input with the number of samples available */
368     for (ch = 0; ch < s->nb_channels; ch++) {
369         const float *p = (float *)in->extended_data[ch];
370
371         for (n = 0; n < in->nb_samples; n++) {
372             s->fft_data[ch][n].re = p[n] * s->window_func_lut[n];
373             s->fft_data[ch][n].im = 0;
374         }
375         for (; n < win_size; n++) {
376             s->fft_data[ch][n].re = 0;
377             s->fft_data[ch][n].im = 0;
378         }
379     }
380
381     /* run FFT on each samples set */
382     for (ch = 0; ch < s->nb_channels; ch++) {
383         av_fft_permute(s->fft, s->fft_data[ch]);
384         av_fft_calc(s->fft, s->fft_data[ch]);
385     }
386
387 #define RE(x, ch) s->fft_data[ch][x].re
388 #define IM(x, ch) s->fft_data[ch][x].im
389 #define M(a, b) (sqrt((a) * (a) + (b) * (b)))
390
391     colors = av_strdup(s->colors);
392     if (!colors) {
393         av_frame_free(&out);
394         return AVERROR(ENOMEM);
395     }
396
397     for (ch = 0; ch < s->nb_channels; ch++) {
398         uint8_t fg[4] = { 0xff, 0xff, 0xff, 0xff };
399         int prev_y = -1, f;
400         double a;
401
402         color = av_strtok(ch == 0 ? colors : NULL, " |", &saveptr);
403         if (color)
404             av_parse_color(fg, color, -1, ctx);
405
406         a = av_clipd(M(RE(0, ch), 0) / s->scale, 0, 1);
407         plot_freq(s, ch, a, 0, fg, &prev_y, out, outlink);
408
409         for (f = 1; f < s->nb_freq; f++) {
410             a = av_clipd(M(RE(f, ch), IM(f, ch)) / s->scale, 0, 1);
411
412             plot_freq(s, ch, a, f, fg, &prev_y, out, outlink);
413         }
414     }
415
416     av_free(colors);
417     out->pts = in->pts;
418     return ff_filter_frame(outlink, out);
419 }
420
421 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
422 {
423     AVFilterContext *ctx = inlink->dst;
424     ShowFreqsContext *s = ctx->priv;
425     AVFrame *fin = NULL;
426     int ret = 0;
427
428     av_audio_fifo_write(s->fifo, (void **)in->extended_data, in->nb_samples);
429     while (av_audio_fifo_size(s->fifo) >= s->win_size) {
430         fin = ff_get_audio_buffer(inlink, s->win_size);
431         if (!fin) {
432             ret = AVERROR(ENOMEM);
433             goto fail;
434         }
435
436         fin->pts = s->pts;
437         s->pts += s->skip_samples;
438         ret = av_audio_fifo_peek(s->fifo, (void **)fin->extended_data, s->win_size);
439         if (ret < 0)
440             goto fail;
441
442         ret = plot_freqs(inlink, fin);
443         av_frame_free(&fin);
444         av_audio_fifo_drain(s->fifo, s->skip_samples);
445         if (ret < 0)
446             goto fail;
447     }
448
449 fail:
450     av_frame_free(&fin);
451     av_frame_free(&in);
452     return ret;
453 }
454
455 static av_cold void uninit(AVFilterContext *ctx)
456 {
457     ShowFreqsContext *s = ctx->priv;
458     int i;
459
460     av_fft_end(s->fft);
461     for (i = 0; i < s->nb_channels; i++) {
462         av_freep(&s->fft_data[i]);
463         av_freep(&s->avg_data[i]);
464     }
465     av_freep(&s->fft_data);
466     av_freep(&s->avg_data);
467     av_freep(&s->window_func_lut);
468     av_audio_fifo_free(s->fifo);
469 }
470
471 static const AVFilterPad showfreqs_inputs[] = {
472     {
473         .name         = "default",
474         .type         = AVMEDIA_TYPE_AUDIO,
475         .filter_frame = filter_frame,
476     },
477     { NULL }
478 };
479
480 static const AVFilterPad showfreqs_outputs[] = {
481     {
482         .name          = "default",
483         .type          = AVMEDIA_TYPE_VIDEO,
484         .config_props  = config_output,
485     },
486     { NULL }
487 };
488
489 AVFilter ff_avf_showfreqs = {
490     .name          = "showfreqs",
491     .description   = NULL_IF_CONFIG_SMALL("Convert input audio to a frequencies video output."),
492     .uninit        = uninit,
493     .query_formats = query_formats,
494     .priv_size     = sizeof(ShowFreqsContext),
495     .inputs        = showfreqs_inputs,
496     .outputs       = showfreqs_outputs,
497     .priv_class    = &showfreqs_class,
498 };