diff --git a/crates/ec-av1/src/cdf.rs b/crates/ec-av1/src/cdf.rs index 2d9bdbba..e000b24b 100644 --- a/crates/ec-av1/src/cdf.rs +++ b/crates/ec-av1/src/cdf.rs @@ -419,6 +419,16 @@ pub const PALETTE_UV_MODE: [[u16; 3]; 2] = [[32461, 32768, 0], [21488, 32768, 0] /// `default_intrabc_cdf` (entropymode.c): the `use_intrabc` flag on an /// intra frame with `allow_intrabc` set. pub const INTRABC: [u16; 3] = [30531, 32768, 0]; +/// `default_wiener_restore_cdf` (entropymode.c): a `RESTORE_WIENER`-plane +/// LR unit's own `use_wiener` flag (spec 5.11.57 `read_lr_unit`). +pub const RESTORE_WIENER: [u16; 3] = [11570, 32768, 0]; +/// `default_sgrproj_restore_cdf`: a `RESTORE_SGRPROJ`-plane LR unit's own +/// `use_sgrproj` flag. +pub const RESTORE_SGRPROJ: [u16; 3] = [16855, 32768, 0]; +/// `default_switchable_restore_cdf`: a `RESTORE_SWITCHABLE`-plane LR unit's +/// own `restoration_type` (3-way: `RESTORE_NONE`/`RESTORE_WIENER`/ +/// `RESTORE_SGRPROJ`). +pub const RESTORE_SWITCHABLE: [u16; 4] = [9413, 22581, 32768, 0]; /// `default_tx_size_cdf[0]` (entropymode.c): an 8x8 block's `tx_depth` flag /// (`TX8` vs `TX4`), indexed by `tx_size_context` (0..=2). diff --git a/crates/ec-av1/src/cdf_state.rs b/crates/ec-av1/src/cdf_state.rs index b8b0e0ca..03bc0cd5 100644 --- a/crates/ec-av1/src/cdf_state.rs +++ b/crates/ec-av1/src/cdf_state.rs @@ -433,6 +433,15 @@ pub(crate) struct Cdfs { pub palette_uv_size: [[u16; 8]; 7], /// The `use_intrabc` flag -- see [`cdf::INTRABC`]. pub intrabc: [u16; 3], + /// A `RESTORE_WIENER`-plane LR unit's `use_wiener` flag -- see + /// [`cdf::RESTORE_WIENER`]. + pub restore_wiener: [u16; 3], + /// A `RESTORE_SGRPROJ`-plane LR unit's `use_sgrproj` flag -- see + /// [`cdf::RESTORE_SGRPROJ`]. + pub restore_sgrproj: [u16; 3], + /// A `RESTORE_SWITCHABLE`-plane LR unit's `restoration_type` -- see + /// [`cdf::RESTORE_SWITCHABLE`]. + pub restore_switchable: [u16; 4], } /// One motion vector component's adapting state (spec 9.4's `Default_Mv_*`, @@ -654,6 +663,9 @@ impl Cdfs { reset2(&mut self.palette_uv_mode); reset2(&mut self.palette_uv_size); reset1(&mut self.intrabc); + reset1(&mut self.restore_wiener); + reset1(&mut self.restore_sgrproj); + reset1(&mut self.restore_switchable); } /// The defaults a key frame starts from (spec 8.4, `init_coeff_cdfs` and @@ -1114,6 +1126,9 @@ impl Cdfs { palette_uv_mode: cdf::PALETTE_UV_MODE, palette_uv_size: cdf::PALETTE_UV_SIZE, intrabc: cdf::INTRABC, + restore_wiener: cdf::RESTORE_WIENER, + restore_sgrproj: cdf::RESTORE_SGRPROJ, + restore_switchable: cdf::RESTORE_SWITCHABLE, } }