ref: 3f252e30e4faa6609e651210ea50941f08f3b7be
parent: f0605f4b7e426013f61927702c971f330e7c3e5b
author: Adrian Grange <agrange@google.com>
date: Fri Apr 27 05:01:17 EDT 2012
Modified ARNR MC-filter to ignore ARF frame 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
--- a/vp8/encoder/temporal_filter.c
+++ b/vp8/encoder/temporal_filter.c
@@ -288,8 +288,6 @@
for (frame = 0; frame < frame_count; frame++)
{
- int err = 0;
-
if (cpi->frames[frame] == NULL)
continue;
@@ -296,23 +294,30 @@
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)
{
--
⑨