diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2023-02-14 18:50:21 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2023-02-14 18:50:21 +0100 |
commit | 2bf1f2332263f37d3cffa4bdee50f58d29bec680 (patch) | |
tree | bd79c591e7a15ded6e7303d1f8c8fad9846db9d3 | |
parent | bd7a26d17d86045e1dbdb6b930407bd34003d53a (diff) | |
download | nihav-2bf1f2332263f37d3cffa4bdee50f58d29bec680.tar.gz |
msvideo1enc: fix inversed flags in quantisation
-rw-r--r-- | nihav-ms/src/codecs/msvideo1enc.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nihav-ms/src/codecs/msvideo1enc.rs b/nihav-ms/src/codecs/msvideo1enc.rs index b927dc8..5d50b9a 100644 --- a/nihav-ms/src/codecs/msvideo1enc.rs +++ b/nihav-ms/src/codecs/msvideo1enc.rs @@ -201,9 +201,9 @@ macro_rules! quant_template { for clr in pix.iter() { if clr[best_axis] > avg[best_axis] { avg2.add(clr); - mask |= mask_bit; } else { avg1.add(clr); + mask |= mask_bit; } mask_bit <<= 1; } @@ -338,8 +338,8 @@ impl BlockState { let src2 = [buf[off], buf[off + 1], buf[off + 4], buf[off + 5]]; let (clrs, mask, dist) = quant2_4pix(&src2); self.clr8[i] = clrs; - let lo_bits = (mask & 0x3) ^ 0x3; - let hi_bits = ((mask & 0xC) ^ 0xC) << 2; + let lo_bits = mask & 0x3; + let hi_bits = (mask & 0xC) << 2; self.clr8_flags |= (hi_bits | lo_bits) << ((i & 1) * 2 + (i & 2) * 4); self.clr8_dist += dist; } @@ -1075,7 +1075,7 @@ mod test { }; //test_encoding_to_file(&dec_config, &enc_config, enc_params, &[]); test_encoding_md5(&dec_config, &enc_config, enc_params, &[], - &[0x27a9db38, 0x74f1000a, 0x38818c05, 0x99d692ba]); + &[0x5afaf853, 0xd53ba9dd, 0x630f53e7, 0x41b33a36]); } #[test] @@ -1121,6 +1121,6 @@ mod test { }; //test_encoding_to_file(&dec_config, &enc_config, enc_params, &[]); test_encoding_md5(&dec_config, &enc_config, enc_params, &[], - &[0xe570a206, 0xc223063f, 0x44a0b70e, 0xa71fed1f]); + &[0xb3175a7b, 0x4a6cb45e, 0x526f3f5d, 0xaa1574cc]); } } |