diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-02-25 15:52:33 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-02-25 16:38:27 +0100 |
commit | 550b7a99292e1047a035c6380019ab63ac670452 (patch) | |
tree | 15d9ed3cbadfa79664a06a61143a61d776f9f567 /libavfilter | |
parent | a5b737e6250e4a335f1d32ec6994614fa092a854 (diff) | |
download | ffmpeg-550b7a99292e1047a035c6380019ab63ac670452.tar.gz |
avfilter/vf_vif: simplify case comparing same inputs
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_vif.c | 9 |
1 files 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; |