JNT_COMP: refactor if statements
Refactor if statement that use frame_offset == -1 to indicate
jnt_comp is not chosen, as distance now can not be negative.
Instead, add a variable use_jnt_comp_avg for the same functionality.
Change-Id: Ie6b9c6ab36131b48bc9e066babada17046729cd8
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 416171e..7734d59 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -5894,7 +5894,8 @@
#if CONFIG_JNT_COMP
const int order_idx = id != 0;
av1_jnt_comp_weight_assign(cm, mbmi, order_idx, &xd->jcp_param.fwd_offset,
- &xd->jcp_param.bck_offset, 1);
+ &xd->jcp_param.bck_offset,
+ &xd->jcp_param.use_jnt_comp_avg, 1);
#endif // CONFIG_JNT_COMP
// Do compound motion search on the current reference frame.
@@ -6537,7 +6538,8 @@
#if CONFIG_JNT_COMP
av1_jnt_comp_weight_assign(cm, mbmi, 0, &xd->jcp_param.fwd_offset,
- &xd->jcp_param.bck_offset, 1);
+ &xd->jcp_param.bck_offset,
+ &xd->jcp_param.use_jnt_comp_avg, 1);
#endif // CONFIG_JNT_COMP
if (scaled_ref_frame) {