Fix building errors with windows VS There are several compile time flags placed under assert code, which caused building errors on windows machine with VS. The fix is placing compile time flag outside of assert code.
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c index 7e83761..8c030ca 100644 --- a/av1/decoder/decodemv.c +++ b/av1/decoder/decodemv.c
@@ -3481,19 +3481,29 @@ if (mbmi->skip_mode) { #if CONFIG_SKIP_MODE_ENHANCEMENT && CONFIG_OPTFLOW_REFINEMENT - assert( - mbmi->mode == - ( -#if CONFIG_D072_SKIP_MODE_IMPROVE - !is_compound ? NEARMV : -#endif // CONFIG_D072_SKIP_MODE_IMPROVE - (cm->features.opfl_refine_type == REFINE_SWITCHABLE && - opfl_allowed_for_cur_refs(cm, mbmi) -#if CONFIG_CWP - && !cm->features.enable_cwp -#endif // CONFIG_CWP - ? NEAR_NEARMV_OPTFLOW - : NEAR_NEARMV))); +#if CONFIG_D072_SKIP_MODE_IMPROVE && CONFIG_CWP + assert(mbmi->mode == + (!is_compound + ? NEARMV + : (cm->features.opfl_refine_type == REFINE_SWITCHABLE && + opfl_allowed_for_cur_refs(cm, mbmi) && + !cm->features.enable_cwp + ? NEAR_NEARMV_OPTFLOW + : NEAR_NEARMV))); +#elif CONFIG_D072_SKIP_MODE_IMPROVE + assert(mbmi->mode == + (!is_compound + ? NEARMV + : (cm->features.opfl_refine_type == REFINE_SWITCHABLE && + opfl_allowed_for_cur_refs(cm, mbmi) + ? NEAR_NEARMV_OPTFLOW + : NEAR_NEARMV))); +#else + assert(mbmi->mode == ((cm->features.opfl_refine_type == REFINE_SWITCHABLE && + opfl_allowed_for_cur_refs(cm, mbmi) + ? NEAR_NEARMV_OPTFLOW + : NEAR_NEARMV))); +#endif // CONFIG_D072_SKIP_MODE_IMPROVE && CONFIG_CWP #else assert(mbmi->mode == NEAR_NEARMV); #endif // CONFIG_SKIP_MODE_ENHANCEMENT && CONFIG_OPTFLOW_REFINEMENT @@ -3673,12 +3683,14 @@ if (mbmi->comp_group_idx == 0) { mbmi->interinter_comp.type = COMPOUND_AVERAGE; } else { +#if CONFIG_COMPOUND_WARP_CAUSAL assert(cm->current_frame.reference_mode != SINGLE_REFERENCE && is_inter_compound_mode(mbmi->mode) && -#if CONFIG_COMPOUND_WARP_CAUSAL (mbmi->motion_mode == SIMPLE_TRANSLATION || is_compound_warp_causal_allowed(mbmi))); #else + assert(cm->current_frame.reference_mode != SINGLE_REFERENCE && + is_inter_compound_mode(mbmi->mode) && mbmi->motion_mode == SIMPLE_TRANSLATION); #endif // CONFIG_COMPOUND_WARP_CAUSAL assert(masked_compound_used);
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index 68b9b85..0c60e0f 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c
@@ -2725,12 +2725,14 @@ if (mbmi->comp_group_idx == 0) { assert(mbmi->interinter_comp.type == COMPOUND_AVERAGE); } else { +#if CONFIG_COMPOUND_WARP_CAUSAL assert(cpi->common.current_frame.reference_mode != SINGLE_REFERENCE && is_inter_compound_mode(mbmi->mode) && -#if CONFIG_COMPOUND_WARP_CAUSAL (mbmi->motion_mode == SIMPLE_TRANSLATION || is_compound_warp_causal_allowed(mbmi))); #else + assert(cpi->common.current_frame.reference_mode != SINGLE_REFERENCE && + is_inter_compound_mode(mbmi->mode) && mbmi->motion_mode == SIMPLE_TRANSLATION); #endif // CONFIG_COMPOUND_WARP_CAUSAL assert(masked_compound_used);
diff --git a/av1/encoder/partition_search.c b/av1/encoder/partition_search.c index 25f8f34..cc3d014 100644 --- a/av1/encoder/partition_search.c +++ b/av1/encoder/partition_search.c
@@ -1852,12 +1852,14 @@ && !is_joint_amvd_coding_mode(mbmi->mode) #endif // IMPROVED_AMVD && CONFIG_JOINT_MVD ) { +#if CONFIG_COMPOUND_WARP_CAUSAL assert(current_frame->reference_mode != SINGLE_REFERENCE && is_inter_compound_mode(mbmi->mode) && -#if CONFIG_COMPOUND_WARP_CAUSAL (mbmi->motion_mode == SIMPLE_TRANSLATION || is_compound_warp_causal_allowed(mbmi))); #else + assert(current_frame->reference_mode != SINGLE_REFERENCE && + is_inter_compound_mode(mbmi->mode) && mbmi->motion_mode == SIMPLE_TRANSLATION); #endif // CONFIG_COMPOUND_WARP_CAUSAL
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index 1d89b66..d2394c0 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c
@@ -7458,14 +7458,19 @@ #endif // CONFIG_SKIP_MODE_ENHANCEMENT #if CONFIG_OPTFLOW_REFINEMENT - assert(this_mode == (cm->features.opfl_refine_type == REFINE_SWITCHABLE && - opfl_allowed_for_cur_refs(cm, mbmi) #if CONFIG_CWP - && !cm->features.enable_cwp -#endif // CONFIG_CWP + assert(this_mode == (cm->features.opfl_refine_type == REFINE_SWITCHABLE && + opfl_allowed_for_cur_refs(cm, mbmi) && + !cm->features.enable_cwp ? NEAR_NEARMV_OPTFLOW : NEAR_NEARMV)); #else + assert(this_mode == (cm->features.opfl_refine_type == REFINE_SWITCHABLE && + opfl_allowed_for_cur_refs(cm, mbmi) + ? NEAR_NEARMV_OPTFLOW + : NEAR_NEARMV)); +#endif // CONFIG_CWP +#else assert(this_mode == NEAR_NEARMV); #endif