diff options
Diffstat (limited to 'vp9/encoder/vp9_encodeframe.c')
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 67069e7c1..e3570504e 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -747,6 +747,8 @@ static int choose_partitioning(VP9_COMP *cpi, const uint8_t *d; int sp; int dp; + // Ref frame used in partitioning. + MV_REFERENCE_FRAME ref_frame_partition = LAST_FRAME; int pixels_wide = 64, pixels_high = 64; int64_t thresholds[4] = {cpi->vbp_thresholds[0], cpi->vbp_thresholds[1], cpi->vbp_thresholds[2], cpi->vbp_thresholds[3]}; @@ -771,6 +773,10 @@ static int choose_partitioning(VP9_COMP *cpi, } } + for (i = 0; i < 9; i++) { + x->variance_low[i] = 0; + } + if (xd->mb_to_right_edge < 0) pixels_wide += (xd->mb_to_right_edge >> 3); if (xd->mb_to_bottom_edge < 0) @@ -831,8 +837,10 @@ static int choose_partitioning(VP9_COMP *cpi, mi->ref_frame[0] = GOLDEN_FRAME; mi->mv[0].as_int = 0; y_sad = y_sad_g; + ref_frame_partition = GOLDEN_FRAME; } else { x->pred_mv[LAST_FRAME] = mi->mv[0].as_mv; + ref_frame_partition = LAST_FRAME; } set_ref_ptrs(cm, xd, mi->ref_frame[0], mi->ref_frame[1]); @@ -1073,6 +1081,34 @@ static int choose_partitioning(VP9_COMP *cpi, } } } + + if (cpi->sf.short_circuit_low_temp_var) { + // Set low variance flag, only for blocks >= 32x32 and if LAST_FRAME was + // selected. + if (ref_frame_partition == LAST_FRAME) { + if (xd->mi[0]->sb_type == BLOCK_64X64 && + vt.part_variances.none.variance < (thresholds[0] >> 1)) { + x->variance_low[0] = 1; + } else if (xd->mi[0]->sb_type == BLOCK_64X32) { + if (vt.part_variances.horz[0].variance < (thresholds[0] >> 2)) + x->variance_low[1] = 1; + if (vt.part_variances.horz[1].variance < (thresholds[0] >> 2)) + x->variance_low[2] = 1; + } else if (xd->mi[0]->sb_type == BLOCK_32X64) { + if (vt.part_variances.vert[0].variance < (thresholds[0] >> 2)) + x->variance_low[3] = 1; + if (vt.part_variances.vert[1].variance < (thresholds[0] >> 2)) + x->variance_low[4] = 1; + } else { + // 32x32 + for (i = 0; i < 4; i++) { + if (!force_split[i + 1] && + vt.split[i].part_variances.none.variance < (thresholds[1] >> 1)) + x->variance_low[i + 5] = 1; + } + } + } + } return 0; } |