From a7d4d3c550b1b98b98fb37fbe409142f45e2ca02 Mon Sep 17 00:00:00 2001 From: Johann Date: Mon, 9 May 2011 11:16:31 -0400 Subject: [PATCH] clean up unused variable warnings Change-Id: I9467d7a50eac32d8e8f3a2f26db818e47c93c94b --- examples/encoder_tmpl.c | 2 -- examples/postproc.txt | 2 +- libmkv/EbmlWriter.c | 1 - vp8/common/x86/x86_systemdependent.c | 10 +++------- vp8/decoder/arm/dequantize_arm.c | 2 -- vp8/decoder/threading.c | 3 --- vp8/encoder/encodemb.c | 2 +- vp8/encoder/rdopt.c | 10 ++++------ vp8/encoder/ssim.c | 6 +++--- vp8/encoder/temporal_filter.c | 7 +------ vp8/encoder/x86/x86_csystemdependent.c | 16 +++++----------- vp8/vp8_dx_iface.c | 2 +- vpxdec.c | 2 -- y4minput.c | 10 ---------- 14 files changed, 19 insertions(+), 56 deletions(-) diff --git a/examples/encoder_tmpl.c b/examples/encoder_tmpl.c index f109e6216..cc70b0081 100644 --- a/examples/encoder_tmpl.c +++ b/examples/encoder_tmpl.c @@ -111,8 +111,6 @@ int main(int argc, char **argv) { vpx_codec_ctx_t codec; vpx_codec_enc_cfg_t cfg; int frame_cnt = 0; - unsigned char file_hdr[IVF_FILE_HDR_SZ]; - unsigned char frame_hdr[IVF_FRAME_HDR_SZ]; vpx_image_t raw; vpx_codec_err_t res; long width; diff --git a/examples/postproc.txt b/examples/postproc.txt index c65ddda8e..0940ea24c 100644 --- a/examples/postproc.txt +++ b/examples/postproc.txt @@ -21,7 +21,7 @@ res = vpx_codec_dec_init(&codec, interface, NULL, if(res == VPX_CODEC_INCAPABLE) { printf("NOTICE: Postproc not supported by %s\n", vpx_codec_iface_name(interface)); - res = vpx_codec_dec_init(&codec, interface, NULL, 0); + res = vpx_codec_dec_init(&codec, interface, NULL, flags); } if(res) die_codec(&codec, "Failed to initialize decoder"); diff --git a/libmkv/EbmlWriter.c b/libmkv/EbmlWriter.c index 9d564c177..ac70d097d 100644 --- a/libmkv/EbmlWriter.c +++ b/libmkv/EbmlWriter.c @@ -143,7 +143,6 @@ void Ebml_SerializeUTF8(EbmlGlobal *glob, unsigned long class_id, wchar_t *s) void Ebml_SerializeData(EbmlGlobal *glob, unsigned long class_id, unsigned char *data, unsigned long data_length) { - unsigned char size = 4; Ebml_WriteID(glob, class_id); Ebml_WriteLen(glob, data_length); Ebml_Write(glob, data, data_length); diff --git a/vp8/common/x86/x86_systemdependent.c b/vp8/common/x86/x86_systemdependent.c index 17667330a..87374f3c6 100644 --- a/vp8/common/x86/x86_systemdependent.c +++ b/vp8/common/x86/x86_systemdependent.c @@ -24,10 +24,6 @@ void vp8_arch_x86_common_init(VP8_COMMON *ctx) #if CONFIG_RUNTIME_CPU_DETECT VP8_COMMON_RTCD *rtcd = &ctx->rtcd; int flags = x86_simd_caps(); - int mmx_enabled = flags & HAS_MMX; - int xmm_enabled = flags & HAS_SSE; - int wmt_enabled = flags & HAS_SSE2; - int SSSE3Enabled = flags & HAS_SSSE3; /* Note: * @@ -39,7 +35,7 @@ void vp8_arch_x86_common_init(VP8_COMMON *ctx) /* Override default functions with fastest ones for this CPU. */ #if HAVE_MMX - if (mmx_enabled) + if (flags & HAS_MMX) { rtcd->idct.idct1 = vp8_short_idct4x4llm_1_mmx; rtcd->idct.idct16 = vp8_short_idct4x4llm_mmx; @@ -83,7 +79,7 @@ void vp8_arch_x86_common_init(VP8_COMMON *ctx) #endif #if HAVE_SSE2 - if (wmt_enabled) + if (flags & HAS_SSE2) { rtcd->recon.recon2 = vp8_recon2b_sse2; rtcd->recon.recon4 = vp8_recon4b_sse2; @@ -122,7 +118,7 @@ void vp8_arch_x86_common_init(VP8_COMMON *ctx) #if HAVE_SSSE3 - if (SSSE3Enabled) + if (flags & HAS_SSSE3) { rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_ssse3; rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_ssse3; diff --git a/vp8/decoder/arm/dequantize_arm.c b/vp8/decoder/arm/dequantize_arm.c index d88adb729..98db6eeff 100644 --- a/vp8/decoder/arm/dequantize_arm.c +++ b/vp8/decoder/arm/dequantize_arm.c @@ -26,7 +26,6 @@ extern void vp8_dequantize_b_loop_v6(short *Q, short *DQC, short *DQ); void vp8_dequantize_b_neon(BLOCKD *d) { - int i; short *DQ = d->dqcoeff; short *Q = d->qcoeff; short *DQC = d->dequant; @@ -38,7 +37,6 @@ void vp8_dequantize_b_neon(BLOCKD *d) #if HAVE_ARMV6 void vp8_dequantize_b_v6(BLOCKD *d) { - int i; short *DQ = d->dqcoeff; short *Q = d->qcoeff; short *DQC = d->dequant; diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c index 9ef85e9cd..de1583473 100644 --- a/vp8/decoder/threading.c +++ b/vp8/decoder/threading.c @@ -91,7 +91,6 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int m { int eobtotal = 0; int i, do_clamp = xd->mode_info_context->mbmi.need_to_clamp_mvs; - VP8_COMMON *pc = &pbi->common; if (xd->mode_info_context->mbmi.mb_skip_coeff) { @@ -478,7 +477,6 @@ void vp8_decoder_create_threads(VP8D_COMP *pbi) void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows) { - VP8_COMMON *const pc = & pbi->common; int i; if (pbi->b_multithreaded_rd) @@ -699,7 +697,6 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd) int mb_row; VP8_COMMON *pc = &pbi->common; - int ibc = 0; int num_part = 1 << pbi->common.multi_token_partition; int i; volatile int *last_row_current_mb_col = NULL; diff --git a/vp8/encoder/encodemb.c b/vp8/encoder/encodemb.c index 2509e0698..fd42ee417 100644 --- a/vp8/encoder/encodemb.c +++ b/vp8/encoder/encodemb.c @@ -238,7 +238,7 @@ static void optimize_b(MACROBLOCK *mb, int ib, int type, int i0; int rc; int x; - int sz; + int sz = 0; int next; int rdmult; int rddiv; diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 2789cffbb..5aa17ca8d 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -297,8 +297,6 @@ void vp8_initialize_rd_consts(VP8_COMP *cpi, int Qvalue) void vp8_auto_select_speed(VP8_COMP *cpi) { - int used = cpi->oxcf.cpu_used; - int milliseconds_for_compress = (int)(1000000 / cpi->oxcf.frame_rate); milliseconds_for_compress = milliseconds_for_compress * (16 - cpi->oxcf.cpu_used) / 16; @@ -319,10 +317,10 @@ void vp8_auto_select_speed(VP8_COMP *cpi) /* // this is done during parameter valid check - if( used > 16) - used = 16; - if( used < -16) - used = -16; + if( cpi->oxcf.cpu_used > 16) + cpi->oxcf.cpu_used = 16; + if( cpi->oxcf.cpu_used < -16) + cpi->oxcf.cpu_used = -16; */ if (cpi->avg_pick_mode_time < milliseconds_for_compress && (cpi->avg_encode_time - cpi->avg_pick_mode_time) < milliseconds_for_compress) diff --git a/vp8/encoder/ssim.c b/vp8/encoder/ssim.c index 8646b5fdb..b8701e813 100644 --- a/vp8/encoder/ssim.c +++ b/vp8/encoder/ssim.c @@ -125,8 +125,8 @@ long dssim(unsigned char *s,int sp, unsigned char *r,int rp, { unsigned long sum_s=0,sum_r=0,sum_sq_s=0,sum_sq_r=0,sum_sxr=0; long long ssim3; - long long ssim_n,ssim_n1,ssim_n2; - long long ssim_d,ssim_d1,ssim_d2; + long long ssim_n1,ssim_n2; + long long ssim_d1,ssim_d2; long long ssim_t1,ssim_t2; long long c1, c2; @@ -245,4 +245,4 @@ double vp8_calc_ssimg ssim_all = (a * 4 + b + c) /6; return ssim_all; -} \ No newline at end of file +} diff --git a/vp8/encoder/temporal_filter.c b/vp8/encoder/temporal_filter.c index b77195511..48e3b9689 100644 --- a/vp8/encoder/temporal_filter.c +++ b/vp8/encoder/temporal_filter.c @@ -149,10 +149,8 @@ static int vp8_temporal_filter_find_matching_mb_c ) { MACROBLOCK *x = &cpi->mb; - int thissme; int step_param; int further_steps; - int n = 0; int sadpb = x->sadperbit16; int bestsme = INT_MAX; int num00 = 0; @@ -243,7 +241,6 @@ static void vp8_temporal_filter_iterate_c unsigned int filter_weight; int mb_cols = cpi->common.mb_cols; int mb_rows = cpi->common.mb_rows; - int MBs = cpi->common.MBs; int mb_y_offset = 0; int mb_uv_offset = 0; DECLARE_ALIGNED_ARRAY(16, unsigned int, accumulator, 16*16 + 8*8 + 8*8); @@ -269,8 +266,7 @@ static void vp8_temporal_filter_iterate_c for (mb_col = 0; mb_col < mb_cols; mb_col++) { - int i, j, k, w; - int weight_cap; + int i, j, k; int stride; vpx_memset(accumulator, 0, 384*sizeof(unsigned int)); @@ -436,7 +432,6 @@ void vp8_temporal_filter_prepare_c int frames_to_blur_forward = 0; int frames_to_blur = 0; int start_frame = 0; - unsigned int filtered = 0; int strength = cpi->oxcf.arnr_strength; diff --git a/vp8/encoder/x86/x86_csystemdependent.c b/vp8/encoder/x86/x86_csystemdependent.c index b01319fa4..c1fae468a 100644 --- a/vp8/encoder/x86/x86_csystemdependent.c +++ b/vp8/encoder/x86/x86_csystemdependent.c @@ -138,12 +138,6 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) { #if CONFIG_RUNTIME_CPU_DETECT int flags = x86_simd_caps(); - int mmx_enabled = flags & HAS_MMX; - int xmm_enabled = flags & HAS_SSE; - int wmt_enabled = flags & HAS_SSE2; - int SSE3Enabled = flags & HAS_SSE3; - int SSSE3Enabled = flags & HAS_SSSE3; - int SSE4_1Enabled = flags & HAS_SSE4_1; /* Note: * @@ -154,7 +148,7 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) /* Override default functions with fastest ones for this CPU. */ #if HAVE_MMX - if (mmx_enabled) + if (flags & HAS_MMX) { cpi->rtcd.variance.sad16x16 = vp8_sad16x16_mmx; cpi->rtcd.variance.sad16x8 = vp8_sad16x8_mmx; @@ -205,7 +199,7 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) #endif #if HAVE_SSE2 - if (wmt_enabled) + if (flags & HAS_SSE2) { cpi->rtcd.variance.sad16x16 = vp8_sad16x16_wmt; cpi->rtcd.variance.sad16x8 = vp8_sad16x8_wmt; @@ -263,7 +257,7 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) #endif #if HAVE_SSE3 - if (SSE3Enabled) + if (flags & HAS_SSE3) { cpi->rtcd.variance.sad16x16 = vp8_sad16x16_sse3; cpi->rtcd.variance.sad16x16x3 = vp8_sad16x16x3_sse3; @@ -282,7 +276,7 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) #endif #if HAVE_SSSE3 - if (SSSE3Enabled) + if (flags & HAS_SSSE3) { cpi->rtcd.variance.sad16x16x3 = vp8_sad16x16x3_ssse3; cpi->rtcd.variance.sad16x8x3 = vp8_sad16x8x3_ssse3; @@ -305,7 +299,7 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) #if HAVE_SSE4_1 - if (SSE4_1Enabled) + if (flags & HAS_SSE4_1) { cpi->rtcd.variance.sad16x16x8 = vp8_sad16x16x8_sse4; cpi->rtcd.variance.sad16x8x8 = vp8_sad16x8x8_sse4; diff --git a/vp8/vp8_dx_iface.c b/vp8/vp8_dx_iface.c index 99657e0a5..cca17c23d 100644 --- a/vp8/vp8_dx_iface.c +++ b/vp8/vp8_dx_iface.c @@ -618,8 +618,8 @@ static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx, int ctr_id, va_list args) { - vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *); #if CONFIG_POSTPROC + vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *); if (data) { diff --git a/vpxdec.c b/vpxdec.c index 3869e20ad..968ad150e 100644 --- a/vpxdec.c +++ b/vpxdec.c @@ -573,12 +573,10 @@ file_is_webm(struct input_ctx *input, { unsigned int i, n; int track_type = -1; - uint64_t tstamp=0; nestegg_io io = {nestegg_read_cb, nestegg_seek_cb, nestegg_tell_cb, input->infile}; nestegg_video_params params; - nestegg_packet * pkt; if(nestegg_init(&input->nestegg_ctx, io, NULL)) goto fail; diff --git a/y4minput.c b/y4minput.c index 449afe858..dd51421d7 100644 --- a/y4minput.c +++ b/y4minput.c @@ -146,7 +146,6 @@ static int y4m_parse_tags(y4m_input *_y4m,char *_tags){ mpeg2 and jpeg cases (thus requiring no vertical resampling).*/ static void y4m_42xmpeg2_42xjpeg_helper(unsigned char *_dst, const unsigned char *_src,int _c_w,int _c_h){ - int pli; int y; int x; for(y=0;y<_c_h;y++){ @@ -178,8 +177,6 @@ static void y4m_convert_42xmpeg2_42xjpeg(y4m_input *_y4m,unsigned char *_dst, int c_h; int c_sz; int pli; - int y; - int x; /*Skip past the luma data.*/ _dst+=_y4m->pic_w*_y4m->pic_h; /*Compute the size of each chroma plane.*/ @@ -396,8 +393,6 @@ static void y4m_convert_422jpeg_420jpeg(y4m_input *_y4m,unsigned char *_dst, int dst_c_w; int dst_c_h; int dst_c_sz; - int tmp_sz; - int pic_sz; int pli; /*Skip past the luma data.*/ _dst+=_y4m->pic_w*_y4m->pic_h; @@ -461,12 +456,9 @@ static void y4m_convert_422_420jpeg(y4m_input *_y4m,unsigned char *_dst, int c_w; int c_h; int c_sz; - int dst_c_w; int dst_c_h; int dst_c_sz; int pli; - int y; - int x; /*Skip past the luma data.*/ _dst+=_y4m->pic_w*_y4m->pic_h; /*Compute the size of each chroma plane.*/ @@ -821,8 +813,6 @@ void y4m_input_close(y4m_input *_y4m){ int y4m_input_fetch_frame(y4m_input *_y4m,FILE *_fin,vpx_image_t *_img){ char frame[6]; int pic_sz; - int frame_c_w; - int frame_c_h; int c_w; int c_h; int c_sz;