code wiki / _hdl_build / nx_codec_real_rd2f.nx
nx_codec_real_rd2f.nx
buildroot/runtime/_hdl_build/nx_codec_real_rd2f.nx
about
nx_codec_real_rd2.nx -- the MODELED patent-free intra codec on a REAL frame's luma (576x1024), the
efficiency upgrade over nx_codec_real_rd (naive raw-coeff rANS). Per 8x8 block: level-shift -> 2D DCT
(nx_dct8, EXPIRED) -> PERCEPTUAL quant matrix (nx_qt_luma, JPEG Annex-K, EXPIRED) -> zigzag (nx_zigzag)
-> DC-differential + AC run/size SYMBOL stream (nx_jsym) separated from raw magnitude bits -> rANS the
symbols (nx_rans, PUBLIC DOMAIN); magnitude bits stored raw (near-incompressible). HONEST total =
512B rANS table + 64B quant table + 8B header + rANS(symbols) + magbits. This is exactly the modeling
nx_codec_rd2_gate MEASURED at 3.5x over naive (at block level) -- now on the real frame, swept over
JPEG quality, to RE-MEASURE vs x264. Round-trip (rANS + jsym) asserted bit-exact each quality = liar-kill.
Every tool EXPIRED/PD; no CABAC; integer-only; nx_cc->nxasm, no gcc. license_tier: ORIGINAL
dependencies 9 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_h264_bitwriter.nxnx_dct8.nxnx_quant_table.nxnx_zigzag.nxnx_jpeg_huff_enc.nxnx_jpeg_sym.nxnx_rans.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 19 | const K_MAGIC_1024: i64 = 1024 |
| 20 | const K_MAGIC_9216: i64 = 9216 |
| 21 | const K_MAGIC_4096: i64 = 4096 |
functions
| 23 | func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 28 | func g_num(v: i64) -> i64 { nxi_out(v); return 0 } |
| 29 | func g_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 34 | func g_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 35 | func iabs(v: i64) -> i64 { if v<0 { return 0-v } return v } called by 1: main |
| 36 | func qrnd(v: i64, q: i64) -> i64 { if v>=0 { return (v + q/2)/q } return 0 - (((0-v) + q/2)/q) } called by 1: main |
| 38 | func main() -> i64 |