summaryrefslogtreecommitdiff
path: root/libavutil/eval.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-04 20:39:50 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-04 21:03:28 +0200
commit039e9fe01ca27606a0ec1a944d51041541e10aab (patch)
tree9fc96837e878cdb2c13b6016d9f3d69785570488 /libavutil/eval.c
parent8b421fad24acbba69935caf2a2775bd04f8a707a (diff)
parent7c29377b702783680b223a12503df784b1808086 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (29 commits) lavfi: reclassify showfiltfmts as a TESTPROG graph2dot: fix printf format specifier swscale: yuv2planeX 8bit >=sse2 functions need aligned stack on x86-32. vp8: loopfilter >=sse2 functions need aligned stack on x86-32. amr: remove shift out of the AMR_BIT() macro. dsputilenc: group yasm and inline asm function pointer assignment. mov: use forward declaration of a function instead of a table. Clarify Doxygen comment for FF_API_* #defines. configure: simplify get_version() Create version.h headers for libraries that lack them gitignore: Use full path instead of relative path to specify patterns mpegvideo: remove VLAs Add XTEA encryption support in libavutil Add Blowfish encryption support in libavutil eval: Add the isinf() function and tests for it flacdec: move lpc filter to flacdsp flacdec: split off channel decorrelation as flacdsp avplay: Add an option for not limiting the input buffer size FATE: add a test for WMA cover art. FATE: add a test for apetag cover art ... Conflicts: .gitignore configure ffplay.c libavcodec/Makefile libavcodec/error_resilience.c libavcodec/mpegvideo.c libavcodec/ratecontrol.c libavdevice/avdevice.h libavfilter/Makefile libavfilter/filtfmts.c libavfilter/version.h libavformat/mov.c libavformat/version.h libavutil/Makefile libavutil/avutil.h libavutil/version.h libswscale/swscale.h libswscale/x86/swscale_mmx.c tests/fate/libavutil.mak tests/lavfi-regression.sh tools/graph2dot.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/eval.c')
-rw-r--r--libavutil/eval.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavutil/eval.c b/libavutil/eval.c
index 771f12d90a..0f9ada6098 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -133,7 +133,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_isnan,
+ e_squish, e_gauss, e_ld, e_isnan, e_isinf,
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_taylor, e_root, e_floor, e_ceil, e_trunc,
@@ -163,6 +163,7 @@ static double eval_expr(Parser *p, AVExpr *e)
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]));
+ case e_isinf: return e->value * !!isinf(eval_expr(p, e->param[0]));
case e_floor: return e->value * floor(eval_expr(p, e->param[0]));
case e_ceil : return e->value * ceil (eval_expr(p, e->param[0]));
case e_trunc: return e->value * trunc(eval_expr(p, e->param[0]));
@@ -383,6 +384,7 @@ static int parse_primary(AVExpr **e, Parser *p)
else if (strmatch(next, "lt" )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gt; }
else if (strmatch(next, "ld" )) d->type = e_ld;
else if (strmatch(next, "isnan" )) d->type = e_isnan;
+ else if (strmatch(next, "isinf" )) d->type = e_isinf;
else if (strmatch(next, "st" )) d->type = e_st;
else if (strmatch(next, "while" )) d->type = e_while;
else if (strmatch(next, "taylor")) d->type = e_taylor;
@@ -562,6 +564,7 @@ static int verify_expr(AVExpr *e)
case e_ld:
case e_gauss:
case e_isnan:
+ case e_isinf:
case e_floor:
case e_ceil:
case e_trunc:
@@ -751,6 +754,10 @@ int main(int argc, char **argv)
"st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))",
"isnan(1)",
"isnan(NAN)",
+ "isnan(INF)",
+ "isinf(1)",
+ "isinf(NAN)",
+ "isinf(INF)",
"floor(NAN)",
"floor(123.123)",
"floor(-123.123)",