Commit 686d4fd2 authored by Urvang Joshi's avatar Urvang Joshi

Refactor av1_build_inter_predictors_sb().

Before this, this function was copied-and-edited from
av1_build_inter_predictors_sby() and av1_build_inter_predictors_sbuv().
Also, some places used sb() one directly (like rdopt.c), while others used
sby() and sbuv() separately (like encodeframe.c --> encode_superblock()).

This was prone to errors, if someone mistakenly modified only one/two of
the 3 functions.

Now, we just reuse sby() and sbuv() functions in sb().

Verified that there's no change in output.

Change-Id: If81d78e767cc3fa09f06094d4db36ff1eaea3e4f
parent 818005b4
......@@ -1400,28 +1400,11 @@ void av1_build_inter_predictors_sbuv(const AV1_COMMON *cm, MACROBLOCKD *xd,
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
}
// TODO(afergs): Check if ctx can be made constant
void av1_build_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col, BUFFER_SET *ctx,
BLOCK_SIZE bsize) {
build_inter_predictors_for_planes(cm, xd, bsize, mi_row, mi_col, 0,
MAX_MB_PLANE - 1);
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
if (is_interintra_pred(&xd->mi[0]->mbmi)) {
BUFFER_SET default_ctx = {
{ xd->plane[0].dst.buf, xd->plane[1].dst.buf, xd->plane[2].dst.buf },
{ xd->plane[0].dst.stride, xd->plane[1].dst.stride,
xd->plane[2].dst.stride }
};
if (!ctx) ctx = &default_ctx;
av1_build_interintra_predictors(
xd, xd->plane[0].dst.buf, xd->plane[1].dst.buf, xd->plane[2].dst.buf,
xd->plane[0].dst.stride, xd->plane[1].dst.stride,
xd->plane[2].dst.stride, ctx, bsize);
}
#else
(void)ctx;
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
av1_build_inter_predictors_sby(cm, xd, mi_row, mi_col, ctx, bsize);
av1_build_inter_predictors_sbuv(cm, xd, mi_row, mi_col, ctx, bsize);
}
void av1_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE],
......
......@@ -6020,8 +6020,7 @@ static void encode_superblock(const AV1_COMP *const cpi, ThreadData *td,
}
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
av1_build_inter_predictors_sby(cm, xd, mi_row, mi_col, NULL, block_size);
av1_build_inter_predictors_sbuv(cm, xd, mi_row, mi_col, NULL, block_size);
av1_build_inter_predictors_sb(cm, xd, mi_row, mi_col, NULL, block_size);
#if CONFIG_MOTION_VAR
if (mbmi->motion_mode == OBMC_CAUSAL) {
#if CONFIG_NCOBMC
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment