code wiki / (root) / nx_h264_cabac.nx

nx_h264_cabac.nx

buildroot/runtime/nx_h264_cabac.nx

5984 B100 linesdepth 2pulls 2 transitivereach 5 importersview sourcekind librarytopic h264
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_h264_cabac.nx nx_h264_cabac_gate.nx nx_h264_cabac_mb.nx nx_h264_cabac_mb_gate.nx nx_h264_cabac_residual.nx nx_h264_cabac_residual_gate.nx

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

18func cab_parse_nums(s: *u8, out: *i64) -> i64
called by 1: cab_load_tables
32func cab_clip3(lo: i64, hi: i64, v: i64) -> i64 { if v < lo { return lo } if v > hi { return hi } return v }
36func cab_load_tables(rlps: *i64, tlps: *i64, tmps: *i64) -> i64
called by 3: mainmainmain calls 1: cab_parse_nums
47func cab_bit(cab: *i64) -> i64
55func cab_init(cab: *i64, data: *u8, bitstart: i64, bytelen: i64) -> i64
called by 3: kat_enginemainmain calls 1: cab_bit
64func cab_renorm(cab: *i64) -> i64 { while cab[0] < 256 { cab[0] = cab[0] << 1; cab[1] = (cab[1] << 1) | cab_bit(cab) } return 0 }
called by 2: cab_decisioncab_terminate calls 1: cab_bit
66func cab_decision(cab: *i64, ctx: *i64, k: i64, rlps: *i64, tlps: *i64, tmps: *i64) -> i64
83func 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 }
84func cab_terminate(cab: *i64) -> i64 { cab[0] = cab[0] - 2; if cab[1] >= cab[0] { return 1 } cab_renorm(cab); return 0 }
called by 2: kat_enginecmb_mbtype_i calls 1: cab_renorm
87func cab_ctx_init_iv(ctx: *i64, k: i64, initValue: i64, sliceQpY: i64) -> i64
called by 1: kat_engine calls 1: cab_clip3
96func cab_ctx_init_mn(ctx: *i64, k: i64, m: i64, n: i64, sliceQpY: i64) -> i64
called by 1: kat_ctxinit_mn calls 1: cab_clip3