Commit 068e7994 authored by Julia Robson's avatar Julia Robson

Fix for ext_interp experiment

Amends previous commit to also handle subsampling correctly.
Change ID of prev commit: I6b07e6cf9b287ba4b5bd6599af4a7412e50b3bdc

Was causing occassional failures for 422 streams due to accessing
elements beyond the extent of the bmi array.

Change-Id: I37ebabf4c01ca84bcd1851428172bdf753805d98
parent 78ee8312
......@@ -1098,7 +1098,7 @@ void vp10_build_inter_predictors_sb_extend(MACROBLOCKD *xd,
const int bh = 4 * num_4x4_h;
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) {
int i = 0, x, y;
int x, y;
assert(bsize == BLOCK_8X8);
for (y = 0; y < num_4x4_h; ++y)
for (x = 0; x < num_4x4_w; ++x)
......@@ -1107,7 +1107,7 @@ void vp10_build_inter_predictors_sb_extend(MACROBLOCKD *xd,
#if CONFIG_OBMC
0, 0,
#endif // CONFIG_OBMC
i++, bw, bh, 4 * x, 4 * y, 4, 4,
y * 2 + x, bw, bh, 4 * x, 4 * y, 4, 4,
#if CONFIG_EXT_INTER
wedge_offset_x >> (xd->plane[plane].subsampling_x),
wedge_offset_y >> (xd->plane[plane].subsampling_y),
......@@ -2067,12 +2067,12 @@ void vp10_build_inter_predictors_for_planes_single_buf(
const int bh = 4 * num_4x4_h;
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) {
int i = 0, x, y;
int x, y;
assert(bsize == BLOCK_8X8);
for (y = 0; y < num_4x4_h; ++y)
for (x = 0; x < num_4x4_w; ++x)
build_inter_predictors_single_buf(xd, plane,
i++, bw, bh,
y * 2 + x, bw, bh,
4 * x, 4 * y, 4, 4,
mi_x, mi_y, ref,
ext_dst[plane],
......
......@@ -331,7 +331,7 @@ static INLINE int vp10_is_interp_needed(const MACROBLOCKD *const xd) {
MB_MODE_INFO *const mbmi = &mi->mbmi;
const BLOCK_SIZE bsize = mbmi->sb_type;
const int is_compound = has_second_ref(mbmi);
int intpel_mv;
int intpel_mv = 1;
int plane;
#if SUPPORT_NONINTERPOLATING_FILTERS
......@@ -351,65 +351,26 @@ static INLINE int vp10_is_interp_needed(const MACROBLOCKD *const xd) {
if (is_compound && vp10_is_scaled(&xd->block_refs[1]->sf))
return 1;
if (bsize == BLOCK_4X4) {
for (plane = 0; plane < 2; ++plane) {
if (bsize < BLOCK_8X8) {
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
const PARTITION_TYPE bp = BLOCK_8X8 - bsize;
const struct macroblockd_plane *const pd = &xd->plane[plane];
MV mv0 = average_split_mvs(pd, mi, 0, 0);
MV mv1 = average_split_mvs(pd, mi, 0, 1);
MV mv2 = average_split_mvs(pd, mi, 0, 2);
MV mv3 = average_split_mvs(pd, mi, 0, 3);
intpel_mv =
!mv_has_subpel(&mv0) &&
!mv_has_subpel(&mv1) &&
!mv_has_subpel(&mv2) &&
!mv_has_subpel(&mv3);
if (is_compound && intpel_mv) {
mv0 = average_split_mvs(pd, mi, 1, 0);
mv1 = average_split_mvs(pd, mi, 1, 1);
mv2 = average_split_mvs(pd, mi, 1, 2);
mv3 = average_split_mvs(pd, mi, 1, 3);
intpel_mv =
!mv_has_subpel(&mv0) &&
!mv_has_subpel(&mv1) &&
!mv_has_subpel(&mv2) &&
!mv_has_subpel(&mv3);
const int have_vsplit = bp != PARTITION_HORZ;
const int have_hsplit = bp != PARTITION_VERT;
const int num_4x4_w = 2 >> ((!have_vsplit) | pd->subsampling_x);
const int num_4x4_h = 2 >> ((!have_hsplit) | pd->subsampling_y);
int ref;
for (ref = 0; ref < 1 + is_compound; ++ref) {
int x, y;
for (y = 0; y < num_4x4_h; ++y)
for (x = 0; x < num_4x4_w; ++x) {
const MV mv = average_split_mvs(pd, mi, ref, y * 2 + x);
if (mv_has_subpel(&mv))
return 1;
}
}
if (!intpel_mv) break;
}
} else if (bsize == BLOCK_4X8) {
for (plane = 0; plane < 2; ++plane) {
const struct macroblockd_plane *const pd = &xd->plane[plane];
MV mv0 = average_split_mvs(pd, mi, 0, 0);
MV mv1 = average_split_mvs(pd, mi, 0, 1);
intpel_mv =
!mv_has_subpel(&mv0) &&
!mv_has_subpel(&mv1);
if (is_compound && intpel_mv) {
mv0 = average_split_mvs(pd, mi, 1, 0);
mv1 = average_split_mvs(pd, mi, 1, 1);
intpel_mv =
!mv_has_subpel(&mv0) &&
!mv_has_subpel(&mv1);
}
if (!intpel_mv) break;
}
} else if (bsize == BLOCK_8X4) {
for (plane = 0; plane < 2; ++plane) {
const struct macroblockd_plane *const pd = &xd->plane[plane];
MV mv0 = average_split_mvs(pd, mi, 0, 0);
MV mv1 = average_split_mvs(pd, mi, 0, 2);
intpel_mv =
!mv_has_subpel(&mv0) &&
!mv_has_subpel(&mv1);
if (is_compound && intpel_mv) {
mv0 = average_split_mvs(pd, mi, 1, 0);
mv1 = average_split_mvs(pd, mi, 1, 2);
intpel_mv =
!mv_has_subpel(&mv0) &&
!mv_has_subpel(&mv1);
}
if (!intpel_mv) break;
}
return 0;
} else {
intpel_mv = !mv_has_subpel(&mbmi->mv[0].as_mv);
if (is_compound && intpel_mv) {
......
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