Merge "Renamings for OBMC experiment" into nextgenv2
diff --git a/aom_dsp/aom_dsp.mk b/aom_dsp/aom_dsp.mk
index 741bbde..25f98a8 100644
--- a/aom_dsp/aom_dsp.mk
+++ b/aom_dsp/aom_dsp.mk
@@ -311,10 +311,10 @@
DSP_SRCS-$(HAVE_SSSE3) += x86/masked_sad_intrin_ssse3.c
DSP_SRCS-$(HAVE_SSSE3) += x86/masked_variance_intrin_ssse3.c
endif #CONFIG_EXT_INTER
-ifeq ($(CONFIG_OBMC),yes)
+ifeq ($(CONFIG_MOTION_VAR),yes)
DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_sad_sse4.c
DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_variance_sse4.c
-endif #CONFIG_OBMC
+endif #CONFIG_MOTION_VAR
endif #CONFIG_AV1_ENCODER
DSP_SRCS-$(HAVE_SSE) += x86/sad4d_sse2.asm
diff --git a/aom_dsp/aom_dsp_rtcd_defs.pl b/aom_dsp/aom_dsp_rtcd_defs.pl
index 779ed00..6af5588 100644
--- a/aom_dsp/aom_dsp_rtcd_defs.pl
+++ b/aom_dsp/aom_dsp_rtcd_defs.pl
@@ -1201,7 +1201,7 @@
#
# OBMC SAD
#
-if (aom_config("CONFIG_OBMC") eq "yes") {
+if (aom_config("CONFIG_MOTION_VAR") eq "yes") {
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_obmc_sad${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask";
@@ -1533,7 +1533,7 @@
#
# OBMC Variance / OBMC Subpixel Variance
#
-if (aom_config("CONFIG_OBMC") eq "yes") {
+if (aom_config("CONFIG_MOTION_VAR") eq "yes") {
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_obmc_variance${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask, unsigned int *sse";
diff --git a/aom_dsp/sad.c b/aom_dsp/sad.c
index 7d284fc..2172b6c 100644
--- a/aom_dsp/sad.c
+++ b/aom_dsp/sad.c
@@ -410,7 +410,7 @@
#endif // CONFIG_AOM_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_EXT_INTER
-#if CONFIG_AV1 && CONFIG_OBMC
+#if CONFIG_AV1 && CONFIG_MOTION_VAR
// pre: predictor being evaluated
// wsrc: target weighted prediction (has been *4096 to keep precision)
// mask: 2d weights (scaled by 4096)
@@ -509,4 +509,4 @@
HIGHBD_OBMCSADMXN(4, 4)
/* clang-format on */
#endif // CONFIG_AOM_HIGHBITDEPTH
-#endif // CONFIG_AV1 && CONFIG_OBMC
+#endif // CONFIG_AV1 && CONFIG_MOTION_VAR
diff --git a/aom_dsp/variance.c b/aom_dsp/variance.c
index ce02a93..90617d9 100644
--- a/aom_dsp/variance.c
+++ b/aom_dsp/variance.c
@@ -942,7 +942,7 @@
#endif // CONFIG_AOM_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_EXT_INTER
-#if CONFIG_AV1 && CONFIG_OBMC
+#if CONFIG_AV1 && CONFIG_MOTION_VAR
static INLINE void obmc_variance(const uint8_t *pre, int pre_stride,
const int32_t *wsrc, const int32_t *mask,
int w, int h, unsigned int *sse, int *sum) {
@@ -1216,4 +1216,4 @@
HIGHBD_OBMC_SUBPIX_VAR(128, 128)
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_AOM_HIGHBITDEPTH
-#endif // CONFIG_AV1 && CONFIG_OBMC
+#endif // CONFIG_AV1 && CONFIG_MOTION_VAR
diff --git a/aom_dsp/variance.h b/aom_dsp/variance.h
index b73754f..222fdaf 100644
--- a/aom_dsp/variance.h
+++ b/aom_dsp/variance.h
@@ -68,7 +68,7 @@
unsigned int *sse);
#endif // CONFIG_AV1 && CONFIG_EXT_INTER
-#if CONFIG_AV1 && CONFIG_OBMC
+#if CONFIG_AV1 && CONFIG_MOTION_VAR
typedef unsigned int (*aom_obmc_sad_fn_t)(const uint8_t *pred, int pred_stride,
const int32_t *wsrc,
const int32_t *msk);
@@ -80,7 +80,7 @@
typedef unsigned int (*aom_obmc_subpixvariance_fn_t)(
const uint8_t *pred, int pred_stride, int xoffset, int yoffset,
const int32_t *wsrc, const int32_t *msk, unsigned int *sse);
-#endif // CONFIG_AV1 && CONFIG_OBMC
+#endif // CONFIG_AV1 && CONFIG_MOTION_VAR
#if CONFIG_AV1
typedef struct aom_variance_vtable {
@@ -97,11 +97,11 @@
aom_masked_variance_fn_t mvf;
aom_masked_subpixvariance_fn_t msvf;
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
aom_obmc_sad_fn_t osdf;
aom_obmc_variance_fn_t ovf;
aom_obmc_subpixvariance_fn_t osvf;
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
} aom_variance_fn_ptr_t;
#endif // CONFIG_AV1
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index 2481de7..a541378 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -227,7 +227,7 @@
int interinter_wedge_index;
int interinter_wedge_sign;
#endif // CONFIG_EXT_INTER
- MOTION_VARIATION motion_variation;
+ MOTION_MODE motion_mode;
int_mv mv[2];
int_mv pred_mv[2];
#if CONFIG_REF_MV
@@ -772,21 +772,26 @@
}
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
-static INLINE int is_motvar_allowed(const MB_MODE_INFO *mbmi) {
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+static INLINE int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
+ return (bsize >= BLOCK_8X8);
+}
+
+static INLINE int is_motion_variation_allowed(const MB_MODE_INFO *mbmi) {
#if CONFIG_EXT_INTER
- return (mbmi->sb_type >= BLOCK_8X8 && mbmi->ref_frame[1] != INTRA_FRAME);
+ return is_motion_variation_allowed_bsize(mbmi->sb_type) &&
+ mbmi->ref_frame[1] != INTRA_FRAME;
#else
- return (mbmi->sb_type >= BLOCK_8X8);
+ return is_motion_variation_allowed_bsize(mbmi->sb_type);
#endif // CONFIG_EXT_INTER
}
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
static INLINE int is_neighbor_overlappable(const MB_MODE_INFO *mbmi) {
return (is_inter_block(mbmi));
}
-#endif // CONFIG_OBMC
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#ifdef __cplusplus
} // extern "C"
diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c
index b65b6df..4daac84 100644
--- a/av1/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -315,43 +315,45 @@
#endif // CONFIG_EXT_INTER
// Change this section appropriately once warped motion is supported
-#if CONFIG_OBMC && !CONFIG_WARPED_MOTION
-const aom_tree_index av1_motvar_tree[TREE_SIZE(MOTION_VARIATIONS)] = {
+#if CONFIG_MOTION_VAR && !CONFIG_WARPED_MOTION
+const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, -OBMC_CAUSAL
};
-static const aom_prob default_motvar_prob[BLOCK_SIZES]
- [MOTION_VARIATIONS - 1] = {
- { 255 }, { 255 }, { 255 }, { 151 },
- { 153 }, { 144 }, { 178 }, { 165 },
- { 160 }, { 207 }, { 195 }, { 168 },
- { 244 },
+static const aom_prob default_motion_mode_prob[BLOCK_SIZES]
+ [MOTION_MODES - 1] = {
+ { 255 }, { 255 }, { 255 },
+ { 151 }, { 153 }, { 144 },
+ { 178 }, { 165 }, { 160 },
+ { 207 }, { 195 }, { 168 },
+ { 244 },
#if CONFIG_EXT_PARTITION
- { 252 }, { 252 }, { 252 },
+ { 252 }, { 252 }, { 252 },
#endif // CONFIG_EXT_PARTITION
- };
+ };
-#elif !CONFIG_OBMC && CONFIG_WARPED_MOTION
+#elif !CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
-const aom_tree_index av1_motvar_tree[TREE_SIZE(MOTION_VARIATIONS)] = {
+const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, -WARPED_CAUSAL
};
-static const aom_prob default_motvar_prob[BLOCK_SIZES]
- [MOTION_VARIATIONS - 1] = {
- { 255 }, { 255 }, { 255 }, { 151 },
- { 153 }, { 144 }, { 178 }, { 165 },
- { 160 }, { 207 }, { 195 }, { 168 },
- { 244 },
+static const aom_prob default_motion_mode_prob[BLOCK_SIZES]
+ [MOTION_MODES - 1] = {
+ { 255 }, { 255 }, { 255 },
+ { 151 }, { 153 }, { 144 },
+ { 178 }, { 165 }, { 160 },
+ { 207 }, { 195 }, { 168 },
+ { 244 },
#if CONFIG_EXT_PARTITION
- { 252 }, { 252 }, { 252 },
+ { 252 }, { 252 }, { 252 },
#endif // CONFIG_EXT_PARTITION
- };
+ };
-#elif CONFIG_OBMC && CONFIG_WARPED_MOTION
+#elif CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
-const aom_tree_index av1_motvar_tree[TREE_SIZE(MOTION_VARIATIONS)] = {
+const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -WARPED_CAUSAL,
};
-static const aom_prob default_motvar_prob[BLOCK_SIZES][MOTION_VARIATIONS - 1] =
+static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] =
{
{ 255, 200 }, { 255, 200 }, { 255, 200 }, { 151, 200 }, { 153, 200 },
{ 144, 200 }, { 178, 200 }, { 165, 200 }, { 160, 200 }, { 207, 200 },
@@ -360,7 +362,7 @@
{ 252, 200 }, { 252, 200 }, { 252, 200 },
#endif // CONFIG_EXT_PARTITION
};
-#endif // CONFIG_OBMC || !CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || !CONFIG_WARPED_MOTION
/* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */
const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
@@ -1350,9 +1352,9 @@
#endif // CONFIG_EXT_INTER
#endif // CONFIG_REF_MV
av1_copy(fc->inter_mode_probs, default_inter_mode_probs);
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- av1_copy(fc->motvar_prob, default_motvar_prob);
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ av1_copy(fc->motion_mode_prob, default_motion_mode_prob);
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
av1_copy(fc->inter_compound_mode_probs, default_inter_compound_mode_probs);
av1_copy(fc->interintra_prob, default_interintra_prob);
@@ -1451,11 +1453,11 @@
counts->inter_mode[i], fc->inter_mode_probs[i]);
#endif
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i)
- aom_tree_merge_probs(av1_motvar_tree, pre_fc->motvar_prob[i],
- counts->motvar[i], fc->motvar_prob[i]);
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+ aom_tree_merge_probs(av1_motion_mode_tree, pre_fc->motion_mode_prob[i],
+ counts->motion_mode[i], fc->motion_mode_prob[i]);
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_SUPERTX
for (i = 0; i < PARTITION_SUPERTX_CONTEXTS; ++i) {
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index 3120f90..4f33bba 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -80,9 +80,9 @@
aom_prob wedge_interintra_prob[BLOCK_SIZES];
aom_prob wedge_interinter_prob[BLOCK_SIZES];
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- aom_prob motvar_prob[BLOCK_SIZES][MOTION_VARIATIONS - 1];
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ aom_prob motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1];
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
aom_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
aom_prob comp_inter_prob[COMP_INTER_CONTEXTS];
aom_prob single_ref_prob[REF_CONTEXTS][SINGLE_REFS - 1];
@@ -165,9 +165,9 @@
unsigned int wedge_interintra[BLOCK_SIZES][2];
unsigned int wedge_interinter[BLOCK_SIZES][2];
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- unsigned int motvar[BLOCK_SIZES][MOTION_VARIATIONS];
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ unsigned int motion_mode[BLOCK_SIZES][MOTION_MODES];
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
unsigned int single_ref[REF_CONTEXTS][SINGLE_REFS - 1][2];
@@ -262,9 +262,9 @@
#else
extern const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)];
#endif // CONFIG_EXT_TX
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
-extern const aom_tree_index av1_motvar_tree[TREE_SIZE(MOTION_VARIATIONS)];
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+extern const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)];
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_LOOP_RESTORATION
#define RESTORE_NONE_BILATERAL_PROB 16
diff --git a/av1/common/enums.h b/av1/common/enums.h
index 7c63255..cefed6c 100644
--- a/av1/common/enums.h
+++ b/av1/common/enums.h
@@ -290,14 +290,14 @@
typedef enum {
SIMPLE_TRANSLATION = 0,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
OBMC_CAUSAL, // 2-sided OBMC
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_WARPED_MOTION
WARPED_CAUSAL, // 2-sided WARPED
#endif // CONFIG_WARPED_MOTION
- MOTION_VARIATIONS
-} MOTION_VARIATION;
+ MOTION_MODES
+} MOTION_MODE;
#if CONFIG_EXT_INTER
typedef enum {
diff --git a/av1/common/reconinter.c b/av1/common/reconinter.c
index d6e2d78..ae57a43 100644
--- a/av1/common/reconinter.c
+++ b/av1/common/reconinter.c
@@ -21,9 +21,9 @@
#include "av1/common/blockd.h"
#include "av1/common/reconinter.h"
#include "av1/common/reconintra.h"
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
#include "av1/common/onyxc_int.h"
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_GLOBAL_MOTION
#include "av1/common/warped_motion.h"
#endif // CONFIG_GLOBAL_MOTION
@@ -534,9 +534,9 @@
}
void build_inter_predictors(MACROBLOCKD *xd, int plane,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
int mi_col_offset, int mi_row_offset,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
int block, int bw, int bh, int x, int y, int w,
int h,
#if CONFIG_SUPERTX && CONFIG_EXT_INTER
@@ -544,11 +544,11 @@
#endif // CONFIG_SUPERTX && CONFIG_EXT_INTER
int mi_x, int mi_y) {
struct macroblockd_plane *const pd = &xd->plane[plane];
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
const MODE_INFO *mi = xd->mi[mi_col_offset + xd->mi_stride * mi_row_offset];
#else
const MODE_INFO *mi = xd->mi[0];
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
const int is_compound = has_second_ref(&mi->mbmi);
int ref;
#if CONFIG_GLOBAL_MOTION
@@ -782,9 +782,9 @@
for (y = 0; y < num_4x4_h; ++y)
for (x = 0; x < num_4x4_w; ++x)
build_inter_predictors(xd, plane,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
0, 0,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
y * 2 + x, bw, bh, 4 * x, 4 * y, pw, ph,
#if CONFIG_SUPERTX && CONFIG_EXT_INTER
0, 0,
@@ -792,9 +792,9 @@
mi_x, mi_y);
} else {
build_inter_predictors(xd, plane,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
0, 0,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
0, bw, bh, 0, 0, bw, bh,
#if CONFIG_SUPERTX && CONFIG_EXT_INTER
0, 0,
@@ -1056,9 +1056,9 @@
const int bh = 4 * num_4x4_h;
build_inter_predictors(xd, plane,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
0, 0,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
block, bw, bh, 0, 0, bw, bh,
#if CONFIG_EXT_INTER
wedge_offset_x, wedge_offset_y,
@@ -1101,9 +1101,9 @@
for (y = 0; y < num_4x4_h; ++y)
for (x = 0; x < num_4x4_w; ++x)
build_inter_predictors(xd, plane,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
0, 0,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
y * 2 + x, bw, bh, 4 * x, 4 * y, 4, 4,
#if CONFIG_EXT_INTER
wedge_offset_x, wedge_offset_y,
@@ -1111,9 +1111,9 @@
mi_x, mi_y);
} else {
build_inter_predictors(xd, plane,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
0, 0,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
0, bw, bh, 0, 0, bw, bh,
#if CONFIG_EXT_INTER
wedge_offset_x, wedge_offset_y,
@@ -1124,7 +1124,7 @@
}
#endif // CONFIG_SUPERTX
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
// obmc_mask_N[overlap_position]
static const uint8_t obmc_mask_1[1] = { 55 };
@@ -1474,7 +1474,7 @@
}
xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8);
}
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER
#if CONFIG_EXT_PARTITION
diff --git a/av1/common/reconinter.h b/av1/common/reconinter.h
index 26a4590..4f86354 100644
--- a/av1/common/reconinter.h
+++ b/av1/common/reconinter.h
@@ -214,9 +214,9 @@
#endif // CONFIG_EXT_INTER
void build_inter_predictors(MACROBLOCKD *xd, int plane,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
int mi_col_offset, int mi_row_offset,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
int block, int bw, int bh, int x, int y, int w,
int h,
#if CONFIG_SUPERTX && CONFIG_EXT_INTER
@@ -515,7 +515,7 @@
}
#endif // CONFIG_EXT_INTERP
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
const uint8_t *av1_get_obmc_mask(int length);
void av1_build_obmc_inter_prediction(AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col,
@@ -535,7 +535,7 @@
int tmp_width[MAX_MB_PLANE],
int tmp_height[MAX_MB_PLANE],
int tmp_stride[MAX_MB_PLANE]);
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER
#define MASK_MASTER_SIZE (2 * MAX_SB_SIZE)
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index e41f166..acca4cb 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -1238,8 +1238,8 @@
} else {
// Prediction
av1_build_inter_predictors_sb(xd, mi_row, mi_col, AOMMAX(bsize, BLOCK_8X8));
-#if CONFIG_OBMC
- if (mbmi->motion_variation == OBMC_CAUSAL) {
+#if CONFIG_MOTION_VAR
+ if (mbmi->motion_mode == OBMC_CAUSAL) {
#if CONFIG_AOM_HIGHBITDEPTH
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]);
@@ -1284,7 +1284,7 @@
av1_build_obmc_inter_prediction(cm, xd, mi_row, mi_col, dst_buf1,
dst_stride1, dst_buf2, dst_stride2);
}
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
// Reconstruction
if (!mbmi->skip) {
@@ -3707,12 +3707,12 @@
}
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i) {
- for (j = 0; j < MOTION_VARIATIONS - 1; ++j)
- av1_diff_update_prob(&r, &fc->motvar_prob[i][j]);
+ for (j = 0; j < MOTION_MODES - 1; ++j)
+ av1_diff_update_prob(&r, &fc->motion_mode_prob[i][j]);
}
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (cm->interp_filter == SWITCHABLE) read_switchable_interp_probs(fc, &r);
@@ -3780,10 +3780,10 @@
assert(!memcmp(cm->counts.wedge_interinter, zero_counts.wedge_interinter,
sizeof(cm->counts.wedge_interinter)));
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- assert(!memcmp(cm->counts.motvar, zero_counts.motvar,
- sizeof(cm->counts.motvar)));
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ assert(!memcmp(cm->counts.motion_mode, zero_counts.motion_mode,
+ sizeof(cm->counts.motion_mode)));
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
assert(!memcmp(cm->counts.intra_inter, zero_counts.intra_inter,
sizeof(cm->counts.intra_inter)));
assert(!memcmp(cm->counts.comp_inter, zero_counts.comp_inter,
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index 1438a56..3f9ab23 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -819,24 +819,22 @@
}
}
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
-static MOTION_VARIATION read_motvar_block(AV1_COMMON *const cm,
- MACROBLOCKD *const xd,
- aom_reader *r) {
- BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
- FRAME_COUNTS *counts = xd->counts;
- MOTION_VARIATION motvar;
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
+ MB_MODE_INFO *mbmi, aom_reader *r) {
+ if (is_motion_variation_allowed(mbmi)) {
+ int motion_mode;
+ FRAME_COUNTS *counts = xd->counts;
- if (is_motvar_allowed(&xd->mi[0]->mbmi)) {
- motvar = (MOTION_VARIATION)aom_read_tree(r, av1_motvar_tree,
- cm->fc->motvar_prob[bsize]);
- if (counts) ++counts->motvar[bsize][motvar];
- return motvar;
+ motion_mode = aom_read_tree(r, av1_motion_mode_tree,
+ cm->fc->motion_mode_prob[mbmi->sb_type]);
+ if (counts) ++counts->motion_mode[mbmi->sb_type][motion_mode];
+ return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
} else {
return SIMPLE_TRANSLATION;
}
}
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static INLINE InterpFilter read_interp_filter(AV1_COMMON *const cm,
MACROBLOCKD *const xd,
@@ -1166,12 +1164,12 @@
static void read_inter_block_mode_info(AV1Decoder *const pbi,
MACROBLOCKD *const xd,
MODE_INFO *const mi,
-#if (CONFIG_OBMC || CONFIG_EXT_INTER) && CONFIG_SUPERTX
+#if (CONFIG_MOTION_VAR || CONFIG_EXT_INTER) && CONFIG_SUPERTX
int mi_row, int mi_col, aom_reader *r,
int supertx_enabled) {
#else
int mi_row, int mi_col, aom_reader *r) {
-#endif // CONFIG_OBMC && CONFIG_SUPERTX
+#endif // CONFIG_MOTION_VAR && CONFIG_SUPERTX
AV1_COMMON *const cm = &pbi->common;
MB_MODE_INFO *const mbmi = &mi->mbmi;
const BLOCK_SIZE bsize = mbmi->sb_type;
@@ -1538,25 +1536,25 @@
}
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- mbmi->motion_variation = SIMPLE_TRANSLATION;
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ mbmi->motion_mode = SIMPLE_TRANSLATION;
#if CONFIG_SUPERTX
if (!supertx_enabled)
#endif // CONFIG_SUPERTX
#if CONFIG_EXT_INTER
if (mbmi->ref_frame[1] != INTRA_FRAME)
#endif // CONFIG_EXT_INTER
- mbmi->motion_variation = read_motvar_block(cm, xd, r);
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+ mbmi->motion_mode = read_motion_mode(cm, xd, mbmi, r);
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
mbmi->use_wedge_interinter = 0;
if (cm->reference_mode != SINGLE_REFERENCE &&
is_inter_compound_mode(mbmi->mode) &&
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- !(is_motvar_allowed(mbmi) &&
- mbmi->motion_variation != SIMPLE_TRANSLATION) &&
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ !(is_motion_variation_allowed(mbmi) &&
+ mbmi->motion_mode != SIMPLE_TRANSLATION) &&
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
is_interinter_wedge_used(bsize)) {
mbmi->use_wedge_interinter =
aom_read(r, cm->fc->wedge_interinter_prob[bsize]);
@@ -1698,12 +1696,12 @@
if (inter_block)
read_inter_block_mode_info(pbi, xd,
-#if (CONFIG_OBMC || CONFIG_EXT_INTER) && CONFIG_SUPERTX
+#if (CONFIG_MOTION_VAR || CONFIG_EXT_INTER) && CONFIG_SUPERTX
mi, mi_row, mi_col, r, supertx_enabled);
#else
mi, mi_row, mi_col, r);
-#endif // CONFIG_OBMC && CONFIG_SUPERTX
+#endif // CONFIG_MOTION_VAR && CONFIG_SUPERTX
else
read_intra_block_mode_info(cm, xd, mi, r);
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 6604728..80da661 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -149,9 +149,9 @@
#if CONFIG_EXT_INTER
static struct av1_token interintra_mode_encodings[INTERINTRA_MODES];
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
-static struct av1_token motvar_encodings[MOTION_VARIATIONS];
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+static struct av1_token motion_mode_encodings[MOTION_MODES];
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_LOOP_RESTORATION
static struct av1_token switchable_restore_encodings[RESTORE_SWITCHABLE_TYPES];
#endif // CONFIG_LOOP_RESTORATION
@@ -174,9 +174,9 @@
#if CONFIG_EXT_INTER
av1_tokens_from_tree(interintra_mode_encodings, av1_interintra_mode_tree);
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- av1_tokens_from_tree(motvar_encodings, av1_motvar_tree);
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ av1_tokens_from_tree(motion_mode_encodings, av1_motion_mode_tree);
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_GLOBAL_MOTION
av1_tokens_from_tree(global_motion_types_encodings,
av1_global_motion_types_tree);
@@ -1339,30 +1339,31 @@
}
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_SUPERTX
if (!supertx_enabled)
#endif // CONFIG_SUPERTX
#if CONFIG_EXT_INTER
if (mbmi->ref_frame[1] != INTRA_FRAME)
#endif // CONFIG_EXT_INTER
- if (is_motvar_allowed(mbmi)) {
+ if (is_motion_variation_allowed(mbmi)) {
// TODO(debargha): Might want to only emit this if SEG_LVL_SKIP
// is not active, and assume SIMPLE_TRANSLATION in the decoder if
// it is active.
- assert(mbmi->motion_variation < MOTION_VARIATIONS);
- av1_write_token(w, av1_motvar_tree, cm->fc->motvar_prob[bsize],
- &motvar_encodings[mbmi->motion_variation]);
+ assert(mbmi->motion_mode < MOTION_MODES);
+ av1_write_token(w, av1_motion_mode_tree,
+ cm->fc->motion_mode_prob[bsize],
+ &motion_mode_encodings[mbmi->motion_mode]);
}
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
if (cpi->common.reference_mode != SINGLE_REFERENCE &&
is_inter_compound_mode(mbmi->mode) &&
-#if CONFIG_OBMC
- !(is_motvar_allowed(mbmi) &&
- mbmi->motion_variation != SIMPLE_TRANSLATION) &&
-#endif // CONFIG_OBMC
+#if CONFIG_MOTION_VAR
+ !(is_motion_variation_allowed(mbmi) &&
+ mbmi->motion_mode != SIMPLE_TRANSLATION) &&
+#endif // CONFIG_MOTION_VAR
is_interinter_wedge_used(bsize)) {
aom_write(w, mbmi->use_wedge_interinter,
cm->fc->wedge_interinter_prob[bsize]);
@@ -3430,11 +3431,11 @@
}
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i)
- prob_diff_update(av1_motvar_tree, fc->motvar_prob[i], counts->motvar[i],
- MOTION_VARIATIONS, header_bc);
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+ prob_diff_update(av1_motion_mode_tree, fc->motion_mode_prob[i],
+ counts->motion_mode[i], MOTION_MODES, header_bc);
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (cm->interp_filter == SWITCHABLE)
update_switchable_interp_probs(cm, header_bc, counts);
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 8e17f66..2d9a892 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1302,7 +1302,7 @@
}
#endif // CONFIG_VAR_TX
// Turn motion variation off for supertx
- mbmi->motion_variation = SIMPLE_TRANSLATION;
+ mbmi->motion_mode = SIMPLE_TRANSLATION;
if (dry_run) return;
@@ -1887,24 +1887,24 @@
}
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_SUPERTX
if (!supertx_enabled)
#endif // CONFIG_SUPERTX
#if CONFIG_EXT_INTER
if (mbmi->ref_frame[1] != INTRA_FRAME)
#endif // CONFIG_EXT_INTER
- if (is_motvar_allowed(mbmi))
- counts->motvar[mbmi->sb_type][mbmi->motion_variation]++;
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+ if (is_motion_variation_allowed(mbmi))
+ counts->motion_mode[mbmi->sb_type][mbmi->motion_mode]++;
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
if (cm->reference_mode != SINGLE_REFERENCE &&
is_inter_compound_mode(mbmi->mode) &&
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- !(is_motvar_allowed(mbmi) &&
- mbmi->motion_variation != SIMPLE_TRANSLATION) &&
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ !(is_motion_variation_allowed(mbmi) &&
+ mbmi->motion_mode != SIMPLE_TRANSLATION) &&
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
is_interinter_wedge_used(bsize)) {
counts->wedge_interinter[bsize][mbmi->use_wedge_interinter]++;
}
@@ -5077,8 +5077,8 @@
av1_build_inter_predictors_sbuv(xd, mi_row, mi_col,
AOMMAX(bsize, BLOCK_8X8));
-#if CONFIG_OBMC
- if (mbmi->motion_variation == OBMC_CAUSAL) {
+#if CONFIG_MOTION_VAR
+ if (mbmi->motion_mode == OBMC_CAUSAL) {
#if CONFIG_AOM_HIGHBITDEPTH
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]);
@@ -5124,7 +5124,7 @@
av1_build_obmc_inter_prediction(cm, xd, mi_row, mi_col, dst_buf1,
dst_stride1, dst_buf2, dst_stride2);
}
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
av1_encode_sb(x, AOMMAX(bsize, BLOCK_8X8));
#if CONFIG_VAR_TX
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index af7e5a6..acb5498 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -1181,7 +1181,7 @@
MAKE_MBFP_SAD_WRAPPER(aom_highbd_masked_sad4x4)
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
#define HIGHBD_OBFP(BT, OSDF, OVF, OSVF) \
cpi->fn_ptr[BT].osdf = OSDF; \
cpi->fn_ptr[BT].ovf = OVF; \
@@ -1222,7 +1222,7 @@
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad8x4)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad4x8)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad4x4)
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
static void highbd_set_var_fns(AV1_COMP *const cpi) {
AV1_COMMON *const cm = &cpi->common;
@@ -1384,7 +1384,7 @@
aom_highbd_masked_variance4x4,
aom_highbd_masked_sub_pixel_variance4x4)
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
#if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits8,
aom_highbd_obmc_variance128x128,
@@ -1435,7 +1435,7 @@
HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits8,
aom_highbd_obmc_variance4x4,
aom_highbd_obmc_sub_pixel_variance4x4)
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
break;
case AOM_BITS_10:
@@ -1598,7 +1598,7 @@
aom_highbd_10_masked_variance4x4,
aom_highbd_10_masked_sub_pixel_variance4x4)
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
#if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits10,
aom_highbd_10_obmc_variance128x128,
@@ -1649,7 +1649,7 @@
HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits10,
aom_highbd_10_obmc_variance4x4,
aom_highbd_10_obmc_sub_pixel_variance4x4)
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
break;
case AOM_BITS_12:
@@ -1813,7 +1813,7 @@
aom_highbd_12_masked_sub_pixel_variance4x4)
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
#if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits12,
aom_highbd_12_obmc_variance128x128,
@@ -1864,7 +1864,7 @@
HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits12,
aom_highbd_12_obmc_variance4x4,
aom_highbd_12_obmc_sub_pixel_variance4x4)
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
break;
default:
@@ -2356,7 +2356,7 @@
aom_sub_pixel_variance4x4, aom_sub_pixel_avg_variance4x4, aom_sad4x4x3,
aom_sad4x4x8, aom_sad4x4x4d)
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
#define OBFP(BT, OSDF, OVF, OSVF) \
cpi->fn_ptr[BT].osdf = OSDF; \
cpi->fn_ptr[BT].ovf = OVF; \
@@ -2396,7 +2396,7 @@
aom_obmc_sub_pixel_variance8x4)
OBFP(BLOCK_4X4, aom_obmc_sad4x4, aom_obmc_variance4x4,
aom_obmc_sub_pixel_variance4x4)
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER
#define MBFP(BT, MSDF, MVF, MSVF) \
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index e352973..f854874 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -543,9 +543,9 @@
[INTER_COMPOUND_MODES];
unsigned int interintra_mode_cost[BLOCK_SIZE_GROUPS][INTERINTRA_MODES];
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- int motvar_cost[BLOCK_SIZES][MOTION_VARIATIONS];
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ int motion_mode_cost[BLOCK_SIZES][MOTION_MODES];
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
int intra_uv_mode_cost[INTRA_MODES][INTRA_MODES];
int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES];
int switchable_interp_costs[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS];
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index 9ea9ede..1dc6b99 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -2930,7 +2930,7 @@
}
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
/* returns subpixel variance error function */
#define DIST(r, c) \
vfp->osvf(pre(y, y_stride, r, c), y_stride, sp(c), sp(r), z, mask, &sse)
@@ -3414,4 +3414,4 @@
}
return bestsme;
}
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
diff --git a/av1/encoder/mcomp.h b/av1/encoder/mcomp.h
index f5ac0e3..f1eccc2 100644
--- a/av1/encoder/mcomp.h
+++ b/av1/encoder/mcomp.h
@@ -140,7 +140,7 @@
const MV *ref_mv, MV *dst_mv, int is_second);
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
int av1_obmc_full_pixel_diamond(const struct AV1_COMP *cpi, MACROBLOCK *x,
const int32_t *wsrc, const int32_t *mask,
MV *mvp_full, int step_param, int sadpb,
@@ -153,7 +153,7 @@
int allow_hp, int error_per_bit, const aom_variance_fn_ptr_t *vfp,
int forced_stop, int iters_per_step, int *mvjcost, int *mvcost[2],
int *distortion, unsigned int *sse1, int is_second, int use_upsampled_ref);
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 5212cbf..ff96714 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -435,12 +435,12 @@
cm->fc->interintra_mode_prob[i],
av1_interintra_mode_tree);
#endif // CONFIG_EXT_INTER
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; i++) {
- av1_cost_tokens((int *)cpi->motvar_cost[i], cm->fc->motvar_prob[i],
- av1_motvar_tree);
+ av1_cost_tokens((int *)cpi->motion_mode_cost[i],
+ cm->fc->motion_mode_prob[i], av1_motion_mode_tree);
}
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
}
}
}
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 8be7310..8707061 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -5993,7 +5993,7 @@
}
}
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
static void single_motion_search_obmc(AV1_COMP *cpi, MACROBLOCK *x,
BLOCK_SIZE bsize, int mi_row, int mi_col,
const int32_t *wsrc, const int32_t *mask,
@@ -6123,7 +6123,7 @@
xd->plane[i].pre[ref_idx] = backup_yv12[i];
}
}
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER
static void do_masked_motion_search(AV1_COMP *cpi, MACROBLOCK *x,
@@ -6661,10 +6661,10 @@
int64_t *distortion, int *skippable, int *rate_y, int *rate_uv,
int *disable_skip, int_mv (*mode_mv)[TOTAL_REFS_PER_FRAME], int mi_row,
int mi_col,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
uint8_t *dst_buf1[3], int dst_stride1[3], uint8_t *dst_buf2[3],
int dst_stride2[3], const int32_t *const wsrc, const int32_t *const mask2d,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER
int_mv single_newmvs[2][TOTAL_REFS_PER_FRAME],
int single_newmvs_rate[2][TOTAL_REFS_PER_FRAME],
@@ -6706,12 +6706,12 @@
#endif // CONFIG_AOM_HIGHBITDEPTH
uint8_t *tmp_buf;
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
int allow_motvar =
#if CONFIG_EXT_INTER
!is_comp_interintra_pred &&
#endif // CONFIG_EXT_INTER
- is_motvar_allowed(mbmi);
+ is_motion_variation_allowed(mbmi);
int rate2_nocoeff = 0, best_rate2 = INT_MAX, best_skippable, best_xskip,
best_disable_skip = 0;
int best_rate_y, best_rate_uv;
@@ -6725,7 +6725,7 @@
int rate_mv_bmc;
MB_MODE_INFO best_bmc_mbmi;
#endif // CONFIG_EXT_INTER
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
int pred_exists = 0;
int intpel_mv;
@@ -7162,12 +7162,12 @@
rs = cm->interp_filter == SWITCHABLE ? av1_get_switchable_rate(cpi, xd) : 0;
#if CONFIG_EXT_INTER
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
best_bmc_mbmi = *mbmi;
rate_mv_bmc = rate_mv;
rate2_bmc_nocoeff = *rate2;
if (cm->interp_filter == SWITCHABLE) rate2_bmc_nocoeff += rs;
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
if (is_comp_pred && is_interinter_wedge_used(bsize)) {
int rate_sum, rs;
@@ -7517,20 +7517,19 @@
}
if (cm->interp_filter == SWITCHABLE) *rate2 += rs;
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
rate2_nocoeff = *rate2;
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
best_rd = INT64_MAX;
- for (mbmi->motion_variation = SIMPLE_TRANSLATION;
- mbmi->motion_variation < (allow_motvar ? MOTION_VARIATIONS : 1);
- mbmi->motion_variation++) {
+ for (mbmi->motion_mode = SIMPLE_TRANSLATION;
+ mbmi->motion_mode < (allow_motvar ? MOTION_MODES : 1);
+ mbmi->motion_mode++) {
int64_t tmp_rd;
#if CONFIG_EXT_INTER
- int tmp_rate2 = mbmi->motion_variation != SIMPLE_TRANSLATION
- ? rate2_bmc_nocoeff
- : rate2_nocoeff;
+ int tmp_rate2 = mbmi->motion_mode != SIMPLE_TRANSLATION ? rate2_bmc_nocoeff
+ : rate2_nocoeff;
#else
int tmp_rate2 = rate2_nocoeff;
#endif // CONFIG_EXT_INTER
@@ -7548,13 +7547,13 @@
#endif // CONFIG_DUAL_FILTER
#endif // CONFIG_EXT_INTERP
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
int tmp_rate;
int64_t tmp_dist;
- if (mbmi->motion_variation == OBMC_CAUSAL) {
+ if (mbmi->motion_mode == OBMC_CAUSAL) {
#if CONFIG_EXT_INTER
*mbmi = best_bmc_mbmi;
- mbmi->motion_variation = OBMC_CAUSAL;
+ mbmi->motion_mode = OBMC_CAUSAL;
#endif // CONFIG_EXT_INTER
if (!is_comp_pred && have_newmv_in_inter_mode(this_mode)) {
int_mv tmp_mv;
@@ -7601,19 +7600,19 @@
model_rd_for_sb(cpi, bsize, x, xd, 0, MAX_MB_PLANE - 1, &tmp_rate,
&tmp_dist, &skip_txfm_sb, &skip_sse_sb);
}
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_WARPED_MOTION
- if (mbmi->motion_variation == WARPED_CAUSAL) {
+ if (mbmi->motion_mode == WARPED_CAUSAL) {
// TODO(yuec): Add code
}
#endif // CONFIG_WARPED_MOTION
x->skip = 0;
*rate2 = tmp_rate2;
- if (allow_motvar) *rate2 += cpi->motvar_cost[bsize][mbmi->motion_variation];
+ if (allow_motvar) *rate2 += cpi->motion_mode_cost[bsize][mbmi->motion_mode];
*distortion = 0;
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (!skip_txfm_sb) {
int skippable_y, skippable_uv;
int64_t sseuv = INT64_MAX;
@@ -7643,16 +7642,16 @@
if (*rate_y == INT_MAX) {
*rate2 = INT_MAX;
*distortion = INT64_MAX;
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- if (mbmi->motion_variation != SIMPLE_TRANSLATION) {
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ if (mbmi->motion_mode != SIMPLE_TRANSLATION) {
continue;
} else {
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
restore_dst_buf(xd, orig_dst, orig_dst_stride);
return INT64_MAX;
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
}
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
}
*rate2 += *rate_y;
@@ -7671,19 +7670,19 @@
{
*rate2 = INT_MAX;
*distortion = INT64_MAX;
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
continue;
#else
restore_dst_buf(xd, orig_dst, orig_dst_stride);
return INT64_MAX;
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
}
*psse += sseuv;
*rate2 += *rate_uv;
*distortion += distortion_uv;
*skippable = skippable_y && skippable_uv;
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (*skippable) {
*rate2 -= *rate_uv + *rate_y;
*rate_y = 0;
@@ -7709,16 +7708,16 @@
mbmi->skip = 0;
}
*disable_skip = 0;
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
} else {
x->skip = 1;
*disable_skip = 1;
mbmi->tx_size = tx_size_from_tx_mode(bsize, cm->tx_mode, 1);
// The cost of skip bit needs to be added.
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
mbmi->skip = 0;
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
*rate2 += av1_cost_bit(av1_get_skip_prob(cm, xd), 1);
*distortion = skip_sse_sb;
@@ -7734,15 +7733,15 @@
}
#endif // CONFIG_GLOBAL_MOTION
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
tmp_rd = RDCOST(x->rdmult, x->rddiv, *rate2, *distortion);
- if (mbmi->motion_variation == SIMPLE_TRANSLATION || (tmp_rd < best_rd)) {
+ if (mbmi->motion_mode == SIMPLE_TRANSLATION || (tmp_rd < best_rd)) {
#if CONFIG_EXT_INTERP
#if CONFIG_DUAL_FILTER
- mbmi->interp_filter[0] = obmc_interp_filter[mbmi->motion_variation][0];
- mbmi->interp_filter[1] = obmc_interp_filter[mbmi->motion_variation][1];
+ mbmi->interp_filter[0] = obmc_interp_filter[mbmi->motion_mode][0];
+ mbmi->interp_filter[1] = obmc_interp_filter[mbmi->motion_mode][1];
#else
- mbmi->interp_filter = obmc_interp_filter[mbmi->motion_variation];
+ mbmi->interp_filter = obmc_interp_filter[mbmi->motion_mode];
#endif // CONFIG_DUAL_FILTER
#endif // CONFIG_EXT_INTERP
best_mbmi = *mbmi;
@@ -7793,11 +7792,11 @@
*skippable = best_skippable;
x->skip = best_xskip;
*disable_skip = best_disable_skip;
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (!is_comp_pred) single_skippable[this_mode][refs[0]] = *skippable;
-#if !(CONFIG_OBMC || CONFIG_WARPED_MOTION)
+#if !(CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION)
#if CONFIG_AOM_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
x->recon_variance = av1_high_get_sby_perpixel_variance(
@@ -7810,7 +7809,7 @@
x->recon_variance =
av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
#endif // CONFIG_AOM_HIGHBITDEPTH
-#endif // !(CONFIG_OBMC || CONFIG_WARPED_MOTION)
+#endif // !(CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION)
restore_dst_buf(xd, orig_dst, orig_dst_stride);
return 0; // The rate-distortion cost will be re-calculated by caller.
@@ -8181,14 +8180,14 @@
}
#endif // CONFIG_EXT_INTRA
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x,
const MACROBLOCKD *xd, int mi_row,
int mi_col, const uint8_t *above,
int above_stride, const uint8_t *left,
int left_stride, int32_t *mask_buf,
int32_t *wsrc_buf);
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
MACROBLOCK *x, int mi_row, int mi_col,
@@ -8287,7 +8286,7 @@
const int cols = 4 * num_4x4_blocks_wide_lookup[bsize];
const MODE_INFO *above_mi = xd->above_mi;
const MODE_INFO *left_mi = xd->left_mi;
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
#if CONFIG_AOM_HIGHBITDEPTH
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]);
@@ -8325,7 +8324,7 @@
#if CONFIG_AOM_HIGHBITDEPTH
}
#endif // CONFIG_AOM_HIGHBITDEPTH
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
av1_zero(best_mbmode);
av1_zero(pmi_uv);
@@ -8400,7 +8399,7 @@
}
#endif // CONFIG_REF_MV
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
av1_build_prediction_by_above_preds(cm, xd, mi_row, mi_col, dst_buf1,
dst_width1, dst_height1, dst_stride1);
av1_build_prediction_by_left_preds(cm, xd, mi_row, mi_col, dst_buf2,
@@ -8409,7 +8408,7 @@
calc_target_weighted_pred(cm, x, xd, mi_row, mi_col, dst_buf1[0],
dst_stride1[0], dst_buf2[0], dst_stride2[0],
mask2d_buf, weighted_src_buf);
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
if (!(cpi->ref_frame_flags & flag_list[ref_frame])) {
@@ -8733,7 +8732,7 @@
cm->interp_filter == SWITCHABLE ? EIGHTTAP_REGULAR : cm->interp_filter;
#endif
mbmi->mv[0].as_int = mbmi->mv[1].as_int = 0;
- mbmi->motion_variation = SIMPLE_TRANSLATION;
+ mbmi->motion_mode = SIMPLE_TRANSLATION;
x->skip = 0;
set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
@@ -8929,10 +8928,10 @@
this_rd = handle_inter_mode(
cpi, x, bsize, &rate2, &distortion2, &skippable, &rate_y, &rate_uv,
&disable_skip, frame_mv, mi_row, mi_col,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
dst_buf1, dst_stride1, dst_buf2, dst_stride2, weighted_src_buf,
mask2d_buf,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER
single_newmvs, single_newmvs_rate, &compmode_interintra_cost,
&compmode_wedge_cost, modelled_rd,
@@ -9037,10 +9036,10 @@
tmp_alt_rd = handle_inter_mode(
cpi, x, bsize, &tmp_rate, &tmp_dist, &tmp_skip, &tmp_rate_y,
&tmp_rate_uv, &dummy_disable_skip, frame_mv, mi_row, mi_col,
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
dst_buf1, dst_stride1, dst_buf2, dst_stride2, weighted_src_buf,
mask2d_buf,
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER
dummy_single_newmvs, dummy_single_newmvs_rate,
&dummy_compmode_interintra_cost, &dummy_compmode_wedge_cost,
@@ -9070,7 +9069,7 @@
}
if (tmp_alt_rd < INT64_MAX) {
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
tmp_alt_rd = RDCOST(x->rdmult, x->rddiv, tmp_rate, tmp_dist);
#else
if (RDCOST(x->rdmult, x->rddiv, tmp_rate_y + tmp_rate_uv,
@@ -9085,7 +9084,7 @@
tmp_rate + av1_cost_bit(av1_get_skip_prob(cm, xd), 1) -
tmp_rate_y - tmp_rate_uv,
tmp_sse);
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
}
if (tmp_ref_rd > tmp_alt_rd) {
@@ -9134,9 +9133,9 @@
#if CONFIG_EXT_INTER
rate2 += compmode_interintra_cost;
if (cm->reference_mode != SINGLE_REFERENCE && comp_pred)
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- if (mbmi->motion_variation == SIMPLE_TRANSLATION)
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ if (mbmi->motion_mode == SIMPLE_TRANSLATION)
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
rate2 += compmode_wedge_cost;
#endif // CONFIG_EXT_INTER
@@ -9151,11 +9150,11 @@
rate2 += ref_costs_single[ref_frame];
}
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
if (ref_frame == INTRA_FRAME) {
#else
if (!disable_skip) {
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
if (skippable) {
// Back out the coefficient coding costs
rate2 -= (rate_y + rate_uv);
@@ -9191,7 +9190,7 @@
// Calculate the final RD estimate for this mode.
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
} else {
this_skip2 = mbmi->skip;
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
@@ -9199,7 +9198,7 @@
rate_y = 0;
rate_uv = 0;
}
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
}
// Apply an adjustment to the rd value based on the similarity of the
@@ -9249,10 +9248,10 @@
av1_get_skip_prob(cm, xd), disable_skip || skippable || this_skip2);
*returnrate_nocoef -= av1_cost_bit(av1_get_intra_inter_prob(cm, xd),
mbmi->ref_frame[0] != INTRA_FRAME);
-#if CONFIG_OBMC || CONFIG_WARPED_MOTION
- if (is_inter_block(mbmi) && is_motvar_allowed(mbmi))
- *returnrate_nocoef -= cpi->motvar_cost[bsize][mbmi->motion_variation];
-#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
+#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+ if (is_inter_block(mbmi) && is_motion_variation_allowed(mbmi))
+ *returnrate_nocoef -= cpi->motion_mode_cost[bsize][mbmi->motion_mode];
+#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#endif // CONFIG_SUPERTX
rd_cost->dist = distortion2;
rd_cost->rdcost = this_rd;
@@ -9350,11 +9349,11 @@
if (is_inter_mode(mbmi->mode)) {
av1_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
-#if CONFIG_OBMC
- if (mbmi->motion_variation == OBMC_CAUSAL)
+#if CONFIG_MOTION_VAR
+ if (mbmi->motion_mode == OBMC_CAUSAL)
av1_build_obmc_inter_prediction(cm, xd, mi_row, mi_col, dst_buf1,
dst_stride1, dst_buf2, dst_stride2);
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
av1_subtract_plane(x, bsize, 0);
#if CONFIG_VAR_TX
if (cm->tx_mode == TX_MODE_SELECT || xd->lossless[mbmi->segment_id]) {
@@ -9825,7 +9824,7 @@
mbmi->ext_intra_mode_info.use_ext_intra_mode[1] = 0;
#endif // CONFIG_EXT_INTRA
mbmi->mode = ZEROMV;
- mbmi->motion_variation = SIMPLE_TRANSLATION;
+ mbmi->motion_mode = SIMPLE_TRANSLATION;
mbmi->uv_mode = DC_PRED;
mbmi->ref_frame[0] = LAST_FRAME;
mbmi->ref_frame[1] = NONE;
@@ -9994,7 +9993,7 @@
mbmi->ext_intra_mode_info.use_ext_intra_mode[0] = 0;
mbmi->ext_intra_mode_info.use_ext_intra_mode[1] = 0;
#endif // CONFIG_EXT_INTRA
- mbmi->motion_variation = SIMPLE_TRANSLATION;
+ mbmi->motion_mode = SIMPLE_TRANSLATION;
#if CONFIG_EXT_INTER
mbmi->use_wedge_interinter = 0;
mbmi->use_wedge_interintra = 0;
@@ -10726,7 +10725,7 @@
store_coding_context(x, ctx, best_ref_index, best_pred_diff, 0);
}
-#if CONFIG_OBMC
+#if CONFIG_MOTION_VAR
// This function has a structure similar to av1_build_obmc_inter_prediction
//
// The OBMC predictor is computed as:
@@ -10944,4 +10943,4 @@
#endif // CONFIG_AOM_HIGHBITDEPTH
}
}
-#endif // CONFIG_OBMC
+#endif // CONFIG_MOTION_VAR
diff --git a/configure b/configure
index e671aa5..0e33876 100755
--- a/configure
+++ b/configure
@@ -272,6 +272,7 @@
ext_partition_types
ext_tile
obmc
+ motion_var
warped_motion
entropy
bidir_pred
diff --git a/test/test.mk b/test/test.mk
index 162d7c9..f149fc5 100644
--- a/test/test.mk
+++ b/test/test.mk
@@ -163,7 +163,7 @@
LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += reconintra_predictors_test.cc
endif
-ifeq ($(CONFIG_OBMC),yes)
+ifeq ($(CONFIG_MOTION_VAR),yes)
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += obmc_sad_test.cc
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += obmc_variance_test.cc
endif