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
diff --git a/aom_scale/generic/yv12config.c b/aom_scale/generic/yv12config.c index fce7192..9ec602a 100644 --- a/aom_scale/generic/yv12config.c +++ b/aom_scale/generic/yv12config.c
@@ -34,7 +34,7 @@ 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 @@ (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);
diff --git a/aom_scale/yv12config.h b/aom_scale/yv12config.h index 994b1b0..e8a7278 100644 --- a/aom_scale/yv12config.h +++ b/aom_scale/yv12config.h
@@ -86,7 +86,7 @@ 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;
diff --git a/av1/av1.cmake b/av1/av1.cmake index 287827e..35b6722 100644 --- a/av1/av1.cmake +++ b/av1/av1.cmake
@@ -333,26 +333,24 @@ "${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_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_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 @@ "${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)
diff --git a/av1/av1_common.mk b/av1/av1_common.mk index 95d5d13..be70a0c 100644 --- a/av1/av1_common.mk +++ b/av1/av1_common.mk
@@ -91,10 +91,8 @@ 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 @@ 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
diff --git a/av1/av1_cx.mk b/av1/av1_cx.mk index ec23aa3..6a9be69 100644 --- a/av1/av1_cx.mk +++ b/av1/av1_cx.mk
@@ -39,18 +39,18 @@ 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/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
diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl index d62d2b1..656ca27 100755 --- a/av1/common/av1_rtcd_defs.pl +++ b/av1/common/av1_rtcd_defs.pl
@@ -523,19 +523,15 @@ # 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/; }
diff --git a/av1/common/blockd.h b/av1/common/blockd.h index 0d8b108..1843179 100644 --- a/av1/common/blockd.h +++ b/av1/common/blockd.h
@@ -516,7 +516,6 @@ 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 @@ 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 @@ // 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 @@ #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 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 @@ 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 @@ } return 1; } -#endif // CONFIG_GLOBAL_MOTION static INLINE PLANE_TYPE get_plane_type(int plane) { return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
diff --git a/av1/common/mv.h b/av1/common/mv.h index 4d8b9f1..2cecdea 100644 --- a/av1/common/mv.h +++ b/av1/common/mv.h
@@ -37,7 +37,6 @@ 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 @@ #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 @@ 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 @@ else return AFFINE; } -#endif // CONFIG_GLOBAL_MOTION typedef struct candidate_mv { int_mv this_mv;
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c index e9814a7..330110f 100644 --- a/av1/common/mvref_common.c +++ b/av1/common/mvref_common.c
@@ -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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ // 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 @@ 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 @@ 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 @@ 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 @@ } 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
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h index 5d769c5..46c00d0 100644 --- a/av1/common/onyxc_int.h +++ b/av1/common/onyxc_int.h
@@ -139,9 +139,7 @@ // 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 @@ // - 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
diff --git a/av1/common/reconinter.c b/av1/common/reconinter.c index c1bc1cf..c5a78f8 100644 --- a/av1/common/reconinter.c +++ b/av1/common/reconinter.c
@@ -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 // combinations of GLOBAL_MOTION, WARPED_MOTION and MOTION_VAR. static INLINE int allow_warp(const MODE_INFO *const mi, const WarpTypesAllowed *const warp_types, -#if CONFIG_GLOBAL_MOTION const WarpedMotionParams *const gm_params, -#endif // CONFIG_GLOBAL_MOTION #if CONFIG_MOTION_VAR int build_for_obmc, #endif // CONFIG_MOTION_VAR @@ -50,24 +47,18 @@ #endif // Only global motion configured -#if CONFIG_GLOBAL_MOTION && !CONFIG_WARPED_MOTION && !CONFIG_MOTION_VAR +#if !CONFIG_WARPED_MOTION && !CONFIG_MOTION_VAR (void)mbmi; if (warp_types->global_warp_allowed) { memcpy(final_warp_params, gm_params, sizeof(*final_warp_params)); return 1; } -#endif // CONFIG_GLOBAL_MOTION && !CONFIG_WARPED_MOTION && !CONFIG_MOTION_VAR +#endif // !CONFIG_WARPED_MOTION && !CONFIG_MOTION_VAR // Only warped motion configured -#if CONFIG_WARPED_MOTION && !CONFIG_GLOBAL_MOTION && !CONFIG_MOTION_VAR - if (warp_types->local_warp_allowed) { - memcpy(final_warp_params, &mbmi->wm_params[0], sizeof(*final_warp_params)); - return 1; - } -#endif // CONFIG_WARPED_MOTION && !CONFIG_GLOBAL_MOTION && !CONFIG_MOTION_VAR // Warped and global motion configured -#if CONFIG_GLOBAL_MOTION && CONFIG_WARPED_MOTION && !CONFIG_MOTION_VAR +#if CONFIG_WARPED_MOTION && !CONFIG_MOTION_VAR // When both are enabled, warped will take priority. The global parameters // will only be used to compute projection samples to find the warped model. // Note that when a block chooses global, it will not be possible to @@ -79,10 +70,10 @@ memcpy(final_warp_params, gm_params, sizeof(*final_warp_params)); return 1; } -#endif // CONFIG_GLOBAL_MOTION && CONFIG_WARPED_MOTION && !CONFIG_MOTION_VAR +#endif // CONFIG_WARPED_MOTION && !CONFIG_MOTION_VAR // Motion var and global motion configured -#if CONFIG_GLOBAL_MOTION && CONFIG_MOTION_VAR && !CONFIG_WARPED_MOTION +#if CONFIG_MOTION_VAR && !CONFIG_WARPED_MOTION // We warp if either case is true: // 1.) We are predicting a block which uses global motion // 2.) We are predicting a neighboring block of a block using OBMC, @@ -94,26 +85,12 @@ memcpy(final_warp_params, gm_params, sizeof(*final_warp_params)); return 1; } -#endif // CONFIG_GLOBAL_MOTION && CONFIG_MOTION_VAR && !CONFIG_WARPED_MOTION +#endif // CONFIG_MOTION_VAR && !CONFIG_WARPED_MOTION // Motion var and warped motion configured -#if CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR && !CONFIG_GLOBAL_MOTION - // We warp if either case is true: - // 1.) We are predicting a block with motion mode WARPED_CAUSAL - // 2.) We are predicting a neighboring block of a block using OBMC, - // the neighboring block has mode WARPED_CAUSAL, and we have enabled - // WARP_WM_NEIGHBORS_WITH_OBMC - if (warp_types->local_warp_allowed) { - if ((build_for_obmc && WARP_WM_NEIGHBORS_WITH_OBMC) || (!build_for_obmc)) { - memcpy(final_warp_params, &mbmi->wm_params[0], - sizeof(*final_warp_params)); - return 1; - } - } -#endif // CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR && !CONFIG_GLOBAL_MOTION // Motion var, warped motion and global motion all configured -#if CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR && CONFIG_GLOBAL_MOTION +#if CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR if (warp_types->local_warp_allowed) { if ((build_for_obmc && WARP_WM_NEIGHBORS_WITH_OBMC) || (!build_for_obmc)) { memcpy(final_warp_params, &mbmi->wm_params[0], @@ -125,28 +102,22 @@ memcpy(final_warp_params, gm_params, sizeof(*final_warp_params)); return 1; } -#endif // CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR && CONFIG_GLOBAL_MOTION +#endif // CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR return 0; } -#endif // CONFIG_GLOBAL_MOTION ||CONFIG_WARPED_MOTION static INLINE void av1_make_inter_predictor( const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const int subpel_x, const int subpel_y, const struct scale_factors *sf, int w, int h, ConvolveParams *conv_params, InterpFilters interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION const WarpTypesAllowed *warp_types, int p_col, int p_row, int plane, int ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR const MODE_INFO *mi, int build_for_obmc, #endif int xs, int ys, const MACROBLOCKD *xd) { (void)xd; -#if !CONFIG_GLOBAL_MOTION && !CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR - (void)build_for_obmc; -#endif #if !CONFIG_MOTION_VAR const MODE_INFO *mi = xd->mi[0]; (void)mi; @@ -154,22 +125,17 @@ // Make sure the selected motion mode is valid for this configuration #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION - assert_motion_mode_valid(mi->mbmi.motion_mode, -#if CONFIG_GLOBAL_MOTION - 0, xd->global_motion, -#endif // CONFIG_GLOBAL_MOTION + assert_motion_mode_valid(mi->mbmi.motion_mode, 0, xd->global_motion, #if CONFIG_WARPED_MOTION xd, #endif mi); #endif // CONFIG MOTION_VAR || CONFIG_WARPED_MOTION -#if CONFIG_WARPED_MOTION || CONFIG_GLOBAL_MOTION WarpedMotionParams final_warp_params; const int do_warp = (w >= 8 && h >= 8 && allow_warp(mi, warp_types, -#if CONFIG_GLOBAL_MOTION #if CONFIG_COMPOUND_SINGLEREF // TODO(zoeliu): To further check the single // ref comp mode to work together with @@ -180,7 +146,6 @@ #else // !(CONFIG_COMPOUND_SINGLEREF) &xd->global_motion[mi->mbmi.ref_frame[ref]], #endif // CONFIG_COMPOUND_SINGLEREF -#endif // CONFIG_GLOBAL_MOTION #if CONFIG_MOTION_VAR build_for_obmc, #endif // CONFIG_MOTION_VAR @@ -201,7 +166,6 @@ pd->subsampling_x, pd->subsampling_y, xs, ys, conv_params); return; } -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_HIGHBITDEPTH if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { highbd_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, @@ -892,14 +856,8 @@ const uint8_t *pre, int pre_stride, uint8_t *dst, int dst_stride, const int subpel_x, const int subpel_y, const struct scale_factors *sf, int w, int h, ConvolveParams *conv_params, InterpFilters interp_filters, - int xs, int ys, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION || CONFIG_COMPOUND_SEGMENT - int plane, -#endif -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - const WarpTypesAllowed *warp_types, int p_col, int p_row, int ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - MACROBLOCKD *xd) { + int xs, int ys, int plane, const WarpTypesAllowed *warp_types, int p_col, + int p_row, int ref, MACROBLOCKD *xd) { const MODE_INFO *mi = xd->mi[0]; const INTERINTER_COMPOUND_DATA comp_data = { @@ -957,9 +915,7 @@ // This will generate a prediction in tmp_buf for the second reference av1_make_inter_predictor(pre, pre_stride, tmp_dst, MAX_SB_SIZE, subpel_x, subpel_y, sf, w, h, conv_params, interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION warp_types, p_col, p_row, plane, ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR mi, 0, #endif @@ -1036,11 +992,8 @@ void av1_highbd_build_inter_predictor( const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const MV *src_mv, const struct scale_factors *sf, int w, int h, int ref, - InterpFilters interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - const WarpTypesAllowed *warp_types, int p_col, int p_row, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - int plane, enum mv_precision precision, int x, int y, + InterpFilters interp_filters, const WarpTypesAllowed *warp_types, int p_col, + int p_row, int plane, enum mv_precision precision, int x, int y, const MACROBLOCKD *xd) { const int is_q4 = precision == MV_PRECISION_Q4; const MV mv_q4 = { is_q4 ? src_mv->row : src_mv->row * 2, @@ -1056,10 +1009,8 @@ (mv.col >> SCALE_SUBPEL_BITS); av1_make_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, - sf, w, h, &conv_params, interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - warp_types, p_col, p_row, plane, ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION + sf, w, h, &conv_params, interp_filters, warp_types, + p_col, p_row, plane, ref, #if CONFIG_MOTION_VAR xd->mi[0], 0, #endif @@ -1067,17 +1018,12 @@ } #endif // CONFIG_HIGHBITDEPTH -void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst, - int dst_stride, const MV *src_mv, - const struct scale_factors *sf, int w, int h, - ConvolveParams *conv_params, - InterpFilters interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - const WarpTypesAllowed *warp_types, int p_col, - int p_row, int plane, int ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - enum mv_precision precision, int x, int y, - const MACROBLOCKD *xd) { +void av1_build_inter_predictor( + const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, + const MV *src_mv, const struct scale_factors *sf, int w, int h, + ConvolveParams *conv_params, InterpFilters interp_filters, + const WarpTypesAllowed *warp_types, int p_col, int p_row, int plane, + int ref, enum mv_precision precision, int x, int y, const MACROBLOCKD *xd) { const int is_q4 = precision == MV_PRECISION_Q4; const MV mv_q4 = { is_q4 ? src_mv->row : src_mv->row * 2, is_q4 ? src_mv->col : src_mv->col * 2 }; @@ -1091,10 +1037,8 @@ (mv.col >> SCALE_SUBPEL_BITS); av1_make_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, - sf, w, h, conv_params, interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - warp_types, p_col, p_row, plane, ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION + sf, w, h, conv_params, interp_filters, warp_types, + p_col, p_row, plane, ref, #if CONFIG_MOTION_VAR xd->mi[0], 0, #endif @@ -1187,7 +1131,6 @@ const int is_intrabc = is_intrabc_block(&mi->mbmi); assert(IMPLIES(is_intrabc, !is_compound)); #endif // CONFIG_INTRABC -#if CONFIG_GLOBAL_MOTION int is_global[2] = { 0, 0 }; for (ref = 0; ref < 1 + is_compound; ++ref) { WarpedMotionParams *const wm = &xd->global_motion[mi->mbmi.ref_frame[ref]]; @@ -1196,7 +1139,6 @@ #if CONFIG_COMPOUND_SINGLEREF if (!is_compound && is_comp_mode_pred) is_global[1] = is_global[0]; #endif // CONFIG_COMPOUND_SINGLEREF -#endif // CONFIG_GLOBAL_MOTION (void)block; (void)cm; @@ -1298,16 +1240,12 @@ uint8_t *pre; int xs, ys, subpel_x, subpel_y; const int is_scaled = av1_is_scaled(sf); -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION WarpTypesAllowed warp_types; -#if CONFIG_GLOBAL_MOTION warp_types.global_warp_allowed = is_global[ref]; -#endif // CONFIG_GLOBAL_MOTION #if CONFIG_WARPED_MOTION warp_types.local_warp_allowed = this_mbmi->motion_mode == WARPED_CAUSAL; #endif // CONFIG_WARPED_MOTION -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION if (is_scaled) { int ssx = pd->subsampling_x; @@ -1358,22 +1296,14 @@ av1_make_masked_inter_predictor( pre, pre_buf->stride, dst, dst_buf->stride, subpel_x, subpel_y, sf, b4_w, b4_h, &conv_params, mi->mbmi.interp_filters, xs, ys, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION || CONFIG_COMPOUND_SEGMENT - plane, -#endif -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, (mi_x >> pd->subsampling_x) + x, - (mi_y >> pd->subsampling_y) + y, ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - xd); + plane, &warp_types, (mi_x >> pd->subsampling_x) + x, + (mi_y >> pd->subsampling_y) + y, ref, xd); else av1_make_inter_predictor( pre, pre_buf->stride, dst, dst_buf->stride, subpel_x, subpel_y, sf, b4_w, b4_h, &conv_params, this_mbmi->interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION &warp_types, (mi_x >> pd->subsampling_x) + x, (mi_y >> pd->subsampling_y) + y, plane, ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR mi, build_for_obmc, #endif // CONFIG_MOTION_VAR @@ -1514,15 +1444,11 @@ const struct scale_factors *const sf = &xd->block_refs[ref]->sf; struct buf_2d *const pre_buf = &pd->pre[ref]; #endif // CONFIG_INTRABC -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION WarpTypesAllowed warp_types; -#if CONFIG_GLOBAL_MOTION warp_types.global_warp_allowed = is_global[ref]; -#endif // CONFIG_GLOBAL_MOTION #if CONFIG_WARPED_MOTION warp_types.local_warp_allowed = mi->mbmi.motion_mode == WARPED_CAUSAL; #endif // CONFIG_WARPED_MOTION -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION conv_params.ref = ref; conv_params.do_average = ref; if (is_masked_compound_type(mi->mbmi.interinter_compound_type)) { @@ -1535,24 +1461,16 @@ pre[ref], pre_buf->stride, dst, dst_buf->stride, subpel_params[ref].subpel_x, subpel_params[ref].subpel_y, sf, w, h, &conv_params, mi->mbmi.interp_filters, subpel_params[ref].xs, - subpel_params[ref].ys, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION || CONFIG_COMPOUND_SEGMENT - plane, -#endif -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, (mi_x >> pd->subsampling_x) + x, - (mi_y >> pd->subsampling_y) + y, ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - xd); + subpel_params[ref].ys, plane, &warp_types, + (mi_x >> pd->subsampling_x) + x, (mi_y >> pd->subsampling_y) + y, + ref, xd); else av1_make_inter_predictor( pre[ref], pre_buf->stride, dst, dst_buf->stride, subpel_params[ref].subpel_x, subpel_params[ref].subpel_y, sf, w, h, - &conv_params, mi->mbmi.interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, (mi_x >> pd->subsampling_x) + x, - (mi_y >> pd->subsampling_y) + y, plane, ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION + &conv_params, mi->mbmi.interp_filters, &warp_types, + (mi_x >> pd->subsampling_x) + x, (mi_y >> pd->subsampling_y) + y, + plane, ref, #if CONFIG_MOTION_VAR mi, build_for_obmc, #endif // CONFIG_MOTION_VAR @@ -2864,9 +2782,7 @@ int xs, ys, subpel_x, subpel_y; const int is_scaled = av1_is_scaled(sf); ConvolveParams conv_params = get_conv_params(ref, 0, plane); -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION WarpTypesAllowed warp_types; -#if CONFIG_GLOBAL_MOTION #if CONFIG_COMPOUND_SINGLEREF WarpedMotionParams *const wm = mi->mbmi.ref_frame[ref] > 0 ? &xd->global_motion[mi->mbmi.ref_frame[ref]] @@ -2875,11 +2791,9 @@ WarpedMotionParams *const wm = &xd->global_motion[mi->mbmi.ref_frame[ref]]; #endif // CONFIG_COMPOUND_SINGLEREF warp_types.global_warp_allowed = is_global_mv_block(mi, block, wm->wmtype); -#endif // CONFIG_GLOBAL_MOTION #if CONFIG_WARPED_MOTION warp_types.local_warp_allowed = mi->mbmi.motion_mode == WARPED_CAUSAL; #endif // CONFIG_WARPED_MOTION -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION if (is_scaled) { int ssx = pd->subsampling_x; @@ -2919,11 +2833,9 @@ av1_make_inter_predictor(pre, pre_buf->stride, dst, ext_dst_stride, subpel_x, subpel_y, sf, w, h, &conv_params, - mi->mbmi.interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, (mi_x >> pd->subsampling_x) + x, + mi->mbmi.interp_filters, &warp_types, + (mi_x >> pd->subsampling_x) + x, (mi_y >> pd->subsampling_y) + y, plane, ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR mi, 0, #endif
diff --git a/av1/common/reconinter.h b/av1/common/reconinter.h index 094d42c..74cac24 100644 --- a/av1/common/reconinter.h +++ b/av1/common/reconinter.h
@@ -15,16 +15,14 @@ #include "av1/common/filter.h" #include "av1/common/onyxc_int.h" #include "av1/common/convolve.h" -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #include "av1/common/warped_motion.h" -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #include "aom/aom_integer.h" #if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION #define WARP_WM_NEIGHBORS_WITH_OBMC 0 #endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION -#if CONFIG_MOTION_VAR && CONFIG_GLOBAL_MOTION +#if CONFIG_MOTION_VAR #define WARP_GM_NEIGHBORS_WITH_OBMC 0 #endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION @@ -290,14 +288,8 @@ const uint8_t *pre, int pre_stride, uint8_t *dst, int dst_stride, const int subpel_x, const int subpel_y, const struct scale_factors *sf, int w, int h, ConvolveParams *conv_params, InterpFilters interp_filters, - int xs, int ys, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION || CONFIG_COMPOUND_SEGMENT - int plane, -#endif -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - const WarpTypesAllowed *warp_types, int p_col, int p_row, int ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - MACROBLOCKD *xd); + int xs, int ys, int plane, const WarpTypesAllowed *warp_types, int p_col, + int p_row, int ref, MACROBLOCKD *xd); static INLINE int round_mv_comp_q4(int value) { return (value < 0 ? value - 2 : value + 2) / 4; @@ -377,27 +369,19 @@ int mi_row, int mi_col, BUFFER_SET *ctx, BLOCK_SIZE bsize); -void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst, - int dst_stride, const MV *src_mv, - const struct scale_factors *sf, int w, int h, - ConvolveParams *conv_params, - InterpFilters interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - const WarpTypesAllowed *warp_types, int p_col, - int p_row, int plane, int ref, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - enum mv_precision precision, int x, int y, - const MACROBLOCKD *xd); +void av1_build_inter_predictor( + const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, + const MV *src_mv, const struct scale_factors *sf, int w, int h, + ConvolveParams *conv_params, InterpFilters interp_filters, + const WarpTypesAllowed *warp_types, int p_col, int p_row, int plane, + int ref, enum mv_precision precision, int x, int y, const MACROBLOCKD *xd); #if CONFIG_HIGHBITDEPTH void av1_highbd_build_inter_predictor( const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const MV *mv_q3, const struct scale_factors *sf, int w, int h, int do_avg, - InterpFilters interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - const WarpTypesAllowed *warp_types, int p_col, int p_row, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - int plane, enum mv_precision precision, int x, int y, + InterpFilters interp_filters, const WarpTypesAllowed *warp_types, int p_col, + int p_row, int plane, enum mv_precision precision, int x, int y, const MACROBLOCKD *xd); #endif @@ -477,9 +461,7 @@ const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; if (mbmi->motion_mode == WARPED_CAUSAL) return 0; #endif // CONFIG_WARPED_MOTION -#if CONFIG_GLOBAL_MOTION if (is_nontrans_global_motion(xd)) return 0; -#endif // CONFIG_GLOBAL_MOTION return 1; }
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index 4d762a8..01776f9 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c
@@ -66,9 +66,7 @@ #include "av1/decoder/dsubexp.h" #include "av1/decoder/symbolrate.h" -#if CONFIG_WARPED_MOTION || CONFIG_GLOBAL_MOTION #include "av1/common/warped_motion.h" -#endif // CONFIG_WARPED_MOTION || CONFIG_GLOBAL_MOTION #define MAX_AV1_HEADER_SIZE 80 #define ACCT_STR __func__ @@ -2787,7 +2785,6 @@ } #endif // CONFIG_VAR_REFS -#if CONFIG_GLOBAL_MOTION static int read_global_motion_params(WarpedMotionParams *params, const WarpedMotionParams *ref_params, struct aom_read_bit_buffer *rb, @@ -2904,7 +2901,6 @@ memcpy(cm->cur_frame->global_motion, cm->global_motion, TOTAL_REFS_PER_FRAME * sizeof(WarpedMotionParams)); } -#endif // CONFIG_GLOBAL_MOTION static size_t read_uncompressed_header(AV1Decoder *pbi, struct aom_read_bit_buffer *rb) { @@ -3481,9 +3477,7 @@ (cm->last_frame_type != KEY_FRAME); #endif // CONFIG_TEMPMV_SIGNALING -#if CONFIG_GLOBAL_MOTION if (!frame_is_intra_only(cm)) read_global_motion(cm, rb); -#endif read_tile_info(pbi, rb); if (use_compressed_header(cm)) { @@ -3756,14 +3750,12 @@ bitstream_queue_set_frame_read(cm->current_video_frame * 2 + cm->show_frame); #endif -#if CONFIG_GLOBAL_MOTION int i; for (i = LAST_FRAME; i <= ALTREF_FRAME; ++i) { cm->global_motion[i] = default_warp_params; cm->cur_frame->global_motion[i] = default_warp_params; } xd->global_motion = cm->global_motion; -#endif // CONFIG_GLOBAL_MOTION first_partition_size = read_uncompressed_header( pbi, init_read_bit_buffer(pbi, &rb, data, data_end, clear_data));
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c index 3f298bc..dc0c291 100644 --- a/av1/decoder/decodemv.c +++ b/av1/decoder/decodemv.c
@@ -289,14 +289,12 @@ (void)cm; #endif - const MOTION_MODE last_motion_mode_allowed = motion_mode_allowed( -#if CONFIG_GLOBAL_MOTION - 0, xd->global_motion, -#endif // CONFIG_GLOBAL_MOTION + const MOTION_MODE last_motion_mode_allowed = + motion_mode_allowed(0, xd->global_motion, #if CONFIG_WARPED_MOTION - xd, + xd, #endif - mi); + mi); int motion_mode; FRAME_COUNTS *counts = xd->counts; @@ -1896,7 +1894,6 @@ break; } case ZEROMV: { -#if CONFIG_GLOBAL_MOTION mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, block @@ -1916,10 +1913,6 @@ #endif ) .as_int; -#else - mv[0].as_int = 0; - if (is_compound) mv[1].as_int = 0; -#endif // CONFIG_GLOBAL_MOTION pred_mv[0].as_int = mv[0].as_int; if (is_compound) pred_mv[1].as_int = mv[1].as_int; @@ -1965,14 +1958,10 @@ } case SR_ZERO_NEWMV: { assert(!is_compound); -#if CONFIG_GLOBAL_MOTION mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, block) .as_int; -#else - mv[0].as_int = 0; -#endif // CONFIG_GLOBAL_MOTION FRAME_COUNTS *counts = xd->counts; int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame); @@ -2090,7 +2079,6 @@ } case ZERO_ZEROMV: { assert(is_compound); -#if CONFIG_GLOBAL_MOTION mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, block @@ -2109,10 +2097,6 @@ #endif ) .as_int; -#else - mv[0].as_int = 0; - mv[1].as_int = 0; -#endif // CONFIG_GLOBAL_MOTION break; } default: { return 0; } @@ -2285,7 +2269,6 @@ MV_REFERENCE_FRAME rf[2]; int_mv zeromv[2]; av1_set_ref_frame(rf, ref_frame); -#if CONFIG_GLOBAL_MOTION zeromv[0].as_int = gm_get_motion_vector(&cm->global_motion[rf[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, 0 @@ -2307,9 +2290,6 @@ ) .as_int : 0; -#else - zeromv[0].as_int = zeromv[1].as_int = 0; -#endif for (ref = 0; ref < 2; ++ref) { if (rf[ref] == NONE_FRAME) continue; #if CONFIG_AMVR @@ -2463,10 +2443,6 @@ nearmv[0] = cur_mv; } -#if !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION && !CONFIG_GLOBAL_MOTION - read_mb_interp_filter(cm, xd, mbmi, r); -#endif // !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION - int_mv ref_mv[2]; ref_mv[0] = nearestmv[0]; ref_mv[1] = nearestmv[1]; @@ -2672,9 +2648,7 @@ xd->counts->compound_interinter[bsize][mbmi->interinter_compound_type]++; } -#if CONFIG_DUAL_FILTER || CONFIG_WARPED_MOTION || CONFIG_GLOBAL_MOTION read_mb_interp_filter(cm, xd, mbmi, r); -#endif // CONFIG_DUAL_FILTER || CONFIG_WARPED_MOTION #if CONFIG_WARPED_MOTION if (mbmi->motion_mode == WARPED_CAUSAL) {
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index 29458b2..6fc5d55 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c
@@ -409,20 +409,12 @@ const MODE_INFO *mi, aom_writer *w) { const MB_MODE_INFO *mbmi = &mi->mbmi; -#if !CONFIG_GLOBAL_MOTION - // The cm parameter is only used with global_motion or with - // motion_var and warped_motion. In other cases, explicitly ignore - // it to avoid a compiler warning. - (void)cm; -#endif - MOTION_MODE last_motion_mode_allowed = motion_mode_allowed( -#if CONFIG_GLOBAL_MOTION - 0, cm->global_motion, -#endif // CONFIG_GLOBAL_MOTION + MOTION_MODE last_motion_mode_allowed = + motion_mode_allowed(0, cm->global_motion, #if CONFIG_WARPED_MOTION - xd, + xd, #endif - mi); + mi); if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return; #if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION #if CONFIG_NCOBMC_ADAPT_WEIGHT @@ -1668,10 +1660,6 @@ assert(mbmi->ref_mv_idx == 0); } -#if !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION && !CONFIG_GLOBAL_MOTION - write_mb_interp_filter(cpi, xd, w); -#endif // !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION - if (mode == NEWMV || mode == NEW_NEWMV) { int_mv ref_mv; for (ref = 0; ref < 1 + is_compound; ++ref) { @@ -1799,9 +1787,7 @@ #endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE } -#if CONFIG_DUAL_FILTER || CONFIG_WARPED_MOTION || CONFIG_GLOBAL_MOTION write_mb_interp_filter(cpi, xd, w); -#endif // CONFIG_DUAL_FILTE || CONFIG_WARPED_MOTION } #if !CONFIG_TXK_SEL @@ -3099,13 +3085,13 @@ // Only one filter is used. So set the filter at frame level for (i = 0; i < SWITCHABLE_FILTERS; ++i) { if (count[i]) { -#if CONFIG_MOTION_VAR && (CONFIG_WARPED_MOTION || CONFIG_GLOBAL_MOTION) +#if CONFIG_MOTION_VAR #if CONFIG_WARPED_MOTION if (i == EIGHTTAP_REGULAR || WARP_WM_NEIGHBORS_WITH_OBMC) #else if (i == EIGHTTAP_REGULAR || WARP_GM_NEIGHBORS_WITH_OBMC) #endif // CONFIG_WARPED_MOTION -#endif // CONFIG_MOTION_VAR && (CONFIG_WARPED_MOTION || CONFIG_GLOBAL_MOTION) +#endif // CONFIG_MOTION_VAR cm->interp_filter = i; break; } @@ -3851,7 +3837,6 @@ #endif // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT } -#if CONFIG_GLOBAL_MOTION static void write_global_motion_params(const WarpedMotionParams *params, const WarpedMotionParams *ref_params, struct aom_write_bit_buffer *wb, @@ -3949,7 +3934,6 @@ */ } } -#endif #if !CONFIG_OBU static void write_uncompressed_header_frame(AV1_COMP *cpi, @@ -4239,9 +4223,7 @@ aom_wb_write_bit(wb, cm->use_adapt_scan); #endif -#if CONFIG_GLOBAL_MOTION if (!frame_is_intra_only(cm)) write_global_motion(cpi, wb); -#endif // CONFIG_GLOBAL_MOTION write_tile_info(cm, wb); } @@ -4572,9 +4554,7 @@ aom_wb_write_bit(wb, cm->reduced_tx_set_used); #endif // CONFIG_EXT_TX -#if CONFIG_GLOBAL_MOTION if (!frame_is_intra_only(cm)) write_global_motion(cpi, wb); -#endif // CONFIG_GLOBAL_MOTION write_tile_info(cm, wb); }
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c index 2978ee8..b0d43f5 100644 --- a/av1/encoder/encodeframe.c +++ b/av1/encoder/encodeframe.c
@@ -39,12 +39,8 @@ #include "av1/encoder/aq_complexity.h" #include "av1/encoder/aq_cyclicrefresh.h" #include "av1/encoder/aq_variance.h" -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #include "av1/common/warped_motion.h" -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION -#if CONFIG_GLOBAL_MOTION #include "av1/encoder/global_motion.h" -#endif // CONFIG_GLOBAL_MOTION #include "av1/encoder/encodeframe.h" #include "av1/encoder/encodemb.h" #include "av1/encoder/encodemv.h" @@ -338,7 +334,6 @@ } } #endif -#if CONFIG_GLOBAL_MOTION static void update_global_motion_used(PREDICTION_MODE mode, BLOCK_SIZE bsize, const MB_MODE_INFO *mbmi, RD_COUNTS *rdc) { @@ -351,7 +346,6 @@ } } } -#endif // CONFIG_GLOBAL_MOTION static void reset_tx_size(MACROBLOCKD *xd, MB_MODE_INFO *mbmi, const TX_MODE tx_mode) { @@ -546,7 +540,6 @@ if (!frame_is_intra_only(cm)) { if (is_inter_block(mbmi)) { av1_update_mv_count(td); -#if CONFIG_GLOBAL_MOTION if (bsize >= BLOCK_8X8) { // TODO(sarahparker): global motion stats need to be handled per-tile // to be compatible with tile-based threading. @@ -562,15 +555,11 @@ } } } -#endif // CONFIG_GLOBAL_MOTION if (cm->interp_filter == SWITCHABLE #if CONFIG_WARPED_MOTION && mbmi->motion_mode != WARPED_CAUSAL #endif // CONFIG_WARPED_MOTION -#if CONFIG_GLOBAL_MOTION - && !is_nontrans_global_motion(xd) -#endif // CONFIG_GLOBAL_MOTION - ) { + && !is_nontrans_global_motion(xd)) { #if CONFIG_DUAL_FILTER update_filter_type_count(td->counts, xd, mbmi); #else @@ -1204,14 +1193,12 @@ #if CONFIG_WARPED_MOTION set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]); #endif - const MOTION_MODE motion_allowed = motion_mode_allowed( -#if CONFIG_GLOBAL_MOTION - 0, xd->global_motion, -#endif // CONFIG_GLOBAL_MOTION + const MOTION_MODE motion_allowed = + motion_mode_allowed(0, xd->global_motion, #if CONFIG_WARPED_MOTION - xd, + xd, #endif - mi); + mi); if (mbmi->ref_frame[1] != INTRA_FRAME) #if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION { @@ -1474,14 +1461,11 @@ #endif #if CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT) - const MOTION_MODE motion_allowed = motion_mode_allowed( -#if CONFIG_GLOBAL_MOTION - 0, xd->global_motion, -#endif // CONFIG_GLOBAL_MOTION + const MOTION_MODE motion_allowed = motion_mode_allowed(0, xd->global_motion, #if CONFIG_WARPED_MOTION - xd, + xd, #endif - xd->mi[0]); + xd->mi[0]); #endif // CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT) #if CONFIG_MOTION_VAR && CONFIG_NCOBMC @@ -3595,7 +3579,6 @@ } #endif -#if CONFIG_GLOBAL_MOTION #define GLOBAL_TRANS_TYPES_ENC 3 // highest motion model to search static int gm_get_params_cost(const WarpedMotionParams *gm, const WarpedMotionParams *ref_gm, int allow_hp) { @@ -3660,7 +3643,6 @@ } return 1; } -#endif // CONFIG_GLOBAL_MOTION // Estimate if the source frame is screen content, based on the portion of // blocks that have no more than 4 (experimentally selected) luma colors. @@ -3799,7 +3781,6 @@ alloc_ncobmc_pred_buffer(xd); #endif -#if CONFIG_GLOBAL_MOTION av1_zero(rdc->global_motion_used); av1_zero(cpi->gmparams_cost); if (cpi->common.frame_type == INTER_FRAME && cpi->source && @@ -3924,7 +3905,6 @@ } memcpy(cm->cur_frame->global_motion, cm->global_motion, TOTAL_REFS_PER_FRAME * sizeof(WarpedMotionParams)); -#endif // CONFIG_GLOBAL_MOTION for (i = 0; i < MAX_SEGMENTS; ++i) { const int qindex = cm->seg.enabled
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c index 691d479..1d30a88 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c
@@ -2461,9 +2461,7 @@ cpi->oxcf = *oxcf; x->e_mbd.bd = (int)cm->bit_depth; -#if CONFIG_GLOBAL_MOTION x->e_mbd.global_motion = cm->global_motion; -#endif // CONFIG_GLOBAL_MOTION if ((oxcf->pass == 0) && (oxcf->rc_mode == AOM_Q)) { rc->baseline_gf_interval = FIXED_GF_INTERVAL; @@ -3496,7 +3494,6 @@ } #endif // OUTPUT_YUV_REC -#if CONFIG_GLOBAL_MOTION #define GM_RECODE_LOOP_NUM4X4_FACTOR 192 static int recode_loop_test_global_motion(AV1_COMP *cpi) { int i; @@ -3516,7 +3513,6 @@ } return recode; } -#endif // CONFIG_GLOBAL_MOTION // Function to test for conditions that indicate we should loop // back and recode a frame. @@ -4113,13 +4109,11 @@ } static void set_size_independent_vars(AV1_COMP *cpi) { -#if CONFIG_GLOBAL_MOTION int i; for (i = LAST_FRAME; i <= ALTREF_FRAME; ++i) { cpi->common.global_motion[i] = default_warp_params; } cpi->global_motion_search_done = 0; -#endif // CONFIG_GLOBAL_MOTION av1_set_speed_features_framesize_independent(cpi); av1_set_rd_speed_thresholds(cpi); av1_set_rd_speed_thresholds_sub8x8(cpi); @@ -4711,7 +4705,7 @@ if (cpi->unscaled_last_source != NULL) cpi->last_source = av1_scale_if_required(cm, cpi->unscaled_last_source, &cpi->scaled_last_source); -#if CONFIG_HIGHBITDEPTH && CONFIG_GLOBAL_MOTION +#if CONFIG_HIGHBITDEPTH cpi->source->buf_8bit_valid = 0; #endif @@ -4767,7 +4761,7 @@ set_size_independent_vars(cpi); -#if CONFIG_HIGHBITDEPTH && CONFIG_GLOBAL_MOTION +#if CONFIG_HIGHBITDEPTH cpi->source->buf_8bit_valid = 0; #endif @@ -4801,13 +4795,11 @@ &frame_over_shoot_limit); } -#if CONFIG_GLOBAL_MOTION // if frame was scaled calculate global_motion_search again if already done if (loop_count > 0 && cpi->source && cpi->global_motion_search_done) if (cpi->source->y_crop_width != cm->width || cpi->source->y_crop_height != cm->height) cpi->global_motion_search_done = 0; -#endif // CONFIG_GLOBAL_MOTION cpi->source = av1_scale_if_required(cm, cpi->unscaled_source, &cpi->scaled_source); if (cpi->unscaled_last_source != NULL) @@ -5015,11 +5007,9 @@ rc->projected_frame_size < rc->max_frame_bandwidth) loop = 0; -#if CONFIG_GLOBAL_MOTION if (recode_loop_test_global_motion(cpi)) { loop = 1; } -#endif // CONFIG_GLOBAL_MOTION if (loop) { ++loop_count; @@ -6452,7 +6442,7 @@ if (cm->new_fb_idx == INVALID_IDX) return -1; cm->cur_frame = &pool->frame_bufs[cm->new_fb_idx]; -#if CONFIG_HIGHBITDEPTH && CONFIG_GLOBAL_MOTION +#if CONFIG_HIGHBITDEPTH cm->cur_frame->buf.buf_8bit_valid = 0; #endif
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h index 01f1b9d..b79eaad 100644 --- a/av1/encoder/encoder.h +++ b/av1/encoder/encoder.h
@@ -324,10 +324,8 @@ typedef struct RD_COUNTS { int64_t comp_pred_diff[REFERENCE_MODES]; -#if CONFIG_GLOBAL_MOTION // Stores number of 4x4 blocks using global motion per reference frame. int global_motion_used[TOTAL_REFS_PER_FRAME]; -#endif // CONFIG_GLOBAL_MOTION int single_ref_used_flag; int compound_ref_used_flag; } RD_COUNTS; @@ -444,10 +442,8 @@ CODING_CONTEXT coding_context; -#if CONFIG_GLOBAL_MOTION int gmtype_cost[TRANS_TYPES]; int gmparams_cost[TOTAL_REFS_PER_FRAME]; -#endif // CONFIG_GLOBAL_MOTION int nmv_costs[NMV_CONTEXTS][2][MV_VALS]; int nmv_costs_hp[NMV_CONTEXTS][2][MV_VALS]; @@ -588,9 +584,7 @@ int arf_map[MAX_EXT_ARFS + 1]; int arf_pos_in_gf[MAX_EXT_ARFS + 1]; int arf_pos_for_ovrly[MAX_EXT_ARFS + 1]; -#if CONFIG_GLOBAL_MOTION int global_motion_search_done; -#endif #if CONFIG_LV_MAP tran_low_t *tcoeff_buf[MAX_MB_PLANE]; #endif
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c index cb33ec1..253deb0 100644 --- a/av1/encoder/ethread.c +++ b/av1/encoder/ethread.c
@@ -18,11 +18,9 @@ for (int i = 0; i < REFERENCE_MODES; i++) td->rd_counts.comp_pred_diff[i] += td_t->rd_counts.comp_pred_diff[i]; -#if CONFIG_GLOBAL_MOTION for (int i = 0; i < TOTAL_REFS_PER_FRAME; i++) td->rd_counts.global_motion_used[i] += td_t->rd_counts.global_motion_used[i]; -#endif // CONFIG_GLOBAL_MOTION td->rd_counts.compound_ref_used_flag |= td_t->rd_counts.compound_ref_used_flag;
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c index 5ecd86a..607745d 100644 --- a/av1/encoder/rd.c +++ b/av1/encoder/rd.c
@@ -744,7 +744,6 @@ } #endif -#if CONFIG_GLOBAL_MOTION if (cpi->oxcf.pass != 1) { for (int i = 0; i < TRANS_TYPES; ++i) #if GLOBAL_TRANS_TYPES > 4 @@ -759,7 +758,6 @@ << AV1_PROB_COST_SHIFT; #endif // GLOBAL_TRANS_TYPES > 4 } -#endif // CONFIG_GLOBAL_MOTION } static void model_rd_norm(int xsq_q10, int *r_q10, int *d_q10) {
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index 3f3169d..76fc5fa 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c
@@ -5735,13 +5735,10 @@ const MV_REFERENCE_FRAME ref_frames[2], const BLOCK_SIZE bsize, int block, int mi_row, int mi_col) { int_mv zeromv[2] = { {.as_int = 0 } }; -#if CONFIG_GLOBAL_MOTION int comp_pred_mode = ref_frames[1] > INTRA_FRAME; -#endif (void)mi_row; (void)mi_col; (void)cpi; -#if CONFIG_GLOBAL_MOTION if (this_mode == ZEROMV || this_mode == ZERO_ZEROMV) { for (int cur_frm = 0; cur_frm < 1 + comp_pred_mode; cur_frm++) { zeromv[cur_frm].as_int = @@ -5756,7 +5753,6 @@ .as_int; } } -#endif // CONFIG_GLOBAL_MOTION if ((this_mode == NEARMV || this_mode == NEARESTMV || this_mode == ZEROMV) && frame_mv[this_mode][ref_frames[0]].as_int == zeromv[0].as_int && @@ -5892,14 +5888,12 @@ int_mv ref_mv[2]; int ite, ref; struct scale_factors sf; -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION // ic and ir are the 4x4 coordinates of the sub8x8 at index "block" const int ic = block & 1; const int ir = (block - ic) >> 1; struct macroblockd_plane *const pd = &xd->plane[0]; const int p_col = ((mi_col * MI_SIZE) >> pd->subsampling_x) + 4 * ic; const int p_row = ((mi_row * MI_SIZE) >> pd->subsampling_y) + 4 * ir; -#if CONFIG_GLOBAL_MOTION int is_global[2]; #if CONFIG_COMPOUND_SINGLEREF for (ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) @@ -5914,10 +5908,6 @@ #if CONFIG_COMPOUND_SINGLEREF if (!has_second_ref(mbmi)) is_global[1] = is_global[0]; #endif // CONFIG_COMPOUND_SINGLEREF -#endif // CONFIG_GLOBAL_MOTION -#else // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - (void)block; -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION // Do joint motion search in compound mode to get more accurate mv. struct buf_2d backup_yv12[2][MAX_MB_PLANE]; @@ -6016,15 +6006,11 @@ conv_params.fwd_offset = -1; conv_params.bck_offset = -1; #endif -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION WarpTypesAllowed warp_types; -#if CONFIG_GLOBAL_MOTION warp_types.global_warp_allowed = is_global[!id]; -#endif // CONFIG_GLOBAL_MOTION #if CONFIG_WARPED_MOTION warp_types.local_warp_allowed = mbmi->motion_mode == WARPED_CAUSAL; #endif // CONFIG_WARPED_MOTION -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION // Initialized here because of compiler problem in Visual Studio. ref_yv12[0] = xd->plane[plane].pre[0]; @@ -6055,10 +6041,8 @@ #else &sf, pw, ph, 0, mbmi->interp_filters, #endif // CONFIG_JNT_COMP -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, p_col, p_row, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - plane, MV_PRECISION_Q3, mi_col * MI_SIZE, mi_row * MI_SIZE, xd); + &warp_types, p_col, p_row, plane, MV_PRECISION_Q3, mi_col * MI_SIZE, + mi_row * MI_SIZE, xd); } else { second_pred = (uint8_t *)second_pred_alloc_16; #endif // CONFIG_HIGHBITDEPTH @@ -6074,10 +6058,8 @@ #else &sf, pw, ph, &conv_params, mbmi->interp_filters, #endif // CONFIG_JNT_COMP -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, p_col, p_row, plane, !id, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - MV_PRECISION_Q3, mi_col * MI_SIZE, mi_row * MI_SIZE, xd); + &warp_types, p_col, p_row, plane, !id, MV_PRECISION_Q3, + mi_col * MI_SIZE, mi_row * MI_SIZE, xd); #if CONFIG_HIGHBITDEPTH } #endif // CONFIG_HIGHBITDEPTH @@ -6748,20 +6730,14 @@ const int other_ref = mbmi->ref_frame[!ref_idx]; #endif // CONFIG_COMPOUND_SINGLEREF struct scale_factors sf; -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION struct macroblockd_plane *const pd = &xd->plane[0]; // ic and ir are the 4x4 coordinates of the sub8x8 at index "block" const int ic = block & 1; const int ir = (block - ic) >> 1; const int p_col = ((mi_col * MI_SIZE) >> pd->subsampling_x) + 4 * ic; const int p_row = ((mi_row * MI_SIZE) >> pd->subsampling_y) + 4 * ir; -#if CONFIG_GLOBAL_MOTION WarpedMotionParams *const wm = &xd->global_motion[other_ref]; int is_global = is_global_mv_block(xd->mi[0], block, wm->wmtype); -#endif // CONFIG_GLOBAL_MOTION -#else - (void)block; -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION // This function should only ever be called for compound modes #if CONFIG_COMPOUND_SINGLEREF @@ -6798,15 +6774,11 @@ const int plane = 0; ConvolveParams conv_params = get_conv_params(!ref_idx, 0, plane); -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION WarpTypesAllowed warp_types; -#if CONFIG_GLOBAL_MOTION warp_types.global_warp_allowed = is_global; -#endif // CONFIG_GLOBAL_MOTION #if CONFIG_WARPED_MOTION warp_types.local_warp_allowed = mbmi->motion_mode == WARPED_CAUSAL; #endif // CONFIG_WARPED_MOTION -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION // Initialized here because of compiler problem in Visual Studio. ref_yv12 = xd->plane[plane].pre[!ref_idx]; @@ -6816,20 +6788,14 @@ if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { av1_highbd_build_inter_predictor( ref_yv12.buf, ref_yv12.stride, second_pred, pw, other_mv, &sf, pw, ph, - 0, mbmi->interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, p_col, p_row, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - plane, MV_PRECISION_Q3, mi_col * MI_SIZE, mi_row * MI_SIZE, xd); + 0, mbmi->interp_filters, &warp_types, p_col, p_row, plane, + MV_PRECISION_Q3, mi_col * MI_SIZE, mi_row * MI_SIZE, xd); } else { #endif // CONFIG_HIGHBITDEPTH av1_build_inter_predictor( ref_yv12.buf, ref_yv12.stride, second_pred, pw, other_mv, &sf, pw, ph, - &conv_params, mbmi->interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, p_col, p_row, plane, !ref_idx, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - MV_PRECISION_Q3, mi_col * MI_SIZE, mi_row * MI_SIZE, xd); + &conv_params, mbmi->interp_filters, &warp_types, p_col, p_row, plane, + !ref_idx, MV_PRECISION_Q3, mi_col * MI_SIZE, mi_row * MI_SIZE, xd); #if CONFIG_HIGHBITDEPTH } #endif // CONFIG_HIGHBITDEPTH @@ -8003,14 +7969,11 @@ #endif // CONFIG_WARPED_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION rate2_nocoeff = rd_stats->rate; - last_motion_mode_allowed = motion_mode_allowed( -#if CONFIG_GLOBAL_MOTION - 0, xd->global_motion, -#endif // CONFIG_GLOBAL_MOTION + last_motion_mode_allowed = motion_mode_allowed(0, xd->global_motion, #if CONFIG_WARPED_MOTION - xd, + xd, #endif - mi); + mi); base_mbmi = *mbmi; #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION @@ -8279,7 +8242,6 @@ rd_stats->skip = 1; } -#if CONFIG_GLOBAL_MOTION if (this_mode == ZEROMV || this_mode == ZERO_ZEROMV) { if (is_nontrans_global_motion(xd)) { rd_stats->rate -= rs; @@ -8287,7 +8249,6 @@ av1_unswitchable_filter(cm->interp_filter)); } } -#endif // CONFIG_GLOBAL_MOTION #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION tmp_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); @@ -9563,7 +9524,6 @@ frame_mv[NEARESTMV], frame_mv[NEARMV], yv12_mb); } frame_mv[NEWMV][ref_frame].as_int = INVALID_MV; -#if CONFIG_GLOBAL_MOTION frame_mv[ZEROMV][ref_frame].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame], cm->allow_high_precision_mv, bsize, mi_col, mi_row, @@ -9574,15 +9534,11 @@ #endif ) .as_int; -#else // CONFIG_GLOBAL_MOTION - frame_mv[ZEROMV][ref_frame].as_int = 0; -#endif // CONFIG_GLOBAL_MOTION frame_mv[NEW_NEWMV][ref_frame].as_int = INVALID_MV; #if CONFIG_COMPOUND_SINGLEREF frame_mv[SR_NEW_NEWMV][ref_frame].as_int = INVALID_MV; frame_comp_mv[SR_NEW_NEWMV][ref_frame].as_int = INVALID_MV; #endif // CONFIG_COMPOUND_SINGLEREF -#if CONFIG_GLOBAL_MOTION frame_mv[ZERO_ZEROMV][ref_frame].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame], cm->allow_high_precision_mv, bsize, mi_col, mi_row, @@ -9593,9 +9549,6 @@ #endif ) .as_int; -#else // CONFIG_GLOBAL_MOTION - frame_mv[ZERO_ZEROMV][ref_frame].as_int = 0; -#endif // CONFIG_GLOBAL_MOTION } for (; ref_frame < MODE_CTX_REF_FRAMES; ++ref_frame) { @@ -9681,7 +9634,6 @@ // TODO(zoeliu): To further explore whether following needs to be done for // BWDREF_FRAME as well. mode_skip_mask[ALTREF_FRAME] = ~INTER_NEAREST_NEAR_ZERO; -#if CONFIG_GLOBAL_MOTION zeromv.as_int = gm_get_motion_vector(&cm->global_motion[ALTREF_FRAME], cm->allow_high_precision_mv, bsize, mi_col, mi_row, 0 @@ -9691,9 +9643,6 @@ #endif ) .as_int; -#else - zeromv.as_int = 0; -#endif // CONFIG_GLOBAL_MOTION if (frame_mv[NEARMV][ALTREF_FRAME].as_int != zeromv.as_int) mode_skip_mask[ALTREF_FRAME] |= (1 << NEARMV); if (frame_mv[NEARESTMV][ALTREF_FRAME].as_int != zeromv.as_int) @@ -9948,13 +9897,9 @@ if (conditional_skipintra(this_mode, best_intra_mode)) continue; } } -#if CONFIG_GLOBAL_MOTION } else if (cm->global_motion[ref_frame].wmtype == IDENTITY && (!comp_pred || cm->global_motion[second_ref_frame].wmtype == IDENTITY)) { -#else // CONFIG_GLOBAL_MOTION - } else { -#endif // CONFIG_GLOBAL_MOTION const MV_REFERENCE_FRAME ref_frames[2] = { ref_frame, second_ref_frame }; if (!check_best_zero_mv(cpi, x, mbmi_ext->mode_context, mbmi_ext->compound_mode_context, frame_mv, @@ -11011,7 +10956,6 @@ int comp_pred_mode = refs[1] > INTRA_FRAME; int_mv zeromv[2]; const uint8_t rf_type = av1_ref_frame_type(best_mbmode.ref_frame); -#if CONFIG_GLOBAL_MOTION zeromv[0].as_int = gm_get_motion_vector(&cm->global_motion[refs[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, 0 @@ -11032,10 +10976,6 @@ ) .as_int : 0; -#else - zeromv[0].as_int = 0; - zeromv[1].as_int = 0; -#endif // CONFIG_GLOBAL_MOTION if (!comp_pred_mode) { int ref_set = (mbmi_ext->ref_mv_count[rf_type] >= 2) ? AOMMIN(2, mbmi_ext->ref_mv_count[rf_type] - 2) @@ -11121,7 +11061,6 @@ int16_t mode_ctx = mbmi_ext->mode_context[ref_frame_type]; if (mode_ctx & (1 << ALL_ZERO_FLAG_OFFSET)) { int_mv zeromv; -#if CONFIG_GLOBAL_MOTION const MV_REFERENCE_FRAME ref = best_mbmode.ref_frame[0]; zeromv.as_int = gm_get_motion_vector(&cm->global_motion[ref], cm->allow_high_precision_mv, bsize, @@ -11132,9 +11071,6 @@ #endif ) .as_int; -#else - zeromv.as_int = 0; -#endif // CONFIG_GLOBAL_MOTION if (best_mbmode.mv[0].as_int == zeromv.as_int) { best_mbmode.mode = ZEROMV; } @@ -11166,9 +11102,8 @@ *mbmi = best_mbmode; x->skip |= best_skip2; -// Note: this section is needed since the mode may have been forced to -// ZEROMV by the all-zero mode handling of ref-mv. -#if CONFIG_GLOBAL_MOTION + // Note: this section is needed since the mode may have been forced to + // ZEROMV by the all-zero mode handling of ref-mv. if (mbmi->mode == ZEROMV || mbmi->mode == ZERO_ZEROMV) { #if CONFIG_WARPED_MOTION || CONFIG_MOTION_VAR // Correct the motion mode for ZEROMV @@ -11188,7 +11123,6 @@ av1_unswitchable_filter(cm->interp_filter)); } } -#endif // CONFIG_GLOBAL_MOTION for (i = 0; i < 1 + has_second_ref(mbmi); ++i) { if (mbmi->mode != NEWMV) @@ -11270,7 +11204,6 @@ else mbmi->ref_frame[0] = LAST_FRAME; mbmi->ref_frame[1] = NONE_FRAME; -#if CONFIG_GLOBAL_MOTION mbmi->mv[0].as_int = gm_get_motion_vector(&cm->global_motion[mbmi->ref_frame[0]], cm->allow_high_precision_mv, bsize, mi_col, mi_row, 0 @@ -11280,9 +11213,6 @@ #endif ) .as_int; -#else // CONFIG_GLOBAL_MOTION - mbmi->mv[0].as_int = 0; -#endif // CONFIG_GLOBAL_MOTION mbmi->tx_size = max_txsize_lookup[bsize]; x->skip = 1; @@ -11731,14 +11661,11 @@ MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; BLOCK_SIZE bsize = mbmi->sb_type; #if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_WARPED_MOTION - const MOTION_MODE motion_allowed = motion_mode_allowed( -#if CONFIG_GLOBAL_MOTION - 0, xd->global_motion, -#endif // CONFIG_GLOBAL_MOTION + const MOTION_MODE motion_allowed = motion_mode_allowed(0, xd->global_motion, #if CONFIG_WARPED_MOTION - xd, + xd, #endif - xd->mi[0]); + xd->mi[0]); #endif // CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_WARPED_MOTION RD_STATS rd_stats_y, rd_stats_uv; const int skip_ctx = av1_get_skip_context(xd);
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c index 5b4ee23..85fa1ae 100644 --- a/av1/encoder/speed_features.c +++ b/av1/encoder/speed_features.c
@@ -217,9 +217,7 @@ #if CONFIG_EXT_TX sf->tx_type_search.prune_mode = PRUNE_2D_FAST; #endif -#if CONFIG_GLOBAL_MOTION sf->gm_search_type = GM_DISABLE_SEARCH; -#endif // CONFIG_GLOBAL_MOTION } if (speed >= 4) { @@ -450,9 +448,7 @@ // Set this at the appropriate speed levels sf->use_transform_domain_distortion = 0; -#if CONFIG_GLOBAL_MOTION sf->gm_search_type = GM_FULL_SEARCH; -#endif // CONFIG_GLOBAL_MOTION if (oxcf->mode == GOOD #if CONFIG_XIPHRC
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h index d946cee..d2f2e3a 100644 --- a/av1/encoder/speed_features.h +++ b/av1/encoder/speed_features.h
@@ -266,13 +266,11 @@ int interval; } MESH_PATTERN; -#if CONFIG_GLOBAL_MOTION typedef enum { GM_FULL_SEARCH, GM_REDUCED_REF_SEARCH, GM_DISABLE_SEARCH } GM_SEARCH_TYPE; -#endif // CONFIG_GLOBAL_MOTION typedef struct SPEED_FEATURES { MV_SPEED_FEATURES mv; @@ -488,9 +486,7 @@ // more accurate), or in the transform domain (faster but less acurate). int use_transform_domain_distortion; -#if CONFIG_GLOBAL_MOTION GM_SEARCH_TYPE gm_search_type; -#endif // CONFIG_GLOBAL_MOTION } SPEED_FEATURES; struct AV1_COMP;
diff --git a/av1/encoder/temporal_filter.c b/av1/encoder/temporal_filter.c index 1afeebe..cde6f1f 100644 --- a/av1/encoder/temporal_filter.c +++ b/av1/encoder/temporal_filter.c
@@ -51,10 +51,8 @@ const InterpFilters interp_filters = xd->mi[0]->mbmi.interp_filters; #endif // USE_TEMPORALFILTER_12TAP -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION WarpTypesAllowed warp_types; memset(&warp_types, 0, sizeof(WarpTypesAllowed)); -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION if (uv_block_width == 8) { uv_stride = (stride + 1) >> 1; @@ -66,53 +64,35 @@ #if CONFIG_HIGHBITDEPTH if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - av1_highbd_build_inter_predictor(y_mb_ptr, stride, &pred[0], 16, &mv, scale, - 16, 16, which_mv, interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, x, y, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - 0, MV_PRECISION_Q3, x, y, xd); + av1_highbd_build_inter_predictor( + y_mb_ptr, stride, &pred[0], 16, &mv, scale, 16, 16, which_mv, + interp_filters, &warp_types, x, y, 0, MV_PRECISION_Q3, x, y, xd); - av1_highbd_build_inter_predictor(u_mb_ptr, uv_stride, &pred[256], - uv_block_width, &mv, scale, uv_block_width, - uv_block_height, which_mv, interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, x, y, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - 1, mv_precision_uv, x, y, xd); + av1_highbd_build_inter_predictor( + u_mb_ptr, uv_stride, &pred[256], uv_block_width, &mv, scale, + uv_block_width, uv_block_height, which_mv, interp_filters, &warp_types, + x, y, 1, mv_precision_uv, x, y, xd); - av1_highbd_build_inter_predictor(v_mb_ptr, uv_stride, &pred[512], - uv_block_width, &mv, scale, uv_block_width, - uv_block_height, which_mv, interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, x, y, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - 2, mv_precision_uv, x, y, xd); + av1_highbd_build_inter_predictor( + v_mb_ptr, uv_stride, &pred[512], uv_block_width, &mv, scale, + uv_block_width, uv_block_height, which_mv, interp_filters, &warp_types, + x, y, 2, mv_precision_uv, x, y, xd); return; } #endif // CONFIG_HIGHBITDEPTH av1_build_inter_predictor(y_mb_ptr, stride, &pred[0], 16, &mv, scale, 16, 16, - &conv_params, interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, x, y, 0, 0, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - MV_PRECISION_Q3, x, y, xd); + &conv_params, interp_filters, &warp_types, x, y, 0, + 0, MV_PRECISION_Q3, x, y, xd); av1_build_inter_predictor(u_mb_ptr, uv_stride, &pred[256], uv_block_width, &mv, scale, uv_block_width, uv_block_height, - &conv_params, interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, x, y, 1, 0, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - mv_precision_uv, x, y, xd); + &conv_params, interp_filters, &warp_types, x, y, 1, + 0, mv_precision_uv, x, y, xd); av1_build_inter_predictor(v_mb_ptr, uv_stride, &pred[512], uv_block_width, &mv, scale, uv_block_width, uv_block_height, - &conv_params, interp_filters, -#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - &warp_types, x, y, 2, 0, -#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION - mv_precision_uv, x, y, xd); + &conv_params, interp_filters, &warp_types, x, y, 2, + 0, mv_precision_uv, x, y, xd); } void av1_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride,
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake index 5a46b28..6e6bda7 100644 --- a/build/cmake/aom_config_defaults.cmake +++ b/build/cmake/aom_config_defaults.cmake
@@ -150,7 +150,6 @@ set(CONFIG_FRAME_SIGN_BIAS 0 CACHE NUMBER "AV1 experiment flag.") set(CONFIG_FRAME_SIZE 0 CACHE NUMBER "AV1 experiment flag.") set(CONFIG_FRAME_SUPERRES 0 CACHE NUMBER "AV1 experiment flag.") -set(CONFIG_GLOBAL_MOTION 1 CACHE NUMBER "AV1 experiment flag.") set(CONFIG_HASH_ME 0 CACHE NUMBER "AV1 experiment flag.") set(CONFIG_HORZONLY_FRAME_SUPERRES 0 CACHE NUMBER "AV1 experiment flag.") set(CONFIG_INTERINTRA 1 CACHE NUMBER "AV1 experiment flag.")
diff --git a/configure b/configure index 8e2fb45..6c7c5ad 100755 --- a/configure +++ b/configure
@@ -265,7 +265,6 @@ interintra wedge compound_segment - global_motion new_quant ans loop_restoration @@ -503,7 +502,6 @@ # Enable adopted experiments by default soft_enable adopted_experiments if enabled adopted_experiments; then - soft_enable global_motion soft_enable ext_tx soft_enable cdef soft_enable ext_intra @@ -556,7 +554,6 @@ enabled ext_intra_mod && enable_feature intra_edge enabled intra_edge && enable_feature ext_intra enabled ncobmc_adapt_weight && enable_feature motion_var - enabled bgsprite && enable_feature global_motion enabled ext_comp_refs && enable_feature one_sided_compound enabled lgt_from_pred && enable_feature ext_tx enabled lgt_from_pred && disable_feature mrc_tx
diff --git a/test/test.cmake b/test/test.cmake index 26937c9..ab2f613 100644 --- a/test/test.cmake +++ b/test/test.cmake
@@ -79,14 +79,12 @@ "${AOM_ROOT}/test/scan_test.cc") endif () - if (CONFIG_GLOBAL_MOTION OR CONFIG_WARPED_MOTION) - if (HAVE_SSE2) - set(AOM_UNIT_TEST_COMMON_SOURCES - ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/warp_filter_test.cc" - "${AOM_ROOT}/test/warp_filter_test_util.cc" - "${AOM_ROOT}/test/warp_filter_test_util.h") - endif () + if (HAVE_SSE2) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/warp_filter_test.cc" + "${AOM_ROOT}/test/warp_filter_test_util.cc" + "${AOM_ROOT}/test/warp_filter_test_util.h") endif () endif () @@ -277,11 +275,9 @@ "${AOM_ROOT}/test/av1_fht8x4_test.cc") endif () - if (CONFIG_GLOBAL_MOTION) - set(AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1 - ${AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1} - "${AOM_ROOT}/test/corner_match_test.cc") - endif () + set(AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1 + ${AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1} + "${AOM_ROOT}/test/corner_match_test.cc") if (CONFIG_MOTION_VAR) set(AOM_UNIT_TEST_ENCODER_SOURCES
diff --git a/test/test.mk b/test/test.mk index e6b0c53..85c7618 100644 --- a/test/test.mk +++ b/test/test.mk
@@ -235,10 +235,8 @@ LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_inv_txfm2d_test.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1) += av1_convolve_test.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1) += av1_convolve_optimz_test.cc -ifneq ($(findstring yes,$(CONFIG_GLOBAL_MOTION)$(CONFIG_WARPED_MOTION)),) LIBAOM_TEST_SRCS-$(HAVE_SSE2) += warp_filter_test_util.h LIBAOM_TEST_SRCS-$(HAVE_SSE2) += warp_filter_test.cc warp_filter_test_util.cc -endif ifeq ($(CONFIG_LOOP_RESTORATION),yes) LIBAOM_TEST_SRCS-$(HAVE_SSE2) += hiprec_convolve_test_util.h LIBAOM_TEST_SRCS-$(HAVE_SSE2) += hiprec_convolve_test.cc @@ -256,7 +254,7 @@ LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += av1_convolve_scale_test.cc endif -ifeq ($(CONFIG_GLOBAL_MOTION)$(CONFIG_AV1_ENCODER),yesyes) +ifeq ($(CONFIG_AV1_ENCODER),yes) LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += corner_match_test.cc endif