]> granicus.if.org Git - libvpx/commitdiff
Assert no 8x4/4x8 partition for scaled references
authorYaowu Xu <yaowu@google.com>
Thu, 3 Dec 2015 01:00:26 +0000 (17:00 -0800)
committerYaowu Xu <yaowu@google.com>
Tue, 5 Jan 2016 02:33:37 +0000 (18:33 -0800)
This commit adds a new configure option:

--enable-better-hw-compatibility

The purpose of the configure option is to provide information on known
hardware decoder implementation bugs, so encoder implementers may
choose to implement their encoders in a way to avoid triggering these
decoder bugs.

The WebM team were made aware of that a number of hardware decoders
have trouble in handling the combination of scaled frame reference
frame and 8x4 or 4x8 partitions. This commit added asserts to vp9
decoder, so when built with above configure option, the decoder can
assert if an input bitstream triggers such decoder bug.

Change-Id: I386204cfa80ed16b50ebde57f886121ed76200bf

configure
vp9/common/vp9_reconinter.c

index 24992c4ef6eedfbfcde172268bc8694f583f1fea..20537695bc8882dd3880d08e3c22f75ddbfa4a44 100755 (executable)
--- a/configure
+++ b/configure
@@ -35,6 +35,9 @@ Advanced options:
   ${toggle_debug_libs}            in/exclude debug version of libraries
   ${toggle_static_msvcrt}         use static MSVCRT (VS builds only)
   ${toggle_vp9_highbitdepth}      use VP9 high bit depth (10/12) profiles
+  ${toggle_better_hw_compatibility}
+                                  enable encoder to produce streams with better
+                                  hardware decoder compatibility
   ${toggle_vp8}                   VP8 codec support
   ${toggle_vp9}                   VP9 codec support
   ${toggle_vp10}                  VP10 codec support
@@ -319,6 +322,7 @@ CONFIG_LIST="
     vp9_temporal_denoising
     coefficient_range_checking
     vp9_highbitdepth
+    better_hw_compatibility
     experimental
     size_limit
     ${EXPERIMENT_LIST}
@@ -377,6 +381,7 @@ CMDLINE_SELECT="
     temporal_denoising
     vp9_temporal_denoising
     coefficient_range_checking
+    better_hw_compatibility
     vp9_highbitdepth
     experimental
 "
index d8c14ecc818bec4833a90f7bc89ef78c576f61b8..3eb19b124f2e0810928525f1ef68efa7381b56cb 100644 (file)
@@ -187,6 +187,10 @@ static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
     const int is_scaled = vp9_is_scaled(sf);
 
     if (is_scaled) {
+#if CONFIG_BETTER_HW_COMPATIBILITY
+      assert(xd->mi[0]->mbmi.sb_type != BLOCK_4X8 &&
+             xd->mi[0]->mbmi.sb_type != BLOCK_8X4);
+#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));