Commit 48795807 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Remove experimental flag of GLOBAL_MOTION

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

Change-Id: I9c9d6ef5317798cbf237307a9754fe7e03bdda47
parent c7af36d4
......@@ -34,7 +34,7 @@ int aom_free_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
aom_free(ybf->buffer_alloc);
}
#if CONFIG_HIGHBITDEPTH && CONFIG_GLOBAL_MOTION
#if CONFIG_HIGHBITDEPTH
if (ybf->y_buffer_8bit) aom_free(ybf->y_buffer_8bit);
#endif
......@@ -167,7 +167,7 @@ int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
(uv_border_h * uv_stride) + uv_border_w,
aom_byte_align);
#if CONFIG_HIGHBITDEPTH && CONFIG_GLOBAL_MOTION
#if CONFIG_HIGHBITDEPTH
if (use_highbitdepth) {
if (ybf->y_buffer_8bit) aom_free(ybf->y_buffer_8bit);
ybf->y_buffer_8bit = (uint8_t *)aom_memalign(32, (size_t)yplane_size);
......
......@@ -86,7 +86,7 @@ typedef struct yv12_buffer_config {
uint8_t *buffers[4];
};
#if CONFIG_HIGHBITDEPTH && CONFIG_GLOBAL_MOTION
#if CONFIG_HIGHBITDEPTH
// If the frame is stored in a 16-bit buffer, this stores an 8-bit version
// for use in global motion detection. It is allocated on-demand.
uint8_t *y_buffer_8bit;
......
......@@ -333,26 +333,24 @@ if (CONFIG_BGSPRITE)
"${AOM_ROOT}/av1/encoder/bgsprite.h")
endif ()
if (CONFIG_GLOBAL_MOTION)
set(AOM_AV1_ENCODER_SOURCES
${AOM_AV1_ENCODER_SOURCES}
"${AOM_ROOT}/av1/encoder/corner_detect.c"
"${AOM_ROOT}/av1/encoder/corner_detect.h"
"${AOM_ROOT}/av1/encoder/corner_match.c"
"${AOM_ROOT}/av1/encoder/corner_match.h"
"${AOM_ROOT}/av1/encoder/global_motion.c"
"${AOM_ROOT}/av1/encoder/global_motion.h"
"${AOM_ROOT}/av1/encoder/ransac.c"
"${AOM_ROOT}/av1/encoder/ransac.h"
"${AOM_ROOT}/third_party/fastfeat/fast_9.c"
"${AOM_ROOT}/third_party/fastfeat/fast.c"
"${AOM_ROOT}/third_party/fastfeat/fast.h"
"${AOM_ROOT}/third_party/fastfeat/nonmax.c")
set(AOM_AV1_ENCODER_INTRIN_SSE4_1
${AOM_AV1_ENCODER_INTRIN_SSE4_1}
"${AOM_ROOT}/av1/encoder/x86/corner_match_sse4.c")
endif ()
set(AOM_AV1_ENCODER_SOURCES
${AOM_AV1_ENCODER_SOURCES}
"${AOM_ROOT}/av1/encoder/corner_detect.c"
"${AOM_ROOT}/av1/encoder/corner_detect.h"
"${AOM_ROOT}/av1/encoder/corner_match.c"
"${AOM_ROOT}/av1/encoder/corner_match.h"
"${AOM_ROOT}/av1/encoder/global_motion.c"
"${AOM_ROOT}/av1/encoder/global_motion.h"
"${AOM_ROOT}/av1/encoder/ransac.c"
"${AOM_ROOT}/av1/encoder/ransac.h"
"${AOM_ROOT}/third_party/fastfeat/fast_9.c"
"${AOM_ROOT}/third_party/fastfeat/fast.c"
"${AOM_ROOT}/third_party/fastfeat/fast.h"
"${AOM_ROOT}/third_party/fastfeat/nonmax.c")
set(AOM_AV1_ENCODER_INTRIN_SSE4_1
${AOM_AV1_ENCODER_INTRIN_SSE4_1}
"${AOM_ROOT}/av1/encoder/x86/corner_match_sse4.c")
if (CONFIG_INSPECTION)
set(AOM_AV1_DECODER_SOURCES
......@@ -420,25 +418,23 @@ if (CONFIG_NCOBMC_ADAPT_WEIGHT)
"${AOM_ROOT}/av1/common/ncobmc_kernels.h")
endif ()
if (CONFIG_WARPED_MOTION OR CONFIG_GLOBAL_MOTION)
set(AOM_AV1_COMMON_SOURCES
${AOM_AV1_COMMON_SOURCES}
"${AOM_ROOT}/av1/common/warped_motion.c"
"${AOM_ROOT}/av1/common/warped_motion.h")
set(AOM_AV1_COMMON_SOURCES
${AOM_AV1_COMMON_SOURCES}
"${AOM_ROOT}/av1/common/warped_motion.c"
"${AOM_ROOT}/av1/common/warped_motion.h")
set(AOM_AV1_COMMON_INTRIN_SSE2
${AOM_AV1_COMMON_INTRIN_SSE2}
"${AOM_ROOT}/av1/common/x86/warp_plane_sse2.c")
set(AOM_AV1_COMMON_INTRIN_SSE2
${AOM_AV1_COMMON_INTRIN_SSE2}
"${AOM_ROOT}/av1/common/x86/warp_plane_sse2.c")
set(AOM_AV1_COMMON_INTRIN_SSSE3
${AOM_AV1_COMMON_INTRIN_SSSE3}
"${AOM_ROOT}/av1/common/x86/warp_plane_ssse3.c")
if (CONFIG_HIGHBITDEPTH)
set(AOM_AV1_COMMON_INTRIN_SSSE3
${AOM_AV1_COMMON_INTRIN_SSSE3}
"${AOM_ROOT}/av1/common/x86/warp_plane_ssse3.c")
if (CONFIG_HIGHBITDEPTH)
set(AOM_AV1_COMMON_INTRIN_SSSE3
${AOM_AV1_COMMON_INTRIN_SSSE3}
"${AOM_ROOT}/av1/common/x86/highbd_warp_plane_ssse3.c")
endif ()
"${AOM_ROOT}/av1/common/x86/highbd_warp_plane_ssse3.c")
endif ()
if (CONFIG_HASH_ME)
......
......@@ -91,10 +91,8 @@ endif
ifeq ($(CONFIG_INTRA_EDGE),yes)
AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/intra_edge_sse4.c
endif
ifeq (yes,$(filter $(CONFIG_GLOBAL_MOTION) $(CONFIG_WARPED_MOTION),yes))
AV1_COMMON_SRCS-yes += common/warped_motion.h
AV1_COMMON_SRCS-yes += common/warped_motion.c
endif
ifeq ($(CONFIG_CDEF),yes)
ifeq ($(CONFIG_CDEF_SINGLEPASS),yes)
AV1_COMMON_SRCS-$(HAVE_AVX2) += common/cdef_block_avx2.c
......@@ -155,13 +153,11 @@ ifeq ($(CONFIG_FILTER_INTRA),yes)
AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/filterintra_sse4.c
endif
ifneq ($(findstring yes,$(CONFIG_GLOBAL_MOTION) $(CONFIG_WARPED_MOTION)),)
AV1_COMMON_SRCS-$(HAVE_SSE2) += common/x86/warp_plane_sse2.c
AV1_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/warp_plane_ssse3.c
ifeq ($(CONFIG_HIGHBITDEPTH),yes)
AV1_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/highbd_warp_plane_ssse3.c
endif
endif
ifeq ($(CONFIG_CONVOLVE_ROUND),yes)
AV1_COMMON_SRCS-$(HAVE_SSE2) += common/x86/convolve_2d_sse2.c
......
......@@ -39,18 +39,18 @@ AV1_CX_SRCS-yes += encoder/ethread.c
AV1_CX_SRCS-yes += encoder/extend.c
AV1_CX_SRCS-yes += encoder/firstpass.c
AV1_CX_SRCS-yes += encoder/mathutils.h
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += ../third_party/fastfeat/fast.h
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += ../third_party/fastfeat/nonmax.c
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += ../third_party/fastfeat/fast_9.c
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += ../third_party/fastfeat/fast.c
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += encoder/corner_match.c
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += encoder/corner_match.h
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += encoder/corner_detect.c
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += encoder/corner_detect.h
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += encoder/global_motion.c
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += encoder/global_motion.h
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += encoder/ransac.c
AV1_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += encoder/ransac.h
AV1_CX_SRCS-yes += ../third_party/fastfeat/fast.h
AV1_CX_SRCS-yes += ../third_party/fastfeat/nonmax.c
AV1_CX_SRCS-yes += ../third_party/fastfeat/fast_9.c
AV1_CX_SRCS-yes += ../third_party/fastfeat/fast.c
AV1_CX_SRCS-yes += encoder/corner_match.c
AV1_CX_SRCS-yes += encoder/corner_match.h
AV1_CX_SRCS-yes += encoder/corner_detect.c
AV1_CX_SRCS-yes += encoder/corner_detect.h
AV1_CX_SRCS-yes += encoder/global_motion.c
AV1_CX_SRCS-yes += encoder/global_motion.h
AV1_CX_SRCS-yes += encoder/ransac.c
AV1_CX_SRCS-yes += encoder/ransac.h
AV1_CX_SRCS-yes += encoder/block.h
AV1_CX_SRCS-yes += encoder/bitstream.h
AV1_CX_SRCS-yes += encoder/encodemb.h
......@@ -158,9 +158,7 @@ AV1_CX_SRCS-$(HAVE_MSA) += encoder/mips/msa/fdct16x16_msa.c
AV1_CX_SRCS-$(HAVE_MSA) += encoder/mips/msa/fdct_msa.h
AV1_CX_SRCS-$(HAVE_MSA) += encoder/mips/msa/temporal_filter_msa.c
ifeq ($(CONFIG_GLOBAL_MOTION),yes)
AV1_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/corner_match_sse4.c
endif
ifeq ($(CONFIG_EXT_TX),yes)
AV1_CX_SRCS-yes += encoder/tx_prune_model_weights.h
......
......@@ -523,19 +523,15 @@ if (aom_config("CONFIG_CDEF") eq "yes") {
# WARPED_MOTION / GLOBAL_MOTION functions
if ((aom_config("CONFIG_WARPED_MOTION") eq "yes") ||
(aom_config("CONFIG_GLOBAL_MOTION") eq "yes")) {
add_proto qw/void av1_warp_affine/, "const int32_t *mat, const uint8_t *ref, int width, int height, int stride, uint8_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, ConvolveParams *conv_params, int16_t alpha, int16_t beta, int16_t gamma, int16_t delta";
specialize qw/av1_warp_affine sse2 ssse3/;
add_proto qw/void av1_warp_affine/, "const int32_t *mat, const uint8_t *ref, int width, int height, int stride, uint8_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, ConvolveParams *conv_params, int16_t alpha, int16_t beta, int16_t gamma, int16_t delta";
specialize qw/av1_warp_affine sse2 ssse3/;
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
add_proto qw/void av1_highbd_warp_affine/, "const int32_t *mat, const uint16_t *ref, int width, int height, int stride, uint16_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, int bd, ConvolveParams *conv_params, int16_t alpha, int16_t beta, int16_t gamma, int16_t delta";
specialize qw/av1_highbd_warp_affine ssse3/;
}
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
add_proto qw/void av1_highbd_warp_affine/, "const int32_t *mat, const uint16_t *ref, int width, int height, int stride, uint16_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, int bd, ConvolveParams *conv_params, int16_t alpha, int16_t beta, int16_t gamma, int16_t delta";
specialize qw/av1_highbd_warp_affine ssse3/;
}
if (aom_config("CONFIG_GLOBAL_MOTION") eq "yes" &&
aom_config("CONFIG_AV1_ENCODER") eq "yes") {
if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
add_proto qw/double compute_cross_correlation/, "unsigned char *im1, int stride1, int x1, int y1, unsigned char *im2, int stride2, int x2, int y2";
specialize qw/compute_cross_correlation sse4_1/;
}
......
......@@ -516,7 +516,6 @@ PREDICTION_MODE av1_left_block_mode(const MODE_INFO *cur_mi,
PREDICTION_MODE av1_above_block_mode(const MODE_INFO *cur_mi,
const MODE_INFO *above_mi, int b);
#if CONFIG_GLOBAL_MOTION
static INLINE int is_global_mv_block(const MODE_INFO *mi, int block,
TransformationType type) {
PREDICTION_MODE mode = get_y_mode(mi, block);
......@@ -530,7 +529,6 @@ static INLINE int is_global_mv_block(const MODE_INFO *mi, int block,
return (mode == ZEROMV || mode == ZERO_ZEROMV) && type > TRANSLATION &&
block_size_allowed;
}
#endif // CONFIG_GLOBAL_MOTION
enum mv_precision { MV_PRECISION_Q3, MV_PRECISION_Q4 };
......@@ -733,9 +731,7 @@ typedef struct macroblockd {
// same with that in AV1_COMMON
#endif
struct aom_internal_error_info *error_info;
#if CONFIG_GLOBAL_MOTION
WarpedMotionParams *global_motion;
#endif // CONFIG_GLOBAL_MOTION
int prev_qindex;
int delta_qindex;
int current_qindex;
......@@ -1433,22 +1429,18 @@ static INLINE NCOBMC_MODE ncobmc_mode_allowed_bsize(BLOCK_SIZE bsize) {
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR
static INLINE MOTION_MODE motion_mode_allowed(
#if CONFIG_GLOBAL_MOTION
int block, const WarpedMotionParams *gm_params,
#endif // CONFIG_GLOBAL_MOTION
static INLINE MOTION_MODE
motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
#if CONFIG_WARPED_MOTION
const MACROBLOCKD *xd,
const MACROBLOCKD *xd,
#endif
const MODE_INFO *mi) {
const MODE_INFO *mi) {
const MB_MODE_INFO *mbmi = &mi->mbmi;
#if CONFIG_AMVR
if (xd->cur_frame_force_integer_mv == 0) {
#endif
#if CONFIG_GLOBAL_MOTION
const TransformationType gm_type = gm_params[mbmi->ref_frame[0]].wmtype;
if (is_global_mv_block(mi, block, gm_type)) return SIMPLE_TRANSLATION;
#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_AMVR
}
#endif
......@@ -1485,23 +1477,18 @@ static INLINE MOTION_MODE motion_mode_allowed(
}
}
static INLINE void assert_motion_mode_valid(MOTION_MODE mode,
#if CONFIG_GLOBAL_MOTION
int block,
static INLINE void assert_motion_mode_valid(MOTION_MODE mode, int block,
const WarpedMotionParams *gm_params,
#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_WARPED_MOTION
const MACROBLOCKD *xd,
#endif
const MODE_INFO *mi) {
const MOTION_MODE last_motion_mode_allowed = motion_mode_allowed(
#if CONFIG_GLOBAL_MOTION
block, gm_params,
#endif // CONFIG_GLOBAL_MOTION
const MOTION_MODE last_motion_mode_allowed =
motion_mode_allowed(block, gm_params,
#if CONFIG_WARPED_MOTION
xd,
xd,
#endif
mi);
mi);
// Check that the input mode is not illegal
if (last_motion_mode_allowed < mode)
......@@ -1568,7 +1555,6 @@ typedef struct {
ColorCost color_cost;
} Av1ColorMapParam;
#if CONFIG_GLOBAL_MOTION
static INLINE int is_nontrans_global_motion(const MACROBLOCKD *xd) {
const MODE_INFO *mi = xd->mi[0];
const MB_MODE_INFO *const mbmi = &mi->mbmi;
......@@ -1587,7 +1573,6 @@ static INLINE int is_nontrans_global_motion(const MACROBLOCKD *xd) {
}
return 1;
}
#endif // CONFIG_GLOBAL_MOTION
static INLINE PLANE_TYPE get_plane_type(int plane) {
return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
......
......@@ -37,7 +37,6 @@ typedef struct mv32 {
int32_t col;
} MV32;
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
// Bits of precision used for the model
#define WARPEDMODEL_PREC_BITS 16
#define WARPEDMODEL_ROW3HOMO_PREC_BITS 16
......@@ -91,9 +90,7 @@ typedef enum {
#endif // GLOBAL_TRANS_TYPES > 4
typedef struct {
#if CONFIG_GLOBAL_MOTION
int global_warp_allowed;
#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_WARPED_MOTION
int local_warp_allowed;
#endif // CONFIG_WARPED_MOTION
......@@ -123,9 +120,7 @@ static const WarpedMotionParams default_warp_params = {
0,
};
/* clang-format on */
#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
#if CONFIG_GLOBAL_MOTION
// The following constants describe the various precisions
// of different parameters in the global motion experiment.
//
......@@ -316,7 +311,6 @@ static INLINE TransformationType get_gmtype(const WarpedMotionParams *gm) {
else
return AFFINE;
}
#endif // CONFIG_GLOBAL_MOTION
typedef struct candidate_mv {
int_mv this_mv;
......
......@@ -14,9 +14,7 @@
#include "av1/common/warped_motion.h"
#endif // CONFIG_WARPED_MOTION
#if CONFIG_GLOBAL_MOTION
#define USE_CUR_GM_REFMV 1
#endif // CONFIG_GLOBAL_MOTION
void av1_copy_frame_mvs(const AV1_COMMON *const cm, MODE_INFO *mi, int mi_row,
int mi_col, int x_mis, int y_mis) {
......@@ -55,9 +53,9 @@ static uint8_t add_ref_mv_candidate(
const MODE_INFO *const candidate_mi, const MB_MODE_INFO *const candidate,
const MV_REFERENCE_FRAME rf[2], uint8_t *refmv_count,
CANDIDATE_MV *ref_mv_stack, const int use_hp, int len, int block,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
int_mv *gm_mv_candidates, const WarpedMotionParams *gm_params,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
int col, int weight,
#if CONFIG_AMVR
int is_integer,
......@@ -116,11 +114,11 @@ static uint8_t add_ref_mv_candidate(
lower_mv_precision(&this_refmv.as_mv, use_hp);
} else {
#endif // CONFIG_EXT_WARPED_MOTION
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
if (is_global_mv_block(candidate_mi, block, gm_params[rf[0]].wmtype))
this_refmv = gm_mv_candidates[0];
else
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
this_refmv = get_sub_block_mv(candidate_mi, ref, col, block);
#if CONFIG_AMVR
lower_mv_precision(&this_refmv.as_mv, use_hp, is_integer);
......@@ -154,11 +152,11 @@ static uint8_t add_ref_mv_candidate(
int_mv this_refmv[2];
for (ref = 0; ref < 2; ++ref) {
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
if (is_global_mv_block(candidate_mi, block, gm_params[rf[ref]].wmtype))
this_refmv[ref] = gm_mv_candidates[ref];
else
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
this_refmv[ref] = get_sub_block_mv(candidate_mi, ref, col, block);
#if CONFIG_AMVR
lower_mv_precision(&this_refmv[ref].as_mv, use_hp, is_integer);
......@@ -196,9 +194,9 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int mi_row, int mi_col, int block,
const MV_REFERENCE_FRAME rf[2], int row_offset,
CANDIDATE_MV *ref_mv_stack, uint8_t *refmv_count,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
int_mv *gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
int max_row_offset, int *processed_rows) {
const int end_mi = AOMMIN(xd->n8_w, cm->mi_cols - mi_col);
const int n8_w_8 = mi_size_wide[BLOCK_8X8];
......@@ -240,9 +238,9 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
col_offset + i, weight, cm->cur_frame_force_integer_mv,
xd->mi[0]->mbmi.sb_type, mi_row, mi_col, xd->plane[0].subsampling_x,
xd->plane[0].subsampling_y);
......@@ -250,9 +248,9 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
col_offset + i, weight, xd->mi[0]->mbmi.sb_type, mi_row, mi_col,
xd->plane[0].subsampling_x, xd->plane[0].subsampling_y);
#endif
......@@ -267,9 +265,9 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int mi_row, int mi_col, int block,
const MV_REFERENCE_FRAME rf[2], int col_offset,
CANDIDATE_MV *ref_mv_stack, uint8_t *refmv_count,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
int_mv *gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
int max_col_offset, int *processed_cols) {
const int end_mi = AOMMIN(xd->n8_h, cm->mi_rows - mi_row);
const int n8_h_8 = mi_size_high[BLOCK_8X8];
......@@ -310,9 +308,9 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
col_offset, weight, cm->cur_frame_force_integer_mv,
xd->mi[0]->mbmi.sb_type, mi_row, mi_col, xd->plane[0].subsampling_x,
xd->plane[0].subsampling_y);
......@@ -320,9 +318,9 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
col_offset, weight, xd->mi[0]->mbmi.sb_type, mi_row, mi_col,
xd->plane[0].subsampling_x, xd->plane[0].subsampling_y);
#endif
......@@ -336,9 +334,9 @@ static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
const int mi_row, const int mi_col, int block,
const MV_REFERENCE_FRAME rf[2], int row_offset,
int col_offset, CANDIDATE_MV *ref_mv_stack,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
int_mv *gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
uint8_t *refmv_count) {
const TileInfo *const tile = &xd->tile;
POSITION mi_pos;
......@@ -358,18 +356,18 @@ static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
mi_pos.col, 2, cm->cur_frame_force_integer_mv, xd->mi[0]->mbmi.sb_type,
mi_row, mi_col, xd->plane[0].subsampling_x, xd->plane[0].subsampling_y);
#else
newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
mi_pos.col, 2, xd->mi[0]->mbmi.sb_type, mi_row, mi_col,
xd->plane[0].subsampling_x, xd->plane[0].subsampling_y);
#endif
......@@ -630,9 +628,9 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MV_REFERENCE_FRAME ref_frame,
uint8_t *refmv_count, CANDIDATE_MV *ref_mv_stack,
int_mv *mv_ref_list,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
int_mv *gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
int block, int mi_row, int mi_col,
int16_t *mode_context) {
int idx, nearest_refmv_count = 0;
......@@ -698,25 +696,25 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
if (abs(max_row_offset) >= 1)
newmv_count += scan_row_mbmi(cm, xd, mi_row, mi_col, block, rf, -1,
ref_mv_stack, refmv_count,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
max_row_offset, &processed_rows);
// Scan the first left column mode info. col_offset = -1;
if (abs(max_col_offset) >= 1)
newmv_count += scan_col_mbmi(cm, xd, mi_row, mi_col, block, rf, -1,
ref_mv_stack, refmv_count,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
max_col_offset, &processed_cols);
// Check top-right boundary
if (has_tr)
newmv_count += scan_blk_mbmi(cm, xd, mi_row, mi_col, block, rf, -1,
xd->n8_w, ref_mv_stack,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
refmv_count);
nearest_refmv_count = *refmv_count;
......@@ -831,9 +829,9 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
// Scan the second outer area.
scan_blk_mbmi(cm, xd, mi_row, mi_col, block, rf, -1, -1, ref_mv_stack,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
refmv_count);
for (idx = 2; idx <= MVREF_ROWS; ++idx) {
row_offset = -(idx << 1) + 1 + row_adj;
......@@ -843,18 +841,18 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
abs(row_offset) > processed_rows)
scan_row_mbmi(cm, xd, mi_row, mi_col, block, rf, row_offset, ref_mv_stack,
refmv_count,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
max_row_offset, &processed_rows);
if (abs(col_offset) <= abs(max_col_offset) &&
abs(col_offset) > processed_cols)
scan_col_mbmi(cm, xd, mi_row, mi_col, block, rf, col_offset, ref_mv_stack,
refmv_count,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
max_col_offset, &processed_cols);
}
......@@ -863,9 +861,9 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
abs(col_offset) > processed_cols)
scan_col_mbmi(cm, xd, mi_row, mi_col, block, rf, col_offset, ref_mv_stack,
refmv_count,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
max_col_offset, &processed_cols);
switch (nearest_refmv_count) {
......@@ -1226,18 +1224,13 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int mi_row, int mi_col, find_mv_refs_sync sync,
void *const data, int16_t *mode_context) {
int_mv zeromv[2];
#if CONFIG_GLOBAL_MOTION
BLOCK_SIZE bsize = mi->mbmi.sb_type;
#endif // CONFIG_GLOBAL_MOTION
int idx, all_zero = 1;
#if CONFIG_GLOBAL_MOTION
MV_REFERENCE_FRAME rf[2];
#endif // CONFIG_GLOBAL_MOTION
av1_update_mv_context(cm, xd, mi, ref_frame, mv_ref_list, -1, mi_row, mi_col,
compound_mode_context);
#if CONFIG_GLOBAL_MOTION
if (!CONFIG_INTRABC || ref_frame != INTRA_FRAME) {
av1_set_ref_frame(rf, ref_frame);
zeromv[0].as_int = gm_get_motion_vector(&cm->global_motion[rf[0]],
......@@ -1263,18 +1256,15 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
} else {
zeromv[0].as_int = zeromv[1].as_int = 0;
}
#else
zeromv[0].as_int = zeromv[1].as_int = 0;
#endif // CONFIG_GLOBAL_MOTION
if (ref_frame <= ALTREF_FRAME)
find_mv_refs_idx(cm, xd, mi, ref_frame, mv_ref_list, -1, mi_row, mi_col,
sync, data, mode_context, zeromv[0]);
setup_ref_mv_list(cm, xd, ref_frame, ref_mv_count, ref_mv_stack, mv_ref_list,
#if CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#if USE_CUR_GM_REFMV
zeromv,
#endif // CONFIG_GLOBAL_MOTION && USE_CUR_GM_REFMV
#endif // USE_CUR_GM_REFMV
-1, mi_row, mi_col, mode_context);
/* Note: If global motion is enabled, then we want to set the ALL_ZERO flag
iff all of the MVs we could generate with NEARMV/NEARESTMV are equivalent
......
......@@ -139,9 +139,7 @@ typedef struct {
// the sizes that can be derived from the buf structure)
int width;
int height;
#if CONFIG_GLOBAL_MOTION
WarpedMotionParams global_motion[TOTAL_REFS_PER_FRAME];
#endif // CONFIG_GLOBAL_MOTION
aom_codec_frame_buffer_t raw_frame_buffer;
YV12_BUFFER_CONFIG buf;
#if CONFIG_HASH_ME
......@@ -472,9 +470,7 @@ typedef struct AV1Common {
// - this is intentionally not placed in FRAME_CONTEXT since it's reset upon
// each keyframe and not used afterwards
aom_prob kf_y_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1];
#if CONFIG_GLOBAL_MOTION
WarpedMotionParams global_motion[TOTAL_REFS_PER_FRAME];
#endif
BLOCK_SIZE sb_size; // Size of the superblock used for this frame
int mib_size; // Size of the superblock in units of MI blocks
......
......@@ -28,16 +28,13 @@
#include "av1/common/obmc.h"
#endif // CONFIG_MOTION_VAR
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
// This function will determine whether or not to create a warped
// prediction and return the appropriate motion model depending
// on the configuration. Behavior will change with different