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 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 {
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 {
- 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 }
height: 0,
format: RGB555_FORMAT,
flipped: true,
+ bits: 16,
};
let enc_params = EncodeParameters {
format: NACodecTypeInfo::Video(dst_vinfo),