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