Skip to main content

Module cabac_test

Module cabac_test 

Source

Structs§

Cabac
The CABAC decoder: arithmetic engine reading MSB-first from the RBSP plus the 460 adaptive context models.

Functions§

b_inter_shape
B mb_type 1..=21 → (partition layout, MV-prediction mode 0/1/2 for 16×16/ 16×8/8×16, per-partition prediction direction) (spec Table 7-14). Test-only view of [b_inter_layout] for the ENCODER crate: (mvmode, p0, p1) with pred coded 1 = L0, 2 = L1, 3 = Bi — the encoder’s b_part_mb_type is the exact inverse, so a round-trip over 4..=21 gates the two tables against drift.
parse_cbp_cabac
coded_block_pattern CABAC parse (openh264 ParseCbpInfoCabac), corner-MB variant (top/left neighbours unavailable → their terms are 0). ctxIdxOffset 73 (luma) with 4 z-order 8×8 bins whose ctxInc uses the EARLIER-decoded bits within this MB, then chroma bits at 77/81. Returns cbp: bits 0-3 = luma 8×8, bits 4-5 = chroma pattern.
parse_mb_qp_delta_cabac
mb_qp_delta CABAC (ParseDeltaQpCabac): ctxIdxOffset 60, ctxInc = (prev delta ≠ 0).
parse_ref_idx_cabac
ref_idx_l0 (P) CABAC — mirror of the encoder cb_ref_idx. Unary, ctxIdxOffset 54: binIdx 0 → ctx0 (condTermFlagA + 2·condTermFlagB), binIdx 1 → 4, binIdx ≥2 → 5.