From a34a44ac915dbeb271d3e16b8f7b0a33a743e95c Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 5 May 2025 16:20:34 +0200 Subject: matroska bitstream filter library --- mtree-test/src/bin/decode.rs | 24 ++++++++++++++++++++++++ mtree-test/src/bin/encode.rs | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 mtree-test/src/bin/decode.rs create mode 100644 mtree-test/src/bin/encode.rs (limited to 'mtree-test/src/bin') diff --git a/mtree-test/src/bin/decode.rs b/mtree-test/src/bin/decode.rs new file mode 100644 index 0000000..6ff2cb3 --- /dev/null +++ b/mtree-test/src/bin/decode.rs @@ -0,0 +1,24 @@ +use framework::{BitstreamFilter, bitstream_filter_main}; +use glam::{I16Vec2, i16vec2}; +use std::io::Result; + +fn main() -> Result<()> { + bitstream_filter_main::() +} + +struct Dec { + res: I16Vec2, +} +impl BitstreamFilter for Dec { + const INPUT_CODEC_ID: &str = "V_VCEMTREE"; + const OUTPUT_CODEC_ID: &str = "V_UNCOMPRESSED"; + + fn new(width: u32, height: u32) -> Self { + Self { + res: i16vec2(width as i16, height as i16), + } + } + fn process_block(&mut self, a: Vec) -> Vec { + a + } +} diff --git a/mtree-test/src/bin/encode.rs b/mtree-test/src/bin/encode.rs new file mode 100644 index 0000000..f85e4c0 --- /dev/null +++ b/mtree-test/src/bin/encode.rs @@ -0,0 +1,24 @@ +use framework::{BitstreamFilter, bitstream_filter_main}; +use glam::{I16Vec2, i16vec2}; +use std::io::Result; + +fn main() -> Result<()> { + bitstream_filter_main::() +} + +struct Enc { + res: I16Vec2, +} +impl BitstreamFilter for Enc { + const INPUT_CODEC_ID: &str = "V_UNCOMPRESSED"; + const OUTPUT_CODEC_ID: &str = "V_VCEMTREE"; + + fn new(width: u32, height: u32) -> Self { + Self { + res: i16vec2(width as i16, height as i16), + } + } + fn process_block(&mut self, a: Vec) -> Vec { + a + } +} -- cgit v1.2.3-70-g09d2