From 90b9f993c113cf13e2648cebc46a0cf94afd1ba0 Mon Sep 17 00:00:00 2001
From: Deb Mukherjee <debargha@google.com>
Date: Tue, 17 Jan 2012 09:23:28 -0800
Subject: [PATCH] Modifying the base q propagation in the mfqe post processing
 filter in a way such that when there is a single bad frame, the
 post-processing is applied not only to just that frame but a few subsequent
 frames as well.

Change-Id: Iba5d9896eed77244eb76b4a74692a93f8ecff634
---
 vp8/common/postproc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c
index eb17a7ca6a..cb81cb52a4 100644
--- a/vp8/common/postproc.c
+++ b/vp8/common/postproc.c
@@ -962,20 +962,25 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
                             q, 1, 0, RTCD_VTABLE(oci));
             }
         }
+        /* Move partially towards the base q of the previous frame */
+        oci->postproc_state.last_base_qindex = (3*oci->postproc_state.last_base_qindex + oci->base_qindex)>>2;
     }
     else if (flags & VP8D_DEMACROBLOCK)
     {
         vp8_deblock_and_de_macro_block(oci->frame_to_show, &oci->post_proc_buffer,
                                        q + (deblock_level - 5) * 10, 1, 0, RTCD_VTABLE(oci));
+        oci->postproc_state.last_base_qindex = oci->base_qindex;
     }
     else if (flags & VP8D_DEBLOCK)
     {
         vp8_deblock(oci->frame_to_show, &oci->post_proc_buffer,
                     q, 1, 0, RTCD_VTABLE(oci));
+        oci->postproc_state.last_base_qindex = oci->base_qindex;
     }
     else
     {
         vp8_yv12_copy_frame_ptr(oci->frame_to_show, &oci->post_proc_buffer);
+        oci->postproc_state.last_base_qindex = oci->base_qindex;
     }
 
     if (flags & VP8D_ADDNOISE)
@@ -1361,6 +1366,5 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
     dest->y_width = oci->Width;
     dest->y_height = oci->Height;
     dest->uv_height = dest->y_height / 2;
-    oci->postproc_state.last_base_qindex = oci->base_qindex;
     return 0;
 }
-- 
GitLab