pub struct LoopFilterParams {
pub level: [u8; 4],
pub sharpness: u8,
pub delta_enabled: bool,
pub delta_update: bool,
pub ref_deltas: [i8; 8],
pub mode_deltas: [i8; 2],
}Expand description
Loop filter parameters as parsed from the frame header.
Fields§
§level: [u8; 4]Loop filter level for Y vertical edges.
sharpness: u8Sharpness level (0-7).
delta_enabled: boolDelta coding enabled.
delta_update: boolUpdate delta values.
ref_deltas: [i8; 8]Reference frame deltas.
mode_deltas: [i8; 2]Mode deltas (for ZERO_MV and MV modes).
Implementations§
Source§impl LoopFilterParams
impl LoopFilterParams
Sourcepub fn parse(
reader: &mut BitReader<'_>,
seq: &SequenceHeader,
frame_is_intra: bool,
) -> CodecResult<Self>
pub fn parse( reader: &mut BitReader<'_>, seq: &SequenceHeader, frame_is_intra: bool, ) -> CodecResult<Self>
Parse loop filter parameters from the bitstream.
§Errors
Returns error if the bitstream is malformed.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if loop filter is enabled for any plane.
Sourcepub fn get_level(&self, plane: usize, direction: usize) -> u8
pub fn get_level(&self, plane: usize, direction: usize) -> u8
Get the filter level for a specific plane and direction.
§Arguments
plane- Plane index (0=Y, 1=U, 2=V)direction- 0 for vertical, 1 for horizontal
Sourcepub fn compute_level(
&self,
base_level: u8,
ref_frame: usize,
mode: usize,
segment_delta: i16,
) -> u8
pub fn compute_level( &self, base_level: u8, ref_frame: usize, mode: usize, segment_delta: i16, ) -> u8
Compute the filter level for a block.
This applies delta adjustments based on reference frame and mode.
§Arguments
base_level- Base filter level from frame headerref_frame- Reference frame index (0 for intra)mode- Mode index (0 for ZEROMV, 1 for other MV modes)segment_delta- Delta from segmentation
Sourcepub fn get_limit(&self, level: u8) -> u8
pub fn get_limit(&self, level: u8) -> u8
Get the limit value for the filter based on sharpness.
The limit determines the maximum difference for the filter to be applied.
Sourcepub fn get_threshold(&self, level: u8) -> u8
pub fn get_threshold(&self, level: u8) -> u8
Get the threshold value for the filter.
Sourcepub const fn get_hev_threshold(&self, level: u8) -> u8
pub const fn get_hev_threshold(&self, level: u8) -> u8
Get the high edge variance threshold.
Sourcepub const fn has_delta_updates(&self) -> bool
pub const fn has_delta_updates(&self) -> bool
Check if delta updates are present.
Sourcepub fn reset_deltas(&mut self)
pub fn reset_deltas(&mut self)
Reset deltas to default values.
Sourcepub fn set_level_all(&mut self, level: u8)
pub fn set_level_all(&mut self, level: u8)
Set filter level for all planes.
Trait Implementations§
Source§impl Clone for LoopFilterParams
impl Clone for LoopFilterParams
Source§fn clone(&self) -> LoopFilterParams
fn clone(&self) -> LoopFilterParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoopFilterParams
impl Debug for LoopFilterParams
Auto Trait Implementations§
impl Freeze for LoopFilterParams
impl RefUnwindSafe for LoopFilterParams
impl Send for LoopFilterParams
impl Sync for LoopFilterParams
impl Unpin for LoopFilterParams
impl UnsafeUnpin for LoopFilterParams
impl UnwindSafe for LoopFilterParams
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