[FFmpeg-devel] [PATCH 7/7] Implement isnan() function evaluation.

Michael Niedermayer michaelni
Mon Nov 1 12:37:15 CET 2010


On Mon, Nov 01, 2010 at 10:46:37AM +0100, Stefano Sabatini wrote:
> On date Monday 2010-11-01 09:35:52 +0100, V?ctor Paesa encoded:
> > Hi,
> > 
> > On Mon, Nov 1, 2010 at 00:23, Stefano Sabatini wrote:
> > > ---
> > > ?doc/eval.texi ? ?| ? ?1 +
> > > ?libavutil/eval.c | ? ?9 +++++++--
> > > ?2 files changed, 8 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/doc/eval.texi b/doc/eval.texi
> > > index c944b3e..768525c 100644
> > > --- a/doc/eval.texi
> > > +++ b/doc/eval.texi
> > > @@ -33,6 +33,7 @@ The following functions are available:
> > > ?@item abs(x)
> > > ?@item squish(x)
> > > ?@item gauss(x)
> > > + at item isnan(x)
> > > ?@item mod(x, y)
> > > ?@item max(x, y)
> > > ?@item min(x, y)
> > > diff --git a/libavutil/eval.c b/libavutil/eval.c
> > > index 83e602d..7438ab2 100644
> > > --- a/libavutil/eval.c
> > > +++ b/libavutil/eval.c
> > > @@ -118,7 +118,7 @@ static int strmatch(const char *s, const char *prefix)
> > > ?struct AVExpr {
> > > ? ? enum {
> > > ? ? ? ? e_value, e_const, e_func0, e_func1, e_func2,
> > > - ? ? ? ?e_squish, e_gauss, e_ld,
> > > + ? ? ? ?e_squish, e_gauss, e_ld, e_isnan,
> > > ? ? ? ? e_mod, e_max, e_min, e_eq, e_gt, e_gte,
> > > ? ? ? ? e_pow, e_mul, e_div, e_add,
> > > ? ? ? ? e_last, e_st, e_while, e_if,
> > > @@ -144,6 +144,7 @@ static double eval_expr(Parser *p, AVExpr *e)
> > > ? ? ? ? case e_squish: return 1/(1+exp(4*eval_expr(p, e->param[0])));
> > > ? ? ? ? case e_gauss: { double d = eval_expr(p, e->param[0]); return exp(-d*d/2)/sqrt(2*M_PI); }
> > > ? ? ? ? case e_ld: ? ? return e->value * p->var[av_clip(eval_expr(p, e->param[0]), 0, VARS-1)];
> > > + ? ? ? ?case e_isnan: ?return e->value * isnan(eval_expr(p, e->param[0]));
> > 
> > I would prefer that eval's isnan returns either 1 or 0.
> > (The math.h isnan() returns either a non-zero value or 0)
> 
> Looks reasonable, patch updated.
> -- 
> FFmpeg = Fostering and Fierce Mega Peaceless EnGine

>  doc/eval.texi    |    3 +++
>  libavutil/eval.c |    9 +++++++--
>  2 files changed, 10 insertions(+), 2 deletions(-)
> f2843d1b5485ec0f795512d07de7b5340b89a310  0002-Implement-isnan-function-evaluation.patch
> From 2e03f49a3ed6cca80bd4faffa3071c9c6ecdd57b Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Mon, 1 Nov 2010 00:23:00 +0100
> Subject: [PATCH 2/2] Implement isnan() function evaluation.

ok too

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101101/1a8adc34/attachment.pgp>



More information about the ffmpeg-devel mailing list