forge
Explore
Log in

Don't you dare go Hollow

edith

Clone
★ 0

0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits

prores.rs24 lines, 1.0 KiBHistoryRawDownload
1//! The Apple ProRes software seat (`ec-prores`): 422 Proxy, LT, Standard, HQ (10-bit 4:2:2)
2//! and 4444, 4444 XQ (12-bit 4:4:4, narrowed to 10). Every frame is a sync sample, so a seek
3//! is one sample read. Interlaced frames come out woven and go through the shared
4//! deinterlacer; an alpha plane is dropped (the engine has no alpha path for a video clip).
5//! See [`super::intra`] for the stream and the span loop.
6
7use ec_core::frame::VideoFrame;
8use ec_core::registry::{CodecId, CodecParameters};
9
10use super::intra::{IntraFacts, Seat};
11
12pub(crate) struct ProResSeat(ec_prores::ProResDecoder);
13
14impl Seat for ProResSeat {
15 const NAME: &'static str = "ProRes";
16 fn open(_: IntraFacts, _: &[u8]) -> Result<Self, String> {
17 ec_prores::ProResDecoder::new(CodecParameters::new(CodecId::ProRes)).map(Self).map_err(|e| e.to_string())
18 }
19 fn decode(&mut self, sample: &[u8]) -> Result<VideoFrame, String> {
20 self.0.decode(sample).map_err(|e| e.to_string())
21 }
22}
23
24pub(crate) type Stream = super::intra::Stream<ProResSeat>;