From: Scott LaVarnway Date: Thu, 14 Mar 2013 21:45:23 +0000 (-0700) Subject: Removed shadow warnings : postproc.c decodframe.c threading.c X-Git-Tag: v1.3.0~1142^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae64e7b408b32a8c6c3ce94c1811b6c47d884a48;p=platform%2Fupstream%2Flibvpx.git Removed shadow warnings : postproc.c decodframe.c threading.c and denoising.c Adding -Wshadow to CFLAGS generated a bunch of warnings. This patch removes these warnings. Change-Id: I434a9f4bfac9ad4ab7d2a67a35ef21e6636280da --- diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c index e40fb11..0266f4c 100644 --- a/vp8/common/postproc.c +++ b/vp8/common/postproc.c @@ -439,29 +439,28 @@ static void fillrd(struct postproc_state *state, int q, int a) char char_dist[300]; double sigma; - int ai = a, qi = q, i; + int i; vp8_clear_system_state(); - sigma = ai + .5 + .6 * (63 - qi) / 63.0; + sigma = a + .5 + .6 * (63 - q) / 63.0; /* set up a lookup table of 256 entries that matches * a gaussian distribution with sigma determined by q. */ { - double i; int next, j; next = 0; for (i = -32; i < 32; i++) { - int a = (int)(.5 + 256 * vp8_gaussian(sigma, 0, i)); + const int v = (int)(.5 + 256 * vp8_gaussian(sigma, 0, i)); - if (a) + if (v) { - for (j = 0; j < a; j++) + for (j = 0; j < v; j++) { char_dist[next+j] = (char) i; } @@ -544,12 +543,12 @@ void vp8_plane_add_noise_c(unsigned char *Start, char *noise, * filled with the same color block. */ void vp8_blend_mb_inner_c (unsigned char *y, unsigned char *u, unsigned char *v, - int y1, int u1, int v1, int alpha, int stride) + int y_1, int u_1, int v_1, int alpha, int stride) { int i, j; - int y1_const = y1*((1<<16)-alpha); - int u1_const = u1*((1<<16)-alpha); - int v1_const = v1*((1<<16)-alpha); + int y1_const = y_1*((1<<16)-alpha); + int u1_const = u_1*((1<<16)-alpha); + int v1_const = v_1*((1<<16)-alpha); y += 2*stride + 2; for (i = 0; i < 12; i++) @@ -582,12 +581,12 @@ void vp8_blend_mb_inner_c (unsigned char *y, unsigned char *u, unsigned char *v, * unblended to allow for other visualizations to be layered. */ void vp8_blend_mb_outer_c (unsigned char *y, unsigned char *u, unsigned char *v, - int y1, int u1, int v1, int alpha, int stride) + int y_1, int u_1, int v_1, int alpha, int stride) { int i, j; - int y1_const = y1*((1<<16)-alpha); - int u1_const = u1*((1<<16)-alpha); - int v1_const = v1*((1<<16)-alpha); + int y1_const = y_1*((1<<16)-alpha); + int u1_const = u_1*((1<<16)-alpha); + int v1_const = v_1*((1<<16)-alpha); for (i = 0; i < 2; i++) { @@ -646,12 +645,12 @@ void vp8_blend_mb_outer_c (unsigned char *y, unsigned char *u, unsigned char *v, } void vp8_blend_b_c (unsigned char *y, unsigned char *u, unsigned char *v, - int y1, int u1, int v1, int alpha, int stride) + int y_1, int u_1, int v_1, int alpha, int stride) { int i, j; - int y1_const = y1*((1<<16)-alpha); - int u1_const = u1*((1<<16)-alpha); - int v1_const = v1*((1<<16)-alpha); + int y1_const = y_1*((1<<16)-alpha); + int u1_const = u_1*((1<<16)-alpha); + int v1_const = v_1*((1<<16)-alpha); for (i = 0; i < 4; i++) { @@ -676,46 +675,46 @@ void vp8_blend_b_c (unsigned char *y, unsigned char *u, unsigned char *v, } } -static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int height) +static void constrain_line (int x_0, int *x_1, int y_0, int *y_1, int width, int height) { int dx; int dy; - if (*x1 > width) + if (*x_1 > width) { - dx = *x1 - x0; - dy = *y1 - y0; + dx = *x_1 - x_0; + dy = *y_1 - y_0; - *x1 = width; + *x_1 = width; if (dx) - *y1 = ((width-x0)*dy)/dx + y0; + *y_1 = ((width-x_0)*dy)/dx + y_0; } - if (*x1 < 0) + if (*x_1 < 0) { - dx = *x1 - x0; - dy = *y1 - y0; + dx = *x_1 - x_0; + dy = *y_1 - y_0; - *x1 = 0; + *x_1 = 0; if (dx) - *y1 = ((0-x0)*dy)/dx + y0; + *y_1 = ((0-x_0)*dy)/dx + y_0; } - if (*y1 > height) + if (*y_1 > height) { - dx = *x1 - x0; - dy = *y1 - y0; + dx = *x_1 - x_0; + dy = *y_1 - y_0; - *y1 = height; + *y_1 = height; if (dy) - *x1 = ((height-y0)*dx)/dy + x0; + *x_1 = ((height-y_0)*dx)/dy + x_0; } - if (*y1 < 0) + if (*y_1 < 0) { - dx = *x1 - x0; - dy = *y1 - y0; + dx = *x_1 - x_0; + dy = *y_1 - y_0; - *y1 = 0; + *y_1 = 0; if (dy) - *x1 = ((0-y0)*dx)/dy + x0; + *x_1 = ((0-y_0)*dx)/dy + x_0; } } diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index 6f8282a..a6b193b 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -1335,11 +1335,11 @@ int vp8_decode_frame(VP8D_COMP *pbi) #if CONFIG_MULTITHREAD if (pbi->b_multithreaded_rd && pc->multi_token_partition != ONE_PARTITION) { - unsigned int i; + unsigned int thread; vp8mt_decode_mb_rows(pbi, xd); vp8_yv12_extend_frame_borders(yv12_fb_new); - for (i = 0; i < pbi->decoding_thread_count; ++i) - corrupt_tokens |= pbi->mb_row_di[i].mbd.corrupted; + for (thread = 0; thread < pbi->decoding_thread_count; ++thread) + corrupt_tokens |= pbi->mb_row_di[thread].mbd.corrupted; } else #endif diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c index 73f9a83..7303189 100644 --- a/vp8/decoder/threading.c +++ b/vp8/decoder/threading.c @@ -343,7 +343,6 @@ static void mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd, int start_mb_row) for (mb_row = start_mb_row; mb_row < pc->mb_rows; mb_row += (pbi->decoding_thread_count + 1)) { - int i; int recon_yoffset, recon_uvoffset; int mb_col; int filter_level; diff --git a/vp8/encoder/denoising.c b/vp8/encoder/denoising.c index 1ee1cb5..7819265 100644 --- a/vp8/encoder/denoising.c +++ b/vp8/encoder/denoising.c @@ -206,8 +206,6 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser, MB_MODE_INFO saved_mbmi; MACROBLOCKD *filter_xd = &x->e_mbd; MB_MODE_INFO *mbmi = &filter_xd->mode_info_context->mbmi; - int mv_col; - int mv_row; int sse_diff = zero_mv_sse - best_sse; saved_mbmi = *mbmi;