Expand description
EVC slice_data() walker (ISO/IEC 23094-1 §7.3.8).
Round-2 scope: drive the CABAC engine through every ae(v) syntax
element of a Baseline-profile bitstream so that:
- every bin is consumed in spec-correct order (matching the syntax tables in §7.3.8.1 through §7.3.8.7), and
- the engine reaches the end of the slice cleanly via the
end_of_tile_one_bitterminate decision (§7.3.8.1).
Pixel emission, transform/quant inversion, intra/inter prediction, deblocking, ALF, DRA — all deferred to round 3+. The walker just advances the CABAC state and surfaces the parsed values via callbacks so the test fixtures (and round-3 pixel pipeline) can observe them without paying for re-parsing.
§Profile constraints we exploit
Baseline profile (Annex A.3.2) forces:
sps_btt_flag == 0(only quad-split viasplit_cu_flag),sps_suco_flag == 0,sps_admvp_flag == 0,sps_eipd_flag == 0,sps_cm_init_flag == 0→ every regular bin maps to ctxTable 0, ctxIdx 0 (init(valState=256, valMps=0)),sps_alf_flag == 0,sps_addb_flag == 0,sps_dquant_flag == 0,sps_ats_flag == 0,sps_ibc_flag == 0,sps_dra_flag == 0,sps_adcc_flag == 0→ run-length residual coding,single_tile_in_pic_flag == 1(one tile per picture).
For an IDR slice in Baseline, slice_type == I so predModeConstraint
becomes INTRA_IBC at the CU split point and the subsequent
coding_unit() is invoked twice — once for DUAL_TREE_LUMA and once
for DUAL_TREE_CHROMA — per §7.3.8.3 lines 2789–2799.
§Surface
walk_baseline_idr_slice takes the slice’s RBSP, the active SPS/PPS
state and a SliceWalkInputs descriptor; it returns the number of
coding_unit() invocations parsed. The walker stops cleanly on the
terminate decision, then verifies the bitstream is byte-aligned per
§7.3.8.1 trailing logic.
Structs§
- AlfCtb
Flags - Per-CTU adaptive-loop-filter applicability decoded from
coding_tree_unit()(§7.3.8.2 lines 2626-2631). Each field carries the resolved on/off state for the CTB after applying the §7.4.9.2 inference rules: when the corresponding flag is not present in the bitstream it is inferred to the slice-level enable (luma →slice_alf_enabled_flag, Cb →sliceChromaAlfEnabledFlag, Cr →sliceChroma2AlfEnabledFlag). - AlfCtb
Stats - Tallies of the per-CTU ALF map bins actually consumed from the CABAC stream. Threaded into each path’s stats struct so fixtures can assert the §7.3.8.2 presence gating fired exactly as the spec requires.
- Inter
Decode Inputs - Inputs for the Baseline P/B decode entry point.
- Inter
Decode Stats - Stats from
decode_baseline_inter_slice. - Slice
Decode Inputs - Inputs that the round-3 decoder needs in addition to
SliceWalkInputs— slice QP and the picture buffer’s bit depth. - Slice
Decode Stats - Stats from
decode_baseline_idr_slice. A superset ofSliceWalkStatsfor testability — coding_units, residual coeff counts, etc. - Slice
Tile Walk Order - The §7.3.8.1
slice_data()CTU-iteration order for a multi-tile slice. - Slice
Tile Walk Segment - One tile’s contribution to the §7.3.8.1
slice_data()walk. - Slice
Walk Inputs - Static SPS/PPS state that the walker needs to make
per-syntax-element decisions. Only the fields actually consulted by
the Baseline-profile path are surfaced; the rest are tracked
implicitly (e.g.
sps_btt_flag = 0is hard-wired in the walker). - Slice
Walk Stats - Counters reported back to the caller after a successful walk. Each one is incremented every time the walker consumes the corresponding syntax element from the CABAC stream — handy for hand-built fixture tests.
Functions§
- decode_
baseline_ idr_ slice - Decode a Baseline-profile IDR slice into a freshly-allocated
YuvPicture. Round-3 deliverable: drives the CABAC engine through every syntax element (matchingwalk_baseline_idr_slice), reconstructs samples per §8.4.4 / §8.7 / §8.7.5, and returns the picture buffer. - decode_
baseline_ inter_ slice - Decode a Baseline-profile P or B slice. Each CU is single-tree;
supports
cu_skip_flag(default-AMVP from candidatemvp_idx_l0=0, no MVD) and the explicit-MV inter path. Intra CUs inside a P/B slice fall back to the round-3 intra-pred pipeline. - derive_
x_ first_ ctb - Derive
xFirstCtbfor a CTB at raster addressCtbAddrInRs, per the §7.3.8.2coding_tree_unit( )preamble (lines 2620-2623). - resolve_
slice_ tile_ walk_ order - Resolve the §7.3.8.1
slice_data()CTU-iteration order from the slice-tile list and the §6.5.1 per-picture tile derivations. - walk_
baseline_ idr_ slice - Walk a Baseline-profile IDR slice’s
slice_data(). Returns walk stats onceend_of_tile_one_bitterminates the engine cleanly. Errors indicate the bitstream cannot be consumed by the round-2 walker (unsupported toolset combination or premature engine exhaustion). - walk_
baseline_ idr_ slice_ tiled - Walk a Baseline-profile IDR slice’s
slice_data()over a multi-tile CTU-iteration order (§7.3.8.1). This is the consumer the tile chain (rounds 273/278/281/292) has named: it drives the per-CTU CABAC walk off the resolvedSliceTileWalkOrderrather than a flat picture raster, so a slice spanning several tiles decodes in the spec’s tile-major order.