static inline uint8_t av1_get_spatial_seg_pred(const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
int *cdf_index,
int skip_over4x4) { const int step_size = skip_over4x4 ? 2 : 1;
uint8_t prev_ul = UINT8_MAX; // top left segment_id
uint8_t prev_l = UINT8_MAX; // left segment_id
uint8_t prev_u = UINT8_MAX; // top segment_id const int mi_row = xd->mi_row; const int mi_col = xd->mi_col; const CommonModeInfoParams *const mi_params = &cm->mi_params; const uint8_t *seg_map = cm->cur_frame->seg_map;
if ((xd->up_available) && (xd->left_available)) {
prev_ul = get_segment_id(mi_params, seg_map, BLOCK_4X4, mi_row - step_size,
mi_col - step_size);
}
if (xd->up_available) {
prev_u = get_segment_id(mi_params, seg_map, BLOCK_4X4, mi_row - step_size,
mi_col - 0);
}
if (xd->left_available) {
prev_l = get_segment_id(mi_params, seg_map, BLOCK_4X4, mi_row - 0,
mi_col - step_size);
}
assert(IMPLIES(prev_ul != UINT8_MAX,
prev_u != UINT8_MAX && prev_l != UINT8_MAX));
// Pick CDF index based on number of matching/out-of-bounds segment IDs.
if (prev_ul == UINT8_MAX) /* Edge cases */
*cdf_index = 0; else if ((prev_ul == prev_u) && (prev_ul == prev_l))
*cdf_index = 2; else if ((prev_ul == prev_u) || (prev_ul == prev_l) || (prev_u == prev_l))
*cdf_index = 1; else
*cdf_index = 0;
// If 2 or more are identical returns that as predictor, otherwise prev_l.
if (prev_u == UINT8_MAX) // edge case return prev_l == UINT8_MAX ? 0 : prev_l;
if (prev_l == UINT8_MAX) // edge case return prev_u; return (prev_ul == prev_u) ? prev_u : prev_l;
}
int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd, int dir);
// Get a list of palette base colors that are used in the above and left blocks, // referred to as "color cache". The return value is the number of colors in the // cache (<= 2 * PALETTE_MAX_SIZE). The color values are stored in "cache" // in ascending order.
int av1_get_palette_cache(const MACROBLOCKD *const xd, int plane,
uint16_t *cache);
// Returns a context number for the given MB prediction signal // The mode info data structure has a one element border above and to the // left of the entries corresponding to real blocks. // The prediction flags in these dummy entries are initialized to 0. static inline int get_tx_size_context(const MACROBLOCKD *xd) { const MB_MODE_INFO *mbmi = xd->mi[0]; const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->bsize]; const int max_tx_wide = tx_size_wide[max_tx_size]; const int max_tx_high = tx_size_high[max_tx_size]; const int has_above = xd->up_available; const int has_left = xd->left_available;
int above = xd->above_txfm_context[0] >= max_tx_wide;
int left = xd->left_txfm_context[0] >= max_tx_high;
if (has_above)
if (is_inter_block(above_mbmi))
above = block_size_wide[above_mbmi->bsize] >= max_tx_wide;
if (has_left)
if (is_inter_block(left_mbmi))
left = block_size_high[left_mbmi->bsize] >= max_tx_high;
if (has_above && has_left) return (above + left); else if (has_above) return above; else if (has_left) return left; else return0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.