Commit 5b0036d480 for aom

commit 5b0036d4808d20eb67fa82bd5b5c0e467e9ad7ed
Author: Deepa K G <deepa.kg@ittiam.com>
Date:   Tue Jul 14 11:16:43 2026 +0530

    Use MV_COST_NONE in subpel search of TPL stage

    In the TPL stage, MV cost is not considered during
    the sub-pel motion search for the NEWMV mode. However,
    during the sub-pel motion search for the NEW_NEWMV mode,
    the entropy rate of the MV was being used as the cost.
    This patch applies MV_COST_NONE to the subpel search
    for the NEW_NEWMV mode in the tpl stage to ensure
    consistency with the NEWMV mode.

    STATS_CHANGED for speed = 0, 1

    Change-Id: I556b2efc76cfb5218d0cb77fbc5656c77847d705

diff --git a/av1/encoder/motion_search_facade.c b/av1/encoder/motion_search_facade.c
index 575ac98714..68e865de7d 100644
--- a/av1/encoder/motion_search_facade.c
+++ b/av1/encoder/motion_search_facade.c
@@ -546,7 +546,8 @@ void av1_single_motion_search(const AV1_COMP *const cpi, MACROBLOCK *x,
 int av1_joint_motion_search(const AV1_COMP *cpi, MACROBLOCK *x,
                             BLOCK_SIZE bsize, int_mv *cur_mv,
                             const uint8_t *mask, int mask_stride, int *rate_mv,
-                            int allow_second_mv, int joint_me_num_refine_iter) {
+                            int allow_second_mv, int joint_me_num_refine_iter,
+                            bool use_subpel_mv_cost_none) {
   const AV1_COMMON *const cm = &cpi->common;
   const int num_planes = av1_num_planes(cm);
   const int pw = block_size_wide[bsize];
@@ -708,6 +709,9 @@ int av1_joint_motion_search(const AV1_COMP *cpi, MACROBLOCK *x,
       av1_set_ms_compound_refs(&ms_params.var_params.ms_buffers, second_pred,
                                mask, mask_stride, id);
       ms_params.forced_stop = EIGHTH_PEL;
+      if (use_subpel_mv_cost_none) {
+        ms_params.mv_cost_params.mv_cost_type = MV_COST_NONE;
+      }
       MV start_mv = get_mv_from_fullmv(&best_mv.as_fullmv);
       assert(av1_is_subpelmv_in_range(&ms_params.mv_limits, start_mv));
       bestsme = cpi->mv_search_params.find_fractional_mv_step(
@@ -948,7 +952,8 @@ static inline void do_masked_motion_search_indexed(
             : NUM_JOINT_ME_REFINE_ITER;
     av1_joint_motion_search(cpi, x, bsize, tmp_mv, mask, mask_stride, rate_mv,
                             !cpi->sf.mv_sf.disable_second_mv,
-                            joint_me_num_refine_iter);
+                            joint_me_num_refine_iter,
+                            /*use_subpel_mv_cost_none=*/false);
   }
 }

diff --git a/av1/encoder/motion_search_facade.h b/av1/encoder/motion_search_facade.h
index 402fdf16e8..e5b4dd2dc0 100644
--- a/av1/encoder/motion_search_facade.h
+++ b/av1/encoder/motion_search_facade.h
@@ -40,7 +40,8 @@ void av1_single_motion_search(const AV1_COMP *const cpi, MACROBLOCK *x,
 int av1_joint_motion_search(const AV1_COMP *cpi, MACROBLOCK *x,
                             BLOCK_SIZE bsize, int_mv *cur_mv,
                             const uint8_t *mask, int mask_stride, int *rate_mv,
-                            int allow_second_mv, int joint_me_num_refine_iter);
+                            int allow_second_mv, int joint_me_num_refine_iter,
+                            bool use_subpel_mv_cost_none);

 int av1_interinter_compound_motion_search(const AV1_COMP *const cpi,
                                           MACROBLOCK *x,
diff --git a/av1/encoder/tpl_model.c b/av1/encoder/tpl_model.c
index d4881c9833..9131c1624d 100644
--- a/av1/encoder/tpl_model.c
+++ b/av1/encoder/tpl_model.c
@@ -981,7 +981,8 @@ static inline void mode_estimation(AV1_COMP *cpi, TplTxfmStats *tpl_txfm_stats,
     int rate_mv;
     av1_joint_motion_search(cpi, x, bsize, tmp_mv, NULL, 0, &rate_mv,
                             !cpi->sf.mv_sf.disable_second_mv,
-                            NUM_JOINT_ME_REFINE_ITER);
+                            NUM_JOINT_ME_REFINE_ITER,
+                            /*use_subpel_mv_cost_none=*/true);

     for (int ref = 0; ref < 2; ++ref) {
       struct buf_2d ref_buf = { NULL, ref_frame_ptr[ref]->y_buffer,