msvideo1enc: fix corner case in box split condition
authorKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 18 Oct 2021 16:56:05 +0000 (18:56 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 18 Oct 2021 16:56:38 +0000 (18:56 +0200)
nihav-ms/src/codecs/msvideo1enc.rs

index 89b4b2200aed810f46ecc15ed45609a60177283f..959c5d5d3e2fca70a59ac098688d29878bbcc82f 100644 (file)
@@ -73,7 +73,7 @@ impl VQElement for Pixel16 {
         let rd = u32::from(r0) - u32::from(r1);
         let gd = u32::from(g0) - u32::from(g1);
         let bd = u32::from(b0) - u32::from(b1);
         let rd = u32::from(r0) - u32::from(r1);
         let gd = u32::from(g0) - u32::from(g1);
         let bd = u32::from(b0) - u32::from(b1);
-        if rd > gd && rd > bd {
+        if rd > gd && rd >= bd {
             0
         } else if bd > rd && bd > gd {
             2
             0
         } else if bd > rd && bd > gd {
             2
@@ -612,6 +612,6 @@ mod test {
             };
         //test_encoding_to_file(&dec_config, &enc_config, enc_params, &[]);
         test_encoding_md5(&dec_config, &enc_config, enc_params, &[],
             };
         //test_encoding_to_file(&dec_config, &enc_config, enc_params, &[]);
         test_encoding_md5(&dec_config, &enc_config, enc_params, &[],
-                          &[0x4339421d, 0x6393f1b6, 0x653d6cd2, 0x3a184382]);
+                          &[0x6921e67e, 0x4f2ada95, 0x009ffc62, 0xd4bfab6a]);
     }
 }
     }
 }