Lines Matching +full:- +full:rf
27 #define REFMVS_LIMIT ((1 << 12) - 1)
38 if (!oh->enable_order_hint) return 0; in get_relative_dist()
40 const int bits = oh->order_hint_bits_minus_1 + 1; in get_relative_dist()
46 int diff = a - b; in get_relative_dist()
47 const int m = 1 << (bits - 1); in get_relative_dist()
48 diff = (diff & (m - 1)) - (diff & m); in get_relative_dist()
54 xd->mb_to_left_edge - GET_MV_SUBPEL(bw) - MV_BORDER, in clamp_mv_ref()
55 xd->mb_to_right_edge + GET_MV_SUBPEL(bw) + MV_BORDER, in clamp_mv_ref()
56 xd->mb_to_top_edge - GET_MV_SUBPEL(bh) - MV_BORDER, in clamp_mv_ref()
57 xd->mb_to_bottom_edge + GET_MV_SUBPEL(bh) + MV_BORDER in clamp_mv_ref()
63 return candidate->mv[which_mv]; in get_block_mv()
70 return !(mi_row + mi_pos->row < tile->mi_row_start || in is_inside()
71 mi_col + mi_pos->col < tile->mi_col_start || in is_inside()
72 mi_row + mi_pos->row >= tile->mi_row_end || in is_inside()
73 mi_col + mi_pos->col >= tile->mi_col_end); in is_inside()
78 return clamp(row_offset, tile->mi_row_start - mi_row, in find_valid_row_offset()
79 tile->mi_row_end - mi_row - 1); in find_valid_row_offset()
84 return clamp(col_offset, tile->mi_col_start - mi_col, in find_valid_col_offset()
85 tile->mi_col_end - mi_col - 1); in find_valid_col_offset()
93 if (mv->row & 1) mv->row += (mv->row > 0 ? -1 : 1); in lower_mv_precision()
94 if (mv->col & 1) mv->col += (mv->col > 0 ? -1 : 1); in lower_mv_precision()
99 static INLINE int8_t get_uni_comp_ref_idx(const MV_REFERENCE_FRAME *const rf) { in get_uni_comp_ref_idx() argument
101 if (rf[1] <= INTRA_FRAME) return -1; in get_uni_comp_ref_idx()
103 // Bi-directional comp ref pred in get_uni_comp_ref_idx()
104 if ((rf[0] < BWDREF_FRAME) && (rf[1] >= BWDREF_FRAME)) return -1; in get_uni_comp_ref_idx()
107 if (rf[0] == comp_ref0(ref_idx) && rf[1] == comp_ref1(ref_idx)) in get_uni_comp_ref_idx()
110 return -1; in get_uni_comp_ref_idx()
113 static INLINE int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) { in av1_ref_frame_type() argument
114 if (rf[1] > INTRA_FRAME) { in av1_ref_frame_type()
115 const int8_t uni_comp_ref_idx = get_uni_comp_ref_idx(rf); in av1_ref_frame_type()
121 return REF_FRAMES + FWD_RF_OFFSET(rf[0]) + in av1_ref_frame_type()
122 BWD_RF_OFFSET(rf[1]) * FWD_REFS; in av1_ref_frame_type()
126 return rf[0]; in av1_ref_frame_type()
129 // clang-format off
145 // which may use the most recent one-sided reference frame pair.
150 // clang-format on
152 static INLINE void av1_set_ref_frame(MV_REFERENCE_FRAME *rf, in av1_set_ref_frame() argument
155 rf[0] = ref_frame_map[ref_frame_type - REF_FRAMES][0]; in av1_set_ref_frame()
156 rf[1] = ref_frame_map[ref_frame_type - REF_FRAMES][1]; in av1_set_ref_frame()
159 rf[0] = ref_frame_type; in av1_set_ref_frame()
160 rf[1] = NONE_FRAME; in av1_set_ref_frame()
171 const int16_t *const mode_context, const MV_REFERENCE_FRAME *const rf) { in av1_mode_context_analyzer() argument
172 const int8_t ref_frame = av1_ref_frame_type(rf); in av1_mode_context_analyzer()
174 if (rf[1] <= INTRA_FRAME) return mode_context[ref_frame]; in av1_mode_context_analyzer()
181 newmv_ctx, COMP_NEWMV_CTXS - 1)]; in av1_mode_context_analyzer()
210 av1_zero(xd->neighbors_ref_counts); in av1_collect_neighbors_ref_counts()
212 uint8_t *const ref_counts = xd->neighbors_ref_counts; in av1_collect_neighbors_ref_counts()
214 const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; in av1_collect_neighbors_ref_counts()
215 const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; in av1_collect_neighbors_ref_counts()
216 const int above_in_image = xd->up_available; in av1_collect_neighbors_ref_counts()
217 const int left_in_image = xd->left_available; in av1_collect_neighbors_ref_counts()
221 ref_counts[above_mbmi->ref_frame[0]]++; in av1_collect_neighbors_ref_counts()
223 ref_counts[above_mbmi->ref_frame[1]]++; in av1_collect_neighbors_ref_counts()
229 ref_counts[left_mbmi->ref_frame[0]]++; in av1_collect_neighbors_ref_counts()
231 ref_counts[left_mbmi->ref_frame[1]]++; in av1_collect_neighbors_ref_counts()
267 if (mi_row - mib_size < tile->mi_row_start) { in av1_find_ref_dv()
268 ref_dv->as_fullmv.row = 0; in av1_find_ref_dv()
269 ref_dv->as_fullmv.col = -MI_SIZE * mib_size - INTRABC_DELAY_PIXELS; in av1_find_ref_dv()
271 ref_dv->as_fullmv.row = -MI_SIZE * mib_size; in av1_find_ref_dv()
272 ref_dv->as_fullmv.col = 0; in av1_find_ref_dv()
285 if (((dv.row & (SCALE_PX_TO_MV - 1)) || (dv.col & (SCALE_PX_TO_MV - 1)))) in av1_is_dv_valid()
288 const TileInfo *const tile = &xd->tile; in av1_is_dv_valid()
289 // Is the source top-left inside the current tile? in av1_is_dv_valid()
291 const int tile_top_edge = tile->mi_row_start * MI_SIZE * SCALE_PX_TO_MV; in av1_is_dv_valid()
294 const int tile_left_edge = tile->mi_col_start * MI_SIZE * SCALE_PX_TO_MV; in av1_is_dv_valid()
298 const int tile_bottom_edge = tile->mi_row_end * MI_SIZE * SCALE_PX_TO_MV; in av1_is_dv_valid()
301 const int tile_right_edge = tile->mi_col_end * MI_SIZE * SCALE_PX_TO_MV; in av1_is_dv_valid()
306 if (xd->is_chroma_ref && av1_num_planes(cm) > 1) { in av1_is_dv_valid()
307 const struct macroblockd_plane *const pd = &xd->plane[1]; in av1_is_dv_valid()
308 if (bw < 8 && pd->subsampling_x) in av1_is_dv_valid()
310 if (bh < 8 && pd->subsampling_y) in av1_is_dv_valid()
320 const int src_sb_row = ((src_bottom_edge >> 3) - 1) / sb_size; in av1_is_dv_valid()
321 const int src_sb64_col = ((src_right_edge >> 3) - 1) >> 6; in av1_is_dv_valid()
323 ((tile->mi_col_end - tile->mi_col_start - 1) >> 4) + 1; in av1_is_dv_valid()
326 if (src_sb64 >= active_sb64 - INTRABC_DELAY_SB64) return 0; in av1_is_dv_valid()
330 const int wf_offset = gradient * (active_sb_row - src_sb_row); in av1_is_dv_valid()
332 src_sb64_col >= active_sb64_col - INTRABC_DELAY_SB64 + wf_offset) in av1_is_dv_valid()