code wiki / _hdl_build / nx_vcodec_subpel_ceiling.nx
nx_vcodec_subpel_ceiling.nx
buildroot/runtime/_hdl_build/nx_vcodec_subpel_ceiling.nx
about
nx_vcodec_subpel_ceiling.nx -- RE-AUDIT the self-judged "6-tap sub-pel = 0" verdict (task #17) against a MEASURED
residual ceiling, decoder-transparent. The codec's sub-pel is BILINEAR (qp_pixel: a 4-neighbour weighted blend that
BLURS the reference). H.264 uses a SHARP 6-tap FIR (1,-5,20,20,-5,1)/32 that preserves high-frequency detail -> a
tighter prediction -> smaller residual -> fewer bits at identical quality. This probe isolates FILTER SHARPNESS:
for each interior 16x16 P-block, integer-search the clean prev (+/-16), then refine to HALF-pel with (a) the existing
bilinear filter and (b) a proper 6-tap filter, and sum the best SAD each way over several P-frames. If 6-tap's total
residual is materially lower, the "0" verdict was a short-bench lie (like RD-skip and wide-ME were) and the real
enc+dec+wasm build is justified. Pure measurement on CLEAN originals => no bitstream, no parity risk. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_vsubpel.nxnx_vmotion.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_2147483647: i64 = 2147483647 |
| 13 | const K_MAGIC_2026: i64 = 2026 |
| 15 | const NW: i64 = 576 |
| 16 | const NH: i64 = 1024 |
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 g2(v: i64) -> i64 { gn(v/100); gw("." as *u8); let f: i64=v%100; if f<10 { gw("0" as *u8) } gn(f); return 0 } |
| 24 | func clp(v: i64) -> i64 { if v<0 { return 0 } if v>255 { return 255 } return v } called by 1: s6_pixel |
| 27 | func s6h(prev: *u8, W: i64, x: i64, y: i64) -> i64 |
| 37 | func s6v(prev: *u8, W: i64, x: i64, y: i64) -> i64 called by 1: s6_pixel |
| 47 | func s6c(prev: *u8, W: i64, x: i64, y: i64) -> i64 |
| 57 | func s6_pixel(prev: *u8, W: i64, x: i64, y: i64, hx: i64, hy: i64) -> i64 |
| 66 | func s6_refine(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, px: i64, py: i64, T: i64) -> i64 |
| 91 | func bl_refine(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, px: i64, py: i64, T: i64) -> i64 |
| 116 | func main() -> i64 |