X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-commonfmt%2Fsrc%2Fcodecs%2Fzmbvenc.rs;h=d7be6054ea184acdf2b4f02954c1923e22284150;hb=252f4009f1e79679923058be5ea7f89cdce4d506;hp=332cc0e47b9230c44dd6cdd8f754c5f4b290dfc2;hpb=2757a0289c980aeba002609c777815b51ace8e56;p=nihav.git diff --git a/nihav-commonfmt/src/codecs/zmbvenc.rs b/nihav-commonfmt/src/codecs/zmbvenc.rs index 332cc0e..d7be605 100644 --- a/nihav-commonfmt/src/codecs/zmbvenc.rs +++ b/nihav-commonfmt/src/codecs/zmbvenc.rs @@ -139,13 +139,14 @@ impl ZMBVEncoder { } } fn encode_intra(&mut self, bw: &mut ByteWriter, buf: NABufferType) -> EncoderResult<()> { - let bpp = buf_type_to_bpp(&buf); + let mut bpp = buf_type_to_bpp(&buf); if let NABufferType::None = buf { if self.bpp == 0 { return Err(EncoderError::FormatError); } self.frm1.copy_from_slice(&self.frm2); + bpp = self.bpp; } else { if bpp == 0 { return Err(EncoderError::FormatError); @@ -596,7 +597,7 @@ mod test { ]; //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options); test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options, - &[0x08615111, 0x6f644a35, 0xa4e28f32, 0x35d2e66c]); + &[0x18bd3754, 0x97007f81, 0xff2bcd07, 0x739c48dc]); } #[test] @@ -643,7 +644,7 @@ mod test { ]; //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options); test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options, - &[0x1cff4116, 0x5926d91b, 0x60aac53f, 0x8a22bc7b]); + &[0x00311257, 0xd26a0e9e, 0xfd4b003f, 0x7c962d7b]); } #[test] @@ -690,7 +691,7 @@ mod test { ]; //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options); test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options, - &[0xb48aa633, 0x673539fe, 0xa312d45a, 0x76eee134]); + &[0x4eea104f, 0x2ebe544b, 0x54deb0f9, 0xe5ca88f4]); } #[test] @@ -737,6 +738,6 @@ mod test { ]; //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options); test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options, - &[0x0836152c, 0xfcd7e1fc, 0xf1e2f619, 0x874d3dbc]); + &[0xffceb4bd, 0xb1beccd9, 0x4983e7f6, 0xf46e33ba]); } }