53 #define OFFSET(x) offsetof(ShowWavesContext, x)
54 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
121 outlink->
w = showwaves->
w;
122 outlink->
h = showwaves->
h;
161 #define MAX_INT16 ((1<<15) -1)
170 int linesize = outpicref ? outpicref->
linesize[0] : 0;
171 int16_t *p = (int16_t *)insamples->
data[0];
173 int i, j, k, h,
ret = 0;
174 const int n = showwaves->
n;
178 for (i = 0; i < nb_samples; i++) {
184 outpicref->
width = outlink->
w;
185 outpicref->
height = outlink->
h;
186 outpicref->
pts = insamples->
pts +
191 for (j = 0; j < outlink->
h; j++)
192 memset(outpicref->
data[0] + j * linesize, 0, outlink->
w);
196 switch (showwaves->
mode) {
198 if (h >= 0 && h < outlink->h)
199 *(outpicref->
data[0] + showwaves->
buf_idx + h * linesize) += x;
204 int start = showwaves->
h/2,
end = av_clip(h, 0, outlink->
h-1);
206 for (k = start; k <
end; k++)
207 *(outpicref->
data[0] + showwaves->
buf_idx + k * linesize) += x;
218 if (showwaves->
buf_idx == showwaves->
w)
253 .
inputs = showwaves_inputs,
255 .priv_class = &showwaves_class,