[FFmpeg-devel] [WIP] av_expr_is_const()

Michael Niedermayer michaelni at gmx.at
Thu Mar 7 03:35:12 CET 2013

On Thu, Mar 07, 2013 at 02:33:58AM +0100, Stefano Sabatini wrote:
> INCOMPLETE work in progress requested by ubitux, since I can't work on
> it before the weekend.
> The idea is that I'm marking all the constant functions as constants
> (note: st() is constant but not pure), then av_expr_is_const() should
> apply the principle that an expression is constants if all its terms
> are constant terms, internal constant variables (PI, PHI, E), or
> constant functions with constant arguments.
> Problems: the "functions" array doesn't consider operators/functions
> like "+" or "*" or "last", so I need to find some way to add them to
> the list and make them accessible, which may be non-trivial.

>  eval.c |  201 +++++++++++++++++++++++++++++++++++++++++++++++------------------
>  1 file changed, 147 insertions(+), 54 deletions(-)
> 79226e0ad7eee143c7dc72ba573cfbcb2232a08b  0005-lavu-eval-refactor-function-handling-code.patch
> From 31f48477513134e51531b1683e5ebe7639026fac Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Tue, 5 Mar 2013 14:51:56 +0100
> Subject: [PATCH] lavu/eval: refactor function handling code
> In particular:
> - create an ExprType and a separate native function list
> - do not treat simple libc wrapper especially
> The function names are now looked with a binary search, which reduces
> procedural logic and avoids chained else-if.

what effect does this has on speed ?
(benchmark result should be in the commit message)

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- 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/20130307/69da33de/attachment.asc>

More information about the ffmpeg-devel mailing list