]> granicus.if.org Git - libvpx/commitdiff
Modified ARNR MC-filter to ignore ARF frame
authorAdrian Grange <agrange@google.com>
Fri, 27 Apr 2012 16:01:17 +0000 (09:01 -0700)
committerAdrian Grange <agrange@google.com>
Fri, 27 Apr 2012 16:01:17 +0000 (09:01 -0700)
The ARNR filter uses MC to find the best match between the
ARF and other nearby frames in the filter-set. Since the
ARF is a member of the filter-set, MC in that case is
unnecesssary. This patch modifies the filter so it does
not apply MC in this case.

Change-Id: Ic0321199c08db2189a57f28d1700b745bc7ff66d

vp8/encoder/temporal_filter.c

index b82ea47cb31b4727b1154cd45ce68398b91827b8..cfe91224637380f9c8bdfaa1b1aaca3ace49de39 100644 (file)
@@ -288,31 +288,36 @@ static void vp8_temporal_filter_iterate_c
 
             for (frame = 0; frame < frame_count; frame++)
             {
-                int err = 0;
-
                 if (cpi->frames[frame] == NULL)
                     continue;
 
                 mbd->block[0].bmi.mv.as_mv.row = 0;
                 mbd->block[0].bmi.mv.as_mv.col = 0;
 
+                if (frame == alt_ref_index)
+                {
+                    filter_weight = 2;
+                }
+                else
+                {
+                    int err = 0;
 #if ALT_REF_MC_ENABLED
 #define THRESH_LOW   10000
 #define THRESH_HIGH  20000
-
-                // Find best match in this frame by MC
-                err = vp8_temporal_filter_find_matching_mb_c
-                          (cpi,
-                           cpi->frames[alt_ref_index],
-                           cpi->frames[frame],
-                           mb_y_offset,
-                           THRESH_LOW);
+                    // Find best match in this frame by MC
+                    err = vp8_temporal_filter_find_matching_mb_c
+                              (cpi,
+                               cpi->frames[alt_ref_index],
+                               cpi->frames[frame],
+                               mb_y_offset,
+                               THRESH_LOW);
 #endif
-                // Assign higher weight to matching MB if it's error
-                // score is lower. If not applying MC default behavior
-                // is to weight all MBs equal.
-                filter_weight = err<THRESH_LOW
-                                  ? 2 : err<THRESH_HIGH ? 1 : 0;
+                    // Assign higher weight to matching MB if it's error
+                    // score is lower. If not applying MC default behavior
+                    // is to weight all MBs equal.
+                    filter_weight = err<THRESH_LOW
+                                       ? 2 : err<THRESH_HIGH ? 1 : 0;
+                }
 
                 if (filter_weight != 0)
                 {