codec_support/vq: use 1% improvement as a threshold in ELBG loop
authorKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 15 Jun 2020 16:47:32 +0000 (18:47 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 15 Jun 2020 16:47:32 +0000 (18:47 +0200)
nihav-codec-support/src/vq/generic_elbg.rs

index 01feaa852084c7cbc30c95de74337de62883d87a..91a56586d81bc1c619ddecde52d7edf6e8d6b3e0 100644 (file)
@@ -181,7 +181,7 @@ impl<T: VQElement+Default, TS: VQElementSum<T>> ELBG<T, TS> {
         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 < 20) && (dist < prev_dist - prev_dist / 100) {
             prev_dist = dist;
             for i in 0..dst.len() {
                 old_cb[i] = self.clusters[i].centroid;