pub struct QuantizationParams {
pub base_q_idx: u8,
pub delta_q_y_dc: i8,
pub delta_q_u_dc: i8,
pub delta_q_u_ac: i8,
pub delta_q_v_dc: i8,
pub delta_q_v_ac: i8,
pub using_qmatrix: bool,
pub qm_y: u8,
pub qm_u: u8,
pub qm_v: u8,
pub delta_q_present: bool,
pub delta_q_res: u8,
}Expand description
Quantization parameters as parsed from the frame header.
Fields§
§base_q_idx: u8Base quantizer index (0-255).
delta_q_y_dc: i8Delta Q for Y DC coefficients.
delta_q_u_dc: i8Delta Q for U DC coefficients.
delta_q_u_ac: i8Delta Q for U AC coefficients.
delta_q_v_dc: i8Delta Q for V DC coefficients.
delta_q_v_ac: i8Delta Q for V AC coefficients.
using_qmatrix: boolUse quantization matrices.
qm_y: u8QM level for Y plane.
qm_u: u8QM level for U plane.
qm_v: u8QM level for V plane.
delta_q_present: boolDelta Q present in block level.
delta_q_res: u8Delta Q resolution (log2).
Implementations§
Source§impl QuantizationParams
impl QuantizationParams
Sourcepub fn parse(
reader: &mut BitReader<'_>,
seq: &SequenceHeader,
) -> CodecResult<Self>
pub fn parse( reader: &mut BitReader<'_>, seq: &SequenceHeader, ) -> CodecResult<Self>
Parse quantization parameters from the bitstream.
§Errors
Returns error if the bitstream is malformed.
Sourcepub fn y_dc_qindex(&self) -> u8
pub fn y_dc_qindex(&self) -> u8
Get the effective Q index for Y DC.
Sourcepub const fn y_ac_qindex(&self) -> u8
pub const fn y_ac_qindex(&self) -> u8
Get the effective Q index for Y AC (same as base).
Sourcepub fn u_dc_qindex(&self) -> u8
pub fn u_dc_qindex(&self) -> u8
Get the effective Q index for U DC.
Sourcepub fn u_ac_qindex(&self) -> u8
pub fn u_ac_qindex(&self) -> u8
Get the effective Q index for U AC.
Sourcepub fn v_dc_qindex(&self) -> u8
pub fn v_dc_qindex(&self) -> u8
Get the effective Q index for V DC.
Sourcepub fn v_ac_qindex(&self) -> u8
pub fn v_ac_qindex(&self) -> u8
Get the effective Q index for V AC.
Sourcepub fn get_y_dc_dequant(&self, bit_depth: u8) -> i16
pub fn get_y_dc_dequant(&self, bit_depth: u8) -> i16
Get the DC dequantizer for Y plane.
Sourcepub fn get_y_ac_dequant(&self, bit_depth: u8) -> i16
pub fn get_y_ac_dequant(&self, bit_depth: u8) -> i16
Get the AC dequantizer for Y plane.
Sourcepub fn get_u_dc_dequant(&self, bit_depth: u8) -> i16
pub fn get_u_dc_dequant(&self, bit_depth: u8) -> i16
Get the DC dequantizer for U plane.
Sourcepub fn get_u_ac_dequant(&self, bit_depth: u8) -> i16
pub fn get_u_ac_dequant(&self, bit_depth: u8) -> i16
Get the AC dequantizer for U plane.
Sourcepub fn get_v_dc_dequant(&self, bit_depth: u8) -> i16
pub fn get_v_dc_dequant(&self, bit_depth: u8) -> i16
Get the DC dequantizer for V plane.
Sourcepub fn get_v_ac_dequant(&self, bit_depth: u8) -> i16
pub fn get_v_ac_dequant(&self, bit_depth: u8) -> i16
Get the AC dequantizer for V plane.
Sourcepub fn is_lossless(&self) -> bool
pub fn is_lossless(&self) -> bool
Check if lossless mode is enabled.
Sourcepub fn has_uv_delta(&self) -> bool
pub fn has_uv_delta(&self) -> bool
Check if any UV delta is non-zero.
Sourcepub const fn get_qm_level(&self, plane: usize) -> u8
pub const fn get_qm_level(&self, plane: usize) -> u8
Get the QM level for a plane.
Sourcepub fn get_dc_quant(&self, plane: usize, bit_depth: u8) -> i16
pub fn get_dc_quant(&self, plane: usize, bit_depth: u8) -> i16
Get DC quantizer for a plane (generic method).
Sourcepub fn get_ac_quant(&self, plane: usize, bit_depth: u8) -> i16
pub fn get_ac_quant(&self, plane: usize, bit_depth: u8) -> i16
Get AC quantizer for a plane (generic method).
Trait Implementations§
Source§impl Clone for QuantizationParams
impl Clone for QuantizationParams
Source§fn clone(&self) -> QuantizationParams
fn clone(&self) -> QuantizationParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuantizationParams
impl Debug for QuantizationParams
Source§impl Default for QuantizationParams
impl Default for QuantizationParams
Source§fn default() -> QuantizationParams
fn default() -> QuantizationParams
Auto Trait Implementations§
impl Freeze for QuantizationParams
impl RefUnwindSafe for QuantizationParams
impl Send for QuantizationParams
impl Sync for QuantizationParams
impl Unpin for QuantizationParams
impl UnsafeUnpin for QuantizationParams
impl UnwindSafe for QuantizationParams
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