]> git.nihav.org Git - nihav.git/commitdiff
zmbvenc: handle I-frames that turned out to be skip frames
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 25 May 2023 15:46:59 +0000 (17:46 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 25 May 2023 15:51:26 +0000 (17:51 +0200)
nihav-commonfmt/src/codecs/zmbvenc.rs

index 52e02e557f8f5fc4f00faa49f84cb210480439bc..d7be6054ea184acdf2b4f02954c1923e22284150 100644 (file)
@@ -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);