diff --git a/libavcodec/aac.h b/libavcodec/aac.h index 75494d2af1..04553e7a46 100644 --- a/libavcodec/aac.h +++ b/libavcodec/aac.h @@ -30,6 +30,29 @@ #ifndef AVCODEC_AAC_H #define AVCODEC_AAC_H +#ifndef USE_FIXED +#define USE_FIXED 0 +#endif + +#if USE_FIXED + +#include "libavutil/softfloat.h" + +#define FFT_FLOAT 0 +#define FFT_FIXED_32 1 + +#define Q30(x) (int)((x)*1073741824.0 + 0.5) +#define Q31(x) (int)((x)*2147483648.0 + 0.5) + +#else + +#define FFT_FLOAT 1 +#define FFT_FIXED_32 0 + +#define Q30(x) x +#define Q31(x) x +#endif /* USE_FIXED */ + #include "libavutil/float_dsp.h" #include "avcodec.h" #include "imdct15.h" diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h index 3e70e064a6..62c7f8742d 100644 --- a/libavcodec/aacdectab.h +++ b/libavcodec/aacdectab.h @@ -38,9 +38,9 @@ /* @name ltp_coef * Table of the LTP coefficients */ -static const float ltp_coef[8] = { - 0.570829, 0.696616, 0.813004, 0.911304, - 0.984900, 1.067894, 1.194601, 1.369533, +static const INTFLOAT ltp_coef[8] = { + Q30(0.570829f), Q30(0.696616f), Q30(0.813004f), Q30(0.911304f), + Q30(0.984900f), Q30(1.067894f), Q30(1.194601f), Q30(1.369533f), }; /* @name tns_tmp2_map @@ -49,28 +49,28 @@ static const float ltp_coef[8] = { * respectively. * @{ */ -static const float tns_tmp2_map_1_3[4] = { - 0.00000000, -0.43388373, 0.64278758, 0.34202015, +static const INTFLOAT tns_tmp2_map_1_3[4] = { + Q31(0.00000000f), Q31(-0.43388373f), Q31(0.64278758f), Q31(0.34202015f), }; -static const float tns_tmp2_map_0_3[8] = { - 0.00000000, -0.43388373, -0.78183150, -0.97492790, - 0.98480773, 0.86602539, 0.64278758, 0.34202015, +static const INTFLOAT tns_tmp2_map_0_3[8] = { + Q31(0.00000000f), Q31(-0.43388373f), Q31(-0.78183150f), Q31(-0.97492790f), + Q31(0.98480773f), Q31( 0.86602539f), Q31( 0.64278758f), Q31( 0.34202015f), }; -static const float tns_tmp2_map_1_4[8] = { - 0.00000000, -0.20791170, -0.40673664, -0.58778524, - 0.67369562, 0.52643216, 0.36124167, 0.18374951, +static const INTFLOAT tns_tmp2_map_1_4[8] = { + Q31(0.00000000f), Q31(-0.20791170f), Q31(-0.40673664f), Q31(-0.58778524f), + Q31(0.67369562f), Q31( 0.52643216f), Q31( 0.36124167f), Q31( 0.18374951f), }; -static const float tns_tmp2_map_0_4[16] = { - 0.00000000, -0.20791170, -0.40673664, -0.58778524, - -0.74314481, -0.86602539, -0.95105654, -0.99452192, - 0.99573416, 0.96182561, 0.89516330, 0.79801720, - 0.67369562, 0.52643216, 0.36124167, 0.18374951, +static const INTFLOAT tns_tmp2_map_0_4[16] = { + Q31( 0.00000000f), Q31(-0.20791170f), Q31(-0.40673664f), Q31(-0.58778524f), + Q31(-0.74314481f), Q31(-0.86602539f), Q31(-0.95105654f), Q31(-0.99452192f), + Q31( 0.99573416f), Q31( 0.96182561f), Q31( 0.89516330f), Q31( 0.79801720f), + Q31( 0.67369562f), Q31( 0.52643216f), Q31( 0.36124167f), Q31( 0.18374951f), }; -static const float * const tns_tmp2_map[4] = { +static const INTFLOAT * const tns_tmp2_map[4] = { tns_tmp2_map_0_3, tns_tmp2_map_0_4, tns_tmp2_map_1_3, diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index 25f6de2927..deb9d91f95 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -35,6 +35,8 @@ DECLARE_ALIGNED(32, float, ff_aac_kbd_long_1024)[1024]; DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128]; +DECLARE_ALIGNED(32, int, ff_aac_kbd_long_1024_fixed)[1024]; +DECLARE_ALIGNED(32, int, ff_aac_kbd_short_128_fixed)[128]; const uint8_t ff_aac_num_swb_1024[] = { 41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40, 40 @@ -1767,6 +1769,490 @@ const DECLARE_ALIGNED(32, float, ff_aac_eld_window_512)[1920] = { -0.00111144, -0.00109764, -0.00108377, -0.00106989, }; +/* Q30 representation of ff_aac_eld_window_512 table */ +const DECLARE_ALIGNED(32, int, ff_aac_eld_window_512_fixed)[1920] = { + 0x003783ba, 0x005d04f4, 0x008ae226, 0x00c02021, + 0x00fb1804, 0x013a30a8, 0x017be9e6, 0x01bf296c, + 0x02033204, 0x0247502c, 0x028adab0, 0x02cd9568, + 0x030fa980, 0x03513dc0, 0x03927274, 0x03d363e0, + 0x04142e40, 0x0454edc0, 0x0495bd48, 0x04d6a060, + 0x051786d8, 0x05586548, 0x059935e8, 0x05d9feb0, + 0x061acea0, 0x065bb680, 0x069cc800, 0x06de13f0, + 0x071fa748, 0x07618b80, 0x07a3c7a8, 0x07e66da0, + 0x082999d0, 0x086d6590, 0x08b1e640, 0x08f72850, + 0x093d3120, 0x09840550, 0x09cba880, 0x0a1415f0, + 0x0a5d41b0, 0x0aa720d0, 0x0af1a9a0, 0x0b3cce70, + 0x0b887ec0, 0x0bd4ac10, 0x0c214a70, 0x0c6e5130, + 0x0cbbba50, 0x0d098130, 0x0d57a240, 0x0da61a60, + 0x0df4e620, 0x0e4401d0, 0x0e9369f0, 0x0ee31de0, + 0x0f332000, 0x0f837180, 0x0fd412a0, 0x10250260, + 0x10763f20, 0x10c7c660, 0x11199560, 0x116baa00, + 0x11be0400, 0x1210a1c0, 0x12638180, 0x12b69ee0, + 0x1309f3e0, 0x135d7ac0, 0x13b12dc0, 0x1404ffa0, + 0x1458dd40, 0x14acb720, 0x15008120, 0x15543260, + 0x15a7c460, 0x15fb3160, 0x164e7520, 0x16a193c0, + 0x16f49740, 0x17478720, 0x179a6720, 0x17ed3720, + 0x183ff460, 0x18929c20, 0x18e52b00, 0x19379c00, + 0x1989e900, 0x19dc0ca0, 0x1a2e0280, 0x1a7fc400, + 0x1ad14a00, 0x1b228ec0, 0x1b738ea0, 0x1bc44540, + 0x1c14ada0, 0x1c64c380, 0x1cb48440, 0x1d03f420, + 0x1d531c00, 0x1da20160, 0x1df0a660, 0x1e3f0860, + 0x1e8d2340, 0x1edaf340, 0x1f2875e0, 0x1f75a700, + 0x1fc281e0, 0x200f0380, 0x205b2ac0, 0x20a6f980, + 0x20f27200, 0x213d9600, 0x21886580, 0x21d2e040, + 0x221d0640, 0x2266d6c0, 0x22b05180, 0x22f97580, + 0x23424280, 0x238ab880, 0x23d2d780, 0x241aa040, + 0x246213c0, 0x24a93300, 0x24efff80, 0x25367b40, + 0x256f68c0, 0x25b53580, 0x25faa580, 0x263fb940, + 0x26847080, 0x26c8cbc0, 0x270ccb00, 0x27506e40, + 0x2793b600, 0x27d6a200, 0x281932c0, 0x285b6880, + 0x289d4400, 0x28dec5c0, 0x291feec0, 0x2960bf80, + 0x29a137c0, 0x29e15800, 0x2a212000, 0x2a609080, + 0x2a9fa980, 0x2ade6b40, 0x2b1cd600, 0x2b5aea00, + 0x2b98a740, 0x2bd60d80, 0x2c131cc0, 0x2c4fd500, + 0x2c8c3600, 0x2cc83f00, 0x2d03f040, 0x2d3f48c0, + 0x2d7a48c0, 0x2db4ef40, 0x2def3c40, 0x2e292ec0, + 0x2e62c700, 0x2e9c0400, 0x2ed4e580, 0x2f0d6ac0, + 0x2f4592c0, 0x2f7d5c80, 0x2fb4c6c0, 0x2febd140, + 0x30227b40, 0x3058c400, 0x308eab40, 0x30c43040, + 0x30f95100, 0x312e0d00, 0x31626240, 0x31965040, + 0x31c9d5c0, 0x31fcf240, 0x322fa480, 0x3261ec00, + 0x3293c7c0, 0x32c53680, 0x32f63780, 0x3326c9c0, + 0x3356ec00, 0x33869d00, 0x33b5db80, 0x33e4a700, + 0x3412fdc0, 0x3440df40, 0x346e4a80, 0x349b3e40, + 0x34c7ba00, 0x34f3bd80, 0x351f47c0, 0x354a5840, + 0x3574ee40, 0x359f0900, 0x35c8a840, 0x35f1cb80, + 0x361a71c0, 0x36429a80, 0x366a4580, 0x36917280, + 0x36b82100, 0x36de5180, 0x37040340, 0x372936c0, + 0x374dec40, 0x37722340, 0x3795dc40, 0x37b91780, + 0x37dbd600, 0x37fe18c0, 0x381fe080, 0x38412e00, + 0x38620280, 0x38825f40, 0x38a24540, 0x38c1b680, + 0x38e0b5c0, 0x38ff4540, 0x391d6800, 0x393b20c0, + 0x39587280, 0x39755fc0, 0x3991eb80, 0x39ae1a80, + 0x39c9f280, 0x39e57980, 0x3a00b600, 0x3a1bae00, + 0x3a366800, 0x3a50e9c0, 0x3a6b3a40, 0x3a8560c0, + 0x3a9f6640, 0x3ab95400, 0x3ad332c0, 0x3aed0680, + 0x3b06cf80, 0x3b208d40, 0x3b3a3e80, 0x3b53cb80, + 0x3b6d0780, 0x3b85c380, 0x3b9dd0c0, 0x3bb4eb40, + 0x3bcabac0, 0x3bdee680, 0x3bf11680, 0x3c011440, + 0x3c179ac0, 0x3c1c4f00, 0x3c21aa40, 0x3c278880, + 0x3c2dba80, 0x3c341140, 0x3c3a5e80, 0x3c409100, + 0x3c46b480, 0x3c4cd5c0, 0x3c530180, 0x3c593cc0, + 0x3c5f84c0, 0x3c65d640, 0x3c6c2e40, 0x3c728b40, + 0x3c78ee80, 0x3c7f5840, 0x3c85c940, 0x3c8c4240, + 0x3c92c380, 0x3c994cc0, 0x3c9fde40, 0x3ca67880, + 0x3cad1ac0, 0x3cb3c540, 0x3cba7800, 0x3cc132c0, + 0x3cc7f640, 0x3ccec280, 0x3cd59800, 0x3cdc76c0, + 0x3ce35e80, 0x3cea4f00, 0x3cf147c0, 0x3cf84900, + 0x3cff5340, 0x3d0666c0, 0x3d0d8400, 0x3d14ab40, + 0x3d1bdc00, 0x3d2315c0, 0x3d2a5880, 0x3d31a440, + 0x3d38f900, 0x3d405780, 0x3d47c040, 0x3d4f3300, + 0x3d56af40, 0x3d5e3500, 0x3d65c380, 0x3d6d5ac0, + 0x3d74fb40, 0x3d7ca540, 0x3d845900, 0x3d8c1680, + 0x3d93dd00, 0x3d9bac80, 0x3da38400, 0x3dab6400, + 0x3db34c80, 0x3dbb3dc0, 0x3dc33840, 0x3dcb3bc0, + 0x3dd347c0, 0x3ddb5bc0, 0x3de37780, 0x3deb9b00, + 0x3df3c600, 0x3dfbf940, 0x3e0434c0, 0x3e0c7840, + 0x3e14c3c0, 0x3e1d1640, 0x3e256f80, 0x3e2dcf40, + 0x3e363580, 0x3e3ea300, 0x3e4717c0, 0x3e4f9380, + 0x3e581600, 0x3e609e40, 0x3e692c40, 0x3e71bf80, + 0x3e7a5840, 0x3e82f740, 0x3e8b9c40, 0x3e944700, + 0x3e9cf780, 0x3ea5ad00, 0x3eae66c0, 0x3eb72500, + 0x3ebfe780, 0x3ec8af00, 0x3ed17b80, 0x3eda4d00, + 0x3ee32340, 0x3eebfd40, 0x3ef4dac0, 0x3efdbbc0, + 0x3f06a040, 0x3f0f88c0, 0x3f187540, 0x3f216600, + 0x3f2a5a80, 0x3f335200, 0x3f3c4c40, 0x3f454940, + 0x3f4e4940, 0x3f574c80, 0x3f605340, 0x3f695dc0, + 0x3f726b40, 0x3f7b7b40, 0x3f848dc0, 0x3f8da240, + 0x3f96b940, 0x3f9fd300, 0x3fa8f040, 0x3fb21080, + 0x3fbb33c0, 0x3fc459c0, 0x3fcd81c0, 0x3fd6abc0, + 0x3fdfd780, 0x3fe90480, 0x3ff23280, 0x3ffb6100, + 0x40049f80, 0x400dd080, 0x40170400, 0x40203880, + 0x40296f00, 0x4032a600, 0x403bde00, 0x40451680, + 0x404e4f00, 0x40578700, 0x4060be80, 0x4069f500, + 0x40732b80, 0x407c6280, 0x40859980, 0x408ed100, + 0x40980800, 0x40a13f00, 0x40aa7500, 0x40b3a980, + 0x40bcdd80, 0x40c61180, 0x40cf4500, 0x40d87800, + 0x40e1ab00, 0x40eadc80, 0x40f40c80, 0x40fd3a80, + 0x41066700, 0x410f9300, 0x4118bd80, 0x4121e700, + 0x412b0f80, 0x41343580, 0x413d5880, 0x41467980, + 0x414f9780, 0x4158b380, 0x4161cd80, 0x416ae580, + 0x4173fb00, 0x417d0d00, 0x41861b80, 0x418f2600, + 0x41982c80, 0x41a12f80, 0x41aa3000, 0x41b32c80, + 0x41bc2580, 0x41c51a00, 0x41ce0900, 0x41d6f300, + 0x41dfd800, 0x41e8b880, 0x41f19400, 0x41fa6b80, + 0x42033d00, 0x420c0900, 0x4214cf00, 0x421d8e00, + 0x42264680, 0x422ef980, 0x4237a680, 0x42404d80, + 0x4248ee00, 0x42518780, 0x425a1a00, 0x4262a480, + 0x426b2800, 0x4273a400, 0x427c1980, 0x42848880, + 0x428cef80, 0x42954f00, 0x429da680, 0x42a5f500, + 0x42ae3b80, 0x42b67a00, 0x42beb100, 0x42c6e080, + 0x42cf0780, 0x42d72680, 0x42df3c00, 0x42e74880, + 0x42ef4c80, 0x42f74880, 0x42ff3c80, 0x43072880, + 0x430f0c80, 0x4316e800, 0x431eba00, 0x43268380, + 0x432e4480, 0x4335fd00, 0x433dae80, 0x43455800, + 0x434cfa00, 0x43549400, 0x435c2500, 0x4363ad80, + 0x436b2e00, 0x4372a700, 0x437a1800, 0x43818200, + 0x4388e400, 0x43903f00, 0x43979200, 0x439edd00, + 0x43a62080, 0x43ad5c80, 0x43b49180, 0x43bbbf80, + 0x43c2e800, 0x43ca0b00, 0x43d12980, 0x43d84280, + 0x43df5200, 0x43e65500, 0x43ed4800, 0x43f43080, + 0x43fb1c80, 0x44021b80, 0x44093a00, 0x44106480, + 0x44176700, 0x441e0c00, 0x44241e00, 0x44297380, + 0x4425dc00, 0x44240180, 0x441ff300, 0x4419e300, + 0x44123f80, 0x44097500, 0x43ffe900, 0x43f5e700, + 0x43eb9f00, 0x43e13f00, 0x43d6f200, 0x43ccbd80, + 0x43c28400, 0x43b82780, 0x43ad8b00, 0x43a29c80, + 0x43975180, 0x438ba080, 0x437f8180, 0x4372fd00, + 0x43662b00, 0x43592480, 0x434c0000, 0x433ecd00, + 0x43319180, 0x43245300, 0x43171700, 0x4309da80, + 0x42fc9300, 0x42ef3500, 0x42e1b600, 0x42d40280, + 0x42c60000, 0x42b79300, 0x42a8a180, 0x42991a00, + 0x4288f200, 0x42782100, 0x42669e00, 0x42546880, + 0x42418800, 0x422e0480, 0x4219e500, 0x42053680, + 0x41f00980, 0x41da7080, 0x41c47b00, 0x41ae3600, + 0x4197ab80, 0x4180e400, 0x4169e780, 0x4152bb00, + 0x413b5e80, 0x4123d180, 0x410c1480, 0x40f42100, + 0x40dbed00, 0x40c36c80, 0x40aa9600, 0x40915f80, + 0x4077c100, 0x405db280, 0x40432c80, 0x40282580, + 0x400c9280, 0x3ff068c0, 0x3fd39dc0, 0x3fb62bc0, + 0x3f981200, 0x3f795080, 0x3f59e780, 0x3f39ebc0, + 0x3f198680, 0x3ef8e100, 0x3ed82440, 0x3eb76c80, + 0x3e96c940, 0x3e764900, 0x3e55f980, 0x3e35cb00, + 0x3e1590c0, 0x3df51cc0, 0x3dd44200, 0x3db2e640, + 0x3d910200, 0x3d6e8e40, 0x3d4b8480, 0x3d27e600, + 0x3d03bc00, 0x3cdf0fc0, 0x3cb9eb80, 0x3c946240, + 0x3c6e9180, 0x3c489700, 0x3c229000, 0x3bfc95c0, + 0x3bd6bd00, 0x3bb11a80, 0x3b8bc180, 0x3b669bc0, + 0x3b416a00, 0x3b1beb80, 0x3af5e140, 0x3acf3300, + 0x3aa7ef80, 0x3a802780, 0x3a57eb80, 0x3a2f5880, + 0x3a069640, 0x39ddcd40, 0x39b524c0, 0x398ca540, + 0x39643800, 0x393bc540, 0x39133580, 0x38ea7ac0, + 0x38c19040, 0x389871c0, 0x386f1b40, 0x38458e00, + 0x381bd000, 0x37f1e780, 0x37c7db00, 0x379db080, + 0x37736e80, 0x37491b00, 0x371ebcc0, 0x36f45980, + 0x36c96600, 0x369ed300, 0x36740380, 0x3648ffc0, + 0x361dcf40, 0x35f27a00, 0x35c70780, 0x359b7f80, + 0x356fe9c0, 0x35444dc0, 0x3518b280, 0x34ed1940, + 0x34c17c00, 0x3495d4c0, 0x346a1d40, 0x343e4300, + 0x34122840, 0x33e5ae00, 0x33b8b780, 0x338b4dc0, + 0x335d9f00, 0x332fdc00, 0x33023440, 0x32d4cc40, + 0x32a7bc80, 0x327b1d40, 0x324f04c0, 0x32235280, + 0x31f7b100, 0x31cbc7c0, 0x319f4140, 0x3171fb40, + 0x31440840, 0x31157d00, 0x30e66e80, 0x30b6fc40, + 0x30875080, 0x30579600, 0x3027f700, 0x2ff89140, + 0x2fc976c0, 0x2f9ab880, 0x2f6c6780, 0x2f3e8780, + 0x2f111000, 0x2ee3f800, 0x2eb73480, 0x2e8a9840, + 0x2e5dd340, 0x2e3093c0, 0x2e028ac0, 0x2dd39680, + 0x2da3c480, 0x2d732380, 0x2d41c400, 0x2d0fd300, + 0x2cdd9ac0, 0x2cab6640, 0x2c797f00, 0x2c480d40, + 0x2c171700, 0x2be6a0c0, 0x2bb6ae80, 0x2b8739c0, + 0x2b583200, 0x2b298600, 0x2afb2400, 0x2accfa40, + 0x2a9ef500, 0x2a710100, 0x2a430ac0, 0x2a14f9c0, + 0x29e6b0c0, 0x29b81240, 0x29890140, 0x29596900, + 0x29293e00, 0x28f87500, 0x28c70340, 0x2894efc0, + 0x28625140, 0x282f4040, 0x27fbd5c0, 0x27c83540, + 0x27948ec0, 0x27611240, 0x272def80, 0x26fb4cc0, + 0x26c94780, 0x2697fcc0, 0x26678880, 0x2637f740, + 0x26094540, 0x25db6dc0, 0x25ae6b40, 0x25821680, + 0x255627c0, 0x252a55c0, 0x24fe5680, 0x24d1db40, + 0x24a48fc0, 0x24761f40, 0x244637c0, 0x2414c900, + 0x23e20240, 0x23ae1740, 0x23793bc0, 0x2343cc00, + 0x230e4ac0, 0x22d93c80, 0x22a52400, 0x22725180, + 0x2240e480, 0x2210f9c0, 0x21e2ab40, 0x21b5c7c0, + 0x2189d2c0, 0x215e4d40, 0x2132b900, 0x2106ba80, + 0x20da1940, 0x20ac9d80, 0x207e11c0, 0x204e77c0, + 0x201e0880, 0x1fecfea0, 0x1fbb94e0, 0x1f8a0500, + 0x1f59d340, 0x1f27ac20, 0x1ef67c60, 0x1ec64e40, + 0x1e96fdc0, 0x1e686400, 0x1e3a5a00, 0x1e0cae80, + 0x1ddf25e0, 0x1db18460, 0x1d839020, 0x1d5536e0, + 0x1d268e80, 0x1cf7ae60, 0x1cc8aea0, 0x1c99af00, + 0x1c6ad820, 0x1c3c5280, 0x1c0e4500, 0x1be0ab60, + 0x1bb35620, 0x1b861400, 0x1b58b480, 0x1b2b1a00, + 0x1afd39c0, 0x1acf09a0, 0x1aa080c0, 0x1a71b020, + 0x1a42c2a0, 0x1a13e420, 0x19e53fc0, 0x19b6eb00, + 0x1988e620, 0x195b3060, 0x192dc8a0, 0x1900a8a0, + 0x18d3c4e0, 0x18a711e0, 0x187a83e0, 0x184e10e0, + 0x1821b060, 0x17f55a00, 0x17c90580, 0x179cb100, + 0x177060a0, 0x17441880, 0x1717dd20, 0x16ebb080, + 0x16bf9260, 0x169382e0, 0x166781c0, 0x163b8f80, + 0x160fade0, 0x15e3de40, 0x15b82220, 0x158c7ae0, + 0x1560ea80, 0x15357240, 0x150a1400, 0x14ded020, + 0x14b3a640, 0x148895a0, 0x145d9dc0, 0x1432bde0, + 0x1407f540, 0x13dd4380, 0x13b2a860, 0x13882460, + 0x135db880, 0x133365a0, 0x13092cc0, 0x12df0e60, + 0x12b50aa0, 0x128b2120, 0x12615200, 0x12379da0, + 0x120e04c0, 0x11e48820, 0x11bb2860, 0x1191e600, + 0x1168c080, 0x113fb7a0, 0x1116cb40, 0x10edfba0, + 0x10c54a00, 0x109cb7a0, 0x10744560, 0x104bf420, + 0x1023c3e0, 0x0ffbb500, 0x0fd3c790, 0x0fabfbe0, + 0x0f845290, 0x0f5ccc40, 0x0f356970, 0x0f0e2a60, + 0x0ee70eb0, 0x0ec01610, 0x0e994040, 0x0e728d50, + 0x0e4bfdf0, 0x0e2592c0, 0x0dff4c70, 0x0dd92af0, + 0x0db32da0, 0x0d8d53e0, 0x0d679cf0, 0x0d420880, + 0x0d1c9680, 0x0cf74700, 0x0cd219f0, 0x0cad0eb0, + 0x0c882450, 0x0c6359a0, 0x0c3ead90, 0x0c1a1f80, + 0x0bf5af40, 0x0bd15cf0, 0x0bad2870, 0x0b891440, + 0x0b652530, 0x0b416020, 0x0b1dca30, 0x0afa6810, + 0x0ad73ee0, 0x0ab45370, 0x0a91aac0, 0x0a6f49b0, + 0x0a4da7f0, 0x0a2c7e20, 0x0a0ba310, 0x09eb1220, + 0x09cac6e0, 0x09aabc70, 0x098aee40, 0x096b57a0, + 0x094bf400, 0x092cbea0, 0x090db2e0, 0x08eecef0, + 0x08d01360, 0x08b18110, 0x089318b0, 0x0874db00, + 0x0856c880, 0x0838e1b0, 0x081b2730, 0x07fd99a8, + 0x07e03a28, 0x07c309a8, 0x07a60910, 0x07893918, + 0x076c99d0, 0x07502b90, 0x0733ee70, 0x0717e2f8, + 0x06fc09b8, 0x06e06378, 0x06c4f0b8, 0x06a9b1c8, + 0x068ea6a0, 0x0673cf18, 0x06592b18, 0x063ebad0, + 0x06247ed0, 0x060a7780, 0x05f0a570, 0x05d708b8, + 0x05bda128, 0x05a46e80, 0x058b7078, 0x0572a740, + 0x055a1330, 0x0541b4d8, 0x05298c98, 0x05119a88, + 0x04f9de50, 0x04e257a0, 0x04cb0630, 0x04b3ea00, + 0x049d0378, 0x04865308, 0x046fd918, 0x045995a8, + 0x04438860, 0x042db0d0, 0x04180ea0, 0x0402a1d0, + 0x03ed6abc, 0x03d869b8, 0x03c39f28, 0x03af0af0, + 0x039aaca0, 0x038683b4, 0x03728fc0, 0x035ed0b0, + 0x034b46c4, 0x0337f254, 0x0324d3a0, 0x0311eab0, + 0x02ff370c, 0x02ecb85c, 0x02da6e34, 0x02c858a8, + 0x02b67820, 0x02a4cd28, 0x02935820, 0x02821920, + 0x02710fac, 0x02603b54, 0x024f9bb4, 0x023f308c, + 0x022ef9e8, 0x021ef7c8, 0x020f2a40, 0x01ff908e, + 0x01f02974, 0x01e0f38a, 0x01d1ed94, 0x01c316d6, + 0x01b46f5e, 0x01a5f720, 0x0197ae28, 0x018994ea, + 0x017bac54, 0x016df546, 0x016070ae, 0x01532078, + 0x01460760, 0x01392834, 0x012c85a4, 0x01201f7a, + 0x0113f27c, 0x0107fb6c, 0x00fc36fd, 0x00f0a2d5, + 0x00e53d51, 0x00da050f, 0x00cef88c, 0x00c41869, + 0x00b9671f, 0x00aee754, 0x00a49b80, 0x009a8384, + 0x00909ca6, 0x0086e400, 0x007d56e3, 0x0073f48f, + 0x006abe70, 0x0061b5de, 0x0058dc65, 0x005033b5, + 0x0047be30, 0x003f7e30, 0x00377619, 0x002fa4d4, + 0x002805ee, 0x002094cb, 0x00194cb8, 0x00122856, + 0x000b215c, 0x00043148, 0xfffd51f1, 0xfff683a1, + 0xffefcd4e, 0xffe93630, 0xffe2c57e, 0xffdc855d, + 0xffd682c4, 0xffd0cad4, 0xffcb6a2d, 0xffc663bd, + 0xffc1b070, 0xffbd48e2, 0xffb92571, 0xffb53a55, + 0xffb1779d, 0xffadcd39, 0xffaa2b43, 0xffa68856, + 0xffa2e142, 0xff9f332d, 0xff9b7b9d, 0xff97bf2f, + 0xff9409e3, 0xff9067e3, 0xff8ce557, 0xff898bf1, + 0xff866307, 0xff8371d0, 0xff80bf64, 0xff7e4ebb, + 0xff7c1eab, 0xff7a2e05, 0xff787b48, 0xff770281, + 0xff75bd07, 0xff74a3f8, 0xff73b0b3, 0xff72dd03, + 0xff72237f, 0xff717ebf, 0xff70e94d, 0xff705f5a, + 0xff6fde6b, 0xff6f6427, 0xff6eee41, 0xff6e7d0c, + 0xff6e135a, 0xff6db404, 0xff6d61f9, 0xff6d2055, + 0xff6cf268, 0xff6cdb77, 0xff6cdebc, 0xff6cff48, + 0xff6d3fca, 0xff6da307, 0xff6e2b83, 0xff6eda14, + 0xff6fad6e, 0xff70a464, 0xff71bd9e, 0xff72f663, + 0xff744a81, 0xff75b5c5, 0xff77340a, 0xff78c0a7, + 0xff7a5694, 0xff7bf0dd, 0xff7d8abc, 0xff7f2302, + 0xff80bc09, 0xff825855, 0xff83fa57, 0xff85a55c, + 0xff875d22, 0xff892599, 0xff8b025e, 0xff8cf53c, + 0xff8efdf5, 0xff911c48, 0xff934fca, 0xff959676, + 0xff97ec87, 0xff9a4e36, 0xff9cb7d2, 0xff9f26cd, + 0xffa199cf, 0xffa40f75, 0xffa6867d, 0xffa8feb2, + 0xffab78e0, 0xffadf5c8, 0xffb07640, 0xffb2fba1, + 0xffb587a2, 0xffb81bfc, 0xffbaba47, 0xffbd6237, + 0xffc011a9, 0xffc2c67a, 0xffc57e85, 0xffc83894, + 0xffcaf41b, 0xffcdb0b9, 0xffd06e18, 0xffd32bf8, + 0xffd5ea38, 0xffd8a8c4, 0xffdb6765, 0xffde25fc, + 0xffe0e472, 0xffe3a2b3, 0xffe66088, 0xffe91da7, + 0xffebd979, 0xffee9352, 0xfff14ab1, 0xfff3fef7, + 0xfff6af95, 0xfff95c0d, 0xfffc03c8, 0xfffea65a, + 0x00015885, 0x0003f2e9, 0x00068a73, 0x00091e8d, + 0x000bae7f, 0x000e39bf, 0x0010bf96, 0x00133f78, + 0x0015b8c4, 0x00182ae4, 0x001a9558, 0x001cf7b3, + 0x001f51e0, 0x0021a3b4, 0x0023ed25, 0x00262df2, + 0x002865c5, 0x002a9469, 0x002cb967, 0x002ed4aa, + 0x0030e607, 0x0032ed88, 0x0034eb2f, 0x0036de23, + 0x0038c503, 0x003a9e4c, 0x003c68a7, 0x003e23dd, + 0x003fd0db, 0x00417083, 0x0043038b, 0x00448adf, + 0x00460741, 0x0047799c, 0x0048e2b3, 0x004a42af, + 0x004b98fb, 0x004ce50b, 0x004e2654, 0x004f5b5d, + 0x005081c3, 0x00519717, 0x00529920, 0x005386d0, + 0x0054603f, 0x00552581, 0x0055d6cc, 0x00567558, + 0x0057033d, 0x005782b4, 0x0057f5b6, 0x00585e46, + 0x0058be68, 0x005917ff, 0x00596ce4, 0x0059bcc0, + 0x005a053a, 0x005a43ef, 0x005a76af, 0x005a9b37, + 0x005aaf39, 0x005ab07b, 0x005a9cef, 0x005a7349, + 0x005a3328, 0x0059dc0a, 0x00596db0, 0x0058e8e5, + 0x00584f98, 0x0057a3c1, 0x0056e738, 0x00561bec, + 0x005543df, 0x0054610b, 0x0053753e, 0x0052824e, + 0x005189f6, 0x00508ded, 0x004f8fc0, 0x004e8fd1, + 0x004d8d27, 0x004c86d7, 0x004b7c0a, 0x004a6b33, + 0x00495239, 0x00482f0e, 0x0046ffc4, 0x0045c201, + 0x00447337, 0x004310cc, 0x00419871, 0x004008e5, + 0x003e6231, 0x003ca461, 0x003acf8a, 0x0038e57a, + 0x0036e981, 0x0034defa, 0x0032c94b, 0x0030acc6, + 0x002e8eb4, 0x002c7452, 0x002a62aa, 0x00285bbf, + 0x00265eda, 0x00246b24, 0x00227f9c, 0x002098e7, + 0x001eb13b, 0x001cc2ef, 0x001ac899, 0x0018be3d, + 0x0016a198, 0x00147065, 0x00122897, 0x000fcbc5, + 0x000d5f03, 0x000ae77a, 0x00086a52, 0x0005eb92, + 0x00036e4a, 0x0000f57e, 0xfffe8415, 0xfffc1a79, + 0xfff9b6bc, 0xfff756da, 0xfff4f8d1, 0xfff29ade, + 0xfff03b88, 0xffedd94d, 0xffeb7296, 0xffe9072c, + 0xffe6981b, 0xffe4265c, 0xffe1b30f, 0xffdf3f2c, + 0xffdccb9e, 0xffda5994, 0xffd7ea0d, 0xffd57d61, + 0xffd31303, 0xffd0aa28, 0xffce4244, 0xffcbdb41, + 0xffc97596, 0xffc711a3, 0xffc4af9e, 0xffc24fa7, + 0xffbff1de, 0xffbd969a, 0xffbb3e45, 0xffb8e8d6, + 0xffb695f5, 0xffb44522, 0xffb1f628, 0xffafa8f1, + 0xffad5d92, 0xffab140b, 0xffa8cc1d, 0xffa68591, + 0xffa44067, 0xffa1fca0, 0xff9fba30, 0xff9d7903, + 0xff9b3917, 0xff98fa6e, 0xff96bd07, 0xff9480b7, + 0xff924532, 0xff900a25, 0xff8dcf42, 0xff8b9434, + 0xff895885, 0xff871bd4, 0xff84dd8b, 0xff829d34, + 0xff805a44, 0xff7e142e, 0xff7bca72, 0xff797c84, + 0xff7729e4, 0xff74d205, 0xff727452, 0xff70101f, + 0xff6da494, 0xff6b30d2, 0xff68b3f5, 0xff662d32, + 0xff639bd2, 0xff60ff0a, 0xff5e562d, 0xff5ba3e1, + 0xff58ee3a, 0xff563c23, 0xff5394f4, 0xff50fd1f, + 0xff4e759a, 0xff4bff33, 0xff499ad5, 0xff47490b, + 0xff450a37, 0xff42deb8, 0xff40c6d0, 0xff3ec2bf, + 0xff3cd29a, 0xff3af682, 0xff392e6b, 0xff377a4b, + 0xff35d9f8, 0xff344d45, 0xff32d3e9, 0xff316d97, + 0xff3019da, 0xff2ed83b, 0xff2da830, 0xff2c88c0, + 0xff2b78b5, 0xff2a76cd, 0xff298185, 0xff289891, + 0xff27bc7e, 0xff26ee22, 0xff262e29, 0xff257cdd, + 0xff24d9f5, 0xff244525, 0xff23be16, 0xff234489, + 0xff22d853, 0xff227948, 0xff22273e, 0xff21e1d3, + 0xff21a872, 0xff217a7a, 0xff215749, 0xff213ecb, + 0xff21319f, 0xff21305d, 0xff213bb0, 0xff2153c3, + 0xff21782c, 0xff21a893, 0xff21e478, 0xff222bdb, + 0xff227f27, 0xff22debe, 0xff234b0a, 0xff23c395, + 0xff24471e, 0xff24d42c, 0xff25695d, 0xff260539, + 0xff26a653, 0xff274b29, 0xff27f22e, 0xff2899d3, + 0xff295976, 0xff29f2ae, 0xff2a96d8, 0xff2b45f5, + 0xff2bffe4, 0xff2cc4bb, 0xff2d9459, 0xff2e6edf, + 0xff2f544d, 0xff3044b8, 0xff314035, 0xff3246fb, + 0xff33591f, 0xff3476e1, 0xff35a061, 0xff36d535, + 0xff381490, 0xff395db0, 0xff3aafd5, 0xff3c0ac9, + 0xff3d6ed7, 0xff3edc55, 0xff405383, 0xff41d3f6, + 0xff435ccd, 0xff44ed10, 0xff4683d4, 0xff482081, + 0xff49c298, 0xff4b69ac, 0xff4d1548, 0xff4ec4f6, + 0xff50781e, 0xff522e21, 0xff53e693, 0xff55a15e, + 0xff575f18, 0xff592023, 0xff5ae4df, 0xff5cacb5, + 0xff5e75e3, 0xff603ee6, 0xff620630, 0xff63caac, + 0xff658b56, 0xff67476e, 0xff68fe12, 0xff6aaea1, + 0xff6c589a, 0xff6dfb87, 0xff6f96e8, 0xff712a66, + 0xff72b5a0, 0xff74382c, 0xff75b1d4, 0xff772277, + 0xff788a21, 0xff79e8e6, 0xff7b3ef1, 0xff7c8c99, + 0xff7dd24a, 0xff7f108d, 0xff804805, 0xff817d0e, + 0xff82b74b, 0xff83fde7, 0xff855763, 0xff86c623, + 0xff884905, 0xff89ded2, 0xff8b8647, 0xff8d3e4d, + 0xff8f05cd, 0xff90dbc6, 0xff92bf2b, 0xff94af05, + 0xff96aa27, 0xff98af9a, 0xff9abe48, 0xff9cd544, + 0xff9ef3c2, 0xffa118eb, 0xffa343fe, 0xffa57424, + 0xffa7a891, 0xffa9e085, 0xffac1b32, 0xffae5803, + 0xffb09681, 0xffb2d622, 0xffb51678, 0xffb75705, + 0xffb99726, 0xffbbd646, 0xffbe13d8, 0xffc04f26, + 0xffc2879b, 0xffc4bc73, 0xffc6ed25, 0xffc918e4, + 0xffcb3eb9, 0xffcd5dcd, 0xffcf754a, 0xffd184d9, + 0xffd38c90, 0xffd58ca5, 0xffd7854e, 0xffd97695, + 0xffdb606f, 0xffdd42d2, 0xffdf1da8, 0xffe0f09c, + 0xffe2bb01, 0xffe47c42, 0xffe633c7, 0xffe7e151, + 0xffe98535, 0xffeb1fb5, 0xffecb10f, 0xffee3945, + 0xffefb7ea, 0xfff12cbf, 0xfff29763, 0xfff3f78a, + 0xfff54cbf, 0xfff69696, 0xfff7d4b9, 0xfff90749, + 0xfffa2ee6, 0xfffb4c3d, 0xfffc6004, 0xfffd6af1, + 0xfffe6ddb, 0xffff69b9, 0x00005f4b, 0x00014e7f, + 0x00023646, 0x000315b4, 0x0003ebd3, 0x0004b74a, + 0x00057677, 0x000627e2, 0x0006ca09, 0x00075ce1, + 0x0007e196, 0x00085955, 0x0008c556, 0x00092751, + 0x00098153, 0x0009d581, 0x000a25be, 0x000a732b, + 0x000abe1f, 0x000b06e4, 0x000b4db1, 0x000b91fa, + 0x000bd266, 0x000c0da0, 0x000c426e, 0x000c6ffb, + 0x000c95b0, 0x000cb2f7, 0x000cc76e, 0x000cd317, + 0x000cd647, 0x000cd17f, 0x000cc52b, 0x000cb1ea, + 0x000c98c0, 0x000c7a62, 0x000c57c7, 0x000c3187, + 0x000c0862, 0x000bdcd8, 0x000baf81, 0x000b80c7, + 0x000b50ec, 0x000b202f, 0x000aeec6, 0x000abcb2, + 0x000a89d2, 0x000a5605, 0x000a2116, 0x0009eafb, + 0x0009b37d, 0x00097a9d, 0x00094030, 0x00090440, + 0x0008c6b9, 0x000887ae, 0x0008470c, 0x00080512, + 0x0007c1f6, 0x00077df9, 0x0007395a, 0x0006f45b, + 0x0006af67, 0x00066abe, 0x000626b6, 0x0005e38f, + 0x0005a1a0, 0x0005611e, 0x00052234, 0x0004e502, + 0x0004a95d, 0x00046f46, 0x00043691, 0x0003ff33, + 0x0003c90d, 0x0003941f, 0x00036047, 0x00032d9c, + 0x0002fc1e, 0x0002cbed, 0x00029d1e, 0x00026fbc, + 0x000243f2, 0x000219d6, 0x0001f17d, 0x0001caf1, + 0x0001a63e, 0x00018363, 0x00016256, 0x00014316, + 0x0001258f, 0x000109cb, 0x0000efaa, 0x0000d720, + 0x0000c03a, 0x0000aacb, 0x000096de, 0x0000846a, + 0x0000736d, 0x000063d3, 0x000055a6, 0x000048d0, + 0x00003d47, 0x000032f6, 0x000029dc, 0x000021d9, + 0x00001ae3, 0x000014ee, 0x00000fdb, 0x00000ba9, + 0x00000839, 0x00000589, 0x00000370, 0x000001ee, + 0x000000d7, 0x00000036, 0xffffffe1, 0xffffffc1, + 0xffffffd6, 0xfffffff6, 0x0000000b, 0x0000000b, + 0x0000000b, 0x0000000b, 0xfffffff6, 0xffffffd6, + 0xffffffcb, 0xffffffe1, 0x00000036, 0x000000d7, + 0x000001ce, 0x0000033b, 0x00000529, 0x000007ad, + 0x00000ac8, 0x00000e99, 0x00001316, 0x0000185e, + 0x00001e7e, 0x00002575, 0x00002d4c, 0x0000361b, + 0x00003fd6, 0x00004a93, 0x00005647, 0x00006312, + 0x000070de, 0x00007fad, 0x00008f87, 0x0000a064, + 0x0000b242, 0x0000c52d, 0x0000d919, 0x0000ee12, + 0x0001040c, 0x00011b13, 0x0001331b, 0x00014c30, + 0x0001663c, 0x0001814a, 0x00019d4f, 0x0001ba35, + 0x0001d7e7, 0x0001f645, 0x00021544, 0x000234c3, + 0x000254b9, 0x00027505, 0x000295a7, 0x0002b67e, + 0x0002d7a1, 0x0002f904, 0x00031ab2, 0x00033ca0, + 0x00035ee5, 0x0003818a, 0x0003a485, 0x0003c7e1, + 0x0003eb72, 0x00040f0e, 0x0004329f, 0x000455e6, + 0x000478c0, 0x00049aef, 0x0004bc52, 0x0004dca9, + 0x0004fbde, 0x000519c5, 0x00053635, 0x0005512d, + 0x00056aae, 0x000582a1, 0x00059927, 0x0005ae40, + 0x0005c1f6, 0x0005d455, 0x0005e572, 0x0005f56d, + 0x00060446, 0x0006121e, 0x00061f09, 0x00062b08, + 0x00063605, 0x00063feb, 0x00064899, 0x00064ff1, + 0x000655a5, 0x00065996, 0x00065b6f, 0x00065af8, + 0x000657e9, 0x000651d4, 0x00064884, 0x00063bae, + 0x00062b33, 0x00061706, 0x0005fefd, 0x0005e344, + 0x0005c405, 0x0005a195, 0x00057c41, 0x00055473, + 0x00052ac2, 0x0004ffc4, 0x0004d410, 0x0004a7e5, + 0x00047b4f, 0x00044e39, 0x00042096, 0x0003f208, + 0x0003c1e1, 0x00038f77, 0x00035a12, 0x00032127, + 0x0002e476, 0x0002a389, 0x00025e29, 0x0002146d, + 0x0001c700, 0x00017682, 0x000123a1, 0x0000cefd, + 0x000078f7, 0x0000221a, 0xffffcad2, 0xffff7333, + 0xffff1b1f, 0xfffec254, 0xfffe6892, 0xfffe0da3, + 0xfffdb15d, 0xfffd5394, 0xfffcf413, 0xfffc92e4, + 0xfffc3033, 0xfffbcc2a, 0xfffb6715, 0xfffb0114, + 0xfffa9a5c, 0xfffa3338, 0xfff9cbd5, 0xfff96451, + 0xfff8fcad, 0xfff894dd, 0xfff82cd9, 0xfff7c4a9, + 0xfff75c6e, 0xfff6f45f, 0xfff68c85, 0xfff62501, + 0xfff5bde8, 0xfff5575b, 0xfff4f17a, 0xfff48c65, + 0xfff42811, 0xfff3c489, 0xfff361d8, 0xfff30009, + 0xfff29f3b, 0xfff23f79, 0xfff1e0d9, 0xfff1835c, + 0xfff1272b, 0xfff0cc47, 0xfff072d0, 0xfff01ad1, + 0xffefc46a, 0xffef6fa5, 0xffef1ca4, 0xffeecb7b, + 0xffee7c20, 0xffee2eb3, 0xffede33e, 0xffed99c2, + 0xffed524a, 0xffed0cdf, 0xffecc98e, 0xffec884a, + 0xffec4935, 0xffec0c39, 0xffebd176, 0xffeb98ec, + 0xffeb62a5, 0xffeb2eae, 0xffeafd1a, 0xffeacdeb, + 0xffeaa12a, 0xffea76cd, 0xffea4ef4, 0xffea29a0, + 0xffea06e6, 0xffe9e6cf, 0xffe9c97e, 0xffe9aebc, + 0xffe99652, 0xffe97fd7, 0xffe96ad4, 0xffe95712, + 0xffe9447e, 0xffe93316, 0xffe922cf, 0xffe913a1, + 0xffe90589, 0xffe8f888, 0xffe8ec94, 0xffe8e1c2, + 0xffe8d807, 0xffe8cf78, 0xffe8c816, 0xffe8c1ec, + 0xffe8bd04, 0xffe8b968, 0xffe8b72f, 0xffe8b64e, + 0xffe8b6d9, 0xffe8b8dd, 0xffe8bc6d, 0xffe8c18b, + 0xffe8c841, 0xffe8d0a5, 0xffe8dacb, 0xffe8e69f, + 0xffe8f42b, 0xffe9035a, 0xffe9142c, 0xffe926a1, + 0xffe93ab8, 0xffe95067, 0xffe967b9, 0xffe980ae, + 0xffe99b3b, 0xffe9b755, 0xffe9d512, 0xffe9f45c, + 0xffea1533, 0xffea3798, 0xffea5b8a, 0xffea8109, + 0xffeaa800, 0xffead07a, 0xffeafa56, 0xffeb259f, + 0xffeb5255, 0xffeb8062, 0xffebafdd, 0xffebe0af, + 0xffec12cf, 0xffec4630, 0xffec7ade, 0xffecb0a4, + 0xffece775, 0xffed1f33, 0xffed57a8, 0xffed90b3, + 0xffedca49, 0xffee042b, 0xffee3e58, 0xffee788f, +}; + const DECLARE_ALIGNED(32, float, ff_aac_eld_window_480)[1800] = { 0.00101191, 0.00440397, 0.00718669, 0.01072130, 0.01459757, 0.01875954, 0.02308987, 0.02751541, diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h index 9f5a7e47bd..380a1acf31 100644 --- a/libavcodec/aactab.h +++ b/libavcodec/aactab.h @@ -46,7 +46,11 @@ */ DECLARE_ALIGNED(32, extern float, ff_aac_kbd_long_1024)[1024]; DECLARE_ALIGNED(32, extern float, ff_aac_kbd_short_128)[128]; +DECLARE_ALIGNED(32, extern int, ff_aac_kbd_long_1024_fixed)[1024]; +DECLARE_ALIGNED(32, extern int, ff_aac_kbd_long_512_fixed)[512]; +DECLARE_ALIGNED(32, extern int, ff_aac_kbd_short_128_fixed)[128]; const DECLARE_ALIGNED(32, extern float, ff_aac_eld_window_512)[1920]; +const DECLARE_ALIGNED(32, extern int, ff_aac_eld_window_512_fixed)[1920]; const DECLARE_ALIGNED(32, extern float, ff_aac_eld_window_480)[1800]; // @} diff --git a/libavcodec/cbrt_fixed_tablegen.c b/libavcodec/cbrt_fixed_tablegen.c new file mode 100644 index 0000000000..24d2fbb7e0 --- /dev/null +++ b/libavcodec/cbrt_fixed_tablegen.c @@ -0,0 +1,24 @@ +/* + * Generate a header file for hardcoded AAC cube-root table + * + * Copyright (c) 2010 Reimar Döffinger + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define USE_FIXED 1 +#include "cbrt_tablegen_template.c" diff --git a/libavcodec/cbrt_tablegen.c b/libavcodec/cbrt_tablegen.c index 59918ae82b..8c2235e987 100644 --- a/libavcodec/cbrt_tablegen.c +++ b/libavcodec/cbrt_tablegen.c @@ -19,3 +19,6 @@ * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#define USE_FIXED 0 +#include "cbrt_tablegen_template.c" diff --git a/libavcodec/cbrt_tablegen.h b/libavcodec/cbrt_tablegen.h index d8c77c2221..07ef392f65 100644 --- a/libavcodec/cbrt_tablegen.h +++ b/libavcodec/cbrt_tablegen.h @@ -27,13 +27,26 @@ #include #include "libavutil/attributes.h" +#if USE_FIXED +#define CBRT_RENAME(a) a ## _fixed +#define CBRT(x) (int)floor((x).f * 8192 + 0.5) +#else +#define CBRT_RENAME(a) a +#define CBRT(x) x.i +#endif + #if CONFIG_HARDCODED_TABLES +#if USE_FIXED +#define cbrt_tableinit_fixed() +#include "libavcodec/cbrt_fixed_tables.h" +#else #define cbrt_tableinit() #include "libavcodec/cbrt_tables.h" +#endif #else static uint32_t cbrt_tab[1 << 13]; -static av_cold void cbrt_tableinit(void) +static av_cold void CBRT_RENAME(cbrt_tableinit)(void) { if (!cbrt_tab[(1<<13) - 1]) { int i; @@ -44,7 +57,7 @@ static av_cold void cbrt_tableinit(void) uint32_t i; } f; f.f = pow(i, 1.0 / 3.0) * i; - cbrt_tab[i] = f.i; + cbrt_tab[i] = CBRT(f); } } } diff --git a/libavcodec/cbrt_tablegen_template.c b/libavcodec/cbrt_tablegen_template.c index e0a8e63a8b..a8c04956d8 100644 --- a/libavcodec/cbrt_tablegen_template.c +++ b/libavcodec/cbrt_tablegen_template.c @@ -27,7 +27,7 @@ int main(void) { - cbrt_tableinit(); + CBRT_RENAME(cbrt_tableinit)(); write_fileheader(); diff --git a/libavcodec/sinewin.c b/libavcodec/sinewin.c index 1fa0e953f0..4532dc7354 100644 --- a/libavcodec/sinewin.c +++ b/libavcodec/sinewin.c @@ -16,5 +16,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#define USE_FIXED 0 #include "sinewin.h" #include "sinewin_tablegen.h" diff --git a/libavcodec/sinewin.h b/libavcodec/sinewin.h index 2268fd52f4..5f0a74afa9 100644 --- a/libavcodec/sinewin.h +++ b/libavcodec/sinewin.h @@ -30,20 +30,32 @@ # define SINETABLE_CONST #endif +#ifndef USE_FIXED +#define USE_FIXED 0 +#endif + +#if USE_FIXED +#define SINEWIN_SUFFIX(a) a ## _fixed +#define INTFLOAT int +#else +#define SINEWIN_SUFFIX(a) a +#define INTFLOAT float +#endif + #define SINETABLE(size) \ - SINETABLE_CONST DECLARE_ALIGNED(32, float, ff_sine_##size)[size] + SINETABLE_CONST DECLARE_ALIGNED(32, INTFLOAT, SINEWIN_SUFFIX(ff_sine_##size))[size] /** * Generate a sine window. * @param window pointer to half window * @param n size of half window */ -void ff_sine_window_init(float *window, int n); +void SINEWIN_SUFFIX(ff_sine_window_init)(INTFLOAT *window, int n); /** * initialize the specified entry of ff_sine_windows */ -void ff_init_ff_sine_windows(int index); +void SINEWIN_SUFFIX(ff_init_ff_sine_windows)(int index); extern SINETABLE( 32); extern SINETABLE( 64); @@ -55,6 +67,6 @@ extern SINETABLE(2048); extern SINETABLE(4096); extern SINETABLE(8192); -extern SINETABLE_CONST float * const ff_sine_windows[14]; +extern SINETABLE_CONST INTFLOAT * const SINEWIN_SUFFIX(ff_sine_windows)[14]; #endif /* AVCODEC_SINEWIN_H */ diff --git a/libavcodec/sinewin_fixed.c b/libavcodec/sinewin_fixed.c new file mode 100644 index 0000000000..27ead29e8e --- /dev/null +++ b/libavcodec/sinewin_fixed.c @@ -0,0 +1,21 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define USE_FIXED 1 +#include "sinewin.h" +#include "sinewin_tablegen.h" diff --git a/libavcodec/sinewin_fixed_tablegen.c b/libavcodec/sinewin_fixed_tablegen.c new file mode 100644 index 0000000000..977e6f3cbf --- /dev/null +++ b/libavcodec/sinewin_fixed_tablegen.c @@ -0,0 +1,24 @@ +/* + * Generate a header file for hardcoded sine windows + * + * Copyright (c) 2009 Reimar Döffinger + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define USE_FIXED 1 +#include "sinewin_tablegen_template.c" diff --git a/libavcodec/sinewin_tablegen.c b/libavcodec/sinewin_tablegen.c index 2013b9525d..dd602668ee 100644 --- a/libavcodec/sinewin_tablegen.c +++ b/libavcodec/sinewin_tablegen.c @@ -19,3 +19,6 @@ * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#define USE_FIXED 0 +#include "sinewin_tablegen_template.c" diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h index 2b9c4f2393..e1623b472a 100644 --- a/libavcodec/sinewin_tablegen.h +++ b/libavcodec/sinewin_tablegen.h @@ -41,26 +41,41 @@ SINETABLE(2048); SINETABLE(4096); SINETABLE(8192); #else +#if USE_FIXED +#include "libavcodec/sinewin_fixed_tables.h" +#else #include "libavcodec/sinewin_tables.h" #endif +#endif + +#if USE_FIXED +#define SINEWIN_SUFFIX(a) a ## _fixed +#define INTFLOAT int +#define SIN_FIX(a) (int)floor((a) * 0x80000000 + 0.5) +#else +#define SINEWIN_SUFFIX(a) a +#define INTFLOAT float +#define SIN_FIX(a) a +#endif -SINETABLE_CONST float * const ff_sine_windows[] = { +SINETABLE_CONST INTFLOAT * const SINEWIN_SUFFIX(ff_sine_windows)[] = { NULL, NULL, NULL, NULL, NULL, // unused - ff_sine_32 , ff_sine_64 , - ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024, ff_sine_2048, ff_sine_4096, ff_sine_8192 + SINEWIN_SUFFIX(ff_sine_32) , SINEWIN_SUFFIX(ff_sine_64), SINEWIN_SUFFIX(ff_sine_128), + SINEWIN_SUFFIX(ff_sine_256), SINEWIN_SUFFIX(ff_sine_512), SINEWIN_SUFFIX(ff_sine_1024), + SINEWIN_SUFFIX(ff_sine_2048), SINEWIN_SUFFIX(ff_sine_4096), SINEWIN_SUFFIX(ff_sine_8192) }; // Generate a sine window. -av_cold void ff_sine_window_init(float *window, int n) { +av_cold void SINEWIN_SUFFIX(ff_sine_window_init)(INTFLOAT *window, int n) { int i; for(i = 0; i < n; i++) - window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n))); + window[i] = SIN_FIX(sinf((i + 0.5) * (M_PI / (2.0 * n)))); } -av_cold void ff_init_ff_sine_windows(int index) { - assert(index >= 0 && index < FF_ARRAY_ELEMS(ff_sine_windows)); +av_cold void SINEWIN_SUFFIX(ff_init_ff_sine_windows)(int index) { + assert(index >= 0 && index < FF_ARRAY_ELEMS(SINEWIN_SUFFIX(ff_sine_windows))); #if !CONFIG_HARDCODED_TABLES - ff_sine_window_init(ff_sine_windows[index], 1 << index); + SINEWIN_SUFFIX(ff_sine_window_init)(SINEWIN_SUFFIX(ff_sine_windows)[index], 1 << index); #endif } diff --git a/libavcodec/sinewin_tablegen_template.c b/libavcodec/sinewin_tablegen_template.c index 561ae3ea1d..45547c43c4 100644 --- a/libavcodec/sinewin_tablegen_template.c +++ b/libavcodec/sinewin_tablegen_template.c @@ -22,9 +22,23 @@ #include #define CONFIG_HARDCODED_TABLES 0 + +#if USE_FIXED +#define ADD_SUFFIX(a) a ## _fixed +#define INTFLOAT int +#define WRITE_FUNC write_int32_t_array + +#else + +#define ADD_SUFFIX(a) a +#define INTFLOAT float +#define WRITE_FUNC write_float_array + +#endif + #define SINETABLE_CONST #define SINETABLE(size) \ - float ff_sine_##size[size] + INTFLOAT ADD_SUFFIX(ff_sine_##size)[size] #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) #include "sinewin_tablegen.h" #include "tableprint.h" @@ -36,9 +50,9 @@ int main(void) write_fileheader(); for (i = 5; i <= 13; i++) { - ff_init_ff_sine_windows(i); + ADD_SUFFIX(ff_init_ff_sine_windows)(i); printf("SINETABLE(%4i) = {\n", 1 << i); - write_float_array(ff_sine_windows[i], 1 << i); + WRITE_FUNC(ADD_SUFFIX(ff_sine_windows)[i], 1 << i); printf("};\n"); } diff --git a/libavcodec/tableprint.h b/libavcodec/tableprint.h index 667985f6d7..6f61c7124b 100644 --- a/libavcodec/tableprint.h +++ b/libavcodec/tableprint.h @@ -64,6 +64,7 @@ void write_int8_t_array (const int8_t *, int); void write_uint8_t_array (const uint8_t *, int); void write_uint16_t_array (const uint16_t *, int); void write_uint32_t_array (const uint32_t *, int); +void write_int32_t_array (const int32_t *, int); void write_float_array (const float *, int); void write_int8_t_2d_array (const void *, int, int); void write_uint8_t_2d_array (const void *, int, int); @@ -116,6 +117,7 @@ WRITE_1D_FUNC(uint8_t, "0x%02"PRIx8, 15) WRITE_1D_FUNC(uint16_t, "0x%08"PRIx16, 7) WRITE_1D_FUNC(int16_t, "%5"PRIi16, 7) WRITE_1D_FUNC(uint32_t, "0x%08"PRIx32, 7) +WRITE_1D_FUNC(int32_t, "0x%08"PRIx32, 7) WRITE_1D_FUNC(float, "%.18e", 3) WRITE_2D_FUNC(int8_t)