]> granicus.if.org Git - libvpx/commitdiff
Sample points to reduce encode overhead.
authorpaulwilkins <paulwilkins@google.com>
Mon, 11 Jul 2016 10:45:52 +0000 (11:45 +0100)
committerpaulwilkins <paulwilkins@google.com>
Mon, 11 Jul 2016 10:45:52 +0000 (11:45 +0100)
Only noise filter sampled points in first pass to reduce
any first pass speed overhead.

Change-Id: Ic80d4400e59146d1c3332336c4350faf28ff8b17

vp9/encoder/vp9_firstpass.c

index 869745e89433cee942fd6a88b783967b0daf7553..449722a85686a8bce08c373e816f8355690adea7 100644 (file)
@@ -689,8 +689,9 @@ static int fp_estimate_block_noise(MACROBLOCK *x, BLOCK_SIZE bsize) {
   int stride = x->plane[0].src.stride;
   int block_noise = 0;
 
-  for (h = 0; h < height; ++h) {
-    for (w = 0; w < width; ++w) {
+  // Sampled points to reduce cost overhead.
+  for (h = 0; h < height; h += 2) {
+    for (w = 0; w < width; w += 2) {
 #if CONFIG_VP9_HIGHBITDEPTH
       if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
         block_noise += fp_highbd_estimate_point_noise(src_ptr, stride);
@@ -703,7 +704,7 @@ static int fp_estimate_block_noise(MACROBLOCK *x, BLOCK_SIZE bsize) {
     }
     src_ptr += (stride - width);
   }
-  return block_noise;
+  return block_noise << 2;  // Scale << 2 to account for sampling.
 }
 
 #define INVALID_ROW -1