forge
Explore
Log in

Don't you dare go Hollow

edith

Clone
★ 0

0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits

dv.rs25 lines, 1.1 KiBHistoryRawDownload
1//! The DV software seat (`ec-dv`): DV25 (NTSC 4:1:1, PAL 4:2:0 and 4:1:1), DVCPRO25, DVCPRO50
2//! (4:2:2) and DVCPRO HD (1080i / 720p, 4:2:2). Every frame is a sync sample holding the whole
3//! picture, so a seek is one sample read. 4:1:1 comes out widened to 4:2:2 by exact chroma
4//! duplication (`ec-core` has no 4:1:1) and then through the same chroma averaging every 4:2:2
5//! source takes. DV is field-coded: a frame whose VAUX pack says so goes through the shared
6//! deinterlacer. See [`super::intra`] for the stream and the span loop.
7
8use ec_core::frame::VideoFrame;
9use ec_core::registry::{CodecId, CodecParameters};
10
11use super::intra::{IntraFacts, Seat};
12
13pub(crate) struct DvSeat(ec_dv::DvDecoder);
14
15impl Seat for DvSeat {
16 const NAME: &'static str = "DV";
17 fn open(_: IntraFacts, _: &[u8]) -> Result<Self, String> {
18 ec_dv::DvDecoder::new(CodecParameters::new(CodecId::DvVideo)).map(Self).map_err(|e| e.to_string())
19 }
20 fn decode(&mut self, sample: &[u8]) -> Result<VideoFrame, String> {
21 self.0.decode(sample).map_err(|e| e.to_string())
22 }
23}
24
25pub(crate) type Stream = super::intra::Stream<DvSeat>;