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