make decoders Send-able
[nihav.git] / nihav-indeo / src / codecs / indeo5.rs
index aece25dc6d637e2bfeadfba279d346b07ed6d69d..19107862f3afad069eef001b3c79649a7eae23ab 100644 (file)
@@ -264,7 +264,7 @@ impl IndeoXParser for Indeo5Parser {
         Ok(BandHeader::new(plane_no, band_no, self.mb_size[band_id], self.blk_size[band_id], self.is_hpel[band_id], inherit_mv, has_qdelta, inherit_qd, band_q, rvmap_idx, num_corr, corr_map, blk_cb, tr, txtype))
     }
 
-    fn decode_mb_info(&mut self, br: &mut BitReader, pic_hdr: &PictureHeader, band: &BandHeader, tile: &mut IVITile, ref_tile: Option<Ref<IVITile>>, mv_scale: u8) -> DecoderResult<()> {
+    fn decode_mb_info(&mut self, br: &mut BitReader, pic_hdr: &PictureHeader, band: &BandHeader, tile: &mut IVITile, ref_tile: Option<&IVITile>, mv_scale: u8) -> DecoderResult<()> {
         let mut mv_x = 0;
         let mut mv_y = 0;
         let band_id = if pic_hdr.luma_bands == 4 { band.band_no + 1 } else { 0 };
@@ -530,6 +530,9 @@ impl NADecoder for Indeo5Decoder {
         frm.set_frame_type(self.dec.get_frame_type());
         Ok(frm.into_ref())
     }
+    fn flush(&mut self) {
+        self.dec.flush();
+    }
 }
 
 const INDEO5_PICTURE_SIZE_TAB: [[usize; 2]; 15] = [
@@ -662,7 +665,7 @@ const INDEO5_Q4_INTRA: &[u16; 16] = &INDEO5_QUANT4X4_INTRA;
 const INDEO5_Q4_INTER: &[u16; 16] = &INDEO5_QUANT4X4_INTER;
 
 const INDEO5_SCAN8X8: [&[usize; 64]; 4] = [
-    &IVI_ZIGZAG, &IVI_SCAN_8X8_VER, &IVI_SCAN_8X8_HOR, &IVI_SCAN_8X8_HOR
+    &ZIGZAG, &IVI_SCAN_8X8_VER, &IVI_SCAN_8X8_HOR, &IVI_SCAN_8X8_HOR
 ];
 const INDEO5_SCAN4X4: &[usize; 16] = &IVI_SCAN_4X4;
 
@@ -711,7 +714,7 @@ const INDEO5_QSCALE4_INTER: [u8; 24] = [
     0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23
 ];
 
-pub fn get_decoder() -> Box<dyn NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder + Send> {
     Box::new(Indeo5Decoder::new())
 }