code wiki / (root) / nx_video_frame.nx

nx_video_frame.nx

buildroot/runtime/nx_video_frame.nx

4466 B133 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic video
docsdependenciesstructsconstsfunctions

about

nx_video_frame.nx -- wire frame format for Nishi sovereign video. Magic "NXVD" (Nishi Video), hash-chained header just like nx_voice_frame. Carries one I-frame as a sequence of 8x8 DCT blocks. Future P-frame support will reuse the same envelope with a different flag. Wire layout (little-endian): [0..3] magic "NXVD" [4] version major (1) [5] tier hint (NX_HW_TIER_*) [6..7] width_blocks (each block is 8 pixels) [8..9] height_blocks [10] frame_kind (1 = I-frame; 2 = P-frame queued) [11] quant_step (1..64; per-frame uniform quantisation) [12..15] sequence [16..47] prev_frame_hash (32 bytes; FNV 4-lane shared with voice) [48..49] payload_bytes (= width_blocks * height_blocks * 64 * 2) [50..] payload: per block, 64 quantised coefficients as int16 LE Per-frame size for a 16x16 I-frame (2x2 blocks of 8x8): header 50 + payload 4 * 64 * 2 = 50 + 512 = 562 bytes. At 30 fps that's 16.86 kbps for 16x16 -- proof of concept. genealogy_id: nx_voice_frame_q10 + jpeg_iso_10918 + h264_iso_14496_10 + nx_dct8_q10 lineage_id: nishi_video_frame_q10

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_video_frame.nx nx_video_codec.nx

imports: nx_syscalls.nx

imported by: nx_video_codec.nx

structs

none

consts

38const NX_VID_VERDICT_UNKNOWN: i64 = 0
39const NX_VID_VERDICT_OK: i64 = 1
40const NX_VID_VERDICT_BAD_MAGIC: i64 = 2
41const NX_VID_VERDICT_VERSION_MISMATCH: i64 = 3
42const NX_VID_VERDICT_TRUNCATED: i64 = 4
43const NX_VID_VERDICT_CHAIN_BROKEN: i64 = 5
44const NX_VID_VERDICT_BAD_PARAMS: i64 = 6
45const NX_VID_VERDICT_N: i64 = 7
47const NX_VID_KIND_I: i64 = 1
48const NX_VID_KIND_P: i64 = 2
50const NX_VID_HEADER_BYTES: i64 = 50

functions

52func nx_vid_build_header(
called by 1: nx_vc_vid_encode
91func nx_vid_parse_header(
called by 1: nx_vc_vid_decode
129func nx_vid_verdict_is_valid(v: i64) -> i64