Commit 1f56b8e3 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Remove experimental flag of WARPED_MOTION

This experiment has been adopted, we can simplify the code
by dropping the associated preprocessor conditionals.

Change-Id: I54fee8a18afaec5333ae852eb6bd9ac0e2550db1
parent e4984ffc
......@@ -377,10 +377,8 @@ typedef struct MB_MODE_INFO {
int mi_row;
int mi_col;
#endif
#if CONFIG_WARPED_MOTION
int num_proj_ref[2];
WarpedMotionParams wm_params[2];
#endif // CONFIG_WARPED_MOTION
#if CONFIG_CFL
// Index of the alpha Cb and alpha Cr combination
......@@ -1399,10 +1397,7 @@ static INLINE NCOBMC_MODE ncobmc_mode_allowed_bsize(BLOCK_SIZE bsize) {
static INLINE MOTION_MODE
motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
#if CONFIG_WARPED_MOTION
const MACROBLOCKD *xd,
#endif
const MODE_INFO *mi) {
const MACROBLOCKD *xd, const MODE_INFO *mi) {
const MB_MODE_INFO *mbmi = &mi->mbmi;
#if CONFIG_AMVR
if (xd->cur_frame_force_integer_mv == 0) {
......@@ -1416,7 +1411,6 @@ motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
is_inter_mode(mbmi->mode) && mbmi->ref_frame[1] != INTRA_FRAME &&
is_motion_variation_allowed_compound(mbmi)) {
if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION;
#if CONFIG_WARPED_MOTION
if (!has_second_ref(mbmi) && mbmi->num_proj_ref[0] >= 1 &&
!av1_is_scaled(&(xd->block_refs[0]->sf))) {
#if CONFIG_AMVR
......@@ -1427,7 +1421,6 @@ motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
return WARPED_CAUSAL;
}
#endif // CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
if (ncobmc_mode_allowed_bsize(mbmi->sb_type) < NO_OVERLAP)
return NCOBMC_ADAPT_WEIGHT;
......@@ -1441,16 +1434,10 @@ motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
static INLINE void assert_motion_mode_valid(MOTION_MODE mode, int block,
const WarpedMotionParams *gm_params,
#if CONFIG_WARPED_MOTION
const MACROBLOCKD *xd,
#endif
const MODE_INFO *mi) {
const MOTION_MODE last_motion_mode_allowed =
motion_mode_allowed(block, gm_params,
#if CONFIG_WARPED_MOTION
xd,
#endif
mi);
motion_mode_allowed(block, gm_params, xd, mi);
// Check that the input mode is not illegal
if (last_motion_mode_allowed < mode)
......
......@@ -2383,10 +2383,8 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
#if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(intra_inter_cdf)
AVERAGE_TILE_CDFS(motion_mode_cdf)
#if CONFIG_WARPED_MOTION
AVERAGE_TILE_CDFS(obmc_cdf)
#endif
#endif
#if CONFIG_MRC_TX
AVERAGE_TILE_CDFS(mrc_mask_inter_cdf)
#endif // CONFIG_MRC_TX
......
......@@ -928,136 +928,6 @@ static const aom_cdf_prob
#endif // TWO_MODEE
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
// Change this section appropriately once warped motion is supported
#if !CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -NCOBMC_ADAPT_WEIGHT,
};
static const aom_prob
default_motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES - 1] = {
{ 255, 255 },
{ 255, 255 },
{ 255, 255 },
{ 255, 255 },
{ 255, 255 },
{ 255, 255 },
/** Only these nine block sizes allow ncobmc_adapt_weight **/
{ 45, 207 },
{ 42, 211 },
{ 34, 207 },
{ 181, 123 },
{ 129, 141 },
{ 15, 209 },
{ 231, 122 },
{ 195, 190 },
{ 168, 190 },
/** ----------------------------------------------------- **/
{ 244, 255 },
#if CONFIG_EXT_PARTITION
{ 252, 255 },
{ 252, 255 },
{ 252, 255 },
#endif // CONFIG_EXT_PARTITION
{ 255, 200 },
{ 255, 200 },
{ 255, 200 },
{ 255, 200 },
#if CONFIG_EXT_PARTITION
{ 252, 255 },
{ 252, 200 },
{ 252, 200 },
#endif // CONFIG_EXT_PARTITION
};
static const aom_cdf_prob
default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = {
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0, 0 },
/** Only these seven block sizes allow ncobmc_adapt_weight **/
{ AOM_ICDF(5702), AOM_ICDF(27555), AOM_ICDF(32768), 0 },
{ AOM_ICDF(5408), AOM_ICDF(27964), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4330), AOM_ICDF(27298), AOM_ICDF(32768), 0 },
{ AOM_ICDF(23107), AOM_ICDF(27760), AOM_ICDF(32768), 0 },
{ AOM_ICDF(16490), AOM_ICDF(25461), AOM_ICDF(32768), 0 },
{ AOM_ICDF(1959), AOM_ICDF(27153), AOM_ICDF(32768), 0 },
{ AOM_ICDF(29530), AOM_ICDF(31073), AOM_ICDF(32768), 0 },
{ AOM_ICDF(25057), AOM_ICDF(30840), AOM_ICDF(32768), 0 },
{ AOM_ICDF(21588), AOM_ICDF(29940), AOM_ICDF(32768), 0 },
/** ----------------------------------------------------- **/
{ AOM_ICDF(244 * 128), AOM_ICDF(32768), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(32256), AOM_ICDF(32768), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32256), AOM_ICDF(32768), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32256), AOM_ICDF(32768), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 }
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
#endif
};
#else // CONFIG_NCOBMC_ADAPT_WEIGHT
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, -OBMC_CAUSAL
};
static const aom_prob
default_motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES - 1] = {
{ 255 }, { 255 }, { 255 }, { 255 }, { 255 }, { 255 }, { 151 }, { 153 },
{ 144 }, { 178 }, { 165 }, { 160 }, { 207 }, { 195 }, { 168 }, { 244 },
#if CONFIG_EXT_PARTITION
{ 252 }, { 252 }, { 252 },
#endif // CONFIG_EXT_PARTITION
{ 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 },
#if CONFIG_EXT_PARTITION
{ 208 }, { 208 }
#endif // CONFIG_EXT_PARTITION
};
static const aom_cdf_prob
default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = {
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(151 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(153 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(144 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(178 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(165 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(160 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(207 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(195 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(168 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#elif CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, 4, -NCOBMC_ADAPT_WEIGHT, -WARPED_CAUSAL
......@@ -1257,7 +1127,6 @@ static const aom_cdf_prob default_obmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = {
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_NEW_MULTISYMBOL
#endif
static const aom_prob default_delta_q_probs[DELTA_Q_PROBS] = { 220, 220, 220 };
static const aom_cdf_prob default_delta_q_cdf[CDF_SIZE(DELTA_Q_PROBS + 1)] = {
......@@ -6111,7 +5980,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->ncobmc_mode_prob, default_ncobmc_mode_prob);
av1_copy(fc->ncobmc_mode_cdf, default_ncobmc_mode_cdf);
#endif
#if CONFIG_WARPED_MOTION
av1_copy(fc->obmc_prob, default_obmc_prob);
#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
av1_copy(fc->obmc_cdf, default_obmc_cdf);
......@@ -6120,7 +5988,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->ncobmc_prob, default_ncobmc_prob);
av1_copy(fc->ncobmc_cdf, default_ncobmc_cdf);
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_WARPED_MOTION
av1_copy(fc->inter_compound_mode_probs, default_inter_compound_mode_probs);
av1_copy(fc->inter_compound_mode_cdf, default_inter_compound_mode_cdf);
#if CONFIG_COMPOUND_SINGLEREF
......@@ -6266,17 +6133,13 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
for (i = 0; i < ADAPT_OVERLAP_BLOCKS; ++i)
aom_tree_merge_probs(av1_ncobmc_mode_tree, pre_fc->ncobmc_mode_prob[i],
counts->ncobmc_mode[i], fc->ncobmc_mode_prob[i]);
#if CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; ++i)
aom_tree_merge_probs(av1_ncobmc_tree, pre_fc->ncobmc_prob[i],
counts->ncobmc[i], fc->ncobmc_prob[i]);
#endif
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#if CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; ++i)
fc->obmc_prob[i] =
av1_mode_mv_merge_probs(pre_fc->obmc_prob[i], counts->obmc[i]);
#endif // CONFIG_WARPED_MOTION
for (i = 0; i < INTER_MODE_CONTEXTS; i++)
aom_tree_merge_probs(
......
......@@ -225,7 +225,6 @@ typedef struct frame_contexts {
aom_cdf_prob ncobmc_mode_cdf[ADAPT_OVERLAP_BLOCKS]
[CDF_SIZE(MAX_NCOBMC_MODES)];
#endif
#if CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
aom_prob ncobmc_prob[BLOCK_SIZES_ALL][OBMC_FAMILY_MODES - 1];
aom_cdf_prob ncobmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(OBMC_FAMILY_MODES)];
......@@ -234,7 +233,6 @@ typedef struct frame_contexts {
#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
aom_cdf_prob obmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)];
#endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_WARPED_MOTION
aom_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
aom_prob comp_inter_prob[COMP_INTER_CONTEXTS];
aom_cdf_prob palette_y_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE(PALETTE_SIZES)];
......@@ -457,12 +455,10 @@ typedef struct FRAME_COUNTS {
#if CONFIG_NCOBMC_ADAPT_WEIGHT
unsigned int ncobmc_mode[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES];
#endif
#if CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
unsigned int ncobmc[BLOCK_SIZES_ALL][OBMC_FAMILY_MODES];
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
unsigned int obmc[BLOCK_SIZES_ALL][2];
#endif // CONFIG_WARPED_MOTION
unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
#if CONFIG_EXT_COMP_REFS
......@@ -641,9 +637,7 @@ extern const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)];
extern const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)];
#if CONFIG_NCOBMC_ADAPT_WEIGHT
extern const aom_tree_index av1_ncobmc_mode_tree[TREE_SIZE(MAX_NCOBMC_MODES)];
#if CONFIG_WARPED_MOTION
extern const aom_tree_index av1_ncobmc_tree[TREE_SIZE(OBMC_FAMILY_MODES)];
#endif // CONFIG_WARPED_MOTION
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#if CONFIG_LOOP_RESTORATION
#define RESTORE_NONE_SGRPROJ_PROB 64
......
......@@ -576,12 +576,10 @@ typedef enum ATTRIBUTE_PACKED {
OBMC_CAUSAL, // 2-sided OBMC
#if CONFIG_NCOBMC_ADAPT_WEIGHT
NCOBMC_ADAPT_WEIGHT,
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#if CONFIG_WARPED_MOTION
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
WARPED_CAUSAL, // 2-sided WARPED
#endif // CONFIG_WARPED_MOTION
MOTION_MODES
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
,
OBMC_FAMILY_MODES = NCOBMC_ADAPT_WEIGHT + 1
#endif
......
......@@ -91,9 +91,7 @@ typedef enum {
typedef struct {
int global_warp_allowed;
#if CONFIG_WARPED_MOTION
int local_warp_allowed;
#endif // CONFIG_WARPED_MOTION
} WarpTypesAllowed;
// number of parameters used by each transformation in TransformationTypes
......
......@@ -10,9 +10,7 @@
*/
#include "av1/common/mvref_common.h"
#if CONFIG_WARPED_MOTION
#include "av1/common/warped_motion.h"
#endif // CONFIG_WARPED_MOTION
#define USE_CUR_GM_REFMV 1
......@@ -1799,7 +1797,6 @@ void av1_setup_motion_field(AV1_COMMON *cm) {
}
#endif // CONFIG_MFMV
#if CONFIG_WARPED_MOTION
#if CONFIG_EXT_WARPED_MOTION
static INLINE void record_samples(MB_MODE_INFO *mbmi, int *pts, int *pts_inref,
int *pts_mv, int global_offset_r,
......@@ -2129,4 +2126,3 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
return np;
}
#endif // CONFIG_EXT_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
......@@ -417,7 +417,6 @@ void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int_mv *mv_ref_list, int block, int mi_row,
int mi_col, int16_t *mode_context);
#if CONFIG_WARPED_MOTION
#if CONFIG_EXT_WARPED_MOTION
int sortSamples(int *pts_mv, MV *mv, int *pts, int *pts_inref, int len);
int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
......@@ -426,7 +425,6 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
int *pts, int *pts_inref);
#endif // CONFIG_EXT_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
#if CONFIG_INTRABC
static INLINE void av1_find_ref_dv(int_mv *ref_dv, int mi_row, int mi_col) {
......
......@@ -38,29 +38,13 @@ static INLINE int allow_warp(const MODE_INFO *const mi,
const MB_MODE_INFO *const mbmi = &mi->mbmi;
*final_warp_params = default_warp_params;
#if CONFIG_WARPED_MOTION
if (mbmi->wm_params[0].invalid) return 0;
#endif
// Motion var and global motion configured
#if !CONFIG_WARPED_MOTION
// We warp if either case is true:
// 1.) We are predicting a block which uses global motion
// 2.) We are predicting a neighboring block of a block using OBMC,
// the neighboring block uses global motion, and we have enabled
// WARP_GM_NEIGHBORS_WITH_OBMC
(void)mbmi;
if (warp_types->global_warp_allowed &&
(WARP_GM_NEIGHBORS_WITH_OBMC || !build_for_obmc)) {
memcpy(final_warp_params, gm_params, sizeof(*final_warp_params));
return 1;
}
#endif // !CONFIG_WARPED_MOTION
// Motion var and global motion configured
// Motion var and warped motion configured
// Motion var and warped motion configured
// Motion var, warped motion and global motion all configured
#if CONFIG_WARPED_MOTION
// Motion var, warped motion and global motion all configured
if (warp_types->local_warp_allowed) {
if ((build_for_obmc && WARP_WM_NEIGHBORS_WITH_OBMC) || (!build_for_obmc)) {
memcpy(final_warp_params, &mbmi->wm_params[0],
......@@ -72,7 +56,6 @@ static INLINE int allow_warp(const MODE_INFO *const mi,
memcpy(final_warp_params, gm_params, sizeof(*final_warp_params));
return 1;
}
#endif // CONFIG_WARPED_MOTION
return 0;
}
......@@ -87,11 +70,7 @@ static INLINE void av1_make_inter_predictor(
(void)xd;
// Make sure the selected motion mode is valid for this configuration
assert_motion_mode_valid(mi->mbmi.motion_mode, 0, xd->global_motion,
#if CONFIG_WARPED_MOTION
xd,
#endif
mi);
assert_motion_mode_valid(mi->mbmi.motion_mode, 0, xd->global_motion, xd, mi);
WarpedMotionParams final_warp_params;
const int do_warp =
......@@ -1133,10 +1112,8 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
const int is_scaled = av1_is_scaled(sf);
WarpTypesAllowed warp_types;
warp_types.global_warp_allowed = is_global[ref];
#if CONFIG_WARPED_MOTION
warp_types.local_warp_allowed =
this_mbmi->motion_mode == WARPED_CAUSAL;
#endif // CONFIG_WARPED_MOTION
if (is_scaled) {
int ssx = pd->subsampling_x;
......@@ -1334,9 +1311,7 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
#endif // CONFIG_INTRABC
WarpTypesAllowed warp_types;
warp_types.global_warp_allowed = is_global[ref];
#if CONFIG_WARPED_MOTION
warp_types.local_warp_allowed = mi->mbmi.motion_mode == WARPED_CAUSAL;
#endif // CONFIG_WARPED_MOTION
conv_params.ref = ref;
conv_params.do_average = ref;
if (is_masked_compound_type(mi->mbmi.interinter_compound_type)) {
......@@ -2670,9 +2645,7 @@ static void build_inter_predictors_single_buf(MACROBLOCKD *xd, int plane,
WarpedMotionParams *const wm = &xd->global_motion[mi->mbmi.ref_frame[ref]];
#endif // CONFIG_COMPOUND_SINGLEREF
warp_types.global_warp_allowed = is_global_mv_block(mi, block, wm->wmtype);
#if CONFIG_WARPED_MOTION
warp_types.local_warp_allowed = mi->mbmi.motion_mode == WARPED_CAUSAL;
#endif // CONFIG_WARPED_MOTION
if (is_scaled) {
int ssx = pd->subsampling_x;
......
......@@ -18,9 +18,7 @@
#include "av1/common/warped_motion.h"
#include "aom/aom_integer.h"
#if CONFIG_WARPED_MOTION
#define WARP_WM_NEIGHBORS_WITH_OBMC 0
#endif // CONFIG_WARPED_MOTION
#define WARP_GM_NEIGHBORS_WITH_OBMC 0
......@@ -449,10 +447,8 @@ static INLINE void set_default_interp_filters(
static INLINE int av1_is_interp_needed(const MACROBLOCKD *const xd) {
(void)xd;
#if CONFIG_WARPED_MOTION
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
if (mbmi->motion_mode == WARPED_CAUSAL) return 0;
#endif // CONFIG_WARPED_MOTION
if (is_nontrans_global_motion(xd)) return 0;
return 1;
}
......
......@@ -322,7 +322,6 @@ static const uint16_t div_lut[DIV_LUT_NUM + 1] = {
8240, 8224, 8208, 8192,
};
#if CONFIG_WARPED_MOTION
// Decomposes a divisor D such that 1/D = y/2^shift, where y is returned
// at precision of DIV_LUT_PREC_BITS along with the shift.
static int16_t resolve_divisor_64(uint64_t D, int16_t *shift) {
......@@ -341,7 +340,6 @@ static int16_t resolve_divisor_64(uint64_t D, int16_t *shift) {
// Use f as lookup into the precomputed table of multipliers
return div_lut[f];
}
#endif // CONFIG_WARPED_MOTION
static int16_t resolve_divisor_32(uint32_t D, int16_t *shift) {
int32_t e, f;
......@@ -1002,7 +1000,6 @@ void av1_warp_plane(WarpedMotionParams *wm,
y_scale, conv_params);
}
#if CONFIG_WARPED_MOTION
#define LEAST_SQUARES_ORDER 2
#define LS_MV_MAX 256 // max mv in 1/8-pel
......@@ -1250,4 +1247,3 @@ int find_projection(int np, int *pts1, int *pts2, BLOCK_SIZE bsize, int mvy,
return 0;
}
#endif // CONFIG_WARPED_MOTION
......@@ -25,7 +25,6 @@
#include "av1/common/convolve.h"
#define MAX_PARAMDIM 9
#if CONFIG_WARPED_MOTION
#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
......@@ -42,7 +41,6 @@
#endif // CONFIG_EXT_WARPED_MOTION
#define DEFAULT_WMTYPE AFFINE
#endif // CONFIG_WARPED_MOTION
extern const int16_t warped_filter[WARPEDPIXEL_PREC_SHIFTS * 3 + 1][8];
......
......@@ -22,9 +22,7 @@
#include "av1/common/reconintra.h"
#endif // CONFIG_EXT_INTRA
#include "av1/common/seg_common.h"
#if CONFIG_WARPED_MOTION
#include "av1/common/warped_motion.h"
#endif // CONFIG_WARPED_MOTION
#include "av1/decoder/decodeframe.h"
#include "av1/decoder/decodemv.h"
......@@ -283,22 +281,16 @@ static void read_drl_idx(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
MODE_INFO *mi, aom_reader *r) {
MB_MODE_INFO *mbmi = &mi->mbmi;
#if !CONFIG_WARPED_MOTION || CONFIG_NEW_MULTISYMBOL || \
CONFIG_NCOBMC_ADAPT_WEIGHT
#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
(void)cm;
#endif
const MOTION_MODE last_motion_mode_allowed =
motion_mode_allowed(0, xd->global_motion,
#if CONFIG_WARPED_MOTION
xd,
#endif
mi);
motion_mode_allowed(0, xd->global_motion, xd, mi);
int motion_mode;
FRAME_COUNTS *counts = xd->counts;
if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return SIMPLE_TRANSLATION;
#if CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
if (last_motion_mode_allowed == NCOBMC_ADAPT_WEIGHT) {
motion_mode = aom_read_symbol(r, xd->tile_ctx->ncobmc_cdf[mbmi->sb_type],
......@@ -323,15 +315,12 @@ static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
} else {
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_WARPED_MOTION
motion_mode =
aom_read_symbol(r, xd->tile_ctx->motion_mode_cdf[mbmi->sb_type],
MOTION_MODES, ACCT_STR);
if (counts) ++counts->motion_mode[mbmi->sb_type][motion_mode];
return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
#if CONFIG_WARPED_MOTION
}
#endif // CONFIG_WARPED_MOTION
}
#if CONFIG_NCOBMC_ADAPT_WEIGHT
......@@ -2203,12 +2192,10 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
int16_t inter_mode_ctx[MODE_CTX_REF_FRAMES];
int16_t compound_inter_mode_ctx[MODE_CTX_REF_FRAMES];
int mode_ctx = 0;
#if CONFIG_WARPED_MOTION
int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
#if CONFIG_EXT_WARPED_MOTION
int pts_mv[SAMPLES_ARRAY_SIZE];
#endif // CONFIG_EXT_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
assert(NELEMENTS(mode_2_counter) == MB_MODE_COUNT);
......@@ -2560,17 +2547,14 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
}
#endif // CONFIG_INTERINTRA
#if CONFIG_WARPED_MOTION
for (ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
RefBuffer *ref_buf = &cm->frame_refs[frame - LAST_FRAME];
xd->block_refs[ref] = ref_buf;
}
#endif
mbmi->motion_mode = SIMPLE_TRANSLATION;
#if CONFIG_WARPED_MOTION
if (mbmi->sb_type >= BLOCK_8X8 && !has_second_ref(mbmi))
#if CONFIG_EXT_WARPED_MOTION
mbmi->num_proj_ref[0] =
......@@ -2578,7 +2562,6 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
#else
mbmi->num_proj_ref[0] = findSamples(cm, xd, mi_row, mi_col, pts, pts_inref);
#endif // CONFIG_EXT_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
av1_count_overlappable_neighbors(cm, xd, mi_row, mi_col);
if (mbmi->ref_frame[1] != INTRA_FRAME)
......@@ -2633,7 +2616,6 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
read_mb_interp_filter(cm, xd, mbmi, r);
#if CONFIG_WARPED_MOTION
if (mbmi->motion_mode == WARPED_CAUSAL) {
mbmi->wm_params[0].wmtype = DEFAULT_WMTYPE;
......@@ -2652,7 +2634,6 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
mbmi->wm_params[0].invalid = 1;
}
}
#endif // CONFIG_WARPED_MOTION
#if DEC_MISMATCH_DEBUG
dec_dump_logs(cm, mi, mi_row, mi_col, inter_mode_ctx, mode_ctx);
......
......@@ -405,13 +405,8 @@ static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
const MB_MODE_INFO *mbmi = &mi->mbmi;
MOTION_MODE last_motion_mode_allowed =
motion_mode_allowed(0, cm->global_motion,
#if CONFIG_WARPED_MOTION
xd,
#endif
mi);
motion_mode_allowed(0, cm->global_motion, xd, mi);
if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return;
#if CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
if (last_motion_mode_allowed == NCOBMC_ADAPT_WEIGHT) {
aom_write_symbol(w, mbmi->motion_mode,
......@@ -432,13 +427,10 @@ static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
#endif
} else {
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_WARPED_MOTION
aom_write_symbol(w, mbmi->motion_mode,
xd->tile_ctx->motion_mode_cdf[mbmi->sb_type],
MOTION_MODES);
#if CONFIG_WARPED_MOTION
}
#endif // CONFIG_WARPED_MOTION
}
#if CONFIG_NCOBMC_ADAPT_WEIGHT
......@@ -2068,7 +2060,6 @@ static void write_mbmi_b(AV1_COMP *cpi, const TileInfo *const tile,
cm->above_txfm_context + (mi_col << TX_UNIT_WIDE_LOG2);
xd->left_txfm_context = xd->left_txfm_context_buffer +
((mi_row & MAX_MIB_MASK) << TX_UNIT_HIGH_LOG2);
#if CONFIG_DUAL_FILTER || CONFIG_WARPED_MOTION
// has_subpel_mv_component needs the ref frame buffers set up to look
// up if they are scaled. has_subpel_mv_component is in turn needed by
// write_switchable_interp_filter, which is called by pack_inter_mode_mvs.
......@@ -2077,7 +2068,6 @@ static void write_mbmi_b(AV1_COMP *cpi, const TileInfo *const tile,
if (!has_second_ref(&m->mbmi) && is_inter_singleref_comp_mode(m->mbmi.mode))
xd->block_refs[1] = xd->block_refs[0];
#endif // CONFIG_COMPOUND_SINGLEREF