Commit 03be30ba authored by Debargha Mukherjee's avatar Debargha Mukherjee
Browse files

Some refactoring to support warped motion mode

Change-Id: I15d54a3ae48b2b33082668116792c6595bdb3ddb
parent f59bf76e
...@@ -202,11 +202,7 @@ typedef struct { ...@@ -202,11 +202,7 @@ typedef struct {
int interinter_wedge_index; int interinter_wedge_index;
int interinter_wedge_sign; int interinter_wedge_sign;
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
MOTION_VARIATION motion_variation;
#if CONFIG_OBMC
int8_t obmc;
#endif // CONFIG_OBMC
int_mv mv[2]; int_mv mv[2];
int_mv pred_mv[2]; int_mv pred_mv[2];
#if CONFIG_REF_MV #if CONFIG_REF_MV
...@@ -710,8 +706,8 @@ static INLINE int is_interintra_pred(const MB_MODE_INFO *mbmi) { ...@@ -710,8 +706,8 @@ static INLINE int is_interintra_pred(const MB_MODE_INFO *mbmi) {
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
static INLINE int is_obmc_allowed(const MB_MODE_INFO *mbmi) { static INLINE int is_motvar_allowed(const MB_MODE_INFO *mbmi) {
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
return (mbmi->sb_type >= BLOCK_8X8 && mbmi->ref_frame[1] != INTRA_FRAME); return (mbmi->sb_type >= BLOCK_8X8 && mbmi->ref_frame[1] != INTRA_FRAME);
#else #else
...@@ -719,10 +715,12 @@ static INLINE int is_obmc_allowed(const MB_MODE_INFO *mbmi) { ...@@ -719,10 +715,12 @@ static INLINE int is_obmc_allowed(const MB_MODE_INFO *mbmi) {
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
} }
#if CONFIG_OBMC
static INLINE int is_neighbor_overlappable(const MB_MODE_INFO *mbmi) { static INLINE int is_neighbor_overlappable(const MB_MODE_INFO *mbmi) {
return (is_inter_block(mbmi)); return (is_inter_block(mbmi));
} }
#endif // CONFIG_OBMC #endif // CONFIG_OBMC
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -295,15 +295,58 @@ static const vpx_prob default_wedge_interinter_prob[BLOCK_SIZES] = { ...@@ -295,15 +295,58 @@ static const vpx_prob default_wedge_interinter_prob[BLOCK_SIZES] = {
}; };
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC // Change this section appropriately once warped motion is supported
static const vpx_prob default_obmc_prob[BLOCK_SIZES] = { #if CONFIG_OBMC && !CONFIG_WARPED_MOTION
255, 255, 255, 151, 153, 144, 178, 165, 160, 207, 195, 168, 244, const vpx_tree_index vp10_motvar_tree[TREE_SIZE(MOTION_VARIATIONS)] = {
-SIMPLE_TRANSLATION, -OBMC_CAUSAL
};
static
const vpx_prob default_motvar_prob[BLOCK_SIZES][MOTION_VARIATIONS - 1] = {
{255},
{255}, {255}, {151},
{153}, {144}, {178},
{165}, {160}, {207},
{195}, {168}, {244},
#if CONFIG_EXT_PARTITION
{252}, {252}, {252},
#endif // CONFIG_EXT_PARTITION
};
#elif !CONFIG_OBMC && CONFIG_WARPED_MOTION
const vpx_tree_index vp10_motvar_tree[TREE_SIZE(MOTION_VARIATIONS)] = {
-SIMPLE_TRANSLATION, -WARPED_CAUSAL
};
static
const vpx_prob default_motvar_prob[BLOCK_SIZES][MOTION_VARIATIONS - 1] = {
{255},
{255}, {255}, {151},
{153}, {144}, {178},
{165}, {160}, {207},
{195}, {168}, {244},
#if CONFIG_EXT_PARTITION
{252}, {252}, {252},
#endif // CONFIG_EXT_PARTITION
};
#elif CONFIG_OBMC && CONFIG_WARPED_MOTION
const vpx_tree_index vp10_motvar_tree[TREE_SIZE(MOTION_VARIATIONS)] = {
-SIMPLE_TRANSLATION, 2,
-OBMC_CAUSAL, -WARPED_CAUSAL,
};
static
const vpx_prob default_motvar_prob[BLOCK_SIZES][MOTION_VARIATIONS - 1] = {
{255, 200},
{255, 200}, {255, 200}, {151, 200},
{153, 200}, {144, 200}, {178, 200},
{165, 200}, {160, 200}, {207, 200},
{195, 200}, {168, 200}, {244, 200},
#if CONFIG_EXT_PARTITION #if CONFIG_EXT_PARTITION
// TODO(debargha) What are the correct values for these? {252, 200}, {252, 200}, {252, 200},
192, 192, 192
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}; };
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || !CONFIG_WARPED_MOTION
/* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */ /* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */
const vpx_tree_index vp10_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = { const vpx_tree_index vp10_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
...@@ -1287,9 +1330,9 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -1287,9 +1330,9 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#endif // CONFIG_REF_MV #endif // CONFIG_REF_MV
vp10_copy(fc->inter_mode_probs, default_inter_mode_probs); vp10_copy(fc->inter_mode_probs, default_inter_mode_probs);
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
vp10_copy(fc->obmc_prob, default_obmc_prob); vp10_copy(fc->motvar_prob, default_motvar_prob);
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
vp10_copy(fc->inter_compound_mode_probs, default_inter_compound_mode_probs); vp10_copy(fc->inter_compound_mode_probs, default_inter_compound_mode_probs);
vp10_copy(fc->interintra_prob, default_interintra_prob); vp10_copy(fc->interintra_prob, default_interintra_prob);
...@@ -1381,14 +1424,14 @@ void vp10_adapt_inter_frame_probs(VP10_COMMON *cm) { ...@@ -1381,14 +1424,14 @@ void vp10_adapt_inter_frame_probs(VP10_COMMON *cm) {
#else #else
for (i = 0; i < INTER_MODE_CONTEXTS; i++) for (i = 0; i < INTER_MODE_CONTEXTS; i++)
vpx_tree_merge_probs(vp10_inter_mode_tree, pre_fc->inter_mode_probs[i], vpx_tree_merge_probs(vp10_inter_mode_tree, pre_fc->inter_mode_probs[i],
counts->inter_mode[i], fc->inter_mode_probs[i]); counts->inter_mode[i], fc->inter_mode_probs[i]);
#endif #endif
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i) for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i)
fc->obmc_prob[i] = vp10_mode_mv_merge_probs(pre_fc->obmc_prob[i], vpx_tree_merge_probs(vp10_motvar_tree, pre_fc->motvar_prob[i],
counts->obmc[i]); counts->motvar[i], fc->motvar_prob[i]);
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
for (i = 0; i < PARTITION_SUPERTX_CONTEXTS; ++i) { for (i = 0; i < PARTITION_SUPERTX_CONTEXTS; ++i) {
......
...@@ -79,9 +79,9 @@ typedef struct frame_contexts { ...@@ -79,9 +79,9 @@ typedef struct frame_contexts {
vpx_prob wedge_interintra_prob[BLOCK_SIZES]; vpx_prob wedge_interintra_prob[BLOCK_SIZES];
vpx_prob wedge_interinter_prob[BLOCK_SIZES]; vpx_prob wedge_interinter_prob[BLOCK_SIZES];
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
vpx_prob obmc_prob[BLOCK_SIZES]; vpx_prob motvar_prob[BLOCK_SIZES][MOTION_VARIATIONS - 1];
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
vpx_prob intra_inter_prob[INTRA_INTER_CONTEXTS]; vpx_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
vpx_prob comp_inter_prob[COMP_INTER_CONTEXTS]; vpx_prob comp_inter_prob[COMP_INTER_CONTEXTS];
vpx_prob single_ref_prob[REF_CONTEXTS][SINGLE_REFS-1]; vpx_prob single_ref_prob[REF_CONTEXTS][SINGLE_REFS-1];
...@@ -154,9 +154,9 @@ typedef struct FRAME_COUNTS { ...@@ -154,9 +154,9 @@ typedef struct FRAME_COUNTS {
unsigned int wedge_interintra[BLOCK_SIZES][2]; unsigned int wedge_interintra[BLOCK_SIZES][2];
unsigned int wedge_interinter[BLOCK_SIZES][2]; unsigned int wedge_interinter[BLOCK_SIZES][2];
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
unsigned int obmc[BLOCK_SIZES][2]; unsigned int motvar[BLOCK_SIZES][MOTION_VARIATIONS];
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
unsigned int intra_inter[INTRA_INTER_CONTEXTS][2]; unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
unsigned int comp_inter[COMP_INTER_CONTEXTS][2]; unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
unsigned int single_ref[REF_CONTEXTS][SINGLE_REFS-1][2]; unsigned int single_ref[REF_CONTEXTS][SINGLE_REFS-1][2];
...@@ -242,6 +242,9 @@ extern const vpx_tree_index ...@@ -242,6 +242,9 @@ extern const vpx_tree_index
extern const vpx_tree_index extern const vpx_tree_index
vp10_ext_tx_tree[TREE_SIZE(TX_TYPES)]; vp10_ext_tx_tree[TREE_SIZE(TX_TYPES)];
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
#if CONFIG_OBMC || CONFIG_WARPED_MOTION
extern const vpx_tree_index vp10_motvar_tree[TREE_SIZE(MOTION_VARIATIONS)];
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
void vp10_setup_past_independence(struct VP10Common *cm); void vp10_setup_past_independence(struct VP10Common *cm);
......
...@@ -281,6 +281,17 @@ typedef uint8_t PREDICTION_MODE; ...@@ -281,6 +281,17 @@ typedef uint8_t PREDICTION_MODE;
#define INTRA_MODES (TM_PRED + 1) #define INTRA_MODES (TM_PRED + 1)
typedef enum {
SIMPLE_TRANSLATION = 0,
#if CONFIG_OBMC
OBMC_CAUSAL, // 2-sided OBMC
#endif // CONFIG_OBMC
#if CONFIG_WARPED_MOTION
WARPED_CAUSAL, // 2-sided WARPED
#endif // CONFIG_WARPED_MOTION
MOTION_VARIATIONS
} MOTION_VARIATION;
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
typedef enum { typedef enum {
II_DC_PRED = 0, II_DC_PRED = 0,
......
...@@ -339,7 +339,6 @@ static const uint8_t *get_wedge_mask(int wedge_index, ...@@ -339,7 +339,6 @@ static const uint8_t *get_wedge_mask(int wedge_index,
return wedge_params_lookup[bsize].masks[neg][wedge_index]; return wedge_params_lookup[bsize].masks[neg][wedge_index];
} }
const uint8_t *vp10_get_soft_mask(int wedge_index, const uint8_t *vp10_get_soft_mask(int wedge_index,
int wedge_sign, int wedge_sign,
BLOCK_SIZE sb_type, BLOCK_SIZE sb_type,
......
...@@ -1319,7 +1319,7 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd, ...@@ -1319,7 +1319,7 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd,
vp10_build_inter_predictors_sb(xd, mi_row, mi_col, vp10_build_inter_predictors_sb(xd, mi_row, mi_col,
VPXMAX(bsize, BLOCK_8X8)); VPXMAX(bsize, BLOCK_8X8));
#if CONFIG_OBMC #if CONFIG_OBMC
if (mbmi->obmc) { if (mbmi->motion_variation == OBMC_CAUSAL) {
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint8_t, DECLARE_ALIGNED(16, uint8_t,
tmp_buf1[2 * MAX_MB_PLANE * MAX_SB_SQUARE]); tmp_buf1[2 * MAX_MB_PLANE * MAX_SB_SQUARE]);
...@@ -3544,10 +3544,12 @@ static int read_compressed_header(VP10Decoder *pbi, const uint8_t *data, ...@@ -3544,10 +3544,12 @@ static int read_compressed_header(VP10Decoder *pbi, const uint8_t *data,
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i) for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i) {
vp10_diff_update_prob(&r, &fc->obmc_prob[i]); for (j = 0; j < MOTION_VARIATIONS - 1; ++j)
#endif // CONFIG_OBMC vp10_diff_update_prob(&r, &fc->motvar_prob[i][j]);
}
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
if (cm->interp_filter == SWITCHABLE) if (cm->interp_filter == SWITCHABLE)
read_switchable_interp_probs(fc, &r); read_switchable_interp_probs(fc, &r);
...@@ -3615,10 +3617,10 @@ static void debug_check_frame_counts(const VP10_COMMON *const cm) { ...@@ -3615,10 +3617,10 @@ static void debug_check_frame_counts(const VP10_COMMON *const cm) {
assert(!memcmp(cm->counts.wedge_interinter, zero_counts.wedge_interinter, assert(!memcmp(cm->counts.wedge_interinter, zero_counts.wedge_interinter,
sizeof(cm->counts.wedge_interinter))); sizeof(cm->counts.wedge_interinter)));
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
assert(!memcmp(cm->counts.obmc, zero_counts.obmc, assert(!memcmp(cm->counts.motvar, zero_counts.motvar,
sizeof(cm->counts.obmc))); sizeof(cm->counts.motvar)));
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
assert(!memcmp(cm->counts.intra_inter, zero_counts.intra_inter, assert(!memcmp(cm->counts.intra_inter, zero_counts.intra_inter,
sizeof(cm->counts.intra_inter))); sizeof(cm->counts.intra_inter)));
assert(!memcmp(cm->counts.comp_inter, zero_counts.comp_inter, assert(!memcmp(cm->counts.comp_inter, zero_counts.comp_inter,
......
...@@ -883,23 +883,24 @@ static void read_ref_frames(VP10_COMMON *const cm, MACROBLOCKD *const xd, ...@@ -883,23 +883,24 @@ static void read_ref_frames(VP10_COMMON *const cm, MACROBLOCKD *const xd,
} }
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
static int read_is_obmc_block(VP10_COMMON *const cm, MACROBLOCKD *const xd, static MOTION_VARIATION read_motvar_block(
vp10_reader *r) { VP10_COMMON *const cm, MACROBLOCKD *const xd, vp10_reader *r) {
BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type; BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
FRAME_COUNTS *counts = xd->counts; FRAME_COUNTS *counts = xd->counts;
int is_obmc; MOTION_VARIATION motvar;
if (is_obmc_allowed(&xd->mi[0]->mbmi)) { if (is_motvar_allowed(&xd->mi[0]->mbmi)) {
is_obmc = vp10_read(r, cm->fc->obmc_prob[bsize]); motvar = (MOTION_VARIATION)
vp10_read_tree(r, vp10_motvar_tree, cm->fc->motvar_prob[bsize]);
if (counts) if (counts)
++counts->obmc[bsize][is_obmc]; ++counts->motvar[bsize][motvar];
return is_obmc; return motvar;
} else { } else {
return 0; return SIMPLE_TRANSLATION;
} }
} }
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
static INLINE INTERP_FILTER read_interp_filter( static INLINE INTERP_FILTER read_interp_filter(
VP10_COMMON *const cm, MACROBLOCKD *const xd, VP10_COMMON *const cm, MACROBLOCKD *const xd,
...@@ -1599,24 +1600,25 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi, ...@@ -1599,24 +1600,25 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
mbmi->obmc = 0; mbmi->motion_variation = SIMPLE_TRANSLATION;
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
if (!supertx_enabled) if (!supertx_enabled)
#endif // CONFIG_SUPERTX #endif // CONFIG_SUPERTX
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
if (mbmi->ref_frame[1] != INTRA_FRAME) if (mbmi->ref_frame[1] != INTRA_FRAME)
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
mbmi->obmc = read_is_obmc_block(cm, xd, r); mbmi->motion_variation = read_motvar_block(cm, xd, r);
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
mbmi->use_wedge_interinter = 0; mbmi->use_wedge_interinter = 0;
if (cm->reference_mode != SINGLE_REFERENCE && if (cm->reference_mode != SINGLE_REFERENCE &&
is_inter_compound_mode(mbmi->mode) && is_inter_compound_mode(mbmi->mode) &&
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
!(is_obmc_allowed(mbmi) && mbmi->obmc) && !(is_motvar_allowed(mbmi) &&
#endif // CONFIG_OBMC mbmi->motion_variation != SIMPLE_TRANSLATION) &&
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
is_interinter_wedge_used(bsize)) { is_interinter_wedge_used(bsize)) {
mbmi->use_wedge_interinter = mbmi->use_wedge_interinter =
vp10_read(r, cm->fc->wedge_interinter_prob[bsize]); vp10_read(r, cm->fc->wedge_interinter_prob[bsize]);
......
...@@ -117,6 +117,9 @@ static struct vp10_token intra_filter_encodings[INTRA_FILTERS]; ...@@ -117,6 +117,9 @@ static struct vp10_token intra_filter_encodings[INTRA_FILTERS];
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
static struct vp10_token interintra_mode_encodings[INTERINTRA_MODES]; static struct vp10_token interintra_mode_encodings[INTERINTRA_MODES];
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC || CONFIG_WARPED_MOTION
static struct vp10_token motvar_encodings[MOTION_VARIATIONS];
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
void vp10_encode_token_init() { void vp10_encode_token_init() {
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
...@@ -136,6 +139,9 @@ void vp10_encode_token_init() { ...@@ -136,6 +139,9 @@ void vp10_encode_token_init() {
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
vp10_tokens_from_tree(interintra_mode_encodings, vp10_interintra_mode_tree); vp10_tokens_from_tree(interintra_mode_encodings, vp10_interintra_mode_tree);
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC || CONFIG_WARPED_MOTION
vp10_tokens_from_tree(motvar_encodings, vp10_motvar_tree);
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
} }
static void write_intra_mode(vp10_writer *w, PREDICTION_MODE mode, static void write_intra_mode(vp10_writer *w, PREDICTION_MODE mode,
...@@ -1370,22 +1376,24 @@ static void pack_inter_mode_mvs(VP10_COMP *cpi, const MODE_INFO *mi, ...@@ -1370,22 +1376,24 @@ static void pack_inter_mode_mvs(VP10_COMP *cpi, const MODE_INFO *mi,
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
if (!supertx_enabled) if (!supertx_enabled)
#endif // CONFIG_SUPERTX #endif // CONFIG_SUPERTX
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
if (mbmi->ref_frame[1] != INTRA_FRAME) if (mbmi->ref_frame[1] != INTRA_FRAME)
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
if (is_obmc_allowed(mbmi)) if (is_motvar_allowed(mbmi))
vp10_write(w, mbmi->obmc, cm->fc->obmc_prob[bsize]); vp10_write_token(w, vp10_motvar_tree, cm->fc->motvar_prob[bsize],
#endif // CONFIG_OBMC &motvar_encodings[mbmi->motion_variation]);
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
if (cpi->common.reference_mode != SINGLE_REFERENCE && if (cpi->common.reference_mode != SINGLE_REFERENCE &&
is_inter_compound_mode(mbmi->mode) && is_inter_compound_mode(mbmi->mode) &&
#if CONFIG_OBMC #if CONFIG_OBMC
!(is_obmc_allowed(mbmi) && mbmi->obmc) && !(is_motvar_allowed(mbmi) &&
mbmi->motion_variation != SIMPLE_TRANSLATION) &&
#endif // CONFIG_OBMC #endif // CONFIG_OBMC
is_interinter_wedge_used(bsize)) { is_interinter_wedge_used(bsize)) {
vp10_write(w, mbmi->use_wedge_interinter, vp10_write(w, mbmi->use_wedge_interinter,
...@@ -3283,11 +3291,11 @@ static uint32_t write_compressed_header(VP10_COMP *cpi, uint8_t *data) { ...@@ -3283,11 +3291,11 @@ static uint32_t write_compressed_header(VP10_COMP *cpi, uint8_t *data) {
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i) for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i)
vp10_cond_prob_diff_update(header_bc, &fc->obmc_prob[i], prob_diff_update(vp10_motvar_tree, fc->motvar_prob[i],
counts->obmc[i]); counts->motvar[i], MOTION_VARIATIONS, header_bc);
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
if (cm->interp_filter == SWITCHABLE) if (cm->interp_filter == SWITCHABLE)
update_switchable_interp_probs(cm, header_bc, counts); update_switchable_interp_probs(cm, header_bc, counts);
......
...@@ -1337,10 +1337,8 @@ static void update_state_supertx(VP10_COMP *cpi, ThreadData *td, ...@@ -1337,10 +1337,8 @@ static void update_state_supertx(VP10_COMP *cpi, ThreadData *td,
mbmi->inter_tx_size[idy][idx] = mbmi->tx_size; mbmi->inter_tx_size[idy][idx] = mbmi->tx_size;
} }
#endif // CONFIG_VAR_TX #endif // CONFIG_VAR_TX
#if CONFIG_OBMC // Turn motion variation off for supertx
// Turn OBMC off for supertx mbmi->motion_variation = SIMPLE_TRANSLATION;
mbmi->obmc = 0;
#endif // CONFIG_OBMC
if (!output_enabled) if (!output_enabled)
return; return;
...@@ -1966,23 +1964,24 @@ static void update_stats(VP10_COMMON *cm, ThreadData *td ...@@ -1966,23 +1964,24 @@ static void update_stats(VP10_COMMON *cm, ThreadData *td
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
if (!supertx_enabled) if (!supertx_enabled)
#endif // CONFIG_SUPERTX #endif // CONFIG_SUPERTX
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
if (mbmi->ref_frame[1] != INTRA_FRAME) if (mbmi->ref_frame[1] != INTRA_FRAME)
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
if (is_obmc_allowed(mbmi)) if (is_motvar_allowed(mbmi))
counts->obmc[mbmi->sb_type][mbmi->obmc]++; counts->motvar[mbmi->sb_type][mbmi->motion_variation]++;
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
if (cm->reference_mode != SINGLE_REFERENCE && if (cm->reference_mode != SINGLE_REFERENCE &&
is_inter_compound_mode(mbmi->mode) && is_inter_compound_mode(mbmi->mode) &&
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
!(is_obmc_allowed(mbmi) && mbmi->obmc) && !(is_motvar_allowed(mbmi) &&
#endif // CONFIG_OBMC mbmi->motion_variation != SIMPLE_TRANSLATION) &&
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
is_interinter_wedge_used(bsize)) { is_interinter_wedge_used(bsize)) {
counts->wedge_interinter[bsize][mbmi->use_wedge_interinter]++; counts->wedge_interinter[bsize][mbmi->use_wedge_interinter]++;
} }
...@@ -5034,7 +5033,7 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td, ...@@ -5034,7 +5033,7 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td,
VPXMAX(bsize, BLOCK_8X8)); VPXMAX(bsize, BLOCK_8X8));
#if CONFIG_OBMC #if CONFIG_OBMC
if (mbmi->obmc) { if (mbmi->motion_variation == OBMC_CAUSAL) {
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint8_t, tmp_buf1[2 * MAX_MB_PLANE * MAX_SB_SQUARE]); DECLARE_ALIGNED(16, uint8_t, tmp_buf1[2 * MAX_MB_PLANE * MAX_SB_SQUARE]);
DECLARE_ALIGNED(16, uint8_t, tmp_buf2[2 * MAX_MB_PLANE * MAX_SB_SQUARE]); DECLARE_ALIGNED(16, uint8_t, tmp_buf2[2 * MAX_MB_PLANE * MAX_SB_SQUARE]);
......
...@@ -527,9 +527,9 @@ typedef struct VP10_COMP { ...@@ -527,9 +527,9 @@ typedef struct VP10_COMP {
[INTER_COMPOUND_MODES]; [INTER_COMPOUND_MODES];
unsigned int interintra_mode_cost[BLOCK_SIZE_GROUPS][INTERINTRA_MODES]; unsigned int interintra_mode_cost[BLOCK_SIZE_GROUPS][INTERINTRA_MODES];
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
int obmc_cost[BLOCK_SIZES][2]; int motvar_cost[BLOCK_SIZES][MOTION_VARIATIONS];
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
int intra_uv_mode_cost[INTRA_MODES][INTRA_MODES]; int intra_uv_mode_cost[INTRA_MODES][INTRA_MODES];
int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES]; int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES];
int switchable_interp_costs[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS]; int switchable_interp_costs[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS];
......
...@@ -472,12 +472,12 @@ void vp10_initialize_rd_consts(VP10_COMP *cpi) { ...@@ -472,12 +472,12 @@ void vp10_initialize_rd_consts(VP10_COMP *cpi) {
cm->fc->interintra_mode_prob[i], cm->fc->interintra_mode_prob[i],
vp10_interintra_mode_tree); vp10_interintra_mode_tree);
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_OBMC || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; i++) { for (i = BLOCK_8X8; i < BLOCK_SIZES; i++) {
cpi->obmc_cost[i][0] = vp10_cost_bit(cm->fc->obmc_prob[i], 0); vp10_cost_tokens((int *)cpi->motvar_cost[i],
cpi->obmc_cost[i][1] = vp10_cost_bit(cm->fc->obmc_prob[i], 1); cm->fc->motvar_prob[i], vp10_motvar_tree);
} }
#endif // CONFIG_OBMC #endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
} }
}