| @@ -61,18 +61,6 @@ static float dynamic_range_tab[256]; · 60 unmodified lines |
| 61 | 61 | float ff_ac3_heavy_dynamic_range_tab[256]; |
| 62 | 62 | #endif |
| 63 | 63 | |
| 64 | | −/** Adjustments in dB gain */ |
| 65 | | −static const float gain_levels[9] = { |
| 66 | | − LEVEL_PLUS_3DB, |
| 67 | | − LEVEL_PLUS_1POINT5DB, |
| 68 | | − LEVEL_ONE, |
| 69 | | − LEVEL_MINUS_1POINT5DB, |
| 70 | | − LEVEL_MINUS_3DB, |
| 71 | | − LEVEL_MINUS_4POINT5DB, |
| 72 | | − LEVEL_MINUS_6DB, |
| 73 | | − LEVEL_ZERO, |
| 74 | | − LEVEL_MINUS_9DB |
| 75 | | −}; |
| 76 | 64 | |
| 77 | 65 | /** Adjustments in dB gain (LFE, +10 to -21 dB) */ |
| 78 | 66 | static const float gain_levels_lfe[32] = { |
| @@ -346,8 +334,8 @@ static int parse_frame_header(AC3DecodeContext *s) · 267 unmodified lines |
| 346 | 334 | static int set_downmix_coeffs(AC3DecodeContext *s) |
| 347 | 335 | { |
| 348 | 336 | int i; |
| 349 | | − float cmix = gain_levels[s-> center_mix_level]; |
| 350 | | − float smix = gain_levels[s->surround_mix_level]; |
| 337 | + float cmix = ff_ac3_gain_levels[s-> center_mix_level]; |
| 338 | + float smix = ff_ac3_gain_levels[s->surround_mix_level]; |
| 351 | 339 | float norm0, norm1; |
| 352 | 340 | float downmix_coeffs[2][AC3_MAX_CHANNELS]; |
| 353 | 341 | |
| @@ -360,8 +348,8 @@ static int set_downmix_coeffs(AC3DecodeContext *s) · 6 unmodified lines |
| 360 | 348 | } |
| 361 | 349 | |
| 362 | 350 | for (i = 0; i < s->fbw_channels; i++) { |
| 363 | | − downmix_coeffs[0][i] = gain_levels[ac3_default_coeffs[s->channel_mode][i][0]]; |
| 364 | | − downmix_coeffs[1][i] = gain_levels[ac3_default_coeffs[s->channel_mode][i][1]]; |
| 351 | + downmix_coeffs[0][i] = ff_ac3_gain_levels[ac3_default_coeffs[s->channel_mode][i][0]]; |
| 352 | + downmix_coeffs[1][i] = ff_ac3_gain_levels[ac3_default_coeffs[s->channel_mode][i][1]]; |
| 365 | 353 | } |
| 366 | 354 | if (s->channel_mode > 1 && s->channel_mode & 1) { |
| 367 | 355 | downmix_coeffs[0][1] = downmix_coeffs[1][1] = cmix; |
| @@ -1562,10 +1550,10 @@ dependent_frame: · 1194 unmodified lines |
| 1562 | 1550 | s->output_mode = AC3_CHMODE_STEREO; |
| 1563 | 1551 | } |
| 1564 | 1552 | |
| 1565 | | − s->loro_center_mix_level = gain_levels[s-> center_mix_level]; |
| 1566 | | − s->loro_surround_mix_level = gain_levels[s->surround_mix_level]; |
| 1567 | | − s->ltrt_center_mix_level = gain_levels[s-> center_mix_level_ltrt]; |
| 1568 | | − s->ltrt_surround_mix_level = gain_levels[s->surround_mix_level_ltrt]; |
| 1553 | + s->loro_center_mix_level = ff_ac3_gain_levels[s-> center_mix_level]; |
| 1554 | + s->loro_surround_mix_level = ff_ac3_gain_levels[s->surround_mix_level]; |
| 1555 | + s->ltrt_center_mix_level = ff_ac3_gain_levels[s-> center_mix_level_ltrt]; |
| 1556 | + s->ltrt_surround_mix_level = ff_ac3_gain_levels[s->surround_mix_level_ltrt]; |
| 1569 | 1557 | switch (s->preferred_downmix) { |
| 1570 | 1558 | case AC3_DMIXMOD_LTRT: |
| 1571 | 1559 | s->preferred_stereo_downmix = AV_DOWNMIX_TYPE_LTRT; |
| @@ -1804,10 +1792,10 @@ skip: · 232 unmodified lines |
| 1804 | 1792 | downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_UNKNOWN; |
| 1805 | 1793 | break; |
| 1806 | 1794 | } |
| 1807 | | − downmix_info->center_mix_level = gain_levels[s-> center_mix_level]; |
| 1808 | | − downmix_info->center_mix_level_ltrt = gain_levels[s-> center_mix_level_ltrt]; |
| 1809 | | − downmix_info->surround_mix_level = gain_levels[s-> surround_mix_level]; |
| 1810 | | − downmix_info->surround_mix_level_ltrt = gain_levels[s->surround_mix_level_ltrt]; |
| 1795 | + downmix_info->center_mix_level = ff_ac3_gain_levels[s-> center_mix_level]; |
| 1796 | + downmix_info->center_mix_level_ltrt = ff_ac3_gain_levels[s-> center_mix_level_ltrt]; |
| 1797 | + downmix_info->surround_mix_level = ff_ac3_gain_levels[s-> surround_mix_level]; |
| 1798 | + downmix_info->surround_mix_level_ltrt = ff_ac3_gain_levels[s->surround_mix_level_ltrt]; |
| 1811 | 1799 | if (s->lfe_mix_level_exists) |
| 1812 | 1800 | downmix_info->lfe_mix_level = gain_levels_lfe[s->lfe_mix_level]; |
| 1813 | 1801 | else |