]> granicus.if.org Git - libvpx/commitdiff
Assert no mv clamping for scaled references
authorYaowu Xu <yaowu@google.com>
Tue, 5 Jan 2016 02:24:18 +0000 (18:24 -0800)
committerYaowu Xu <yaowu@google.com>
Tue, 5 Jan 2016 22:55:05 +0000 (14:55 -0800)
Under --enable-better-hw-compabibility, this commit adds the asserts
that no mv clamping is applied for scaled references, so when built
with this configure option, decoder will assert if an input bitstream
triggger mv clamping for scaled reference frames.

Change-Id: I786e86a2bbbfb5bc2d2b706a31b0ffa8fe2eb0cb

vp9/common/vp9_reconinter.c
vp9/decoder/vp9_decodeframe.c

index 3eb19b124f2e0810928525f1ef68efa7381b56cb..37658dc9421006c486771f62923b266264a99378 100644 (file)
@@ -187,13 +187,15 @@ static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
     const int is_scaled = vp9_is_scaled(sf);
 
     if (is_scaled) {
+      // Co-ordinate of containing block to pixel precision.
+      const int x_start = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x));
+      const int y_start = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y));
 #if CONFIG_BETTER_HW_COMPATIBILITY
       assert(xd->mi[0]->mbmi.sb_type != BLOCK_4X8 &&
              xd->mi[0]->mbmi.sb_type != BLOCK_8X4);
+      assert(mv_q4.row == mv.row * (1 << (1 - pd->subsampling_y)) &&
+             mv_q4.col == mv.col * (1 << (1 - pd->subsampling_x)));
 #endif
-      // Co-ordinate of containing block to pixel precision.
-      const int x_start = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x));
-      const int y_start = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y));
       if (plane == 0)
         pre_buf->buf = xd->block_refs[ref]->buf->y_buffer;
       else if (plane == 1)
index 39e4dcfe3c8454c66ef6ad56a94819cd843d264f..3fd87cc3afbf21bb2bd1968dcfe206b91df78927 100644 (file)
@@ -587,7 +587,12 @@ static void dec_build_inter_predictors(VP9Decoder *const pbi, MACROBLOCKD *xd,
     // Co-ordinate of containing block to pixel precision.
     int x_start = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x));
     int y_start = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y));
-
+#if CONFIG_BETTER_HW_COMPATIBILITY
+    assert(xd->mi[0]->mbmi.sb_type != BLOCK_4X8 &&
+           xd->mi[0]->mbmi.sb_type != BLOCK_8X4);
+    assert(mv_q4.row == mv->row * (1 << (1 - pd->subsampling_y)) &&
+           mv_q4.col == mv->col * (1 << (1 - pd->subsampling_x)));
+#endif
     // Co-ordinate of the block to 1/16th pixel precision.
     x0_16 = (x_start + x) << SUBPEL_BITS;
     y0_16 = (y_start + y) << SUBPEL_BITS;