code wiki / (root) / nx_rle.nx

nx_rle.nx

buildroot/runtime/nx_rle.nx

4836 B136 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_rle.nx -- run-length encoding for sparse coefficient streams. Encoding format for one 8x8 block (64 entries): Stream is a sequence of (run, level) pairs. Each pair is: [run_byte] number of preceding zeros (0..63 inclusive) [level_int16] the non-zero coefficient that follows the run The stream is terminated by an End-Of-Block marker = (0, 0). A run of >63 zeros wraps via a special "zero-run-only" pair (run=63, level=0) that consumes 63 zeros and contributes none; caller continues from there. Since one block has 64 coefficients, 64 zeros total means we emit (0, 0) immediately (EOB). genealogy_id: jpeg_iso_10918 + mpeg_iso_11172 + h264_cavlc + nx_zigzag_q10 lineage_id: nishi_rle_block_q10

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_rle.nx nx_video_codec.nx

imports: nx_syscalls.nx

imported by: nx_video_codec.nx

structs

none

consts

26const NX_RLE_VERDICT_UNKNOWN: i64 = 0
27const NX_RLE_VERDICT_OK: i64 = 1
28const NX_RLE_VERDICT_BUF_TOO_SMALL: i64 = 2
29const NX_RLE_VERDICT_TRUNCATED: i64 = 3
30const NX_RLE_VERDICT_BAD_PARAMS: i64 = 4
31const NX_RLE_VERDICT_N: i64 = 5
33const NX_RLE_BLOCK_LEN: i64 = 64

functions

36func _rle_w16(buf: *u8, off: i64, v: i64) -> i64
called by 1: nx_rle_encode_block
45func _rle_r16(buf: *u8, off: i64) -> i64
called by 1: nx_rle_decode_block
53func nx_rle_encode_block(
called by 1: nx_vc_vid_encode calls 1: _rle_w16
89func nx_rle_decode_block(
called by 1: nx_vc_vid_decode calls 1: _rle_r16
132func nx_rle_verdict_is_valid(v: i64) -> i64