AV1 RT: Fix uninitialized variable use in estimate_intra
Accessing MVs without checking any inter mode leads to MSAN warnings
BUG=b/200884145
Change-Id: I1ca8ab90da567cd4a33ffa4c3c4caa185d67d33d
(cherry picked from commit 552a0398f47d558b315b4ee0b6b2ec31606a8706)
diff --git a/av1/encoder/nonrd_pickmode.c b/av1/encoder/nonrd_pickmode.c
index 3f17713..a3f1216 100644
--- a/av1/encoder/nonrd_pickmode.c
+++ b/av1/encoder/nonrd_pickmode.c
@@ -1986,9 +1986,10 @@
if (x->source_variance < spatial_var_thresh) {
// If the best inter mode is large motion or non-LAST ref reduce intra cost
// penalty, so intra mode is more likely tested.
- if (best_pickmode->best_ref_frame != LAST_FRAME ||
- abs(mi->mv[0].as_mv.row) >= motion_thresh ||
- abs(mi->mv[0].as_mv.col) >= motion_thresh) {
+ if (best_rdc->rdcost != INT64_MAX &&
+ (best_pickmode->best_ref_frame != LAST_FRAME ||
+ abs(mi->mv[0].as_mv.row) >= motion_thresh ||
+ abs(mi->mv[0].as_mv.col) >= motion_thresh)) {
intra_cost_penalty = intra_cost_penalty >> 2;
inter_mode_thresh = RDCOST(x->rdmult, intra_cost_penalty, 0);
do_early_exit_rdthresh = 0;