all: Remove unused-but-set variables

Newer versions of Clang detect this and emit warnings for it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/375/head
Andreas Rheinhardt 3 years ago
parent a4798a5d51
commit 01d158d1c8
  1. 3
      libavcodec/aaccoder.c
  2. 3
      libavcodec/cinepakenc.c
  3. 3
      libavcodec/error_resilience.c
  4. 5
      libavcodec/imc.c
  5. 2
      libavcodec/j2kenc.c
  6. 2
      libavcodec/roqvideoenc.c
  7. 4
      libavfilter/af_astats.c
  8. 8
      libswresample/tests/swresample.c

@ -414,11 +414,10 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s,
start = 0;
for (g = 0; g < sce->ics.num_swb; g++) {
int nz = 0;
float uplim = 0.0f, energy = 0.0f;
float uplim = 0.0f;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
uplim += band->threshold;
energy += band->energy;
if (band->energy <= band->threshold || band->threshold == 0.0f) {
sce->zeroes[(w+w2)*16+g] = 1;
continue;

@ -705,7 +705,6 @@ static int quantize(CinepakEncContext *s, int h, uint8_t *data[4],
int entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4;
int *codebook = v1mode ? info->v1_codebook : info->v4_codebook;
int size = v1mode ? info->v1_size : info->v4_size;
int64_t total_error = 0;
uint8_t vq_pict_buf[(MB_AREA * 3) / 2];
uint8_t *sub_data[4], *vq_data[4];
int sub_linesize[4], vq_linesize[4];
@ -795,7 +794,6 @@ static int quantize(CinepakEncContext *s, int h, uint8_t *data[4],
mb->v1_error = compute_mb_distortion(s, sub_data, sub_linesize,
vq_data, vq_linesize);
total_error += mb->v1_error;
} else {
for (k = 0; k < 4; k++)
mb->v4_vector[k] = s->codebook_closest[i + k];
@ -805,7 +803,6 @@ static int quantize(CinepakEncContext *s, int h, uint8_t *data[4],
mb->v4_error = compute_mb_distortion(s, sub_data, sub_linesize,
vq_data, vq_linesize);
total_error += mb->v4_error;
}
i += v1mode ? 1 : 4;
}

@ -476,8 +476,6 @@ static void guess_mv(ERContext *s)
none_left = 1;
changed = 1;
for (pass = 0; (changed || pass < 2) && pass < 10; pass++) {
int score_sum = 0;
changed = 0;
for (blocklist_index = 0; blocklist_index < blocklist_length; blocklist_index++) {
const int mb_x = blocklist[blocklist_index][0];
@ -668,7 +666,6 @@ skip_mean_and_median:
best_pred = j;
}
}
score_sum += best_score;
s->mv[0][0][0] = mv_predictor[best_pred][0];
s->mv[0][0][1] = mv_predictor[best_pred][1];

@ -829,7 +829,7 @@ static void imc_get_coeffs(AVCodecContext *avctx,
static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx)
{
int i, j;
int bits, summer;
int summer;
for (i = 0; i < BANDS; i++) {
chctx->sumLenArr[i] = 0;
@ -853,7 +853,7 @@ static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx)
}
/* calculate bits left, bits needed and adjust bit allocation */
bits = summer = 0;
summer = 0;
for (i = 0; i < BANDS; i++) {
if (chctx->bandFlagsBuf[i]) {
@ -863,7 +863,6 @@ static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx)
chctx->CWlengthT[j] = 0;
}
}
bits += chctx->skipFlagBits[i];
summer -= chctx->skipFlagBits[i];
}
}

@ -1272,7 +1272,6 @@ static void makelayers(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile)
double min = DBL_MAX;
double max = 0;
double thresh;
int tile_disto = 0;
Jpeg2000CodingStyle *codsty = &s->codsty;
@ -1294,7 +1293,6 @@ static void makelayers(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile)
int dr;
double dd, drslope;
tile_disto += pass->disto;
if (passno == 0) {
dr = (int32_t)pass->rate;
dd = pass->disto;

@ -666,7 +666,6 @@ static void reconstruct_and_encode_image(RoqEncContext *enc,
int i, j, k;
int x, y;
int subX, subY;
int dist=0;
roq_qcell *qcell;
CelEvaluation *eval;
@ -692,7 +691,6 @@ static void reconstruct_and_encode_image(RoqEncContext *enc,
x = eval->sourceX;
y = eval->sourceY;
dist += eval->eval_dist[eval->best_coding];
switch (eval->best_coding) {
case RoQ_ID_MOT:

@ -403,7 +403,6 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata)
max_sigma_x = 0,
diff1_sum = 0,
diff1_sum_x2 = 0,
sigma_x = 0,
sigma_x2 = 0,
noise_floor = 0,
entropy = 0,
@ -428,7 +427,6 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata)
diff1_sum_x2 += p->diff1_sum_x2;
min_sigma_x2 = FFMIN(min_sigma_x2, p->min_sigma_x2);
max_sigma_x2 = FFMAX(max_sigma_x2, p->max_sigma_x2);
sigma_x += p->sigma_x;
sigma_x2 += p->sigma_x2;
noise_floor = FFMAX(noise_floor, p->noise_floor);
noise_floor_count += p->noise_floor_count;
@ -659,7 +657,6 @@ static void print_stats(AVFilterContext *ctx)
max_sigma_x = 0,
diff1_sum_x2 = 0,
diff1_sum = 0,
sigma_x = 0,
sigma_x2 = 0,
noise_floor = 0,
entropy = 0,
@ -684,7 +681,6 @@ static void print_stats(AVFilterContext *ctx)
diff1_sum += p->diff1_sum;
min_sigma_x2 = FFMIN(min_sigma_x2, p->min_sigma_x2);
max_sigma_x2 = FFMAX(max_sigma_x2, p->max_sigma_x2);
sigma_x += p->sigma_x;
sigma_x2 += p->sigma_x2;
noise_floor = FFMAX(noise_floor, p->noise_floor);
p->entropy = calc_entropy(s, p);

@ -362,16 +362,12 @@ int main(int argc, char **argv){
for(ch=0; ch<in_ch_count; ch++){
double sse, maxdiff=0;
double sum_a= 0;
double sum_b= 0;
double sum_aa= 0;
double sum_bb= 0;
double sum_ab= 0;
for(i=0; i<out_count; i++){
double a= get(ain , ch, i, in_ch_count, in_sample_fmt);
double b= get(aout, ch, i, in_ch_count, in_sample_fmt);
sum_a += a;
sum_b += b;
sum_aa+= a*a;
sum_bb+= b*b;
sum_ab+= a*b;
@ -392,16 +388,12 @@ int main(int argc, char **argv){
if(flush_count){
for(ch=0; ch<in_ch_count; ch++){
double sse, maxdiff=0;
double sum_a= 0;
double sum_b= 0;
double sum_aa= 0;
double sum_bb= 0;
double sum_ab= 0;
for(i=0; i<flush_count; i++){
double a= get(ain , ch, i+out_count, in_ch_count, in_sample_fmt);
double b= get(aout, ch, i, in_ch_count, in_sample_fmt);
sum_a += a;
sum_b += b;
sum_aa+= a*a;
sum_bb+= b*b;
sum_ab+= a*b;

Loading…
Cancel
Save