From db99840bf66c305b3c03e9e991f9f4c0c0cd64d8 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 26 Jan 2017 14:09:57 -0800 Subject: [PATCH] vp9: Fixes for usage of skin_map for high bit depth. Also avoid noise_estimation and source_sad if use_highbitdepth is set. Change-Id: I5fea396b8f8380ea377045d99ba22a52b92daa46 --- vp9/encoder/vp9_encodeframe.c | 12 ++++-------- vp9/encoder/vp9_noise_estimate.c | 3 +++ vp9/encoder/vp9_ratectrl.c | 3 +++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 070454ea7..bf3238967 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -647,12 +647,14 @@ static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d, } } -#if !CONFIG_VP9_HIGHBITDEPTH // Check if most of the superblock is skin content, and if so, force split to // 32x32, and set x->sb_is_skin for use in mode selection. static int skin_sb_split(VP9_COMP *cpi, MACROBLOCK *x, const int low_res, int mi_row, int mi_col, int *force_split) { VP9_COMMON *const cm = &cpi->common; +#if CONFIG_VP9_HIGHBITDEPTH + if (cm->use_highbitdepth) return 0; +#endif // Avoid checking superblocks on/near boundary and avoid low resolutions. // Note superblock may still pick 64X64 if y_sad is very small // (i.e., y_sad < cpi->vbp_threshold_sad) below. For now leave this as is. @@ -707,7 +709,6 @@ static int skin_sb_split(VP9_COMP *cpi, MACROBLOCK *x, const int low_res, } return 0; } -#endif static void set_low_temp_var_flag(VP9_COMP *cpi, MACROBLOCK *x, MACROBLOCKD *xd, v64x64 *vt, int64_t thresholds[], @@ -1048,12 +1049,7 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile, set_ref_ptrs(cm, xd, mi->ref_frame[0], mi->ref_frame[1]); vp9_build_inter_predictors_sb(xd, mi_row, mi_col, BLOCK_64X64); - x->sb_is_skin = 0; -#if !CONFIG_VP9_HIGHBITDEPTH - if (cpi->use_skin_detection) - x->sb_is_skin = - skin_sb_split(cpi, x, low_res, mi_row, mi_col, force_split); -#endif + x->sb_is_skin = skin_sb_split(cpi, x, low_res, mi_row, mi_col, force_split); d = xd->plane[0].dst.buf; dp = xd->plane[0].dst.stride; diff --git a/vp9/encoder/vp9_noise_estimate.c b/vp9/encoder/vp9_noise_estimate.c index 3dc321bfc..a32e5cac5 100644 --- a/vp9/encoder/vp9_noise_estimate.c +++ b/vp9/encoder/vp9_noise_estimate.c @@ -38,6 +38,9 @@ void vp9_noise_estimate_init(NOISE_ESTIMATE *const ne, int width, int height) { } static int enable_noise_estimation(VP9_COMP *const cpi) { +#if CONFIG_VP9_HIGHBITDEPTH + if (cpi->common.use_highbitdepth) return 0; +#endif // Enable noise estimation if denoising is on, but not for low resolutions. #if CONFIG_VP9_TEMPORAL_DENOISING if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc(cpi) && diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index e7dfb0856..f7816224c 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -2181,6 +2181,9 @@ void adjust_gf_boost_lag_one_pass_vbr(VP9_COMP *cpi, uint64_t avg_sad_current) { void vp9_avg_source_sad(VP9_COMP *cpi) { VP9_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; +#if CONFIG_VP9_HIGHBITDEPTH + if (cm->use_highbitdepth) return; +#endif rc->high_source_sad = 0; if (cpi->Last_Source != NULL && cpi->Last_Source->y_width == cpi->Source->y_width && -- 2.40.0