[FFmpeg-cvslog] lavfi/vf_idet: replace round and cast by lrint

Ganesh Ajjanagadde git at videolan.org
Sat Dec 19 18:42:11 CET 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Wed Dec 16 13:03:59 2015 -0500| [641cb77f501a7fa1410ab53da4923b1bebc2e690] | committer: Ganesh Ajjanagadde

lavfi/vf_idet: replace round and cast by lrint

lrint is faster and conveys the intent better here. It is safe as long int has
at least 32 bits.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=641cb77f501a7fa1410ab53da4923b1bebc2e690
---

 libavfilter/vf_idet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index e4fe6cb..60ec23a 100644
--- a/libavfilter/vf_idet.c
+++ b/libavfilter/vf_idet.c
@@ -409,7 +409,7 @@ static av_cold int init(AVFilterContext *ctx)
     memset(idet->history, UNDETERMINED, HIST_SIZE);
 
     if( idet->half_life > 0 )
-        idet->decay_coefficient = (uint64_t) round( PRECISION * exp2(-1.0 / idet->half_life) );
+        idet->decay_coefficient = lrint( PRECISION * exp2(-1.0 / idet->half_life) );
     else
         idet->decay_coefficient = PRECISION;
 



More information about the ffmpeg-cvslog mailing list