nx_vcodec_color_wasm.nx
buildroot/runtime/nx_vcodec_color_wasm.nx
about
nx_vcodec_color_wasm.nx -- the BROWSER entry wrapper for the COLOR codec, fixed-offset linear-memory model
(mirrors nx_vcodec_wasm). wasm has NO syscalls, so every buffer is a fixed offset (no sys_mmap) and the
color glue (RGB<->YCbCr, 4:2:0 subsample/upsample) is inlined; the heavy lifting is the PROVEN nx_vcodec
engine (vc_enc/dec_frame_packed) run once per Y/Cb/Cr plane. JS only blits RGB in/out at the offsets; all
codec logic is sovereign nx -> nx_compile_wat -> nx_wat_compiler -> .wasm. Frame cap 128x128 (chroma 64x64).
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_vcodec.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 10 | const O_RGB: i64 = 0 // input RGB (interleaved), up to 49152 |
| 11 | const O_Y: i64 = 49152 // luma plane (16384) |
| 12 | const O_CB: i64 = 65536 // full Cb (16384) |
| 13 | const O_CR: i64 = 81920 // full Cr (16384) |
| 14 | const O_CBS: i64 = 98304 // subsampled Cb (4096) |
| 15 | const O_CRS: i64 = 102400 // subsampled Cr (4096) |
| 16 | const O_PREVY: i64 = 106496 // prev recon Y (16384) |
| 17 | const O_PREVCB: i64 = 122880 // prev recon Cb (4096) |
| 18 | const O_PREVCR: i64 = 126976 // prev recon Cr (4096) |
| 19 | const O_RECONY: i64 = 131072 // enc recon Y (16384) |
| 20 | const O_RECONCB: i64 = 147456 // enc recon Cb (4096) |
| 21 | const O_RECONCR: i64 = 151552 // enc recon Cr (4096) |
| 22 | const O_STRY: i64 = 155648 // stream Y (16384) |
| 23 | const O_STRCB: i64 = 172032 // stream Cb (8192) |
| 24 | const O_STRCR: i64 = 180224 // stream Cr (8192) |
| 25 | const O_DECY: i64 = 188416 // dec recon Y (16384) |
| 26 | const O_DECCB: i64 = 204800 // dec recon Cb (4096) |
| 27 | const O_DECCR: i64 = 208896 // dec recon Cr (4096) |
| 28 | const O_DECCBU: i64 = 212992 // dec Cb upsampled (16384) |
| 29 | const O_DECCRU: i64 = 229376 // dec Cr upsampled (16384) |
| 30 | const O_RGBOUT: i64 = 245760 // output RGB (49152) |
| 31 | const O_BLK: i64 = 294912 // 16 i64 transform scratch (128) |
| 32 | const O_MV: i64 = 295040 // 2 i64 motion vector (16) |
| 33 | const O_TMP: i64 = 295056 // 3 i64 color temp (24) -- end 295080 |
functions
| 35 | func vc_clamp8(v: i64) -> i64 { if v < 0 { return 0 } if v > 255 { return 255 } return v } |
| 38 | func vc_color_wasm_encode(W: i64, H: i64, qp: i64, keyframe: i64, sad: i64) -> i64 |
| 70 | func vc_color_wasm_decode(W: i64, H: i64, qp: i64) -> i64 |
| 100 | func vc_color_rgb_off() -> i64 { return O_RGB } |
| 101 | func vc_color_rgbout_off() -> i64 { return O_RGBOUT } |
| 102 | func vc_color_prevy_off() -> i64 { return O_PREVY } |
| 103 | func vc_color_prevcb_off() -> i64 { return O_PREVCB } |
| 104 | func vc_color_prevcr_off() -> i64 { return O_PREVCR } |
| 105 | func vc_color_decy_off() -> i64 { return O_DECY } |
| 106 | func vc_color_deccb_off() -> i64 { return O_DECCB } |
| 107 | func vc_color_deccr_off() -> i64 { return O_DECCR } |
| 108 | func main() -> i64 { return 0 } |