code wiki / (root) / nx_av1_txfm2d.nx

nx_av1_txfm2d.nx

buildroot/runtime/nx_av1_txfm2d.nx

7253 B165 linesdepth 4pulls 5 transitivereach 1 importersview sourcekind librarytopic av1
docsdependenciesstructsconstsfunctions

about

nx_av1_txfm2d.nx -- the 2-D transform-type lattice shared VERBATIM with AV2. WHY THIS ONE, AND WHY NOW. AOMedia published AV2 v1.0.0 on 2026-05-28 and announced it on 2026-06-09. The technical overview by Andrey Norkin lists what AV2 REUSES from AV1 unchanged, and the first item is: "Four primary 1-D transform types producing 16 2-D combinations" So this lattice is not AV1 work that might carry over to AV2 -- it is AV2 work, already, by the spec authors' own account. Every byte here serves both decoders. That matters because as of mid-2026 NO browser decodes AV2: not Chrome, Firefox, Edge or Safari; no shipping hardware decoder exists; dav2d is early and the reference software is not production-ready. Practical support is expected around 2028. Building the shared core now is the whole moat argument, and this module is the part of it with the least risk of being invalidated by a spec detail. THE FOUR 1-D KINDS: DCT, ADST, FLIPADST, IDTX (identity). THE 16 COMBINATIONS are exactly the 4x4 grid of (column kind, row kind), each appearing EXACTLY ONCE -- a bijection. That is the property the gate proves, and it is strong: any mis-assignment of any one of the sixteen types either duplicates a pair or leaves one uncovered, and both are caught. Naming follows AV1: the FIRST token is the COLUMN (vertical) transform and the second is the ROW (horizontal) one, so ADST_DCT means ADST down the columns and DCT across the rows. Swapping that convention decodes -- it produces a transposed-looking error that survives on symmetric content -- which is exactly why it is pinned by test rather than by comment. FLIPADST is the ADST with its output reversed. It exists because a block whose energy sits at the far edge is predicted better by a basis that ramps the other way; substituting plain ADST for it does not error, it just puts the gradient at the wrong end of the block. license_tier: ORIGINAL

dependencies 4 imports · 1 importers

nx_syscalls.nx nx_av1_txfm.nx nx_av1_dct.nx nx_av1_adst.nx nx_av1_txfm2d.nx nx_av1_txfm2d_gate.nx

imports: nx_syscalls.nxnx_av1_txfm.nxnx_av1_dct.nxnx_av1_adst.nx

imported by: nx_av1_txfm2d_gate.nx

structs

none

consts

43const NX_TX1D_DCT: i64 = 0
44const NX_TX1D_ADST: i64 = 1
45const NX_TX1D_FLIPADST: i64 = 2
46const NX_TX1D_IDTX: i64 = 3
47const NX_TX1D_N: i64 = 4
51const NX_TX2D_DCT_DCT: i64 = 0
52const NX_TX2D_ADST_DCT: i64 = 1
53const NX_TX2D_DCT_ADST: i64 = 2
54const NX_TX2D_ADST_ADST: i64 = 3
55const NX_TX2D_FLIPADST_DCT: i64 = 4
56const NX_TX2D_DCT_FLIPADST: i64 = 5
57const NX_TX2D_FLIPADST_FLIPADST: i64 = 6
58const NX_TX2D_ADST_FLIPADST: i64 = 7
59const NX_TX2D_FLIPADST_ADST: i64 = 8
60const NX_TX2D_IDTX: i64 = 9
61const NX_TX2D_V_DCT: i64 = 10
62const NX_TX2D_H_DCT: i64 = 11
63const NX_TX2D_V_ADST: i64 = 12
64const NX_TX2D_H_ADST: i64 = 13
65const NX_TX2D_V_FLIPADST: i64 = 14
66const NX_TX2D_H_FLIPADST: i64 = 15
67const NX_TX2D_N: i64 = 16
142const NX_TX_SQRT2_Q12: i64 = 5793

functions

71func nx_av1_tx2d_col_kind(t: i64) -> i64
called by 1: main
92func nx_av1_tx2d_row_kind(t: i64) -> i64
called by 1: main
117func nx_av1_iflipadst4(io: *i64) -> i64
144func nx_av1_itx_identity4(io: *i64) -> i64
called by 2: nx_av1_itx1d_4main calls 1: nx_av1_round2
159func nx_av1_itx1d_4(kind: i64, cos_table: *i64, io: *i64) -> i64