code wiki / (root) / nx_intra_pred.nx

nx_intra_pred.nx

buildroot/runtime/nx_intra_pred.nx

3178 B68 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind librarytopic intra
docsdependenciesstructsconstsfunctions

about

nx_intra_pred.nx -- sovereign directional intra prediction for 4x4 luma blocks (DC / vertical / horizontal / diagonal-down-right), predicting from already-available neighbor samples (top row, left column, top-left corner), exactly as H.264/AVC intra-4x4 does. The codec is intra-DC-only today; this is the lever to close the measured real-content efficiency gap (RT-003 R1b). Built as a reusable lib so the codec's intra path can adopt it, and so nx_intra_pred_gate can MEASURE the residual reduction on a real frame before any core-codec change. No syscalls here.

dependencies 0 imports · 1 importers

nx_intra_pred.nx nx_intra_pred_gate.nx

imports: none

imported by: nx_intra_pred_gate.nx

structs

none

consts

7const IP_DC: i64 = 0
8const IP_V: i64 = 1
9const IP_H: i64 = 2
10const IP_DDR: i64 = 3
11const IP_NMODES: i64 = 4

functions

13func ip_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: ip_sad4
18func ip_predict4(src: *u8, W: i64, px: i64, py: i64, mode: i64, pred: *u8) -> i64
called by 2: ip_best4main
50func ip_sad4(src: *u8, W: i64, px: i64, py: i64, pred: *u8) -> i64
called by 2: ip_best4main calls 1: ip_abs
58func ip_best4(src: *u8, W: i64, px: i64, py: i64, pred: *u8, outmode: *i64) -> i64
called by 1: main calls 2: ip_predict4ip_sad4