From acabf1634bd688a55af95b93217e12b55c30b18a Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 18 Oct 2021 18:56:05 +0200 Subject: [PATCH] msvideo1enc: fix corner case in box split condition --- nihav-ms/src/codecs/msvideo1enc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nihav-ms/src/codecs/msvideo1enc.rs b/nihav-ms/src/codecs/msvideo1enc.rs index 89b4b22..959c5d5 100644 --- a/nihav-ms/src/codecs/msvideo1enc.rs +++ b/nihav-ms/src/codecs/msvideo1enc.rs @@ -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); - if rd > gd && rd > bd { + if rd > gd && rd >= bd { 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, &[], - &[0x4339421d, 0x6393f1b6, 0x653d6cd2, 0x3a184382]); + &[0x6921e67e, 0x4f2ada95, 0x009ffc62, 0xd4bfab6a]); } } -- 2.39.5