Skip to content

Commit bf8c0be

Browse files
committed
avcodec/aac/aacdec_usac: Simplify decode_usac_scale_factors()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 41cd72d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent 0e5b6a7 commit bf8c0be

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

libavcodec/aac/aacdec_usac.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -567,15 +567,8 @@ static int decode_usac_scale_factors(AACDecContext *ac,
567567
int offset_sf = global_gain;
568568
for (int g = 0; g < ics->num_window_groups; g++) {
569569
for (int sfb = 0; sfb < ics->max_sfb; sfb++) {
570-
/* First coefficient is just the global gain */
571-
if (!g && !sfb) {
572-
/* The cannonical representation of quantized scalefactors
573-
* in the spec is with 100 subtracted. */
574-
sce->sfo[0] = offset_sf - 100;
575-
continue;
576-
}
577-
578-
offset_sf += get_vlc2(gb, ff_vlc_scalefactors, 7, 3) - SCALE_DIFF_ZERO;
570+
if (g || sfb)
571+
offset_sf += get_vlc2(gb, ff_vlc_scalefactors, 7, 3) - SCALE_DIFF_ZERO;
579572
if (offset_sf > 255U) {
580573
av_log(ac->avctx, AV_LOG_ERROR,
581574
"Scalefactor (%d) out of range.\n", offset_sf);

0 commit comments

Comments
 (0)