U15: ec-dv drop re-exports nothing outside the crate uses (DvAudio, DvPicture, dv_probe_score, to_video_frame, PROFILE_BYTES, is_dv_header); delete the now-dead is_dv_header
Browse files at this commit5796a707e56eba1978bffc2f7bf675a7ded7ec32Parent: 3d4a9b72 changed files +8 -13
- crates/ec-dv/src/lib.rs +7 -7
- crates/ec-dv/src/video.rs +1 -6
crates/ec-dv/src/lib.rsmodified+7 -7
| @@ -6,11 +6,11 @@ | |||
| 6 | //! blocks, macroblocks and video segments, so planes are byte-identical to FFmpeg's native | 6 | //! blocks, macroblocks and video segments, so planes are byte-identical to FFmpeg's native |
| 7 | //! `yuv411p` / `yuv420p` / `yuv422p` output. | 7 | //! `yuv411p` / `yuv420p` / `yuv422p` output. |
| 8 | //! | 8 | //! |
| 9 | -//! * [`DvVideoDecoder`] / [`DvPicture`] -- frame in, native planes out (4:1:1 stays 4:1:1). | 9 | +//! * [`DvVideoDecoder`] / `DvPicture` -- frame in, native planes out (4:1:1 stays 4:1:1). |
| 10 | //! * [`DvDecoder`] -- the `ec_core` [`Decoder`](ec_core::registry::Decoder). It widens 4:1:1 to | 10 | //! * [`DvDecoder`] -- the `ec_core` [`Decoder`](ec_core::registry::Decoder). It widens 4:1:1 to |
| 11 | //! `I422` by exact chroma duplication (ec-core has no `I411`); 4:2:0 -> `I420`; 4:2:2 -> `I422`. | 11 | //! `I422` by exact chroma duplication (ec-core has no `I411`); 4:2:0 -> `I420`; 4:2:2 -> `I422`. |
| 12 | //! * [`extract_audio`] -- the PCM in the audio DIF blocks (16-bit linear and 12-bit non-linear, | 12 | //! * [`extract_audio`] -- the PCM in the audio DIF blocks (16-bit linear and 12-bit non-linear, |
| 13 | -//! both returned as 16-bit linear) as [`DvAudio`]. No audio `CodecId` is involved: audio leaves | 13 | +//! both returned as 16-bit linear) as `DvAudio`. No audio `CodecId` is involved: audio leaves |
| 14 | //! this crate as PCM, and [`DvDemuxer`] publishes it as `PcmS16Le` streams. | 14 | //! this crate as PCM, and [`DvDemuxer`] publishes it as `PcmS16Le` streams. |
| 15 | //! * [`DvDemuxer`], [`is_dv`] -- raw `.dv` / `.dif` files. | 15 | //! * [`DvDemuxer`], [`is_dv`] -- raw `.dv` / `.dif` files. |
| 16 | #![forbid(unsafe_code)] | 16 | #![forbid(unsafe_code)] |
| @@ -24,8 +24,8 @@ mod profile; | |||
| 24 | mod tables; | 24 | mod tables; |
| 25 | mod video; | 25 | mod video; |
| 26 | 26 | ||
| 27 | -pub use audio::{DvAudio, extract_audio}; | 27 | +pub use audio::extract_audio; |
| 28 | -pub use decoder::{DvDecoder, output_format, to_video_frame}; | 28 | +pub use decoder::{DvDecoder, output_format}; |
| 29 | -pub use demux::{DvDemuxer, dv_probe_score, is_dv}; | 29 | +pub use demux::{DvDemuxer, is_dv}; |
| 30 | -pub use profile::{Chroma, PROFILES, PROFILE_BYTES, Profile, frame_profile}; | 30 | +pub use profile::{Chroma, PROFILES, Profile, frame_profile}; |
| 31 | -pub use video::{DvPicture, DvVideoDecoder, is_dv_header}; | 31 | +pub use video::DvVideoDecoder; |
crates/ec-dv/src/video.rsmodified+1 -6
| @@ -6,7 +6,7 @@ use ec_core::error::{Error, Result}; | |||
| 6 | use ec_core::frame::Interlace; | 6 | use ec_core::frame::Interlace; |
| 7 | 7 | ||
| 8 | use crate::idct::{idct248_tile, idct_tile}; | 8 | use crate::idct::{idct248_tile, idct_tile}; |
| 9 | -use crate::profile::{Chroma, PROFILE_BYTES, Profile, WorkChunk, frame_profile, work_chunks}; | 9 | +use crate::profile::{Chroma, Profile, WorkChunk, frame_profile, work_chunks}; |
| 10 | use crate::tables::*; | 10 | use crate::tables::*; |
| 11 | 11 | ||
| 12 | const DV_VIDEO_CONTROL: u8 = 0x61; | 12 | 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 | |||
| 669 | put_block_8x4(&blocks[3][32..], out, plane, off + 24 + stride, s2); | 669 | put_block_8x4(&blocks[3][32..], out, plane, off + 24 + stride, s2); |
| 670 | } | 670 | } |
| 671 | 671 | ||
| 672 | -/// `true` when `buf` starts a plausible DV frame header (DIF header block of a DV file). | ||
| 673 | -pub fn is_dv_header(buf: &[u8]) -> bool { | ||
| 674 | - buf.len() >= PROFILE_BYTES && (buf[0] == 0x1f) && buf[1] & 0x07 == 0x07 && buf[2] == 0 && (buf[3] & 0x7f) == 0x3f | ||
| 675 | -} | ||
| 676 | - | ||
| 677 | #[cfg(test)] | 672 | #[cfg(test)] |
| 678 | mod tests { | 673 | mod tests { |
| 679 | use super::ZIGZAG; | 674 | use super::ZIGZAG; |