nx_lbp_core.nx
buildroot/runtime/nx_lbp_core.nx
about
nx_lbp_core.nx -- shared SOVEREIGN LBP descriptor primitives (NO main). Hardware-up, integer-only,
weight-free. Used by nx_lbp.nx (rung-1 KAT gate) and nx_lbp_img.nx (real-image descriptor rung).
license_tier: ORIGINAL
dependencies 1 imports · 9 importers
imports: nx_syscalls.nx
imported by: nx_face_novelty.nxnx_face_novelty_gate.nxnx_lbp.nxnx_lbp_batch.nxnx_lbp_cluster.nxnx_lbp_faceindex.nxnx_lbp_grid.nxnx_lbp_img.nxnx_lbp_imgio.nx
structs
| none |
consts
| none |
functions
| 6 | func lp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 7 | func ln(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; var neg: i64=0; if m<0{neg=1;m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; if neg==1{b[0]=45;i=1}; var j: i64=0; while j<k{b[i]=t[k-1-j];i=i+1;j=j+1}; sys_write(1,b,i); return 0 } |
| 11 | func lbp_code(img: *u8, w: i64, x: i64, y: i64) -> i64 |
| 27 | func lbp_hist_region(img: *u8, w: i64, x0: i64, y0: i64, x1: i64, y1: i64, hist: *i64) -> i64 |
| 34 | func lbp_hist(img: *u8, w: i64, h: i64, hist: *i64) -> i64 { lbp_hist_region(img, w, 1, 1, w-1, h-1, hist); return 0 } |
| 37 | func chi2_range(a: *i64, b: *i64, off: i64, n: i64, scale: i64) -> i64 |
| 43 | func chi2(a: *i64, b: *i64, scale: i64) -> i64 { return chi2_range(a, b, 0, 256, scale) } |
| 45 | func zero256(p: *i64) -> i64 { var i: i64=0; while i<256 { p[i]=0; i=i+1 } return 0 } |
| 46 | func hsum(p: *i64) -> i64 { var s: i64=0; var i: i64=0; while i<256 { s=s+p[i]; i=i+1 } return s } |
| 49 | func rgb_to_gray(rgb: *u8, gray: *u8, w: i64, h: i64, nch: i64) -> i64 called by 1: load_gray |
| 62 | func gray_resize_box(src: *u8, sw: i64, sh: i64, dst: *u8, dw: i64, dh: i64) -> i64 called by 1: load_gray_fixed |
| 83 | func lbp_grid_descr(gray: *u8, w: i64, h: i64, g: i64, descr: *i64) -> i64 |
| 101 | func grid_chi2(a: *i64, b: *i64, g: i64, scale: i64) -> i64 { return chi2_range(a, b, 0, g*g*256, scale) } |
| 104 | func chi2_at(buf: *i64, i: i64, j: i64, d: i64, scale: i64) -> i64 |
| 113 | func cluster_greedy(buf: *i64, m: i64, d: i64, thresh: i64, scale: i64, assign: *i64, reps: *i64) -> i64 |