forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB7947774Tahinli1 month ago3899 commits

lib.rs31 lines, 1.6 KiBHistoryRawDownload
1//! DV video decoder (IEC 61834, SMPTE 314M / 370M) and DIF audio extraction.
2//!
3//! Covers DV25 (NTSC 4:1:1, PAL 4:2:0 and PAL 4:1:1), DVCPRO25, DVCPRO50 (4:2:2) and DVCPRO HD
4//! (1080i / 720p, 4:2:2). The arithmetic is FFmpeg's `dvvideo` decoder: its integer simple IDCT,
5//! the 2-4-8 IDCT for field-mode blocks, and the three-pass bit-recovery of AC coefficients across
6//! blocks, macroblocks and video segments, so planes are byte-identical to FFmpeg's native
7//! `yuv411p` / `yuv420p` / `yuv422p` output.
8//!
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
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,
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.
15//! * [`DvDemuxer`], [`is_dv`] -- raw `.dv` / `.dif` files.
16#![forbid(unsafe_code)]
17#![allow(clippy::needless_range_loop, clippy::too_many_arguments)]
18
19mod audio;
20mod decoder;
21mod demux;
22mod idct;
23mod profile;
24mod tables;
25mod video;
26
27pub use audio::{DvAudio, extract_audio};
28pub use decoder::{DvDecoder, output_format, to_video_frame};
29pub use demux::{DvDemuxer, dv_probe_score, is_dv};
30pub use profile::{Chroma, PROFILES, PROFILE_BYTES, Profile, frame_profile};
31pub use video::{DvPicture, DvVideoDecoder, is_dv_header};