code wiki / _hdl_build / nx_vcodec_entcost_probe.nx
nx_vcodec_entcost_probe.nx
buildroot/runtime/_hdl_build/nx_vcodec_entcost_probe.nx
about
nx_vcodec_entcost_probe.nx -- ENTROPY-EFFICIENCY AUDIT (seq1105, the 2.9x direction question):
is the residual coder spending materially more bits than its own coefficients' entropy floor?
For each P-frame MB of a real 2593-chain encode (same refs the encoder used), take the encoder's
deterministic (mv,qpel) choice, form the residual, 4x4-transform+quant (the shipped tf=1 path),
then measure: bits_rc = rc_sig_cost_q8 (the shipping coder's own cost) vs H0 = the static
per-zigzag-position level-entropy floor of the WHOLE collected coefficient field.
bits_rc / H0 <= ~1.15 => the coder is fine, the gap is UPSTREAM (prediction/transform quality);
bits_rc / H0 >= ~1.3 => context/entropy depth is the rung.
No float: entropy accumulated in millibits via a log2 lookup on p in permille. license: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_video_codec_wasm.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
| 12 | const K_MAGIC_20000: i64 = 20000 |
| 13 | const K_MAGIC_2026: i64 = 2026 |
| 14 | const K_MAGIC_4194304: i64 = 4194304 |
| 15 | const K_MAGIC_8192: i64 = 8192 |
| 16 | const K_MAGIC_65536: i64 = 65536 |
| 17 | const K_MAGIC_4096: i64 = 4096 |
| 18 | const K_MAGIC_2593: i64 = 2593 |
| 19 | const K_MAGIC_500000: i64 = 500000 |
| 21 | const SW: i64 = 352 |
| 22 | const SH: i64 = 288 |
| 23 | const NF: i64 = 16 |
| 24 | const QP: i64 = 16 |
| 25 | const PMUL: i64 = 94 |
| 26 | const KEYMUL: i64 = 188 |
functions
| 28 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 29 | func gn(v: i64) -> i64 |
| 33 | func cpb(d: *u8, s: *u8, n: i64) -> i64 { var i: i64=0; while i<n { d[i]=s[i]; i=i+1 } return 0 } called by 1: main |
| 34 | func frames(yuv: *u8, hi: i64, total: i64, fp: *i64, fdata: i64) -> i64 called by 1: main |
| 43 | func mb_log2(num: i64, den: i64) -> i64 called by 1: main |
| 55 | func main(argc: i64, argv: *i64) -> i64 |