Commit d7599d66 authored by Romain Vimont's avatar Romain Vimont Committed by Thomas Daede

Inline all TileBlocks methods

The method set_block_size() have been declared inlined after profiling.
Also inline the others setters.
parent 5a1d14ba
...@@ -154,6 +154,7 @@ impl TileBlocksMut<'_> { ...@@ -154,6 +154,7 @@ impl TileBlocksMut<'_> {
} }
} }
#[inline(always)]
pub fn for_each<F>(&mut self, bo: BlockOffset, bsize: BlockSize, f: F) pub fn for_each<F>(&mut self, bo: BlockOffset, bsize: BlockSize, f: F)
where where
F: Fn(&mut Block) -> (), F: Fn(&mut Block) -> (),
...@@ -167,6 +168,7 @@ impl TileBlocksMut<'_> { ...@@ -167,6 +168,7 @@ impl TileBlocksMut<'_> {
} }
} }
#[inline(always)]
pub fn set_mode( pub fn set_mode(
&mut self, &mut self,
bo: BlockOffset, bo: BlockOffset,
...@@ -187,6 +189,7 @@ impl TileBlocksMut<'_> { ...@@ -187,6 +189,7 @@ impl TileBlocksMut<'_> {
}); });
} }
#[inline(always)]
pub fn set_tx_size( pub fn set_tx_size(
&mut self, &mut self,
bo: BlockOffset, bo: BlockOffset,
...@@ -196,10 +199,12 @@ impl TileBlocksMut<'_> { ...@@ -196,10 +199,12 @@ impl TileBlocksMut<'_> {
self.for_each(bo, bsize, |block| block.txsize = tx_size); self.for_each(bo, bsize, |block| block.txsize = tx_size);
} }
#[inline(always)]
pub fn set_skip(&mut self, bo: BlockOffset, bsize: BlockSize, skip: bool) { pub fn set_skip(&mut self, bo: BlockOffset, bsize: BlockSize, skip: bool) {
self.for_each(bo, bsize, |block| block.skip = skip); self.for_each(bo, bsize, |block| block.skip = skip);
} }
#[inline(always)]
pub fn set_segmentation_idx( pub fn set_segmentation_idx(
&mut self, &mut self,
bo: BlockOffset, bo: BlockOffset,
...@@ -209,6 +214,7 @@ impl TileBlocksMut<'_> { ...@@ -209,6 +214,7 @@ impl TileBlocksMut<'_> {
self.for_each(bo, bsize, |block| block.segmentation_idx = idx); self.for_each(bo, bsize, |block| block.segmentation_idx = idx);
} }
#[inline(always)]
pub fn set_ref_frames( pub fn set_ref_frames(
&mut self, &mut self,
bo: BlockOffset, bo: BlockOffset,
...@@ -218,6 +224,7 @@ impl TileBlocksMut<'_> { ...@@ -218,6 +224,7 @@ impl TileBlocksMut<'_> {
self.for_each(bo, bsize, |block| block.ref_frames = r); self.for_each(bo, bsize, |block| block.ref_frames = r);
} }
#[inline(always)]
pub fn set_motion_vectors( pub fn set_motion_vectors(
&mut self, &mut self,
bo: BlockOffset, bo: BlockOffset,
...@@ -227,6 +234,7 @@ impl TileBlocksMut<'_> { ...@@ -227,6 +234,7 @@ impl TileBlocksMut<'_> {
self.for_each(bo, bsize, |block| block.mv = mvs); self.for_each(bo, bsize, |block| block.mv = mvs);
} }
#[inline(always)]
pub fn set_cdef(&mut self, sbo: SuperBlockOffset, cdef_index: u8) { pub fn set_cdef(&mut self, sbo: SuperBlockOffset, cdef_index: u8) {
let bo = sbo.block_offset(0, 0); let bo = sbo.block_offset(0, 0);
// Checkme: Is 16 still the right block unit for 128x128 superblocks? // Checkme: Is 16 still the right block unit for 128x128 superblocks?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment