Commit 992e07ff authored by Romain Vimont's avatar Romain Vimont Committed by Thomas Daede

Expose superblock size on FrameInvariants

Add convenience methods to get the actual superblock size.
parent 61f3cdb7
......@@ -383,6 +383,16 @@ impl Sequence {
second_forward_idx >= 0
}
}
#[inline(always)]
pub fn sb_size_log2(&self) -> usize {
if self.use_128x128_superblock { 7 } else { 6 }
}
#[inline(always)]
pub fn sb_size(&self) -> usize {
1 << self.sb_size_log2()
}
}
#[derive(Debug)]
......@@ -836,6 +846,16 @@ impl<T: Pixel> FrameInvariants<T> {
qps.lambda * ((1 << (2 * (self.sequence.bit_depth - 8))) as f64);
self.me_lambda = self.lambda.sqrt();
}
#[inline(always)]
pub fn sb_size_log2(&self) -> usize {
self.sequence.sb_size_log2()
}
#[inline(always)]
pub fn sb_size(&self) -> usize {
self.sequence.sb_size()
}
}
impl<T: Pixel> fmt::Display for FrameInvariants<T> {
......
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