]> git.nihav.org Git - nihav.git/commitdiff
prepare for implementing scalable Indeo 5
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 13 Oct 2022 16:21:33 +0000 (18:21 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 13 Oct 2022 16:22:10 +0000 (18:22 +0200)
nihav-indeo/src/codecs/indeo4.rs
nihav-indeo/src/codecs/indeo5.rs
nihav-indeo/src/codecs/ivibr.rs
nihav-indeo/src/codecs/mod.rs
nihav-indeo/src/demuxers/ivf.rs
nihav-registry/src/register.rs

index 526668bbc4c4fad37e226f125d097817f86de755..cc737024a17d8ed8d8a50be8b7e49dc2243dd586 100644 (file)
@@ -422,7 +422,7 @@ impl Indeo4Decoder {
     fn new() -> Self {
         Indeo4Decoder {
             info:   NACodecInfo::new_dummy(),
-            dec:    IVIDecoder::new(),
+            dec:    IVIDecoder::new(false),
         }
     }
 }
index 0115b2a0bb601d72550482dbefa23997b3d4a63c..ec23981857dfeaf5dbd767289619296ac818d6bb 100644 (file)
@@ -499,10 +499,10 @@ struct Indeo5Decoder {
 }
 
 impl Indeo5Decoder {
-    fn new() -> Self {
+    fn new(scalable: bool) -> Self {
         Indeo5Decoder {
             info:   NACodecInfo::new_dummy(),
-            dec:    IVIDecoder::new(),
+            dec:    IVIDecoder::new(scalable),
             ip:     Indeo5Parser::new(),
         }
     }
@@ -723,7 +723,11 @@ const INDEO5_QSCALE4_INTER: [u8; 24] = [
 ];
 
 pub fn get_decoder() -> Box<dyn NADecoder + Send> {
-    Box::new(Indeo5Decoder::new())
+    Box::new(Indeo5Decoder::new(false))
+}
+
+pub fn get_decoder_scalable() -> Box<dyn NADecoder + Send> {
+    Box::new(Indeo5Decoder::new(true))
 }
 
 #[cfg(test)]
index 9165d017d777297715faddb230c3b7559528af97..5831f801693d23181716b4ecc4e00c7f305432e5 100644 (file)
@@ -488,10 +488,12 @@ pub struct IVIDecoder {
     tiles:      Vec<IVITile>,
     num_tiles:  [[usize; 4]; 4],
     tile_start: [[usize; 4]; 4],
+
+    scalable:   bool,
 }
 
 impl IVIDecoder {
-    pub fn new() -> Self {
+    pub fn new(scalable: bool) -> Self {
         let mut bands: Vec<BandHeader> = Vec::with_capacity(12);
         bands.resize(12, BandHeader::new_empty(42, 42));
         IVIDecoder {
@@ -506,6 +508,8 @@ impl IVIDecoder {
             bands,
             band_tiles: 0,
             tiles: Vec::new(), tile_start: [[0; 4]; 4], num_tiles: [[0; 4]; 4],
+
+            scalable,
         }
     }
 
index a5a8ec3bbd3ec67eb9a2e4ab82a8dc74eba6bbbe..2352bf95cee3ff4873cbd674cfc51e97ea080ee8 100644 (file)
@@ -37,6 +37,8 @@ const INDEO_CODECS: &[DecoderInfo] = &[
     DecoderInfo { name: "indeo4", get_decoder: indeo4::get_decoder },
 #[cfg(feature="decoder_indeo5")]
     DecoderInfo { name: "indeo5", get_decoder: indeo5::get_decoder },
+#[cfg(feature="decoder_indeo5")]
+    DecoderInfo { name: "indeo5s", get_decoder: indeo5::get_decoder_scalable },
 #[cfg(feature="decoder_intel263")]
     DecoderInfo { name: "intel263", get_decoder: intel263::get_decoder },
 
index 952e526edea2e4e2ce2436f1b8e979f69c6c6263..6ea4623c3870b4b9dac234ae0c2285ecffabebfb 100644 (file)
@@ -90,7 +90,7 @@ impl<'a> DemuxCore<'a> for IVFDemuxer<'a> {
         let cname = match &fcc {
                 b"IV31" | b"IV32" => "indeo3",
                 b"IV41" => "indeo4",
-                b"IV50" => "indeo5",
+                b"IV50" => "indeo5s",
                 _ => "unknown",
             };
         let edata = if vhdr_size > 40 {
index 222d921c083943ba878d1457b6266072219a520b..3a37892c2cd78af578830c3ce33b3ada364f1022 100644 (file)
@@ -165,6 +165,7 @@ static CODEC_REGISTER: &[CodecDescription] = &[
     desc!(video;    "indeo3", "Intel Indeo 3"),
     desc!(video;    "indeo4", "Intel Indeo 4", CODEC_CAP_REORDER | CODEC_CAP_SCALABLE),
     desc!(video;    "indeo5", "Intel Indeo 5", CODEC_CAP_REORDER | CODEC_CAP_SCALABLE),
+    desc!(video;    "indeo5s", "Intel Indeo 5 Scalable", CODEC_CAP_SCALABLE),
     desc!(video;    "intel263", "Intel I263", CODEC_CAP_REORDER),
     desc!(audio;    "iac",    "Intel Indeo audio"),
     desc!(audio;    "imc",    "Intel Music Coder"),