From 8dbd683068d7f87f21dcc4ed1dfdca786d82c52b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 28 Aug 2026 12:33:42 +0300 Subject: [PATCH] wip(av1): reduced_tx_set=false inter tx sets -- CDFs + inverse transforms, NOT WIRED YET Compiles clean; NOT YET reachable from any decode path (dying-words WIP, budget exhausted mid-lane -- entropy layer is done, threading is not). What this round did (root cause from r1: cdf_state.rs TxbSet::Luma16Inter/ Luma8Inter hardcode the reduced_tx_set=true 2-symbol table; a real aomenc stream with reduced_tx_set=false needs wider sets there): 1. Transcribed from /tmp/libaom-src (entropymode.c:369-403, entropymode.h: 169-185, blockd.h:1036-1122, common_data.h:149-159, av1_txfm.h:169-207, txb_common.h:32-47, aom_dsp/txfm_common.h:52-68): - av1_ext_tx_set_lookup[is_inter=1][tx_size_sqr==TX_16X16] gives, for a 16x16 inter block, EXT_TX_SET_DTT9_IDTX_1DDCT (12 symbols) -- NOT DTT4_IDTX_1DDCT as the r1 handoff guessed (right symbol count, wrong set name); for 8x8 (and 4x4) inter, EXT_TX_SET_ALL16 (16 symbols). - New cdf.rs tables INTER_TX_TYPE_SET2_16 (TX_16X16 row of default_inter_ext_tx_cdf[EXT_TX_SET_DTT9_IDTX_1DDCT]) and INTER_TX_TYPE_SET1_8 (TX_8X8 row of default_inter_ext_tx_cdf[EXT_TX_SET_ALL16]), transcribed verbatim. - New cdf_state.rs storage (inter_tx_type_16_set2, inter_tx_type_8_set1), reset1-wired (adaptation) and seeded from the new cdf.rs tables in Cdfs::new -- both join the existing reset sweep so a forwarded-CDF frame carries them too (av1-cdffwd-three-bugs class: nothing here is a new table left off the forwarding/reset map). - New TxbSet::Luma16InterSet1/Luma8InterSet1 variants + txb() match arms. 2. Coverage check (tx-class-cross-cutting class, repo memory) -- swept every libaom array indexed by tx_type/tx_set for the new TxType members this needs (FLIPADST_DCT, DCT_FLIPADST, FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, V_ADST, H_ADST, V_FLIPADST, H_FLIPADST -- 9 new variants): - transform.rs: TxType gained the 9 variants + from_symbol_set2_12 (12- symbol table, av1_ext_tx_inv[EXT_TX_SET_DTT9_IDTX_1DDCT]) + from_symbol_all16 (16-symbol, av1_ext_tx_inv[EXT_TX_SET_ALL16]). - axes(): FLIPADST reads the *same* 1D ADST kernel as ADST (common_data.h vtx_tab/htx_tab map both FLIPADST_1D and ADST_1D to the identical butterfly network) -- no new 1D transform to port, confirmed against av1_inv_txfm2d.c's inv_txfm2d_add_c (lines 234-316): the flip is pure post-processing (lr_flip reverses which column the column-pass reads, ud_flip reverses which output row the result lands in), never a different arithmetic kernel. Added TxType::flip() and rewired inverse_transform_2d_typed to read from an un-mutated `residual` buffer into a separate `out` buffer under the flip (the naive in-place version has a real RAW hazard: for side/2 columns, a flipped write at iteration j clobbers a source column iteration side-1-j will read later -- caught before it shipped, not left as a corner-cut). - decode.rs TxClass::of: V_ADST/V_FLIPADST -> Vert, H_ADST/H_FLIPADST -> Horiz (txb_common.h's tx_type_to_class table), matching V_DCT/H_DCT's existing treatment -- coefficient scan/context tables are already generic over TxClass, not TxType, so no further surface needed there. - decode.rs read_coeffs: CDF-length dispatch (already the crate's own idiom, doc'd at the read site) extended from 2-way to 4-way: 17 slots -> from_symbol_all16, 13 -> from_symbol_set2_12, 8 -> from_symbol_set1, else -> from_symbol (unchanged 2-/5-symbol sets). 3. NOT DONE (why this is WIP, not a fix): no call site actually threads reduced_tx_set into TxbSet::Luma16InterSet1/Luma8InterSet1 selection. decode_inter_frame_tile_with_cdfs (decode.rs:6197) does not even take a reduced_tx_set parameter -- the entire inter tile path hardcodes the reduced (2-symbol) inter tables today, unconditionally. Wiring needs: - reduced_tx_set: bool added to decode_inter_frame_tile/_with_cdfs (decode.rs:6147/6197) and its caller (stream.rs, frame-header reduced_tx_set bit -- already parsed for the key-frame/intra path, needs finding/threading for inter frames too). - threaded through decode_inter_block (4259) and decode_inter_block8 (5384) as a new parameter, to their four call sites (6399, 6465, 6535, 7307). - TxbSet::Luma16Inter -> Luma16InterSet1 and Luma8Inter -> Luma8InterSet1 selection gated on !reduced_tx_set at decode.rs:6484, 7326 (Luma16*) and 5746, 5940 (Luma8*) -- mirroring txbset_for's existing reduced_tx_set match, but for the inter call sites which currently have no such helper. - the pinned repro (cdfflake-stream-seed45.bin) will not go green until this wiring lands; not run this round since the desync path is still unreached. Intra ext-tx (default_intra_ext_tx_cdf) was NOT re-checked for the same hardcoding this round -- r8's comment (Luma8Set1/Luma4Set1 exist) says intra's reduced_tx_set split is already handled at 8x8/4x4, and 16x16 intra is DCT_IDTX-set-only regardless of the flag per av1_get_ext_tx_set_type (`tx_size_sqr == TX_16X16` branch skips the `use_reduced_set` check for BOTH is_inter values) -- so intra should already be correct, but this was reasoned, not re-verified against entropymode.c line by line this round. Also unaddressed (pre-existing, r1-noted gap): no Luma4Inter path exists at all in this crate -- an inter TX_4X4 transform (also EXT_TX_SET_ALL16 under reduced_tx_set=false, TX_4X4 row of the same CDF, not yet transcribed) has nowhere to decode to. Out of this round's scope. --- crates/ec-av1/src/cdf.rs | 20 ++++++ crates/ec-av1/src/cdf_state.rs | 47 ++++++++++++++ crates/ec-av1/src/decode.rs | 30 +++++---- crates/ec-av1/src/transform.rs | 115 ++++++++++++++++++++++++++++++++- 4 files changed, 198 insertions(+), 14 deletions(-) diff --git a/crates/ec-av1/src/cdf.rs b/crates/ec-av1/src/cdf.rs index 7d2245e3..f5e0a250 100644 --- a/crates/ec-av1/src/cdf.rs +++ b/crates/ec-av1/src/cdf.rs @@ -1105,6 +1105,26 @@ pub const INTER_TX_TYPE_SET3_16: [u16; 3] = [1998, 32768, 0]; /// `default_inter_ext_tx_cdf[EXT_TX_SET_DCT_IDTX][TX_8X8]`). pub const INTER_TX_TYPE_SET3_8: [u16; 3] = [4167, 32768, 0]; +/// `Default_Inter_Ext_Tx_Cdf`'s `TX_SET_INTER_2` (`EXT_TX_SET_DTT9_IDTX_1DDCT`) +/// row for `TX_16X16` (lane-cdffwd2, spec 9.4/5.11.48): the twelve-symbol +/// transform type of an `is_inter` 16x16 luma transform when `reduced_tx_set +/// == 0` -- `av1_get_ext_tx_set_type`'s `av1_ext_tx_set_lookup[1][1]`, not +/// [`INTER_TX_TYPE_SET3_16`]'s two-symbol reduced set (libaom +/// `entropymode.c` `default_inter_ext_tx_cdf[2][TX_16X16]`). +pub const INTER_TX_TYPE_SET2_16: [u16; 13] = [ + 770, 2421, 5225, 12907, 15819, 18927, 21561, 24089, 26595, 28526, 30529, 32768, 0, +]; + +/// `Default_Inter_Ext_Tx_Cdf`'s `TX_SET_INTER_1` (`EXT_TX_SET_ALL16`) row for +/// `TX_8X8` (lane-cdffwd2): the full sixteen-symbol transform type of an +/// `is_inter` 8x8 luma transform when `reduced_tx_set == 0` +/// (`av1_ext_tx_set_lookup[1][0]`, libaom `entropymode.c` +/// `default_inter_ext_tx_cdf[1][TX_8X8]`). +pub const INTER_TX_TYPE_SET1_8: [u16; 17] = [ + 1645, 2573, 4778, 5711, 7807, 8622, 10522, 15357, 17674, 20408, 22517, 25010, 27116, 28856, + 30749, 32768, 0, +]; + // The inter-frame tables below (spec 9.4) support the syntax an inter block // needs: whether it is coded as intra at all, which reference frame and // motion vector it takes when it is not. The compound-reference tables diff --git a/crates/ec-av1/src/cdf_state.rs b/crates/ec-av1/src/cdf_state.rs index 6093bfbc..f04826cd 100644 --- a/crates/ec-av1/src/cdf_state.rs +++ b/crates/ec-av1/src/cdf_state.rs @@ -37,6 +37,13 @@ pub(crate) enum TxbSet { /// reads, but its own two-symbol `tx_type` table rather than `Luma16`'s /// five-symbol, mode-indexed one. Luma16Inter, + /// [`Luma16Inter`](TxbSet::Luma16Inter)'s `reduced_tx_set: false` + /// counterpart (lane-cdffwd2, root-caused off `cdfflake-stream-seed45`): + /// the same coefficient tables, but the twelve-symbol + /// `EXT_TX_SET_DTT9_IDTX_1DDCT` `tx_type` table + /// ([`crate::cdf::INTER_TX_TYPE_SET2_16`]) rather than `Luma16Inter`'s + /// two-symbol reduced one. + Luma16InterSet1, /// The 8x8 luma transform of an intra 8x8 leaf under a straddling 16x16 /// block (lane-av1-rect). An `is_inter` leaf reads /// [`Luma8Inter`](TxbSet::Luma8Inter) instead. @@ -55,6 +62,10 @@ pub(crate) enum TxbSet { /// adapted table from the 16x16 and 32x32 sizes' own entries in the same /// set, per `entropymode.c`). Luma8Inter, + /// [`Luma8Inter`](TxbSet::Luma8Inter)'s `reduced_tx_set: false` + /// counterpart (lane-cdffwd2): the sixteen-symbol `EXT_TX_SET_ALL16` + /// `tx_type` table ([`crate::cdf::INTER_TX_TYPE_SET1_8`]). + Luma8InterSet1, /// The 4x4 luma transform of a `TxMode::Select` 8x8 leaf or 16x16 block /// whose `tx_depth` resolves all the way down (lane-av1tx4). An /// `is_inter` block has no writer path yet, so this crate has no @@ -287,6 +298,14 @@ pub(crate) struct Cdfs { /// `reduced_tx_set` (spec `TX_SET_INTER_3`, `TX_8X8` row) -- not indexed /// by mode, same as [`Self::inter_tx_type_32`] (lane-av1inter8). pub inter_tx_type_8: [u16; 3], + /// [`Self::inter_tx_type_16`]'s `reduced_tx_set: false` counterpart + /// (lane-cdffwd2): the twelve-symbol `EXT_TX_SET_DTT9_IDTX_1DDCT` row, + /// not indexed by mode. + pub inter_tx_type_16_set2: [u16; 13], + /// [`Self::inter_tx_type_8`]'s `reduced_tx_set: false` counterpart + /// (lane-cdffwd2): the sixteen-symbol `EXT_TX_SET_ALL16` row, not + /// indexed by mode. + pub inter_tx_type_8_set1: [u16; 17], /// The DC sign of a chroma coefficient, shared by both chroma sets. pub dc_sign_chroma: [[u16; 3]; 3], /// Whether an inter frame's block is coded as intra. @@ -522,6 +541,8 @@ impl Cdfs { reset1(&mut self.inter_tx_type_32); reset1(&mut self.inter_tx_type_16); reset1(&mut self.inter_tx_type_8); + reset1(&mut self.inter_tx_type_16_set2); + reset1(&mut self.inter_tx_type_8_set1); reset2(&mut self.dc_sign_chroma); reset2(&mut self.intra_inter); reset3(&mut self.single_ref); @@ -955,6 +976,8 @@ impl Cdfs { inter_tx_type_32: cdf::INTER_TX_TYPE_SET3_32, inter_tx_type_16: cdf::INTER_TX_TYPE_SET3_16, inter_tx_type_8: cdf::INTER_TX_TYPE_SET3_8, + inter_tx_type_16_set2: cdf::INTER_TX_TYPE_SET2_16, + inter_tx_type_8_set1: cdf::INTER_TX_TYPE_SET1_8, dc_sign_chroma: cdf::DC_SIGN_CHROMA, intra_inter: cdf::INTRA_INTER, single_ref: cdf::SINGLE_REF, @@ -1047,6 +1070,18 @@ impl Cdfs { tx_type: Some(self.inter_tx_type_16.as_mut_slice()), eob_pt_class1: None, }, + TxbSet::Luma16InterSet1 => TxbTables { + side: 16, + txb_skip: &mut self.txb_skip_luma_16, + eob_pt: &mut self.eob_pt_256_luma, + eob_extra: &mut self.eob_extra_luma_16, + base: &mut self.base_luma_16, + base_eob: &mut self.base_eob_luma_16, + br: &mut self.br_luma_16, + dc_sign: &mut self.dc_sign_luma, + tx_type: Some(self.inter_tx_type_16_set2.as_mut_slice()), + eob_pt_class1: None, + }, TxbSet::Luma8 => TxbTables { side: 8, txb_skip: &mut self.txb_skip_luma_8, @@ -1107,6 +1142,18 @@ impl Cdfs { tx_type: Some(self.inter_tx_type_8.as_mut_slice()), eob_pt_class1: None, }, + TxbSet::Luma8InterSet1 => TxbTables { + side: 8, + txb_skip: &mut self.txb_skip_luma_8, + eob_pt: &mut self.eob_pt_64_luma, + eob_extra: &mut self.eob_extra_luma_8, + base: &mut self.base_luma_8, + base_eob: &mut self.base_eob_luma_8, + br: &mut self.br_luma_8, + dc_sign: &mut self.dc_sign_luma, + tx_type: Some(self.inter_tx_type_8_set1.as_mut_slice()), + eob_pt_class1: Some(&mut self.eob_pt_64_luma_class1), + }, TxbSet::Chroma8 => TxbTables { side: 8, txb_skip: &mut self.txb_skip_chroma_8, diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 571adc37..49597772 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -400,8 +400,10 @@ enum TxClass { impl TxClass { fn of(tx_type: TxType) -> Self { match tx_type { - TxType::VDct => Self::Vert, - TxType::HDct => Self::Horiz, + // `TX_CLASS_VERT`/`TX_CLASS_HORIZ` (`txb_common.h`'s `tx_type_to_class`) + // key on axis alone -- FLIPADST is still ADST for this purpose. + TxType::VDct | TxType::VAdst | TxType::VFlipAdst => Self::Vert, + TxType::HDct | TxType::HAdst | TxType::HFlipAdst => Self::Horiz, _ => Self::TwoD, } } @@ -599,18 +601,24 @@ fn read_coeffs( } let mut tx_type = default_tx_type; if let Some(tx_type_cdf) = coding.tx_type.as_deref_mut() { - // The CDF row's own width names its set: 7 symbols (8 slots) is - // `TX_SET_INTRA_1`, 5 (6 slots) the reduced `TX_SET_INTRA_2` (the - // inter sets we read share set 2's symbol order). - let set1 = tx_type_cdf.len() == 8; + // The CDF row's own width names its set (lane-cdffwd2: extended + // past the original two-way intra split once wider `reduced_tx_set + // == 0` inter sets joined the table): 17 slots (16 symbols) is + // `EXT_TX_SET_ALL16`, 13 (12 symbols) `EXT_TX_SET_DTT9_IDTX_1DDCT`, + // 8 (7 symbols) `TX_SET_INTRA_1`, everything else (6 slots, 5 + // symbols) the reduced `TX_SET_INTRA_2`/`TX_SET_INTER_3` two sets + // share their symbol order with (`Tx_Type_Inter_Inv_Set3`'s two + // members are a prefix of `Tx_Type_Intra_Inv_Set2`'s five). + let len = tx_type_cdf.len(); let t = dec.symbol(tx_type_cdf); if trace { - eprintln!("TRACE tx_type value={t} set1={set1}"); + eprintln!("TRACE tx_type value={t} len={len}"); } - tx_type = if set1 { - TxType::from_symbol_set1(t) - } else { - TxType::from_symbol(t) + tx_type = match len { + 17 => TxType::from_symbol_all16(t), + 13 => TxType::from_symbol_set2_12(t), + 8 => TxType::from_symbol_set1(t), + _ => TxType::from_symbol(t), } .ok_or_else(|| unsupported(format!("a tx_type symbol outside its CDF's own set: {t}")))?; } diff --git a/crates/ec-av1/src/transform.rs b/crates/ec-av1/src/transform.rs index 7ad050ec..7c764d35 100644 --- a/crates/ec-av1/src/transform.rs +++ b/crates/ec-av1/src/transform.rs @@ -320,6 +320,31 @@ pub enum TxType { /// Identity down the column axis, DCT across the row axis /// (`H_DCT` -- `TX_SET_INTRA_1` only). HDct, + /// FLIPADST down the column axis, DCT across the row axis (lane-cdffwd2: + /// reachable once `reduced_tx_set == false`'s wider inter sets are read + /// -- `EXT_TX_SET_DTT9_IDTX_1DDCT`/`EXT_TX_SET_ALL16`). FLIPADST is the + /// same 1D ADST kernel [`AdstDct`] uses (`vtx_tab`/`htx_tab`, + /// `common_data.h`), just read/written flipped -- see [`TxType::flip`]. + FlipAdstDct, + /// DCT down the column axis, FLIPADST across the row axis. + DctFlipAdst, + /// FLIPADST on both axes. + FlipAdstFlipAdst, + /// ADST down the column axis, FLIPADST across the row axis. + AdstFlipAdst, + /// FLIPADST down the column axis, ADST across the row axis. + FlipAdstAdst, + /// ADST down the column axis, identity across the row axis (`V_ADST` -- + /// `EXT_TX_SET_ALL16` only). + VAdst, + /// Identity down the column axis, ADST across the row axis (`H_ADST`). + HAdst, + /// FLIPADST down the column axis, identity across the row axis + /// (`V_FLIPADST`). + VFlipAdst, + /// Identity down the column axis, FLIPADST across the row axis + /// (`H_FLIPADST`). + HFlipAdst, } impl TxType { @@ -353,6 +378,57 @@ impl TxType { } } + /// The inverse of `Tx_Type_Inter_Inv_Set2`'s CDF symbol order + /// (`av1_ext_tx_inv[EXT_TX_SET_DTT9_IDTX_1DDCT]`, `entropymode.h`: + /// `{9, 10, 11, 0, 1, 2, 4, 5, 3, 6, 7, 8}`) -- the twelve-type set a + /// `reduced_tx_set == 0` frame's 16x16 *inter* transform reads from + /// (`av1_get_ext_tx_set_type`'s `tx_size_sqr == TX_16X16` branch of + /// `av1_ext_tx_set_lookup[1]`). + pub fn from_symbol_set2_12(t: usize) -> Option { + match t { + 0 => Some(Self::Idtx), + 1 => Some(Self::VDct), + 2 => Some(Self::HDct), + 3 => Some(Self::DctDct), + 4 => Some(Self::AdstDct), + 5 => Some(Self::DctAdst), + 6 => Some(Self::FlipAdstDct), + 7 => Some(Self::DctFlipAdst), + 8 => Some(Self::AdstAdst), + 9 => Some(Self::FlipAdstFlipAdst), + 10 => Some(Self::AdstFlipAdst), + 11 => Some(Self::FlipAdstAdst), + _ => None, + } + } + + /// The inverse of `Tx_Type_Inter_Inv_Set1`'s CDF symbol order + /// (`av1_ext_tx_inv[EXT_TX_SET_ALL16]`, `entropymode.h`: + /// `{9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 4, 5, 3, 6, 7, 8}`) -- the full + /// sixteen-type set a `reduced_tx_set == 0` frame's 8x8 (and 4x4) inter + /// transform reads from (`av1_ext_tx_set_lookup[1][0]`). + pub fn from_symbol_all16(t: usize) -> Option { + match t { + 0 => Some(Self::Idtx), + 1 => Some(Self::VDct), + 2 => Some(Self::HDct), + 3 => Some(Self::VAdst), + 4 => Some(Self::HAdst), + 5 => Some(Self::VFlipAdst), + 6 => Some(Self::HFlipAdst), + 7 => Some(Self::DctDct), + 8 => Some(Self::AdstDct), + 9 => Some(Self::DctAdst), + 10 => Some(Self::FlipAdstDct), + 11 => Some(Self::DctFlipAdst), + 12 => Some(Self::AdstAdst), + 13 => Some(Self::FlipAdstFlipAdst), + 14 => Some(Self::AdstFlipAdst), + 15 => Some(Self::FlipAdstAdst), + _ => None, + } + } + /// `(row, col)`: the transform `inverse_transform_2d_typed`'s row pass /// (`htx_tab`, spec/libaom "horizontal") and column pass (`vtx_tab`, /// "vertical") each run. Read off libaom's `av1_inv_txfm2d.c` `vtx_tab`/ @@ -370,6 +446,29 @@ impl TxType { // `av1_inv_txfm2d.c`: V_DCT vtx=DCT htx=IDTX, H_DCT the mirror. Self::VDct => (Identity, Dct), Self::HDct => (Dct, Identity), + // FLIPADST reads the same 1D ADST kernel as ADST -- `vtx_tab`/ + // `htx_tab` (`common_data.h`) map `FLIPADST_1D` and `ADST_1D` + // to the exact same butterfly network; only [`Self::flip`] + // differs. So every FLIPADST-bearing axis below mirrors its + // plain-ADST counterpart's kernel pairing. + Self::FlipAdstDct => (Dct, Adst), + Self::DctFlipAdst => (Adst, Dct), + Self::FlipAdstFlipAdst | Self::AdstFlipAdst | Self::FlipAdstAdst => (Adst, Adst), + Self::VAdst | Self::VFlipAdst => (Identity, Adst), + Self::HAdst | Self::HFlipAdst => (Adst, Identity), + } + } + + /// `(ud_flip, lr_flip)` (`get_flip_cfg`, `av1_txfm.h`): whether the + /// column pass reads its input right-to-left and/or the finished + /// residual is written bottom-to-top. Every FLIPADST-bearing type sets + /// one or both; every other type is `(false, false)`. + fn flip(self) -> (bool, bool) { + match self { + Self::FlipAdstDct | Self::FlipAdstAdst | Self::VFlipAdst => (true, false), + Self::DctFlipAdst | Self::AdstFlipAdst | Self::HFlipAdst => (false, true), + Self::FlipAdstFlipAdst => (true, true), + _ => (false, false), } } } @@ -698,6 +797,7 @@ pub fn inverse_transform_2d_typed( let col_clamp = (usize::from(bit_depth) + 6).max(16); let mut residual = vec![0i32; side * side]; let (row_kind, col_kind) = tx_type.axes(); + let (ud_flip, lr_flip) = tx_type.flip(); let mut t = [0i32; 64]; for i in 0..side { @@ -716,16 +816,25 @@ pub fn inverse_transform_2d_typed( } } + // A FLIPADST axis reads the row-pass output right-to-left and/or writes + // its own output bottom-to-top (`inv_txfm2d_add_c`, `av1_inv_txfm2d.c` + // lines 291-314): `out` is a second buffer, not `residual` reused in + // place, because a flipped read/write pair aliases a column this same + // loop has not visited yet (column `j`'s write target under `lr_flip` + // is a column an unflipped loop would still need to read from later). + let mut out = vec![0i32; side * side]; for j in 0..side { + let src_col = if lr_flip { side - 1 - j } else { j }; for i in 0..side { - t[i] = residual[i * side + j]; + t[i] = residual[i * side + src_col]; } inverse_1d(&mut t, log2, col_clamp, col_kind); for i in 0..side { - residual[i * side + j] = round2(t[i], 4); + let dst_row = if ud_flip { side - 1 - i } else { i }; + out[dst_row * side + j] = round2(t[i], 4); } } - residual + out } /// [`inverse_transform_2d_typed`] at `DCT_DCT`, this crate's original