nx_uxf_ebml_test.nx
buildroot/runtime/nx_uxf_ebml_test.nx
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
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
| 13 | func 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 } |
| 14 | func 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 } |
| 17 | func ebml_vint_len(b: i64) -> i64 |
| 30 | func ebml_read_id(buf: *u8, pos: *i64) -> i64 |
| 42 | func ebml_read_size(buf: *u8, pos: *i64) -> i64 |
| 53 | func main() -> i64 |