mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
275aca8fba
commit
401c93ddb7
|
@ -299,7 +299,7 @@ static double eval_expr(Parser *p, AVExpr *e)
|
||||||
case e_add: return e->value * (d + d2);
|
case e_add: return e->value * (d + d2);
|
||||||
case e_last:return e->value * 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_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_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);
|
case e_bitor: return isnan(d) || isnan(d2) ? NAN : e->value * ((long int)d | (long int)d2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue