From: Kostya Shishkov Date: Wed, 8 Jul 2020 15:26:54 +0000 (+0200) Subject: nihav_core/scale: fix ELBG palettisation in the same way as the generic version X-Git-Url: https://git.nihav.org/?p=nihav.git;a=commitdiff_plain;h=4faa9e7d41eccb3ec29e79d5f960f9ab3c96a16a nihav_core/scale: fix ELBG palettisation in the same way as the generic version --- diff --git a/nihav-core/src/scale/palette/elbg.rs b/nihav-core/src/scale/palette/elbg.rs index 300b3f1..8b67a51 100644 --- a/nihav-core/src/scale/palette/elbg.rs +++ b/nihav-core/src/scale/palette/elbg.rs @@ -66,9 +66,6 @@ impl Cluster { } } fn calc_dist(&mut self) { - if self.count != 0 { - self.dist = (self.dist + self.count / 2) / self.count; - } } } @@ -232,7 +229,7 @@ impl ELBG { let mut rng = RNG::new(); let mut iterations = 0usize; let mut do_elbg_step = true; - while (iterations < 20) && (dist < prev_dist - prev_dist / 1000) { + while (iterations < 10) && (dist < prev_dist - prev_dist / 100) { prev_dist = dist; for i in 0..256 { old_cb[i] = self.clusters[i].centroid;