]> granicus.if.org Git - libvpx/commitdiff
Fix non-highbitdepth coding path for HBD build
authorYaowu Xu <yaowu@google.com>
Fri, 8 Jul 2016 18:02:59 +0000 (11:02 -0700)
committerYaowu Xu <yaowu@google.com>
Fri, 8 Jul 2016 18:26:34 +0000 (11:26 -0700)
Change-Id: I38eb42b8d051924a7cd1ccc3421a4057cf6e170f

vp9/encoder/vp9_pickmode.c

index df1f862d183bda54e587db92347bd7bedc67e84a..2d1cae3c1d322f325838f0940c8fe139f8dcd044 100644 (file)
@@ -239,7 +239,10 @@ static int combined_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
 static void block_variance(const uint8_t *src, int src_stride,
                            const uint8_t *ref, int ref_stride,
                            int w, int h, unsigned int *sse, int *sum,
-                           int block_size, vpx_bit_depth_t bd,
+                           int block_size,
+#if CONFIG_VP9_HIGHBITDEPTH
+                           int use_highbitdepth, vpx_bit_depth_t bd,
+#endif
                            uint32_t *sse8x8, int *sum8x8, uint32_t *var8x8) {
   int i, j, k = 0;
 
@@ -249,25 +252,30 @@ static void block_variance(const uint8_t *src, int src_stride,
   for (i = 0; i < h; i += block_size) {
     for (j = 0; j < w; j += block_size) {
 #if CONFIG_VP9_HIGHBITDEPTH
-      switch (bd) {
-        case VPX_BITS_8:
-          vpx_highbd_8_get8x8var(src + src_stride * i + j, src_stride,
-                                 ref + ref_stride * i + j, ref_stride,
-                                 &sse8x8[k], &sum8x8[k]);
-          break;
-        case VPX_BITS_10:
-          vpx_highbd_10_get8x8var(src + src_stride * i + j, src_stride,
-                                  ref + ref_stride * i + j, ref_stride,
-                                  &sse8x8[k], &sum8x8[k]);
-          break;
-        case VPX_BITS_12:
-          vpx_highbd_12_get8x8var(src + src_stride * i + j, src_stride,
-                                  ref + ref_stride * i + j, ref_stride,
-                                  &sse8x8[k], &sum8x8[k]);
+      if (use_highbitdepth) {
+        switch (bd) {
+          case VPX_BITS_8:
+            vpx_highbd_8_get8x8var(src + src_stride * i + j, src_stride,
+                                   ref + ref_stride * i + j, ref_stride,
+                                   &sse8x8[k], &sum8x8[k]);
           break;
+          case VPX_BITS_10:
+            vpx_highbd_10_get8x8var(src + src_stride * i + j, src_stride,
+                                    ref + ref_stride * i + j, ref_stride,
+                                    &sse8x8[k], &sum8x8[k]);
+            break;
+          case VPX_BITS_12:
+            vpx_highbd_12_get8x8var(src + src_stride * i + j, src_stride,
+                                    ref + ref_stride * i + j, ref_stride,
+                                    &sse8x8[k], &sum8x8[k]);
+            break;
+        }
+      } else {
+          vpx_get8x8var(src + src_stride * i + j, src_stride,
+                        ref + ref_stride * i + j, ref_stride,
+                        &sse8x8[k], &sum8x8[k]);
       }
 #else
-      (void)bd;
       vpx_get8x8var(src + src_stride * i + j, src_stride,
                     ref + ref_stride * i + j, ref_stride,
                     &sse8x8[k], &sum8x8[k]);
@@ -332,12 +340,17 @@ static void model_rd_for_sb_y_large(VP9_COMP *cpi, BLOCK_SIZE bsize,
   unsigned int var8x8[64] = {0};
   TX_SIZE tx_size;
   int i, k;
+#if CONFIG_VP9_HIGHBITDEPTH
   const vpx_bit_depth_t bd = cpi->common.bit_depth;
-
+#endif
   // Calculate variance for whole partition, and also save 8x8 blocks' variance
   // to be used in following transform skipping test.
   block_variance(p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride,
-                 4 << bw, 4 << bh, &sse, &sum, 8, bd, sse8x8, sum8x8, var8x8);
+                 4 << bw, 4 << bh, &sse, &sum, 8,
+#if CONFIG_VP9_HIGHBITDEPTH
+                 cpi->common.use_highbitdepth, bd,
+#endif
+                 sse8x8, sum8x8, var8x8);
   var = sse - (((int64_t)sum * sum) >> (bw + bh + 4));
 
   *var_y = var;