• John Koleszar's avatar
    Centralize mb skip state calculation · 13685747
    John Koleszar authored
    This patch moves the scattered updates to the mb skip state
    (mode_info_context->mbmi.mb_skip_coeff) to vp8_tokenize_mb. Recent
    changes to the quantizer exposed a bug where if a macroblock
    could be coded as a skip but isn't, the encoder would run the
    loopfilter but the decoder wouldn't, causing a reference buffer
    mismatch.
    
    The loopfilter is controlled by a flag called dc_diff. The decoder
    looks at the number of decoded coefficients when setting this flag.
    The encoder sets this flag based on the skip state, since any
    skippable macroblock should be transmitted as a skip. The coefficient
    optimization pass (vp8_optimize_b()) could change the coefficients
    such that a block that was not a skip becomes one. The encoder was
    not updating the skip state in this situation for intra coded blocks.
    
    The underlying issue predates it, but this bug was recently triggered
    by enabling trellis quantization on the Y2 block in commit dcd29e36,
    and by changing the quantizer range control in commit 305be4e4.
    
    Change-Id: I5cce5da0dbc2d22f7d79ee48149f01e868a64802
    13685747
encodeframe.c 43.6 KB