This commit adds a decoder for the frequency-domain part of USAC. What works: - Mono - Stereo (no prediction) - Stereo (mid/side coding) - Stereo (complex prediction) What's left: - SBR - Speech coding Known issues: - Desync with certain sequences - Preroll crossover missing (shouldn't matter, bitrate adaptation only)
Showing the changes to libavcodec/aactab.c (1 of 13 files). Show all
Unified · Split
| @@ -1998,6 +1998,11 @@ const uint8_t ff_tns_max_bands_128[] = { · 1997 unmodified lines | |||
| 1998 | }; | 1998 | }; |
| 1999 | // @} | 1999 | // @} |
| 2000 | 2000 | ||
| 2001 | const uint8_t ff_usac_noise_fill_start_offset[2][2] = { | ||
| 2002 | { 160, 20 }, | ||
| 2003 | { 120, 15 }, | ||
| 2004 | }; | ||
| 2005 | |||
| 2001 | const DECLARE_ALIGNED(32, float, ff_aac_eld_window_512)[1920] = { | 2006 | const DECLARE_ALIGNED(32, float, ff_aac_eld_window_512)[1920] = { |
| 2002 | 0.00338834, 0.00567745, 0.00847677, 0.01172641, | 2007 | 0.00338834, 0.00567745, 0.00847677, 0.01172641, |
| 2003 | 0.01532555, 0.01917664, 0.02318809, 0.02729259, | 2008 | 0.01532555, 0.01917664, 0.02318809, 0.02729259, |
| @@ -3895,3 +3900,40 @@ DECLARE_ALIGNED(16, const float, ff_aac_deemph_weights)[16] = { · 1891 unmodified lines | |||
| 3895 | 0, | 3900 | 0, |
| 3896 | USAC_EMPH_COEFF, | 3901 | USAC_EMPH_COEFF, |
| 3897 | }; | 3902 | }; |
| 3903 | |||
| 3904 | const int ff_aac_usac_samplerate[32] = { | ||
| 3905 | 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, | ||
| 3906 | 16000, 12000, 11025, 8000, 7350, -1, -1, 57600, | ||
| 3907 | 51200, 40000, 38400, 34150, 28800, 25600, 20000, 19200, | ||
| 3908 | 17075, 14400, 12800, 9600, -1, -1, -1, -1, | ||
| 3909 | }; | ||
| 3910 | |||
| 3911 | /* Window type (only long+eight, start/stop/stopstart), sine+sine, kbd+kbd, sine+kbd, kbd+sine */ | ||
| 3912 | const float ff_aac_usac_mdst_filt_cur[4 /* Window */][4 /* Shape */][7] = | ||
| 3913 | { | ||
| 3914 | { { 0.000000, 0.000000, 0.500000, 0.000000, -0.500000, 0.000000, 0.000000 }, | ||
| 3915 | { 0.091497, 0.000000, 0.581427, 0.000000, -0.581427, 0.000000, -0.091497 }, | ||
| 3916 | { 0.045748, 0.057238, 0.540714, 0.000000, -0.540714, -0.057238, -0.045748 }, | ||
| 3917 | { 0.045748, -0.057238, 0.540714, 0.000000, -0.540714, 0.057238, -0.045748 } }, | ||
| 3918 | { { 0.102658, 0.103791, 0.567149, 0.000000, -0.567149, -0.103791, -0.102658 }, | ||
| 3919 | { 0.150512, 0.047969, 0.608574, 0.000000, -0.608574, -0.047969, -0.150512 }, | ||
| 3920 | { 0.104763, 0.105207, 0.567861, 0.000000, -0.567861, -0.105207, -0.104763 }, | ||
| 3921 | { 0.148406, 0.046553, 0.607863, 0.000000, -0.607863, -0.046553, -0.148406 } }, | ||
| 3922 | { { 0.102658, -0.103791, 0.567149, 0.000000, -0.567149, 0.103791, -0.102658 }, | ||
| 3923 | { 0.150512, -0.047969, 0.608574, 0.000000, -0.608574, 0.047969, -0.150512 }, | ||
| 3924 | { 0.148406, -0.046553, 0.607863, 0.000000, -0.607863, 0.046553, -0.148406 }, | ||
| 3925 | { 0.104763, -0.105207, 0.567861, 0.000000, -0.567861, 0.105207, -0.104763 } }, | ||
| 3926 | { { 0.205316, 0.000000, 0.634298, 0.000000, -0.634298, 0.000000, -0.205316 }, | ||
| 3927 | { 0.209526, 0.000000, 0.635722, 0.000000, -0.635722, 0.000000, -0.209526 }, | ||
| 3928 | { 0.207421, 0.001416, 0.635010, 0.000000, -0.635010, -0.001416, -0.207421 }, | ||
| 3929 | { 0.207421, -0.001416, 0.635010, 0.000000, -0.635010, 0.001416, -0.207421 } } | ||
| 3930 | }; | ||
| 3931 | |||
| 3932 | /* Window type (everything/longstop+stopstart), sine or kbd */ | ||
| 3933 | const float ff_aac_usac_mdst_filt_prev[2 /* Window */][2 /* sine/kbd */][7] = | ||
| 3934 | { | ||
| 3935 | { { 0.000000, 0.106103, 0.250000, 0.318310, 0.250000, 0.106103, 0.000000 }, | ||
| 3936 | { 0.059509, 0.123714, 0.186579, 0.213077, 0.186579, 0.123714, 0.059509 } }, | ||
| 3937 | { { 0.038498, 0.039212, 0.039645, 0.039790, 0.039645, 0.039212, 0.038498 }, | ||
| 3938 | { 0.026142, 0.026413, 0.026577, 0.026631, 0.026577, 0.026413, 0.026142 } } | ||
| 3939 | }; | ||