xref: /aosp_15_r20/external/libaom/av1/encoder/reconinter_enc.h (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1*77c1e3ccSAndroid Build Coastguard Worker /*
2*77c1e3ccSAndroid Build Coastguard Worker  * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
3*77c1e3ccSAndroid Build Coastguard Worker  *
4*77c1e3ccSAndroid Build Coastguard Worker  * This source code is subject to the terms of the BSD 2 Clause License and
5*77c1e3ccSAndroid Build Coastguard Worker  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6*77c1e3ccSAndroid Build Coastguard Worker  * was not distributed with this source code in the LICENSE file, you can
7*77c1e3ccSAndroid Build Coastguard Worker  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8*77c1e3ccSAndroid Build Coastguard Worker  * Media Patent License 1.0 was not distributed with this source code in the
9*77c1e3ccSAndroid Build Coastguard Worker  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10*77c1e3ccSAndroid Build Coastguard Worker  */
11*77c1e3ccSAndroid Build Coastguard Worker 
12*77c1e3ccSAndroid Build Coastguard Worker #ifndef AOM_AV1_ENCODER_RECONINTER_ENC_H_
13*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AV1_ENCODER_RECONINTER_ENC_H_
14*77c1e3ccSAndroid Build Coastguard Worker 
15*77c1e3ccSAndroid Build Coastguard Worker #include "aom/aom_integer.h"
16*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/av1_common_int.h"
17*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/blockd.h"
18*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/convolve.h"
19*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/filter.h"
20*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/reconinter.h"
21*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/warped_motion.h"
22*77c1e3ccSAndroid Build Coastguard Worker 
23*77c1e3ccSAndroid Build Coastguard Worker #ifdef __cplusplus
24*77c1e3ccSAndroid Build Coastguard Worker extern "C" {
25*77c1e3ccSAndroid Build Coastguard Worker #endif
26*77c1e3ccSAndroid Build Coastguard Worker 
27*77c1e3ccSAndroid Build Coastguard Worker void aom_comp_mask_upsampled_pred(MACROBLOCKD *xd, const AV1_COMMON *const cm,
28*77c1e3ccSAndroid Build Coastguard Worker                                   int mi_row, int mi_col, const MV *const mv,
29*77c1e3ccSAndroid Build Coastguard Worker                                   uint8_t *comp_pred, const uint8_t *pred,
30*77c1e3ccSAndroid Build Coastguard Worker                                   int width, int height, int subpel_x_q3,
31*77c1e3ccSAndroid Build Coastguard Worker                                   int subpel_y_q3, const uint8_t *ref,
32*77c1e3ccSAndroid Build Coastguard Worker                                   int ref_stride, const uint8_t *mask,
33*77c1e3ccSAndroid Build Coastguard Worker                                   int mask_stride, int invert_mask,
34*77c1e3ccSAndroid Build Coastguard Worker                                   int subpel_search);
35*77c1e3ccSAndroid Build Coastguard Worker 
36*77c1e3ccSAndroid Build Coastguard Worker void aom_highbd_comp_mask_upsampled_pred(
37*77c1e3ccSAndroid Build Coastguard Worker     MACROBLOCKD *xd, const struct AV1Common *const cm, int mi_row, int mi_col,
38*77c1e3ccSAndroid Build Coastguard Worker     const MV *const mv, uint8_t *comp_pred8, const uint8_t *pred8, int width,
39*77c1e3ccSAndroid Build Coastguard Worker     int height, int subpel_x_q3, int subpel_y_q3, const uint8_t *ref8,
40*77c1e3ccSAndroid Build Coastguard Worker     int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask,
41*77c1e3ccSAndroid Build Coastguard Worker     int bd, int subpel_search);
42*77c1e3ccSAndroid Build Coastguard Worker 
43*77c1e3ccSAndroid Build Coastguard Worker // Build single or compound reference inter predictors for all planes.
44*77c1e3ccSAndroid Build Coastguard Worker // Can build inter-intra predictors, masked predictors etc as well.
45*77c1e3ccSAndroid Build Coastguard Worker void av1_enc_build_inter_predictor(const AV1_COMMON *cm, MACROBLOCKD *xd,
46*77c1e3ccSAndroid Build Coastguard Worker                                    int mi_row, int mi_col,
47*77c1e3ccSAndroid Build Coastguard Worker                                    const BUFFER_SET *ctx, BLOCK_SIZE bsize,
48*77c1e3ccSAndroid Build Coastguard Worker                                    int plane_from, int plane_to);
49*77c1e3ccSAndroid Build Coastguard Worker 
50*77c1e3ccSAndroid Build Coastguard Worker void av1_enc_build_inter_predictor_y(MACROBLOCKD *xd, int mi_row, int mi_col);
51*77c1e3ccSAndroid Build Coastguard Worker 
52*77c1e3ccSAndroid Build Coastguard Worker void av1_enc_build_inter_predictor_y_nonrd(MACROBLOCKD *xd,
53*77c1e3ccSAndroid Build Coastguard Worker                                            InterPredParams *inter_pred_params,
54*77c1e3ccSAndroid Build Coastguard Worker                                            const SubpelParams *subpel_params);
55*77c1e3ccSAndroid Build Coastguard Worker 
56*77c1e3ccSAndroid Build Coastguard Worker // Build one inter predictor. It is called for building predictor for single
57*77c1e3ccSAndroid Build Coastguard Worker // reference case, or just the 1st or 2nd reference in compound reference case.
58*77c1e3ccSAndroid Build Coastguard Worker // Can build both regular and masked predictors.
59*77c1e3ccSAndroid Build Coastguard Worker void av1_enc_build_one_inter_predictor(uint8_t *dst, int dst_stride,
60*77c1e3ccSAndroid Build Coastguard Worker                                        const MV *src_mv,
61*77c1e3ccSAndroid Build Coastguard Worker                                        InterPredParams *inter_pred_params);
62*77c1e3ccSAndroid Build Coastguard Worker 
63*77c1e3ccSAndroid Build Coastguard Worker void av1_build_prediction_by_above_preds(const AV1_COMMON *cm, MACROBLOCKD *xd,
64*77c1e3ccSAndroid Build Coastguard Worker                                          uint8_t *tmp_buf[MAX_MB_PLANE],
65*77c1e3ccSAndroid Build Coastguard Worker                                          int tmp_width[MAX_MB_PLANE],
66*77c1e3ccSAndroid Build Coastguard Worker                                          int tmp_height[MAX_MB_PLANE],
67*77c1e3ccSAndroid Build Coastguard Worker                                          int tmp_stride[MAX_MB_PLANE]);
68*77c1e3ccSAndroid Build Coastguard Worker 
69*77c1e3ccSAndroid Build Coastguard Worker void av1_build_prediction_by_left_preds(const AV1_COMMON *cm, MACROBLOCKD *xd,
70*77c1e3ccSAndroid Build Coastguard Worker                                         uint8_t *tmp_buf[MAX_MB_PLANE],
71*77c1e3ccSAndroid Build Coastguard Worker                                         int tmp_width[MAX_MB_PLANE],
72*77c1e3ccSAndroid Build Coastguard Worker                                         int tmp_height[MAX_MB_PLANE],
73*77c1e3ccSAndroid Build Coastguard Worker                                         int tmp_stride[MAX_MB_PLANE]);
74*77c1e3ccSAndroid Build Coastguard Worker 
75*77c1e3ccSAndroid Build Coastguard Worker void av1_build_obmc_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd);
76*77c1e3ccSAndroid Build Coastguard Worker 
77*77c1e3ccSAndroid Build Coastguard Worker // |ext_dst*| are indexed from |plane_from| to |plane_to| inclusive.
78*77c1e3ccSAndroid Build Coastguard Worker void av1_build_inter_predictors_for_planes_single_buf(
79*77c1e3ccSAndroid Build Coastguard Worker     MACROBLOCKD *xd, BLOCK_SIZE bsize, int plane_from, int plane_to, int ref,
80*77c1e3ccSAndroid Build Coastguard Worker     uint8_t *ext_dst[], int ext_dst_stride[]);
81*77c1e3ccSAndroid Build Coastguard Worker 
82*77c1e3ccSAndroid Build Coastguard Worker // |ext_dst*| are indexed from |plane_from| to |plane_to| inclusive.
83*77c1e3ccSAndroid Build Coastguard Worker void av1_build_wedge_inter_predictor_from_buf(MACROBLOCKD *xd, BLOCK_SIZE bsize,
84*77c1e3ccSAndroid Build Coastguard Worker                                               int plane_from, int plane_to,
85*77c1e3ccSAndroid Build Coastguard Worker                                               uint8_t *ext_dst0[],
86*77c1e3ccSAndroid Build Coastguard Worker                                               int ext_dst_stride0[],
87*77c1e3ccSAndroid Build Coastguard Worker                                               uint8_t *ext_dst1[],
88*77c1e3ccSAndroid Build Coastguard Worker                                               int ext_dst_stride1[]);
89*77c1e3ccSAndroid Build Coastguard Worker 
90*77c1e3ccSAndroid Build Coastguard Worker #ifdef __cplusplus
91*77c1e3ccSAndroid Build Coastguard Worker }  // extern "C"
92*77c1e3ccSAndroid Build Coastguard Worker #endif
93*77c1e3ccSAndroid Build Coastguard Worker 
94*77c1e3ccSAndroid Build Coastguard Worker #endif  // AOM_AV1_ENCODER_RECONINTER_ENC_H_
95