Renamings for OBMC experiment

To get ready for pulling AV1 to nextgenv2
Replace the experimental flag by MOTION_VAR. Rename major variables.

Change-Id: If6cf4f37b9319c46d8f90df551cc7295d66ca205
This commit is contained in:
Yue Chen
2016-10-13 15:18:22 -07:00
parent 732c188523
commit cb60b185c7
23 changed files with 257 additions and 251 deletions

View File

@@ -314,10 +314,10 @@ ifeq ($(CONFIG_EXT_INTER),yes)
DSP_SRCS-$(HAVE_SSSE3) += x86/masked_sad_intrin_ssse3.c DSP_SRCS-$(HAVE_SSSE3) += x86/masked_sad_intrin_ssse3.c
DSP_SRCS-$(HAVE_SSSE3) += x86/masked_variance_intrin_ssse3.c DSP_SRCS-$(HAVE_SSSE3) += x86/masked_variance_intrin_ssse3.c
endif #CONFIG_EXT_INTER 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_sad_sse4.c
DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_variance_sse4.c DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_variance_sse4.c
endif #CONFIG_OBMC endif #CONFIG_MOTION_VAR
endif #CONFIG_AV1_ENCODER endif #CONFIG_AV1_ENCODER
DSP_SRCS-$(HAVE_SSE) += x86/sad4d_sse2.asm DSP_SRCS-$(HAVE_SSE) += x86/sad4d_sse2.asm

View File

