From cb60b185c73e0f15eeac71d83175345de9b03fa6 Mon Sep 17 00:00:00 2001 From: Yue Chen Date: Thu, 13 Oct 2016 15:18:22 -0700 Subject: [PATCH] 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 --- aom_dsp/aom_dsp.mk | 4 +- aom_dsp/aom_dsp_rtcd_defs.pl | 4 +- aom_dsp/sad.c | 4 +- aom_dsp/variance.c | 4 +- aom_dsp/variance.h | 8 +- av1/common/blockd.h | 21 +++-- av1/common/entropymode.c | 64 +++++++-------- av1/common/entropymode.h | 18 ++--- av1/common/enums.h | 8 +- av1/common/reconinter.c | 36 ++++----- av1/common/reconinter.h | 8 +- av1/decoder/decodeframe.c | 22 +++--- av1/decoder/decodemv.c | 48 ++++++----- av1/encoder/bitstream.c | 41 +++++----- av1/encoder/encodeframe.c | 24 +++--- av1/encoder/encoder.c | 20 ++--- av1/encoder/encoder.h | 6 +- av1/encoder/mcomp.c | 4 +- av1/encoder/mcomp.h | 4 +- av1/encoder/rd.c | 8 +- av1/encoder/rdopt.c | 149 +++++++++++++++++------------------ configure | 1 + test/test.mk | 2 +- 23 files changed, 257 insertions(+), 251 deletions(-) diff --git a/aom_dsp/aom_dsp.mk b/aom_dsp/aom_dsp.mk index 2adbef16c..036aef0e9 100644 --- a/aom_dsp/aom_dsp.mk +++ b/aom_dsp/aom_dsp.mk @@ -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_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 ba4b40fcd..8d17d03af 100644 --- a/aom_dsp/aom_dsp_rtcd_defs.pl +++ b/aom_dsp/aom_dsp_rtcd_defs.pl @@ -1208,7 +1208,7 @@ if (aom_config("CONFIG_EXT_INTER") eq "yes") { # # 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"; @@ -1540,7 +1540,7 @@ if (aom_config("CONFIG_EXT_INTER") eq "yes") { # # 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 7d284fc1e..2172b6cde 100644 --- a/aom_dsp/sad.c +++ b/aom_dsp/sad.c @@ -410,7 +410,7 @@ HIGHBD_MASKSADMXN(4, 4) #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, 8) 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 ce02a93e5..90617d9cf 100644 --- a/aom_dsp/variance.c +++ b/aom_dsp/variance.c @@ -942,7 +942,7 @@ HIGHBD_MASK_SUBPIX_VAR(128, 128) #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_VAR(128, 128) 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 b73754f0a..222fdaf0d 100644 --- a/aom_dsp/variance.h +++ b/aom_dsp/variance.h @@ -68,7 +68,7 @@ typedef unsigned int (*aom_masked_subpixvariance_fn_t)( 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_variance_fn_t)(const uint8_t *pred, 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 @@ typedef struct aom_variance_vtable { 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 2481de73f..a541378b0 100644 --- a/av1/common/blockd.h +++ b/av1/common/blockd.h @@ -227,7 +227,7 @@ typedef struct { 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 @@ static INLINE int is_interintra_pred(const MB_MODE_INFO *mbmi) { } #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 b65b6dffa..4daac84f9 100644 --- a/av1/common/entropymode.c +++ b/av1/common/entropymode.c @@ -315,43 +315,45 @@ static const aom_prob default_wedge_interinter_prob[BLOCK_SIZES] = { #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 @@ static const aom_prob default_motvar_prob[BLOCK_SIZES][MOTION_VARIATIONS - 1] = { 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 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { #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 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { 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 3120f90d9..4f33bba0a 100644 --- a/av1/common/entropymode.h +++ b/av1/common/entropymode.h @@ -80,9 +80,9 @@ typedef struct frame_contexts { 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 @@ typedef struct FRAME_COUNTS { 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 @@ extern const aom_tree_index av1_ext_tx_intra_tree[EXT_TX_SETS_INTRA] #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 c8776ef25..89a219d1e 100644 --- a/av1/common/enums.h +++ b/av1/common/enums.h @@ -280,14 +280,14 @@ typedef enum ATTRIBUTE_PACKED { 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 d6e2d787a..ae57a43fa 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 av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst, } 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 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane, #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 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize, 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 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize, 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 @@ void av1_build_inter_predictors_sb_sub8x8_extend(MACROBLOCKD *xd, 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 @@ void av1_build_inter_predictors_sb_extend(MACROBLOCKD *xd, 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 @@ void av1_build_inter_predictors_sb_extend(MACROBLOCKD *xd, 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 @@ void av1_build_inter_predictors_sb_extend(MACROBLOCKD *xd, } #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 @@ void av1_build_prediction_by_left_preds(AV1_COMMON *cm, MACROBLOCKD *xd, } 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 26a4590c7..4f86354ae 100644 --- a/av1/common/reconinter.h +++ b/av1/common/reconinter.h @@ -214,9 +214,9 @@ static INLINE int get_interintra_wedge_bits(BLOCK_SIZE sb_type) { #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 @@ static INLINE int av1_is_interp_needed(const MACROBLOCKD *const xd) { } #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 @@ void av1_build_prediction_by_left_preds(AV1_COMMON *cm, MACROBLOCKD *xd, 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 7daeb5de0..e7a057846 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c @@ -1238,8 +1238,8 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd, } 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 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd, 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) { @@ -3649,12 +3649,12 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data, } #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); @@ -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, 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 1438a5645..3f9ab2382 100644 --- a/av1/decoder/decodemv.c +++ b/av1/decoder/decodemv.c @@ -819,24 +819,22 @@ static void read_ref_frames(AV1_COMMON *const cm, MACROBLOCKD *const xd, } } -#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 fpm_sync(void *const data, int mi_row) { 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 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi, } #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 @@ static void read_inter_frame_mode_info(AV1Decoder *const pbi, 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 6774bb2b9..f4b5da6c9 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c @@ -149,9 +149,9 @@ static struct av1_token intra_filter_encodings[INTRA_FILTERS]; #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 @@ void av1_encode_token_init(void) { #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); @@ -1401,30 +1401,31 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi, } #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]); @@ -3474,11 +3475,11 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) { } #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 2eecee4f6..163f4c0a4 100644 --- a/av1/encoder/encodeframe.c +++ b/av1/encoder/encodeframe.c @@ -1301,7 +1301,7 @@ static void update_state_supertx(AV1_COMP *cpi, ThreadData *td, } #endif // CONFIG_VAR_TX // Turn motion variation off for supertx - mbmi->motion_variation = SIMPLE_TRANSLATION; + mbmi->motion_mode = SIMPLE_TRANSLATION; if (!output_enabled) return; @@ -1886,24 +1886,24 @@ static void update_stats(AV1_COMMON *cm, ThreadData *td } #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]++; } @@ -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, 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]); @@ -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, 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 983f8ccfc..ddd3cc5b0 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c @@ -1181,7 +1181,7 @@ MAKE_MBFP_SAD_WRAPPER(aom_highbd_masked_sad4x8) 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_sad8x8) 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 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) { 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 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) { 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 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) { 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 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) { 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 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) { 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 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) { 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 @@ AV1_COMP *av1_create_compressor(AV1EncoderConfig *oxcf, 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 @@ AV1_COMP *av1_create_compressor(AV1EncoderConfig *oxcf, 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 e35297336..f85487482 100644 --- a/av1/encoder/encoder.h +++ b/av1/encoder/encoder.h @@ -543,9 +543,9 @@ typedef struct AV1_COMP { [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 9ea9edeed..1dc6b99c9 100644 --- a/av1/encoder/mcomp.c +++ b/av1/encoder/mcomp.c @@ -2930,7 +2930,7 @@ int av1_masked_full_pixel_diamond(const AV1_COMP *cpi, MACROBLOCK *x, } #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 @@ int av1_obmc_full_pixel_diamond(const AV1_COMP *cpi, MACROBLOCK *x, } return bestsme; } -#endif // CONFIG_OBMC +#endif // CONFIG_MOTION_VAR diff --git a/av1/encoder/mcomp.h b/av1/encoder/mcomp.h index f5ac0e3cb..f1eccc2f0 100644 --- a/av1/encoder/mcomp.h +++ b/av1/encoder/mcomp.h @@ -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); #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 av1_find_best_obmc_sub_pixel_tree_up( 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 007f9920d..ee651075d 100644 --- a/av1/encoder/rd.c +++ b/av1/encoder/rd.c @@ -450,12 +450,12 @@ void av1_initialize_rd_consts(AV1_COMP *cpi) { 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 86f0c8d81..78d61e2ce 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c @@ -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, BLOCK_SIZE bsize, int mi_row, int mi_col, 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]; } } -#endif // CONFIG_OBMC +#endif // CONFIG_MOTION_VAR #if CONFIG_EXT_INTER 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, 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], @@ -6700,12 +6700,12 @@ static int64_t handle_inter_mode( #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; @@ -6719,7 +6719,7 @@ static int64_t handle_inter_mode( 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; @@ -7156,12 +7156,12 @@ static int64_t handle_inter_mode( 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; @@ -7511,20 +7511,19 @@ static int64_t handle_inter_mode( } 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 @@ -7542,13 +7541,13 @@ static int64_t handle_inter_mode( #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; @@ -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, &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; @@ -7637,16 +7636,16 @@ static int64_t handle_inter_mode( 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; @@ -7665,19 +7664,19 @@ static int64_t handle_inter_mode( { *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; @@ -7703,16 +7702,16 @@ static int64_t handle_inter_mode( 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; @@ -7728,15 +7727,15 @@ static int64_t handle_inter_mode( } #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; @@ -7787,11 +7786,11 @@ static int64_t handle_inter_mode( *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( @@ -7804,7 +7803,7 @@ static int64_t handle_inter_mode( 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. @@ -8175,14 +8174,14 @@ static void pick_ext_intra_interframe( } #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, @@ -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 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]); @@ -8319,7 +8318,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data, #if CONFIG_AOM_HIGHBITDEPTH } #endif // CONFIG_AOM_HIGHBITDEPTH -#endif // CONFIG_OBMC +#endif // CONFIG_MOTION_VAR av1_zero(best_mbmode); 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 -#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, @@ -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], 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])) { @@ -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; #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); @@ -8923,10 +8922,10 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data, 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, @@ -9031,10 +9030,10 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data, 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, @@ -9064,7 +9063,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data, } 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, @@ -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_y - tmp_rate_uv, tmp_sse); -#endif // CONFIG_OBMC +#endif // CONFIG_MOTION_VAR } 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 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 @@ -9145,11 +9144,11 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data, 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); @@ -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. 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); @@ -9193,7 +9192,7 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data, 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 @@ -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); *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; @@ -9344,11 +9343,11 @@ void av1_rd_pick_inter_mode_sb(AV1_COMP *cpi, TileDataEnc *tile_data, 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]) { @@ -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; #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; @@ -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[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; @@ -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); } -#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: @@ -10938,4 +10937,4 @@ static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x, #endif // CONFIG_AOM_HIGHBITDEPTH } } -#endif // CONFIG_OBMC +#endif // CONFIG_MOTION_VAR diff --git a/configure b/configure index 1bc0863e6..231909b3b 100755 --- a/configure +++ b/configure @@ -272,6 +272,7 @@ EXPERIMENT_LIST=" ext_partition_types ext_tile obmc + motion_var warped_motion entropy bidir_pred diff --git a/test/test.mk b/test/test.mk index c071cea80..c0573e7f3 100644 --- a/test/test.mk +++ b/test/test.mk @@ -162,7 +162,7 @@ ifeq ($(CONFIG_EXT_INTRA),yes) 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 -- 2.50.0