code wiki / (root) / nx_h264_coeff_token.nx

nx_h264_coeff_token.nx

buildroot/runtime/nx_h264_coeff_token.nx

15357 B380 linesdepth 3pulls 4 transitivereach 19 importersview sourcekind librarytopic h264
docsdependenciesstructsconstsfunctions

about

nx_h264_coeff_token.nx -- CAVLC coeff_token VLC (rung 4c-ii), table-driven encoder + decoder. coeff_token maps a prefix-free code <-> (TotalCoeff, TrailingOnes), selected by neighbour context nC. This builds the MACHINERY (lookup-by-symbol encode, accumulate-and-match decode) + the high-confidence canonical subset of the 0<=nC<2 table (Table 9-5 first column). SOVEREIGN VALIDATION: round-trip (encode->decode) gates the machinery; the anchored short codes pin those entries to the spec; the ULTIMATE oracle is decoding the real I-frame (wrong table value -> desync -> garbage image, so a coherent reconstruction proves every entry). No third-party reference. HONEST: only the verified subset (TotalCoeff<=3 short codes + a few) is filled; the full TC 0..16 x 4 nC contexts is accuracy-critical data to complete from the ITU-T spec, validated by the real-frame decode. nC>=8 uses a 6-bit FLC (not here yet). genealogy_id: itu_t_h264_table9_5_coeff_token lineage_id: vlc_symbol_table + prefix_match_decode + roundtrip_oracle license_tier: ORIGINAL

dependencies 3 imports · 14 importers

nx_syscalls.nx nx_h264_bits.nx nx_h264_bitwriter.nx nx_h264_coeff_token.nx nx_h264_bframe_walk.nx nx_h264_brecon.nx nx_h264_cdc_gate.nx nx_h264_coeff_token_gate.nx nx_h264_ctctx_gate.nx nx_h264_ctfull_gate.nx nx_h264_decode_frame.nx nx_h264_iframe.nx nx_h264_mv_recon_gate.nx nx_h264_pframe_recon.nx

diagram shows first 10 each side; +0 more imports, +4 more importers in the complete lists below.

imports: nx_syscalls.nxnx_h264_bits.nxnx_h264_bitwriter.nx

imported by: nx_h264_bframe_walk.nxnx_h264_brecon.nxnx_h264_cdc_gate.nxnx_h264_coeff_token_gate.nxnx_h264_ctctx_gate.nxnx_h264_ctfull_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

26func ct_table_nc01(ln: *i64, cd: *i64, tc: *i64, to: *i64) -> i64
97func ct_table_chromadc(ln: *i64, cd: *i64, tc: *i64, to: *i64) -> i64
115func nx_coeff_token_encode_cdc(bw: *BitWriter, total_coeff: i64, trailing_ones: i64) -> i64
129func nx_coeff_token_decode_cdc(br: *BitReader, out: *i64) -> i64
149func nx_coeff_token_encode(bw: *BitWriter, total_coeff: i64, trailing_ones: i64) -> i64
164func nx_coeff_token_decode(br: *BitReader, out: *i64) -> i64
185func ct_table_nc23(ln: *i64, cd: *i64, tc: *i64, to: *i64) -> i64
called by 1: ct_table_for
254func ct_table_nc47(ln: *i64, cd: *i64, tc: *i64, to: *i64) -> i64
called by 1: ct_table_for
323func ct_table_for(nC: i64, ln: *i64, cd: *i64, tc: *i64, to: *i64) -> i64
332func nx_coeff_token_decode_ctx(br: *BitReader, nC: i64, out: *i64) -> i64
361func nx_coeff_token_encode_ctx(bw: *BitWriter, nC: i64, total_coeff: i64, trailing_ones: i64) -> i64