Commit 7a5b4a5914 for aom

commit 7a5b4a5914a18e6f168fec071ce15d9272aac673
Author: Narayan Kalaburgi <narayan.kalaburgi@ittiam.com>
Date:   Thu Apr 16 14:14:53 2026 +0530

    lc-dec: Tune sf 'ref_frame_mvs_lvl' for decoder speed-up

    This CL refines the sf 'ref_frame_mvs_lvl' by improving the
    spatial MV prediction error computation with the addition of
    2 spatial neighbors. It also tunes the thresholds used to
    disable temporal motion vector prediction for more decoder
    speed-up.

    STATS_CHANGED for low complexity decode, hdres

    Change-Id: I36db7c70e611c9556e115d11693b511de9a1334e

diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 54ef94fb71..f1d9f88a92 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1954,11 +1954,11 @@ static int aom_get_variance_boost_delta_q_res(int qindex) {

 #if !CONFIG_REALTIME_ONLY
 static float get_thresh_based_on_q(int qindex, int speed) {
-  const float min_threshold_arr[2] = { 0.06f, 0.09f };
-  const float max_threshold_arr[2] = { 0.10f, 0.13f };
-
-  const float min_thresh = min_threshold_arr[speed >= 3];
-  const float max_thresh = max_threshold_arr[speed >= 3];
+  const float min_threshold_arr[3] = { 0.084f, 0.087f, 0.126f };
+  const float max_threshold_arr[3] = { 0.140f, 0.150f, 0.182f };
+  const int idx = (speed >= 3) ? 2 : (speed - 1);
+  const float min_thresh = min_threshold_arr[idx];
+  const float max_thresh = max_threshold_arr[idx];
   const float thresh = min_thresh + (max_thresh - min_thresh) *
                                         ((float)MAXQ - (float)qindex) /
                                         (float)(MAXQ - MINQ);
@@ -1998,12 +1998,12 @@ static int get_spatial_mvpred_err(AV1_COMMON *cm, TplParams *const tpl_data,

   int mv_err = INT32_MAX;
   const int step = 1 << block_mis_log2;
-  const int mv_pred_pos_in_mis[6][2] = {
-    { -step, 0 },     { 0, -step },     { -step, step },
-    { -step, -step }, { -2 * step, 0 }, { 0, -2 * step },
+  const int mv_pred_pos_in_mis[8][2] = {
+    { -step, 0 },     { 0, -step },     { -step, step },  { -step, -step },
+    { -2 * step, 0 }, { 0, -2 * step }, { -3 * step, 0 }, { 0, -3 * step },
   };

-  for (int i = 0; i < 6; i++) {
+  for (int i = 0; i < 8; i++) {
     int row_offset = mv_pred_pos_in_mis[i][0];
     int col_offset = mv_pred_pos_in_mis[i][1];
     if (!is_inside_frame_border(mi_row, mi_col, row_offset, col_offset,