forge
Explore
Log in

Don't you dare go Hollow

edith

Clone
★ 0

0 watching0 forksRust18.3 MiBb02f499Tahinli1 month ago1000 commits

dnxhd.rs23 lines, 990 bytesHistoryRawDownload
1//! The Avid DNxHD / DNxHR software seat (`ec-dnxhd`): all twenty compression ids, 8, 10 and
2//! 12-bit (narrowed to 10) in 4:2:2 and 4:4:4, progressive and two-field. Every frame is a
3//! sync sample, so a seek is one sample read. Interlaced frames come out woven and go
4//! through the shared deinterlacer. See [`super::intra`] for the stream and the span loop.
5
6use ec_core::frame::VideoFrame;
7use ec_core::registry::{CodecId, CodecParameters};
8
9use super::intra::{IntraFacts, Seat};
10
11pub(crate) struct DnxhdSeat(ec_dnxhd::DnxhdDecoder);
12
13impl Seat for DnxhdSeat {
14 const NAME: &'static str = "DNxHD";
15 fn open(_: IntraFacts, _: &[u8]) -> Result<Self, String> {
16 ec_dnxhd::DnxhdDecoder::new(CodecParameters::new(CodecId::Dnxhd)).map(Self).map_err(|e| e.to_string())
17 }
18 fn decode(&mut self, sample: &[u8]) -> Result<VideoFrame, String> {
19 self.0.decode_bytes(sample).map_err(|e| e.to_string())
20 }
21}
22
23pub(crate) type Stream = super::intra::Stream<DnxhdSeat>;