code wiki / (root) / nx_h264_fdct.nx

nx_h264_fdct.nx

buildroot/runtime/nx_h264_fdct.nx

4347 B97 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic h264
docsdependenciesstructsconstsfunctions

about

nx_h264_fdct.nx -- H.264 FORWARD 4x4 integer transform + forward quantization (the ENCODE counterpart of the existing decode-side nx_h264_idct + nx_h264_dequant). This is the core rung of the sovereign H.264 ENCODER (R6, for HEVC->H.264 transcode): residual -> coefficients -> quantized levels, validated by round-tripping back through the proven inverse pieces. The core transform Cf (rows then cols): [1 1 1 1; 2 1 -1 -2; 1 -1 -1 1; 1 -2 2 -1], in butterfly form (no floats). Forward quant uses the standard MF[qp%6][posClass] multiplier matrix + dead-zone f, matching the inverse normAdjust/V table so the pair round-trips. Reuses nx_dq_posclass for the position class (DRY, identical to the dequant). ITU-T H.264 transform is public -> patent-clean for the integer math. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_h264_dequant.nx nx_h264_fdct.nx nx_h264_fdct_gate.nx

imports: nx_syscalls.nxnx_h264_dequant.nx

imported by: nx_h264_fdct_gate.nx

structs

none

consts

11const K_MAGIC_13107: i64 = 13107
12const K_MAGIC_5243: i64 = 5243
13const K_MAGIC_8066: i64 = 8066
14const K_MAGIC_11916: i64 = 11916
15const K_MAGIC_4660: i64 = 4660
16const K_MAGIC_7490: i64 = 7490
17const K_MAGIC_10082: i64 = 10082
18const K_MAGIC_4194: i64 = 4194
19const K_MAGIC_6554: i64 = 6554
20const K_MAGIC_9362: i64 = 9362
21const K_MAGIC_3647: i64 = 3647
22const K_MAGIC_5825: i64 = 5825
23const K_MAGIC_8192: i64 = 8192
24const K_MAGIC_3355: i64 = 3355
25const K_MAGIC_7282: i64 = 7282
26const K_MAGIC_2893: i64 = 2893
27const K_MAGIC_4559: i64 = 4559

functions

30func nx_h264_fdct4x4(d: *i64) -> i64
called by 2: rtmain calls 1: sys_mmap
50func nx_h264_fq_mf(m: i64, pc: i64) -> i64
called by 1: nx_h264_fquant4x4 calls 1: sys_mmap
63func nx_h264_fquant4x4(c: *i64, qp: i64, out: *i64) -> i64
called by 1: rt calls 2: nx_dq_posclassnx_h264_fq_mf
88func nx_h264_fwd_zigzag4x4(raster: *i64, scan: *i64) -> i64
called by 1: main calls 1: sys_mmap