@@ -1208,7 +1208,7 @@ if (aom_config("CONFIG_EXT_INTER") eq "yes") {
# #
# OBMC SAD # OBMC SAD
# #
if (aom_config("CONFIG_OBMC") eq "yes") { if (aom_config("CONFIG_MOTION_VAR") eq "yes") {
foreach (@block_sizes) { foreach (@block_sizes) {
($w, $h) = @$_; ($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"; 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";
@@ -1540,7 +1540,7 @@ if (aom_config("CONFIG_EXT_INTER") eq "yes") {
# #
# OBMC Variance / OBMC Subpixel Variance # OBMC Variance / OBMC Subpixel Variance
# #
if (aom_config("CONFIG_OBMC") eq "yes") { if (aom_config("CONFIG_MOTION_VAR") eq "yes") {
foreach (@block_sizes) { foreach (@block_sizes) {
($w, $h) = @$_; ($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"; 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";

View File

@@ -410,7 +410,7 @@ HIGHBD_MASKSADMXN(4, 4)
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_EXT_INTER #endif // CONFIG_AV1 && CONFIG_EXT_INTER
#if CONFIG_AV1 && CONFIG_OBMC #if CONFIG_AV1 && CONFIG_MOTION_VAR
// pre: predictor being evaluated // pre: predictor being evaluated
// wsrc: target weighted prediction (has been *4096 to keep precision) // wsrc: target weighted prediction (has been *4096 to keep precision)
// mask: 2d weights (scaled by 4096) // mask: 2d weights (scaled by 4096)
@@ -509,4 +509,4 @@ HIGHBD_OBMCSADMXN(4, 8)
HIGHBD_OBMCSADMXN(4, 4) HIGHBD_OBMCSADMXN(4, 4)
/* clang-format on */ /* clang-format on */
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_OBMC #endif // CONFIG_AV1 && CONFIG_MOTION_VAR

View File

@@ -942,7 +942,7 @@ HIGHBD_MASK_SUBPIX_VAR(128, 128)
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_EXT_INTER #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, static INLINE void obmc_variance(const uint8_t *pre, int pre_stride,
const int32_t *wsrc, const int32_t *mask, const int32_t *wsrc, const int32_t *mask,
int w, int h, unsigned int *sse, int *sum) { int w, int h, unsigned int *sse, int *sum) {
@@ -1216,4 +1216,4 @@ HIGHBD_OBMC_VAR(128, 128)
HIGHBD_OBMC_SUBPIX_VAR(128, 128) HIGHBD_OBMC_SUBPIX_VAR(128, 128)
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_OBMC #endif // CONFIG_AV1 && CONFIG_MOTION_VAR

View File

@@ -68,7 +68,7 @@ typedef unsigned int (*aom_masked_subpixvariance_fn_t)(
unsigned int *sse); unsigned int *sse);
#endif // CONFIG_AV1 && CONFIG_EXT_INTER #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, typedef unsigned int (*aom_obmc_sad_fn_t)(const uint8_t *pred, int pred_stride,
const int32_t *wsrc, const int32_t *wsrc,
const int32_t *msk); const int32_t *msk);
@@ -80,7 +80,7 @@ typedef unsigned int (*aom_obmc_variance_fn_t)(const uint8_t *pred,
typedef unsigned int (*aom_obmc_subpixvariance_fn_t)( typedef unsigned int (*aom_obmc_subpixvariance_fn_t)(
const uint8_t *pred, int pred_stride, int xoffset, int yoffset, const uint8_t *pred, int pred_stride, int xoffset, int yoffset,
const int32_t *wsrc, const int32_t *msk, unsigned int *sse); 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 #if CONFIG_AV1
typedef struct aom_variance_vtable { typedef struct aom_variance_vtable {
@@ -97,11 +97,11 @@ typedef struct aom_variance_vtable {
aom_masked_variance_fn_t mvf; aom_masked_variance_fn_t mvf;
aom_masked_subpixvariance_fn_t msvf; aom_masked_subpixvariance_fn_t msvf;
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
aom_obmc_sad_fn_t osdf; aom_obmc_sad_fn_t osdf;
aom_obmc_variance_fn_t ovf; aom_obmc_variance_fn_t ovf;
aom_obmc_subpixvariance_fn_t osvf; aom_obmc_subpixvariance_fn_t osvf;
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
} aom_variance_fn_ptr_t; } aom_variance_fn_ptr_t;
#endif // CONFIG_AV1 #endif // CONFIG_AV1

View File

@@ -227,7 +227,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; MOTION_MODE motion_mode;
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
@@ -772,21 +772,26 @@ static INLINE int is_interintra_pred(const MB_MODE_INFO *mbmi) {
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static INLINE int is_motvar_allowed(const MB_MODE_INFO *mbmi) { 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 #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 #else
return (mbmi->sb_type >= BLOCK_8X8); return is_motion_variation_allowed_bsize(mbmi->sb_type);
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
} }
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
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_MOTION_VAR
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"

View File

@@ -315,43 +315,45 @@ static const aom_prob default_wedge_interinter_prob[BLOCK_SIZES] = {
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
// Change this section appropriately once warped motion is supported // Change this section appropriately once warped motion is supported
#if CONFIG_OBMC && !CONFIG_WARPED_MOTION #if 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, -OBMC_CAUSAL -SIMPLE_TRANSLATION, -OBMC_CAUSAL
}; };
static const aom_prob default_motvar_prob[BLOCK_SIZES] static const aom_prob default_motion_mode_prob[BLOCK_SIZES]
[MOTION_VARIATIONS - 1] = { [MOTION_MODES - 1] = {
{ 255 }, { 255 }, { 255 }, { 151 }, { 255 }, { 255 }, { 255 },
{ 153 }, { 144 }, { 178 }, { 165 }, { 151 }, { 153 }, { 144 },
{ 160 }, { 207 }, { 195 }, { 168 }, { 178 }, { 165 }, { 160 },
{ 244 }, { 207 }, { 195 }, { 168 },
{ 244 },
#if CONFIG_EXT_PARTITION #if CONFIG_EXT_PARTITION
{ 252 }, { 252 }, { 252 }, { 252 }, { 252 }, { 252 },
#endif // CONFIG_EXT_PARTITION #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 -SIMPLE_TRANSLATION, -WARPED_CAUSAL
}; };
static const aom_prob default_motvar_prob[BLOCK_SIZES] static const aom_prob default_motion_mode_prob[BLOCK_SIZES]
[MOTION_VARIATIONS - 1] = { [MOTION_MODES - 1] = {
{ 255 }, { 255 }, { 255 }, { 151 }, { 255 }, { 255 }, { 255 },
{ 153 }, { 144 }, { 178 }, { 165 }, { 151 }, { 153 }, { 144 },
{ 160 }, { 207 }, { 195 }, { 168 }, { 178 }, { 165 }, { 160 },
{ 244 }, { 207 }, { 195 }, { 168 },
{ 244 },
#if CONFIG_EXT_PARTITION #if CONFIG_EXT_PARTITION
{ 252 }, { 252 }, { 252 }, { 252 }, { 252 }, { 252 },
#endif // CONFIG_EXT_PARTITION #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, -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 }, { 255, 200 }, { 255, 200 }, { 255, 200 }, { 151, 200 }, { 153, 200 },
{ 144, 200 }, { 178, 200 }, { 165, 200 }, { 160, 200 }, { 207, 200 }, { 144, 200 }, { 178, 200 }, { 165, 200 }, { 160, 200 }, { 207, 200 },
@@ -360,7 +362,7 @@ static const aom_prob default_motvar_prob[BLOCK_SIZES][MOTION_VARIATIONS - 1] =
{ 252, 200 }, { 252, 200 }, { 252, 200 }, { 252, 200 }, { 252, 200 }, { 252, 200 },
#endif // CONFIG_EXT_PARTITION #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. */ /* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */
const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = { const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
@@ -1350,9 +1352,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
av1_copy(fc->inter_mode_probs, default_inter_mode_probs); av1_copy(fc->inter_mode_probs, default_inter_mode_probs);
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
av1_copy(fc->motvar_prob, default_motvar_prob); av1_copy(fc->motion_mode_prob, default_motion_mode_prob);
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
av1_copy(fc->inter_compound_mode_probs, default_inter_compound_mode_probs); av1_copy(fc->inter_compound_mode_probs, default_inter_compound_mode_probs);
av1_copy(fc->interintra_prob, default_interintra_prob); av1_copy(fc->interintra_prob, default_interintra_prob);
@@ -1451,11 +1453,11 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
counts->inter_mode[i], fc->inter_mode_probs[i]); counts->inter_mode[i], fc->inter_mode_probs[i]);
#endif #endif
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i) for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i)
aom_tree_merge_probs(av1_motvar_tree, pre_fc->motvar_prob[i], aom_tree_merge_probs(av1_motion_mode_tree, pre_fc->motion_mode_prob[i],
counts->motvar[i], fc->motvar_prob[i]); counts->motion_mode[i], fc->motion_mode_prob[i]);
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || 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) {

View File

@@ -80,9 +80,9 @@ typedef struct frame_contexts {
aom_prob wedge_interintra_prob[BLOCK_SIZES]; aom_prob wedge_interintra_prob[BLOCK_SIZES];
aom_prob wedge_interinter_prob[BLOCK_SIZES]; aom_prob wedge_interinter_prob[BLOCK_SIZES];
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
aom_prob motvar_prob[BLOCK_SIZES][MOTION_VARIATIONS - 1]; aom_prob motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1];
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
aom_prob intra_inter_prob[INTRA_INTER_CONTEXTS]; aom_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
aom_prob comp_inter_prob[COMP_INTER_CONTEXTS]; aom_prob comp_inter_prob[COMP_INTER_CONTEXTS];
aom_prob single_ref_prob[REF_CONTEXTS][SINGLE_REFS - 1]; aom_prob single_ref_prob[REF_CONTEXTS][SINGLE_REFS - 1];
@@ -165,9 +165,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 || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
unsigned int motvar[BLOCK_SIZES][MOTION_VARIATIONS]; unsigned int motion_mode[BLOCK_SIZES][MOTION_MODES];
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || 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];
@@ -262,9 +262,9 @@ extern const aom_tree_index av1_ext_tx_intra_tree[EXT_TX_SETS_INTRA]
#else #else
extern const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)]; extern const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)];
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
extern const aom_tree_index av1_motvar_tree[TREE_SIZE(MOTION_VARIATIONS)]; extern const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)];
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_LOOP_RESTORATION #if CONFIG_LOOP_RESTORATION
#define RESTORE_NONE_BILATERAL_PROB 16 #define RESTORE_NONE_BILATERAL_PROB 16

View File

@@ -280,14 +280,14 @@ typedef enum ATTRIBUTE_PACKED {
typedef enum { typedef enum {
SIMPLE_TRANSLATION = 0, SIMPLE_TRANSLATION = 0,
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
OBMC_CAUSAL, // 2-sided OBMC OBMC_CAUSAL, // 2-sided OBMC
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#if CONFIG_WARPED_MOTION #if CONFIG_WARPED_MOTION
WARPED_CAUSAL, // 2-sided WARPED WARPED_CAUSAL, // 2-sided WARPED
#endif // CONFIG_WARPED_MOTION #endif // CONFIG_WARPED_MOTION
MOTION_VARIATIONS MOTION_MODES
} MOTION_VARIATION; } MOTION_MODE;
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
typedef enum { typedef enum {

View File

@@ -21,9 +21,9 @@
#include "av1/common/blockd.h" #include "av1/common/blockd.h"
#include "av1/common/reconinter.h" #include "av1/common/reconinter.h"
#include "av1/common/reconintra.h" #include "av1/common/reconintra.h"
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
#include "av1/common/onyxc_int.h" #include "av1/common/onyxc_int.h"
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
#include "av1/common/warped_motion.h" #include "av1/common/warped_motion.h"
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
@@ -534,9 +534,9 @@ void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst,
} }
void build_inter_predictors(MACROBLOCKD *xd, int plane, void build_inter_predictors(MACROBLOCKD *xd, int plane,
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
int mi_col_offset, int mi_row_offset, 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 block, int bw, int bh, int x, int y, int w,
int h, int h,
#if CONFIG_SUPERTX && CONFIG_EXT_INTER #if CONFIG_SUPERTX && CONFIG_EXT_INTER
@@ -544,11 +544,11 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane,
#endif // CONFIG_SUPERTX && CONFIG_EXT_INTER #endif // CONFIG_SUPERTX && CONFIG_EXT_INTER
int mi_x, int mi_y) { int mi_x, int mi_y) {
struct macroblockd_plane *const pd = &xd->plane[plane]; 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]; const MODE_INFO *mi = xd->mi[mi_col_offset + xd->mi_stride * mi_row_offset];
#else #else
const MODE_INFO *mi = xd->mi[0]; const MODE_INFO *mi = xd->mi[0];
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
const int is_compound = has_second_ref(&mi->mbmi); const int is_compound = has_second_ref(&mi->mbmi);
int ref; int ref;
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
@@ -782,9 +782,9 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize,
for (y = 0; y < num_4x4_h; ++y) for (y = 0; y < num_4x4_h; ++y)
for (x = 0; x < num_4x4_w; ++x) for (x = 0; x < num_4x4_w; ++x)
build_inter_predictors(xd, plane, build_inter_predictors(xd, plane,
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
0, 0, 0, 0,
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
y * 2 + x, bw, bh, 4 * x, 4 * y, pw, ph, y * 2 + x, bw, bh, 4 * x, 4 * y, pw, ph,
#if CONFIG_SUPERTX && CONFIG_EXT_INTER #if CONFIG_SUPERTX && CONFIG_EXT_INTER
0, 0, 0, 0,
@@ -792,9 +792,9 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize,
mi_x, mi_y); mi_x, mi_y);
} else { } else {
build_inter_predictors(xd, plane, build_inter_predictors(xd, plane,
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
0, 0, 0, 0,
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
0, bw, bh, 0, 0, bw, bh, 0, bw, bh, 0, 0, bw, bh,
#if CONFIG_SUPERTX && CONFIG_EXT_INTER #if CONFIG_SUPERTX && CONFIG_EXT_INTER
0, 0, 0, 0,
@@ -1056,9 +1056,9 @@ void av1_build_inter_predictors_sb_sub8x8_extend(MACROBLOCKD *xd,
const int bh = 4 * num_4x4_h; const int bh = 4 * num_4x4_h;
build_inter_predictors(xd, plane, build_inter_predictors(xd, plane,
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
0, 0, 0, 0,
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
block, bw, bh, 0, 0, bw, bh, block, bw, bh, 0, 0, bw, bh,
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
wedge_offset_x, wedge_offset_y, wedge_offset_x, wedge_offset_y,
@@ -1101,9 +1101,9 @@ void av1_build_inter_predictors_sb_extend(MACROBLOCKD *xd,
for (y = 0; y < num_4x4_h; ++y) for (y = 0; y < num_4x4_h; ++y)
for (x = 0; x < num_4x4_w; ++x) for (x = 0; x < num_4x4_w; ++x)
build_inter_predictors(xd, plane, build_inter_predictors(xd, plane,
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
0, 0, 0, 0,
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
y * 2 + x, bw, bh, 4 * x, 4 * y, 4, 4, y * 2 + x, bw, bh, 4 * x, 4 * y, 4, 4,
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
wedge_offset_x, wedge_offset_y, wedge_offset_x, wedge_offset_y,
@@ -1111,9 +1111,9 @@ void av1_build_inter_predictors_sb_extend(MACROBLOCKD *xd,
mi_x, mi_y); mi_x, mi_y);
} else { } else {
build_inter_predictors(xd, plane, build_inter_predictors(xd, plane,
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
0, 0, 0, 0,
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
0, bw, bh, 0, 0, bw, bh, 0, bw, bh, 0, 0, bw, bh,
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
wedge_offset_x, wedge_offset_y, wedge_offset_x, wedge_offset_y,
@@ -1124,7 +1124,7 @@ void av1_build_inter_predictors_sb_extend(MACROBLOCKD *xd,
} }
#endif // CONFIG_SUPERTX #endif // CONFIG_SUPERTX
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
// obmc_mask_N[overlap_position] // obmc_mask_N[overlap_position]
static const uint8_t obmc_mask_1[1] = { 55 }; static const uint8_t obmc_mask_1[1] = { 55 };
@@ -1474,7 +1474,7 @@ void av1_build_prediction_by_left_preds(AV1_COMMON *cm, MACROBLOCKD *xd,
} }
xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8); xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8);
} }
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
#if CONFIG_EXT_PARTITION #if CONFIG_EXT_PARTITION

View File

@@ -214,9 +214,9 @@ static INLINE int get_interintra_wedge_bits(BLOCK_SIZE sb_type) {
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
void build_inter_predictors(MACROBLOCKD *xd, int plane, void build_inter_predictors(MACROBLOCKD *xd, int plane,
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
int mi_col_offset, int mi_row_offset, 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 block, int bw, int bh, int x, int y, int w,
int h, int h,
#if CONFIG_SUPERTX && CONFIG_EXT_INTER #if CONFIG_SUPERTX && CONFIG_EXT_INTER
@@ -515,7 +515,7 @@ static INLINE int av1_is_interp_needed(const MACROBLOCKD *const xd) {
} }
#endif // CONFIG_EXT_INTERP #endif // CONFIG_EXT_INTERP
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
const uint8_t *av1_get_obmc_mask(int length); const uint8_t *av1_get_obmc_mask(int length);
void av1_build_obmc_inter_prediction(AV1_COMMON *cm, MACROBLOCKD *xd, void av1_build_obmc_inter_prediction(AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col, int mi_row, int mi_col,
@@ -535,7 +535,7 @@ void av1_build_prediction_by_left_preds(AV1_COMMON *cm, MACROBLOCKD *xd,
int tmp_width[MAX_MB_PLANE], int tmp_width[MAX_MB_PLANE],
int tmp_height[MAX_MB_PLANE], int tmp_height[MAX_MB_PLANE],
int tmp_stride[MAX_MB_PLANE]); int tmp_stride[MAX_MB_PLANE]);
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
#define MASK_MASTER_SIZE (2 * MAX_SB_SIZE) #define MASK_MASTER_SIZE (2 * MAX_SB_SIZE)

View File

@@ -1238,8 +1238,8 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd,
} else { } else {
// Prediction // Prediction
av1_build_inter_predictors_sb(xd, mi_row, mi_col, AOMMAX(bsize, BLOCK_8X8)); av1_build_inter_predictors_sb(xd, mi_row, mi_col, AOMMAX(bsize, BLOCK_8X8));
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
if (mbmi->motion_variation == OBMC_CAUSAL) { if (mbmi->motion_mode == OBMC_CAUSAL) {
#if CONFIG_AOM_HIGHBITDEPTH #if CONFIG_AOM_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]);
@@ -1284,7 +1284,7 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd,
av1_build_obmc_inter_prediction(cm, xd, mi_row, mi_col, dst_buf1, av1_build_obmc_inter_prediction(cm, xd, mi_row, mi_col, dst_buf1,
dst_stride1, dst_buf2, dst_stride2); dst_stride1, dst_buf2, dst_stride2);
} }
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
// Reconstruction // Reconstruction
if (!mbmi->skip) { if (!mbmi->skip) {
@@ -3649,12 +3649,12 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
} }
#endif // CONFIG_EXT_INTER #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 (i = BLOCK_8X8; i < BLOCK_SIZES; ++i) {
for (j = 0; j < MOTION_VARIATIONS - 1; ++j) for (j = 0; j < MOTION_MODES - 1; ++j)
av1_diff_update_prob(&r, &fc->motvar_prob[i][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); if (cm->interp_filter == SWITCHABLE) read_switchable_interp_probs(fc, &r);
@@ -3722,10 +3722,10 @@ static void debug_check_frame_counts(const AV1_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 || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
assert(!memcmp(cm->counts.motvar, zero_counts.motvar, assert(!memcmp(cm->counts.motion_mode, zero_counts.motion_mode,
sizeof(cm->counts.motvar))); sizeof(cm->counts.motion_mode)));
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || 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,

View File

@@ -819,24 +819,22 @@ static void read_ref_frames(AV1_COMMON *const cm, MACROBLOCKD *const xd,
} }
} }
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static MOTION_VARIATION read_motvar_block(AV1_COMMON *const cm, static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
MACROBLOCKD *const xd, MB_MODE_INFO *mbmi, aom_reader *r) {
aom_reader *r) { if (is_motion_variation_allowed(mbmi)) {
BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type; int motion_mode;
FRAME_COUNTS *counts = xd->counts; FRAME_COUNTS *counts = xd->counts;
MOTION_VARIATION motvar;
if (is_motvar_allowed(&xd->mi[0]->mbmi)) { motion_mode = aom_read_tree(r, av1_motion_mode_tree,
motvar = (MOTION_VARIATION)aom_read_tree(r, av1_motvar_tree, cm->fc->motion_mode_prob[mbmi->sb_type]);
cm->fc->motvar_prob[bsize]); if (counts) ++counts->motion_mode[mbmi->sb_type][motion_mode];
if (counts) ++counts->motvar[bsize][motvar]; return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
return motvar;
} else { } else {
return SIMPLE_TRANSLATION; 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, static INLINE InterpFilter read_interp_filter(AV1_COMMON *const cm,
MACROBLOCKD *const xd, MACROBLOCKD *const xd,
@@ -1166,12 +1164,12 @@ static void fpm_sync(void *const data, int mi_row) {
static void read_inter_block_mode_info(AV1Decoder *const pbi, static void read_inter_block_mode_info(AV1Decoder *const pbi,
MACROBLOCKD *const xd, MACROBLOCKD *const xd,
MODE_INFO *const mi, 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 mi_row, int mi_col, aom_reader *r,
int supertx_enabled) { int supertx_enabled) {
#else #else
int mi_row, int mi_col, aom_reader *r) { 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; AV1_COMMON *const cm = &pbi->common;
MB_MODE_INFO *const mbmi = &mi->mbmi; MB_MODE_INFO *const mbmi = &mi->mbmi;
const BLOCK_SIZE bsize = mbmi->sb_type; const BLOCK_SIZE bsize = mbmi->sb_type;
@@ -1538,25 +1536,25 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
mbmi->motion_variation = SIMPLE_TRANSLATION; mbmi->motion_mode = 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->motion_variation = read_motvar_block(cm, xd, r); mbmi->motion_mode = read_motion_mode(cm, xd, mbmi, r);
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || 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 || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
!(is_motvar_allowed(mbmi) && !(is_motion_variation_allowed(mbmi) &&
mbmi->motion_variation != SIMPLE_TRANSLATION) && mbmi->motion_mode != SIMPLE_TRANSLATION) &&
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
is_interinter_wedge_used(bsize)) { is_interinter_wedge_used(bsize)) {
mbmi->use_wedge_interinter = mbmi->use_wedge_interinter =
aom_read(r, cm->fc->wedge_interinter_prob[bsize]); aom_read(r, cm->fc->wedge_interinter_prob[bsize]);
@@ -1698,12 +1696,12 @@ static void read_inter_frame_mode_info(AV1Decoder *const pbi,
if (inter_block) if (inter_block)
read_inter_block_mode_info(pbi, xd, 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); mi, mi_row, mi_col, r, supertx_enabled);
#else #else
mi, mi_row, mi_col, r); mi, mi_row, mi_col, r);
#endif // CONFIG_OBMC && CONFIG_SUPERTX #endif // CONFIG_MOTION_VAR && CONFIG_SUPERTX
else else
read_intra_block_mode_info(cm, xd, mi, r); read_intra_block_mode_info(cm, xd, mi, r);

View File

@@ -149,9 +149,9 @@ static struct av1_token intra_filter_encodings[INTRA_FILTERS];
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
static struct av1_token interintra_mode_encodings[INTERINTRA_MODES]; static struct av1_token interintra_mode_encodings[INTERINTRA_MODES];
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static struct av1_token motvar_encodings[MOTION_VARIATIONS]; static struct av1_token motion_mode_encodings[MOTION_MODES];
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_LOOP_RESTORATION #if CONFIG_LOOP_RESTORATION
static struct av1_token switchable_restore_encodings[RESTORE_SWITCHABLE_TYPES]; static struct av1_token switchable_restore_encodings[RESTORE_SWITCHABLE_TYPES];
#endif // CONFIG_LOOP_RESTORATION #endif // CONFIG_LOOP_RESTORATION
@@ -174,9 +174,9 @@ void av1_encode_token_init(void) {
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
av1_tokens_from_tree(interintra_mode_encodings, av1_interintra_mode_tree); av1_tokens_from_tree(interintra_mode_encodings, av1_interintra_mode_tree);
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
av1_tokens_from_tree(motvar_encodings, av1_motvar_tree); av1_tokens_from_tree(motion_mode_encodings, av1_motion_mode_tree);
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
av1_tokens_from_tree(global_motion_types_encodings, av1_tokens_from_tree(global_motion_types_encodings,
av1_global_motion_types_tree); av1_global_motion_types_tree);
@@ -1401,30 +1401,31 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi,
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || 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_motvar_allowed(mbmi)) { if (is_motion_variation_allowed(mbmi)) {
// TODO(debargha): Might want to only emit this if SEG_LVL_SKIP // TODO(debargha): Might want to only emit this if SEG_LVL_SKIP
// is not active, and assume SIMPLE_TRANSLATION in the decoder if // is not active, and assume SIMPLE_TRANSLATION in the decoder if
// it is active. // it is active.
assert(mbmi->motion_variation < MOTION_VARIATIONS); assert(mbmi->motion_mode < MOTION_MODES);
av1_write_token(w, av1_motvar_tree, cm->fc->motvar_prob[bsize], av1_write_token(w, av1_motion_mode_tree,
&motvar_encodings[mbmi->motion_variation]); 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 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_MOTION_VAR
!(is_motvar_allowed(mbmi) && !(is_motion_variation_allowed(mbmi) &&
mbmi->motion_variation != SIMPLE_TRANSLATION) && mbmi->motion_mode != SIMPLE_TRANSLATION) &&
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
is_interinter_wedge_used(bsize)) { is_interinter_wedge_used(bsize)) {
aom_write(w, mbmi->use_wedge_interinter, aom_write(w, mbmi->use_wedge_interinter,
cm->fc->wedge_interinter_prob[bsize]); cm->fc->wedge_interinter_prob[bsize]);
@@ -3474,11 +3475,11 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
} }
#endif // CONFIG_EXT_INTER #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 (i = BLOCK_8X8; i < BLOCK_SIZES; ++i)
prob_diff_update(av1_motvar_tree, fc->motvar_prob[i], counts->motvar[i], prob_diff_update(av1_motion_mode_tree, fc->motion_mode_prob[i],
MOTION_VARIATIONS, header_bc); counts->motion_mode[i], MOTION_MODES, header_bc);
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || 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);

View File

@@ -1301,7 +1301,7 @@ static void update_state_supertx(AV1_COMP *cpi, ThreadData *td,
} }
#endif // CONFIG_VAR_TX #endif // CONFIG_VAR_TX
// Turn motion variation off for supertx // Turn motion variation off for supertx
mbmi->motion_variation = SIMPLE_TRANSLATION; mbmi->motion_mode = SIMPLE_TRANSLATION;
if (!output_enabled) return; if (!output_enabled) return;
@@ -1886,24 +1886,24 @@ static void update_stats(AV1_COMMON *cm, ThreadData *td
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || 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_motvar_allowed(mbmi)) if (is_motion_variation_allowed(mbmi))
counts->motvar[mbmi->sb_type][mbmi->motion_variation]++; counts->motion_mode[mbmi->sb_type][mbmi->motion_mode]++;
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || 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 || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
!(is_motvar_allowed(mbmi) && !(is_motion_variation_allowed(mbmi) &&
mbmi->motion_variation != SIMPLE_TRANSLATION) && mbmi->motion_mode != SIMPLE_TRANSLATION) &&
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || 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]++;
} }
@@ -5063,8 +5063,8 @@ static void encode_superblock(AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
av1_build_inter_predictors_sbuv(xd, mi_row, mi_col, av1_build_inter_predictors_sbuv(xd, mi_row, mi_col,
AOMMAX(bsize, BLOCK_8X8)); AOMMAX(bsize, BLOCK_8X8));
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
if (mbmi->motion_variation == OBMC_CAUSAL) { if (mbmi->motion_mode == OBMC_CAUSAL) {
#if CONFIG_AOM_HIGHBITDEPTH #if CONFIG_AOM_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]);
@@ -5110,7 +5110,7 @@ static void encode_superblock(AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
av1_build_obmc_inter_prediction(cm, xd, mi_row, mi_col, dst_buf1, av1_build_obmc_inter_prediction(cm, xd, mi_row, mi_col, dst_buf1,
dst_stride1, dst_buf2, dst_stride2); dst_stride1, dst_buf2, dst_stride2);
} }
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
av1_encode_sb(x, AOMMAX(bsize, BLOCK_8X8)); av1_encode_sb(x, AOMMAX(bsize, BLOCK_8X8));
#if CONFIG_VAR_TX #if CONFIG_VAR_TX

View File

@@ -1181,7 +1181,7 @@ MAKE_MBFP_SAD_WRAPPER(aom_highbd_masked_sad4x8)
MAKE_MBFP_SAD_WRAPPER(aom_highbd_masked_sad4x4) MAKE_MBFP_SAD_WRAPPER(aom_highbd_masked_sad4x4)
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
#define HIGHBD_OBFP(BT, OSDF, OVF, OSVF) \ #define HIGHBD_OBFP(BT, OSDF, OVF, OSVF) \
cpi->fn_ptr[BT].osdf = OSDF; \ cpi->fn_ptr[BT].osdf = OSDF; \
cpi->fn_ptr[BT].ovf = OVF; \ cpi->fn_ptr[BT].ovf = OVF; \
@@ -1222,7 +1222,7 @@ MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad8x8)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad8x4) MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad8x4)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad4x8) MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad4x8)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad4x4) 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) { static void highbd_set_var_fns(AV1_COMP *const cpi) {
AV1_COMMON *const cm = &cpi->common; AV1_COMMON *const cm = &cpi->common;
@@ -1384,7 +1384,7 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) {
aom_highbd_masked_variance4x4, aom_highbd_masked_variance4x4,
aom_highbd_masked_sub_pixel_variance4x4) aom_highbd_masked_sub_pixel_variance4x4)
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
#if CONFIG_EXT_PARTITION #if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits8, HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits8,
aom_highbd_obmc_variance128x128, aom_highbd_obmc_variance128x128,
@@ -1435,7 +1435,7 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) {
HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits8, HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits8,
aom_highbd_obmc_variance4x4, aom_highbd_obmc_variance4x4,
aom_highbd_obmc_sub_pixel_variance4x4) aom_highbd_obmc_sub_pixel_variance4x4)
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
break; break;
case AOM_BITS_10: case AOM_BITS_10:
@@ -1598,7 +1598,7 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) {
aom_highbd_10_masked_variance4x4, aom_highbd_10_masked_variance4x4,
aom_highbd_10_masked_sub_pixel_variance4x4) aom_highbd_10_masked_sub_pixel_variance4x4)
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
#if CONFIG_EXT_PARTITION #if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits10, HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits10,
aom_highbd_10_obmc_variance128x128, aom_highbd_10_obmc_variance128x128,
@@ -1649,7 +1649,7 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) {
HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits10, HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits10,
aom_highbd_10_obmc_variance4x4, aom_highbd_10_obmc_variance4x4,
aom_highbd_10_obmc_sub_pixel_variance4x4) aom_highbd_10_obmc_sub_pixel_variance4x4)
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
break; break;
case AOM_BITS_12: case AOM_BITS_12:
@@ -1813,7 +1813,7 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) {
aom_highbd_12_masked_sub_pixel_variance4x4) aom_highbd_12_masked_sub_pixel_variance4x4)
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
#if CONFIG_EXT_PARTITION #if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits12, HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits12,
aom_highbd_12_obmc_variance128x128, aom_highbd_12_obmc_variance128x128,
@@ -1864,7 +1864,7 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) {
HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits12, HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits12,
aom_highbd_12_obmc_variance4x4, aom_highbd_12_obmc_variance4x4,
aom_highbd_12_obmc_sub_pixel_variance4x4) aom_highbd_12_obmc_sub_pixel_variance4x4)
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
break; break;
default: default:
@@ -2356,7 +2356,7 @@ AV1_COMP *av1_create_compressor(AV1EncoderConfig *oxcf,
aom_sub_pixel_variance4x4, aom_sub_pixel_avg_variance4x4, aom_sad4x4x3, aom_sub_pixel_variance4x4, aom_sub_pixel_avg_variance4x4, aom_sad4x4x3,
aom_sad4x4x8, aom_sad4x4x4d) aom_sad4x4x8, aom_sad4x4x4d)
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
#define OBFP(BT, OSDF, OVF, OSVF) \ #define OBFP(BT, OSDF, OVF, OSVF) \
cpi->fn_ptr[BT].osdf = OSDF; \ cpi->fn_ptr[BT].osdf = OSDF; \
cpi->fn_ptr[BT].ovf = OVF; \ cpi->fn_ptr[BT].ovf = OVF; \
@@ -2396,7 +2396,7 @@ AV1_COMP *av1_create_compressor(AV1EncoderConfig *oxcf,
aom_obmc_sub_pixel_variance8x4) aom_obmc_sub_pixel_variance8x4)
OBFP(BLOCK_4X4, aom_obmc_sad4x4, aom_obmc_variance4x4, OBFP(BLOCK_4X4, aom_obmc_sad4x4, aom_obmc_variance4x4,
aom_obmc_sub_pixel_variance4x4) aom_obmc_sub_pixel_variance4x4)
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
#define MBFP(BT, MSDF, MVF, MSVF) \ #define MBFP(BT, MSDF, MVF, MSVF) \

