nx_h264_cabac.nx
buildroot/runtime/nx_h264_cabac.nx
about
nx_h264_cabac.nx -- H.264 CABAC arithmetic decoding ENGINE (ITU-T H.264 clause 9.3), STEP 1 core.
The arithmetic core (DecodeDecision/DecodeBypass/DecodeTerminate + renormalization) is IDENTICAL
to HEVC's and is copied VERBATIM from the gated nx_hevc_cabac engine, including the normative
rangeTabLps[64x4]/transIdxLps[64]/transIdxMps[64] tables. The H.264-specific delta lives in
context-variable init from the (m,n) init tables (clause 9.3.1.1) -> cab_ctx_init_mn.
This is the ENGINE only. The I-slice syntax-element context tables + binarizations
(mb_type, coded_block_pattern, coded_block_flag, significant_coeff_flag,
last_significant_coeff_flag, coeff_abs_level_minus1, mb_qp_delta, prev_intra4x4_pred_mode,
intra_chroma_pred_mode, transform_size_8x8_flag, end_of_slice) are the NEXT rung and plug
their (m,n) rows into cab_ctx_init_mn + drive cab_decision with the derived ctxIdx.
LIB (no main); gated by nx_h264_cabac_gate. license_tier: ORIGINAL
genealogy_id: itu_t_h264_sec9_3_cabac lineage_id: hevc_arith_engine_reuse + h264_mn_ctxinit
dependencies 1 imports · 5 importers
imports: nx_syscalls.nx
imported by: nx_h264_cabac_gate.nxnx_h264_cabac_mb.nxnx_h264_cabac_mb_gate.nxnx_h264_cabac_residual.nxnx_h264_cabac_residual_gate.nx
structs
| none |
consts
| none |
functions
| 18 | func cab_parse_nums(s: *u8, out: *i64) -> i64 called by 1: cab_load_tables |
| 32 | func cab_clip3(lo: i64, hi: i64, v: i64) -> i64 { if v < lo { return lo } if v > hi { return hi } return v } |
| 36 | func cab_load_tables(rlps: *i64, tlps: *i64, tmps: *i64) -> i64 |
| 47 | func cab_bit(cab: *i64) -> i64 |
| 55 | func cab_init(cab: *i64, data: *u8, bitstart: i64, bytelen: i64) -> i64 |
| 64 | func cab_renorm(cab: *i64) -> i64 { while cab[0] < 256 { cab[0] = cab[0] << 1; cab[1] = (cab[1] << 1) | cab_bit(cab) } return 0 } |
| 66 | func cab_decision(cab: *i64, ctx: *i64, k: i64, rlps: *i64, tlps: *i64, tmps: *i64) -> i64 called by 10: kat_enginecmb_mbtype_icmb_prev_i4cmb_rem_i4cmb_chroma_predcmb_cbp_luma+4 calls 1: cab_renorm |
| 83 | func cab_bypass(cab: *i64) -> i64 { cab[1] = (cab[1] << 1) | cab_bit(cab); if cab[1] >= cab[0] { cab[1] = cab[1] - cab[0]; return 1 } return 0 } |
| 84 | func cab_terminate(cab: *i64) -> i64 { cab[0] = cab[0] - 2; if cab[1] >= cab[0] { return 1 } cab_renorm(cab); return 0 } |
| 87 | func cab_ctx_init_iv(ctx: *i64, k: i64, initValue: i64, sliceQpY: i64) -> i64 |
| 96 | func cab_ctx_init_mn(ctx: *i64, k: i64, m: i64, n: i64, sliceQpY: i64) -> i64 |