[FFmpeg-cvslog] avfilter/vf_vif: simplify case comparing same inputs

Paul B Mahol git at videolan.org
Thu Feb 25 17:39:03 EET 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Feb 25 15:52:33 2021 +0100| [550b7a99292e1047a035c6380019ab63ac670452] | committer: Paul B Mahol

avfilter/vf_vif: simplify case comparing same inputs

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

 libavfilter/vf_vif.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vf_vif.c b/libavfilter/vf_vif.c
index 0bd71eca5c..1e9096caff 100644
--- a/libavfilter/vf_vif.c
+++ b/libavfilter/vf_vif.c
@@ -167,13 +167,8 @@ static void vif_statistic(const float *mu1_sq, const float *mu2_sq,
             num_val = log2f(1.0f + g * g * sigma1_sq / (sv_sq + sigma_nsq));
             den_val = log2f(1.0f + sigma1_sq / sigma_nsq);
 
-            if (sigma12 < 0.0f)
-                num_val = 0.0f;
-
-            if (sigma1_sq < sigma_nsq) {
-                num_val = 1.0f - sigma2_sq * sigma_max_inv;
-                den_val = 1.0f;
-            }
+            if (isnan(den_val))
+                num_val = den_val = 1.f;
 
             accum_inner_num += num_val;
             accum_inner_den += den_val;



More information about the ffmpeg-cvslog mailing list