diff options
-rw-r--r-- | vp10/encoder/rdopt.c | 10 | ||||
-rw-r--r-- | vp9/encoder/vp9_denoiser.c | 2 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 35 |
3 files changed, 31 insertions, 16 deletions
diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c index b1077cb21..c62da964a 100644 --- a/vp10/encoder/rdopt.c +++ b/vp10/encoder/rdopt.c @@ -1073,6 +1073,12 @@ static int64_t rd_pick_intra_sub_8x8_y_mode(VP10_COMP *cpi, MACROBLOCK *mb, memcpy(t_above, xd->plane[0].above_context, sizeof(t_above)); memcpy(t_left, xd->plane[0].left_context, sizeof(t_left)); + // TODO(any): Add search of the tx_type to improve rd performance at the + // expense of speed. + mic->mbmi.tx_type = DCT_DCT; + + // Later we can add search of the tx_type to improve results. + // For now just set it to DCT_DCT // Pick modes for each sub-block (of size 4x4, 4x8, or 8x4) in an 8x8 block. for (idy = 0; idy < 2; idy += num_4x4_blocks_high) { for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) { @@ -3940,6 +3946,10 @@ void vp10_rd_pick_inter_mode_sub8x8(VP10_COMP *cpi, for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) filter_cache[i] = INT64_MAX; + // TODO(any): Add search of the tx_type to improve rd performance at the + // expense of speed. + mbmi->tx_type = DCT_DCT; + if (cm->interp_filter != BILINEAR) { tmp_best_filter = EIGHTTAP; if (x->source_variance < sf->disable_filter_search_var_thresh) { diff --git a/vp9/encoder/vp9_denoiser.c b/vp9/encoder/vp9_denoiser.c index 99118f5df..e419cffd8 100644 --- a/vp9/encoder/vp9_denoiser.c +++ b/vp9/encoder/vp9_denoiser.c @@ -332,7 +332,7 @@ void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb, struct buf_2d src = mb->plane[0].src; int is_skin = 0; - if (bs <= BLOCK_16X16 && denoiser->denoising_level >= kDenLow) { + if (bs <= BLOCK_32X32 && denoiser->denoising_level >= kDenLow) { is_skin = vp9_compute_skin_block(mb->plane[0].src.buf, mb->plane[1].src.buf, mb->plane[2].src.buf, diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index f00a58ce2..1480ea418 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -3355,24 +3355,25 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, } if (!disable_skip) { - vpx_prob skip_prob = vp9_get_skip_prob(cm, xd); + const vpx_prob skip_prob = vp9_get_skip_prob(cm, xd); + const int skip_cost0 = vp9_cost_bit(skip_prob, 0); + const int skip_cost1 = vp9_cost_bit(skip_prob, 1); + if (skippable) { // Back out the coefficient coding costs rate2 -= (rate_y + rate_uv); // Cost the skip mb case - rate2 += vp9_cost_bit(skip_prob, 1); + rate2 += skip_cost1; } else if (ref_frame != INTRA_FRAME && !xd->lossless) { if (RDCOST(x->rdmult, x->rddiv, - rate_y + rate_uv + vp9_cost_bit(skip_prob, 0), - distortion2) < - RDCOST(x->rdmult, x->rddiv, - vp9_cost_bit(skip_prob, 1), total_sse)) { + rate_y + rate_uv + skip_cost0, distortion2) < + RDCOST(x->rdmult, x->rddiv, skip_cost1, total_sse)) { // Add in the cost of the no skip flag. - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); + rate2 += skip_cost0; } else { // FIXME(rbultje) make this work for splitmv also - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1); + rate2 += skip_cost1; distortion2 = total_sse; assert(total_sse >= 0); rate2 -= (rate_y + rate_uv); @@ -3380,7 +3381,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, } } else { // Add in the cost of the no skip flag. - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); + rate2 += skip_cost0; } // Calculate the final RD estimate for this mode. @@ -4152,17 +4153,21 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, } if (!disable_skip) { + const vpx_prob skip_prob = vp9_get_skip_prob(cm, xd); + const int skip_cost0 = vp9_cost_bit(skip_prob, 0); + const int skip_cost1 = vp9_cost_bit(skip_prob, 1); + // Skip is never coded at the segment level for sub8x8 blocks and instead // always coded in the bitstream at the mode info level. - if (ref_frame != INTRA_FRAME && !xd->lossless) { - if (RDCOST(x->rdmult, x->rddiv, rate_y + rate_uv, distortion2) < - RDCOST(x->rdmult, x->rddiv, 0, total_sse)) { + if (RDCOST(x->rdmult, x->rddiv, + rate_y + rate_uv + skip_cost0, distortion2) < + RDCOST(x->rdmult, x->rddiv, skip_cost1, total_sse)) { // Add in the cost of the no skip flag. - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); + rate2 += skip_cost0; } else { // FIXME(rbultje) make this work for splitmv also - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1); + rate2 += skip_cost1; distortion2 = total_sse; assert(total_sse >= 0); rate2 -= (rate_y + rate_uv); @@ -4172,7 +4177,7 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, } } else { // Add in the cost of the no skip flag. - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); + rate2 += skip_cost0; } // Calculate the final RD estimate for this mode. |