View File

@@ -543,9 +543,9 @@ typedef struct AV1_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 || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
int motvar_cost[BLOCK_SIZES][MOTION_VARIATIONS]; int motion_mode_cost[BLOCK_SIZES][MOTION_MODES];
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || 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];

View File

@@ -2930,7 +2930,7 @@ int av1_masked_full_pixel_diamond(const AV1_COMP *cpi, MACROBLOCK *x,
} }
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
/* returns subpixel variance error function */ /* returns subpixel variance error function */
#define DIST(r, c) \ #define DIST(r, c) \
vfp->osvf(pre(y, y_stride, r, c), y_stride, sp(c), sp(r), z, mask, &sse) vfp->osvf(pre(y, y_stride, r, c), y_stride, sp(c), sp(r), z, mask, &sse)
@@ -3414,4 +3414,4 @@ int av1_obmc_full_pixel_diamond(const AV1_COMP *cpi, MACROBLOCK *x,
} }
return bestsme; return bestsme;
} }
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR

View File

@@ -140,7 +140,7 @@ int av1_masked_full_pixel_diamond(const struct AV1_COMP *cpi, MACROBLOCK *x,
const MV *ref_mv, MV *dst_mv, int is_second); const MV *ref_mv, MV *dst_mv, int is_second);
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
int av1_obmc_full_pixel_diamond(const struct AV1_COMP *cpi, MACROBLOCK *x, int av1_obmc_full_pixel_diamond(const struct AV1_COMP *cpi, MACROBLOCK *x,
const int32_t *wsrc, const int32_t *mask, const int32_t *wsrc, const int32_t *mask,
MV *mvp_full, int step_param, int sadpb, MV *mvp_full, int step_param, int sadpb,
@@ -153,7 +153,7 @@ int av1_find_best_obmc_sub_pixel_tree_up(
int allow_hp, int error_per_bit, const aom_variance_fn_ptr_t *vfp, 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 forced_stop, int iters_per_step, int *mvjcost, int *mvcost[2],
int *distortion, unsigned int *sse1, int is_second, int use_upsampled_ref); int *distortion, unsigned int *sse1, int is_second, int use_upsampled_ref);
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif

View File

@@ -450,12 +450,12 @@ void av1_initialize_rd_consts(AV1_COMP *cpi) {
cm->fc->interintra_mode_prob[i], cm->fc->interintra_mode_prob[i],
av1_interintra_mode_tree); av1_interintra_mode_tree);
#endif // CONFIG_EXT_INTER #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 (i = BLOCK_8X8; i < BLOCK_SIZES; i++) {
av1_cost_tokens((int *)cpi->motvar_cost[i], cm->fc->motvar_prob[i], av1_cost_tokens((int *)cpi->motion_mode_cost[i],
av1_motvar_tree); cm->fc->motion_mode_prob[i], av1_motion_mode_tree);
} }
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
} }
} }
} }

