#[non_exhaustive]pub enum ZeroBiasConfig {
Perceptual,
Disabled,
Custom {
luma: ([f32; 64], [f32; 64]),
cb: ([f32; 64], [f32; 64]),
cr: ([f32; 64], [f32; 64]),
},
}Expand description
Zero-bias configuration for quantization.
Zero-bias controls how coefficients are rounded toward zero during quantization. Higher multipliers mean more aggressive zeroing of small coefficients, which improves compression but may reduce quality.
The jpegli defaults are perceptually optimized and vary by:
- Quality level (blends between HQ and LQ tables based on butteraugli distance)
- Component (Y, Cb, Cr have different optimal bias values)
- Coefficient position (different DCT frequencies have different biases)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Perceptual
Use jpegli’s perceptual zero-bias tables (default). These are quality-adaptive: they blend between HQ and LQ tables based on the effective butteraugli distance.
Disabled
Disable zero-bias (all multipliers = 0, all offsets = 0). This matches standard JPEG behavior without adaptive quantization.
Custom
Custom zero-bias tables. Each component has 64 multiplier values and 64 offset values.
Trait Implementations§
Source§impl Clone for ZeroBiasConfig
impl Clone for ZeroBiasConfig
Source§fn clone(&self) -> ZeroBiasConfig
fn clone(&self) -> ZeroBiasConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ZeroBiasConfig
impl Debug for ZeroBiasConfig
Source§impl Default for ZeroBiasConfig
impl Default for ZeroBiasConfig
Source§fn default() -> ZeroBiasConfig
fn default() -> ZeroBiasConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ZeroBiasConfig
impl RefUnwindSafe for ZeroBiasConfig
impl Send for ZeroBiasConfig
impl Sync for ZeroBiasConfig
impl Unpin for ZeroBiasConfig
impl UnwindSafe for ZeroBiasConfig
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