projects
/
nihav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0be53e5
)
add declared bitdepth to NAVideoInfo
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Sun, 7 Jun 2020 12:48:03 +0000
(14:48 +0200)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Sun, 7 Jun 2020 12:48:03 +0000
(14:48 +0200)
nihav-codec-support/src/test/enc_video.rs
patch
|
blob
|
blame
|
history
nihav-commonfmt/src/demuxers/avi.rs
patch
|
blob
|
blame
|
history
nihav-core/src/frame.rs
patch
|
blob
|
blame
|
history
nihav-ms/src/codecs/msvideo1enc.rs
patch
|
blob
|
blame
|
history
diff --git
a/nihav-codec-support/src/test/enc_video.rs
b/nihav-codec-support/src/test/enc_video.rs
index 4a258de07863ef7f185647ad16c8e55f413fd6a1..bde9e7874e46fbd969fd0a05f321b468398de1ee 100644
(file)
--- a/
nihav-codec-support/src/test/enc_video.rs
+++ b/
nihav-codec-support/src/test/enc_video.rs
@@
-271,7
+271,7
@@
pub fn test_encoding_to_file(dec_config: &DecoderTestParams, enc_config: &Encode
vinfo)
} else {
(ScaleInfo { fmt: YUV420_FORMAT, width: 2, height: 2 },
vinfo)
} else {
(ScaleInfo { fmt: YUV420_FORMAT, width: 2, height: 2 },
- NAVideoInfo { width: 2, height: 2, format: YUV420_FORMAT, flipped: false })
+ NAVideoInfo { width: 2, height: 2, format: YUV420_FORMAT, flipped: false
, bits: 12
})
};
let ofmt = ifmt;
let mut scaler = NAScale::new(ifmt, ofmt).unwrap();
};
let ofmt = ifmt;
let mut scaler = NAScale::new(ifmt, ofmt).unwrap();
diff --git
a/nihav-commonfmt/src/demuxers/avi.rs
b/nihav-commonfmt/src/demuxers/avi.rs
index cf1b5bfa5fb1b7ebf4f5aa1c80e53faac5244839..11f0bce5d1dfcb55c84e6022982ba2b5e42fd83b 100644
(file)
--- a/
nihav-commonfmt/src/demuxers/avi.rs
+++ b/
nihav-commonfmt/src/demuxers/avi.rs
@@
-415,7
+415,8
@@
fn parse_strf_vids(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize
let flip = height < 0;
let format = if bitcount > 8 { RGB24_FORMAT } else { PAL8_FORMAT };
let flip = height < 0;
let format = if bitcount > 8 { RGB24_FORMAT } else { PAL8_FORMAT };
- let vhdr = NAVideoInfo::new(width as usize, if flip { -height as usize } else { height as usize}, flip, format);
+ let mut vhdr = NAVideoInfo::new(width as usize, if flip { -height as usize } else { height as usize}, flip, format);
+ vhdr.bits = (planes as u8) * (bitcount as u8);
let vci = NACodecTypeInfo::Video(vhdr);
let edata = dmx.read_extradata(size - 40)?;
if colors > 0 {
let vci = NACodecTypeInfo::Video(vhdr);
let edata = dmx.read_extradata(size - 40)?;
if colors > 0 {
diff --git
a/nihav-core/src/frame.rs
b/nihav-core/src/frame.rs
index 26e8640aa5dc236ee7ba605cf2126e91c333a957..6386d6f80902c7b2c7ba9e72487e9b2c396dc029 100644
(file)
--- a/
nihav-core/src/frame.rs
+++ b/
nihav-core/src/frame.rs
@@
-53,12
+53,15
@@
pub struct NAVideoInfo {
pub flipped: bool,
/// Picture pixel format.
pub format: NAPixelFormaton,
pub flipped: bool,
/// Picture pixel format.
pub format: NAPixelFormaton,
+ /// Declared bits per sample.
+ pub bits: u8,
}
impl NAVideoInfo {
/// Constructs a new `NAVideoInfo` instance.
pub fn new(w: usize, h: usize, flip: bool, fmt: NAPixelFormaton) -> Self {
}
impl NAVideoInfo {
/// Constructs a new `NAVideoInfo` instance.
pub fn new(w: usize, h: usize, flip: bool, fmt: NAPixelFormaton) -> Self {
- NAVideoInfo { width: w, height: h, flipped: flip, format: fmt }
+ let bits = fmt.get_total_depth();
+ NAVideoInfo { width: w, height: h, flipped: flip, format: fmt, bits }
}
/// Returns picture width.
pub fn get_width(&self) -> usize { self.width as usize }
}
/// Returns picture width.
pub fn get_width(&self) -> usize { self.width as usize }
diff --git
a/nihav-ms/src/codecs/msvideo1enc.rs
b/nihav-ms/src/codecs/msvideo1enc.rs
index 5b130ff3c25e52f1f8ac157ce4807136671e3335..c6e4e8d24a4e2496ea8ed2b0aafc579478dc0f80 100644
(file)
--- a/
nihav-ms/src/codecs/msvideo1enc.rs
+++ b/
nihav-ms/src/codecs/msvideo1enc.rs
@@
-559,6
+559,7
@@
mod test {
height: 0,
format: RGB555_FORMAT,
flipped: true,
height: 0,
format: RGB555_FORMAT,
flipped: true,
+ bits: 16,
};
let enc_params = EncodeParameters {
format: NACodecTypeInfo::Video(dst_vinfo),
};
let enc_params = EncodeParameters {
format: NACodecTypeInfo::Video(dst_vinfo),