View File

@@ -5987,7 +5987,7 @@ static INLINE void restore_dst_buf(MACROBLOCKD *xd,
} }
} }
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
static void single_motion_search_obmc(AV1_COMP *cpi, MACROBLOCK *x, static void single_motion_search_obmc(AV1_COMP *cpi, MACROBLOCK *x,
BLOCK_SIZE bsize, int mi_row, int mi_col, BLOCK_SIZE bsize, int mi_row, int mi_col,
const int32_t *wsrc, const int32_t *mask, const int32_t *wsrc, const int32_t *mask,
@@ -6117,7 +6117,7 @@ static void single_motion_search_obmc(AV1_COMP *cpi, MACROBLOCK *x,
xd->plane[i].pre[ref_idx] = backup_yv12[i]; xd->plane[i].pre[ref_idx] = backup_yv12[i];
} }
} }
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
static void do_masked_motion_search(AV1_COMP *cpi, MACROBLOCK *x, static void do_masked_motion_search(AV1_COMP *cpi, MACROBLOCK *x,
@@ -6655,10 +6655,10 @@ static int64_t handle_inter_mode(
int64_t *distortion, int *skippable, int *rate_y, int *rate_uv, 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 *disable_skip, int_mv (*mode_mv)[TOTAL_REFS_PER_FRAME], int mi_row,
int mi_col, int mi_col,
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
uint8_t *dst_buf1[3], int dst_stride1[3], uint8_t *dst_buf2[3], 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, 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 #if CONFIG_EXT_INTER
int_mv single_newmvs[2][TOTAL_REFS_PER_FRAME], int_mv single_newmvs[2][TOTAL_REFS_PER_FRAME],
int single_newmvs_rate[2][TOTAL_REFS_PER_FRAME], int single_newmvs_rate[2][TOTAL_REFS_PER_FRAME],
@@ -6700,12 +6700,12 @@ static int64_t handle_inter_mode(
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
uint8_t *tmp_buf; uint8_t *tmp_buf;
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
int allow_motvar = int allow_motvar =
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
!is_comp_interintra_pred && !is_comp_interintra_pred &&
#endif // CONFIG_EXT_INTER #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, int rate2_nocoeff = 0, best_rate2 = INT_MAX, best_skippable, best_xskip,
best_disable_skip = 0; best_disable_skip = 0;
int best_rate_y, best_rate_uv; int best_rate_y, best_rate_uv;
@@ -6719,7 +6719,7 @@ static int64_t handle_inter_mode(
int rate_mv_bmc; int rate_mv_bmc;
MB_MODE_INFO best_bmc_mbmi; MB_MODE_INFO best_bmc_mbmi;
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
int pred_exists = 0; int pred_exists = 0;
int intpel_mv; int intpel_mv;
@@ -7156,12 +7156,12 @@ static int64_t handle_inter_mode(
rs = cm->interp_filter == SWITCHABLE ? av1_get_switchable_rate(cpi, xd) : 0; rs = cm->interp_filter == SWITCHABLE ? av1_get_switchable_rate(cpi, xd) : 0;
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
best_bmc_mbmi = *mbmi; best_bmc_mbmi = *mbmi;
rate_mv_bmc = rate_mv; rate_mv_bmc = rate_mv;
rate2_bmc_nocoeff = *rate2; rate2_bmc_nocoeff = *rate2;
if (cm->interp_filter == SWITCHABLE) rate2_bmc_nocoeff += rs; 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)) { if (is_comp_pred && is_interinter_wedge_used(bsize)) {
int rate_sum, rs; int rate_sum, rs;
@@ -7511,20 +7511,19 @@ static int64_t handle_inter_mode(
} }
if (cm->interp_filter == SWITCHABLE) *rate2 += rs; if (cm->interp_filter == SWITCHABLE) *rate2 += rs;
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
rate2_nocoeff = *rate2; 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; best_rd = INT64_MAX;
for (mbmi->motion_variation = SIMPLE_TRANSLATION; for (mbmi->motion_mode = SIMPLE_TRANSLATION;
mbmi->motion_variation < (allow_motvar ? MOTION_VARIATIONS : 1); mbmi->motion_mode < (allow_motvar ? MOTION_MODES : 1);
mbmi->motion_variation++) { mbmi->motion_mode++) {
int64_t tmp_rd; int64_t tmp_rd;
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
int tmp_rate2 = mbmi->motion_variation != SIMPLE_TRANSLATION int tmp_rate2 = mbmi->motion_mode != SIMPLE_TRANSLATION ? rate2_bmc_nocoeff
? rate2_bmc_nocoeff : rate2_nocoeff;
: rate2_nocoeff;
#else #else
int tmp_rate2 = rate2_nocoeff; int tmp_rate2 = rate2_nocoeff;
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
@@ -7542,13 +7541,13 @@ static int64_t handle_inter_mode(
#endif // CONFIG_DUAL_FILTER #endif // CONFIG_DUAL_FILTER
#endif // CONFIG_EXT_INTERP #endif // CONFIG_EXT_INTERP
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
int tmp_rate; int tmp_rate;
int64_t tmp_dist; int64_t tmp_dist;
if (mbmi->motion_variation == OBMC_CAUSAL) { if (mbmi->motion_mode == OBMC_CAUSAL) {
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
*mbmi = best_bmc_mbmi; *mbmi = best_bmc_mbmi;
mbmi->motion_variation = OBMC_CAUSAL; mbmi->motion_mode = OBMC_CAUSAL;
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
if (!is_comp_pred && have_newmv_in_inter_mode(this_mode)) { if (!is_comp_pred && have_newmv_in_inter_mode(this_mode)) {
int_mv tmp_mv; int_mv tmp_mv;
@@ -7595,19 +7594,19 @@ static int64_t handle_inter_mode(
model_rd_for_sb(cpi, bsize, x, xd, 0, MAX_MB_PLANE - 1, &tmp_rate, model_rd_for_sb(cpi, bsize, x, xd, 0, MAX_MB_PLANE - 1, &tmp_rate,
&tmp_dist, &skip_txfm_sb, &skip_sse_sb); &tmp_dist, &skip_txfm_sb, &skip_sse_sb);
} }
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#if CONFIG_WARPED_MOTION #if CONFIG_WARPED_MOTION
if (mbmi->motion_variation == WARPED_CAUSAL) { if (mbmi->motion_mode == WARPED_CAUSAL) {
// TODO(yuec): Add code // TODO(yuec): Add code
} }
#endif // CONFIG_WARPED_MOTION #endif // CONFIG_WARPED_MOTION
x->skip = 0; x->skip = 0;
*rate2 = tmp_rate2; *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; *distortion = 0;
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (!skip_txfm_sb) { if (!skip_txfm_sb) {
int skippable_y, skippable_uv; int skippable_y, skippable_uv;
int64_t sseuv = INT64_MAX; int64_t sseuv = INT64_MAX;
@@ -7637,16 +7636,16 @@ static int64_t handle_inter_mode(
if (*rate_y == INT_MAX) { if (*rate_y == INT_MAX) {
*rate2 = INT_MAX; *rate2 = INT_MAX;
*distortion = INT64_MAX; *distortion = INT64_MAX;
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (mbmi->motion_variation != SIMPLE_TRANSLATION) { if (mbmi->motion_mode != SIMPLE_TRANSLATION) {
continue; continue;
} else { } else {
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
restore_dst_buf(xd, orig_dst, orig_dst_stride); restore_dst_buf(xd, orig_dst, orig_dst_stride);
return INT64_MAX; 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; *rate2 += *rate_y;
@@ -7665,19 +7664,19 @@ static int64_t handle_inter_mode(
{ {
*rate2 = INT_MAX; *rate2 = INT_MAX;
*distortion = INT64_MAX; *distortion = INT64_MAX;
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
continue; continue;
#else #else
restore_dst_buf(xd, orig_dst, orig_dst_stride); restore_dst_buf(xd, orig_dst, orig_dst_stride);
return INT64_MAX; return INT64_MAX;
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
} }
*psse += sseuv; *psse += sseuv;
*rate2 += *rate_uv; *rate2 += *rate_uv;
*distortion += distortion_uv; *distortion += distortion_uv;
*skippable = skippable_y && skippable_uv; *skippable = skippable_y && skippable_uv;
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (*skippable) { if (*skippable) {
*rate2 -= *rate_uv + *rate_y; *rate2 -= *rate_uv + *rate_y;
*rate_y = 0; *rate_y = 0;
@@ -7703,16 +7702,16 @@ static int64_t handle_inter_mode(
mbmi->skip = 0; mbmi->skip = 0;
} }
*disable_skip = 0; *disable_skip = 0;
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
} else { } else {
x->skip = 1; x->skip = 1;
*disable_skip = 1; *disable_skip = 1;
mbmi->tx_size = tx_size_from_tx_mode(bsize, cm->tx_mode, 1); mbmi->tx_size = tx_size_from_tx_mode(bsize, cm->tx_mode, 1);
// The cost of skip bit needs to be added. // 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; 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); *rate2 += av1_cost_bit(av1_get_skip_prob(cm, xd), 1);
*distortion = skip_sse_sb; *distortion = skip_sse_sb;
@@ -7728,15 +7727,15 @@ static int64_t handle_inter_mode(
} }
#endif // CONFIG_GLOBAL_MOTION #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); 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_EXT_INTERP
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER
mbmi->interp_filter[0] = obmc_interp_filter[mbmi->motion_variation][0]; mbmi->interp_filter[0] = obmc_interp_filter[mbmi->motion_mode][0];
mbmi->interp_filter[1] = obmc_interp_filter[mbmi->motion_variation][1]; mbmi->interp_filter[1] = obmc_interp_filter[mbmi->motion_mode][1];
#else #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_DUAL_FILTER
#endif // CONFIG_EXT_INTERP #endif // CONFIG_EXT_INTERP
best_mbmi = *mbmi; best_mbmi = *mbmi;
@@ -7787,11 +7786,11 @@ static int64_t handle_inter_mode(
*skippable = best_skippable; *skippable = best_skippable;
x->skip = best_xskip; x->skip = best_xskip;
*disable_skip = best_disable_skip; *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 (!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 CONFIG_AOM_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
x->recon_variance = av1_high_get_sby_perpixel_variance( x->recon_variance = av1_high_get_sby_perpixel_variance(
@@ -7804,7 +7803,7 @@ static int64_t handle_inter_mode(
x->recon_variance = x->recon_variance =
av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize); av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
#endif // CONFIG_AOM_HIGHBITDEPTH #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); restore_dst_buf(xd, orig_dst, orig_dst_stride);
return 0; // The rate-distortion cost will be re-calculated by caller. return 0; // The rate-distortion cost will be re-calculated by caller.
@@ -8175,14 +8174,14 @@ static void pick_ext_intra_interframe(
} }
#endif // CONFIG_EXT_INTRA #endif // CONFIG_EXT_INTRA
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x, static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x,
const MACROBLOCKD *xd, int mi_row, const MACROBLOCKD *xd, int mi_row,
int mi_col, const uint8_t *above, int mi_col, const uint8_t *above,
int above_stride, const uint8_t *left, int above_stride, const uint8_t *left,
int left_stride, int32_t *mask_buf, int left_stride, int32_t *mask_buf,
int32_t *wsrc_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, void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
MACROBLOCK *x, int mi_row, int mi_col, MACROBLOCK *x, int mi_row, int mi_col,
@@ -8281,7 +8280,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
const int cols = 4 * num_4x4_blocks_wide_lookup[bsize]; const int cols = 4 * num_4x4_blocks_wide_lookup[bsize];
const MODE_INFO *above_mi = xd->above_mi; const MODE_INFO *above_mi = xd->above_mi;
const MODE_INFO *left_mi = xd->left_mi; const MODE_INFO *left_mi = xd->left_mi;
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
#if CONFIG_AOM_HIGHBITDEPTH #if CONFIG_AOM_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]);
@@ -8319,7 +8318,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
#if CONFIG_AOM_HIGHBITDEPTH #if CONFIG_AOM_HIGHBITDEPTH
} }
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
av1_zero(best_mbmode); av1_zero(best_mbmode);
av1_zero(pmi_uv); av1_zero(pmi_uv);
@@ -8394,7 +8393,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
} }
#endif // CONFIG_REF_MV #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, av1_build_prediction_by_above_preds(cm, xd, mi_row, mi_col, dst_buf1,
dst_width1, dst_height1, dst_stride1); dst_width1, dst_height1, dst_stride1);
av1_build_prediction_by_left_preds(cm, xd, mi_row, mi_col, dst_buf2, av1_build_prediction_by_left_preds(cm, xd, mi_row, mi_col, dst_buf2,
@@ -8403,7 +8402,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
calc_target_weighted_pred(cm, x, xd, mi_row, mi_col, dst_buf1[0], calc_target_weighted_pred(cm, x, xd, mi_row, mi_col, dst_buf1[0],
dst_stride1[0], dst_buf2[0], dst_stride2[0], dst_stride1[0], dst_buf2[0], dst_stride2[0],
mask2d_buf, weighted_src_buf); mask2d_buf, weighted_src_buf);
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) { for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
if (!(cpi->ref_frame_flags & flag_list[ref_frame])) { if (!(cpi->ref_frame_flags & flag_list[ref_frame])) {
@@ -8727,7 +8726,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
cm->interp_filter == SWITCHABLE ? EIGHTTAP_REGULAR : cm->interp_filter; cm->interp_filter == SWITCHABLE ? EIGHTTAP_REGULAR : cm->interp_filter;
#endif #endif
mbmi->mv[0].as_int = mbmi->mv[1].as_int = 0; mbmi->mv[0].as_int = mbmi->mv[1].as_int = 0;
mbmi->motion_variation = SIMPLE_TRANSLATION; mbmi->motion_mode = SIMPLE_TRANSLATION;
x->skip = 0; x->skip = 0;
set_ref_ptrs(cm, xd, ref_frame, second_ref_frame); set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
@@ -8923,10 +8922,10 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
this_rd = handle_inter_mode( this_rd = handle_inter_mode(
cpi, x, bsize, &rate2, &distortion2, &skippable, &rate_y, &rate_uv, cpi, x, bsize, &rate2, &distortion2, &skippable, &rate_y, &rate_uv,
&disable_skip, frame_mv, mi_row, mi_col, &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, dst_buf1, dst_stride1, dst_buf2, dst_stride2, weighted_src_buf,
mask2d_buf, mask2d_buf,
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
single_newmvs, single_newmvs_rate, &compmode_interintra_cost, single_newmvs, single_newmvs_rate, &compmode_interintra_cost,
&compmode_wedge_cost, modelled_rd, &compmode_wedge_cost, modelled_rd,
@@ -9031,10 +9030,10 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
tmp_alt_rd = handle_inter_mode( tmp_alt_rd = handle_inter_mode(
cpi, x, bsize, &tmp_rate, &tmp_dist, &tmp_skip, &tmp_rate_y, cpi, x, bsize, &tmp_rate, &tmp_dist, &tmp_skip, &tmp_rate_y,
&tmp_rate_uv, &dummy_disable_skip, frame_mv, mi_row, mi_col, &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, dst_buf1, dst_stride1, dst_buf2, dst_stride2, weighted_src_buf,
mask2d_buf, mask2d_buf,
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
dummy_single_newmvs, dummy_single_newmvs_rate, dummy_single_newmvs, dummy_single_newmvs_rate,
&dummy_compmode_interintra_cost, &dummy_compmode_wedge_cost, &dummy_compmode_interintra_cost, &dummy_compmode_wedge_cost,
@@ -9064,7 +9063,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
} }
if (tmp_alt_rd < INT64_MAX) { 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); tmp_alt_rd = RDCOST(x->rdmult, x->rddiv, tmp_rate, tmp_dist);
#else #else
if (RDCOST(x->rdmult, x->rddiv, tmp_rate_y + tmp_rate_uv, if (RDCOST(x->rdmult, x->rddiv, tmp_rate_y + tmp_rate_uv,
@@ -9079,7 +9078,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
tmp_rate + av1_cost_bit(av1_get_skip_prob(cm, xd), 1) - tmp_rate + av1_cost_bit(av1_get_skip_prob(cm, xd), 1) -
tmp_rate_y - tmp_rate_uv, tmp_rate_y - tmp_rate_uv,
tmp_sse); tmp_sse);
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
} }
if (tmp_ref_rd > tmp_alt_rd) { if (tmp_ref_rd > tmp_alt_rd) {
@@ -9128,9 +9127,9 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
rate2 += compmode_interintra_cost; rate2 += compmode_interintra_cost;
if (cm->reference_mode != SINGLE_REFERENCE && comp_pred) if (cm->reference_mode != SINGLE_REFERENCE && comp_pred)
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (mbmi->motion_variation == SIMPLE_TRANSLATION) if (mbmi->motion_mode == SIMPLE_TRANSLATION)
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
rate2 += compmode_wedge_cost; rate2 += compmode_wedge_cost;
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
@@ -9145,11 +9144,11 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
rate2 += ref_costs_single[ref_frame]; rate2 += ref_costs_single[ref_frame];
} }
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
if (ref_frame == INTRA_FRAME) { if (ref_frame == INTRA_FRAME) {
#else #else
if (!disable_skip) { if (!disable_skip) {
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
if (skippable) { if (skippable) {
// Back out the coefficient coding costs // Back out the coefficient coding costs
rate2 -= (rate_y + rate_uv); rate2 -= (rate_y + rate_uv);
@@ -9185,7 +9184,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
// Calculate the final RD estimate for this mode. // Calculate the final RD estimate for this mode.
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2); this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
} else { } else {
this_skip2 = mbmi->skip; this_skip2 = mbmi->skip;
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2); this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
@@ -9193,7 +9192,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
rate_y = 0; rate_y = 0;
rate_uv = 0; rate_uv = 0;
} }
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
} }
// Apply an adjustment to the rd value based on the similarity of the // Apply an adjustment to the rd value based on the similarity of the
@@ -9243,10 +9242,10 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
av1_get_skip_prob(cm, xd), disable_skip || skippable || this_skip2); av1_get_skip_prob(cm, xd), disable_skip || skippable || this_skip2);
*returnrate_nocoef -= av1_cost_bit(av1_get_intra_inter_prob(cm, xd), *returnrate_nocoef -= av1_cost_bit(av1_get_intra_inter_prob(cm, xd),
mbmi->ref_frame[0] != INTRA_FRAME); mbmi->ref_frame[0] != INTRA_FRAME);
#if CONFIG_OBMC || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (is_inter_block(mbmi) && is_motvar_allowed(mbmi)) if (is_inter_block(mbmi) && is_motion_variation_allowed(mbmi))
*returnrate_nocoef -= cpi->motvar_cost[bsize][mbmi->motion_variation]; *returnrate_nocoef -= cpi->motion_mode_cost[bsize][mbmi->motion_mode];
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#endif // CONFIG_SUPERTX #endif // CONFIG_SUPERTX
rd_cost->dist = distortion2; rd_cost->dist = distortion2;
rd_cost->rdcost = this_rd; rd_cost->rdcost = this_rd;
@@ -9344,11 +9343,11 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data,
if (is_inter_mode(mbmi->mode)) { if (is_inter_mode(mbmi->mode)) {
av1_build_inter_predictors_sb(xd, mi_row, mi_col, bsize); av1_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
#if CONFIG_OBMC #if CONFIG_MOTION_VAR
if (mbmi->motion_variation == OBMC_CAUSAL) if (mbmi->motion_mode == OBMC_CAUSAL)
av1_build_obmc_inter_prediction(cm, xd, mi_row, mi_col, dst_buf1, av1_build_obmc_inter_prediction(cm, xd, mi_row, mi_col, dst_buf1,
dst_stride1, dst_buf2, dst_stride2); dst_stride1, dst_buf2, dst_stride2);
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR
av1_subtract_plane(x, bsize, 0); av1_subtract_plane(x, bsize, 0);
#if CONFIG_VAR_TX #if CONFIG_VAR_TX
if (cm->tx_mode == TX_MODE_SELECT || xd->lossless[mbmi->segment_id]) { if (cm->tx_mode == TX_MODE_SELECT || xd->lossless[mbmi->segment_id]) {
@@ -9819,7 +9818,7 @@ void av1_rd_pick_inter_mode_sb_seg_skip(AV1_COMP *cpi, TileDataEnc *tile_data,
mbmi->ext_intra_mode_info.use_ext_intra_mode[1] = 0; mbmi->ext_intra_mode_info.use_ext_intra_mode[1] = 0;
#endif // CONFIG_EXT_INTRA #endif // CONFIG_EXT_INTRA
mbmi->mode = ZEROMV; mbmi->mode = ZEROMV;
mbmi->motion_variation = SIMPLE_TRANSLATION; mbmi->motion_mode = SIMPLE_TRANSLATION;
mbmi->uv_mode = DC_PRED; mbmi->uv_mode = DC_PRED;
mbmi->ref_frame[0] = LAST_FRAME; mbmi->ref_frame[0] = LAST_FRAME;
mbmi->ref_frame[1] = NONE; mbmi->ref_frame[1] = NONE;
@@ -9988,7 +9987,7 @@ void av1_rd_pick_inter_mode_sub8x8(struct AV1_COMP *cpi, TileDataEnc *tile_data,
mbmi->ext_intra_mode_info.use_ext_intra_mode[0] = 0; mbmi->ext_intra_mode_info.use_ext_intra_mode[0] = 0;
mbmi->ext_intra_mode_info.use_ext_intra_mode[1] = 0; mbmi->ext_intra_mode_info.use_ext_intra_mode[1] = 0;
#endif // CONFIG_EXT_INTRA #endif // CONFIG_EXT_INTRA
mbmi->motion_variation = SIMPLE_TRANSLATION; mbmi->motion_mode = SIMPLE_TRANSLATION;
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
mbmi->use_wedge_interinter = 0; mbmi->use_wedge_interinter = 0;
mbmi->use_wedge_interintra = 0; mbmi->use_wedge_interintra = 0;
@@ -10720,7 +10719,7 @@ void av1_rd_pick_inter_mode_sub8x8(struct AV1_COMP *cpi, TileDataEnc *tile_data,
store_coding_context(x, ctx, best_ref_index, best_pred_diff, 0); 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 // This function has a structure similar to av1_build_obmc_inter_prediction
// //
// The OBMC predictor is computed as: // The OBMC predictor is computed as:
@@ -10938,4 +10937,4 @@ static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x,
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
} }
} }
#endif // CONFIG_OBMC #endif // CONFIG_MOTION_VAR

1
configure vendored
View File

@@ -272,6 +272,7 @@ EXPERIMENT_LIST="
ext_partition_types ext_partition_types
ext_tile ext_tile
obmc obmc
motion_var
warped_motion warped_motion
entropy entropy
bidir_pred bidir_pred

View File

@@ -162,7 +162,7 @@ ifeq ($(CONFIG_EXT_INTRA),yes)
LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += reconintra_predictors_test.cc LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += reconintra_predictors_test.cc
endif 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_sad_test.cc
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += obmc_variance_test.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += obmc_variance_test.cc
endif endif