code wiki / (root) / nx_uxf_ebml_test.nx

nx_uxf_ebml_test.nx

buildroot/runtime/nx_uxf_ebml_test.nx

5253 B98 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic uxf
docsdependenciesstructsconstsfunctions

about

nx_uxf_ebml_test.nx -- UXF arc #2 (real remux), rung 2: the EBML/Matroska parser primitive -- the INPUT side of an MKV->MP4 remux. MKV is an EBML document: a tree of elements [element-ID (vint, marker KEPT)][size (vint, marker STRIPPED)][data]. A vint's first byte encodes its length: leading-zero count + 1 (the first 1-bit is the marker). This builds vint length + ID read + size read, and KAT-proves them on the real EBML magic header (0x1A45DFA3) + a size vint, plus a malformed-vint neg-control. HONEST SCOPE: this is the EBML element primitive (read IDs/sizes -> walk MKV structure). Mapping MKV tracks/codec-private/SimpleBlock frames into MP4 sample tables (the actual rewrap) is the next rung. No hardware writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_uxf_ebml_test.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 e_puts sys_write sys_mmap ebml_vint_len ebml_read_id ebml_vint_len ↻ e_putn sys_mmap ↻ sys_write ↻ ebml_read_size ebml_vint_len ↻ sys_exit

structs

none

consts

none

functions

13func e_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
14func e_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m; sys_write(1, "-" as *u8, 1) } let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 } sys_write(1, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
17func ebml_vint_len(b: i64) -> i64
30func ebml_read_id(buf: *u8, pos: *i64) -> i64
called by 1: main calls 1: ebml_vint_len
42func ebml_read_size(buf: *u8, pos: *i64) -> i64
called by 1: main calls 1: ebml_vint_len
53func main() -> i64