code wiki / (root) / nx_av1_dct.nx

nx_av1_dct.nx

buildroot/runtime/nx_av1_dct.nx

4997 B133 linesdepth 3pulls 3 transitivereach 4 importersview sourcekind librarytopic av1
docsdependenciesstructsconstsfunctions

about

nx_av1_dct.nx -- AV1/AV2 inverse DCT butterfly networks, 4 and 8 point. The residual path's core. Built on nx_av1_txfm.nx's 12-bit cosine table and Round2, so every constant traces to one definition rather than being baked in as a magic number. ANGLE MAPPING. The classic references express these constants as cospi_N_64 = cos(N*pi/64). This table is a 256-step circle, so cos128(a) is cos(a*pi/128) and the mapping is a = 2N: cospi_16_64 -> cos128(32), cospi_8_64 -> cos128(16), cospi_24_64 -> cos128(48), cospi_4_64 -> cos128(8), cospi_28_64 -> cos128(56). Halving that factor is the obvious mistake and it produces a transform that still looks like a DCT -- the basis functions are simply at the wrong frequencies, so the image decodes blurred rather than broken. WHAT IS PROVEN HERE. The gate checks STRUCTURAL properties -- a DC-only input must give a flat output, an odd basis index must give an antisymmetric one, and the transform must be linear within rounding. These catch a mis-wired butterfly, a wrong angle and a sign error. They do NOT establish bit-exactness against libaom's reference vectors, which needs those vectors; that is a separate, later step and is not claimed. genealogy_id: av1_spec_7_13_2_inverse_dct lineage_id: nx_av1_dct_v1 license_tier: ORIGINAL

dependencies 2 imports · 4 importers

nx_syscalls.nx nx_av1_txfm.nx nx_av1_dct.nx nx_av1_adst_gate.nx nx_av1_dct_gate.nx nx_av1_txfm2d.nx nx_av1_txfm2d_gate.nx

imports: nx_syscalls.nxnx_av1_txfm.nx

imported by: nx_av1_adst_gate.nxnx_av1_dct_gate.nxnx_av1_txfm2d.nxnx_av1_txfm2d_gate.nx

structs

none

consts

29const K_MAGIC_3784: i64 = 3784
30const K_MAGIC_1567: i64 = 1567

functions

36func nx_av1_idct4(t: *i64, io: *i64) -> i64
63func nx_av1_idct8(t: *i64, io: *i64) -> i64
121func nx_av1_dct_permute(io: *i64, n_log2: i64) -> i64
called by 1: main calls 2: sys_mmapnx_av1_brev