ref: c70552c01ed48f46ba9f6ba41c9555b34fd37bce
parent: a4cc75cd754a20176aef52e537b0ffeb2abc44c9
parent: 62261d5eb83183f67113cd9cea9d8c0759137f68
author: Marco Paniconi <marpan@google.com>
date: Mon Aug 13 19:20:58 EDT 2018
Merge "vp9-svc: Fixes for cyclic refresh for SVC."
--- a/test/svc_datarate_test.cc
+++ b/test/svc_datarate_test.cc
@@ -1353,7 +1353,7 @@
}
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
CheckLayerRateTargeting(number_spatial_layers_, number_temporal_layers_, 0.73,
- 1.2);
+ 1.25);
#if CONFIG_VP9_DECODER
// The non-reference frames are expected to be mismatched frames as the
// encoder will avoid loopfilter on these frames.
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -146,6 +146,9 @@
size_t consec_zero_mv_size;
VP9_COMMON *const cm = &cpi->common;
lc->sb_index = 0;
+ lc->actual_num_seg1_blocks = 0;
+ lc->actual_num_seg2_blocks = 0;
+ lc->counter_encode_maxq_scene_change = 0;
CHECK_MEM_ERROR(cm, lc->map,
vpx_malloc(mi_rows * mi_cols * sizeof(*lc->map)));
memset(lc->map, 0, mi_rows * mi_cols);
@@ -349,6 +352,9 @@
cpi->consec_zero_mv = lc->consec_zero_mv;
lc->consec_zero_mv = temp3;
cr->sb_index = lc->sb_index;
+ cr->actual_num_seg1_blocks = lc->actual_num_seg1_blocks;
+ cr->actual_num_seg2_blocks = lc->actual_num_seg2_blocks;
+ cr->counter_encode_maxq_scene_change = lc->counter_encode_maxq_scene_change;
}
}
@@ -376,6 +382,9 @@
lc->consec_zero_mv = cpi->consec_zero_mv;
cpi->consec_zero_mv = temp3;
lc->sb_index = cr->sb_index;
+ lc->actual_num_seg1_blocks = cr->actual_num_seg1_blocks;
+ lc->actual_num_seg2_blocks = cr->actual_num_seg2_blocks;
+ lc->counter_encode_maxq_scene_change = cr->counter_encode_maxq_scene_change;
}
}
--- a/vp9/encoder/vp9_svc_layercontext.h
+++ b/vp9/encoder/vp9_svc_layercontext.h
@@ -60,10 +60,14 @@
size_t layer_size;
struct vpx_psnr_pkt psnr_pkt;
// Cyclic refresh parameters (aq-mode=3), that need to be updated per-frame.
+ // TODO(jianj/marpan): Is it better to use the full cyclic refresh struct.
int sb_index;
signed char *map;
uint8_t *last_coded_q_map;
uint8_t *consec_zero_mv;
+ int actual_num_seg1_blocks;
+ int actual_num_seg2_blocks;
+ int counter_encode_maxq_scene_change;
uint8_t speed;
} LAYER_CONTEXT;