1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/aacenc_quantization: Remove always-zero function parameter

rtz is only ever nonzero for quantize_and_encode_band().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-08-01 09:45:10 +02:00
parent d23cb45c1c
commit 386990a955
7 changed files with 24 additions and 24 deletions

View File

@ -123,7 +123,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce
rd += quantize_band_cost(s, &sce->coeffs[start + w*128],
&s->scoefs[start + w*128], size,
sce->sf_idx[(win+w)*16+swb], aac_cb_out_map[cb],
lambda / band->threshold, INFINITY, NULL, NULL, 0);
lambda / band->threshold, INFINITY, NULL, NULL);
}
cost_stay_here = path[swb][cb].cost + rd;
cost_get_here = minrd + rd + run_bits + 4;
@ -346,7 +346,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
q + q0, cb, lambda / band->threshold, INFINITY, NULL, NULL, 0);
q + q0, cb, lambda / band->threshold, INFINITY, NULL, NULL);
}
minrd = FFMIN(minrd, dist);
@ -658,7 +658,7 @@ static void search_for_pns(AACEncContext *s, AVCodecContext *avctx, SingleChanne
sce->ics.swb_sizes[g],
sce->sf_idx[(w+w2)*16+g],
sce->band_alt[(w+w2)*16+g],
lambda/band->threshold, INFINITY, NULL, NULL, 0);
lambda/band->threshold, INFINITY, NULL, NULL);
/* Estimate rd on average as 5 bits for SF, 4 for the CB, plus spread energy * lambda/thr */
dist2 += band->energy/(band->spread*band->spread)*lambda*dist_thresh/band->threshold;
}
@ -842,25 +842,25 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe)
sce0->ics.swb_sizes[g],
sce0->sf_idx[w*16+g],
sce0->band_type[w*16+g],
lambda / (band0->threshold + FLT_MIN), INFINITY, &b1, NULL, 0);
lambda / (band0->threshold + FLT_MIN), INFINITY, &b1, NULL);
dist1 += quantize_band_cost(s, &sce1->coeffs[start + (w+w2)*128],
R34,
sce1->ics.swb_sizes[g],
sce1->sf_idx[w*16+g],
sce1->band_type[w*16+g],
lambda / (band1->threshold + FLT_MIN), INFINITY, &b2, NULL, 0);
lambda / (band1->threshold + FLT_MIN), INFINITY, &b2, NULL);
dist2 += quantize_band_cost(s, M,
M34,
sce0->ics.swb_sizes[g],
mididx,
midcb,
lambda / (minthr + FLT_MIN), INFINITY, &b3, NULL, 0);
lambda / (minthr + FLT_MIN), INFINITY, &b3, NULL);
dist2 += quantize_band_cost(s, S,
S34,
sce1->ics.swb_sizes[g],
sididx,
sidcb,
mslambda / (minthr * bmax + FLT_MIN), INFINITY, &b4, NULL, 0);
mslambda / (minthr * bmax + FLT_MIN), INFINITY, &b4, NULL);
B0 += b1+b2;
B1 += b3+b4;
dist1 -= b1+b2;

View File

@ -127,7 +127,7 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
&s->scoefs[start + w*128], size,
sce->sf_idx[win*16+swb],
aac_cb_out_map[cb],
0, INFINITY, NULL, NULL, 0);
0, INFINITY, NULL, NULL);
}
cost_stay_here = path[swb][cb].cost + bits;
cost_get_here = minbits + bits + run_bits + 4;

View File

@ -68,15 +68,15 @@ struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
sce0->ics.swb_sizes[g],
sce0->sf_idx[w*16+g],
sce0->band_type[w*16+g],
s->lambda / band0->threshold, INFINITY, NULL, NULL, 0);
s->lambda / band0->threshold, INFINITY, NULL, NULL);
dist1 += quantize_band_cost(s, &R[start + (w+w2)*128], R34,
sce1->ics.swb_sizes[g],
sce1->sf_idx[w*16+g],
sce1->band_type[w*16+g],
s->lambda / band1->threshold, INFINITY, NULL, NULL, 0);
s->lambda / band1->threshold, INFINITY, NULL, NULL);
dist2 += quantize_band_cost(s, IS, I34, sce0->ics.swb_sizes[g],
is_sf_idx, is_band_type,
s->lambda / minthr, INFINITY, NULL, NULL, 0);
s->lambda / minthr, INFINITY, NULL, NULL);
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
dist_spec_err += (L34[i] - I34[i])*(L34[i] - I34[i]);
dist_spec_err += (R34[i] - I34[i]*e01_34)*(R34[i] - I34[i]*e01_34);

