Merge "Unify the use of inter predictor in encoder and decoder" into nextgenv2
This commit is contained in:
Коммит
7ac38a7143
|
@ -778,103 +778,6 @@ static void dec_build_inter_predictors(VP10Decoder *const pbi,
|
|||
interp_filter, xs, ys, xd);
|
||||
}
|
||||
|
||||
static void dec_build_inter_predictors_sb_extend(
|
||||
VP10Decoder *const pbi, MACROBLOCKD *xd,
|
||||
#if CONFIG_EXT_INTER
|
||||
int mi_row_ori, int mi_col_ori,
|
||||
#endif // CONFIG_EXT_INTER
|
||||
int mi_row, int mi_col) {
|
||||
int plane;
|
||||
const int mi_x = mi_col * MI_SIZE;
|
||||
const int mi_y = mi_row * MI_SIZE;
|
||||
#if CONFIG_EXT_INTER
|
||||
const int wedge_offset_x = (mi_col_ori - mi_col) * MI_SIZE;
|
||||
const int wedge_offset_y = (mi_row_ori - mi_row) * MI_SIZE;
|
||||
#endif // CONFIG_EXT_INTER
|
||||
const MODE_INFO *mi = xd->mi[0];
|
||||
const BLOCK_SIZE sb_type = mi->mbmi.sb_type;
|
||||
const int is_compound = has_second_ref(&mi->mbmi);
|
||||
|
||||
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
|
||||
struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||
|
||||
struct buf_2d *const dst_buf = &pd->dst;
|
||||
const int num_4x4_w = pd->n4_w;
|
||||
const int num_4x4_h = pd->n4_h;
|
||||
|
||||
const int n4w_x4 = 4 * num_4x4_w;
|
||||
const int n4h_x4 = 4 * num_4x4_h;
|
||||
int ref;
|
||||
|
||||
for (ref = 0; ref < 1 + is_compound; ++ref) {
|
||||
const struct scale_factors *const sf = &xd->block_refs[ref]->sf;
|
||||
struct buf_2d *const pre_buf = &pd->pre[ref];
|
||||
const int idx = xd->block_refs[ref]->idx;
|
||||
BufferPool *const pool = pbi->common.buffer_pool;
|
||||
RefCntBuffer *const ref_frame_buf = &pool->frame_bufs[idx];
|
||||
const int is_scaled = vp10_is_scaled(sf);
|
||||
|
||||
if (sb_type < BLOCK_8X8) {
|
||||
const PARTITION_TYPE bp = BLOCK_8X8 - sb_type;
|
||||
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);
|
||||
const int pw = 8 >> (have_vsplit | pd->subsampling_x);
|
||||
const int ph = 8 >> (have_hsplit | pd->subsampling_y);
|
||||
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);
|
||||
dec_build_inter_predictors(
|
||||
pbi, xd, plane,
|
||||
#if CONFIG_OBMC
|
||||
0, 0,
|
||||
#endif // CONFIG_OBMC
|
||||
n4w_x4, n4h_x4,
|
||||
4 * x, 4 * y, pw, ph,
|
||||
#if CONFIG_EXT_INTER
|
||||
wedge_offset_x,
|
||||
wedge_offset_y,
|
||||
#endif // CONFIG_EXT_INTER
|
||||
mi_x, mi_y,
|
||||
mi->mbmi.interp_filter, sf, pre_buf, dst_buf,
|
||||
&mv, ref_frame_buf, is_scaled, ref);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const MV mv = mi->mbmi.mv[ref].as_mv;
|
||||
dec_build_inter_predictors(
|
||||
pbi, xd, plane,
|
||||
#if CONFIG_OBMC
|
||||
0, 0,
|
||||
#endif // CONFIG_OBMC
|
||||
n4w_x4, n4h_x4,
|
||||
0, 0, n4w_x4, n4h_x4,
|
||||
#if CONFIG_EXT_INTER
|
||||
wedge_offset_x,
|
||||
wedge_offset_y,
|
||||
#endif // CONFIG_EXT_INTER
|
||||
mi_x, mi_y,
|
||||
mi->mbmi.interp_filter, sf, pre_buf, dst_buf,
|
||||
&mv, ref_frame_buf,
|
||||
is_scaled, ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
#if CONFIG_EXT_INTER
|
||||
if (is_interintra_pred(&mi->mbmi))
|
||||
vp10_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,
|
||||
sb_type);
|
||||
#endif // CONFIG_EXT_INTER
|
||||
}
|
||||
|
||||
static void dec_build_inter_predictors_sb_sub8x8_extend(
|
||||
VP10Decoder *const pbi,
|
||||
MACROBLOCKD *xd,
|
||||
|
@ -1171,12 +1074,12 @@ static void dec_predict_b_extend(
|
|||
(c >> xd->plane[2].subsampling_x);
|
||||
|
||||
if (!b_sub8x8)
|
||||
dec_build_inter_predictors_sb_extend(
|
||||
pbi, xd,
|
||||
vp10_build_inter_predictors_sb_extend(
|
||||
xd,
|
||||
#if CONFIG_EXT_INTER
|
||||
mi_row_ori, mi_col_ori,
|
||||
#endif // CONFIG_EXT_INTER
|
||||
mi_row_pred, mi_col_pred);
|
||||
mi_row_pred, mi_col_pred, bsize_pred);
|
||||
else
|
||||
dec_build_inter_predictors_sb_sub8x8_extend(
|
||||
pbi, xd,
|
||||
|
|
Загрузка…
Ссылка в новой задаче