64 #define OFFSET(x) offsetof(ShowSpectrumContext, x)
65 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
99 { 0.13, .03587126228984074, .1573300977624594, -.02548747583751842 },
100 { 0.30, .18572281794568020, .1772436246393981, .17475554840414750 },
101 { 0.60, .28184980583656130, -.1593064119945782, .47132074554608920 },
102 { 0.73, .65830621175547810, -.3716070802232764, .24352759331252930 },
103 { 0.78, .76318535758242900, -.4307467689263783, .16866496622310430 },
104 { 0.91, .95336363636363640, -.2045454545454546, .03313636363636363 },
161 int i, rdft_bits, win_size, h;
170 for (rdft_bits = 1; 1 << rdft_bits < 2 * h; rdft_bits++);
171 win_size = 1 << rdft_bits;
175 size_t rdft_size, rdft_listsize;
182 "The window size might be too high.\n");
199 win_size, &rdft_size) < 0)
218 for (i = 0; i < win_size; i++)
222 for (i = 0; i < win_size; i++)
226 for (i = 0; i < win_size; i++)
230 for (i = 0; i < win_size; i++)
245 for (i = 0; i < outlink->
h; i++) {
246 memset(outpicref->
data[0] + i * outpicref->
linesize[0], 0, outlink->
w);
247 memset(outpicref->
data[1] + i * outpicref->
linesize[1], 128, outlink->
w);
248 memset(outpicref->
data[2] + i * outpicref->
linesize[2], 128, outlink->
w);
252 if (s->
xpos >= outlink->
w)
267 s->
w, s->
h, win_size);
283 for (i = 0; i < outlink->
h; i++) {
307 const int nb_freq = 1 << (s->
rdft_bits - 1);
308 const int win_size = nb_freq << 1;
309 const double w = 1. / (sqrt(nb_freq) * 32768.);
320 for (n = 0; n < win_size; n++)
331 #define RE(y, ch) s->rdft_data[ch][2 * (y) + 0]
332 #define IM(y, ch) s->rdft_data[ch][2 * (y) + 1]
333 #define MAGNITUDE(y, ch) hypot(RE(y, ch), IM(y, ch))
336 for (y = 0; y < outlink->
h; y++) {
388 for (y = 0; y < h; y++) {
406 a = 1 - log(
FFMAX(
FFMIN(1, a), 1e-6)) / log(1e-6);
432 float lerpfrac = (a -
start) / (end - start);
454 for (plane = 0; plane < 3; plane++) {
455 for (y = 0; y < outlink->
h; y++) {
458 memmove(p, p + 1, outlink->
w - 1);
461 s->
xpos = outlink->
w - 1;
463 for (plane = 0; plane < 3; plane++) {
465 (outlink->
h - 1) * outpicref->
linesize[plane] +
467 for (y = 0; y < outlink->
h; y++) {
474 outpicref->
pts = insamples->
pts;
477 if (s->
xpos >= outlink->
w)
524 .
name =
"showspectrum",
529 .
inputs = showspectrum_inputs,
530 .
outputs = showspectrum_outputs,
531 .priv_class = &showspectrum_class,