History

avcodec/aac/aacdec_usac: Simplify decode_usac_scale_factors()

Michael Niedermayer committed 1 year ago

Commit 41cd72d1 parent d1be3691 file · +2 −9Browse files

Unified · Split

libavcodec/aac/aacdec_usac.c+2−9
@@ -567,15 +567,8 @@ static int decode_usac_scale_factors(AACDecContext *ac, · 566 unmodified lines
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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t