From bbdabfd55f8ff781384aeb3a8fbb8b9a0a13e442 Mon Sep 17 00:00:00 2001 From: sekrit-twc Date: Tue, 21 Sep 2021 18:41:09 -0700 Subject: [PATCH] Fix prescreener with float inputs --- znedi3/znedi3_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/znedi3/znedi3_impl.cpp b/znedi3/znedi3_impl.cpp index 92e7520..cd8715a 100644 --- a/znedi3/znedi3_impl.cpp +++ b/znedi3/znedi3_impl.cpp @@ -125,7 +125,7 @@ znedi3_filter::znedi3_filter(const NNEDI3Weights &weights, const znedi3_filter_p assert(model_set.find(traits) != model_set.end()); const PredictorModel &model = *model_set.find(traits); - double pixel_half_val = static_cast((1UL << bit_depth) - 1) / 2.0; + double pixel_half_val = (m_type == PixelType::HALF || m_type == PixelType::FLOAT) ? 0.5 : static_cast((1UL << bit_depth) - 1) / 2.0; switch (params.prescreen) { case ZNEDI3_PRESCREEN_NONE: