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;
......
This diff is collapsed.
......@@ -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
......
This diff is collapsed.
......@@ -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 @@ void av1_make_masked_inter_predictor(
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 @@ void av1_build_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
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 @@ static INLINE int av1_is_interp_needed(const MACROBLOCKD *const xd) {
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;
}
......
......@@ -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 @@ static void check_valid_ref_frames(AV1_COMMON *cm) {
}
#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 @@ static void read_global_motion(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
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 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
(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 @@ size_t av1_decode_frame_headers_and_setup(AV1Decoder *pbi, const uint8_t *data,
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));
......
......@@ -289,14 +289,12 @@ static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
(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 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
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 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
#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 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
}
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 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
}
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 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
#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 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
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 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
)
.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 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
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 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
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) {
......
......@@ -409,20 +409,12 @@ static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
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 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
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 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
#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 @@ static void fix_interp_filter(AV1_COMMON *cm, FRAME_COUNTS *counts) {
// 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 @@ static void write_compound_tools(const AV1_COMMON *cm,
#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 @@ static void write_global_motion(AV1_COMP *cpi,
*/
}
}
#endif
#if !CONFIG_OBU
static void write_uncompressed_header_frame(AV1_COMP *cpi,
......@@ -4239,9 +4223,7 @@ static void write_uncompressed_header_frame(AV1_COMP *cpi,
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 @@ static void write_uncompressed_header_obu(AV1_COMP *cpi,
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);
}
......