diff --git a/crates/ec-dv/src/lib.rs b/crates/ec-dv/src/lib.rs index ec68dde9..22323a1d 100644 --- a/crates/ec-dv/src/lib.rs +++ b/crates/ec-dv/src/lib.rs @@ -6,11 +6,11 @@ //! blocks, macroblocks and video segments, so planes are byte-identical to FFmpeg's native //! `yuv411p` / `yuv420p` / `yuv422p` output. //! -//! * [`DvVideoDecoder`] / [`DvPicture`] -- frame in, native planes out (4:1:1 stays 4:1:1). +//! * [`DvVideoDecoder`] / `DvPicture` -- frame in, native planes out (4:1:1 stays 4:1:1). //! * [`DvDecoder`] -- the `ec_core` [`Decoder`](ec_core::registry::Decoder). It widens 4:1:1 to //! `I422` by exact chroma duplication (ec-core has no `I411`); 4:2:0 -> `I420`; 4:2:2 -> `I422`. //! * [`extract_audio`] -- the PCM in the audio DIF blocks (16-bit linear and 12-bit non-linear, -//! both returned as 16-bit linear) as [`DvAudio`]. No audio `CodecId` is involved: audio leaves +//! both returned as 16-bit linear) as `DvAudio`. No audio `CodecId` is involved: audio leaves //! this crate as PCM, and [`DvDemuxer`] publishes it as `PcmS16Le` streams. //! * [`DvDemuxer`], [`is_dv`] -- raw `.dv` / `.dif` files. #![forbid(unsafe_code)] @@ -24,8 +24,8 @@ mod profile; mod tables; mod video; -pub use audio::{DvAudio, extract_audio}; -pub use decoder::{DvDecoder, output_format, to_video_frame}; -pub use demux::{DvDemuxer, dv_probe_score, is_dv}; -pub use profile::{Chroma, PROFILES, PROFILE_BYTES, Profile, frame_profile}; -pub use video::{DvPicture, DvVideoDecoder, is_dv_header}; +pub use audio::extract_audio; +pub use decoder::{DvDecoder, output_format}; +pub use demux::{DvDemuxer, is_dv}; +pub use profile::{Chroma, PROFILES, Profile, frame_profile}; +pub use video::DvVideoDecoder; diff --git a/crates/ec-dv/src/video.rs b/crates/ec-dv/src/video.rs index 662d2539..a908cdac 100644 --- a/crates/ec-dv/src/video.rs +++ b/crates/ec-dv/src/video.rs @@ -6,7 +6,7 @@ use ec_core::error::{Error, Result}; use ec_core::frame::Interlace; use crate::idct::{idct248_tile, idct_tile}; -use crate::profile::{Chroma, PROFILE_BYTES, Profile, WorkChunk, frame_profile, work_chunks}; +use crate::profile::{Chroma, Profile, WorkChunk, frame_profile, work_chunks}; use crate::tables::*; const DV_VIDEO_CONTROL: u8 = 0x61; @@ -669,11 +669,6 @@ fn last_row_field_luma(out: &mut Out, plane: usize, off: usize, stride: usize, b put_block_8x4(&blocks[3][32..], out, plane, off + 24 + stride, s2); } -/// `true` when `buf` starts a plausible DV frame header (DIF header block of a DV file). -pub fn is_dv_header(buf: &[u8]) -> bool { - buf.len() >= PROFILE_BYTES && (buf[0] == 0x1f) && buf[1] & 0x07 == 0x07 && buf[2] == 0 && (buf[3] & 0x7f) == 0x3f -} - #[cfg(test)] mod tests { use super::ZIGZAG;