Newer versions of Clang detect this and emit warnings for it.
Unified · Split
| @@ -414,11 +414,10 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s, · 413 unmodified lines | |||
| 414 | start = 0; | 414 | start = 0; |
| 415 | for (g = 0; g < sce->ics.num_swb; g++) { | 415 | for (g = 0; g < sce->ics.num_swb; g++) { |
| 416 | int nz = 0; | 416 | int nz = 0; |
| 417 | float uplim = 0.0f, energy = 0.0f; | 417 | float uplim = 0.0f; |
| 418 | for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { | 418 | for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { |
| 419 | FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g]; | 419 | FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g]; |
| 420 | uplim += band->threshold; | 420 | uplim += band->threshold; |
| 421 | energy += band->energy; | ||
| 422 | if (band->energy <= band->threshold || band->threshold == 0.0f) { | 421 | if (band->energy <= band->threshold || band->threshold == 0.0f) { |
| 423 | sce->zeroes[(w+w2)*16+g] = 1; | 422 | sce->zeroes[(w+w2)*16+g] = 1; |
| 424 | continue; | 423 | continue; |
| @@ -705,7 +705,6 @@ static int quantize(CinepakEncContext *s, int h, uint8_t *data[4], · 704 unmodified lines | |||
| 705 | int entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4; | 705 | int entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4; |
| 706 | int *codebook = v1mode ? info->v1_codebook : info->v4_codebook; | 706 | int *codebook = v1mode ? info->v1_codebook : info->v4_codebook; |
| 707 | int size = v1mode ? info->v1_size : info->v4_size; | 707 | int size = v1mode ? info->v1_size : info->v4_size; |
| 708 | int64_t total_error = 0; | ||
| 709 | uint8_t vq_pict_buf[(MB_AREA * 3) / 2]; | 708 | uint8_t vq_pict_buf[(MB_AREA * 3) / 2]; |
| 710 | uint8_t *sub_data[4], *vq_data[4]; | 709 | uint8_t *sub_data[4], *vq_data[4]; |
| 711 | int sub_linesize[4], vq_linesize[4]; | 710 | int sub_linesize[4], vq_linesize[4]; |
| @@ -795,7 +794,6 @@ static int quantize(CinepakEncContext *s, int h, uint8_t *data[4], · 83 unmodified lines | |||
| 795 | 794 | ||
| 796 | mb->v1_error = compute_mb_distortion(s, sub_data, sub_linesize, | 795 | mb->v1_error = compute_mb_distortion(s, sub_data, sub_linesize, |
| 797 | vq_data, vq_linesize); | 796 | vq_data, vq_linesize); |
| 798 | total_error += mb->v1_error; | ||
| 799 | } else { | 797 | } else { |
| 800 | for (k = 0; k < 4; k++) | 798 | for (k = 0; k < 4; k++) |
| 801 | mb->v4_vector[k] = s->codebook_closest[i + k]; | 799 | mb->v4_vector[k] = s->codebook_closest[i + k]; |
| @@ -805,7 +803,6 @@ static int quantize(CinepakEncContext *s, int h, uint8_t *data[4], · 3 unmodified lines | |||
| 805 | 803 | ||
| 806 | mb->v4_error = compute_mb_distortion(s, sub_data, sub_linesize, | 804 | mb->v4_error = compute_mb_distortion(s, sub_data, sub_linesize, |
| 807 | vq_data, vq_linesize); | 805 | vq_data, vq_linesize); |
| 808 | total_error += mb->v4_error; | ||
| 809 | } | 806 | } |
| 810 | i += v1mode ? 1 : 4; | 807 | i += v1mode ? 1 : 4; |
| 811 | } | 808 | } |
| @@ -476,8 +476,6 @@ static void guess_mv(ERContext *s) · 475 unmodified lines | |||
| 476 | none_left = 1; | 476 | none_left = 1; |
| 477 | changed = 1; | 477 | changed = 1; |
| 478 | for (pass = 0; (changed || pass < 2) && pass < 10; pass++) { | 478 | for (pass = 0; (changed || pass < 2) && pass < 10; pass++) { |
| 479 | int score_sum = 0; | ||
| 480 | |||
| 481 | changed = 0; | 479 | changed = 0; |
| 482 | for (blocklist_index = 0; blocklist_index < blocklist_length; blocklist_index++) { | 480 | for (blocklist_index = 0; blocklist_index < blocklist_length; blocklist_index++) { |
| 483 | const int mb_x = blocklist[blocklist_index][0]; | 481 | const int mb_x = blocklist[blocklist_index][0]; |
| @@ -668,7 +666,6 @@ skip_mean_and_median: · 184 unmodified lines | |||
| 668 | best_pred = j; | 666 | best_pred = j; |
| 669 | } | 667 | } |
| 670 | } | 668 | } |
| 671 | score_sum += best_score; | ||
| 672 | s->mv[0][0][0] = mv_predictor[best_pred][0]; | 669 | s->mv[0][0][0] = mv_predictor[best_pred][0]; |
| 673 | s->mv[0][0][1] = mv_predictor[best_pred][1]; | 670 | s->mv[0][0][1] = mv_predictor[best_pred][1]; |
| 674 | 671 | ||
| @@ -829,7 +829,7 @@ static void imc_get_coeffs(AVCodecContext *avctx, · 828 unmodified lines | |||
| 829 | static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx) | 829 | static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx) |
| 830 | { | 830 | { |
| 831 | int i, j; | 831 | int i, j; |
| 832 | int bits, summer; | 832 | int summer; |
| 833 | 833 | ||
| 834 | for (i = 0; i < BANDS; i++) { | 834 | for (i = 0; i < BANDS; i++) { |
| 835 | chctx->sumLenArr[i] = 0; | 835 | chctx->sumLenArr[i] = 0; |
| @@ -853,7 +853,7 @@ static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx) · 17 unmodified lines | |||
| 853 | } | 853 | } |
| 854 | 854 | ||
| 855 | /* calculate bits left, bits needed and adjust bit allocation */ | 855 | /* calculate bits left, bits needed and adjust bit allocation */ |
| 856 | bits = summer = 0; | 856 | summer = 0; |
| 857 | 857 | ||
| 858 | for (i = 0; i < BANDS; i++) { | 858 | for (i = 0; i < BANDS; i++) { |
| 859 | if (chctx->bandFlagsBuf[i]) { | 859 | if (chctx->bandFlagsBuf[i]) { |
| @@ -863,7 +863,6 @@ static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx) · 3 unmodified lines | |||
| 863 | chctx->CWlengthT[j] = 0; | 863 | chctx->CWlengthT[j] = 0; |
| 864 | } | 864 | } |
| 865 | } | 865 | } |
| 866 | bits += chctx->skipFlagBits[i]; | ||
| 867 | summer -= chctx->skipFlagBits[i]; | 866 | summer -= chctx->skipFlagBits[i]; |
| 868 | } | 867 | } |
| 869 | } | 868 | } |
| @@ -1272,7 +1272,6 @@ static void makelayers(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile) · 1271 unmodified lines | |||
| 1272 | double min = DBL_MAX; | 1272 | double min = DBL_MAX; |
| 1273 | double max = 0; | 1273 | double max = 0; |
| 1274 | double thresh; | 1274 | double thresh; |
| 1275 | int tile_disto = 0; | ||
| 1276 | 1275 | ||
| 1277 | Jpeg2000CodingStyle *codsty = &s->codsty; | 1276 | Jpeg2000CodingStyle *codsty = &s->codsty; |
| 1278 | 1277 | ||
| @@ -1294,7 +1293,6 @@ static void makelayers(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile) · 15 unmodified lines | |||
| 1294 | int dr; | 1293 | int dr; |
| 1295 | double dd, drslope; | 1294 | double dd, drslope; |
| 1296 | 1295 | ||
| 1297 | tile_disto += pass->disto; | ||
| 1298 | if (passno == 0) { | 1296 | if (passno == 0) { |
| 1299 | dr = (int32_t)pass->rate; | 1297 | dr = (int32_t)pass->rate; |
| 1300 | dd = pass->disto; | 1298 | dd = pass->disto; |
| @@ -666,7 +666,6 @@ static void reconstruct_and_encode_image(RoqEncContext *enc, · 665 unmodified lines | |||
| 666 | int i, j, k; | 666 | int i, j, k; |
| 667 | int x, y; | 667 | int x, y; |
| 668 | int subX, subY; | 668 | int subX, subY; |
| 669 | int dist=0; | ||
| 670 | 669 | ||
| 671 | roq_qcell *qcell; | 670 | roq_qcell *qcell; |
| 672 | CelEvaluation *eval; | 671 | CelEvaluation *eval; |
| @@ -692,7 +691,6 @@ static void reconstruct_and_encode_image(RoqEncContext *enc, · 19 unmodified lines | |||
| 692 | 691 | ||
| 693 | x = eval->sourceX; | 692 | x = eval->sourceX; |
| 694 | y = eval->sourceY; | 693 | y = eval->sourceY; |
| 695 | dist += eval->eval_dist[eval->best_coding]; | ||
| 696 | 694 | ||
| 697 | switch (eval->best_coding) { | 695 | switch (eval->best_coding) { |
| 698 | case RoQ_ID_MOT: | 696 | case RoQ_ID_MOT: |
| @@ -403,7 +403,6 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata) · 402 unmodified lines | |||
| 403 | max_sigma_x = 0, | 403 | max_sigma_x = 0, |
| 404 | diff1_sum = 0, | 404 | diff1_sum = 0, |
| 405 | diff1_sum_x2 = 0, | 405 | diff1_sum_x2 = 0, |
| 406 | sigma_x = 0, | ||
| 407 | sigma_x2 = 0, | 406 | sigma_x2 = 0, |
| 408 | noise_floor = 0, | 407 | noise_floor = 0, |
| 409 | entropy = 0, | 408 | entropy = 0, |
| @@ -428,7 +427,6 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata) · 18 unmodified lines | |||
| 428 | diff1_sum_x2 += p->diff1_sum_x2; | 427 | diff1_sum_x2 += p->diff1_sum_x2; |
| 429 | min_sigma_x2 = FFMIN(min_sigma_x2, p->min_sigma_x2); | 428 | min_sigma_x2 = FFMIN(min_sigma_x2, p->min_sigma_x2); |
| 430 | max_sigma_x2 = FFMAX(max_sigma_x2, p->max_sigma_x2); | 429 | max_sigma_x2 = FFMAX(max_sigma_x2, p->max_sigma_x2); |
| 431 | sigma_x += p->sigma_x; | ||
| 432 | sigma_x2 += p->sigma_x2; | 430 | sigma_x2 += p->sigma_x2; |
| 433 | noise_floor = FFMAX(noise_floor, p->noise_floor); | 431 | noise_floor = FFMAX(noise_floor, p->noise_floor); |
| 434 | noise_floor_count += p->noise_floor_count; | 432 | noise_floor_count += p->noise_floor_count; |
| @@ -659,7 +657,6 @@ static void print_stats(AVFilterContext *ctx) · 224 unmodified lines | |||
| 659 | max_sigma_x = 0, | 657 | max_sigma_x = 0, |
| 660 | diff1_sum_x2 = 0, | 658 | diff1_sum_x2 = 0, |
| 661 | diff1_sum = 0, | 659 | diff1_sum = 0, |
| 662 | sigma_x = 0, | ||
| 663 | sigma_x2 = 0, | 660 | sigma_x2 = 0, |
| 664 | noise_floor = 0, | 661 | noise_floor = 0, |
| 665 | entropy = 0, | 662 | entropy = 0, |
| @@ -684,7 +681,6 @@ static void print_stats(AVFilterContext *ctx) · 18 unmodified lines | |||
| 684 | diff1_sum += p->diff1_sum; | 681 | diff1_sum += p->diff1_sum; |
| 685 | min_sigma_x2 = FFMIN(min_sigma_x2, p->min_sigma_x2); | 682 | min_sigma_x2 = FFMIN(min_sigma_x2, p->min_sigma_x2); |
| 686 | max_sigma_x2 = FFMAX(max_sigma_x2, p->max_sigma_x2); | 683 | max_sigma_x2 = FFMAX(max_sigma_x2, p->max_sigma_x2); |
| 687 | sigma_x += p->sigma_x; | ||
| 688 | sigma_x2 += p->sigma_x2; | 684 | sigma_x2 += p->sigma_x2; |
| 689 | noise_floor = FFMAX(noise_floor, p->noise_floor); | 685 | noise_floor = FFMAX(noise_floor, p->noise_floor); |
| 690 | p->entropy = calc_entropy(s, p); | 686 | p->entropy = calc_entropy(s, p); |
| @@ -362,16 +362,12 @@ int main(int argc, char **argv){ · 361 unmodified lines | |||
| 362 | 362 | ||
| 363 | for(ch=0; ch<in_ch_count; ch++){ | 363 | for(ch=0; ch<in_ch_count; ch++){ |
| 364 | double sse, maxdiff=0; | 364 | double sse, maxdiff=0; |
| 365 | double sum_a= 0; | ||
| 366 | double sum_b= 0; | ||
| 367 | double sum_aa= 0; | 365 | double sum_aa= 0; |
| 368 | double sum_bb= 0; | 366 | double sum_bb= 0; |
| 369 | double sum_ab= 0; | 367 | double sum_ab= 0; |
| 370 | for(i=0; i<out_count; i++){ | 368 | for(i=0; i<out_count; i++){ |
| 371 | double a= get(ain , ch, i, in_ch_count, in_sample_fmt); | 369 | double a= get(ain , ch, i, in_ch_count, in_sample_fmt); |
| 372 | double b= get(aout, ch, i, in_ch_count, in_sample_fmt); | 370 | double b= get(aout, ch, i, in_ch_count, in_sample_fmt); |
| 373 | sum_a += a; | ||
| 374 | sum_b += b; | ||
| 375 | sum_aa+= a*a; | 371 | sum_aa+= a*a; |
| 376 | sum_bb+= b*b; | 372 | sum_bb+= b*b; |
| 377 | sum_ab+= a*b; | 373 | sum_ab+= a*b; |
| @@ -392,16 +388,12 @@ int main(int argc, char **argv){ · 14 unmodified lines | |||
| 392 | if(flush_count){ | 388 | if(flush_count){ |
| 393 | for(ch=0; ch<in_ch_count; ch++){ | 389 | for(ch=0; ch<in_ch_count; ch++){ |
| 394 | double sse, maxdiff=0; | 390 | double sse, maxdiff=0; |
| 395 | double sum_a= 0; | ||
| 396 | double sum_b= 0; | ||
| 397 | double sum_aa= 0; | 391 | double sum_aa= 0; |
| 398 | double sum_bb= 0; | 392 | double sum_bb= 0; |
| 399 | double sum_ab= 0; | 393 | double sum_ab= 0; |
| 400 | for(i=0; i<flush_count; i++){ | 394 | for(i=0; i<flush_count; i++){ |
| 401 | double a= get(ain , ch, i+out_count, in_ch_count, in_sample_fmt); | 395 | double a= get(ain , ch, i+out_count, in_ch_count, in_sample_fmt); |
| 402 | double b= get(aout, ch, i, in_ch_count, in_sample_fmt); | 396 | double b= get(aout, ch, i, in_ch_count, in_sample_fmt); |
| 403 | sum_a += a; | ||
| 404 | sum_b += b; | ||
| 405 | sum_aa+= a*a; | 397 | sum_aa+= a*a; |
| 406 | sum_bb+= b*b; | 398 | sum_bb+= b*b; |
| 407 | sum_ab+= a*b; | 399 | sum_ab+= a*b; |