Fix encoder crashes and enc/dec mismatches
authorYaowu Xu <yaowu@google.com>
Tue, 12 Jan 2016 17:47:07 +0000 (09:47 -0800)
committerYaowu Xu <yaowu@google.com>
Wed, 13 Jan 2016 17:51:05 +0000 (09:51 -0800)
This commit adds the logic for segmentation map initialization and
disable temporal update of segmentation map when error-resilient
mode is on. It fixes the enc/dec mistmates (release build) and
assertions(debug) when both aq-mode and error-resilient are on.

Change-Id: Id2155e8b28962cf1f64494f4df0c8d79499b6890

vp10/encoder/aq_complexity.c
vp10/encoder/aq_variance.c
vp10/encoder/segmentation.c

index 0de044c..2506a4e 100644 (file)
@@ -51,7 +51,7 @@ void vp10_setup_in_frame_q_adj(VP10_COMP *cpi) {
   // Make SURE use of floating point in this function is safe.
   vpx_clear_system_state();
 
-  if (cm->frame_type == KEY_FRAME ||
+  if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
       cpi->refresh_alt_ref_frame ||
       (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
     int segment;
index e8e88c3..bed5162 100644 (file)
@@ -47,7 +47,7 @@ void vp10_vaq_frame_setup(VP10_COMP *cpi) {
   struct segmentation *seg = &cm->seg;
   int i;
 
-  if (cm->frame_type == KEY_FRAME ||
+  if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
       cpi->refresh_alt_ref_frame ||
       (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
     vp10_enable_segmentation(seg);
index 6a20ee4..677910f 100644 (file)
@@ -273,7 +273,7 @@ void vp10_choose_segmap_coding_method(VP10_COMMON *cm, MACROBLOCKD *xd) {
   no_pred_cost = cost_segmap(no_pred_segcounts, no_pred_tree);
 
   // Key frames cannot use temporal prediction
-  if (!frame_is_intra_only(cm)) {
+  if (!frame_is_intra_only(cm) && !cm->error_resilient_mode) {
     // Work out probability tree for coding those segments not
     // predicted using the temporal method and the cost.
     calc_segtree_probs(t_unpred_seg_counts, t_pred_tree, segp->tree_probs);
@@ -300,6 +300,7 @@ void vp10_choose_segmap_coding_method(VP10_COMMON *cm, MACROBLOCKD *xd) {
 
   // Now choose which coding method to use.
   if (t_pred_cost < no_pred_cost) {
+    assert(!cm->error_resilient_mode);
     seg->temporal_update = 1;
 #if !CONFIG_MISC_FIXES
     memcpy(segp->tree_probs, t_pred_tree, sizeof(t_pred_tree));