diff options
author | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-11-14 12:04:53 -0500 |
---|---|---|
committer | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-11-21 08:51:49 -0500 |
commit | 401c93ddb76fb213b858ad722c83cdb4a510dc52 (patch) | |
tree | 52edc279af209c452f4899676d2062863b44f934 | |
parent | 275aca8fba50e77af16627d8d5db4b3d4987d889 (diff) | |
download | ffmpeg-401c93ddb76fb213b858ad722c83cdb4a510dc52.tar.gz |
avutil/eval: change sqrt to hypot
This improves the mathematical behavior of hypotenuse computation.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
-rw-r--r-- | libavutil/eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/eval.c b/libavutil/eval.c index 7642b919cb..44129d65c2 100644 --- a/libavutil/eval.c +++ b/libavutil/eval.c @@ -299,7 +299,7 @@ static double eval_expr(Parser *p, AVExpr *e) case e_add: return e->value * (d + d2); case e_last:return e->value * d2; case e_st : return e->value * (p->var[av_clip(d, 0, VARS-1)]= d2); - case e_hypot:return e->value * (sqrt(d*d + d2*d2)); + case e_hypot:return e->value * hypot(d, d2); case e_bitand: return isnan(d) || isnan(d2) ? NAN : e->value * ((long int)d & (long int)d2); case e_bitor: return isnan(d) || isnan(d2) ? NAN : e->value * ((long int)d | (long int)d2); } |