summaryrefslogtreecommitdiff
path: root/xBRZ/src/xbrz.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-09-07 14:49:22 -0400
committerB. Stack <bgstack15@gmail.com>2022-09-07 14:49:22 -0400
commit47c88c433d17948fab1d8e1d76121a72fe5938cb (patch)
treefbc1dea58a6b28f1af4a9e9b2bc8e3e1d23b2103 /xBRZ/src/xbrz.cpp
parentMerge branch 'b11.23' into 'master' (diff)
downloadFreeFileSync-47c88c433d17948fab1d8e1d76121a72fe5938cb.tar.gz
FreeFileSync-47c88c433d17948fab1d8e1d76121a72fe5938cb.tar.bz2
FreeFileSync-47c88c433d17948fab1d8e1d76121a72fe5938cb.zip
add upstream 11.24
Diffstat (limited to 'xBRZ/src/xbrz.cpp')
-rw-r--r--xBRZ/src/xbrz.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/xBRZ/src/xbrz.cpp b/xBRZ/src/xbrz.cpp
index 65dfc47e..448a4b74 100644
--- a/xBRZ/src/xbrz.cpp
+++ b/xBRZ/src/xbrz.cpp
@@ -283,20 +283,18 @@ template <class ColorDistance>
FORCE_INLINE //detect blend direction
BlendResult preProcessCorners(const Kernel_4x4& ker, const xbrz::ScalerCfg& cfg) //result: E, F, H, I corners of "GradientType"
{
-
- BlendResult result = {};
-
if ((ker.e == ker.f &&
ker.h == ker.i) ||
(ker.e == ker.h &&
ker.f == ker.i))
- return result;
+ return {};
auto dist = [&](uint32_t pix1, uint32_t pix2) { return ColorDistance::dist(pix1, pix2, cfg.testAttribute); };
const double hf = dist(ker.g, ker.e) + dist(ker.e, ker.c) + dist(ker.k, ker.i) + dist(ker.i, ker.o) + cfg.centerDirectionBias * dist(ker.h, ker.f);
const double ei = dist(ker.d, ker.h) + dist(ker.h, ker.l) + dist(ker.b, ker.f) + dist(ker.f, ker.n) + cfg.centerDirectionBias * dist(ker.e, ker.i);
+ BlendResult result = {};
if (hf < ei) //test sample: 70% of values max(hf, ei) / min(hf, ei) are between 1.1 and 3.7 with median being 1.8
{
const bool dominantGradient = cfg.dominantDirectionThreshold * hf < ei;
bgstack15