nx_hevc_recon.nx
buildroot/runtime/nx_hevc_recon.nx
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
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
structs
| none |
consts
| none |
functions
| 8 | func pe(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return sys_write(1,s,n) } |
| 9 | func 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) } |
| 10 | func 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 |
| 11 | func ilog2(n: i64) -> i64 { var l: i64=0; var v: i64=n; while v>1 {v=v>>1; l=l+1} return l } |
| 14 | func predict_planar(pred: *i64, N: i64, refL: *i64, refT: *i64, refTR: i64, refBL: i64) -> i64 |
| 20 | func predict_dc(pred: *i64, N: i64, refL: *i64, refT: *i64) -> i64 |
| 26 | func reconstruct_block(frame: *i64, stride: i64, x0: i64, y0: i64, N: i64, pred: *i64, res: *i64) -> i64 |
| 32 | func write_pgm(frame: *i64, w: i64, h: i64, path: *u8) -> i64 |
| 47 | func main(argc: i64, argv: *i64) -> i64 |