summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-05-31 09:59:15 -0700
committerMarco Paniconi <marpan@google.com>2018-05-31 11:34:51 -0700
commitbfe85191dda47ce90f655864bf848c71ff6eed22 (patch)
treebac9b976ec5ce3d94c408f1b0616da8d6cd7ee32
parent4caabd362d8811e14ba23d903c4ad60df730c6db (diff)
downloadlibvpx-bfe85191dda47ce90f655864bf848c71ff6eed22.tar
libvpx-bfe85191dda47ce90f655864bf848c71ff6eed22.tar.gz
libvpx-bfe85191dda47ce90f655864bf848c71ff6eed22.tar.bz2
libvpx-bfe85191dda47ce90f655864bf848c71ff6eed22.zip
vp9-svc: Fix to some frame metrics for real-time mode.
Add condition of LAST frame to the consec_zeromv and avg_frame_low_motion metrics. This is needed for SVC as the golden reference is a spatial reference and should not be included in the metric computation. Small/negligible change in metrics on RTC set. Change-Id: I6ea16298fae566bb288c34cf50d120b509146eee
-rw-r--r--vp9/encoder/vp9_encodeframe.c3
-rw-r--r--vp9/encoder/vp9_ratectrl.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 90906cc46..d2281d976 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -5140,7 +5140,8 @@ static void update_zeromv_cnt(VP9_COMP *const cpi, const MODE_INFO *const mi,
for (y = 0; y < ymis; y++)
for (x = 0; x < xmis; x++) {
int map_offset = block_index + y * cm->mi_cols + x;
- if (is_inter_block(mi) && mi->segment_id <= CR_SEGMENT_ID_BOOST2) {
+ if (mi->ref_frame[0] == LAST_FRAME && is_inter_block(mi) &&
+ mi->segment_id <= CR_SEGMENT_ID_BOOST2) {
if (abs(mv.row) < 8 && abs(mv.col) < 8) {
if (cpi->consec_zero_mv[map_offset] < 255)
cpi->consec_zero_mv[map_offset]++;
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index 11547fb2e..9e361e768 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1496,7 +1496,8 @@ static void compute_frame_low_motion(VP9_COMP *const cpi) {
int cnt_zeromv = 0;
for (mi_row = 0; mi_row < rows; mi_row++) {
for (mi_col = 0; mi_col < cols; mi_col++) {
- if (abs(mi[0]->mv[0].as_mv.row) < 16 && abs(mi[0]->mv[0].as_mv.col) < 16)
+ if (mi[0]->ref_frame[0] == LAST_FRAME &&
+ abs(mi[0]->mv[0].as_mv.row) < 16 && abs(mi[0]->mv[0].as_mv.col) < 16)
cnt_zeromv++;
mi++;
}