nx_rle.nx
buildroot/runtime/nx_rle.nx
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
imports: nx_syscalls.nx
imported by: nx_video_codec.nx
structs
| none |
consts
| 26 | const NX_RLE_VERDICT_UNKNOWN: i64 = 0 |
| 27 | const NX_RLE_VERDICT_OK: i64 = 1 |
| 28 | const NX_RLE_VERDICT_BUF_TOO_SMALL: i64 = 2 |
| 29 | const NX_RLE_VERDICT_TRUNCATED: i64 = 3 |
| 30 | const NX_RLE_VERDICT_BAD_PARAMS: i64 = 4 |
| 31 | const NX_RLE_VERDICT_N: i64 = 5 |
| 33 | const NX_RLE_BLOCK_LEN: i64 = 64 |
functions
| 36 | func _rle_w16(buf: *u8, off: i64, v: i64) -> i64 called by 1: nx_rle_encode_block |
| 45 | func _rle_r16(buf: *u8, off: i64) -> i64 called by 1: nx_rle_decode_block |
| 53 | func nx_rle_encode_block( |
| 89 | func nx_rle_decode_block( |
| 132 | func nx_rle_verdict_is_valid(v: i64) -> i64 |