From 606fb6c03e9797b6bff1df5100e2038b9cf55688 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 16 Mar 2024 02:19:35 +0100 Subject: [PATCH 22/38] aacdec: remove unnecessary decode_spectrum_and_dequant arguments Small cleanup to reduce number of arguments. --- libavcodec/aacdec_template.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 28b2213416..4c9869f143 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -1609,12 +1609,13 @@ static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb, * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_spectrum_and_dequant(AACDecContext *ac, INTFLOAT coef[1024], +static int decode_spectrum_and_dequant(AACDecContext *ac, GetBitContext *gb, - int pulse_present, const Pulse *pulse, + const Pulse *pulse, SingleChannelElement *sce) { int i, k, g, idx = 0; + INTFLOAT *coef = sce->AAC_RENAME(coeffs); IndividualChannelStream *ics = &sce->ics; const int c = 1024 / ics->num_windows; const uint16_t *offsets = ics->swb_offset; @@ -1855,7 +1856,7 @@ static int decode_spectrum_and_dequant(AACDecContext *ac, INTFLOAT coef[1024], coef += g_len << 7; } - if (pulse_present) { + if (pulse) { idx = 0; for (i = 0; i < pulse->num_pulse; i++) { INTFLOAT co = coef_base[ pulse->pos[i] ]; @@ -1976,7 +1977,6 @@ static int decode_ics(AACDecContext *ac, SingleChannelElement *sce, Pulse pulse; TemporalNoiseShaping *tns = &sce->tns; IndividualChannelStream *ics = &sce->ics; - INTFLOAT *out = sce->AAC_RENAME(coeffs); int global_gain, eld_syntax, er_syntax, pulse_present = 0; int ret; @@ -2046,9 +2046,9 @@ static int decode_ics(AACDecContext *ac, SingleChannelElement *sce, } } - ret = decode_spectrum_and_dequant(ac, out, gb, - pulse_present, - &pulse, sce); + ret = decode_spectrum_and_dequant(ac, gb, + pulse_present ? &pulse : NULL, + sce); if (ret < 0) goto fail; -- 2.43.0.381.gb435a96ce8