code wiki / _hdl_build / nx_vcodec_subpel_ceil.nx
nx_vcodec_subpel_ceil.nx
buildroot/runtime/_hdl_build/nx_vcodec_subpel_ceil.nx
about
nx_vcodec_subpel_ceil.nx -- CEILING of the 6-tap sub-pel lever (the next real refinement after the magic-number
fixes). Our qp_pixel is BILINEAR; x264 uses a 6-tap [1,-5,20,20,-5,1]/32 half-pel filter. For each genuinely-
coded P-MB (non-skip, INTERIOR so the 6-tap has its +/-2..3 margin), find the best integer MV, then compare the
best fractional residual SAD under BILINEAR quarter-pel (what we do) vs 6-TAP half-pel. The reduction is the
prediction gain a 6-tap upgrade could realize (residual smaller -> fewer bits). Decides if the (vcv-bump,
bit-exact-critical) 6-tap build is worth it. Reads /tmp/seq.y4m. CIF. license: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_video_codec_wasm.nxnx_vmotion.nxnx_vsubpel.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
| 11 | const K_MAGIC_2147483647: i64 = 2147483647 |
| 12 | const K_MAGIC_2026: i64 = 2026 |
| 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 |
| 25 | func tap6(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64) -> i64 called by 1: h6 |
| 29 | func h6(prev: *u8, W: i64, x: i64, y: i64, hx: i64, hy: i64) -> i64 |
| 41 | func frames(yuv: *u8, hi: i64, total: i64, fp: *i64, fdata: i64) -> i64 called by 1: main |
| 49 | func bil_sad(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, idx: i64, idy: i64) -> i64 |
| 59 | func t6_sad(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, idx: i64, idy: i64) -> i64 |
| 69 | func main() -> i64 |