aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-core
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2021-10-18 18:51:09 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2021-10-18 18:56:38 +0200
commit9d2db2234d6c97dd13f6ca693d370b1e67bd8bed (patch)
tree4261e5d40cb1e51cdd1c03337e9e51a607f858d7 /nihav-core
parent25e0bf9a974b1bb5a8f8b38e23b4a7e91db3eab0 (diff)
downloadnihav-9d2db2234d6c97dd13f6ca693d370b1e67bd8bed.tar.gz
core/scale: fix corner case in mediancut palettiser
Diffstat (limited to 'nihav-core')
-rw-r--r--nihav-core/src/scale/palette/mediancut.rs2
1 files changed, 1 insertions, 1 deletions
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);