From 96e41cb461893e240e24950242879a538aee7728 Mon Sep 17 00:00:00 2001 From: Scott LaVarnway Date: Thu, 14 Mar 2013 09:49:38 -0700 Subject: [PATCH] Removed shadow warnings : bitstream.c encodeframe.c onyx_if.c ratectrl.c and quantize.c Adding -Wshadow to CFLAGS generated a bunch of warnings. This patch removes these warnings. Change-Id: I8c8faa9fde57c1c49662d332a90bc8d9a0f4a2ce --- vp8/encoder/bitstream.c | 22 +++++++++++----------- vp8/encoder/encodeframe.c | 3 +-- vp8/encoder/onyx_if.c | 2 +- vp8/encoder/quantize.c | 6 +++--- vp8/encoder/ratectrl.c | 4 ++-- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c index 8f94171e6..5c41ec8a1 100644 --- a/vp8/encoder/bitstream.c +++ b/vp8/encoder/bitstream.c @@ -90,17 +90,17 @@ static void update_mode( if (new_b + (n << 8) < old_b) { - int i = 0; + int j = 0; vp8_write_bit(w, 1); do { - const vp8_prob p = Pnew[i]; + const vp8_prob p = Pnew[j]; - vp8_write_literal(w, Pcur[i] = p ? p : 1, 8); + vp8_write_literal(w, Pcur[j] = p ? p : 1, 8); } - while (++i < n); + while (++j < n); } else vp8_write_bit(w, 0); @@ -245,15 +245,15 @@ void vp8_pack_tokens_c(vp8_writer *w, const TOKENEXTRA *p, int xcount) if (L) { - const unsigned char *pp = b->prob; - int v = e >> 1; - int n = L; /* number of bits in v, assumed nonzero */ - int i = 0; + const unsigned char *proba = b->prob; + const int v2 = e >> 1; + int n2 = L; /* number of bits in v2, assumed nonzero */ + i = 0; do { - const int bb = (v >> --n) & 1; - split = 1 + (((range - 1) * pp[i>>1]) >> 8); + const int bb = (v2 >> --n2) & 1; + split = 1 + (((range - 1) * proba[i>>1]) >> 8); i = b->tree[i+bb]; if (bb) @@ -301,7 +301,7 @@ void vp8_pack_tokens_c(vp8_writer *w, const TOKENEXTRA *p, int xcount) lowvalue <<= shift; } - while (n); + while (n2); } diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index d1b647be9..07bc33ced 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -852,11 +852,10 @@ void vp8_encode_frame(VP8_COMP *cpi) if (xd->segmentation_enabled) { - int i, j; + int j; if (xd->segmentation_enabled) { - for (i = 0; i < cpi->encoding_thread_count; i++) { for (j = 0; j < 4; j++) diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 555a9e4bc..60dd856f4 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -826,7 +826,7 @@ void vp8_set_speed_features(VP8_COMP *cpi) { unsigned int sum = 0; unsigned int total_mbs = cm->MBs; - int i, thresh; + int thresh; unsigned int total_skip; int min = 2000; diff --git a/vp8/encoder/quantize.c b/vp8/encoder/quantize.c index 4e2fef793..fda997ff6 100644 --- a/vp8/encoder/quantize.c +++ b/vp8/encoder/quantize.c @@ -184,17 +184,17 @@ void vp8_strict_quantize_b_c(BLOCK *b, BLOCKD *d) for (i = 0; i < 16; i++) { int dq; - int round; + int rounding; /*TODO: These arrays should be stored in zig-zag order.*/ rc = vp8_default_zig_zag1d[i]; z = coeff_ptr[rc]; dq = dequant_ptr[rc]; - round = dq >> 1; + rounding = dq >> 1; /* Sign of z. */ sz = -(z < 0); x = (z + sz) ^ sz; - x += round; + x += rounding; if (x >= dq) { /* Quantize x. */ diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c index 65fd0c5be..8e3c01d93 100644 --- a/vp8/encoder/ratectrl.c +++ b/vp8/encoder/ratectrl.c @@ -614,7 +614,6 @@ static void calc_gf_params(VP8_COMP *cpi) static void calc_pframe_target_size(VP8_COMP *cpi) { int min_frame_target; - int Adjustment; int old_per_frame_bandwidth = cpi->per_frame_bandwidth; if ( cpi->current_layer > 0) @@ -658,6 +657,7 @@ static void calc_pframe_target_size(VP8_COMP *cpi) /* 1 pass */ else { + int Adjustment; /* Make rate adjustment to recover bits spent in key frame * Test to see if the key frame inter data rate correction * should still be in force @@ -688,7 +688,7 @@ static void calc_pframe_target_size(VP8_COMP *cpi) */ if ((cpi->gf_overspend_bits > 0) && (cpi->this_frame_target > min_frame_target)) { - int Adjustment = (cpi->non_gf_bitrate_adjustment <= cpi->gf_overspend_bits) ? cpi->non_gf_bitrate_adjustment : cpi->gf_overspend_bits; + Adjustment = (cpi->non_gf_bitrate_adjustment <= cpi->gf_overspend_bits) ? cpi->non_gf_bitrate_adjustment : cpi->gf_overspend_bits; if (Adjustment > (cpi->this_frame_target - min_frame_target)) Adjustment = (cpi->this_frame_target - min_frame_target);