code wiki / (root) / nx_h264_cabac_mb.nx

nx_h264_cabac_mb.nx

buildroot/runtime/nx_h264_cabac_mb.nx

7973 B158 linesdepth 3pulls 4 transitivereach 1 importersview sourcekind librarytopic h264
docsdependenciesstructsconstsfunctions

about

nx_h264_cabac_mb.nx -- H.264 CABAC I-slice macroblock syntax (clauses 9.3.2.5, 9.3.3.1.1, Table 9-36). STEP 3, on the KAT-verified engine (nx_h264_cabac.nx, clause 9.3.1) and the residual layer (nx_h264_cabac_residual.nx, gate 8/8). I-slices only: an I-frame poster needs no motion vectors and no inter prediction, which removes most of full CABAC from scope. All ctxIdxOffsets are NAMED (rule 11) and carry their spec table reference, so a wrong constant is reviewable against the standard instead of being a bare number. license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_h264_cabac.nx nx_h264_cabac_ctxinc.nx nx_h264_cabac_mb.nx nx_h264_cabac_mb_gate.nx

imports: nx_syscalls.nxnx_h264_cabac.nxnx_h264_cabac_ctxinc.nx

imported by: nx_h264_cabac_mb_gate.nx

structs

none

consts

13const CMB_OFF_MBTYPE_I: i64 = 3 // Table 9-34: mb_type, I slices
14const CMB_CTX_TERMINATE: i64 = 276 // clause 9.3.3.2.2.3: the end-of-slice / I_PCM terminate context
15const CMB_OFF_CHROMA_PRED: i64 = 64 // Table 9-34: intra_chroma_pred_mode
16const CMB_OFF_PREV_I4: i64 = 68 // Table 9-34: prev_intra4x4_pred_mode_flag
17const CMB_OFF_REM_I4: i64 = 69 // Table 9-34: rem_intra4x4_pred_mode
18const CMB_OFF_CBP_LUMA: i64 = 73 // Table 9-34: coded_block_pattern, luma prefix
19const CMB_OFF_CBP_CHROMA: i64 = 77 // Table 9-34: coded_block_pattern, chroma suffix
20const CMB_MBTYPE_I_NXN: i64 = 0
21const CMB_MBTYPE_I_PCM: i64 = 25
22const CMB_REM_I4_BITS: i64 = 3 // FL binarization, cMax=7
106const CMB_OFF_CBF: i64 = 85 // Table 9-34: coded_block_flag base
107const CMB_OFF_SIG: i64 = 105 // significant_coeff_flag base (frame-coded)
108const CMB_OFF_LAST: i64 = 166 // last_significant_coeff_flag base (frame-coded)
109const CMB_OFF_ABS: i64 = 227 // coeff_abs_level_minus1 base
110const CMB_CAT_MAX: i64 = 4 // ctxBlockCat 0..4 for non-8x8 I-slice residual

functions

27func cmb_mbtype_i(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64, condA: i64, condB: i64) -> i64
called by 1: main calls 2: cab_decisioncab_terminate
46func cmb_is_i16x16(mbt: i64) -> i64
52func cmb_i16_predmode(mbt: i64) -> i64 { if cmb_is_i16x16(mbt) == 0 { return 0 - 1 } return (mbt - 1) % 4 }
called by 1: main calls 1: cmb_is_i16x16
53func cmb_i16_cbpchroma(mbt: i64) -> i64 { if cmb_is_i16x16(mbt) == 0 { return 0 - 1 } return ((mbt - 1) / 4) % 3 }
called by 1: main calls 1: cmb_is_i16x16
54func cmb_i16_cbpluma(mbt: i64) -> i64
called by 1: main calls 1: cmb_is_i16x16
61func cmb_prev_i4(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64) -> i64
calls 1: cab_decision
65func cmb_rem_i4(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64) -> i64
called by 1: main calls 1: cab_decision
76func cmb_chroma_pred(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64, condA: i64, condB: i64) -> i64
called by 1: main calls 1: cab_decision
84func cmb_cbp_luma(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64, condA: *i64, condB: *i64) -> i64
called by 1: main calls 1: cab_decision
96func cmb_cbp_chroma(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64,
called by 1: main calls 1: cab_decision
113func cmb_cbf_catoff(cat: i64) -> i64
118func cmb_sig_catoff(cat: i64) -> i64
127func cmb_abs_catoff(cat: i64) -> i64
called by 1: cmb_abs_base
137func cmb_cat_maxcoeff(cat: i64) -> i64
called by 1: main
146func cmb_sig_base(cat: i64) -> i64 { let o: i64 = cmb_sig_catoff(cat); if o < 0 { return 0 - 1 } return CMB_OFF_SIG + o }
called by 1: main calls 1: cmb_sig_catoff
147func cmb_last_base(cat: i64) -> i64 { let o: i64 = cmb_sig_catoff(cat); if o < 0 { return 0 - 1 } return CMB_OFF_LAST + o }
called by 1: main calls 1: cmb_sig_catoff
148func cmb_abs_base(cat: i64) -> i64 { let o: i64 = cmb_abs_catoff(cat); if o < 0 { return 0 - 1 } return CMB_OFF_ABS + o }
called by 1: main calls 1: cmb_abs_catoff
153func cmb_coded_block_flag(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64,