From 306f96164784a8cbf405e72fa4364d6523366e95 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 5 May 2025 15:09:54 +0200 Subject: old dir --- dhwt-codec/src/trim.rs | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 dhwt-codec/src/trim.rs (limited to 'dhwt-codec/src/trim.rs') diff --git a/dhwt-codec/src/trim.rs b/dhwt-codec/src/trim.rs deleted file mode 100644 index 85a920a..0000000 --- a/dhwt-codec/src/trim.rs +++ /dev/null @@ -1,36 +0,0 @@ -use crate::io::{Value, TWO, ZERO}; -use std::ops::{Index, IndexMut}; - -pub fn trim + IndexMut>( - size: usize, - a: &mut X, -) { - let half = size / 2; - let quarter = size / 4; - for i in 0..(size / 2 / 4) { - let hi = half + i * 4; - let qi = quarter + i * 2; - a[qi] = (a[qi + 0] + a[qi + 1]) / TWO; - a[qi + 1] = (a[hi + 0] + a[hi + 1] + a[hi + 2] + a[hi + 3]) / (TWO * TWO); - } - for i in half..size { - a[i] = ZERO; - } -} - -pub fn untrim + IndexMut>( - size: usize, - a: &mut X, -) { - let half = size / 2; - let quarter = size / 4; - for i in 0..(size / 2 / 4) { - let hi = half + i * 4; - let qi = quarter + i * 2; - a[hi + 0] = a[qi + 1]; - a[hi + 1] = a[qi + 1]; - a[hi + 2] = a[qi + 1]; - a[hi + 3] = a[qi + 1]; - a[qi + 1] = a[qi]; - } -} -- cgit v1.2.3-70-g09d2