]> git.sesse.net Git - ffmpeg/commit
avutil/eval: add function to track variable use
authorGyan Doshi <ffmpeg@gyani.pro>
Sun, 17 Nov 2019 05:32:10 +0000 (11:02 +0530)
committerGyan Doshi <ffmpeg@gyani.pro>
Sun, 17 Nov 2019 05:37:05 +0000 (11:07 +0530)
commit1c23abc88fef0a0c8486bf0ec3594f8e2d26d83f
treedf57ffda1f5b410dc8bdac004d3340e2814858a8
parent487e7e9670032465e1850d54fd58c5248aa50be9
avutil/eval: add function to track variable use

1)Some filters allow cross-referenced expressions e.g. x=y+10. In
such cases, filters evaluate expressions multiple times for
successful evaluation of all expressions. If the expression for one or
more variables contains a RNG, the result may vary across evaluation
leading to inconsistent values across the cross-referenced expressions.

2)A related case is circular expressions e.g. x=y+10 and y=x+10 which
cannot be succesfully resolved.

3)Certain filter variables may only be applicable in specific eval modes
and lead to a failure of evaluation in other modes e.g. pts is only
relevant for frame eval mode.

At present, there is no reliable means to identify these occurrences and
thus the error messages provided are broad or inaccurate. The helper
function introduced - av_expr_count_vars - allows developers to identify
the use and count of variables in expressions and thus tailor the error
message, allow for a graceful fallback and/or decide evaluation order.
libavutil/eval.c
libavutil/eval.h
libavutil/version.h