[FFmpeg-devel] [PATCH] lavfi/volume: add dynamic expression evaluation

Nicolas George nicolas.george at normalesup.org
Tue Mar 5 23:21:41 CET 2013

Le quintidi 15 ventôse, an CCXXI, Stefano Sabatini a écrit :
> And here there is a problem. In case I have something like this:
> foo(100);
> assuming the function is constant (and there is no way to know in case
> it is an user function), then the evaluation is obviously constant.
> OTOH if we have:
> foo(W+X)
> we don't know which parameters we assume are going to change (which
> really depends on the implementation, if the parameters are reset
> after one evaluation and the next one).

IMHO, the code that calls av_expr_is_const() is responsible for providing
the information: for each user variable, is it considered constant or not;
for each user function, is it pure or not.

OTOH, I agree with Clément that av_expr_is_const() returning false even
when the expression is actually constant in certain cases is acceptable.

(In fact I believe that determining if an expression is constant or not is
undecidable. So the return value of av_expr_is_const() is actually whether
the expression is obviously constant, and the only question is how much
effort to put in this "obviously".)


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130305/1c3225eb/attachment.asc>

More information about the ffmpeg-devel mailing list