Skip to main content

EntropyMulTable

Struct EntropyMulTable 

Source
#[non_exhaustive]
pub struct EntropyMulTable { pub dct8: f32, pub dct4x4: f32, pub dct4x8: f32, pub identity: f32, pub dct2x2: f32, pub afv: f32, pub dct16x8: f32, pub dct16x16: f32, pub dct16x32: f32, pub dct32x32: f32, pub dct64x32: f32, pub dct64x64: f32, }
Expand description

Per-strategy raw entropy multipliers for the AC strategy cost model.

These control the relative preference for each transform type in AC strategy selection. Higher values penalize a strategy (making it less likely to be chosen); lower values favor it. The 8x8-class values are normalized by DCT8’s value before use, so DCT8 always evaluates at 1.0. Larger transforms use raw values directly.

Default values match libjxl enc_ac_strategy.cc:584 (kTransforms8x8[i].entropy_mul). Experimental values from libjxl PR #4506 (Jon Sneyers, VarDCT cost tuning).

#[non_exhaustive] so future libjxl-side strategy additions can land without a breaking change. Construct via Self::reference or Self::experimental and mutate fields as needed.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§dct8: f32

DCT8 base value. All 8x8-class transforms are normalized by this. Reference: 0.8 (libjxl enc_ac_strategy.cc:357, kTransforms8x8[0].entropy_mul).

§dct4x4: f32

DCT4x4 (four 4x4 sub-blocks per 8x8 block). Reference: 1.08. Experimental: 0.88 (PR #4506, ~19% reduction). Lowering favors DCT4x4 for textured/detailed regions (screenshots, text).

§dct4x8: f32

DCT4x8 / DCT8x4 (half-block transforms for edges/detail). Reference: 0.859316 (libjxl enc_ac_strategy.cc).

§identity: f32

Identity (pixel copy, no transform). Reference: 1.0428. Experimental: 0.88 (PR #4506, ~16% reduction). Lowering favors identity blocks for flat/noisy regions.

§dct2x2: f32

DCT2x2 (2x2 Hadamard-like transform). Reference: 0.95 (libjxl enc_ac_strategy.cc).

§afv: f32

AFV (Adaptive Frequency Variable, corner DCT). Reference: 0.818. Experimental: 0.75 (PR #4506, ~8% reduction). Lowering favors AFV for edge blocks with mixed content.

§dct16x8: f32

DCT16x8 / DCT8x16 (larger transforms use raw values, not normalized by DCT8). Reference: 1.21 (libjxl enc_ac_strategy.cc).

§dct16x16: f32

DCT16x16. Reference: 1.34 (libjxl enc_ac_strategy.cc).

§dct16x32: f32

DCT16x32 / DCT32x16. Reference: 1.49 (libjxl enc_ac_strategy.cc).

§dct32x32: f32

DCT32x32. Reference: 1.48 (libjxl enc_ac_strategy.cc).

§dct64x32: f32

DCT64x32 / DCT32x64. Reference: 2.25 (libjxl enc_ac_strategy.cc).

§dct64x64: f32

DCT64x64. Reference: 2.25 (libjxl enc_ac_strategy.cc).

Implementations§

Source§

impl EntropyMulTable

Source

pub fn reference() -> Self

Default values matching libjxl enc_ac_strategy.cc:584.

Source

pub fn experimental() -> Self

Experimental values from libjxl PR #4506 (Jon Sneyers, VarDCT cost tuning).

Changes vs reference:

  • dct4x4: 1.08 → 0.88 (~19% reduction) — favor detail-preserving 4x4 sub-blocks
  • identity: 1.0428 → 0.88 (~16% reduction) — favor pixel-copy for flat regions
  • afv: 0.818 → 0.75 (~8% reduction) — favor corner DCT for edge blocks

Trait Implementations§

Source§

impl Clone for EntropyMulTable

Source§

fn clone(&self) -> EntropyMulTable

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EntropyMulTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.