141 #define OFFSET(x) offsetof(SelectContext, x)
142 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM
152 const char *shorthand[] = {
"expr",
NULL };
155 select->
class =
class;
171 #define INTERLACE_TYPE_P 0
172 #define INTERLACE_TYPE_T 1
173 #define INTERLACE_TYPE_B 2
232 int x,
y, nb_sad = 0;
237 const int linesize = picref->
linesize[0];
239 for (y = 0; y < picref->
video->
h - 8; y += 8) {
240 for (x = 0; x < picref->
video->
w*3 - 8; x += 8) {
241 sad += select->c.sad[1](select, p1 + x, p2 + x,
249 mafd = nb_sad ? sad / nb_sad : 0;
250 diff = fabs(mafd - select->prev_mafd);
251 ret = av_clipf(
FFMIN(mafd, diff) / 100., 0, 1);
252 select->prev_mafd = mafd;
260 #define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
261 #define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
278 switch (inlink->
type) {
302 "n:%f pts:%f t:%f pos:%f key:%d",
309 switch (inlink->
type) {
366 }
while (!select->
select);
406 #if CONFIG_ASELECT_FILTER
408 #define aselect_options options
416 if ((ret =
init(ctx, args, &aselect_class)) < 0)
427 static const AVFilterPad avfilter_af_aselect_inputs[] = {
438 static const AVFilterPad avfilter_af_aselect_outputs[] = {
449 .init = aselect_init,
452 .
inputs = avfilter_af_aselect_inputs,
453 .
outputs = avfilter_af_aselect_outputs,
454 .priv_class = &aselect_class,
458 #if CONFIG_SELECT_FILTER
460 #define select_options options
468 if ((ret =
init(ctx, args, &select_class)) < 0)
479 static const AVFilterPad avfilter_vf_select_inputs[] = {
491 static const AVFilterPad avfilter_vf_select_outputs[] = {
509 .
inputs = avfilter_vf_select_inputs,
510 .
outputs = avfilter_vf_select_outputs,
511 .priv_class = &select_class,