pub struct SearchContext<'a> {
pub src: &'a [u8],
pub src_stride: usize,
pub ref_frame: &'a [u8],
pub ref_stride: usize,
pub block_size: BlockSize,
pub block_x: usize,
pub block_y: usize,
pub ref_width: usize,
pub ref_height: usize,
}Expand description
Search context containing frame data and configuration.
Fields§
§src: &'a [u8]Source block data.
src_stride: usizeSource stride.
ref_frame: &'a [u8]Reference frame data.
ref_stride: usizeReference stride.
block_size: BlockSizeBlock size.
block_x: usizeBlock position X in source.
block_y: usizeBlock position Y in source.
ref_width: usizeReference frame width.
ref_height: usizeReference frame height.
Implementations§
Source§impl<'a> SearchContext<'a>
impl<'a> SearchContext<'a>
Sourcepub const fn new(
src: &'a [u8],
src_stride: usize,
ref_frame: &'a [u8],
ref_stride: usize,
block_size: BlockSize,
block_x: usize,
block_y: usize,
ref_width: usize,
ref_height: usize,
) -> Self
pub const fn new( src: &'a [u8], src_stride: usize, ref_frame: &'a [u8], ref_stride: usize, block_size: BlockSize, block_x: usize, block_y: usize, ref_width: usize, ref_height: usize, ) -> Self
Creates a new search context.
Sourcepub const fn src_offset(&self) -> usize
pub const fn src_offset(&self) -> usize
Returns the source block offset.
Sourcepub fn calculate_sad(&self, mv: &MotionVector) -> Option<u32>
pub fn calculate_sad(&self, mv: &MotionVector) -> Option<u32>
Calculates SAD for a given motion vector.
Sourcepub fn is_valid_mv(&self, mv: &MotionVector, range: &SearchRange) -> bool
pub fn is_valid_mv(&self, mv: &MotionVector, range: &SearchRange) -> bool
Checks if a motion vector is within valid bounds.
Auto Trait Implementations§
impl<'a> Freeze for SearchContext<'a>
impl<'a> RefUnwindSafe for SearchContext<'a>
impl<'a> Send for SearchContext<'a>
impl<'a> Sync for SearchContext<'a>
impl<'a> Unpin for SearchContext<'a>
impl<'a> UnsafeUnpin for SearchContext<'a>
impl<'a> UnwindSafe for SearchContext<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more