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
231 int x, y, nb_sad = 0;
236 const int linesize = picref->
linesize[0];
238 for (y = 0; y < picref->
video->
h - 8; y += 8) {
239 for (x = 0; x < picref->
video->
w*3 - 8; x += 8) {
240 sad += select->c.sad[1](select, p1 + x, p2 + x,
248 mafd = nb_sad ? sad / nb_sad : 0;
249 diff = fabs(mafd - select->prev_mafd);
250 ret = av_clipf(
FFMIN(mafd, diff) / 100., 0, 1);
251 select->prev_mafd = mafd;
259 #define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
260 #define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
278 switch (inlink->
type) {
302 "n:%d pts:%d t:%f pos:%d key:%d",
309 switch (inlink->
type) {
364 }
while (!select->
select);
404 #if CONFIG_ASELECT_FILTER
406 #define aselect_options options
414 if ((ret =
init(ctx, args, &aselect_class)) < 0)
425 static const AVFilterPad avfilter_af_aselect_inputs[] = {
436 static const AVFilterPad avfilter_af_aselect_outputs[] = {
447 .init = aselect_init,
450 .
inputs = avfilter_af_aselect_inputs,
451 .
outputs = avfilter_af_aselect_outputs,
452 .priv_class = &aselect_class,
456 #if CONFIG_SELECT_FILTER
458 #define select_options options
466 if ((ret =
init(ctx, args, &select_class)) < 0)
477 static const AVFilterPad avfilter_vf_select_inputs[] = {
489 static const AVFilterPad avfilter_vf_select_outputs[] = {
507 .
inputs = avfilter_vf_select_inputs,
508 .
outputs = avfilter_vf_select_outputs,
509 .priv_class = &select_class,