Brings it in line with dequantization.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -1460,11 +1460,13 @@ static int decode_scalefactors(AACDecContext *ac, int sfo[120], · 1459 unmodified lines | ||
| 1460 | 1460 | for (g = 0; g < ics->num_window_groups; g++) { |
| 1461 | 1461 | for (i = 0; i < ics->max_sfb;) { |
| 1462 | 1462 | int run_end = band_type_run_end[idx]; |
| 1463 | − if (band_type[idx] == ZERO_BT) { | |
| 1463 | + switch (band_type[idx]) { | |
| 1464 | + case ZERO_BT: | |
| 1464 | 1465 | for (; i < run_end; i++, idx++) |
| 1465 | 1466 | sfo[idx] = 0; |
| 1466 | − } else if ((band_type[idx] == INTENSITY_BT) || | |
| 1467 | − (band_type[idx] == INTENSITY_BT2)) { | |
| 1467 | + break; | |
| 1468 | + case INTENSITY_BT: /* fallthrough */ | |
| 1469 | + case INTENSITY_BT2: | |
| 1468 | 1470 | for (; i < run_end; i++, idx++) { |
| 1469 | 1471 | offset[2] += get_vlc2(gb, ff_vlc_scalefactors, 7, 3) - SCALE_DIFF_ZERO; |
| 1470 | 1472 | clipped_offset = av_clip(offset[2], -155, 100); |
| @@ -1476,7 +1478,8 @@ static int decode_scalefactors(AACDecContext *ac, int sfo[120], · 5 unmodified lines | ||
| 1476 | 1478 | } |
| 1477 | 1479 | sfo[idx] = clipped_offset; |
| 1478 | 1480 | } |
| 1479 | − } else if (band_type[idx] == NOISE_BT) { | |
| 1481 | + break; | |
| 1482 | + case NOISE_BT: | |
| 1480 | 1483 | for (; i < run_end; i++, idx++) { |
| 1481 | 1484 | if (noise_flag-- > 0) |
| 1482 | 1485 | offset[1] += get_bits(gb, NOISE_PRE_BITS) - NOISE_PRE; |
| @@ -1491,7 +1494,8 @@ static int decode_scalefactors(AACDecContext *ac, int sfo[120], · 8 unmodified lines | ||
| 1491 | 1494 | } |
| 1492 | 1495 | sfo[idx] = clipped_offset; |
| 1493 | 1496 | } |
| 1494 | − } else { | |
| 1497 | + break; | |
| 1498 | + default: | |
| 1495 | 1499 | for (; i < run_end; i++, idx++) { |
| 1496 | 1500 | offset[0] += get_vlc2(gb, ff_vlc_scalefactors, 7, 3) - SCALE_DIFF_ZERO; |
| 1497 | 1501 | if (offset[0] > 255U) { |
| @@ -1501,6 +1505,7 @@ static int decode_scalefactors(AACDecContext *ac, int sfo[120], · 3 unmodified lines | ||
| 1501 | 1505 | } |
| 1502 | 1506 | sfo[idx] = offset[0]; |
| 1503 | 1507 | } |
| 1508 | + break; | |
| 1504 | 1509 | } |
| 1505 | 1510 | } |
| 1506 | 1511 | } |