]> granicus.if.org Git - libvpx/commitdiff
vp9_rdopt: correct size to vpx_sum_squares_2d_i16
authorJames Zern <jzern@google.com>
Wed, 22 Mar 2017 06:29:12 +0000 (23:29 -0700)
committerJames Zern <jzern@google.com>
Wed, 22 Mar 2017 19:04:33 +0000 (12:04 -0700)
the current implementations expect pixel size, not the block type

BUG=webm:1392

Change-Id: Ib91e9f30a1f56e13566b1fb76f089dae9bb50cdc

vp9/encoder/vp9_rdopt.c
vpx_dsp/x86/sum_squares_sse2.c

index 0432eebd5406d1ad7c603a7df9c6c0ea54259844..bbfc2dc4b4ea17332d0ad59a6b9350efe37d83fd 100644 (file)
@@ -515,7 +515,8 @@ static int64_t sum_squares_visible(const MACROBLOCKD *xd,
                                              pd->subsampling_y, blk_row);
   if (tx_bsize == BLOCK_4X4 ||
       (b4x4s_to_right_edge >= tx_4x4_w && b4x4s_to_bottom_edge >= tx_4x4_h)) {
-    sse = (int64_t)vpx_sum_squares_2d_i16(diff, diff_stride, tx_bsize);
+    assert(tx_4x4_w == tx_4x4_h);
+    sse = (int64_t)vpx_sum_squares_2d_i16(diff, diff_stride, tx_4x4_w << 2);
   } else {
     int r, c;
     int max_r = VPXMIN(b4x4s_to_bottom_edge, tx_4x4_h);
@@ -525,7 +526,8 @@ static int64_t sum_squares_visible(const MACROBLOCKD *xd,
     for (r = 0; r < max_r; ++r) {
       // Skip visiting the sub blocks that are wholly within the UMV.
       for (c = 0; c < max_c; ++c) {
-        sse += (int64_t)vpx_sum_squares_2d_i16(diff, diff_stride, BLOCK_4X4);
+        sse += (int64_t)vpx_sum_squares_2d_i16(
+            diff + r * diff_stride * 4 + c * 4, diff_stride, 4);
       }
     }
   }
index bc5362e10ff9a5e0622ba2c0d243368eb58f334e..026d0ca2f272bfd1f21a294bad95b59f68ff9fa0 100644 (file)
@@ -123,6 +123,7 @@ uint64_t vpx_sum_squares_2d_i16_sse2(const int16_t *src, int stride, int size) {
     return vpx_sum_squares_2d_i16_4x4_sse2(src, stride);
   } else {
     // Generic case
+    assert(size % 8 == 0);
     return vpx_sum_squares_2d_i16_nxn_sse2(src, stride, size);
   }
 }