diff options
author | Hui Su <huisu@google.com> | 2016-06-21 21:33:26 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-06-21 21:33:26 +0000 |
commit | b8ec5dcdf8f5bc40a137b988437ef5ff3931b03a (patch) | |
tree | 48b12525ff2ab1ca4fdcfb15dc509df3b94e3776 | |
parent | cb1d152719a3f0d0dff461e7a712eb49402b0933 (diff) | |
parent | a5af392aaec8f91d62ab68812f090697b06cce33 (diff) | |
download | libvpx-b8ec5dcdf8f5bc40a137b988437ef5ff3931b03a.tar libvpx-b8ec5dcdf8f5bc40a137b988437ef5ff3931b03a.tar.gz libvpx-b8ec5dcdf8f5bc40a137b988437ef5ff3931b03a.tar.bz2 libvpx-b8ec5dcdf8f5bc40a137b988437ef5ff3931b03a.zip |
Merge "Add a hardware compatibility feature"
-rw-r--r-- | vp9/common/vp9_common_data.c | 15 | ||||
-rw-r--r-- | vp9/common/vp9_common_data.h | 3 | ||||
-rw-r--r-- | vp9/decoder/vp9_decodemv.c | 6 | ||||
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 6 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 5 |
5 files changed, 35 insertions, 0 deletions
diff --git a/vp9/common/vp9_common_data.c b/vp9/common/vp9_common_data.c index a6dae6a1c..3409d0484 100644 --- a/vp9/common/vp9_common_data.c +++ b/vp9/common/vp9_common_data.c @@ -159,3 +159,18 @@ const struct { {0, 8 }, // 64X32 - {0b0000, 0b1000} {0, 0 }, // 64X64 - {0b0000, 0b0000} }; + +#if CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH +const uint8_t need_top_left[INTRA_MODES] = { + 0, // DC_PRED + 0, // V_PRED + 0, // H_PRED + 0, // D45_PRED + 1, // D135_PRED + 1, // D117_PRED + 1, // D153_PRED + 0, // D207_PRED + 0, // D63_PRED + 1, // TM_PRED +}; +#endif // CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH diff --git a/vp9/common/vp9_common_data.h b/vp9/common/vp9_common_data.h index 95a117961..0ae24dad5 100644 --- a/vp9/common/vp9_common_data.h +++ b/vp9/common/vp9_common_data.h @@ -33,6 +33,9 @@ extern const TX_SIZE max_txsize_lookup[BLOCK_SIZES]; extern const BLOCK_SIZE txsize_to_bsize[TX_SIZES]; extern const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES]; extern const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2]; +#if CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH +extern const uint8_t need_top_left[INTRA_MODES]; +#endif // CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH #ifdef __cplusplus } // extern "C" diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index fe89829a9..ffc6839ad 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -902,4 +902,10 @@ void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd, frame_mvs += cm->mi_cols; } } +#if CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH + if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) && + (xd->above_mi == NULL || xd->left_mi == NULL) && + !is_inter_block(mi) && need_top_left[mi->uv_mode]) + assert(0); +#endif // CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH } diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 2ef9a93d8..984f98a91 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -4443,6 +4443,12 @@ static void encode_superblock(VP9_COMP *cpi, ThreadData *td, if (!is_inter_block(mi)) { int plane; +#if CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH + if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) && + (xd->above_mi == NULL || xd->left_mi == NULL) && + need_top_left[mi->uv_mode]) + assert(0); +#endif // CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH mi->skip = 1; for (plane = 0; plane < MAX_MB_PLANE; ++plane) vp9_encode_intra_block_plane(x, VPXMAX(bsize, BLOCK_8X8), plane, 1); diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index a30418286..f15fc31fd 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1214,6 +1214,11 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, for (mode = DC_PRED; mode <= TM_PRED; ++mode) { if (!(cpi->sf.intra_uv_mode_mask[max_tx_size] & (1 << mode))) continue; +#if CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH + if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) && + (xd->above_mi == NULL || xd->left_mi == NULL) && need_top_left[mode]) + continue; +#endif // CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH xd->mi[0]->uv_mode = mode; |