54 #define OFFSET(x) offsetof(ShowWavesContext, x)
55 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
77 showwaves->
class = &showwaves_class;
136 if (showwaves->
n && showwaves->
rate_str) {
151 outlink->
w = showwaves->
w;
152 outlink->
h = showwaves->
h;
191 #define MAX_INT16 ((1<<15) -1)
200 int linesize = outpicref ? outpicref->
linesize[0] : 0;
201 int16_t *p = (int16_t *)insamples->
data[0];
203 int i, j, k, h, ret = 0;
204 const int n = showwaves->
n;
212 outlink->
w, outlink->
h);
215 outpicref->
video->
w = outlink->
w;
216 outpicref->
video->
h = outlink->
h;
217 outpicref->
pts = insamples->
pts +
222 memset(outpicref->
data[0], 0, showwaves->
h*linesize);
226 switch (showwaves->
mode) {
228 if (h >= 0 && h < outlink->h)
229 *(outpicref->
data[0] + showwaves->
buf_idx + h * linesize) += x;
234 int start = showwaves->
h/2,
end = av_clip(h, 0, outlink->
h-1);
236 for (k = start; k <
end; k++)
237 *(outpicref->
data[0] + showwaves->
buf_idx + k * linesize) += x;
248 if (showwaves->
buf_idx == showwaves->
w)
285 .
inputs = showwaves_inputs,
287 .priv_class = &showwaves_class,