mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-18 00:05:08 +00:00
video: the VMD decoder is behind vmd-decode, with vmd turning it on
craft-audio names its VMD decoder feature `vmd-decode`, and craft-video names a codec's decoder `<codec>-decode` wherever the codec may also have an encoder (mpeg2, mpeg4, vp8…). The video decoder now follows that: `vmd-decode` gates the module and its VideoFrame conversion, and `vmd` turns it on, so `vmd` keeps working and an encoder can be added later without renaming. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4 files changed
+9
-8
No files matched your search
@@ -62,8 +62,9 @@ av1-decode = []
|
||||
av1-encode = ["craft-media/isobmff"]
|
||||
# Tiled AV1 fallback for frames that exceed the clean-room encoder's single-tile limits.
|
||||
av1-large-encode = ["av1-encode", "dep:rav1e"]
|
||||
# Sierra VMD video (8-bit paletted): decoder.
|
||||
vmd = []
|
||||
# Sierra VMD video (8-bit paletted): decoder; `vmd` turns it on too.
|
||||
vmd = ["vmd-decode"]
|
||||
vmd-decode = []
|
||||
# Decode and encode across worker threads (rayon) in the codecs that support it.
|
||||
threads = ["dep:rayon", "rav1e?/threading"]
|
||||
|
||||
@@ -84,7 +85,7 @@ craft-media = { workspace = true, features = ["avi", "vmd"] }
|
||||
|
||||
[[test]]
|
||||
name = "vmd"
|
||||
required-features = ["vmd"]
|
||||
required-features = ["vmd-decode"]
|
||||
|
||||
[[test]]
|
||||
name = "hap"
|
||||
|
||||
@@ -30,7 +30,7 @@ No codec feature is on by default.
|
||||
| `hevc` | [`hevc`](src/hevc/decode/README.md) | ITU-T H.265 / HEVC: decoder (`hevc-decode` alone) and encoder (`hevc-encode` alone) |
|
||||
| `vp9` | [`vp9`](src/vp9/decode/README.md) | VP9: decoder (`vp9-decode` alone) and encoder (`vp9-encode` alone) |
|
||||
| `av1` | [`av1`](src/av1/decode/README.md) | AV1 (AOMedia Video 1): decoder (`av1-decode` alone) and clean-room encoder (`av1-encode`); tiled rav1e fallback for large frames (`av1-large-encode`) |
|
||||
| `vmd` | `vmd` | Sierra VMD video (the 8-bit paletted pictures of Sierra and Coktel Vision game videos): decoder |
|
||||
| `vmd` | `vmd` | Sierra VMD video (the 8-bit paletted pictures of Sierra and Coktel Vision game videos): decoder (`vmd-decode`) |
|
||||
| `threads` | — | Multi-threaded slice/row parallelism via `rayon` |
|
||||
|
||||
## Decoded frames
|
||||
|
||||
@@ -370,7 +370,7 @@ impl TryFrom<crate::ffv1::Frame> for VideoFrame {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "vmd")]
|
||||
#[cfg(feature = "vmd-decode")]
|
||||
impl TryFrom<&crate::vmd::Decoder> for VideoFrame {
|
||||
type Error = FrameError;
|
||||
|
||||
@@ -384,7 +384,7 @@ impl TryFrom<&crate::vmd::Decoder> for VideoFrame {
|
||||
|
||||
/// A picture of palette indices, `width` a row, as 8-bit R, G, B planes. Matrix 0 (identity), the
|
||||
/// other colour tags unspecified.
|
||||
#[cfg(feature = "vmd")]
|
||||
#[cfg(feature = "vmd-decode")]
|
||||
fn paletted(width: usize, height: usize, indices: &[u8], palette: &[[u8; 3]; 256]) -> Result<VideoFrame, FrameError> {
|
||||
let too_large = FrameError::Shape("picture size does not fit in u32");
|
||||
let (w, h) = (u32::try_from(width).map_err(|_| too_large.clone())?, u32::try_from(height).map_err(|_| too_large)?);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//! | `hevc` | [`hevc`] | ITU-T H.265 / HEVC: decoder (`hevc-decode`) and encoder (`hevc-encode`) |
|
||||
//! | `vp9` | [`vp9`] | VP9: decoder (`vp9-decode`) and encoder (`vp9-encode`) |
|
||||
//! | `av1` | [`av1`] | AV1 (AOMedia Video 1): decoder (`av1-decode`) and encoder (`av1-encode`) |
|
||||
//! | `vmd` | [`vmd`] | Sierra VMD video (8-bit paletted): decoder |
|
||||
//! | `vmd` | [`vmd`] | Sierra VMD video (8-bit paletted): decoder (`vmd-decode`) |
|
||||
//!
|
||||
//! No codec is on by default. Feature `threads` spreads the work of the codecs that support it
|
||||
//! over rayon worker threads.
|
||||
@@ -80,5 +80,5 @@ pub mod raw_video;
|
||||
#[cfg(feature = "screen-video")]
|
||||
pub mod screen_video;
|
||||
|
||||
#[cfg(feature = "vmd")]
|
||||
#[cfg(feature = "vmd-decode")]
|
||||
pub mod vmd;
|
||||
Reference in new issue
Block a user