pub struct CostMap { /* private fields */ }Expand description
Per-coefficient embedding costs for one image component.
Stored in the same block-raster order as DctGrid: block index * 64 + row * 8 + col.
DC positions (index % 64 == 0) always have WET_COST.
Uses f32 storage to halve memory usage (~46 MB instead of ~93 MB for a 4032x3024 image). f32 has more than enough precision for cost ranking.
Implementations§
Source§impl CostMap
impl CostMap
pub fn new(blocks_wide: usize, blocks_tall: usize) -> Self
pub fn blocks_wide(&self) -> usize
pub fn blocks_tall(&self) -> usize
pub fn total_blocks(&self) -> usize
Auto Trait Implementations§
impl Freeze for CostMap
impl RefUnwindSafe for CostMap
impl Send for CostMap
impl Sync for CostMap
impl Unpin for CostMap
impl UnsafeUnpin for CostMap
impl UnwindSafe for CostMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more