chromium/third_party/libaom/source/libaom/av1/common/reconinter_template.inc

/*
 * Copyright (c) 2022, Alliance for Open Media. All rights reserved.
 *
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 */

#ifndef IS_DEC
#error "IS_DEC must be defined for reconinter_template.inc."
#endif

#if IS_DEC
static inline void build_one_inter_predictor(uint8_t *dst, int dst_stride,
                                             const MV *src_mv,
                                             InterPredParams *inter_pred_params,
                                             MACROBLOCKD *xd, int mi_x,
                                             int mi_y, int ref,
                                             uint8_t **mc_buf) {
#else
static inline void build_one_inter_predictor(
    uint8_t *dst, int dst_stride, const MV *src_mv,
    InterPredParams *inter_pred_params) {}

// True if the following hold:
//  1. Not intrabc and not build_for_obmc
//  2. At least one dimension is size 4 with subsampling
//  3. If sub-sampled, none of the previous blocks around the sub-sample
//     are intrabc or inter-blocks
static bool is_sub8x8_inter(const MACROBLOCKD *xd, int plane, BLOCK_SIZE bsize,
                            int is_intrabc, int build_for_obmc) {}

#if IS_DEC
static inline void build_inter_predictors_sub8x8(const AV1_COMMON *cm,
                                                 MACROBLOCKD *xd, int plane,
                                                 const MB_MODE_INFO *mi,
                                                 int mi_x, int mi_y,
                                                 uint8_t **mc_buf) {
#else
static inline void build_inter_predictors_sub8x8(const AV1_COMMON *cm,
                                                 MACROBLOCKD *xd, int plane,
                                                 const MB_MODE_INFO *mi,
                                                 int mi_x, int mi_y) {}

#if IS_DEC
static inline void build_inter_predictors_8x8_and_bigger(
    const AV1_COMMON *cm, MACROBLOCKD *xd, int plane, const MB_MODE_INFO *mi,
    int build_for_obmc, int bw, int bh, int mi_x, int mi_y, uint8_t **mc_buf) {
#else
static inline void build_inter_predictors_8x8_and_bigger(
    const AV1_COMMON *cm, MACROBLOCKD *xd, int plane, const MB_MODE_INFO *mi,
    int build_for_obmc, int bw, int bh, int mi_x, int mi_y) {}

#if IS_DEC
static inline void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
                                          int plane, const MB_MODE_INFO *mi,
                                          int build_for_obmc, int bw, int bh,
                                          int mi_x, int mi_y,
                                          uint8_t **mc_buf) {
  if (is_sub8x8_inter(xd, plane, mi->bsize, is_intrabc_block(mi),
                      build_for_obmc)) {
    assert(bw < 8 || bh < 8);
    build_inter_predictors_sub8x8(cm, xd, plane, mi, mi_x, mi_y, mc_buf);
  } else {
    build_inter_predictors_8x8_and_bigger(cm, xd, plane, mi, build_for_obmc, bw,
                                          bh, mi_x, mi_y, mc_buf);
  }
}
#else
static inline void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
                                          int plane, const MB_MODE_INFO *mi,
                                          int build_for_obmc, int bw, int bh,
                                          int mi_x, int mi_y) {}
#endif  // IS_DEC