nx_h264_cabac_mb.nx
buildroot/runtime/nx_h264_cabac_mb.nx
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
imports: nx_syscalls.nxnx_h264_cabac.nxnx_h264_cabac_ctxinc.nx
imported by: nx_h264_cabac_mb_gate.nx
structs
| none |
consts
| 13 | const CMB_OFF_MBTYPE_I: i64 = 3 // Table 9-34: mb_type, I slices |
| 14 | const CMB_CTX_TERMINATE: i64 = 276 // clause 9.3.3.2.2.3: the end-of-slice / I_PCM terminate context |
| 15 | const CMB_OFF_CHROMA_PRED: i64 = 64 // Table 9-34: intra_chroma_pred_mode |
| 16 | const CMB_OFF_PREV_I4: i64 = 68 // Table 9-34: prev_intra4x4_pred_mode_flag |
| 17 | const CMB_OFF_REM_I4: i64 = 69 // Table 9-34: rem_intra4x4_pred_mode |
| 18 | const CMB_OFF_CBP_LUMA: i64 = 73 // Table 9-34: coded_block_pattern, luma prefix |
| 19 | const CMB_OFF_CBP_CHROMA: i64 = 77 // Table 9-34: coded_block_pattern, chroma suffix |
| 20 | const CMB_MBTYPE_I_NXN: i64 = 0 |
| 21 | const CMB_MBTYPE_I_PCM: i64 = 25 |
| 22 | const CMB_REM_I4_BITS: i64 = 3 // FL binarization, cMax=7 |
| 106 | const CMB_OFF_CBF: i64 = 85 // Table 9-34: coded_block_flag base |
| 107 | const CMB_OFF_SIG: i64 = 105 // significant_coeff_flag base (frame-coded) |
| 108 | const CMB_OFF_LAST: i64 = 166 // last_significant_coeff_flag base (frame-coded) |
| 109 | const CMB_OFF_ABS: i64 = 227 // coeff_abs_level_minus1 base |
| 110 | const CMB_CAT_MAX: i64 = 4 // ctxBlockCat 0..4 for non-8x8 I-slice residual |
functions
| 27 | func cmb_mbtype_i(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64, condA: i64, condB: i64) -> i64 |
| 46 | func cmb_is_i16x16(mbt: i64) -> i64 |
| 52 | func cmb_i16_predmode(mbt: i64) -> i64 { if cmb_is_i16x16(mbt) == 0 { return 0 - 1 } return (mbt - 1) % 4 } |
| 53 | func cmb_i16_cbpchroma(mbt: i64) -> i64 { if cmb_is_i16x16(mbt) == 0 { return 0 - 1 } return ((mbt - 1) / 4) % 3 } |
| 54 | func cmb_i16_cbpluma(mbt: i64) -> i64 |
| 61 | func cmb_prev_i4(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64) -> i64 calls 1: cab_decision |
| 65 | func cmb_rem_i4(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64) -> i64 |
| 76 | func cmb_chroma_pred(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64, condA: i64, condB: i64) -> i64 |
| 84 | func cmb_cbp_luma(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64, condA: *i64, condB: *i64) -> i64 |
| 96 | func cmb_cbp_chroma(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64, |
| 113 | func cmb_cbf_catoff(cat: i64) -> i64 called by 1: cmb_coded_block_flag |
| 118 | func cmb_sig_catoff(cat: i64) -> i64 |
| 127 | func cmb_abs_catoff(cat: i64) -> i64 called by 1: cmb_abs_base |
| 137 | func cmb_cat_maxcoeff(cat: i64) -> i64 called by 1: main |
| 146 | func cmb_sig_base(cat: i64) -> i64 { let o: i64 = cmb_sig_catoff(cat); if o < 0 { return 0 - 1 } return CMB_OFF_SIG + o } |
| 147 | func cmb_last_base(cat: i64) -> i64 { let o: i64 = cmb_sig_catoff(cat); if o < 0 { return 0 - 1 } return CMB_OFF_LAST + o } |
| 148 | func cmb_abs_base(cat: i64) -> i64 { let o: i64 = cmb_abs_catoff(cat); if o < 0 { return 0 - 1 } return CMB_OFF_ABS + o } |
| 153 | func cmb_coded_block_flag(cab: *i64, ctx: *i64, rlps: *i64, tlps: *i64, tmps: *i64, |