nx_vtransform_dct2.nx
buildroot/runtime/nx_vtransform_dct2.nx
about
nx_vtransform_dct2.nx -- ROYALTY-FREE integer DCT-II (4x4) for the sovereign video codec.
PATENT-CLEAN BY PROVENANCE: the literal Ahmed-Natarajan-Rao 1974 DCT-II basis cos((2n+1)*k*pi/8), evaluated
at scale 64 and rounded to integers -> matrix M, with UNIFORM scalar quantization. This is NOT H.264/AVC's
specific integer core ([1,1,1,1; 2,1,-1,-2; 1,-1,-1,1; 1,-2,2,-1]) and NOT its position-dependent Mf/Vi quant
tables (those are the AVC patent-pool technique), and NOT HEVC's 32x32-derived matrices. The DCT *itself* is
1974 prior art -- CITED to the sovereign-fetched source knowledge/fetched/dct_provenance.raw ("Nasir Ahmed
... in 1972 ... Natarajan ... Rao ... 1974"). Better energy compaction than Walsh-Hadamard on natural images
-> recovers the DCT RD win cleanly. Shape-compatible with nx_vtransform: vt2_fwd / vt2_inv / vt2_quant /
vt2_dequant operate on a 4x4 i64 block (row-major, 16 elements).
license_tier: ORIGINAL
dependencies 1 imports · 4 importers
imports: nx_syscalls.nx
imported by: nx_rangecoder_gain_gate.nxnx_vcodec.nxnx_vcodec_mrbits_gate.nxnx_vcodec_tsize_rd_gate.nx
structs
| none |
consts
| 20 | const DCT2_QSHIFT: i64 = 10 // q<<10: aligns the quant step with the WHT path's raw scale (DCT 2D fwd |
| 23 | const DCT2_ISHIFT: i64 = 24 // inverse final descale (2D round-trip ~= 4096^2 = 2^24) |
| 24 | const DCT2_IROUND: i64 = 8388608 // 1<<23, symmetric rounding for the inverse descale |
| 76 | const VC_QOFF_24: i64 = 10 |
functions
| 27 | func vt2_1d_fwd(b: *i64, base: i64, st: i64) -> i64 called by 1: vt2_fwd |
| 39 | func vt2_1d_inv(b: *i64, base: i64, st: i64) -> i64 called by 1: vt2_inv |
| 50 | func vt2_fwd(blk: *i64) -> i64 called by 11: mainvc_enc_sub_at_tfvc_enc_sub_rcvc_enc_sub_sigvc_rd_t8_intermain+5 calls 1: vt2_1d_fwd |
| 57 | func vt2_inv(blk: *i64) -> i64 called by 8: vc_enc_sub_at_tfvc_dec_sub_at_tfvc_enc_sub_rcvc_dec_sub_rcvc_enc_sub_sigvc_dec_sub_sig+2 calls 1: vt2_1d_inv |
| 78 | func vt2_quant(blk: *i64, q: i64) -> i64 |
| 93 | func vt2_dequant(blk: *i64, q: i64) -> i64 |