View File

@ -194,11 +194,11 @@ void ff_aac_search_for_ltp(AACEncContext *s, SingleChannelElement *sce,
s->abs_pow34(PCD34, PCD, sce->ics.swb_sizes[g]);
dist1 += quantize_band_cost(s, &sce->coeffs[start+(w+w2)*128], C34, sce->ics.swb_sizes[g],
sce->sf_idx[(w+w2)*16+g], sce->band_type[(w+w2)*16+g],
s->lambda/band->threshold, INFINITY, &bits_tmp1, NULL, 0);
s->lambda/band->threshold, INFINITY, &bits_tmp1, NULL);
dist2 += quantize_band_cost(s, PCD, PCD34, sce->ics.swb_sizes[g],
sce->sf_idx[(w+w2)*16+g],
sce->band_type[(w+w2)*16+g],
s->lambda/band->threshold, INFINITY, &bits_tmp2, NULL, 0);
s->lambda/band->threshold, INFINITY, &bits_tmp2, NULL);
bits1 += bits_tmp1;
bits2 += bits_tmp2;
}

View File

@ -250,20 +250,20 @@ static float (*const quantize_and_encode_band_cost_rtz_arr[])(
static inline float quantize_band_cost(struct AACEncContext *s, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy, int rtz)
int *bits, float *energy)
{
return quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx,
cb, lambda, uplim, bits, energy, rtz);
cb, lambda, uplim, bits, energy, 0);
}
static inline int quantize_band_cost_bits(struct AACEncContext *s, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy, int rtz)
int *bits, float *energy)
{
int auxbits;
quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx,
cb, 0.0f, uplim, &auxbits, energy, rtz);
cb, 0.0f, uplim, &auxbits, energy, 0);
if (bits) {
*bits = auxbits;
}

View File

@ -38,7 +38,7 @@ static inline float quantize_band_cost_cached(struct AACEncContext *s, int w, in
entry = &s->quantize_band_cost_cache[scale_idx][w*16+g];
if (entry->generation != s->quantize_band_cost_cache_generation || entry->cb != cb || entry->rtz != rtz) {
entry->rd = quantize_band_cost(s, in, scaled, size, scale_idx,
cb, lambda, uplim, &entry->bits, &entry->energy, rtz);
cb, lambda, uplim, &entry->bits, &entry->energy);
entry->cb = cb;
entry->rtz = rtz;
entry->generation = s->quantize_band_cost_cache_generation;

View File

@ -1472,7 +1472,7 @@ static float (*const get_band_numbits_arr[])(struct AACEncContext *s,
static float quantize_band_cost_bits(struct AACEncContext *s, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy, int rtz)
int *bits, float *energy)
{
return get_band_numbits(s, NULL, in, scaled, size, scale_idx, cb, lambda, uplim, bits);
}
@ -2326,7 +2326,7 @@ static float (*const get_band_cost_arr[])(struct AACEncContext *s,
static float quantize_band_cost(struct AACEncContext *s, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy, int rtz)
int *bits, float *energy)
{
return get_band_cost(s, NULL, in, scaled, size, scale_idx, cb, lambda, uplim, bits, energy);
}
@ -2424,25 +2424,25 @@ static void search_for_ms_mips(AACEncContext *s, ChannelElement *cpe)
sce0->ics.swb_sizes[g],
sce0->sf_idx[w*16+g],
sce0->band_type[w*16+g],
lambda / band0->threshold, INFINITY, &b1, NULL, 0);
lambda / band0->threshold, INFINITY, &b1, NULL);
dist1 += quantize_band_cost(s, &sce1->coeffs[start + (w+w2)*128],
R34,
sce1->ics.swb_sizes[g],
sce1->sf_idx[w*16+g],
sce1->band_type[w*16+g],
lambda / band1->threshold, INFINITY, &b2, NULL, 0);
lambda / band1->threshold, INFINITY, &b2, NULL);
dist2 += quantize_band_cost(s, M,
M34,
sce0->ics.swb_sizes[g],
mididx,
midcb,
lambda / minthr, INFINITY, &b3, NULL, 0);
lambda / minthr, INFINITY, &b3, NULL);
dist2 += quantize_band_cost(s, S,
S34,
sce1->ics.swb_sizes[g],
sididx,
sidcb,
mslambda / (minthr * bmax), INFINITY, &b4, NULL, 0);
mslambda / (minthr * bmax), INFINITY, &b4, NULL);
B0 += b1+b2;
B1 += b3+b4;
dist1 -= b1+b2;