diff options
author | metamuffin <metamuffin@disroot.org> | 2023-03-09 22:48:33 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-03-09 22:48:33 +0100 |
commit | 680b08e6b9d64284b7992fb52a23e5f891291406 (patch) | |
tree | abe30a9f18be09ef931b4b6357d216f6ba982095 /bv1/codec/src/lib.rs | |
parent | c45f80a14ecd00914eb1d4e8f628b74a713667ba (diff) | |
download | video-codec-experiments-680b08e6b9d64284b7992fb52a23e5f891291406.tar video-codec-experiments-680b08e6b9d64284b7992fb52a23e5f891291406.tar.bz2 video-codec-experiments-680b08e6b9d64284b7992fb52a23e5f891291406.tar.zst |
rename + readme
Diffstat (limited to 'bv1/codec/src/lib.rs')
-rw-r--r-- | bv1/codec/src/lib.rs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/bv1/codec/src/lib.rs b/bv1/codec/src/lib.rs new file mode 100644 index 0000000..c764211 --- /dev/null +++ b/bv1/codec/src/lib.rs @@ -0,0 +1,55 @@ +#![feature(portable_simd)] +#![feature(io_error_other)] +#![feature(box_syntax)] + +pub mod debug; +pub mod decode; +pub mod diff; +pub mod encode; +pub mod frameio; +pub mod huff; +pub mod impls; +pub mod serialize; +pub mod split; + +pub type PixelValue = i16; + +pub use decode::{decode, Decoder}; +pub use encode::encode; + +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub struct Pixel { + pub r: PixelValue, + pub g: PixelValue, + pub b: PixelValue, +} + +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub struct P2 { + pub x: i32, + pub y: i32, +} + +pub struct Frame { + pub size: P2, + pub pixels: Vec<Pixel>, +} + +#[derive(Debug, Clone, Copy)] +pub struct View { + pub a: P2, + pub b: P2, +} + +#[derive(Debug, Clone)] +pub enum Block { + Split(Box<Block>, Box<Block>), + Lit(Vec<Pixel>), + Ref(Ref), +} + +#[derive(Debug, Clone, Copy, Default)] +pub struct Ref { + pub pos_off: P2, + pub color_off: Pixel, +} |