shithub: libvpx

Download patch

ref: d82b9f62a9e237618fe05cb79746dcfee1e292aa
parent: 270fadc135b2005a6f23a87ab0f27ddb93cdc5e8
parent: 40ffa2839f115beaa805159a74eef07ee36faa45
author: Jerome Jiang <jianj@google.com>
date: Mon Jan 23 22:43:11 EST 2017

Merge "vp9: Adjust the threshold to set avg_source_sad_sb flag."

--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -2246,6 +2246,8 @@
         int num_samples = 0;
         int sb_cols = (cm->mi_cols + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
         int sb_rows = (cm->mi_rows + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
+        uint64_t avg_source_sad_threshold = 5000;
+        if (cpi->oxcf.speed >= 8) avg_source_sad_threshold = 10000;
         if (cpi->oxcf.lag_in_frames > 0) {
           src_y = frames[frame]->y_buffer;
           src_ystride = frames[frame]->y_stride;
@@ -2264,7 +2266,8 @@
               tmp_sad = cpi->fn_ptr[bsize].sdf(src_y, src_ystride, last_src_y,
                                                last_src_ystride);
               if (cpi->sf.use_source_sad)
-                cpi->avg_source_sad_sb[num_samples] = tmp_sad < 5000 ? 1 : 0;
+                cpi->avg_source_sad_sb[num_samples] =
+                    tmp_sad < avg_source_sad_threshold ? 1 : 0;
               avg_sad += tmp_sad;
               num_samples++;
             }