nx_h264_cabac_ctxinc.nx
buildroot/runtime/nx_h264_cabac_ctxinc.nx
about
nx_h264_cabac_ctxinc.nx -- H.264 CABAC I-slice ctxIdxInc DERIVATION (spec clause 9.3.3.1.1).
This is the table-INDEPENDENT logic layer of the CABAC decoder: pure procedures that select WHICH
context variable each bin uses. They need no (m,n) init values, so they are verifiable in isolation
(KAT gate) and are the correct next rung stacked on the already-GREEN arithmetic engine (nx_h264_cabac).
The (m,n) context-init VALUE tables (spec Tables 9-12..9-33) are a SEPARATE module and are DELIBERATELY
NOT included here -- they must be transcribed from the normative spec with per-table KATs, never guessed.
I-slice ctxIdxOffset map (spec Table 9-11) -- documented HERE so the value tables drop into known slots:
mb_type (I, prefix) : ctxIdxOffset 3 (ctxIdx 3..10)
mb_qp_delta : ctxIdxOffset 60 (ctxIdx 60..63)
intra_chroma_pred_mode : ctxIdxOffset 64 (ctxIdx 64..67)
prev_intra4x4_pred_mode_flag: ctxIdxOffset 68 (ctxIdx 68)
rem_intra4x4_pred_mode : ctxIdxOffset 69 (ctxIdx 69)
coded_block_pattern (luma) : ctxIdxOffset 73 (ctxIdx 73..76)
coded_block_pattern (chroma): ctxIdxOffset 77 (ctxIdx 77..84)
coded_block_flag : ctxIdxOffset 85 (+ per-ctxBlockCat sub-offsets; field/8x8 extensions >459)
significant_coeff_flag : ctxIdxOffset 105 (frame) / 277 (field)
last_significant_coeff_flag: ctxIdxOffset 166 (frame) / 338 (field)
coeff_abs_level_minus1 : ctxIdxOffset 227
end_of_slice_flag : ctxIdxOffset 276 (decoded via cab_terminate, no init pair)
transform_size_8x8_flag : ctxIdxOffset 399 (High profile)
LIB (no main). license_tier: ORIGINAL genealogy_id: itu_t_h264_sec9_3_3_1_1_ctxidxinc
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_h264_cabac_ctxinc_gate.nxnx_h264_cabac_mb.nxnx_h264_cabac_residual.nx
structs
| none |
consts
| none |
functions
| 25 | func cci_min(a: i64, b: i64) -> i64 { if a < b { return a } return b } |
| 29 | func cci_cbf(condA: i64, condB: i64) -> i64 { return condA + 2 * condB } |
| 33 | func cci_sig4x4(scanpos: i64) -> i64 { return scanpos } |
| 39 | func cci_abslevel_bin0(numGt1: i64, numEq1: i64) -> i64 { if numGt1 != 0 { return 0 } return cci_min(4, 1 + numEq1) } |
| 40 | func cci_abslevel_binN(numGt1: i64) -> i64 { return 5 + cci_min(4, numGt1) } |
| 43 | func cci_mbqpdelta(binIdx: i64, prevNonZero: i64) -> i64 called by 1: main |
| 51 | func cci_chromapred(binIdx: i64, condA: i64, condB: i64) -> i64 called by 1: main |