shithub: libvpx

Download patch

ref: 0c2919c3d57c92db996531b17255c6c444375600
parent: de5546c37297383aae7648e84fd38009a333b9cf
author: Scott LaVarnway <slavarnway@google.com>
date: Fri Jan 25 12:06:32 EST 2013

Bug fix:  error-concealment enabled changed postproc output

When error concealment is enabled, it swaps the mi and prev_mi ptrs after
each frame is decoded.  The postproc uses the mi ptr for the mode info context.
Now the postproc will use the correct mode info context.

Change-Id: I537ae5450f319c624999b44525bb52bb30047b7b

--- a/vp8/common/mfqe.c
+++ b/vp8/common/mfqe.c
@@ -280,7 +280,7 @@
 
     FRAME_TYPE frame_type = cm->frame_type;
     /* Point at base of Mb MODE_INFO list has motion vectors etc */
-    const MODE_INFO *mode_info_context = cm->mi;
+    const MODE_INFO *mode_info_context = cm->show_frame_mi;
     int mb_row;
     int mb_col;
     int totmap, map[4];
--- a/vp8/common/onyxc_int.h
+++ b/vp8/common/onyxc_int.h
@@ -127,7 +127,8 @@
     MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */
     MODE_INFO *prev_mi;  /* 'mi' from last frame (points into prev_mip) */
 #endif
-
+    MODE_INFO *show_frame_mi;  /* MODE_INFO for the last decoded frame
+                                  to show */
     LOOPFILTERTYPE filter_type;
 
     loop_filter_info_n lf_info;
--- a/vp8/common/postproc.c
+++ b/vp8/common/postproc.c
@@ -334,7 +334,7 @@
     double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065;
     int ppl = (int)(level + .5);
 
-    const MODE_INFO *mode_info_context = cm->mi;
+    const MODE_INFO *mode_info_context = cm->show_frame_mi;
     int mbr, mbc;
 
     /* The pixel thresholds are adjusted according to if or not the macroblock
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -419,7 +419,13 @@
 
     vp8_clear_system_state();
 
-#if CONFIG_ERROR_CONCEALMENT
+    if (cm->show_frame)
+    {
+        cm->current_video_frame++;
+        cm->show_frame_mi = cm->mi;
+    }
+
+    #if CONFIG_ERROR_CONCEALMENT
     /* swap the mode infos to storage for future error concealment */
     if (pbi->ec_enabled && pbi->common.prev_mi)
     {
@@ -440,9 +446,6 @@
         }
     }
 #endif
-
-    if (cm->show_frame)
-        cm->current_video_frame++;
 
     pbi->ready_for_new_data = 0;
     pbi->last_time_stamp = time_stamp;
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -5362,6 +5362,7 @@
 #endif
 
 #if CONFIG_POSTPROC
+        cpi->common.show_frame_mi = cpi->common.mi;
         ret = vp8_post_proc_frame(&cpi->common, dest, flags);
 #else
 
--