code wiki / _hdl_build / nx_vcodec_compound_ceil.nx
nx_vcodec_compound_ceil.nx
buildroot/runtime/_hdl_build/nx_vcodec_compound_ceil.nx
about
nx_vcodec_compound_ceil.nx -- GEN-2 RUNG-0 PROBE P0a: compound-from-past AVERAGING ceiling (SAD domain).
Question: on P-frames, does predicting a coded MB as the AVERAGE of two motion-compensated PAST references
(latency-safe: no future frame) beat the single-ref prediction we ship? Compound averaging cancels independent
quant noise between refs (up to ~sqrt(2) on static) and covers occlusion flips -- multi-ref SELECTION measured
only 1.5%, but AVERAGING is unmeasured and is gen-2's biggest open lever. Method: build the recon chain with
the REAL shipped encoder (vv_enc_rct8, emode 681); per coded (non-skip-threshold) MB, compare full-pel ME SAD:
single = vm_search vs prev1; compound = avg(MC(prev1,mv1), MC(prev2,mv2)) with mv2 = vm_search vs prev2.
Both arms full-pel (equal granularity = fair relative). Reports total SADs + the per-mille cut + the share of
MBs where compound wins. ⚠SAD->bits is SUBLINEAR (measured: an 18% SAD cut -> 3.7% bits at qp8) -- read the
result as an UPPER-bound direction gate for building compound syntax, not as BD-rate. 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
| 14 | const SW: i64 = 352 |
| 15 | const SH: i64 = 288 |
| 16 | const NF: i64 = 48 |
functions
| 18 | 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 } |
| 19 | func gn(v: i64) -> i64 |
| 23 | 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: runv |
| 25 | func frames(yuv: *u8, hi: i64, total: i64, fp: *i64, fdata: i64) -> i64 called by 1: main |
| 33 | func sad_avg2(cur: *u8, r1: *u8, r2: *u8, W: i64, cx: i64, cy: i64, m1x: i64, m1y: i64, m2x: i64, m2y: i64) -> i64 called by 1: runv |
| 48 | func runv(fp: *i64, qp: i64, sz: i64, out: *i64) -> i64 |
| 92 | func sweepqp(fp: *i64, sz: i64, qp: i64) -> i64 |
| 104 | func main() -> i64 |