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_COMMON_RECONINTER_H_
13*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AV1_COMMON_RECONINTER_H_
14*77c1e3ccSAndroid Build Coastguard Worker
15*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/av1_common_int.h"
16*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/convolve.h"
17*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/filter.h"
18*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/warped_motion.h"
19*77c1e3ccSAndroid Build Coastguard Worker #include "aom/aom_integer.h"
20*77c1e3ccSAndroid Build Coastguard Worker
21*77c1e3ccSAndroid Build Coastguard Worker // Work out how many pixels off the edge of a reference frame we're allowed
22*77c1e3ccSAndroid Build Coastguard Worker // to go when forming an inter prediction.
23*77c1e3ccSAndroid Build Coastguard Worker // The outermost row/col of each referernce frame is extended by
24*77c1e3ccSAndroid Build Coastguard Worker // (AOM_BORDER_IN_PIXELS >> subsampling) pixels, but we need to keep
25*77c1e3ccSAndroid Build Coastguard Worker // at least AOM_INTERP_EXTEND pixels within that to account for filtering.
26*77c1e3ccSAndroid Build Coastguard Worker //
27*77c1e3ccSAndroid Build Coastguard Worker // We have to break this up into two macros to keep both clang-format and
28*77c1e3ccSAndroid Build Coastguard Worker // tools/lint-hunks.py happy.
29*77c1e3ccSAndroid Build Coastguard Worker #define AOM_LEFT_TOP_MARGIN_PX(subsampling) \
30*77c1e3ccSAndroid Build Coastguard Worker ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
31*77c1e3ccSAndroid Build Coastguard Worker #define AOM_LEFT_TOP_MARGIN_SCALED(subsampling) \
32*77c1e3ccSAndroid Build Coastguard Worker (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
33*77c1e3ccSAndroid Build Coastguard Worker
34*77c1e3ccSAndroid Build Coastguard Worker #ifdef __cplusplus
35*77c1e3ccSAndroid Build Coastguard Worker extern "C" {
36*77c1e3ccSAndroid Build Coastguard Worker #endif
37*77c1e3ccSAndroid Build Coastguard Worker
38*77c1e3ccSAndroid Build Coastguard Worker #define MAX_WEDGE_TYPES 16
39*77c1e3ccSAndroid Build Coastguard Worker
40*77c1e3ccSAndroid Build Coastguard Worker #define MAX_WEDGE_SIZE_LOG2 5 // 32x32
41*77c1e3ccSAndroid Build Coastguard Worker #define MAX_WEDGE_SIZE (1 << MAX_WEDGE_SIZE_LOG2)
42*77c1e3ccSAndroid Build Coastguard Worker #define MAX_WEDGE_SQUARE (MAX_WEDGE_SIZE * MAX_WEDGE_SIZE)
43*77c1e3ccSAndroid Build Coastguard Worker
44*77c1e3ccSAndroid Build Coastguard Worker #define WEDGE_WEIGHT_BITS 6
45*77c1e3ccSAndroid Build Coastguard Worker
46*77c1e3ccSAndroid Build Coastguard Worker #define WEDGE_NONE -1
47*77c1e3ccSAndroid Build Coastguard Worker
48*77c1e3ccSAndroid Build Coastguard Worker // Angles are with respect to horizontal anti-clockwise
49*77c1e3ccSAndroid Build Coastguard Worker enum {
50*77c1e3ccSAndroid Build Coastguard Worker WEDGE_HORIZONTAL = 0,
51*77c1e3ccSAndroid Build Coastguard Worker WEDGE_VERTICAL = 1,
52*77c1e3ccSAndroid Build Coastguard Worker WEDGE_OBLIQUE27 = 2,
53*77c1e3ccSAndroid Build Coastguard Worker WEDGE_OBLIQUE63 = 3,
54*77c1e3ccSAndroid Build Coastguard Worker WEDGE_OBLIQUE117 = 4,
55*77c1e3ccSAndroid Build Coastguard Worker WEDGE_OBLIQUE153 = 5,
56*77c1e3ccSAndroid Build Coastguard Worker WEDGE_DIRECTIONS
57*77c1e3ccSAndroid Build Coastguard Worker } UENUM1BYTE(WedgeDirectionType);
58*77c1e3ccSAndroid Build Coastguard Worker
59*77c1e3ccSAndroid Build Coastguard Worker // 3-tuple: {direction, x_offset, y_offset}
60*77c1e3ccSAndroid Build Coastguard Worker typedef struct {
61*77c1e3ccSAndroid Build Coastguard Worker WedgeDirectionType direction;
62*77c1e3ccSAndroid Build Coastguard Worker int x_offset;
63*77c1e3ccSAndroid Build Coastguard Worker int y_offset;
64*77c1e3ccSAndroid Build Coastguard Worker } wedge_code_type;
65*77c1e3ccSAndroid Build Coastguard Worker
66*77c1e3ccSAndroid Build Coastguard Worker typedef uint8_t *wedge_masks_type[MAX_WEDGE_TYPES];
67*77c1e3ccSAndroid Build Coastguard Worker
68*77c1e3ccSAndroid Build Coastguard Worker typedef struct {
69*77c1e3ccSAndroid Build Coastguard Worker int wedge_types;
70*77c1e3ccSAndroid Build Coastguard Worker const wedge_code_type *codebook;
71*77c1e3ccSAndroid Build Coastguard Worker uint8_t *signflip;
72*77c1e3ccSAndroid Build Coastguard Worker wedge_masks_type *masks;
73*77c1e3ccSAndroid Build Coastguard Worker } wedge_params_type;
74*77c1e3ccSAndroid Build Coastguard Worker
75*77c1e3ccSAndroid Build Coastguard Worker extern const wedge_params_type av1_wedge_params_lookup[BLOCK_SIZES_ALL];
76*77c1e3ccSAndroid Build Coastguard Worker
77*77c1e3ccSAndroid Build Coastguard Worker typedef struct SubpelParams {
78*77c1e3ccSAndroid Build Coastguard Worker int xs;
79*77c1e3ccSAndroid Build Coastguard Worker int ys;
80*77c1e3ccSAndroid Build Coastguard Worker int subpel_x;
81*77c1e3ccSAndroid Build Coastguard Worker int subpel_y;
82*77c1e3ccSAndroid Build Coastguard Worker int pos_x;
83*77c1e3ccSAndroid Build Coastguard Worker int pos_y;
84*77c1e3ccSAndroid Build Coastguard Worker } SubpelParams;
85*77c1e3ccSAndroid Build Coastguard Worker
86*77c1e3ccSAndroid Build Coastguard Worker struct build_prediction_ctxt {
87*77c1e3ccSAndroid Build Coastguard Worker const AV1_COMMON *cm;
88*77c1e3ccSAndroid Build Coastguard Worker uint8_t **tmp_buf;
89*77c1e3ccSAndroid Build Coastguard Worker int *tmp_width;
90*77c1e3ccSAndroid Build Coastguard Worker int *tmp_height;
91*77c1e3ccSAndroid Build Coastguard Worker int *tmp_stride;
92*77c1e3ccSAndroid Build Coastguard Worker int mb_to_far_edge;
93*77c1e3ccSAndroid Build Coastguard Worker void *dcb; // Decoder-only coding block.
94*77c1e3ccSAndroid Build Coastguard Worker };
95*77c1e3ccSAndroid Build Coastguard Worker
96*77c1e3ccSAndroid Build Coastguard Worker typedef enum InterPredMode {
97*77c1e3ccSAndroid Build Coastguard Worker TRANSLATION_PRED,
98*77c1e3ccSAndroid Build Coastguard Worker WARP_PRED,
99*77c1e3ccSAndroid Build Coastguard Worker } InterPredMode;
100*77c1e3ccSAndroid Build Coastguard Worker
101*77c1e3ccSAndroid Build Coastguard Worker typedef enum InterCompMode {
102*77c1e3ccSAndroid Build Coastguard Worker UNIFORM_SINGLE,
103*77c1e3ccSAndroid Build Coastguard Worker UNIFORM_COMP,
104*77c1e3ccSAndroid Build Coastguard Worker MASK_COMP,
105*77c1e3ccSAndroid Build Coastguard Worker } InterCompMode;
106*77c1e3ccSAndroid Build Coastguard Worker
107*77c1e3ccSAndroid Build Coastguard Worker typedef struct InterPredParams {
108*77c1e3ccSAndroid Build Coastguard Worker InterPredMode mode;
109*77c1e3ccSAndroid Build Coastguard Worker InterCompMode comp_mode;
110*77c1e3ccSAndroid Build Coastguard Worker WarpedMotionParams warp_params;
111*77c1e3ccSAndroid Build Coastguard Worker ConvolveParams conv_params;
112*77c1e3ccSAndroid Build Coastguard Worker const InterpFilterParams *interp_filter_params[2];
113*77c1e3ccSAndroid Build Coastguard Worker int block_width;
114*77c1e3ccSAndroid Build Coastguard Worker int block_height;
115*77c1e3ccSAndroid Build Coastguard Worker int pix_row;
116*77c1e3ccSAndroid Build Coastguard Worker int pix_col;
117*77c1e3ccSAndroid Build Coastguard Worker struct buf_2d ref_frame_buf;
118*77c1e3ccSAndroid Build Coastguard Worker int subsampling_x;
119*77c1e3ccSAndroid Build Coastguard Worker int subsampling_y;
120*77c1e3ccSAndroid Build Coastguard Worker const struct scale_factors *scale_factors;
121*77c1e3ccSAndroid Build Coastguard Worker int bit_depth;
122*77c1e3ccSAndroid Build Coastguard Worker int use_hbd_buf;
123*77c1e3ccSAndroid Build Coastguard Worker INTERINTER_COMPOUND_DATA mask_comp;
124*77c1e3ccSAndroid Build Coastguard Worker BLOCK_SIZE sb_type;
125*77c1e3ccSAndroid Build Coastguard Worker int is_intrabc;
126*77c1e3ccSAndroid Build Coastguard Worker int top;
127*77c1e3ccSAndroid Build Coastguard Worker int left;
128*77c1e3ccSAndroid Build Coastguard Worker } InterPredParams;
129*77c1e3ccSAndroid Build Coastguard Worker
130*77c1e3ccSAndroid Build Coastguard Worker // Initialize sub-pel params required for inter prediction.
init_subpel_params(const MV * const src_mv,InterPredParams * const inter_pred_params,SubpelParams * subpel_params,int width,int height)131*77c1e3ccSAndroid Build Coastguard Worker static inline void init_subpel_params(const MV *const src_mv,
132*77c1e3ccSAndroid Build Coastguard Worker InterPredParams *const inter_pred_params,
133*77c1e3ccSAndroid Build Coastguard Worker SubpelParams *subpel_params, int width,
134*77c1e3ccSAndroid Build Coastguard Worker int height) {
135*77c1e3ccSAndroid Build Coastguard Worker const struct scale_factors *sf = inter_pred_params->scale_factors;
136*77c1e3ccSAndroid Build Coastguard Worker int ssx = inter_pred_params->subsampling_x;
137*77c1e3ccSAndroid Build Coastguard Worker int ssy = inter_pred_params->subsampling_y;
138*77c1e3ccSAndroid Build Coastguard Worker int orig_pos_y = inter_pred_params->pix_row << SUBPEL_BITS;
139*77c1e3ccSAndroid Build Coastguard Worker orig_pos_y += src_mv->row * (1 << (1 - ssy));
140*77c1e3ccSAndroid Build Coastguard Worker int orig_pos_x = inter_pred_params->pix_col << SUBPEL_BITS;
141*77c1e3ccSAndroid Build Coastguard Worker orig_pos_x += src_mv->col * (1 << (1 - ssx));
142*77c1e3ccSAndroid Build Coastguard Worker const int is_scaled = av1_is_scaled(sf);
143*77c1e3ccSAndroid Build Coastguard Worker int pos_x, pos_y;
144*77c1e3ccSAndroid Build Coastguard Worker if (LIKELY(!is_scaled)) {
145*77c1e3ccSAndroid Build Coastguard Worker pos_y = av1_unscaled_value(orig_pos_y, sf);
146*77c1e3ccSAndroid Build Coastguard Worker pos_x = av1_unscaled_value(orig_pos_x, sf);
147*77c1e3ccSAndroid Build Coastguard Worker } else {
148*77c1e3ccSAndroid Build Coastguard Worker pos_y = av1_scaled_y(orig_pos_y, sf);
149*77c1e3ccSAndroid Build Coastguard Worker pos_x = av1_scaled_x(orig_pos_x, sf);
150*77c1e3ccSAndroid Build Coastguard Worker }
151*77c1e3ccSAndroid Build Coastguard Worker
152*77c1e3ccSAndroid Build Coastguard Worker pos_x += SCALE_EXTRA_OFF;
153*77c1e3ccSAndroid Build Coastguard Worker pos_y += SCALE_EXTRA_OFF;
154*77c1e3ccSAndroid Build Coastguard Worker
155*77c1e3ccSAndroid Build Coastguard Worker const int bottom = (height + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
156*77c1e3ccSAndroid Build Coastguard Worker const int right = (width + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
157*77c1e3ccSAndroid Build Coastguard Worker pos_y = clamp(pos_y, inter_pred_params->top, bottom);
158*77c1e3ccSAndroid Build Coastguard Worker pos_x = clamp(pos_x, inter_pred_params->left, right);
159*77c1e3ccSAndroid Build Coastguard Worker
160*77c1e3ccSAndroid Build Coastguard Worker subpel_params->pos_x = pos_x;
161*77c1e3ccSAndroid Build Coastguard Worker subpel_params->pos_y = pos_y;
162*77c1e3ccSAndroid Build Coastguard Worker subpel_params->subpel_x = pos_x & SCALE_SUBPEL_MASK;
163*77c1e3ccSAndroid Build Coastguard Worker subpel_params->subpel_y = pos_y & SCALE_SUBPEL_MASK;
164*77c1e3ccSAndroid Build Coastguard Worker subpel_params->xs = sf->x_step_q4;
165*77c1e3ccSAndroid Build Coastguard Worker subpel_params->ys = sf->y_step_q4;
166*77c1e3ccSAndroid Build Coastguard Worker }
167*77c1e3ccSAndroid Build Coastguard Worker
168*77c1e3ccSAndroid Build Coastguard Worker // Initialize interp filter required for inter prediction.
init_interp_filter_params(const InterpFilterParams * interp_filter_params[2],const InterpFilters * filter,int block_width,int block_height,int is_intrabc)169*77c1e3ccSAndroid Build Coastguard Worker static inline void init_interp_filter_params(
170*77c1e3ccSAndroid Build Coastguard Worker const InterpFilterParams *interp_filter_params[2],
171*77c1e3ccSAndroid Build Coastguard Worker const InterpFilters *filter, int block_width, int block_height,
172*77c1e3ccSAndroid Build Coastguard Worker int is_intrabc) {
173*77c1e3ccSAndroid Build Coastguard Worker if (UNLIKELY(is_intrabc)) {
174*77c1e3ccSAndroid Build Coastguard Worker interp_filter_params[0] = &av1_intrabc_filter_params;
175*77c1e3ccSAndroid Build Coastguard Worker interp_filter_params[1] = &av1_intrabc_filter_params;
176*77c1e3ccSAndroid Build Coastguard Worker } else {
177*77c1e3ccSAndroid Build Coastguard Worker interp_filter_params[0] = av1_get_interp_filter_params_with_block_size(
178*77c1e3ccSAndroid Build Coastguard Worker (InterpFilter)filter->x_filter, block_width);
179*77c1e3ccSAndroid Build Coastguard Worker interp_filter_params[1] = av1_get_interp_filter_params_with_block_size(
180*77c1e3ccSAndroid Build Coastguard Worker (InterpFilter)filter->y_filter, block_height);
181*77c1e3ccSAndroid Build Coastguard Worker }
182*77c1e3ccSAndroid Build Coastguard Worker }
183*77c1e3ccSAndroid Build Coastguard Worker
184*77c1e3ccSAndroid Build Coastguard Worker // Initialize parameters required for inter prediction at mode level.
init_inter_mode_params(const MV * const src_mv,InterPredParams * const inter_pred_params,SubpelParams * subpel_params,const struct scale_factors * sf,int width,int height)185*77c1e3ccSAndroid Build Coastguard Worker static inline void init_inter_mode_params(
186*77c1e3ccSAndroid Build Coastguard Worker const MV *const src_mv, InterPredParams *const inter_pred_params,
187*77c1e3ccSAndroid Build Coastguard Worker SubpelParams *subpel_params, const struct scale_factors *sf, int width,
188*77c1e3ccSAndroid Build Coastguard Worker int height) {
189*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->scale_factors = sf;
190*77c1e3ccSAndroid Build Coastguard Worker init_subpel_params(src_mv, inter_pred_params, subpel_params, width, height);
191*77c1e3ccSAndroid Build Coastguard Worker }
192*77c1e3ccSAndroid Build Coastguard Worker
193*77c1e3ccSAndroid Build Coastguard Worker // Initialize parameters required for inter prediction at block level.
init_inter_block_params(InterPredParams * inter_pred_params,int block_width,int block_height,int pix_row,int pix_col,int subsampling_x,int subsampling_y,int bit_depth,int use_hbd_buf,int is_intrabc)194*77c1e3ccSAndroid Build Coastguard Worker static inline void init_inter_block_params(InterPredParams *inter_pred_params,
195*77c1e3ccSAndroid Build Coastguard Worker int block_width, int block_height,
196*77c1e3ccSAndroid Build Coastguard Worker int pix_row, int pix_col,
197*77c1e3ccSAndroid Build Coastguard Worker int subsampling_x, int subsampling_y,
198*77c1e3ccSAndroid Build Coastguard Worker int bit_depth, int use_hbd_buf,
199*77c1e3ccSAndroid Build Coastguard Worker int is_intrabc) {
200*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->block_width = block_width;
201*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->block_height = block_height;
202*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->pix_row = pix_row;
203*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->pix_col = pix_col;
204*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->subsampling_x = subsampling_x;
205*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->subsampling_y = subsampling_y;
206*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->bit_depth = bit_depth;
207*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->use_hbd_buf = use_hbd_buf;
208*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->is_intrabc = is_intrabc;
209*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->mode = TRANSLATION_PRED;
210*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->comp_mode = UNIFORM_SINGLE;
211*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->top = -AOM_LEFT_TOP_MARGIN_SCALED(subsampling_y);
212*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->left = -AOM_LEFT_TOP_MARGIN_SCALED(subsampling_x);
213*77c1e3ccSAndroid Build Coastguard Worker }
214*77c1e3ccSAndroid Build Coastguard Worker
215*77c1e3ccSAndroid Build Coastguard Worker // Initialize params required for inter prediction.
av1_init_inter_params(InterPredParams * inter_pred_params,int block_width,int block_height,int pix_row,int pix_col,int subsampling_x,int subsampling_y,int bit_depth,int use_hbd_buf,int is_intrabc,const struct scale_factors * sf,const struct buf_2d * ref_buf,int_interpfilters interp_filters)216*77c1e3ccSAndroid Build Coastguard Worker static inline void av1_init_inter_params(
217*77c1e3ccSAndroid Build Coastguard Worker InterPredParams *inter_pred_params, int block_width, int block_height,
218*77c1e3ccSAndroid Build Coastguard Worker int pix_row, int pix_col, int subsampling_x, int subsampling_y,
219*77c1e3ccSAndroid Build Coastguard Worker int bit_depth, int use_hbd_buf, int is_intrabc,
220*77c1e3ccSAndroid Build Coastguard Worker const struct scale_factors *sf, const struct buf_2d *ref_buf,
221*77c1e3ccSAndroid Build Coastguard Worker int_interpfilters interp_filters) {
222*77c1e3ccSAndroid Build Coastguard Worker init_inter_block_params(inter_pred_params, block_width, block_height, pix_row,
223*77c1e3ccSAndroid Build Coastguard Worker pix_col, subsampling_x, subsampling_y, bit_depth,
224*77c1e3ccSAndroid Build Coastguard Worker use_hbd_buf, is_intrabc);
225*77c1e3ccSAndroid Build Coastguard Worker init_interp_filter_params(inter_pred_params->interp_filter_params,
226*77c1e3ccSAndroid Build Coastguard Worker &interp_filters.as_filters, block_width,
227*77c1e3ccSAndroid Build Coastguard Worker block_height, is_intrabc);
228*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->scale_factors = sf;
229*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->ref_frame_buf = *ref_buf;
230*77c1e3ccSAndroid Build Coastguard Worker }
231*77c1e3ccSAndroid Build Coastguard Worker
av1_init_comp_mode(InterPredParams * inter_pred_params)232*77c1e3ccSAndroid Build Coastguard Worker static inline void av1_init_comp_mode(InterPredParams *inter_pred_params) {
233*77c1e3ccSAndroid Build Coastguard Worker inter_pred_params->comp_mode = UNIFORM_COMP;
234*77c1e3ccSAndroid Build Coastguard Worker }
235*77c1e3ccSAndroid Build Coastguard Worker
236*77c1e3ccSAndroid Build Coastguard Worker void av1_init_warp_params(InterPredParams *inter_pred_params,
237*77c1e3ccSAndroid Build Coastguard Worker const WarpTypesAllowed *warp_types, int ref,
238*77c1e3ccSAndroid Build Coastguard Worker const MACROBLOCKD *xd, const MB_MODE_INFO *mi);
239*77c1e3ccSAndroid Build Coastguard Worker
has_scale(int xs,int ys)240*77c1e3ccSAndroid Build Coastguard Worker static inline int has_scale(int xs, int ys) {
241*77c1e3ccSAndroid Build Coastguard Worker return xs != SCALE_SUBPEL_SHIFTS || ys != SCALE_SUBPEL_SHIFTS;
242*77c1e3ccSAndroid Build Coastguard Worker }
243*77c1e3ccSAndroid Build Coastguard Worker
revert_scale_extra_bits(SubpelParams * sp)244*77c1e3ccSAndroid Build Coastguard Worker static inline void revert_scale_extra_bits(SubpelParams *sp) {
245*77c1e3ccSAndroid Build Coastguard Worker sp->subpel_x >>= SCALE_EXTRA_BITS;
246*77c1e3ccSAndroid Build Coastguard Worker sp->subpel_y >>= SCALE_EXTRA_BITS;
247*77c1e3ccSAndroid Build Coastguard Worker sp->xs >>= SCALE_EXTRA_BITS;
248*77c1e3ccSAndroid Build Coastguard Worker sp->ys >>= SCALE_EXTRA_BITS;
249*77c1e3ccSAndroid Build Coastguard Worker assert(sp->subpel_x < SUBPEL_SHIFTS);
250*77c1e3ccSAndroid Build Coastguard Worker assert(sp->subpel_y < SUBPEL_SHIFTS);
251*77c1e3ccSAndroid Build Coastguard Worker assert(sp->xs <= SUBPEL_SHIFTS);
252*77c1e3ccSAndroid Build Coastguard Worker assert(sp->ys <= SUBPEL_SHIFTS);
253*77c1e3ccSAndroid Build Coastguard Worker }
254*77c1e3ccSAndroid Build Coastguard Worker
inter_predictor(const uint8_t * src,int src_stride,uint8_t * dst,int dst_stride,const SubpelParams * subpel_params,int w,int h,ConvolveParams * conv_params,const InterpFilterParams * interp_filters[2])255*77c1e3ccSAndroid Build Coastguard Worker static inline void inter_predictor(
256*77c1e3ccSAndroid Build Coastguard Worker const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride,
257*77c1e3ccSAndroid Build Coastguard Worker const SubpelParams *subpel_params, int w, int h,
258*77c1e3ccSAndroid Build Coastguard Worker ConvolveParams *conv_params, const InterpFilterParams *interp_filters[2]) {
259*77c1e3ccSAndroid Build Coastguard Worker assert(conv_params->do_average == 0 || conv_params->do_average == 1);
260*77c1e3ccSAndroid Build Coastguard Worker const int is_scaled = has_scale(subpel_params->xs, subpel_params->ys);
261*77c1e3ccSAndroid Build Coastguard Worker if (is_scaled) {
262*77c1e3ccSAndroid Build Coastguard Worker av1_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
263*77c1e3ccSAndroid Build Coastguard Worker interp_filters, subpel_params->subpel_x,
264*77c1e3ccSAndroid Build Coastguard Worker subpel_params->xs, subpel_params->subpel_y,
265*77c1e3ccSAndroid Build Coastguard Worker subpel_params->ys, 1, conv_params);
266*77c1e3ccSAndroid Build Coastguard Worker } else {
267*77c1e3ccSAndroid Build Coastguard Worker SubpelParams sp = *subpel_params;
268*77c1e3ccSAndroid Build Coastguard Worker revert_scale_extra_bits(&sp);
269*77c1e3ccSAndroid Build Coastguard Worker av1_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
270*77c1e3ccSAndroid Build Coastguard Worker interp_filters, sp.subpel_x, sp.xs, sp.subpel_y,
271*77c1e3ccSAndroid Build Coastguard Worker sp.ys, 0, conv_params);
272*77c1e3ccSAndroid Build Coastguard Worker }
273*77c1e3ccSAndroid Build Coastguard Worker }
274*77c1e3ccSAndroid Build Coastguard Worker
highbd_inter_predictor(const uint8_t * src,int src_stride,uint8_t * dst,int dst_stride,const SubpelParams * subpel_params,int w,int h,ConvolveParams * conv_params,const InterpFilterParams * interp_filters[2],int bd)275*77c1e3ccSAndroid Build Coastguard Worker static inline void highbd_inter_predictor(
276*77c1e3ccSAndroid Build Coastguard Worker const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride,
277*77c1e3ccSAndroid Build Coastguard Worker const SubpelParams *subpel_params, int w, int h,
278*77c1e3ccSAndroid Build Coastguard Worker ConvolveParams *conv_params, const InterpFilterParams *interp_filters[2],
279*77c1e3ccSAndroid Build Coastguard Worker int bd) {
280*77c1e3ccSAndroid Build Coastguard Worker assert(conv_params->do_average == 0 || conv_params->do_average == 1);
281*77c1e3ccSAndroid Build Coastguard Worker const int is_scaled = has_scale(subpel_params->xs, subpel_params->ys);
282*77c1e3ccSAndroid Build Coastguard Worker if (is_scaled) {
283*77c1e3ccSAndroid Build Coastguard Worker av1_highbd_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
284*77c1e3ccSAndroid Build Coastguard Worker interp_filters, subpel_params->subpel_x,
285*77c1e3ccSAndroid Build Coastguard Worker subpel_params->xs, subpel_params->subpel_y,
286*77c1e3ccSAndroid Build Coastguard Worker subpel_params->ys, 1, conv_params, bd);
287*77c1e3ccSAndroid Build Coastguard Worker } else {
288*77c1e3ccSAndroid Build Coastguard Worker SubpelParams sp = *subpel_params;
289*77c1e3ccSAndroid Build Coastguard Worker revert_scale_extra_bits(&sp);
290*77c1e3ccSAndroid Build Coastguard Worker av1_highbd_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
291*77c1e3ccSAndroid Build Coastguard Worker interp_filters, sp.subpel_x, sp.xs,
292*77c1e3ccSAndroid Build Coastguard Worker sp.subpel_y, sp.ys, 0, conv_params, bd);
293*77c1e3ccSAndroid Build Coastguard Worker }
294*77c1e3ccSAndroid Build Coastguard Worker }
295*77c1e3ccSAndroid Build Coastguard Worker
296*77c1e3ccSAndroid Build Coastguard Worker int av1_skip_u4x4_pred_in_obmc(BLOCK_SIZE bsize,
297*77c1e3ccSAndroid Build Coastguard Worker const struct macroblockd_plane *pd, int dir);
298*77c1e3ccSAndroid Build Coastguard Worker
is_interinter_compound_used(COMPOUND_TYPE type,BLOCK_SIZE sb_type)299*77c1e3ccSAndroid Build Coastguard Worker static inline int is_interinter_compound_used(COMPOUND_TYPE type,
300*77c1e3ccSAndroid Build Coastguard Worker BLOCK_SIZE sb_type) {
301*77c1e3ccSAndroid Build Coastguard Worker const int comp_allowed = is_comp_ref_allowed(sb_type);
302*77c1e3ccSAndroid Build Coastguard Worker switch (type) {
303*77c1e3ccSAndroid Build Coastguard Worker case COMPOUND_AVERAGE:
304*77c1e3ccSAndroid Build Coastguard Worker case COMPOUND_DISTWTD:
305*77c1e3ccSAndroid Build Coastguard Worker case COMPOUND_DIFFWTD: return comp_allowed;
306*77c1e3ccSAndroid Build Coastguard Worker case COMPOUND_WEDGE:
307*77c1e3ccSAndroid Build Coastguard Worker return comp_allowed && av1_wedge_params_lookup[sb_type].wedge_types > 0;
308*77c1e3ccSAndroid Build Coastguard Worker default: assert(0); return 0;
309*77c1e3ccSAndroid Build Coastguard Worker }
310*77c1e3ccSAndroid Build Coastguard Worker }
311*77c1e3ccSAndroid Build Coastguard Worker
is_any_masked_compound_used(BLOCK_SIZE sb_type)312*77c1e3ccSAndroid Build Coastguard Worker static inline int is_any_masked_compound_used(BLOCK_SIZE sb_type) {
313*77c1e3ccSAndroid Build Coastguard Worker COMPOUND_TYPE comp_type;
314*77c1e3ccSAndroid Build Coastguard Worker int i;
315*77c1e3ccSAndroid Build Coastguard Worker if (!is_comp_ref_allowed(sb_type)) return 0;
316*77c1e3ccSAndroid Build Coastguard Worker for (i = 0; i < COMPOUND_TYPES; i++) {
317*77c1e3ccSAndroid Build Coastguard Worker comp_type = (COMPOUND_TYPE)i;
318*77c1e3ccSAndroid Build Coastguard Worker if (is_masked_compound_type(comp_type) &&
319*77c1e3ccSAndroid Build Coastguard Worker is_interinter_compound_used(comp_type, sb_type))
320*77c1e3ccSAndroid Build Coastguard Worker return 1;
321*77c1e3ccSAndroid Build Coastguard Worker }
322*77c1e3ccSAndroid Build Coastguard Worker return 0;
323*77c1e3ccSAndroid Build Coastguard Worker }
324*77c1e3ccSAndroid Build Coastguard Worker
get_wedge_types_lookup(BLOCK_SIZE sb_type)325*77c1e3ccSAndroid Build Coastguard Worker static inline int get_wedge_types_lookup(BLOCK_SIZE sb_type) {
326*77c1e3ccSAndroid Build Coastguard Worker return av1_wedge_params_lookup[sb_type].wedge_types;
327*77c1e3ccSAndroid Build Coastguard Worker }
328*77c1e3ccSAndroid Build Coastguard Worker
av1_is_wedge_used(BLOCK_SIZE sb_type)329*77c1e3ccSAndroid Build Coastguard Worker static inline int av1_is_wedge_used(BLOCK_SIZE sb_type) {
330*77c1e3ccSAndroid Build Coastguard Worker return av1_wedge_params_lookup[sb_type].wedge_types > 0;
331*77c1e3ccSAndroid Build Coastguard Worker }
332*77c1e3ccSAndroid Build Coastguard Worker
333*77c1e3ccSAndroid Build Coastguard Worker void av1_make_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst,
334*77c1e3ccSAndroid Build Coastguard Worker int dst_stride,
335*77c1e3ccSAndroid Build Coastguard Worker InterPredParams *inter_pred_params,
336*77c1e3ccSAndroid Build Coastguard Worker const SubpelParams *subpel_params);
337*77c1e3ccSAndroid Build Coastguard Worker void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride,
338*77c1e3ccSAndroid Build Coastguard Worker uint8_t *dst, int dst_stride,
339*77c1e3ccSAndroid Build Coastguard Worker InterPredParams *inter_pred_params,
340*77c1e3ccSAndroid Build Coastguard Worker const SubpelParams *subpel_params);
341*77c1e3ccSAndroid Build Coastguard Worker
342*77c1e3ccSAndroid Build Coastguard Worker // TODO(jkoleszar): yet another mv clamping function :-(
clamp_mv_to_umv_border_sb(const MACROBLOCKD * xd,const MV * src_mv,int bw,int bh,int ss_x,int ss_y)343*77c1e3ccSAndroid Build Coastguard Worker static inline MV clamp_mv_to_umv_border_sb(const MACROBLOCKD *xd,
344*77c1e3ccSAndroid Build Coastguard Worker const MV *src_mv, int bw, int bh,
345*77c1e3ccSAndroid Build Coastguard Worker int ss_x, int ss_y) {
346*77c1e3ccSAndroid Build Coastguard Worker // If the MV points so far into the UMV border that no visible pixels
347*77c1e3ccSAndroid Build Coastguard Worker // are used for reconstruction, the subpel part of the MV can be
348*77c1e3ccSAndroid Build Coastguard Worker // discarded and the MV limited to 16 pixels with equivalent results.
349*77c1e3ccSAndroid Build Coastguard Worker const int spel_left = (AOM_INTERP_EXTEND + bw) << SUBPEL_BITS;
350*77c1e3ccSAndroid Build Coastguard Worker const int spel_right = spel_left - SUBPEL_SHIFTS;
351*77c1e3ccSAndroid Build Coastguard Worker const int spel_top = (AOM_INTERP_EXTEND + bh) << SUBPEL_BITS;
352*77c1e3ccSAndroid Build Coastguard Worker const int spel_bottom = spel_top - SUBPEL_SHIFTS;
353*77c1e3ccSAndroid Build Coastguard Worker MV clamped_mv = { (int16_t)(src_mv->row * (1 << (1 - ss_y))),
354*77c1e3ccSAndroid Build Coastguard Worker (int16_t)(src_mv->col * (1 << (1 - ss_x))) };
355*77c1e3ccSAndroid Build Coastguard Worker assert(ss_x <= 1);
356*77c1e3ccSAndroid Build Coastguard Worker assert(ss_y <= 1);
357*77c1e3ccSAndroid Build Coastguard Worker const SubpelMvLimits mv_limits = {
358*77c1e3ccSAndroid Build Coastguard Worker xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left,
359*77c1e3ccSAndroid Build Coastguard Worker xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right,
360*77c1e3ccSAndroid Build Coastguard Worker xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top,
361*77c1e3ccSAndroid Build Coastguard Worker xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom
362*77c1e3ccSAndroid Build Coastguard Worker };
363*77c1e3ccSAndroid Build Coastguard Worker
364*77c1e3ccSAndroid Build Coastguard Worker clamp_mv(&clamped_mv, &mv_limits);
365*77c1e3ccSAndroid Build Coastguard Worker
366*77c1e3ccSAndroid Build Coastguard Worker return clamped_mv;
367*77c1e3ccSAndroid Build Coastguard Worker }
368*77c1e3ccSAndroid Build Coastguard Worker
scaled_buffer_offset(int x_offset,int y_offset,int stride,const struct scale_factors * sf)369*77c1e3ccSAndroid Build Coastguard Worker static inline int64_t scaled_buffer_offset(int x_offset, int y_offset,
370*77c1e3ccSAndroid Build Coastguard Worker int stride,
371*77c1e3ccSAndroid Build Coastguard Worker const struct scale_factors *sf) {
372*77c1e3ccSAndroid Build Coastguard Worker int x, y;
373*77c1e3ccSAndroid Build Coastguard Worker if (!sf) {
374*77c1e3ccSAndroid Build Coastguard Worker x = x_offset;
375*77c1e3ccSAndroid Build Coastguard Worker y = y_offset;
376*77c1e3ccSAndroid Build Coastguard Worker } else if (av1_is_scaled(sf)) {
377*77c1e3ccSAndroid Build Coastguard Worker x = av1_scaled_x(x_offset, sf) >> SCALE_EXTRA_BITS;
378*77c1e3ccSAndroid Build Coastguard Worker y = av1_scaled_y(y_offset, sf) >> SCALE_EXTRA_BITS;
379*77c1e3ccSAndroid Build Coastguard Worker } else {
380*77c1e3ccSAndroid Build Coastguard Worker x = av1_unscaled_value(x_offset, sf) >> SCALE_EXTRA_BITS;
381*77c1e3ccSAndroid Build Coastguard Worker y = av1_unscaled_value(y_offset, sf) >> SCALE_EXTRA_BITS;
382*77c1e3ccSAndroid Build Coastguard Worker }
383*77c1e3ccSAndroid Build Coastguard Worker return (int64_t)y * stride + x;
384*77c1e3ccSAndroid Build Coastguard Worker }
385*77c1e3ccSAndroid Build Coastguard Worker
setup_pred_plane(struct buf_2d * dst,BLOCK_SIZE bsize,uint8_t * src,int width,int height,int stride,int mi_row,int mi_col,const struct scale_factors * scale,int subsampling_x,int subsampling_y)386*77c1e3ccSAndroid Build Coastguard Worker static inline void setup_pred_plane(struct buf_2d *dst, BLOCK_SIZE bsize,
387*77c1e3ccSAndroid Build Coastguard Worker uint8_t *src, int width, int height,
388*77c1e3ccSAndroid Build Coastguard Worker int stride, int mi_row, int mi_col,
389*77c1e3ccSAndroid Build Coastguard Worker const struct scale_factors *scale,
390*77c1e3ccSAndroid Build Coastguard Worker int subsampling_x, int subsampling_y) {
391*77c1e3ccSAndroid Build Coastguard Worker // Offset the buffer pointer
392*77c1e3ccSAndroid Build Coastguard Worker if (subsampling_y && (mi_row & 0x01) && (mi_size_high[bsize] == 1))
393*77c1e3ccSAndroid Build Coastguard Worker mi_row -= 1;
394*77c1e3ccSAndroid Build Coastguard Worker if (subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1))
395*77c1e3ccSAndroid Build Coastguard Worker mi_col -= 1;
396*77c1e3ccSAndroid Build Coastguard Worker
397*77c1e3ccSAndroid Build Coastguard Worker const int x = (MI_SIZE * mi_col) >> subsampling_x;
398*77c1e3ccSAndroid Build Coastguard Worker const int y = (MI_SIZE * mi_row) >> subsampling_y;
399*77c1e3ccSAndroid Build Coastguard Worker dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
400*77c1e3ccSAndroid Build Coastguard Worker dst->buf0 = src;
401*77c1e3ccSAndroid Build Coastguard Worker dst->width = width;
402*77c1e3ccSAndroid Build Coastguard Worker dst->height = height;
403*77c1e3ccSAndroid Build Coastguard Worker dst->stride = stride;
404*77c1e3ccSAndroid Build Coastguard Worker }
405*77c1e3ccSAndroid Build Coastguard Worker
406*77c1e3ccSAndroid Build Coastguard Worker void av1_setup_dst_planes(struct macroblockd_plane *planes, BLOCK_SIZE bsize,
407*77c1e3ccSAndroid Build Coastguard Worker const YV12_BUFFER_CONFIG *src, int mi_row, int mi_col,
408*77c1e3ccSAndroid Build Coastguard Worker const int plane_start, const int plane_end);
409*77c1e3ccSAndroid Build Coastguard Worker
410*77c1e3ccSAndroid Build Coastguard Worker void av1_setup_pre_planes(MACROBLOCKD *xd, int idx,
411*77c1e3ccSAndroid Build Coastguard Worker const YV12_BUFFER_CONFIG *src, int mi_row, int mi_col,
412*77c1e3ccSAndroid Build Coastguard Worker const struct scale_factors *sf, const int num_planes);
413*77c1e3ccSAndroid Build Coastguard Worker
set_default_interp_filters(MB_MODE_INFO * const mbmi,InterpFilter frame_interp_filter)414*77c1e3ccSAndroid Build Coastguard Worker static inline void set_default_interp_filters(
415*77c1e3ccSAndroid Build Coastguard Worker MB_MODE_INFO *const mbmi, InterpFilter frame_interp_filter) {
416*77c1e3ccSAndroid Build Coastguard Worker mbmi->interp_filters =
417*77c1e3ccSAndroid Build Coastguard Worker av1_broadcast_interp_filter(av1_unswitchable_filter(frame_interp_filter));
418*77c1e3ccSAndroid Build Coastguard Worker }
419*77c1e3ccSAndroid Build Coastguard Worker
av1_is_interp_needed(const MACROBLOCKD * const xd)420*77c1e3ccSAndroid Build Coastguard Worker static inline int av1_is_interp_needed(const MACROBLOCKD *const xd) {
421*77c1e3ccSAndroid Build Coastguard Worker const MB_MODE_INFO *const mbmi = xd->mi[0];
422*77c1e3ccSAndroid Build Coastguard Worker if (mbmi->skip_mode) return 0;
423*77c1e3ccSAndroid Build Coastguard Worker if (mbmi->motion_mode == WARPED_CAUSAL) return 0;
424*77c1e3ccSAndroid Build Coastguard Worker if (is_nontrans_global_motion(xd, xd->mi[0])) return 0;
425*77c1e3ccSAndroid Build Coastguard Worker return 1;
426*77c1e3ccSAndroid Build Coastguard Worker }
427*77c1e3ccSAndroid Build Coastguard Worker
428*77c1e3ccSAndroid Build Coastguard Worker // Sets up buffers 'dst_buf1' and 'dst_buf2' from relevant buffers in 'xd' for
429*77c1e3ccSAndroid Build Coastguard Worker // subsequent use in OBMC prediction.
430*77c1e3ccSAndroid Build Coastguard Worker void av1_setup_obmc_dst_bufs(MACROBLOCKD *xd, uint8_t **dst_buf1,
431*77c1e3ccSAndroid Build Coastguard Worker uint8_t **dst_buf2);
432*77c1e3ccSAndroid Build Coastguard Worker
433*77c1e3ccSAndroid Build Coastguard Worker void av1_setup_build_prediction_by_above_pred(
434*77c1e3ccSAndroid Build Coastguard Worker MACROBLOCKD *xd, int rel_mi_col, uint8_t above_mi_width,
435*77c1e3ccSAndroid Build Coastguard Worker MB_MODE_INFO *above_mbmi, struct build_prediction_ctxt *ctxt,
436*77c1e3ccSAndroid Build Coastguard Worker const int num_planes);
437*77c1e3ccSAndroid Build Coastguard Worker void av1_setup_build_prediction_by_left_pred(MACROBLOCKD *xd, int rel_mi_row,
438*77c1e3ccSAndroid Build Coastguard Worker uint8_t left_mi_height,
439*77c1e3ccSAndroid Build Coastguard Worker MB_MODE_INFO *left_mbmi,
440*77c1e3ccSAndroid Build Coastguard Worker struct build_prediction_ctxt *ctxt,
441*77c1e3ccSAndroid Build Coastguard Worker const int num_planes);
442*77c1e3ccSAndroid Build Coastguard Worker void av1_build_obmc_inter_prediction(const AV1_COMMON *cm, MACROBLOCKD *xd,
443*77c1e3ccSAndroid Build Coastguard Worker uint8_t *above[MAX_MB_PLANE],
444*77c1e3ccSAndroid Build Coastguard Worker int above_stride[MAX_MB_PLANE],
445*77c1e3ccSAndroid Build Coastguard Worker uint8_t *left[MAX_MB_PLANE],
446*77c1e3ccSAndroid Build Coastguard Worker int left_stride[MAX_MB_PLANE]);
447*77c1e3ccSAndroid Build Coastguard Worker
448*77c1e3ccSAndroid Build Coastguard Worker const uint8_t *av1_get_obmc_mask(int length);
449*77c1e3ccSAndroid Build Coastguard Worker void av1_count_overlappable_neighbors(const AV1_COMMON *cm, MACROBLOCKD *xd);
450*77c1e3ccSAndroid Build Coastguard Worker
451*77c1e3ccSAndroid Build Coastguard Worker #define MASK_MASTER_SIZE ((MAX_WEDGE_SIZE) << 1)
452*77c1e3ccSAndroid Build Coastguard Worker #define MASK_MASTER_STRIDE (MASK_MASTER_SIZE)
453*77c1e3ccSAndroid Build Coastguard Worker
454*77c1e3ccSAndroid Build Coastguard Worker void av1_init_wedge_masks(void);
455*77c1e3ccSAndroid Build Coastguard Worker
av1_get_contiguous_soft_mask(int8_t wedge_index,int8_t wedge_sign,BLOCK_SIZE sb_type)456*77c1e3ccSAndroid Build Coastguard Worker static inline const uint8_t *av1_get_contiguous_soft_mask(int8_t wedge_index,
457*77c1e3ccSAndroid Build Coastguard Worker int8_t wedge_sign,
458*77c1e3ccSAndroid Build Coastguard Worker BLOCK_SIZE sb_type) {
459*77c1e3ccSAndroid Build Coastguard Worker return av1_wedge_params_lookup[sb_type].masks[wedge_sign][wedge_index];
460*77c1e3ccSAndroid Build Coastguard Worker }
461*77c1e3ccSAndroid Build Coastguard Worker
462*77c1e3ccSAndroid Build Coastguard Worker void av1_dist_wtd_comp_weight_assign(const AV1_COMMON *cm,
463*77c1e3ccSAndroid Build Coastguard Worker const MB_MODE_INFO *mbmi, int *fwd_offset,
464*77c1e3ccSAndroid Build Coastguard Worker int *bck_offset,
465*77c1e3ccSAndroid Build Coastguard Worker int *use_dist_wtd_comp_avg,
466*77c1e3ccSAndroid Build Coastguard Worker int is_compound);
467*77c1e3ccSAndroid Build Coastguard Worker
468*77c1e3ccSAndroid Build Coastguard Worker const uint8_t *av1_get_compound_type_mask(
469*77c1e3ccSAndroid Build Coastguard Worker const INTERINTER_COMPOUND_DATA *const comp_data, BLOCK_SIZE sb_type);
470*77c1e3ccSAndroid Build Coastguard Worker
471*77c1e3ccSAndroid Build Coastguard Worker // build interintra_predictors for one plane
472*77c1e3ccSAndroid Build Coastguard Worker void av1_build_interintra_predictor(const AV1_COMMON *cm, MACROBLOCKD *xd,
473*77c1e3ccSAndroid Build Coastguard Worker uint8_t *pred, int stride,
474*77c1e3ccSAndroid Build Coastguard Worker const BUFFER_SET *ctx, int plane,
475*77c1e3ccSAndroid Build Coastguard Worker BLOCK_SIZE bsize);
476*77c1e3ccSAndroid Build Coastguard Worker
477*77c1e3ccSAndroid Build Coastguard Worker void av1_build_intra_predictors_for_interintra(const AV1_COMMON *cm,
478*77c1e3ccSAndroid Build Coastguard Worker MACROBLOCKD *xd,
479*77c1e3ccSAndroid Build Coastguard Worker BLOCK_SIZE bsize, int plane,
480*77c1e3ccSAndroid Build Coastguard Worker const BUFFER_SET *ctx,
481*77c1e3ccSAndroid Build Coastguard Worker uint8_t *dst, int dst_stride);
482*77c1e3ccSAndroid Build Coastguard Worker
483*77c1e3ccSAndroid Build Coastguard Worker void av1_combine_interintra(MACROBLOCKD *xd, BLOCK_SIZE bsize, int plane,
484*77c1e3ccSAndroid Build Coastguard Worker const uint8_t *inter_pred, int inter_stride,
485*77c1e3ccSAndroid Build Coastguard Worker const uint8_t *intra_pred, int intra_stride);
486*77c1e3ccSAndroid Build Coastguard Worker
487*77c1e3ccSAndroid Build Coastguard Worker #ifdef __cplusplus
488*77c1e3ccSAndroid Build Coastguard Worker } // extern "C"
489*77c1e3ccSAndroid Build Coastguard Worker #endif
490*77c1e3ccSAndroid Build Coastguard Worker
491*77c1e3ccSAndroid Build Coastguard Worker #endif // AOM_AV1_COMMON_RECONINTER_H_
492