summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorJackyChen <jackychen@google.com>2016-06-15 10:14:14 -0700
committerJackyChen <jackychen@google.com>2016-06-15 13:46:24 -0700
commit7abc05c9af7468ea9ad9df31505181eafaec9341 (patch)
tree6ee91d8e88dda721cbb463e5cc4d33f0e54c7d53 /vp9
parent9c90830165413f5197d993a94e4b46def3e53aa3 (diff)
downloadlibvpx-7abc05c9af7468ea9ad9df31505181eafaec9341.tar
libvpx-7abc05c9af7468ea9ad9df31505181eafaec9341.tar.gz
libvpx-7abc05c9af7468ea9ad9df31505181eafaec9341.tar.bz2
libvpx-7abc05c9af7468ea9ad9df31505181eafaec9341.zip
vp9: Add bias to last frame in choose_partitioning.
This change is only for real-time mode if short_circuit_low_temp_var is on. Add bias to last frame in choosing ref frame for partitioning, when y_sad and y_sad_g are close. It speeds up real-time encoding by 0.5% on some clips with less than 0.1% overall PSNR drop on rtc test set. Change-Id: I2a2110fe36455f3d8f0fc404aef2228f512e8df8
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encodeframe.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index d8bfb9d79..6af0c0b9d 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -796,7 +796,7 @@ static int choose_partitioning(VP9_COMP *cpi,
const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, LAST_FRAME);
const YV12_BUFFER_CONFIG *yv12_g = NULL;
- unsigned int y_sad, y_sad_g;
+ unsigned int y_sad, y_sad_g, y_sad_thr;
const BLOCK_SIZE bsize = BLOCK_32X32
+ (mi_col + 4 < cm->mi_cols) * 2 + (mi_row + 4 < cm->mi_rows);
@@ -829,7 +829,10 @@ static int choose_partitioning(VP9_COMP *cpi,
mi->interp_filter = BILINEAR;
y_sad = vp9_int_pro_motion_estimation(cpi, x, bsize, mi_row, mi_col);
- if (y_sad_g < y_sad) {
+ // Pick ref frame for partitioning, bias last frame when y_sad_g and y_sad
+ // are close if short_circuit_low_temp_var is on.
+ y_sad_thr = cpi->sf.short_circuit_low_temp_var ? (y_sad * 7) >> 3 : y_sad;
+ if (y_sad_g < y_sad_thr) {
vp9_setup_pre_planes(xd, 0, yv12_g, mi_row, mi_col,
&cm->frame_refs[GOLDEN_FRAME - 1].sf);
mi->ref_frame[0] = GOLDEN_FRAME;