From: Kostya Shishkov Date: Mon, 18 Oct 2021 16:51:09 +0000 (+0200) Subject: core/scale: fix corner case in mediancut palettiser X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=9d2db2234d6c97dd13f6ca693d370b1e67bd8bed;p=nihav.git core/scale: fix corner case in mediancut palettiser --- diff --git a/nihav-core/src/scale/palette/mediancut.rs b/nihav-core/src/scale/palette/mediancut.rs index 497cc4a..64281ef 100644 --- a/nihav-core/src/scale/palette/mediancut.rs +++ b/nihav-core/src/scale/palette/mediancut.rs @@ -78,7 +78,7 @@ impl<'a> VQBox<'a> { let box0; let box1; - if (dr > dg) && (dr > db) { + if (dr > dg) && (dr >= db) { let pivot = Self::sort(self.pixels, |pix| pix.r as usize); let (part0, part1) = self.pixels.split_at_mut(pivot); let (min0, max0) = Self::calc_min_and_max(part0);