nx_hevc_pred.nx
buildroot/runtime/nx_hevc_pred.nx
about
nx_hevc_pred.nx -- SOVEREIGN HEVC intra prediction, RUNG 4a of the HEVC decoder (Planar + DC).
Given reference samples (reconstructed left column + top row + corners), produce the NxN predicted block
per H.265 8.4.4.2.4 (Planar) and 8.4.4.2.5 (DC, with the luma edge filter). Angular (modes 2-34) = R4b.
Self-test: flat refs -> flat pred; a top gradient -> Planar interpolates. No third party. 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
| 7 | func pe(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return sys_write(1,s,n) } |
| 8 | 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) } |
| 9 | func ilog2(n: i64) -> i64 { var l: i64=0; var v: i64=n; while v>1 {v=v>>1; l=l+1} return l } |
| 13 | func predict_planar(pred: *i64, N: i64, refL: *i64, refT: *i64, refTR: i64, refBL: i64) -> i64 |
| 22 | func predict_dc(pred: *i64, N: i64, refL: *i64, refT: *i64, cIdx: i64) -> i64 |
| 37 | func predict_angular(pred: *i64, N: i64, mode: i64, refL: *i64, refT: *i64, corner: i64, angT: *i64, invT: *i64) -> i64 |
| 57 | func parse_nums(s: *u8, out: *i64) -> i64 { var n: i64=0; var i: i64=0; var cur: i64=0; var neg: i64=0; var has: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c==45 {neg=1} else { if c>=48 { if c<=57 {cur=cur*10+(c-48); has=1} else { if has==1{ if neg==1{out[n]=0-cur}else{out[n]=cur} n=n+1; cur=0; has=0; neg=0} } } else { if has==1{ if neg==1{out[n]=0-cur}else{out[n]=cur} n=n+1; cur=0; has=0; neg=0} } } i=i+1 } if has==1{ if neg==1{out[n]=0-cur}else{out[n]=cur} n=n+1} return n } called by 1: main |
| 59 | func main(argc: i64, argv: *i64) -> i64 |