pub struct IntraPredContext { /* private fields */ }Expand description
Intra prediction context.
Holds neighbor samples and availability information for intra prediction.
Implementations§
Source§impl IntraPredContext
impl IntraPredContext
Sourcepub fn new(width: usize, height: usize, bit_depth: BitDepth) -> Self
pub fn new(width: usize, height: usize, bit_depth: BitDepth) -> Self
Create a new prediction context.
Sourcepub fn with_availability(
width: usize,
height: usize,
bit_depth: BitDepth,
availability: NeighborAvailability,
) -> Self
pub fn with_availability( width: usize, height: usize, bit_depth: BitDepth, availability: NeighborAvailability, ) -> Self
Create with specific neighbor availability.
Sourcepub const fn has_top_left(&self) -> bool
pub const fn has_top_left(&self) -> bool
Check if top-left neighbor is available.
Sourcepub const fn availability(&self) -> NeighborAvailability
pub const fn availability(&self) -> NeighborAvailability
Get neighbor availability.
Sourcepub fn set_availability(&mut self, has_top: bool, has_left: bool)
pub fn set_availability(&mut self, has_top: bool, has_left: bool)
Set neighbor availability.
Sourcepub fn set_full_availability(&mut self, availability: NeighborAvailability)
pub fn set_full_availability(&mut self, availability: NeighborAvailability)
Set full neighbor availability.
Sourcepub fn top_samples(&self) -> &[u16]
pub fn top_samples(&self) -> &[u16]
Get top samples slice.
Sourcepub fn left_samples(&self) -> &[u16]
pub fn left_samples(&self) -> &[u16]
Get left samples slice.
Sourcepub fn extended_top_samples(&self) -> &[u16]
pub fn extended_top_samples(&self) -> &[u16]
Get extended top samples (including top-right).
Sourcepub fn extended_left_samples(&self) -> &[u16]
pub fn extended_left_samples(&self) -> &[u16]
Get extended left samples (including bottom-left).
Sourcepub const fn top_left_sample(&self) -> u16
pub const fn top_left_sample(&self) -> u16
Get top-left sample.
Sourcepub fn set_top_sample(&mut self, idx: usize, value: u16)
pub fn set_top_sample(&mut self, idx: usize, value: u16)
Set a top sample.
Sourcepub fn set_left_sample(&mut self, idx: usize, value: u16)
pub fn set_left_sample(&mut self, idx: usize, value: u16)
Set a left sample.
Sourcepub fn set_top_left_sample(&mut self, value: u16)
pub fn set_top_left_sample(&mut self, value: u16)
Set top-left sample.
Sourcepub fn set_top_samples(&mut self, samples: &[u16])
pub fn set_top_samples(&mut self, samples: &[u16])
Set all top samples from a slice.
Sourcepub fn set_left_samples(&mut self, samples: &[u16])
pub fn set_left_samples(&mut self, samples: &[u16])
Set all left samples from a slice.
Sourcepub fn filter_top_samples<F>(&mut self, filter: F)
pub fn filter_top_samples<F>(&mut self, filter: F)
Apply a filter function to top samples.
Sourcepub fn filter_left_samples<F>(&mut self, filter: F)
pub fn filter_left_samples<F>(&mut self, filter: F)
Apply a filter function to left samples.
Sourcepub fn reconstruct_neighbors(
&mut self,
frame: &[u16],
frame_stride: usize,
block_x: usize,
block_y: usize,
frame_width: usize,
frame_height: usize,
)
pub fn reconstruct_neighbors( &mut self, frame: &[u16], frame_stride: usize, block_x: usize, block_y: usize, frame_width: usize, frame_height: usize, )
Reconstruct neighbors from a frame buffer.
§Arguments
frame- Frame sample bufferframe_stride- Frame row strideblock_x- Block X position in samplesblock_y- Block Y position in samplesframe_width- Frame width in samplesframe_height- Frame height in samples
Sourcepub const fn is_at_frame_edge(&self) -> bool
pub const fn is_at_frame_edge(&self) -> bool
Check if the block is at the frame edge.
Fill unavailable samples with the midpoint value.
Sourcepub fn get_extended_sample(&self, x: i32, y: i32) -> u16
pub fn get_extended_sample(&self, x: i32, y: i32) -> u16
Get a sample at an extended position (can be negative for top-left region).
Trait Implementations§
Source§impl Clone for IntraPredContext
impl Clone for IntraPredContext
Source§fn clone(&self) -> IntraPredContext
fn clone(&self) -> IntraPredContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntraPredContext
impl Debug for IntraPredContext
Auto Trait Implementations§
impl Freeze for IntraPredContext
impl RefUnwindSafe for IntraPredContext
impl Send for IntraPredContext
impl Sync for IntraPredContext
impl Unpin for IntraPredContext
impl UnsafeUnpin for IntraPredContext
impl UnwindSafe for IntraPredContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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