56 int16_t
sample, int16_t *prev_y,
int intensity);
59 #define OFFSET(x) offsetof(ShowWavesContext, x)
60 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
136 outlink->
w = showwaves->
w;
137 outlink->
h = showwaves->
h;
182 int16_t
sample, int16_t *prev_y,
int intensity)
184 const int h = height/2 -
av_rescale(sample, height/2, INT16_MAX);
185 if (h >= 0 && h < height)
186 buf[h * linesize] += intensity;
190 int16_t
sample, int16_t *prev_y,
int intensity)
193 const int h = height/2 -
av_rescale(sample, height/2, INT16_MAX);
194 int start = height/2;
195 int end = av_clip(h, 0, height-1);
197 FFSWAP(int16_t, start, end);
198 for (k = start; k <
end; k++)
199 buf[k * linesize] += intensity;
203 int16_t
sample, int16_t *prev_y,
int intensity)
206 const int h = height/2 -
av_rescale(sample, height/2, INT16_MAX);
207 if (h >= 0 && h < height) {
208 buf[h * linesize] += intensity;
209 if (*prev_y && h != *prev_y) {
211 int end = av_clip(h, 0, height-1);
213 FFSWAP(int16_t, start, end);
214 for (k = start + 1; k <
end; k++)
215 buf[k * linesize] += intensity;
222 int16_t
sample, int16_t *prev_y,
int intensity)
225 const int h =
av_rescale(abs(sample), height, INT16_MAX);
226 const int start = (height - h) / 2;
227 const int end = start + h;
228 for (k = start; k <
end; k++)
229 buf[k * linesize] += intensity;
239 int linesize = outpicref ? outpicref->
linesize[0] : 0;
240 int16_t *p = (int16_t *)insamples->
data[0];
243 const int n = showwaves->
n;
248 for (i = 0; i < nb_samples; i++) {
254 outpicref->
width = outlink->
w;
255 outpicref->
height = outlink->
h;
256 outpicref->
pts = insamples->
pts +
261 for (j = 0; j < outlink->
h; j++)
262 memset(outpicref->
data[0] + j * linesize, 0, outlink->
w);
267 buf += j*ch_height*linesize;
268 showwaves->
draw_sample(buf, ch_height, linesize, *p++,
277 if (showwaves->
buf_idx == showwaves->
w)
291 switch (showwaves->
mode) {
328 .
inputs = showwaves_inputs,
330 .priv_class = &showwaves_class,