nx_webp_vp8l.nx
buildroot/runtime/nx_webp_vp8l.nx
about
nx_webp_vp8l.nx -- sovereign WebP VP8L (lossless) pixel decoder.
THE LAST MILE. WebP already reaches four layers deep in this tree: sniffed
by nx_media_sniff, sized by nx_img_dims, negotiated by nx_cms_image and
transfer-validated by nx_manga_get. Nothing turned the bitstream into
pixels. This does.
VP8L is, in order: a 5-byte header, an optional stack of up to 4 reversible
transforms, an optional colour cache, an optional meta-Huffman image that
selects which of N Huffman groups applies to each 2^k block, and then one
LZ77 stream over ARGB pixels. Decode runs the stream, then UNDOES the
transforms in reverse order.
Composes: nx_bitstream (LSB-first, matches VP8L exactly), nx_webp_huff
(canonical trees incl. the zero-bit single-symbol case).
genealogy_id: webp_lossless_bitstream_spec_2012
lineage_id: nx_webp_vp8l_v1
license_tier: ORIGINAL
dependencies 4 imports · 2 importers
imports: nx_syscalls.nxnx_bitstream.nxnx_huffman.nxnx_webp_huff.nx
imported by: nx_webp.nxnx_webp_vp8l_gate.nx
structs
| none |
consts
| 28 | const NX_VP8L_SIG: i64 = 0x2f |
| 29 | const NX_VP8L_NUM_LIT: i64 = 256 |
| 30 | const NX_VP8L_NUM_LEN: i64 = 24 |
| 31 | const NX_VP8L_NUM_DIST: i64 = 40 |
| 32 | const NX_VP8L_GROUP_SIZE: i64 = 5 |
| 33 | const NX_VP8L_PLANE_CODES: i64 = 120 |
| 34 | const NX_VP8L_BLACK: i64 = 0xff000000 |
| 35 | const NX_VP8L_CACHE_MUL: i64 = 0x1e35a7bd |
| 36 | const NX_VP8L_U32: i64 = 0xffffffff |
| 38 | const NX_VP8L_XF_PREDICT: i64 = 0 |
| 39 | const NX_VP8L_XF_COLOR: i64 = 1 |
| 40 | const NX_VP8L_XF_SUBGREEN: i64 = 2 |
| 41 | const NX_VP8L_XF_PALETTE: i64 = 3 |
| 42 | const NX_VP8L_XF_COUNT: i64 = 4 |
functions
| 46 | func vl_min(a: i64, b: i64) -> i64 { if a < b { return a } return b } |
| 48 | func vl_abs(a: i64) -> i64 { if a < 0 { return 0 - a } return a } called by 1: vl_sub3 |
| 50 | func vl_clip255(v: i64) -> i64 |
| 57 | func vl_subsample_size(size: i64, bits: i64) -> i64 |
| 61 | func vl_chan(argb: i64, shift: i64) -> i64 { return (argb >> shift) & 255 } |
| 63 | func vl_argb(a: i64, r: i64, g: i64, b: i64) -> i64 |
| 68 | func vl_average2(a: i64, b: i64) -> i64 |
| 80 | func vl_sub3(a: i64, b: i64, c: i64) -> i64 |
| 86 | func vl_select(t: i64, l: i64, tl: i64) -> i64 |
| 95 | func vl_clamp_add_sub_full(c0: i64, c1: i64, c2: i64) -> i64 |
| 103 | func vl_add_sub_half(a: i64, b: i64) -> i64 |
| 107 | func vl_clamp_add_sub_half(c0: i64, c1: i64, c2: i64) -> i64 |
| 116 | func vl_predict(mode: i64, l: i64, t: i64, tl: i64, tr: i64) -> i64 called by 2: vl_inv_predictmain calls 4: vl_average2vl_selectvl_clamp_add_sub_fullvl_clamp_add_sub_half |
| 139 | func vl_plane_table(out: *i64) -> i64 |
| 167 | func vl_dist_map(plane: *i64, dist_code: i64, xsize: i64) -> i64 |
| 182 | func vl_prefix_value(bs: *NxBitStream, prefix: i64) -> i64 |
| 191 | func vl_cache_index(argb: i64, bits: i64) -> i64 called by 1: vl_decode_pixels |
| 206 | func vl_decode_pixels(bs: *NxBitStream, out: *i64, width: i64, height: i64, called by 1: wb_decode_stream calls 6: sys_mmapwl_decode_symbolvl_argbvl_cache_indexvl_prefix_valuevl_dist_map |
| 304 | func vl_inv_subtract_green(argb: *i64, npix: i64) -> i64 |
| 317 | func vl_inv_predict(argb: *i64, w: i64, h: i64, bits: i64, sub: *i64) -> i64 |
| 354 | func vl_s8(v: i64) -> i64 called by 1: vl_inv_color |
| 360 | func vl_inv_color(argb: *i64, w: i64, h: i64, bits: i64, sub: *i64) -> i64 |
| 391 | func vp8l_read_header(bs: *NxBitStream, wh: *i64) -> i64 |