From 306f96164784a8cbf405e72fa4364d6523366e95 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 5 May 2025 15:09:54 +0200 Subject: old dir --- evc/src/codec/decode.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 evc/src/codec/decode.rs (limited to 'evc/src/codec/decode.rs') diff --git a/evc/src/codec/decode.rs b/evc/src/codec/decode.rs deleted file mode 100644 index c042278..0000000 --- a/evc/src/codec/decode.rs +++ /dev/null @@ -1,34 +0,0 @@ -use super::compress::lit_decompress; -use crate::{block::Block, frame::Frame, refsampler::Sampler, view::View}; - -pub struct DecodeConfig {} - -pub fn decode_block( - block: &Block, - mut target: View<&mut Frame>, - prev: View<&Frame>, - config: &DecodeConfig, -) { - match &block { - Block::Literal(pixels) => target.set_pixels(pixels), - Block::Split(box [a, b]) => { - let [a, b] = unsafe { std::mem::transmute::<_, [&'static Block; 2]>([a, b]) }; - let [at, bt] = unsafe { - std::mem::transmute::<_, [View<&'static mut Frame>; 2]>(target.split_mut_unsafe()) - }; - let [ap, bp] = - unsafe { std::mem::transmute::<_, [View<&'static Frame>; 2]>(prev.split()) }; - let config = unsafe { std::mem::transmute::<_, &'static DecodeConfig>(config) }; - - rayon::join( - move || decode_block(a, at, ap, config), - move || decode_block(b, bt, bp, config), - ); - } - Block::CompressedLiteral(data) => { - lit_decompress(&data, target); - } - Block::Reference { translation } => target.copy_from(&prev.offset(*translation)), - Block::AdvancedReference(r) => target.copy_from_sampler(&Sampler::from_refblock(prev, r)), - } -} -- cgit v1.2.3-70-g09d2