nx_h264_cavlc_level.nx
buildroot/runtime/nx_h264_cavlc_level.nx
about
nx_h264_cavlc_level.nx -- CAVLC level decoding (rung 4c-i, spec 9.2.2.1).
The algorithmic heart of CAVLC residual reading: for each non-trailing-ones
coefficient, read level_prefix (leading zeros) + level_suffix, form levelCode,
map to a signed level, and adapt suffixLength. Pure algorithm (no VLC tables)
-> exactly gateable. The coeff_token / total_zeros / run_before VLC tables are
the following sub-rungs.
level_prefix = number of leading 0 bits before the first 1
levelSuffixSize = suffixLength; =4 if prefix==14 && suffixLength==0;
= prefix-3 if prefix>=15
levelCode = (min(prefix,15) << suffixLength) + level_suffix
(+15 if prefix>=15 && suffixLength==0; + (1<<(prefix-3))-4096 if prefix>=16)
level = (levelCode+2)>>1 if even ; -((levelCode+1)>>1) if odd
suffixLength: 0->1 first; ++ if |level| > (3<<(suffixLength-1)) and <6
genealogy_id: itu_t_h264_sec9_2_2_cavlc_level
lineage_id: level_prefix_suffix + levelcode_signed_map + suffixlength_adapt
license_tier: ORIGINAL
dependencies 2 imports · 12 importers
diagram shows first 10 each side; +0 more imports, +2 more importers in the complete lists below.
imports: nx_syscalls.nxnx_h264_bits.nx
imported by: nx_h264_bframe_walk.nxnx_h264_brecon.nxnx_h264_cavlc_level_gate.nxnx_h264_cavlc_rt_gate.nxnx_h264_decode_frame.nxnx_h264_iframe.nxnx_h264_mv_recon_gate.nxnx_h264_pframe_recon.nxnx_h264_pframe_walk.nxnx_h264_pmvfield.nxnx_h264_residual.nxnx_h264_slice_extract.nx
structs
| none |
consts
| none |
functions
| 23 | func nx_cavlc_levelcode_to_level(level_code: i64) -> i64 |
| 31 | func nx_cavlc_read_level_off(br: *BitReader, suffix_length: i64, code_offset: i64) -> i64 |
| 55 | func nx_cavlc_read_level(br: *BitReader, suffix_length: i64) -> i64 |
| 60 | func nx_cavlc_update_suffix(suffix_length: i64, level: i64) -> i64 called by 1: main |