Skip to main content

encode_slice_data_b

Function encode_slice_data_b 

Source
pub fn encode_slice_data_b(
    w: &mut BitWriter,
    cfg: &EncoderConfig,
    frame: &YuvFrame,
    qp: u8,
    poc: i32,
    l0: &RefFrame,
    l1: &RefFrame,
    qpo: &[i32],
)
Expand description

Codes a B-slice’s macroblock layer. B-frames are non-reference, so the reconstruction is computed (the CAVLC nnz predictor needs it) but discarded.

This brick: every MB is coded B_L0_16x16 (mb_type == 1) — a real motion-compensated prediction from l0 (the nearest PAST anchor, List-0 index 0) plus a coded residual. Because every MB is List-0-only with ref_idx inferred 0, the per-4×4 List-0 motion field and its median mvd predictor are byte-identical to the P-slice P_L0_16x16 path — so this reuses FrameEncoder::encode_inter_mb_v1_b verbatim, differing from P only in the mb_type value. l1 (nearest future anchor) is unused until B_Bi lands.