code wiki / (root) / nx_vcodec_wasm.nx

nx_vcodec_wasm.nx

buildroot/runtime/nx_vcodec_wasm.nx

2695 B34 linesdepth 5pulls 14 transitivereach 0 importersview sourcekind tooltopic vcodec
docsdependenciesstructsconstsfunctions

about

nx_vcodec_wasm.nx -- the BROWSER entry wrapper for the sovereign video codec (nx_vcodec). Same wasm memory model as nx_wasmvoxel/nx_wasmcube: fixed linear-memory offsets (the codec's "caller-owned scratch" become wasm offsets), a handful of exported entry/accessor funcs, main()=0. This wrapper drives the TRANSMITTABLE PACKED codec -- the path the gates prove and the daemon relays -- so the in-browser demo exercises the real encode->stream->INDEPENDENT-decode (with directional intra prediction + the sovereign H.264 integer DCT), not just an encoder-side reconstruction. JS only ferries raw bytes + blits to <canvas>; ALL codec logic is sovereign nx compiled nx_compile_wat -> nx_wat_compiler -> .wasm. Frame cap 128x128 this rung. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_vcodec.nx nx_vcodec_wasm.nx

imports: nx_vcodec.nx

imported by: nobody (leaf or entry point)

structs

none

consts

10const O_CUR: i64 = 0 // current frame, 8bpp luma (up to 128*128 = 16384 B)
11const O_PREV: i64 = 16384 // previous reconstructed reference (unused for a keyframe)
12const O_ENC_RECON: i64 = 32768 // encoder-side reconstruction
13const O_DEC_RECON: i64 = 49152 // INDEPENDENT decoder reconstruction (what the far side sees)
14const O_STREAM: i64 = 65536 // the transmittable bitstream (up to 65536 B)
15const O_BLK: i64 = 131072 // 16 i64 transform scratch
16const O_MV: i64 = 131200 // 2 i64 motion vector

functions

20func vc_wasm_encode(W: i64, H: i64, qp: i64, keyframe: i64, sad_thresh: i64) -> i64
25func vc_wasm_decode(W: i64, H: i64, qp: i64) -> i64
29func vc_cur_off() -> i64 { return O_CUR }
30func vc_prev_off() -> i64 { return O_PREV }
31func vc_enc_recon_off() -> i64 { return O_ENC_RECON }
32func vc_dec_recon_off() -> i64 { return O_DEC_RECON }
33func vc_stream_off() -> i64 { return O_STREAM }
34func main() -> i64 { return 0 }