From 60bbd43995da739e83113a6d125ed945f29efbbc Mon Sep 17 00:00:00 2001 From: Scott LaVarnway Date: Thu, 14 Mar 2013 08:23:26 -0700 Subject: [PATCH] Removed shadow warnings : loopfilter*.c Adding -Wshadow to CFLAGS generated a bunch of warnings. This commit is based on work already done by jzern. Change-Id: Iefc08a7ab601c4d1b507f039577433bfb1c6cc9d --- vp8/common/loopfilter.c | 19 +++++++-------- vp8/common/loopfilter_filters.c | 52 ++++++++++++++++++++--------------------- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/vp8/common/loopfilter.c b/vp8/common/loopfilter.c index 8681b7a..19857a7 100644 --- a/vp8/common/loopfilter.c +++ b/vp8/common/loopfilter.c @@ -156,39 +156,38 @@ void vp8_loop_filter_frame_init(VP8_COMMON *cm, continue; } - lvl_ref = lvl_seg; - /* INTRA_FRAME */ ref = INTRA_FRAME; /* Apply delta for reference frame */ - lvl_ref += mbd->ref_lf_deltas[ref]; + lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref]; /* Apply delta for Intra modes */ mode = 0; /* B_PRED */ /* Only the split mode BPRED has a further special case */ - lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode]; - lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; /* clamp */ + lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode]; + /* clamp */ + lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; lfi->lvl[seg][ref][mode] = lvl_mode; mode = 1; /* all the rest of Intra modes */ - lvl_mode = (lvl_ref > 0) ? (lvl_ref > 63 ? 63 : lvl_ref) : 0; /* clamp */ + /* clamp */ + lvl_mode = (lvl_ref > 0) ? (lvl_ref > 63 ? 63 : lvl_ref) : 0; lfi->lvl[seg][ref][mode] = lvl_mode; /* LAST, GOLDEN, ALT */ for(ref = 1; ref < MAX_REF_FRAMES; ref++) { - int lvl_ref = lvl_seg; - /* Apply delta for reference frame */ - lvl_ref += mbd->ref_lf_deltas[ref]; + lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref]; /* Apply delta for Inter modes */ for (mode = 1; mode < 4; mode++) { lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode]; - lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; /* clamp */ + /* clamp */ + lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; lfi->lvl[seg][ref][mode] = lvl_mode; } diff --git a/vp8/common/loopfilter_filters.c b/vp8/common/loopfilter_filters.c index 8235f6e..1d51696 100644 --- a/vp8/common/loopfilter_filters.c +++ b/vp8/common/loopfilter_filters.c @@ -54,7 +54,7 @@ static void vp8_filter(signed char mask, uc hev, uc *op1, { signed char ps0, qs0; signed char ps1, qs1; - signed char vp8_filter, Filter1, Filter2; + signed char filter_value, Filter1, Filter2; signed char u; ps1 = (signed char) * op1 ^ 0x80; @@ -63,35 +63,35 @@ static void vp8_filter(signed char mask, uc hev, uc *op1, qs1 = (signed char) * oq1 ^ 0x80; /* add outer taps if we have high edge variance */ - vp8_filter = vp8_signed_char_clamp(ps1 - qs1); - vp8_filter &= hev; + filter_value = vp8_signed_char_clamp(ps1 - qs1); + filter_value &= hev; /* inner taps */ - vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0)); - vp8_filter &= mask; + filter_value = vp8_signed_char_clamp(filter_value + 3 * (qs0 - ps0)); + filter_value &= mask; /* save bottom 3 bits so that we round one side +4 and the other +3 * if it equals 4 we'll set to adjust by -1 to account for the fact * we'd round 3 the other way */ - Filter1 = vp8_signed_char_clamp(vp8_filter + 4); - Filter2 = vp8_signed_char_clamp(vp8_filter + 3); + Filter1 = vp8_signed_char_clamp(filter_value + 4); + Filter2 = vp8_signed_char_clamp(filter_value + 3); Filter1 >>= 3; Filter2 >>= 3; u = vp8_signed_char_clamp(qs0 - Filter1); *oq0 = u ^ 0x80; u = vp8_signed_char_clamp(ps0 + Filter2); *op0 = u ^ 0x80; - vp8_filter = Filter1; + filter_value = Filter1; /* outer tap adjustments */ - vp8_filter += 1; - vp8_filter >>= 1; - vp8_filter &= ~hev; + filter_value += 1; + filter_value >>= 1; + filter_value &= ~hev; - u = vp8_signed_char_clamp(qs1 - vp8_filter); + u = vp8_signed_char_clamp(qs1 - filter_value); *oq1 = u ^ 0x80; - u = vp8_signed_char_clamp(ps1 + vp8_filter); + u = vp8_signed_char_clamp(ps1 + filter_value); *op1 = u ^ 0x80; } @@ -162,7 +162,7 @@ static void vp8_mbfilter(signed char mask, uc hev, uc *op2, uc *op1, uc *op0, uc *oq0, uc *oq1, uc *oq2) { signed char s, u; - signed char vp8_filter, Filter1, Filter2; + signed char filter_value, Filter1, Filter2; signed char ps2 = (signed char) * op2 ^ 0x80; signed char ps1 = (signed char) * op1 ^ 0x80; signed char ps0 = (signed char) * op0 ^ 0x80; @@ -171,11 +171,11 @@ static void vp8_mbfilter(signed char mask, uc hev, signed char qs2 = (signed char) * oq2 ^ 0x80; /* add outer taps if we have high edge variance */ - vp8_filter = vp8_signed_char_clamp(ps1 - qs1); - vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0)); - vp8_filter &= mask; + filter_value = vp8_signed_char_clamp(ps1 - qs1); + filter_value = vp8_signed_char_clamp(filter_value + 3 * (qs0 - ps0)); + filter_value &= mask; - Filter2 = vp8_filter; + Filter2 = filter_value; Filter2 &= hev; /* save bottom 3 bits so that we round one side +4 and the other +3 */ @@ -188,8 +188,8 @@ static void vp8_mbfilter(signed char mask, uc hev, /* only apply wider filter if not high edge variance */ - vp8_filter &= ~hev; - Filter2 = vp8_filter; + filter_value &= ~hev; + Filter2 = filter_value; /* roughly 3/7th difference across boundary */ u = vp8_signed_char_clamp((63 + Filter2 * 27) >> 7); @@ -291,24 +291,24 @@ static signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1) static void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1) { - signed char vp8_filter, Filter1, Filter2; + signed char filter_value, Filter1, Filter2; signed char p1 = (signed char) * op1 ^ 0x80; signed char p0 = (signed char) * op0 ^ 0x80; signed char q0 = (signed char) * oq0 ^ 0x80; signed char q1 = (signed char) * oq1 ^ 0x80; signed char u; - vp8_filter = vp8_signed_char_clamp(p1 - q1); - vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (q0 - p0)); - vp8_filter &= mask; + filter_value = vp8_signed_char_clamp(p1 - q1); + filter_value = vp8_signed_char_clamp(filter_value + 3 * (q0 - p0)); + filter_value &= mask; /* save bottom 3 bits so that we round one side +4 and the other +3 */ - Filter1 = vp8_signed_char_clamp(vp8_filter + 4); + Filter1 = vp8_signed_char_clamp(filter_value + 4); Filter1 >>= 3; u = vp8_signed_char_clamp(q0 - Filter1); *oq0 = u ^ 0x80; - Filter2 = vp8_signed_char_clamp(vp8_filter + 3); + Filter2 = vp8_signed_char_clamp(filter_value + 3); Filter2 >>= 3; u = vp8_signed_char_clamp(p0 + Filter2); *op0 = u ^ 0x80; -- 2.7.4