code wiki / (root) / nx_hevc_recon.nx

nx_hevc_recon.nx

buildroot/runtime/nx_hevc_recon.nx

5071 B70 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic hevc
docsdependenciesstructsconstsfunctions

about

nx_hevc_recon.nx -- SOVEREIGN HEVC reconstruction + frame output, RUNG 6a of the HEVC decoder. reconstruct_block(): recon = clip(pred + residual) stored into a strided frame buffer (8.6.5). write_pgm(): dump the luma plane as a viewable P5 PGM (10-bit -> 8-bit). This is the "see the frame" mechanism; R6b wires the real decoded intra modes + IDCT residuals (R4/R5, already verified) into it. Self-test: a DC block and a Planar-gradient block reconstruct + write to a PGM whose samples match hand-computed values. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_hevc_recon.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap predict_dc ilog2 reconstruct_block clip3 predict_planar ilog2 ↻ write_pgm sys_openat_wr sys_mmap ↻ sys_write sys_close pe sys_write ↻ pn sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

8func pe(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return sys_write(1,s,n) }
called by 1: main calls 1: sys_write
9func pn(v: i64) -> i64 { var m: i64=v; if m<0{m=0-m} let b: *u8=sys_mmap(32); var i: i64=32; if m==0{i=i-1;b[i]=(48 as u8)} while m>0{let q: i64=m/10; i=i-1; b[i]=((48+(m-q*10)) as u8); m=q} if v<0{i=i-1;b[i]=(45 as u8)} return sys_write(1,((b as i64)+i) as *u8,32-i) }
called by 1: main calls 2: sys_mmapsys_write
10func clip3(lo: i64, hi: i64, v: i64) -> i64 { if v<lo {return lo} if v>hi {return hi} return v }
called by 1: reconstruct_block
11func ilog2(n: i64) -> i64 { var l: i64=0; var v: i64=n; while v>1 {v=v>>1; l=l+1} return l }
14func predict_planar(pred: *i64, N: i64, refL: *i64, refT: *i64, refTR: i64, refBL: i64) -> i64
called by 1: main calls 1: ilog2
20func predict_dc(pred: *i64, N: i64, refL: *i64, refT: *i64) -> i64
called by 1: main calls 1: ilog2
26func reconstruct_block(frame: *i64, stride: i64, x0: i64, y0: i64, N: i64, pred: *i64, res: *i64) -> i64
called by 1: main calls 1: clip3
32func write_pgm(frame: *i64, w: i64, h: i64, path: *u8) -> i64
47func main(argc: i64, argv: *i64) -> i64