Skip to content
  • David Barker's avatar
    Add 'do_average' to ConvolveParams structure · e64d51a9
    David Barker authored
    The 'ref' member of ConvolveParams currently serves two purposes:
    * To indicate which component of a compound we're currently predicting,
      eg. for fetching interpolation filters with dual-filter enabled.
    * To determine whether we should average into the destination buffer.
    
    But there are two cases where we want to separate these out:
    * In joint_motion_search, we want to try combining a fixed second
      prediction with various first predictions.
    * When searching masked interinter compounds, we want to predict
      each component separately then try different combinations.
    
    In these cases, we set 'ref' to 0 and use temporary variables to
    make sure we use the correct interpolation filters. But this is
    quite fragile.
    
    This patch separates out the two uses into separate members.
    This allows us to remove some temporary variables, but more
    importantly gives easy fixes to two bugs in
    build_inter_predictors_single_buf (used by rdopt):
    
    * We previously set ref=0 but didn't f...
    e64d51a9