diff options
Diffstat (limited to 'media/libstagefright/codecs/aacenc/src')
34 files changed, 4869 insertions, 4869 deletions
diff --git a/media/libstagefright/codecs/aacenc/src/aac_rom.c b/media/libstagefright/codecs/aacenc/src/aac_rom.c index 2ce0352..16b44e0 100644 --- a/media/libstagefright/codecs/aacenc/src/aac_rom.c +++ b/media/libstagefright/codecs/aacenc/src/aac_rom.c @@ -1,358 +1,358 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: aac_rom.c
-
- Content: constant tables
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: aac_rom.c + + Content: constant tables + *******************************************************************************/ -#include "aac_rom.h"
-
-#if defined (ARMV5E) && !defined (ARMV7Neon)
-
-/*
- * Q30 for 128 and 1024
- *
- * for (i = 0; i < num/4; i++) {
- * angle = (i + 0.125) * M_PI / num;
- * x = cos(angle) * (1 << 30);
- * x = sin(angle) * (1 << 30);
- *
- * angle = (num/2 - 1 - i + 0.125) * M_PI / num;
- * x = cos(angle) * (1 << 30);
- * x = sin(angle) * (1 << 30);
- * }
- */
-const int cossintab[128 + 1024] = {
- /* 128 */
- 0x3fffec43, 0x003243f1, 0x015fd4d2, 0x3ffc38d1, 0x3ff9c13a, 0x01c454f5, 0x02f1b755, 0x3feea776,
- 0x3fe9b8a9, 0x03562038, 0x0483259d, 0x3fd73a4a, 0x3fcfd50b, 0x04e767c5, 0x0613e1c5, 0x3fb5f4ea,
- 0x3fac1a5b, 0x0677edbb, 0x07a3adff, 0x3f8adc77, 0x3f7e8e1e, 0x08077457, 0x09324ca7, 0x3f55f796,
- 0x3f473759, 0x0995bdfd, 0x0abf8043, 0x3f174e70, 0x3f061e95, 0x0b228d42, 0x0c4b0b94, 0x3eceeaad,
- 0x3ebb4ddb, 0x0cada4f5, 0x0dd4b19a, 0x3e7cd778, 0x3e66d0b4, 0x0e36c82a, 0x0f5c35a3, 0x3e212179,
- 0x3e08b42a, 0x0fbdba40, 0x10e15b4e, 0x3dbbd6d4, 0x3da106bd, 0x11423ef0, 0x1263e699, 0x3d4d0728,
- 0x3d2fd86c, 0x12c41a4f, 0x13e39be9, 0x3cd4c38b, 0x3cb53aaa, 0x144310dd, 0x15604013, 0x3c531e88,
- 0x3c314060, 0x15bee78c, 0x16d99864, 0x3bc82c1f, 0x3ba3fde7, 0x173763c9, 0x184f6aab, 0x3b3401bb,
- 0x3b0d8909, 0x18ac4b87, 0x19c17d44, 0x3a96b636, 0x3a6df8f8, 0x1a1d6544, 0x1b2f971e, 0x39f061d2,
- 0x39c5664f, 0x1b8a7815, 0x1c997fc4, 0x39411e33, 0x3913eb0e, 0x1cf34baf, 0x1dfeff67, 0x38890663,
- 0x3859a292, 0x1e57a86d, 0x1f5fdee6, 0x37c836c2, 0x3796a996, 0x1fb7575c, 0x20bbe7d8, 0x36fecd0e,
- 0x36cb1e2a, 0x21122240, 0x2212e492, 0x362ce855, 0x35f71fb1, 0x2267d3a0, 0x2364a02e, 0x3552a8f4,
- 0x351acedd, 0x23b836ca, 0x24b0e699, 0x34703095, 0x34364da6, 0x250317df, 0x25f78497, 0x3385a222,
- 0x3349bf48, 0x264843d9, 0x273847c8, 0x329321c7, 0x32554840, 0x27878893, 0x2872feb6, 0x3198d4ea,
- 0x31590e3e, 0x28c0b4d2, 0x29a778db, 0x3096e223, 0x30553828, 0x29f3984c, 0x2ad586a3, 0x2f8d713a,
- 0x2f49ee0f, 0x2b2003ac, 0x2bfcf97c, 0x2e7cab1c, 0x2e37592c, 0x2c45c8a0, 0x2d1da3d5, 0x2d64b9da,
- /* 1024 */
- 0x3fffffb1, 0x0006487f, 0x002bfb74, 0x3ffff0e3, 0x3fffe705, 0x00388c6e, 0x005e3f4c, 0x3fffba9b,
- 0x3fffa6de, 0x006ad03b, 0x009082ea, 0x3fff5cd8, 0x3fff3f3c, 0x009d13c5, 0x00c2c62f, 0x3ffed79b,
- 0x3ffeb021, 0x00cf56ef, 0x00f508fc, 0x3ffe2ae5, 0x3ffdf98c, 0x01019998, 0x01274b31, 0x3ffd56b5,
- 0x3ffd1b7e, 0x0133dba3, 0x01598cb1, 0x3ffc5b0c, 0x3ffc15f7, 0x01661cf0, 0x018bcd5b, 0x3ffb37ec,
- 0x3ffae8f9, 0x01985d60, 0x01be0d11, 0x3ff9ed53, 0x3ff99483, 0x01ca9cd4, 0x01f04bb4, 0x3ff87b44,
- 0x3ff81896, 0x01fcdb2e, 0x02228924, 0x3ff6e1bf, 0x3ff67534, 0x022f184d, 0x0254c544, 0x3ff520c5,
- 0x3ff4aa5d, 0x02615414, 0x0286fff3, 0x3ff33858, 0x3ff2b813, 0x02938e62, 0x02b93914, 0x3ff12878,
- 0x3ff09e56, 0x02c5c71a, 0x02eb7086, 0x3feef126, 0x3fee5d28, 0x02f7fe1c, 0x031da62b, 0x3fec9265,
- 0x3febf48b, 0x032a3349, 0x034fd9e5, 0x3fea0c35, 0x3fe96480, 0x035c6682, 0x03820b93, 0x3fe75e98,
- 0x3fe6ad08, 0x038e97a9, 0x03b43b17, 0x3fe48990, 0x3fe3ce26, 0x03c0c69e, 0x03e66852, 0x3fe18d1f,
- 0x3fe0c7da, 0x03f2f342, 0x04189326, 0x3fde6945, 0x3fdd9a27, 0x04251d77, 0x044abb73, 0x3fdb1e06,
- 0x3fda450f, 0x0457451d, 0x047ce11a, 0x3fd7ab64, 0x3fd6c894, 0x04896a16, 0x04af03fc, 0x3fd4115f,
- 0x3fd324b7, 0x04bb8c42, 0x04e123fa, 0x3fd04ffc, 0x3fcf597c, 0x04edab83, 0x051340f6, 0x3fcc673b,
- 0x3fcb66e4, 0x051fc7b9, 0x05455ad1, 0x3fc8571f, 0x3fc74cf3, 0x0551e0c7, 0x0577716b, 0x3fc41fac,
- 0x3fc30baa, 0x0583f68c, 0x05a984a6, 0x3fbfc0e3, 0x3fbea30c, 0x05b608eb, 0x05db9463, 0x3fbb3ac7,
- 0x3fba131b, 0x05e817c3, 0x060da083, 0x3fb68d5b, 0x3fb55bdc, 0x061a22f7, 0x063fa8e7, 0x3fb1b8a2,
- 0x3fb07d50, 0x064c2a67, 0x0671ad71, 0x3facbc9f, 0x3fab777b, 0x067e2df5, 0x06a3ae00, 0x3fa79954,
- 0x3fa64a5f, 0x06b02d81, 0x06d5aa77, 0x3fa24ec6, 0x3fa0f600, 0x06e228ee, 0x0707a2b7, 0x3f9cdcf7,
- 0x3f9b7a62, 0x0714201b, 0x073996a1, 0x3f9743eb, 0x3f95d787, 0x074612eb, 0x076b8616, 0x3f9183a5,
- 0x3f900d72, 0x0778013d, 0x079d70f7, 0x3f8b9c28, 0x3f8a1c29, 0x07a9eaf5, 0x07cf5726, 0x3f858d79,
- 0x3f8403ae, 0x07dbcff2, 0x08013883, 0x3f7f579b, 0x3f7dc405, 0x080db016, 0x083314f1, 0x3f78fa92,
- 0x3f775d31, 0x083f8b43, 0x0864ec4f, 0x3f727661, 0x3f70cf38, 0x08716159, 0x0896be80, 0x3f6bcb0e,
- 0x3f6a1a1c, 0x08a3323a, 0x08c88b65, 0x3f64f89b, 0x3f633de2, 0x08d4fdc6, 0x08fa52de, 0x3f5dff0e,
- 0x3f5c3a8f, 0x0906c3e0, 0x092c14ce, 0x3f56de6a, 0x3f551026, 0x09388469, 0x095dd116, 0x3f4f96b4,
- 0x3f4dbeac, 0x096a3f42, 0x098f8796, 0x3f4827f0, 0x3f464626, 0x099bf44c, 0x09c13831, 0x3f409223,
- 0x3f3ea697, 0x09cda368, 0x09f2e2c7, 0x3f38d552, 0x3f36e006, 0x09ff4c78, 0x0a24873a, 0x3f30f181,
- 0x3f2ef276, 0x0a30ef5e, 0x0a56256c, 0x3f28e6b6, 0x3f26ddec, 0x0a628bfa, 0x0a87bd3d, 0x3f20b4f5,
- 0x3f1ea26e, 0x0a94222f, 0x0ab94e8f, 0x3f185c43, 0x3f164001, 0x0ac5b1dc, 0x0aead944, 0x3f0fdca5,
- 0x3f0db6a9, 0x0af73ae5, 0x0b1c5d3d, 0x3f073621, 0x3f05066d, 0x0b28bd2a, 0x0b4dda5c, 0x3efe68bc,
- 0x3efc2f50, 0x0b5a388d, 0x0b7f5081, 0x3ef5747b, 0x3ef3315a, 0x0b8bacf0, 0x0bb0bf8f, 0x3eec5965,
- 0x3eea0c8e, 0x0bbd1a33, 0x0be22766, 0x3ee3177e, 0x3ee0c0f4, 0x0bee8038, 0x0c1387e9, 0x3ed9aecc,
- 0x3ed74e91, 0x0c1fdee1, 0x0c44e0f9, 0x3ed01f55, 0x3ecdb56a, 0x0c513610, 0x0c763278, 0x3ec66920,
- 0x3ec3f585, 0x0c8285a5, 0x0ca77c47, 0x3ebc8c31, 0x3eba0ee9, 0x0cb3cd84, 0x0cd8be47, 0x3eb2888f,
- 0x3eb0019c, 0x0ce50d8c, 0x0d09f85b, 0x3ea85e41, 0x3ea5cda3, 0x0d1645a0, 0x0d3b2a64, 0x3e9e0d4c,
- 0x3e9b7306, 0x0d4775a1, 0x0d6c5443, 0x3e9395b7, 0x3e90f1ca, 0x0d789d71, 0x0d9d75db, 0x3e88f788,
- 0x3e8649f5, 0x0da9bcf2, 0x0dce8f0d, 0x3e7e32c6, 0x3e7b7b90, 0x0ddad406, 0x0dff9fba, 0x3e734778,
- 0x3e70869f, 0x0e0be28e, 0x0e30a7c5, 0x3e6835a4, 0x3e656b2b, 0x0e3ce86b, 0x0e61a70f, 0x3e5cfd51,
- 0x3e5a2939, 0x0e6de580, 0x0e929d7a, 0x3e519e86, 0x3e4ec0d1, 0x0e9ed9af, 0x0ec38ae8, 0x3e46194a,
- 0x3e4331fa, 0x0ecfc4d9, 0x0ef46f3b, 0x3e3a6da4, 0x3e377cbb, 0x0f00a6df, 0x0f254a53, 0x3e2e9b9c,
- 0x3e2ba11b, 0x0f317fa5, 0x0f561c15, 0x3e22a338, 0x3e1f9f21, 0x0f624f0c, 0x0f86e460, 0x3e168480,
- 0x3e1376d5, 0x0f9314f5, 0x0fb7a317, 0x3e0a3f7b, 0x3e07283f, 0x0fc3d143, 0x0fe8581d, 0x3dfdd432,
- 0x3dfab365, 0x0ff483d7, 0x10190352, 0x3df142ab, 0x3dee1851, 0x10252c94, 0x1049a49a, 0x3de48aef,
- 0x3de15708, 0x1055cb5b, 0x107a3bd5, 0x3dd7ad05, 0x3dd46f94, 0x1086600e, 0x10aac8e6, 0x3dcaa8f5,
- 0x3dc761fc, 0x10b6ea90, 0x10db4baf, 0x3dbd7ec7, 0x3dba2e48, 0x10e76ac3, 0x110bc413, 0x3db02e84,
- 0x3dacd481, 0x1117e088, 0x113c31f3, 0x3da2b834, 0x3d9f54af, 0x11484bc2, 0x116c9531, 0x3d951bde,
- 0x3d91aed9, 0x1178ac53, 0x119cedaf, 0x3d87598c, 0x3d83e309, 0x11a9021d, 0x11cd3b50, 0x3d797145,
- 0x3d75f147, 0x11d94d02, 0x11fd7df6, 0x3d6b6313, 0x3d67d99b, 0x12098ce5, 0x122db583, 0x3d5d2efe,
- 0x3d599c0e, 0x1239c1a7, 0x125de1da, 0x3d4ed50f, 0x3d4b38aa, 0x1269eb2b, 0x128e02dc, 0x3d40554e,
- 0x3d3caf76, 0x129a0954, 0x12be186c, 0x3d31afc5, 0x3d2e007c, 0x12ca1c03, 0x12ee226c, 0x3d22e47c,
- 0x3d1f2bc5, 0x12fa231b, 0x131e20c0, 0x3d13f37e, 0x3d10315a, 0x132a1e7e, 0x134e1348, 0x3d04dcd2,
- 0x3d011145, 0x135a0e0e, 0x137df9e7, 0x3cf5a082, 0x3cf1cb8e, 0x1389f1af, 0x13add481, 0x3ce63e98,
- 0x3ce2603f, 0x13b9c943, 0x13dda2f7, 0x3cd6b71e, 0x3cd2cf62, 0x13e994ab, 0x140d652c, 0x3cc70a1c,
- 0x3cc318ff, 0x141953cb, 0x143d1b02, 0x3cb7379c, 0x3cb33d22, 0x14490685, 0x146cc45c, 0x3ca73fa9,
- 0x3ca33bd3, 0x1478acbc, 0x149c611d, 0x3c97224c, 0x3c93151d, 0x14a84652, 0x14cbf127, 0x3c86df8e,
- 0x3c82c909, 0x14d7d32a, 0x14fb745e, 0x3c76777b, 0x3c7257a2, 0x15075327, 0x152aeaa3, 0x3c65ea1c,
- 0x3c61c0f1, 0x1536c62b, 0x155a53d9, 0x3c55377b, 0x3c510501, 0x15662c18, 0x1589afe3, 0x3c445fa2,
- 0x3c4023dd, 0x159584d3, 0x15b8fea4, 0x3c33629d, 0x3c2f1d8e, 0x15c4d03e, 0x15e83fff, 0x3c224075,
- 0x3c1df21f, 0x15f40e3a, 0x161773d6, 0x3c10f935, 0x3c0ca19b, 0x16233eac, 0x16469a0d, 0x3bff8ce8,
- 0x3bfb2c0c, 0x16526176, 0x1675b286, 0x3bedfb99, 0x3be9917e, 0x1681767c, 0x16a4bd25, 0x3bdc4552,
- 0x3bd7d1fa, 0x16b07d9f, 0x16d3b9cc, 0x3bca6a1d, 0x3bc5ed8d, 0x16df76c3, 0x1702a85e, 0x3bb86a08,
- 0x3bb3e440, 0x170e61cc, 0x173188be, 0x3ba6451b, 0x3ba1b620, 0x173d3e9b, 0x17605ad0, 0x3b93fb63,
- 0x3b8f6337, 0x176c0d15, 0x178f1e76, 0x3b818ceb, 0x3b7ceb90, 0x179acd1c, 0x17bdd394, 0x3b6ef9be,
- 0x3b6a4f38, 0x17c97e93, 0x17ec7a0d, 0x3b5c41e8, 0x3b578e39, 0x17f8215e, 0x181b11c4, 0x3b496574,
- 0x3b44a8a0, 0x1826b561, 0x18499a9d, 0x3b36646e, 0x3b319e77, 0x18553a7d, 0x1878147a, 0x3b233ee1,
- 0x3b1e6fca, 0x1883b097, 0x18a67f3f, 0x3b0ff4d9, 0x3b0b1ca6, 0x18b21791, 0x18d4dad0, 0x3afc8663,
- 0x3af7a516, 0x18e06f50, 0x1903270f, 0x3ae8f38b, 0x3ae40926, 0x190eb7b7, 0x193163e1, 0x3ad53c5b,
- 0x3ad048e3, 0x193cf0a9, 0x195f9128, 0x3ac160e1, 0x3abc6458, 0x196b1a09, 0x198daec8, 0x3aad6129,
- 0x3aa85b92, 0x199933bb, 0x19bbbca6, 0x3a993d3e, 0x3a942e9d, 0x19c73da3, 0x19e9baa3, 0x3a84f52f,
- 0x3a7fdd86, 0x19f537a4, 0x1a17a8a5, 0x3a708906, 0x3a6b6859, 0x1a2321a2, 0x1a45868e, 0x3a5bf8d1,
- 0x3a56cf23, 0x1a50fb81, 0x1a735442, 0x3a47449c, 0x3a4211f0, 0x1a7ec524, 0x1aa111a6, 0x3a326c74,
- 0x3a2d30cd, 0x1aac7e6f, 0x1acebe9d, 0x3a1d7066, 0x3a182bc8, 0x1ada2746, 0x1afc5b0a, 0x3a08507f,
- 0x3a0302ed, 0x1b07bf8c, 0x1b29e6d2, 0x39f30ccc, 0x39edb649, 0x1b354727, 0x1b5761d8, 0x39dda55a,
- 0x39d845e9, 0x1b62bdf8, 0x1b84cc01, 0x39c81a36, 0x39c2b1da, 0x1b9023e5, 0x1bb22530, 0x39b26b6d,
- 0x39acfa2b, 0x1bbd78d2, 0x1bdf6d4a, 0x399c990d, 0x39971ee7, 0x1beabca1, 0x1c0ca432, 0x3986a324,
- 0x3981201e, 0x1c17ef39, 0x1c39c9cd, 0x397089bf, 0x396afddc, 0x1c45107c, 0x1c66ddfe, 0x395a4ceb,
- 0x3954b82e, 0x1c72204f, 0x1c93e0ab, 0x3943ecb6, 0x393e4f23, 0x1c9f1e96, 0x1cc0d1b6, 0x392d692f,
- 0x3927c2c9, 0x1ccc0b35, 0x1cedb106, 0x3916c262, 0x3911132d, 0x1cf8e611, 0x1d1a7e7d, 0x38fff85e,
- 0x38fa405e, 0x1d25af0d, 0x1d473a00, 0x38e90b31, 0x38e34a69, 0x1d52660f, 0x1d73e374, 0x38d1fae9,
- 0x38cc315d, 0x1d7f0afb, 0x1da07abc, 0x38bac795, 0x38b4f547, 0x1dab9db5, 0x1dccffbf, 0x38a37142,
- 0x389d9637, 0x1dd81e21, 0x1df9725f, 0x388bf7ff, 0x3886143b, 0x1e048c24, 0x1e25d282, 0x38745bdb,
- 0x386e6f60, 0x1e30e7a4, 0x1e52200c, 0x385c9ce3, 0x3856a7b6, 0x1e5d3084, 0x1e7e5ae2, 0x3844bb28,
- 0x383ebd4c, 0x1e8966a8, 0x1eaa82e9, 0x382cb6b7, 0x3826b030, 0x1eb589f7, 0x1ed69805, 0x38148f9f,
- 0x380e8071, 0x1ee19a54, 0x1f029a1c, 0x37fc45ef, 0x37f62e1d, 0x1f0d97a5, 0x1f2e8911, 0x37e3d9b7,
- 0x37ddb945, 0x1f3981ce, 0x1f5a64cb, 0x37cb4b04, 0x37c521f6, 0x1f6558b5, 0x1f862d2d, 0x37b299e7,
- 0x37ac6841, 0x1f911c3d, 0x1fb1e21d, 0x3799c66f, 0x37938c34, 0x1fbccc4d, 0x1fdd8381, 0x3780d0aa,
- 0x377a8ddf, 0x1fe868c8, 0x2009113c, 0x3767b8a9, 0x37616d51, 0x2013f196, 0x20348b35, 0x374e7e7b,
- 0x37482a9a, 0x203f6699, 0x205ff14f, 0x3735222f, 0x372ec5c9, 0x206ac7b8, 0x208b4372, 0x371ba3d4,
- 0x37153eee, 0x209614d9, 0x20b68181, 0x3702037c, 0x36fb9618, 0x20c14ddf, 0x20e1ab63, 0x36e84135,
- 0x36e1cb58, 0x20ec72b1, 0x210cc0fc, 0x36ce5d10, 0x36c7debd, 0x21178334, 0x2137c232, 0x36b4571b,
- 0x36add058, 0x21427f4d, 0x2162aeea, 0x369a2f69, 0x3693a038, 0x216d66e2, 0x218d870b, 0x367fe608,
- 0x36794e6e, 0x219839d8, 0x21b84a79, 0x36657b08, 0x365edb09, 0x21c2f815, 0x21e2f91a, 0x364aee7b,
- 0x3644461b, 0x21eda17f, 0x220d92d4, 0x36304070, 0x36298fb4, 0x221835fb, 0x2238178d, 0x361570f8,
- 0x360eb7e3, 0x2242b56f, 0x22628729, 0x35fa8023, 0x35f3beba, 0x226d1fc1, 0x228ce191, 0x35df6e03,
- 0x35d8a449, 0x229774d7, 0x22b726a8, 0x35c43aa7, 0x35bd68a1, 0x22c1b496, 0x22e15655, 0x35a8e621,
- 0x35a20bd3, 0x22ebdee5, 0x230b707e, 0x358d7081, 0x35868def, 0x2315f3a8, 0x23357509, 0x3571d9d9,
- 0x356aef08, 0x233ff2c8, 0x235f63dc, 0x35562239, 0x354f2f2c, 0x2369dc29, 0x23893cdd, 0x353a49b2,
- 0x35334e6f, 0x2393afb2, 0x23b2fff3, 0x351e5056, 0x35174ce0, 0x23bd6d48, 0x23dcad03, 0x35023636,
- 0x34fb2a92, 0x23e714d3, 0x240643f4, 0x34e5fb63, 0x34dee795, 0x2410a639, 0x242fc4ad, 0x34c99fef,
- 0x34c283fb, 0x243a215f, 0x24592f13, 0x34ad23eb, 0x34a5ffd5, 0x2463862c, 0x2482830d, 0x34908768,
- 0x34895b36, 0x248cd487, 0x24abc082, 0x3473ca79, 0x346c962f, 0x24b60c57, 0x24d4e757, 0x3456ed2f,
- 0x344fb0d1, 0x24df2d81, 0x24fdf775, 0x3439ef9c, 0x3432ab2e, 0x250837ed, 0x2526f0c1, 0x341cd1d2,
- 0x34158559, 0x25312b81, 0x254fd323, 0x33ff93e2, 0x33f83f62, 0x255a0823, 0x25789e80, 0x33e235df,
- 0x33dad95e, 0x2582cdbc, 0x25a152c0, 0x33c4b7db, 0x33bd535c, 0x25ab7c30, 0x25c9efca, 0x33a719e8,
- 0x339fad70, 0x25d41369, 0x25f27584, 0x33895c18, 0x3381e7ac, 0x25fc934b, 0x261ae3d6, 0x336b7e7e,
- 0x33640223, 0x2624fbbf, 0x26433aa7, 0x334d812d, 0x3345fce6, 0x264d4cac, 0x266b79dd, 0x332f6435,
- 0x3327d808, 0x267585f8, 0x2693a161, 0x331127ab, 0x3309939c, 0x269da78b, 0x26bbb119, 0x32f2cba1,
- 0x32eb2fb5, 0x26c5b14c, 0x26e3a8ec, 0x32d45029, 0x32ccac64, 0x26eda322, 0x270b88c2, 0x32b5b557,
- 0x32ae09be, 0x27157cf5, 0x27335082, 0x3296fb3d, 0x328f47d5, 0x273d3eac, 0x275b0014, 0x327821ee,
- 0x327066bc, 0x2764e82f, 0x27829760, 0x3259297d, 0x32516686, 0x278c7965, 0x27aa164c, 0x323a11fe,
- 0x32324746, 0x27b3f235, 0x27d17cc1, 0x321adb83, 0x3213090f, 0x27db5288, 0x27f8caa5, 0x31fb8620,
- 0x31f3abf5, 0x28029a45, 0x281fffe2, 0x31dc11e8, 0x31d4300b, 0x2829c954, 0x28471c5e, 0x31bc7eee,
- 0x31b49564, 0x2850df9d, 0x286e2002, 0x319ccd46, 0x3194dc14, 0x2877dd07, 0x28950ab6, 0x317cfd04,
- 0x3175042e, 0x289ec17a, 0x28bbdc61, 0x315d0e3b, 0x31550dc6, 0x28c58cdf, 0x28e294eb, 0x313d00ff,
- 0x3134f8f1, 0x28ec3f1e, 0x2909343e, 0x311cd564, 0x3114c5c0, 0x2912d81f, 0x292fba40, 0x30fc8b7d,
- 0x30f47449, 0x293957c9, 0x295626da, 0x30dc235e, 0x30d404a0, 0x295fbe06, 0x297c79f5, 0x30bb9d1c,
- 0x30b376d8, 0x29860abd, 0x29a2b378, 0x309af8ca, 0x3092cb05, 0x29ac3dd7, 0x29c8d34d, 0x307a367c,
- 0x3072013c, 0x29d2573c, 0x29eed95b, 0x30595648, 0x30511991, 0x29f856d5, 0x2a14c58b, 0x30385840,
- 0x30301418, 0x2a1e3c8a, 0x2a3a97c7, 0x30173c7a, 0x300ef0e5, 0x2a440844, 0x2a604ff5, 0x2ff6030a,
- 0x2fedb00d, 0x2a69b9ec, 0x2a85ee00, 0x2fd4ac04, 0x2fcc51a5, 0x2a8f516b, 0x2aab71d0, 0x2fb3377c,
- 0x2faad5c1, 0x2ab4cea9, 0x2ad0db4e, 0x2f91a589, 0x2f893c75, 0x2ada318e, 0x2af62a63, 0x2f6ff63d,
- 0x2f6785d7, 0x2aff7a05, 0x2b1b5ef8, 0x2f4e29af, 0x2f45b1fb, 0x2b24a7f6, 0x2b4078f5, 0x2f2c3ff2,
- 0x2f23c0f6, 0x2b49bb4a, 0x2b657844, 0x2f0a391d, 0x2f01b2de, 0x2b6eb3ea, 0x2b8a5cce, 0x2ee81543,
- 0x2edf87c6, 0x2b9391c0, 0x2baf267d, 0x2ec5d479, 0x2ebd3fc4, 0x2bb854b4, 0x2bd3d53a, 0x2ea376d6,
- 0x2e9adaee, 0x2bdcfcb0, 0x2bf868ed, 0x2e80fc6e, 0x2e785958, 0x2c01899e, 0x2c1ce181, 0x2e5e6556,
- 0x2e55bb17, 0x2c25fb66, 0x2c413edf, 0x2e3bb1a4, 0x2e330042, 0x2c4a51f3, 0x2c6580f1, 0x2e18e16d,
- 0x2e1028ed, 0x2c6e8d2e, 0x2c89a79f, 0x2df5f4c7, 0x2ded352f, 0x2c92ad01, 0x2cadb2d5, 0x2dd2ebc7,
- 0x2dca251c, 0x2cb6b155, 0x2cd1a27b, 0x2dafc683, 0x2da6f8ca, 0x2cda9a14, 0x2cf5767c, 0x2d8c8510,
- 0x2d83b04f, 0x2cfe6728, 0x2d192ec1, 0x2d692784, 0x2d604bc0, 0x2d22187a, 0x2d3ccb34, 0x2d45adf6
-};
-
-
-const int twidTab512[(8*6 + 32*6 + 128*6)/2] = {
- 0x40000000, 0x40000000, 0x40000000, 0x3b20187d,
- 0x3ec50c7c, 0x3536238e, 0x2d412d41, 0x3b20187d,
- 0x187d3b20, 0x187d3b20, 0x3536238e, 0xf3843ec5,
- 0x00004000, 0x2d412d41, 0xd2bf2d41, 0xe7833b20,
- 0x238e3536, 0xc13b0c7c, 0xd2bf2d41, 0x187d3b20,
- 0xc4e0e783, 0xc4e0187d, 0x0c7c3ec5, 0xdc72caca,
-
- 0x40000000, 0x40000000, 0x40000000, 0x3fb10645,
- 0x3fec0323, 0x3f4e0964, 0x3ec50c7c, 0x3fb10645,
- 0x3d3e1294, 0x3d3e1294, 0x3f4e0964, 0x39da1b5d,
- 0x3b20187d, 0x3ec50c7c, 0x3536238e, 0x38711e2b,
- 0x3e140f8c, 0x2f6b2afa, 0x3536238e, 0x3d3e1294,
- 0x28993179, 0x31792899, 0x3c42158f, 0x20e736e5,
- 0x2d412d41, 0x3b20187d, 0x187d3b20, 0x28993179,
- 0x39da1b5d, 0x0f8c3e14, 0x238e3536, 0x38711e2b,
- 0x06453fb1, 0x1e2b3871, 0x36e520e7, 0xfcdd3fec,
- 0x187d3b20, 0x3536238e, 0xf3843ec5, 0x12943d3e,
- 0x3367261f, 0xea713c42, 0x0c7c3ec5, 0x31792899,
- 0xe1d53871, 0x06453fb1, 0x2f6b2afa, 0xd9e13367,
- 0x00004000, 0x2d412d41, 0xd2bf2d41, 0xf9bb3fb1,
- 0x2afa2f6b, 0xcc99261f, 0xf3843ec5, 0x28993179,
- 0xc78f1e2b, 0xed6c3d3e, 0x261f3367, 0xc3be158f,
- 0xe7833b20, 0x238e3536, 0xc13b0c7c, 0xe1d53871,
- 0x20e736e5, 0xc0140323, 0xdc723536, 0x1e2b3871,
- 0xc04ff9bb, 0xd7673179, 0x1b5d39da, 0xc1ecf074,
- 0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xce872899,
- 0x158f3c42, 0xc91bdf19, 0xcaca238e, 0x12943d3e,
- 0xce87d767, 0xc78f1e2b, 0x0f8c3e14, 0xd506d095,
- 0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, 0xc2c21294,
- 0x09643f4e, 0xe4a3c626, 0xc13b0c7c, 0x06453fb1,
- 0xed6cc2c2, 0xc04f0645, 0x03233fec, 0xf69cc0b2,
-
- 0x40000000, 0x40000000, 0x40000000, 0x3ffb0192,
- 0x3ffe00c9, 0x3ff4025b, 0x3fec0323, 0x3ffb0192,
- 0x3fd304b5, 0x3fd304b5, 0x3ff4025b, 0x3f9c070d,
- 0x3fb10645, 0x3fec0323, 0x3f4e0964, 0x3f8407d5,
- 0x3fe103ec, 0x3eeb0bb6, 0x3f4e0964, 0x3fd304b5,
- 0x3e710e05, 0x3f0e0af1, 0x3fc3057d, 0x3de2104f,
- 0x3ec50c7c, 0x3fb10645, 0x3d3e1294, 0x3e710e05,
- 0x3f9c070d, 0x3c8414d1, 0x3e140f8c, 0x3f8407d5,
- 0x3bb61708, 0x3dae1111, 0x3f6a089c, 0x3ad21937,
- 0x3d3e1294, 0x3f4e0964, 0x39da1b5d, 0x3cc51413,
- 0x3f2f0a2a, 0x38cf1d79, 0x3c42158f, 0x3f0e0af1,
- 0x37af1f8b, 0x3bb61708, 0x3eeb0bb6, 0x367c2192,
- 0x3b20187d, 0x3ec50c7c, 0x3536238e, 0x3a8219ef,
- 0x3e9c0d41, 0x33de257d, 0x39da1b5d, 0x3e710e05,
- 0x3274275f, 0x392a1cc6, 0x3e440ec9, 0x30f82934,
- 0x38711e2b, 0x3e140f8c, 0x2f6b2afa, 0x37af1f8b,
- 0x3de2104f, 0x2dce2cb2, 0x36e520e7, 0x3dae1111,
- 0x2c212e5a, 0x3612223d, 0x3d7711d3, 0x2a652ff1,
- 0x3536238e, 0x3d3e1294, 0x28993179, 0x345324da,
- 0x3d021354, 0x26c032ee, 0x3367261f, 0x3cc51413,
- 0x24da3453, 0x3274275f, 0x3c8414d1, 0x22e635a5,
- 0x31792899, 0x3c42158f, 0x20e736e5, 0x307629cd,
- 0x3bfd164c, 0x1edc3811, 0x2f6b2afa, 0x3bb61708,
- 0x1cc6392a, 0x2e5a2c21, 0x3b6c17c3, 0x1aa63a2f,
- 0x2d412d41, 0x3b20187d, 0x187d3b20, 0x2c212e5a,
- 0x3ad21937, 0x164c3bfd, 0x2afa2f6b, 0x3a8219ef,
- 0x14133cc5, 0x29cd3076, 0x3a2f1aa6, 0x11d33d77,
- 0x28993179, 0x39da1b5d, 0x0f8c3e14, 0x275f3274,
- 0x39831c12, 0x0d413e9c, 0x261f3367, 0x392a1cc6,
- 0x0af13f0e, 0x24da3453, 0x38cf1d79, 0x089c3f6a,
- 0x238e3536, 0x38711e2b, 0x06453fb1, 0x223d3612,
- 0x38111edc, 0x03ec3fe1, 0x20e736e5, 0x37af1f8b,
- 0x01923ffb, 0x1f8b37af, 0x374b2039, 0xff373ffe,
- 0x1e2b3871, 0x36e520e7, 0xfcdd3fec, 0x1cc6392a,
- 0x367c2192, 0xfa833fc3, 0x1b5d39da, 0x3612223d,
- 0xf82b3f84, 0x19ef3a82, 0x35a522e6, 0xf5d63f2f,
- 0x187d3b20, 0x3536238e, 0xf3843ec5, 0x17083bb6,
- 0x34c62434, 0xf1373e44, 0x158f3c42, 0x345324da,
- 0xeeef3dae, 0x14133cc5, 0x33de257d, 0xecac3d02,
- 0x12943d3e, 0x3367261f, 0xea713c42, 0x11113dae,
- 0x32ee26c0, 0xe83d3b6c, 0x0f8c3e14, 0x3274275f,
- 0xe6113a82, 0x0e053e71, 0x31f727fd, 0xe3ee3983,
- 0x0c7c3ec5, 0x31792899, 0xe1d53871, 0x0af13f0e,
- 0x30f82934, 0xdfc7374b, 0x09643f4e, 0x307629cd,
- 0xddc33612, 0x07d53f84, 0x2ff12a65, 0xdbcc34c6,
- 0x06453fb1, 0x2f6b2afa, 0xd9e13367, 0x04b53fd3,
- 0x2ee32b8e, 0xd80331f7, 0x03233fec, 0x2e5a2c21,
- 0xd6333076, 0x01923ffb, 0x2dce2cb2, 0xd4722ee3,
- 0x00004000, 0x2d412d41, 0xd2bf2d41, 0xfe6e3ffb,
- 0x2cb22dce, 0xd11d2b8e, 0xfcdd3fec, 0x2c212e5a,
- 0xcf8a29cd, 0xfb4b3fd3, 0x2b8e2ee3, 0xce0927fd,
- 0xf9bb3fb1, 0x2afa2f6b, 0xcc99261f, 0xf82b3f84,
- 0x2a652ff1, 0xcb3a2434, 0xf69c3f4e, 0x29cd3076,
- 0xc9ee223d, 0xf50f3f0e, 0x293430f8, 0xc8b52039,
- 0xf3843ec5, 0x28993179, 0xc78f1e2b, 0xf1fb3e71,
- 0x27fd31f7, 0xc67d1c12, 0xf0743e14, 0x275f3274,
- 0xc57e19ef, 0xeeef3dae, 0x26c032ee, 0xc49417c3,
- 0xed6c3d3e, 0x261f3367, 0xc3be158f, 0xebed3cc5,
- 0x257d33de, 0xc2fe1354, 0xea713c42, 0x24da3453,
- 0xc2521111, 0xe8f83bb6, 0x243434c6, 0xc1bc0ec9,
- 0xe7833b20, 0x238e3536, 0xc13b0c7c, 0xe6113a82,
- 0x22e635a5, 0xc0d10a2a, 0xe4a339da, 0x223d3612,
- 0xc07c07d5, 0xe33a392a, 0x2192367c, 0xc03d057d,
- 0xe1d53871, 0x20e736e5, 0xc0140323, 0xe07537af,
- 0x2039374b, 0xc00200c9, 0xdf1936e5, 0x1f8b37af,
- 0xc005fe6e, 0xddc33612, 0x1edc3811, 0xc01ffc14,
- 0xdc723536, 0x1e2b3871, 0xc04ff9bb, 0xdb263453,
- 0x1d7938cf, 0xc096f764, 0xd9e13367, 0x1cc6392a,
- 0xc0f2f50f, 0xd8a13274, 0x1c123983, 0xc164f2bf,
- 0xd7673179, 0x1b5d39da, 0xc1ecf074, 0xd6333076,
- 0x1aa63a2f, 0xc289ee2d, 0xd5062f6b, 0x19ef3a82,
- 0xc33bebed, 0xd3df2e5a, 0x19373ad2, 0xc403e9b4,
- 0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xd1a62c21,
- 0x17c33b6c, 0xc5d1e55a, 0xd0952afa, 0x17083bb6,
- 0xc6d6e33a, 0xcf8a29cd, 0x164c3bfd, 0xc7efe124,
- 0xce872899, 0x158f3c42, 0xc91bdf19, 0xcd8c275f,
- 0x14d13c84, 0xca5bdd1a, 0xcc99261f, 0x14133cc5,
- 0xcbaddb26, 0xcbad24da, 0x13543d02, 0xcd12d940,
- 0xcaca238e, 0x12943d3e, 0xce87d767, 0xc9ee223d,
- 0x11d33d77, 0xd00fd59b, 0xc91b20e7, 0x11113dae,
- 0xd1a6d3df, 0xc8511f8b, 0x104f3de2, 0xd34ed232,
- 0xc78f1e2b, 0x0f8c3e14, 0xd506d095, 0xc6d61cc6,
- 0x0ec93e44, 0xd6cccf08, 0xc6261b5d, 0x0e053e71,
- 0xd8a1cd8c, 0xc57e19ef, 0x0d413e9c, 0xda83cc22,
- 0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, 0xc44a1708,
- 0x0bb63eeb, 0xde6ec984, 0xc3be158f, 0x0af13f0e,
- 0xe075c851, 0xc33b1413, 0x0a2a3f2f, 0xe287c731,
- 0xc2c21294, 0x09643f4e, 0xe4a3c626, 0xc2521111,
- 0x089c3f6a, 0xe6c9c52e, 0xc1ec0f8c, 0x07d53f84,
- 0xe8f8c44a, 0xc18f0e05, 0x070d3f9c, 0xeb2fc37c,
- 0xc13b0c7c, 0x06453fb1, 0xed6cc2c2, 0xc0f20af1,
- 0x057d3fc3, 0xefb1c21e, 0xc0b20964, 0x04b53fd3,
- 0xf1fbc18f, 0xc07c07d5, 0x03ec3fe1, 0xf44ac115,
- 0xc04f0645, 0x03233fec, 0xf69cc0b2, 0xc02d04b5,
- 0x025b3ff4, 0xf8f3c064, 0xc0140323, 0x01923ffb,
- 0xfb4bc02d, 0xc0050192, 0x00c93ffe, 0xfda5c00c
-};
-
-const int twidTab64[(4*6 + 16*6)/2] = {
- 0x40000000, 0x40000000, 0x40000000, 0x2d412d41,
- 0x3b20187d, 0x187d3b20, 0x00004000, 0x2d412d41,
- 0xd2bf2d41, 0xd2bf2d41, 0x187d3b20, 0xc4e0e783,
-
- 0x40000000, 0x40000000, 0x40000000, 0x3ec50c7c,
- 0x3fb10645, 0x3d3e1294, 0x3b20187d, 0x3ec50c7c,
- 0x3536238e, 0x3536238e, 0x3d3e1294, 0x28993179,
- 0x2d412d41, 0x3b20187d, 0x187d3b20, 0x238e3536,
- 0x38711e2b, 0x06453fb1, 0x187d3b20, 0x3536238e,
- 0xf3843ec5, 0x0c7c3ec5, 0x31792899, 0xe1d53871,
- 0x00004000, 0x2d412d41, 0xd2bf2d41, 0xf3843ec5,
- 0x28993179, 0xc78f1e2b, 0xe7833b20, 0x238e3536,
- 0xc13b0c7c, 0xdc723536, 0x1e2b3871, 0xc04ff9bb,
- 0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xcaca238e,
- 0x12943d3e, 0xce87d767, 0xc4e0187d, 0x0c7c3ec5,
- 0xdc72caca, 0xc13b0c7c, 0x06453fb1, 0xed6cc2c2
-};
-
-#elif defined ARMV7Neon
-/*
- * Q29 for 128 and 1024
- *
- * for (i = 0; i < num/4; i++) {
- * angle = (i + 0.125) * M_PI / num;
- * x = cos(angle) * (1 << 29);
- * x = sin(angle) * (1 << 29);
- *
- * angle = (num/2 - 1 - i + 0.125) * M_PI / num;
- * x = cos(angle) * (1 << 29);
- * x = sin(angle) * (1 << 29);
- * }
- */
-const int cossintab[128 + 1024] = {
- /* 128 */
+#include "aac_rom.h" + +#if defined (ARMV5E) && !defined (ARMV7Neon) + +/* + * Q30 for 128 and 1024 + * + * for (i = 0; i < num/4; i++) { + * angle = (i + 0.125) * M_PI / num; + * x = cos(angle) * (1 << 30); + * x = sin(angle) * (1 << 30); + * + * angle = (num/2 - 1 - i + 0.125) * M_PI / num; + * x = cos(angle) * (1 << 30); + * x = sin(angle) * (1 << 30); + * } + */ +const int cossintab[128 + 1024] = { + /* 128 */ + 0x3fffec43, 0x003243f1, 0x015fd4d2, 0x3ffc38d1, 0x3ff9c13a, 0x01c454f5, 0x02f1b755, 0x3feea776, + 0x3fe9b8a9, 0x03562038, 0x0483259d, 0x3fd73a4a, 0x3fcfd50b, 0x04e767c5, 0x0613e1c5, 0x3fb5f4ea, + 0x3fac1a5b, 0x0677edbb, 0x07a3adff, 0x3f8adc77, 0x3f7e8e1e, 0x08077457, 0x09324ca7, 0x3f55f796, + 0x3f473759, 0x0995bdfd, 0x0abf8043, 0x3f174e70, 0x3f061e95, 0x0b228d42, 0x0c4b0b94, 0x3eceeaad, + 0x3ebb4ddb, 0x0cada4f5, 0x0dd4b19a, 0x3e7cd778, 0x3e66d0b4, 0x0e36c82a, 0x0f5c35a3, 0x3e212179, + 0x3e08b42a, 0x0fbdba40, 0x10e15b4e, 0x3dbbd6d4, 0x3da106bd, 0x11423ef0, 0x1263e699, 0x3d4d0728, + 0x3d2fd86c, 0x12c41a4f, 0x13e39be9, 0x3cd4c38b, 0x3cb53aaa, 0x144310dd, 0x15604013, 0x3c531e88, + 0x3c314060, 0x15bee78c, 0x16d99864, 0x3bc82c1f, 0x3ba3fde7, 0x173763c9, 0x184f6aab, 0x3b3401bb, + 0x3b0d8909, 0x18ac4b87, 0x19c17d44, 0x3a96b636, 0x3a6df8f8, 0x1a1d6544, 0x1b2f971e, 0x39f061d2, + 0x39c5664f, 0x1b8a7815, 0x1c997fc4, 0x39411e33, 0x3913eb0e, 0x1cf34baf, 0x1dfeff67, 0x38890663, + 0x3859a292, 0x1e57a86d, 0x1f5fdee6, 0x37c836c2, 0x3796a996, 0x1fb7575c, 0x20bbe7d8, 0x36fecd0e, + 0x36cb1e2a, 0x21122240, 0x2212e492, 0x362ce855, 0x35f71fb1, 0x2267d3a0, 0x2364a02e, 0x3552a8f4, + 0x351acedd, 0x23b836ca, 0x24b0e699, 0x34703095, 0x34364da6, 0x250317df, 0x25f78497, 0x3385a222, + 0x3349bf48, 0x264843d9, 0x273847c8, 0x329321c7, 0x32554840, 0x27878893, 0x2872feb6, 0x3198d4ea, + 0x31590e3e, 0x28c0b4d2, 0x29a778db, 0x3096e223, 0x30553828, 0x29f3984c, 0x2ad586a3, 0x2f8d713a, + 0x2f49ee0f, 0x2b2003ac, 0x2bfcf97c, 0x2e7cab1c, 0x2e37592c, 0x2c45c8a0, 0x2d1da3d5, 0x2d64b9da, + /* 1024 */ + 0x3fffffb1, 0x0006487f, 0x002bfb74, 0x3ffff0e3, 0x3fffe705, 0x00388c6e, 0x005e3f4c, 0x3fffba9b, + 0x3fffa6de, 0x006ad03b, 0x009082ea, 0x3fff5cd8, 0x3fff3f3c, 0x009d13c5, 0x00c2c62f, 0x3ffed79b, + 0x3ffeb021, 0x00cf56ef, 0x00f508fc, 0x3ffe2ae5, 0x3ffdf98c, 0x01019998, 0x01274b31, 0x3ffd56b5, + 0x3ffd1b7e, 0x0133dba3, 0x01598cb1, 0x3ffc5b0c, 0x3ffc15f7, 0x01661cf0, 0x018bcd5b, 0x3ffb37ec, + 0x3ffae8f9, 0x01985d60, 0x01be0d11, 0x3ff9ed53, 0x3ff99483, 0x01ca9cd4, 0x01f04bb4, 0x3ff87b44, + 0x3ff81896, 0x01fcdb2e, 0x02228924, 0x3ff6e1bf, 0x3ff67534, 0x022f184d, 0x0254c544, 0x3ff520c5, + 0x3ff4aa5d, 0x02615414, 0x0286fff3, 0x3ff33858, 0x3ff2b813, 0x02938e62, 0x02b93914, 0x3ff12878, + 0x3ff09e56, 0x02c5c71a, 0x02eb7086, 0x3feef126, 0x3fee5d28, 0x02f7fe1c, 0x031da62b, 0x3fec9265, + 0x3febf48b, 0x032a3349, 0x034fd9e5, 0x3fea0c35, 0x3fe96480, 0x035c6682, 0x03820b93, 0x3fe75e98, + 0x3fe6ad08, 0x038e97a9, 0x03b43b17, 0x3fe48990, 0x3fe3ce26, 0x03c0c69e, 0x03e66852, 0x3fe18d1f, + 0x3fe0c7da, 0x03f2f342, 0x04189326, 0x3fde6945, 0x3fdd9a27, 0x04251d77, 0x044abb73, 0x3fdb1e06, + 0x3fda450f, 0x0457451d, 0x047ce11a, 0x3fd7ab64, 0x3fd6c894, 0x04896a16, 0x04af03fc, 0x3fd4115f, + 0x3fd324b7, 0x04bb8c42, 0x04e123fa, 0x3fd04ffc, 0x3fcf597c, 0x04edab83, 0x051340f6, 0x3fcc673b, + 0x3fcb66e4, 0x051fc7b9, 0x05455ad1, 0x3fc8571f, 0x3fc74cf3, 0x0551e0c7, 0x0577716b, 0x3fc41fac, + 0x3fc30baa, 0x0583f68c, 0x05a984a6, 0x3fbfc0e3, 0x3fbea30c, 0x05b608eb, 0x05db9463, 0x3fbb3ac7, + 0x3fba131b, 0x05e817c3, 0x060da083, 0x3fb68d5b, 0x3fb55bdc, 0x061a22f7, 0x063fa8e7, 0x3fb1b8a2, + 0x3fb07d50, 0x064c2a67, 0x0671ad71, 0x3facbc9f, 0x3fab777b, 0x067e2df5, 0x06a3ae00, 0x3fa79954, + 0x3fa64a5f, 0x06b02d81, 0x06d5aa77, 0x3fa24ec6, 0x3fa0f600, 0x06e228ee, 0x0707a2b7, 0x3f9cdcf7, + 0x3f9b7a62, 0x0714201b, 0x073996a1, 0x3f9743eb, 0x3f95d787, 0x074612eb, 0x076b8616, 0x3f9183a5, + 0x3f900d72, 0x0778013d, 0x079d70f7, 0x3f8b9c28, 0x3f8a1c29, 0x07a9eaf5, 0x07cf5726, 0x3f858d79, + 0x3f8403ae, 0x07dbcff2, 0x08013883, 0x3f7f579b, 0x3f7dc405, 0x080db016, 0x083314f1, 0x3f78fa92, + 0x3f775d31, 0x083f8b43, 0x0864ec4f, 0x3f727661, 0x3f70cf38, 0x08716159, 0x0896be80, 0x3f6bcb0e, + 0x3f6a1a1c, 0x08a3323a, 0x08c88b65, 0x3f64f89b, 0x3f633de2, 0x08d4fdc6, 0x08fa52de, 0x3f5dff0e, + 0x3f5c3a8f, 0x0906c3e0, 0x092c14ce, 0x3f56de6a, 0x3f551026, 0x09388469, 0x095dd116, 0x3f4f96b4, + 0x3f4dbeac, 0x096a3f42, 0x098f8796, 0x3f4827f0, 0x3f464626, 0x099bf44c, 0x09c13831, 0x3f409223, + 0x3f3ea697, 0x09cda368, 0x09f2e2c7, 0x3f38d552, 0x3f36e006, 0x09ff4c78, 0x0a24873a, 0x3f30f181, + 0x3f2ef276, 0x0a30ef5e, 0x0a56256c, 0x3f28e6b6, 0x3f26ddec, 0x0a628bfa, 0x0a87bd3d, 0x3f20b4f5, + 0x3f1ea26e, 0x0a94222f, 0x0ab94e8f, 0x3f185c43, 0x3f164001, 0x0ac5b1dc, 0x0aead944, 0x3f0fdca5, + 0x3f0db6a9, 0x0af73ae5, 0x0b1c5d3d, 0x3f073621, 0x3f05066d, 0x0b28bd2a, 0x0b4dda5c, 0x3efe68bc, + 0x3efc2f50, 0x0b5a388d, 0x0b7f5081, 0x3ef5747b, 0x3ef3315a, 0x0b8bacf0, 0x0bb0bf8f, 0x3eec5965, + 0x3eea0c8e, 0x0bbd1a33, 0x0be22766, 0x3ee3177e, 0x3ee0c0f4, 0x0bee8038, 0x0c1387e9, 0x3ed9aecc, + 0x3ed74e91, 0x0c1fdee1, 0x0c44e0f9, 0x3ed01f55, 0x3ecdb56a, 0x0c513610, 0x0c763278, 0x3ec66920, + 0x3ec3f585, 0x0c8285a5, 0x0ca77c47, 0x3ebc8c31, 0x3eba0ee9, 0x0cb3cd84, 0x0cd8be47, 0x3eb2888f, + 0x3eb0019c, 0x0ce50d8c, 0x0d09f85b, 0x3ea85e41, 0x3ea5cda3, 0x0d1645a0, 0x0d3b2a64, 0x3e9e0d4c, + 0x3e9b7306, 0x0d4775a1, 0x0d6c5443, 0x3e9395b7, 0x3e90f1ca, 0x0d789d71, 0x0d9d75db, 0x3e88f788, + 0x3e8649f5, 0x0da9bcf2, 0x0dce8f0d, 0x3e7e32c6, 0x3e7b7b90, 0x0ddad406, 0x0dff9fba, 0x3e734778, + 0x3e70869f, 0x0e0be28e, 0x0e30a7c5, 0x3e6835a4, 0x3e656b2b, 0x0e3ce86b, 0x0e61a70f, 0x3e5cfd51, + 0x3e5a2939, 0x0e6de580, 0x0e929d7a, 0x3e519e86, 0x3e4ec0d1, 0x0e9ed9af, 0x0ec38ae8, 0x3e46194a, + 0x3e4331fa, 0x0ecfc4d9, 0x0ef46f3b, 0x3e3a6da4, 0x3e377cbb, 0x0f00a6df, 0x0f254a53, 0x3e2e9b9c, + 0x3e2ba11b, 0x0f317fa5, 0x0f561c15, 0x3e22a338, 0x3e1f9f21, 0x0f624f0c, 0x0f86e460, 0x3e168480, + 0x3e1376d5, 0x0f9314f5, 0x0fb7a317, 0x3e0a3f7b, 0x3e07283f, 0x0fc3d143, 0x0fe8581d, 0x3dfdd432, + 0x3dfab365, 0x0ff483d7, 0x10190352, 0x3df142ab, 0x3dee1851, 0x10252c94, 0x1049a49a, 0x3de48aef, + 0x3de15708, 0x1055cb5b, 0x107a3bd5, 0x3dd7ad05, 0x3dd46f94, 0x1086600e, 0x10aac8e6, 0x3dcaa8f5, + 0x3dc761fc, 0x10b6ea90, 0x10db4baf, 0x3dbd7ec7, 0x3dba2e48, 0x10e76ac3, 0x110bc413, 0x3db02e84, + 0x3dacd481, 0x1117e088, 0x113c31f3, 0x3da2b834, 0x3d9f54af, 0x11484bc2, 0x116c9531, 0x3d951bde, + 0x3d91aed9, 0x1178ac53, 0x119cedaf, 0x3d87598c, 0x3d83e309, 0x11a9021d, 0x11cd3b50, 0x3d797145, + 0x3d75f147, 0x11d94d02, 0x11fd7df6, 0x3d6b6313, 0x3d67d99b, 0x12098ce5, 0x122db583, 0x3d5d2efe, + 0x3d599c0e, 0x1239c1a7, 0x125de1da, 0x3d4ed50f, 0x3d4b38aa, 0x1269eb2b, 0x128e02dc, 0x3d40554e, + 0x3d3caf76, 0x129a0954, 0x12be186c, 0x3d31afc5, 0x3d2e007c, 0x12ca1c03, 0x12ee226c, 0x3d22e47c, + 0x3d1f2bc5, 0x12fa231b, 0x131e20c0, 0x3d13f37e, 0x3d10315a, 0x132a1e7e, 0x134e1348, 0x3d04dcd2, + 0x3d011145, 0x135a0e0e, 0x137df9e7, 0x3cf5a082, 0x3cf1cb8e, 0x1389f1af, 0x13add481, 0x3ce63e98, + 0x3ce2603f, 0x13b9c943, 0x13dda2f7, 0x3cd6b71e, 0x3cd2cf62, 0x13e994ab, 0x140d652c, 0x3cc70a1c, + 0x3cc318ff, 0x141953cb, 0x143d1b02, 0x3cb7379c, 0x3cb33d22, 0x14490685, 0x146cc45c, 0x3ca73fa9, + 0x3ca33bd3, 0x1478acbc, 0x149c611d, 0x3c97224c, 0x3c93151d, 0x14a84652, 0x14cbf127, 0x3c86df8e, + 0x3c82c909, 0x14d7d32a, 0x14fb745e, 0x3c76777b, 0x3c7257a2, 0x15075327, 0x152aeaa3, 0x3c65ea1c, + 0x3c61c0f1, 0x1536c62b, 0x155a53d9, 0x3c55377b, 0x3c510501, 0x15662c18, 0x1589afe3, 0x3c445fa2, + 0x3c4023dd, 0x159584d3, 0x15b8fea4, 0x3c33629d, 0x3c2f1d8e, 0x15c4d03e, 0x15e83fff, 0x3c224075, + 0x3c1df21f, 0x15f40e3a, 0x161773d6, 0x3c10f935, 0x3c0ca19b, 0x16233eac, 0x16469a0d, 0x3bff8ce8, + 0x3bfb2c0c, 0x16526176, 0x1675b286, 0x3bedfb99, 0x3be9917e, 0x1681767c, 0x16a4bd25, 0x3bdc4552, + 0x3bd7d1fa, 0x16b07d9f, 0x16d3b9cc, 0x3bca6a1d, 0x3bc5ed8d, 0x16df76c3, 0x1702a85e, 0x3bb86a08, + 0x3bb3e440, 0x170e61cc, 0x173188be, 0x3ba6451b, 0x3ba1b620, 0x173d3e9b, 0x17605ad0, 0x3b93fb63, + 0x3b8f6337, 0x176c0d15, 0x178f1e76, 0x3b818ceb, 0x3b7ceb90, 0x179acd1c, 0x17bdd394, 0x3b6ef9be, + 0x3b6a4f38, 0x17c97e93, 0x17ec7a0d, 0x3b5c41e8, 0x3b578e39, 0x17f8215e, 0x181b11c4, 0x3b496574, + 0x3b44a8a0, 0x1826b561, 0x18499a9d, 0x3b36646e, 0x3b319e77, 0x18553a7d, 0x1878147a, 0x3b233ee1, + 0x3b1e6fca, 0x1883b097, 0x18a67f3f, 0x3b0ff4d9, 0x3b0b1ca6, 0x18b21791, 0x18d4dad0, 0x3afc8663, + 0x3af7a516, 0x18e06f50, 0x1903270f, 0x3ae8f38b, 0x3ae40926, 0x190eb7b7, 0x193163e1, 0x3ad53c5b, + 0x3ad048e3, 0x193cf0a9, 0x195f9128, 0x3ac160e1, 0x3abc6458, 0x196b1a09, 0x198daec8, 0x3aad6129, + 0x3aa85b92, 0x199933bb, 0x19bbbca6, 0x3a993d3e, 0x3a942e9d, 0x19c73da3, 0x19e9baa3, 0x3a84f52f, + 0x3a7fdd86, 0x19f537a4, 0x1a17a8a5, 0x3a708906, 0x3a6b6859, 0x1a2321a2, 0x1a45868e, 0x3a5bf8d1, + 0x3a56cf23, 0x1a50fb81, 0x1a735442, 0x3a47449c, 0x3a4211f0, 0x1a7ec524, 0x1aa111a6, 0x3a326c74, + 0x3a2d30cd, 0x1aac7e6f, 0x1acebe9d, 0x3a1d7066, 0x3a182bc8, 0x1ada2746, 0x1afc5b0a, 0x3a08507f, + 0x3a0302ed, 0x1b07bf8c, 0x1b29e6d2, 0x39f30ccc, 0x39edb649, 0x1b354727, 0x1b5761d8, 0x39dda55a, + 0x39d845e9, 0x1b62bdf8, 0x1b84cc01, 0x39c81a36, 0x39c2b1da, 0x1b9023e5, 0x1bb22530, 0x39b26b6d, + 0x39acfa2b, 0x1bbd78d2, 0x1bdf6d4a, 0x399c990d, 0x39971ee7, 0x1beabca1, 0x1c0ca432, 0x3986a324, + 0x3981201e, 0x1c17ef39, 0x1c39c9cd, 0x397089bf, 0x396afddc, 0x1c45107c, 0x1c66ddfe, 0x395a4ceb, + 0x3954b82e, 0x1c72204f, 0x1c93e0ab, 0x3943ecb6, 0x393e4f23, 0x1c9f1e96, 0x1cc0d1b6, 0x392d692f, + 0x3927c2c9, 0x1ccc0b35, 0x1cedb106, 0x3916c262, 0x3911132d, 0x1cf8e611, 0x1d1a7e7d, 0x38fff85e, + 0x38fa405e, 0x1d25af0d, 0x1d473a00, 0x38e90b31, 0x38e34a69, 0x1d52660f, 0x1d73e374, 0x38d1fae9, + 0x38cc315d, 0x1d7f0afb, 0x1da07abc, 0x38bac795, 0x38b4f547, 0x1dab9db5, 0x1dccffbf, 0x38a37142, + 0x389d9637, 0x1dd81e21, 0x1df9725f, 0x388bf7ff, 0x3886143b, 0x1e048c24, 0x1e25d282, 0x38745bdb, + 0x386e6f60, 0x1e30e7a4, 0x1e52200c, 0x385c9ce3, 0x3856a7b6, 0x1e5d3084, 0x1e7e5ae2, 0x3844bb28, + 0x383ebd4c, 0x1e8966a8, 0x1eaa82e9, 0x382cb6b7, 0x3826b030, 0x1eb589f7, 0x1ed69805, 0x38148f9f, + 0x380e8071, 0x1ee19a54, 0x1f029a1c, 0x37fc45ef, 0x37f62e1d, 0x1f0d97a5, 0x1f2e8911, 0x37e3d9b7, + 0x37ddb945, 0x1f3981ce, 0x1f5a64cb, 0x37cb4b04, 0x37c521f6, 0x1f6558b5, 0x1f862d2d, 0x37b299e7, + 0x37ac6841, 0x1f911c3d, 0x1fb1e21d, 0x3799c66f, 0x37938c34, 0x1fbccc4d, 0x1fdd8381, 0x3780d0aa, + 0x377a8ddf, 0x1fe868c8, 0x2009113c, 0x3767b8a9, 0x37616d51, 0x2013f196, 0x20348b35, 0x374e7e7b, + 0x37482a9a, 0x203f6699, 0x205ff14f, 0x3735222f, 0x372ec5c9, 0x206ac7b8, 0x208b4372, 0x371ba3d4, + 0x37153eee, 0x209614d9, 0x20b68181, 0x3702037c, 0x36fb9618, 0x20c14ddf, 0x20e1ab63, 0x36e84135, + 0x36e1cb58, 0x20ec72b1, 0x210cc0fc, 0x36ce5d10, 0x36c7debd, 0x21178334, 0x2137c232, 0x36b4571b, + 0x36add058, 0x21427f4d, 0x2162aeea, 0x369a2f69, 0x3693a038, 0x216d66e2, 0x218d870b, 0x367fe608, + 0x36794e6e, 0x219839d8, 0x21b84a79, 0x36657b08, 0x365edb09, 0x21c2f815, 0x21e2f91a, 0x364aee7b, + 0x3644461b, 0x21eda17f, 0x220d92d4, 0x36304070, 0x36298fb4, 0x221835fb, 0x2238178d, 0x361570f8, + 0x360eb7e3, 0x2242b56f, 0x22628729, 0x35fa8023, 0x35f3beba, 0x226d1fc1, 0x228ce191, 0x35df6e03, + 0x35d8a449, 0x229774d7, 0x22b726a8, 0x35c43aa7, 0x35bd68a1, 0x22c1b496, 0x22e15655, 0x35a8e621, + 0x35a20bd3, 0x22ebdee5, 0x230b707e, 0x358d7081, 0x35868def, 0x2315f3a8, 0x23357509, 0x3571d9d9, + 0x356aef08, 0x233ff2c8, 0x235f63dc, 0x35562239, 0x354f2f2c, 0x2369dc29, 0x23893cdd, 0x353a49b2, + 0x35334e6f, 0x2393afb2, 0x23b2fff3, 0x351e5056, 0x35174ce0, 0x23bd6d48, 0x23dcad03, 0x35023636, + 0x34fb2a92, 0x23e714d3, 0x240643f4, 0x34e5fb63, 0x34dee795, 0x2410a639, 0x242fc4ad, 0x34c99fef, + 0x34c283fb, 0x243a215f, 0x24592f13, 0x34ad23eb, 0x34a5ffd5, 0x2463862c, 0x2482830d, 0x34908768, + 0x34895b36, 0x248cd487, 0x24abc082, 0x3473ca79, 0x346c962f, 0x24b60c57, 0x24d4e757, 0x3456ed2f, + 0x344fb0d1, 0x24df2d81, 0x24fdf775, 0x3439ef9c, 0x3432ab2e, 0x250837ed, 0x2526f0c1, 0x341cd1d2, + 0x34158559, 0x25312b81, 0x254fd323, 0x33ff93e2, 0x33f83f62, 0x255a0823, 0x25789e80, 0x33e235df, + 0x33dad95e, 0x2582cdbc, 0x25a152c0, 0x33c4b7db, 0x33bd535c, 0x25ab7c30, 0x25c9efca, 0x33a719e8, + 0x339fad70, 0x25d41369, 0x25f27584, 0x33895c18, 0x3381e7ac, 0x25fc934b, 0x261ae3d6, 0x336b7e7e, + 0x33640223, 0x2624fbbf, 0x26433aa7, 0x334d812d, 0x3345fce6, 0x264d4cac, 0x266b79dd, 0x332f6435, + 0x3327d808, 0x267585f8, 0x2693a161, 0x331127ab, 0x3309939c, 0x269da78b, 0x26bbb119, 0x32f2cba1, + 0x32eb2fb5, 0x26c5b14c, 0x26e3a8ec, 0x32d45029, 0x32ccac64, 0x26eda322, 0x270b88c2, 0x32b5b557, + 0x32ae09be, 0x27157cf5, 0x27335082, 0x3296fb3d, 0x328f47d5, 0x273d3eac, 0x275b0014, 0x327821ee, + 0x327066bc, 0x2764e82f, 0x27829760, 0x3259297d, 0x32516686, 0x278c7965, 0x27aa164c, 0x323a11fe, + 0x32324746, 0x27b3f235, 0x27d17cc1, 0x321adb83, 0x3213090f, 0x27db5288, 0x27f8caa5, 0x31fb8620, + 0x31f3abf5, 0x28029a45, 0x281fffe2, 0x31dc11e8, 0x31d4300b, 0x2829c954, 0x28471c5e, 0x31bc7eee, + 0x31b49564, 0x2850df9d, 0x286e2002, 0x319ccd46, 0x3194dc14, 0x2877dd07, 0x28950ab6, 0x317cfd04, + 0x3175042e, 0x289ec17a, 0x28bbdc61, 0x315d0e3b, 0x31550dc6, 0x28c58cdf, 0x28e294eb, 0x313d00ff, + 0x3134f8f1, 0x28ec3f1e, 0x2909343e, 0x311cd564, 0x3114c5c0, 0x2912d81f, 0x292fba40, 0x30fc8b7d, + 0x30f47449, 0x293957c9, 0x295626da, 0x30dc235e, 0x30d404a0, 0x295fbe06, 0x297c79f5, 0x30bb9d1c, + 0x30b376d8, 0x29860abd, 0x29a2b378, 0x309af8ca, 0x3092cb05, 0x29ac3dd7, 0x29c8d34d, 0x307a367c, + 0x3072013c, 0x29d2573c, 0x29eed95b, 0x30595648, 0x30511991, 0x29f856d5, 0x2a14c58b, 0x30385840, + 0x30301418, 0x2a1e3c8a, 0x2a3a97c7, 0x30173c7a, 0x300ef0e5, 0x2a440844, 0x2a604ff5, 0x2ff6030a, + 0x2fedb00d, 0x2a69b9ec, 0x2a85ee00, 0x2fd4ac04, 0x2fcc51a5, 0x2a8f516b, 0x2aab71d0, 0x2fb3377c, + 0x2faad5c1, 0x2ab4cea9, 0x2ad0db4e, 0x2f91a589, 0x2f893c75, 0x2ada318e, 0x2af62a63, 0x2f6ff63d, + 0x2f6785d7, 0x2aff7a05, 0x2b1b5ef8, 0x2f4e29af, 0x2f45b1fb, 0x2b24a7f6, 0x2b4078f5, 0x2f2c3ff2, + 0x2f23c0f6, 0x2b49bb4a, 0x2b657844, 0x2f0a391d, 0x2f01b2de, 0x2b6eb3ea, 0x2b8a5cce, 0x2ee81543, + 0x2edf87c6, 0x2b9391c0, 0x2baf267d, 0x2ec5d479, 0x2ebd3fc4, 0x2bb854b4, 0x2bd3d53a, 0x2ea376d6, + 0x2e9adaee, 0x2bdcfcb0, 0x2bf868ed, 0x2e80fc6e, 0x2e785958, 0x2c01899e, 0x2c1ce181, 0x2e5e6556, + 0x2e55bb17, 0x2c25fb66, 0x2c413edf, 0x2e3bb1a4, 0x2e330042, 0x2c4a51f3, 0x2c6580f1, 0x2e18e16d, + 0x2e1028ed, 0x2c6e8d2e, 0x2c89a79f, 0x2df5f4c7, 0x2ded352f, 0x2c92ad01, 0x2cadb2d5, 0x2dd2ebc7, + 0x2dca251c, 0x2cb6b155, 0x2cd1a27b, 0x2dafc683, 0x2da6f8ca, 0x2cda9a14, 0x2cf5767c, 0x2d8c8510, + 0x2d83b04f, 0x2cfe6728, 0x2d192ec1, 0x2d692784, 0x2d604bc0, 0x2d22187a, 0x2d3ccb34, 0x2d45adf6 +}; + + +const int twidTab512[(8*6 + 32*6 + 128*6)/2] = { + 0x40000000, 0x40000000, 0x40000000, 0x3b20187d, + 0x3ec50c7c, 0x3536238e, 0x2d412d41, 0x3b20187d, + 0x187d3b20, 0x187d3b20, 0x3536238e, 0xf3843ec5, + 0x00004000, 0x2d412d41, 0xd2bf2d41, 0xe7833b20, + 0x238e3536, 0xc13b0c7c, 0xd2bf2d41, 0x187d3b20, + 0xc4e0e783, 0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, + + 0x40000000, 0x40000000, 0x40000000, 0x3fb10645, + 0x3fec0323, 0x3f4e0964, 0x3ec50c7c, 0x3fb10645, + 0x3d3e1294, 0x3d3e1294, 0x3f4e0964, 0x39da1b5d, + 0x3b20187d, 0x3ec50c7c, 0x3536238e, 0x38711e2b, + 0x3e140f8c, 0x2f6b2afa, 0x3536238e, 0x3d3e1294, + 0x28993179, 0x31792899, 0x3c42158f, 0x20e736e5, + 0x2d412d41, 0x3b20187d, 0x187d3b20, 0x28993179, + 0x39da1b5d, 0x0f8c3e14, 0x238e3536, 0x38711e2b, + 0x06453fb1, 0x1e2b3871, 0x36e520e7, 0xfcdd3fec, + 0x187d3b20, 0x3536238e, 0xf3843ec5, 0x12943d3e, + 0x3367261f, 0xea713c42, 0x0c7c3ec5, 0x31792899, + 0xe1d53871, 0x06453fb1, 0x2f6b2afa, 0xd9e13367, + 0x00004000, 0x2d412d41, 0xd2bf2d41, 0xf9bb3fb1, + 0x2afa2f6b, 0xcc99261f, 0xf3843ec5, 0x28993179, + 0xc78f1e2b, 0xed6c3d3e, 0x261f3367, 0xc3be158f, + 0xe7833b20, 0x238e3536, 0xc13b0c7c, 0xe1d53871, + 0x20e736e5, 0xc0140323, 0xdc723536, 0x1e2b3871, + 0xc04ff9bb, 0xd7673179, 0x1b5d39da, 0xc1ecf074, + 0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xce872899, + 0x158f3c42, 0xc91bdf19, 0xcaca238e, 0x12943d3e, + 0xce87d767, 0xc78f1e2b, 0x0f8c3e14, 0xd506d095, + 0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, 0xc2c21294, + 0x09643f4e, 0xe4a3c626, 0xc13b0c7c, 0x06453fb1, + 0xed6cc2c2, 0xc04f0645, 0x03233fec, 0xf69cc0b2, + + 0x40000000, 0x40000000, 0x40000000, 0x3ffb0192, + 0x3ffe00c9, 0x3ff4025b, 0x3fec0323, 0x3ffb0192, + 0x3fd304b5, 0x3fd304b5, 0x3ff4025b, 0x3f9c070d, + 0x3fb10645, 0x3fec0323, 0x3f4e0964, 0x3f8407d5, + 0x3fe103ec, 0x3eeb0bb6, 0x3f4e0964, 0x3fd304b5, + 0x3e710e05, 0x3f0e0af1, 0x3fc3057d, 0x3de2104f, + 0x3ec50c7c, 0x3fb10645, 0x3d3e1294, 0x3e710e05, + 0x3f9c070d, 0x3c8414d1, 0x3e140f8c, 0x3f8407d5, + 0x3bb61708, 0x3dae1111, 0x3f6a089c, 0x3ad21937, + 0x3d3e1294, 0x3f4e0964, 0x39da1b5d, 0x3cc51413, + 0x3f2f0a2a, 0x38cf1d79, 0x3c42158f, 0x3f0e0af1, + 0x37af1f8b, 0x3bb61708, 0x3eeb0bb6, 0x367c2192, + 0x3b20187d, 0x3ec50c7c, 0x3536238e, 0x3a8219ef, + 0x3e9c0d41, 0x33de257d, 0x39da1b5d, 0x3e710e05, + 0x3274275f, 0x392a1cc6, 0x3e440ec9, 0x30f82934, + 0x38711e2b, 0x3e140f8c, 0x2f6b2afa, 0x37af1f8b, + 0x3de2104f, 0x2dce2cb2, 0x36e520e7, 0x3dae1111, + 0x2c212e5a, 0x3612223d, 0x3d7711d3, 0x2a652ff1, + 0x3536238e, 0x3d3e1294, 0x28993179, 0x345324da, + 0x3d021354, 0x26c032ee, 0x3367261f, 0x3cc51413, + 0x24da3453, 0x3274275f, 0x3c8414d1, 0x22e635a5, + 0x31792899, 0x3c42158f, 0x20e736e5, 0x307629cd, + 0x3bfd164c, 0x1edc3811, 0x2f6b2afa, 0x3bb61708, + 0x1cc6392a, 0x2e5a2c21, 0x3b6c17c3, 0x1aa63a2f, + 0x2d412d41, 0x3b20187d, 0x187d3b20, 0x2c212e5a, + 0x3ad21937, 0x164c3bfd, 0x2afa2f6b, 0x3a8219ef, + 0x14133cc5, 0x29cd3076, 0x3a2f1aa6, 0x11d33d77, + 0x28993179, 0x39da1b5d, 0x0f8c3e14, 0x275f3274, + 0x39831c12, 0x0d413e9c, 0x261f3367, 0x392a1cc6, + 0x0af13f0e, 0x24da3453, 0x38cf1d79, 0x089c3f6a, + 0x238e3536, 0x38711e2b, 0x06453fb1, 0x223d3612, + 0x38111edc, 0x03ec3fe1, 0x20e736e5, 0x37af1f8b, + 0x01923ffb, 0x1f8b37af, 0x374b2039, 0xff373ffe, + 0x1e2b3871, 0x36e520e7, 0xfcdd3fec, 0x1cc6392a, + 0x367c2192, 0xfa833fc3, 0x1b5d39da, 0x3612223d, + 0xf82b3f84, 0x19ef3a82, 0x35a522e6, 0xf5d63f2f, + 0x187d3b20, 0x3536238e, 0xf3843ec5, 0x17083bb6, + 0x34c62434, 0xf1373e44, 0x158f3c42, 0x345324da, + 0xeeef3dae, 0x14133cc5, 0x33de257d, 0xecac3d02, + 0x12943d3e, 0x3367261f, 0xea713c42, 0x11113dae, + 0x32ee26c0, 0xe83d3b6c, 0x0f8c3e14, 0x3274275f, + 0xe6113a82, 0x0e053e71, 0x31f727fd, 0xe3ee3983, + 0x0c7c3ec5, 0x31792899, 0xe1d53871, 0x0af13f0e, + 0x30f82934, 0xdfc7374b, 0x09643f4e, 0x307629cd, + 0xddc33612, 0x07d53f84, 0x2ff12a65, 0xdbcc34c6, + 0x06453fb1, 0x2f6b2afa, 0xd9e13367, 0x04b53fd3, + 0x2ee32b8e, 0xd80331f7, 0x03233fec, 0x2e5a2c21, + 0xd6333076, 0x01923ffb, 0x2dce2cb2, 0xd4722ee3, + 0x00004000, 0x2d412d41, 0xd2bf2d41, 0xfe6e3ffb, + 0x2cb22dce, 0xd11d2b8e, 0xfcdd3fec, 0x2c212e5a, + 0xcf8a29cd, 0xfb4b3fd3, 0x2b8e2ee3, 0xce0927fd, + 0xf9bb3fb1, 0x2afa2f6b, 0xcc99261f, 0xf82b3f84, + 0x2a652ff1, 0xcb3a2434, 0xf69c3f4e, 0x29cd3076, + 0xc9ee223d, 0xf50f3f0e, 0x293430f8, 0xc8b52039, + 0xf3843ec5, 0x28993179, 0xc78f1e2b, 0xf1fb3e71, + 0x27fd31f7, 0xc67d1c12, 0xf0743e14, 0x275f3274, + 0xc57e19ef, 0xeeef3dae, 0x26c032ee, 0xc49417c3, + 0xed6c3d3e, 0x261f3367, 0xc3be158f, 0xebed3cc5, + 0x257d33de, 0xc2fe1354, 0xea713c42, 0x24da3453, + 0xc2521111, 0xe8f83bb6, 0x243434c6, 0xc1bc0ec9, + 0xe7833b20, 0x238e3536, 0xc13b0c7c, 0xe6113a82, + 0x22e635a5, 0xc0d10a2a, 0xe4a339da, 0x223d3612, + 0xc07c07d5, 0xe33a392a, 0x2192367c, 0xc03d057d, + 0xe1d53871, 0x20e736e5, 0xc0140323, 0xe07537af, + 0x2039374b, 0xc00200c9, 0xdf1936e5, 0x1f8b37af, + 0xc005fe6e, 0xddc33612, 0x1edc3811, 0xc01ffc14, + 0xdc723536, 0x1e2b3871, 0xc04ff9bb, 0xdb263453, + 0x1d7938cf, 0xc096f764, 0xd9e13367, 0x1cc6392a, + 0xc0f2f50f, 0xd8a13274, 0x1c123983, 0xc164f2bf, + 0xd7673179, 0x1b5d39da, 0xc1ecf074, 0xd6333076, + 0x1aa63a2f, 0xc289ee2d, 0xd5062f6b, 0x19ef3a82, + 0xc33bebed, 0xd3df2e5a, 0x19373ad2, 0xc403e9b4, + 0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xd1a62c21, + 0x17c33b6c, 0xc5d1e55a, 0xd0952afa, 0x17083bb6, + 0xc6d6e33a, 0xcf8a29cd, 0x164c3bfd, 0xc7efe124, + 0xce872899, 0x158f3c42, 0xc91bdf19, 0xcd8c275f, + 0x14d13c84, 0xca5bdd1a, 0xcc99261f, 0x14133cc5, + 0xcbaddb26, 0xcbad24da, 0x13543d02, 0xcd12d940, + 0xcaca238e, 0x12943d3e, 0xce87d767, 0xc9ee223d, + 0x11d33d77, 0xd00fd59b, 0xc91b20e7, 0x11113dae, + 0xd1a6d3df, 0xc8511f8b, 0x104f3de2, 0xd34ed232, + 0xc78f1e2b, 0x0f8c3e14, 0xd506d095, 0xc6d61cc6, + 0x0ec93e44, 0xd6cccf08, 0xc6261b5d, 0x0e053e71, + 0xd8a1cd8c, 0xc57e19ef, 0x0d413e9c, 0xda83cc22, + 0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, 0xc44a1708, + 0x0bb63eeb, 0xde6ec984, 0xc3be158f, 0x0af13f0e, + 0xe075c851, 0xc33b1413, 0x0a2a3f2f, 0xe287c731, + 0xc2c21294, 0x09643f4e, 0xe4a3c626, 0xc2521111, + 0x089c3f6a, 0xe6c9c52e, 0xc1ec0f8c, 0x07d53f84, + 0xe8f8c44a, 0xc18f0e05, 0x070d3f9c, 0xeb2fc37c, + 0xc13b0c7c, 0x06453fb1, 0xed6cc2c2, 0xc0f20af1, + 0x057d3fc3, 0xefb1c21e, 0xc0b20964, 0x04b53fd3, + 0xf1fbc18f, 0xc07c07d5, 0x03ec3fe1, 0xf44ac115, + 0xc04f0645, 0x03233fec, 0xf69cc0b2, 0xc02d04b5, + 0x025b3ff4, 0xf8f3c064, 0xc0140323, 0x01923ffb, + 0xfb4bc02d, 0xc0050192, 0x00c93ffe, 0xfda5c00c +}; + +const int twidTab64[(4*6 + 16*6)/2] = { + 0x40000000, 0x40000000, 0x40000000, 0x2d412d41, + 0x3b20187d, 0x187d3b20, 0x00004000, 0x2d412d41, + 0xd2bf2d41, 0xd2bf2d41, 0x187d3b20, 0xc4e0e783, + + 0x40000000, 0x40000000, 0x40000000, 0x3ec50c7c, + 0x3fb10645, 0x3d3e1294, 0x3b20187d, 0x3ec50c7c, + 0x3536238e, 0x3536238e, 0x3d3e1294, 0x28993179, + 0x2d412d41, 0x3b20187d, 0x187d3b20, 0x238e3536, + 0x38711e2b, 0x06453fb1, 0x187d3b20, 0x3536238e, + 0xf3843ec5, 0x0c7c3ec5, 0x31792899, 0xe1d53871, + 0x00004000, 0x2d412d41, 0xd2bf2d41, 0xf3843ec5, + 0x28993179, 0xc78f1e2b, 0xe7833b20, 0x238e3536, + 0xc13b0c7c, 0xdc723536, 0x1e2b3871, 0xc04ff9bb, + 0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xcaca238e, + 0x12943d3e, 0xce87d767, 0xc4e0187d, 0x0c7c3ec5, + 0xdc72caca, 0xc13b0c7c, 0x06453fb1, 0xed6cc2c2 +}; + +#elif defined ARMV7Neon +/* + * Q29 for 128 and 1024 + * + * for (i = 0; i < num/4; i++) { + * angle = (i + 0.125) * M_PI / num; + * x = cos(angle) * (1 << 29); + * x = sin(angle) * (1 << 29); + * + * angle = (num/2 - 1 - i + 0.125) * M_PI / num; + * x = cos(angle) * (1 << 29); + * x = sin(angle) * (1 << 29); + * } + */ +const int cossintab[128 + 1024] = { + /* 128 */ 0x1ffff621, 0x001921f9, 0x00afea69, 0x1ffe1c68, 0x1ffce09d, 0x00e22a7a, 0x0178dbaa, 0x1ff753bb, 0x1ff4dc55, 0x01ab101c, 0x024192cf, 0x1feb9d25, 0x1fe7ea85, 0x0273b3e2, 0x0309f0e2, 0x1fdafa75, 0x1fd60d2e, 0x033bf6dd, 0x03d1d700, 0x1fc56e3b, 0x1fbf470f, 0x0403ba2b, 0x04992653, 0x1faafbcb, @@ -368,139 +368,139 @@ const int cossintab[128 + 1024] = { 0x1a8d676e, 0x11dc1b65, 0x1258734d, 0x1a38184a, 0x1a1b26d3, 0x12818bef, 0x12fbc24b, 0x19c2d111, 0x19a4dfa4, 0x132421ec, 0x139c23e4, 0x194990e4, 0x192aa420, 0x13c3c44a, 0x14397f5b, 0x18cc6a75, 0x18ac871f, 0x14605a69, 0x14d3bc6d, 0x184b7112, 0x182a9c14, 0x14f9cc26, 0x156ac352, 0x17c6b89d, - 0x17a4f708, 0x159001d6, 0x15fe7cbe, 0x173e558e, 0x171bac96, 0x1622e450, 0x168ed1eb, 0x16b25ced,
- /* 1024 */
- 0x1fffffd9, 0x0003243f, 0x0015fdba, 0x1ffff872, 0x1ffff382, 0x001c4637, 0x002f1fa6, 0x1fffdd4d,
- 0x1fffd36f, 0x0035681d, 0x00484175, 0x1fffae6c, 0x1fff9f9e, 0x004e89e3, 0x00616318, 0x1fff6bce,
- 0x1fff5811, 0x0067ab77, 0x007a847e, 0x1fff1572, 0x1ffefcc6, 0x0080cccc, 0x0093a599, 0x1ffeab5b,
- 0x1ffe8dbf, 0x0099edd2, 0x00acc658, 0x1ffe2d86, 0x1ffe0afc, 0x00b30e78, 0x00c5e6ad, 0x1ffd9bf6,
- 0x1ffd747c, 0x00cc2eb0, 0x00df0688, 0x1ffcf6aa, 0x1ffcca41, 0x00e54e6a, 0x00f825da, 0x1ffc3da2,
- 0x1ffc0c4b, 0x00fe6d97, 0x01114492, 0x1ffb70e0, 0x1ffb3a9a, 0x01178c27, 0x012a62a2, 0x1ffa9063,
- 0x1ffa552e, 0x0130aa0a, 0x01437ffa, 0x1ff99c2c, 0x1ff95c09, 0x0149c731, 0x015c9c8a, 0x1ff8943c,
- 0x1ff84f2b, 0x0162e38d, 0x0175b843, 0x1ff77893, 0x1ff72e94, 0x017bff0e, 0x018ed316, 0x1ff64932,
- 0x1ff5fa46, 0x019519a5, 0x01a7ecf2, 0x1ff5061b, 0x1ff4b240, 0x01ae3341, 0x01c105c9, 0x1ff3af4c,
- 0x1ff35684, 0x01c74bd5, 0x01da1d8c, 0x1ff244c8, 0x1ff1e713, 0x01e0634f, 0x01f33429, 0x1ff0c68f,
- 0x1ff063ed, 0x01f979a1, 0x020c4993, 0x1fef34a3, 0x1feecd14, 0x02128ebb, 0x02255db9, 0x1fed8f03,
- 0x1fed2287, 0x022ba28f, 0x023e708d, 0x1febd5b2, 0x1feb644a, 0x0244b50b, 0x025781fe, 0x1fea08b0,
- 0x1fe9925c, 0x025dc621, 0x027091fd, 0x1fe827fe, 0x1fe7acbe, 0x0276d5c1, 0x0289a07b, 0x1fe6339d,
- 0x1fe5b372, 0x028fe3dd, 0x02a2ad69, 0x1fe42b90, 0x1fe3a679, 0x02a8f063, 0x02bbb8b6, 0x1fe20fd6,
- 0x1fe185d5, 0x02c1fb46, 0x02d4c253, 0x1fdfe071, 0x1fdf5186, 0x02db0475, 0x02edca32, 0x1fdd9d64,
- 0x1fdd098e, 0x02f40be2, 0x0306d042, 0x1fdb46ae, 0x1fdaadee, 0x030d117c, 0x031fd474, 0x1fd8dc51,
- 0x1fd83ea8, 0x03261534, 0x0338d6b8, 0x1fd65e4f, 0x1fd5bbbd, 0x033f16fb, 0x0351d700, 0x1fd3ccaa,
- 0x1fd32530, 0x035816c1, 0x036ad53c, 0x1fd12763, 0x1fd07b00, 0x03711477, 0x0383d15c, 0x1fce6e7c,
- 0x1fcdbd31, 0x038a100e, 0x039ccb51, 0x1fcba1f5, 0x1fcaebc3, 0x03a30975, 0x03b5c30b, 0x1fc8c1d2,
- 0x1fc806b9, 0x03bc009f, 0x03ceb87c, 0x1fc5ce14, 0x1fc50e14, 0x03d4f57a, 0x03e7ab93, 0x1fc2c6bd,
- 0x1fc201d7, 0x03ede7f9, 0x04009c42, 0x1fbfabcd, 0x1fbee202, 0x0406d80b, 0x04198a78, 0x1fbc7d49,
- 0x1fbbae99, 0x041fc5a1, 0x04327628, 0x1fb93b31, 0x1fb8679c, 0x0438b0ac, 0x044b5f40, 0x1fb5e587,
- 0x1fb50d0e, 0x0451991d, 0x046445b2, 0x1fb27c4e, 0x1fb19ef1, 0x046a7ee3, 0x047d296f, 0x1faeff87,
- 0x1fae1d47, 0x048361f0, 0x04960a67, 0x1fab6f35, 0x1faa8813, 0x049c4235, 0x04aee88b, 0x1fa7cb5a,
- 0x1fa6df56, 0x04b51fa1, 0x04c7c3cb, 0x1fa413f8, 0x1fa32313, 0x04cdfa26, 0x04e09c18, 0x1fa04912,
- 0x1f9f534c, 0x04e6d1b4, 0x04f97163, 0x1f9c6aa9, 0x1f9b7003, 0x04ffa63c, 0x0512439d, 0x1f9878c1,
- 0x1f97793b, 0x051877af, 0x052b12b6, 0x1f94735b, 0x1f936ef6, 0x053145fd, 0x0543de9e, 0x1f905a7a,
- 0x1f8f5137, 0x054a1117, 0x055ca748, 0x1f8c2e21, 0x1f8b2000, 0x0562d8ee, 0x05756ca2, 0x1f87ee52,
- 0x1f86db55, 0x057b9d73, 0x058e2e9f, 0x1f839b10, 0x1f828336, 0x05945e95, 0x05a6ed2e, 0x1f7f345e,
- 0x1f7e17a8, 0x05ad1c47, 0x05bfa840, 0x1f7aba3e, 0x1f7998ad, 0x05c5d678, 0x05d85fc7, 0x1f762cb2,
- 0x1f750647, 0x05de8d19, 0x05f113b3, 0x1f718bbf, 0x1f70607a, 0x05f7401c, 0x0609c3f5, 0x1f6cd766,
- 0x1f6ba748, 0x060fef71, 0x0622707d, 0x1f680fab, 0x1f66dab5, 0x06289b08, 0x063b193c, 0x1f633490,
- 0x1f61fac3, 0x064142d3, 0x0653be23, 0x1f5e4619, 0x1f5d0775, 0x0659e6c2, 0x066c5f24, 0x1f594448,
- 0x1f5800ce, 0x067286c6, 0x0684fc2e, 0x1f542f21, 0x1f52e6d2, 0x068b22d0, 0x069d9532, 0x1f4f06a6,
- 0x1f4db983, 0x06a3bad0, 0x06b62a22, 0x1f49cadc, 0x1f4878e5, 0x06bc4eb9, 0x06cebaee, 0x1f447bc4,
- 0x1f4324fb, 0x06d4de79, 0x06e74786, 0x1f3f1963, 0x1f3dbdc8, 0x06ed6a03, 0x06ffcfdd, 0x1f39a3bc,
- 0x1f384350, 0x0705f147, 0x071853e3, 0x1f341ad2, 0x1f32b595, 0x071e7436, 0x0730d388, 0x1f2e7ea9,
- 0x1f2d149d, 0x0736f2c0, 0x07494ebd, 0x1f28cf43, 0x1f276069, 0x074f6cd7, 0x0761c574, 0x1f230ca5,
- 0x1f2198fd, 0x0767e26c, 0x077a379d, 0x1f1d36d2, 0x1f1bbe5d, 0x07805370, 0x0792a52a, 0x1f174dce,
- 0x1f15d08d, 0x0798bfd3, 0x07ab0e0a, 0x1f11519c, 0x1f0fcf91, 0x07b12786, 0x07c37230, 0x1f0b4240,
- 0x1f09bb6b, 0x07c98a7a, 0x07dbd18c, 0x1f051fbe, 0x1f03941f, 0x07e1e8a1, 0x07f42c0e, 0x1efeea19,
- 0x1efd59b3, 0x07fa41eb, 0x080c81a9, 0x1ef8a155, 0x1ef70c28, 0x0812964a, 0x0824d24d, 0x1ef24577,
- 0x1ef0ab84, 0x082ae5ad, 0x083d1dea, 0x1eebd682, 0x1eea37ca, 0x08433007, 0x08556473, 0x1ee5547a,
- 0x1ee3b0fe, 0x085b7548, 0x086da5d8, 0x1edebf64, 0x1edd1724, 0x0873b562, 0x0885e209, 0x1ed81742,
- 0x1ed66a41, 0x088bf044, 0x089e18f9, 0x1ed15c1a, 0x1ecfaa57, 0x08a425e1, 0x08b64a98, 0x1eca8def,
- 0x1ec8d76c, 0x08bc562a, 0x08ce76d8, 0x1ec3acc6, 0x1ec1f184, 0x08d4810f, 0x08e69da8, 0x1ebcb8a3,
- 0x1ebaf8a3, 0x08eca681, 0x08febefb, 0x1eb5b18a, 0x1eb3eccd, 0x0904c673, 0x0916dac2, 0x1eae977f,
- 0x1eacce07, 0x091ce0d4, 0x092ef0ed, 0x1ea76a87, 0x1ea59c55, 0x0934f596, 0x0947016e, 0x1ea02aa7,
- 0x1e9e57bb, 0x094d04aa, 0x095f0c36, 0x1e98d7e2, 0x1e97003e, 0x09650e01, 0x09771136, 0x1e91723e,
- 0x1e8f95e3, 0x097d118d, 0x098f1060, 0x1e89f9bf, 0x1e8818ad, 0x09950f3f, 0x09a709a4, 0x1e826e69,
- 0x1e8088a2, 0x09ad0707, 0x09befcf4, 0x1e7ad041, 0x1e78e5c7, 0x09c4f8d8, 0x09d6ea40, 0x1e731f4c,
- 0x1e71301f, 0x09dce4a1, 0x09eed17b, 0x1e6b5b8f, 0x1e6967b1, 0x09f4ca56, 0x0a06b296, 0x1e63850e,
- 0x1e618c80, 0x0a0ca9e6, 0x0a1e8d81, 0x1e5b9bce, 0x1e599e91, 0x0a248343, 0x0a36622e, 0x1e539fd4,
- 0x1e519dea, 0x0a3c565e, 0x0a4e308f, 0x1e4b9126, 0x1e498a8e, 0x0a542329, 0x0a65f894, 0x1e436fc7,
- 0x1e416485, 0x0a6be995, 0x0a7dba2f, 0x1e3b3bbd, 0x1e392bd1, 0x0a83a993, 0x0a957551, 0x1e32f50e,
- 0x1e30e079, 0x0a9b6315, 0x0aad29ec, 0x1e2a9bbd, 0x1e288281, 0x0ab3160c, 0x0ac4d7f1, 0x1e222fd1,
- 0x1e2011ee, 0x0acac26a, 0x0adc7f52, 0x1e19b14f, 0x1e178ec7, 0x0ae2681f, 0x0af41fff, 0x1e11203b,
- 0x1e0ef910, 0x0afa071d, 0x0b0bb9eb, 0x1e087c9b, 0x1e0650ce, 0x0b119f56, 0x0b234d07, 0x1dffc674,
- 0x1dfd9606, 0x0b2930bb, 0x0b3ad943, 0x1df6fdcc, 0x1df4c8bf, 0x0b40bb3e, 0x0b525e92, 0x1dee22a9,
- 0x1debe8fd, 0x0b583ecf, 0x0b69dce6, 0x1de5350f, 0x1de2f6c6, 0x0b6fbb62, 0x0b81542f, 0x1ddc3504,
- 0x1dd9f220, 0x0b8730e6, 0x0b98c45f, 0x1dd3228e, 0x1dd0db10, 0x0b9e9f4d, 0x0bb02d68, 0x1dc9fdb2,
- 0x1dc7b19b, 0x0bb6068a, 0x0bc78f3b, 0x1dc0c676, 0x1dbe75c8, 0x0bcd668e, 0x0bdee9ca, 0x1db77cdf,
- 0x1db5279c, 0x0be4bf4a, 0x0bf63d07, 0x1dae20f4, 0x1dabc71d, 0x0bfc10af, 0x0c0d88e2, 0x1da4b2ba,
- 0x1da25450, 0x0c135ab0, 0x0c24cd4e, 0x1d9b3237, 0x1d98cf3b, 0x0c2a9d3e, 0x0c3c0a3d, 0x1d919f70,
- 0x1d8f37e5, 0x0c41d84b, 0x0c533fa0, 0x1d87fa6d, 0x1d858e53, 0x0c590bc9, 0x0c6a6d68, 0x1d7e4332,
- 0x1d7bd28b, 0x0c7037a8, 0x0c819388, 0x1d7479c5, 0x1d720493, 0x0c875bdb, 0x0c98b1f0, 0x1d6a9e2e,
- 0x1d682472, 0x0c9e7854, 0x0cafc894, 0x1d60b070, 0x1d5e322c, 0x0cb58d04, 0x0cc6d764, 0x1d56b094,
- 0x1d542dc9, 0x0ccc99de, 0x0cddde53, 0x1d4c9e9f, 0x1d4a174f, 0x0ce39ed2, 0x0cf4dd52, 0x1d427a97,
- 0x1d3feec3, 0x0cfa9bd2, 0x0d0bd452, 0x1d384483, 0x1d35b42d, 0x0d1190d1, 0x0d22c347, 0x1d2dfc68,
- 0x1d2b6791, 0x0d287dc1, 0x0d39aa21, 0x1d23a24e, 0x1d2108f8, 0x0d3f6292, 0x0d5088d3, 0x1d19363a,
- 0x1d169867, 0x0d563f38, 0x0d675f4e, 0x1d0eb833, 0x1d0c15e4, 0x0d6d13a3, 0x0d7e2d85, 0x1d04283f,
- 0x1d018176, 0x0d83dfc6, 0x0d94f369, 0x1cf98666, 0x1cf6db24, 0x0d9aa393, 0x0dabb0ec, 0x1ceed2ad,
- 0x1cec22f4, 0x0db15efc, 0x0dc26600, 0x1ce40d1b, 0x1ce158ed, 0x0dc811f3, 0x0dd91298, 0x1cd935b7,
- 0x1cd67d15, 0x0ddebc69, 0x0defb6a5, 0x1cce4c87, 0x1ccb8f74, 0x0df55e51, 0x0e065219, 0x1cc35192,
- 0x1cc0900f, 0x0e0bf79c, 0x0e1ce4e6, 0x1cb844df, 0x1cb57eee, 0x0e22883e, 0x0e336eff, 0x1cad2675,
- 0x1caa5c17, 0x0e391027, 0x0e49f055, 0x1ca1f65b, 0x1c9f2792, 0x0e4f8f4b, 0x0e6068db, 0x1c96b497,
- 0x1c93e165, 0x0e66059a, 0x0e76d883, 0x1c8b6131, 0x1c888997, 0x0e7c7308, 0x0e8d3f3e, 0x1c7ffc2f,
- 0x1c7d202f, 0x0e92d787, 0x0ea39d00, 0x1c748599, 0x1c71a535, 0x0ea93308, 0x0eb9f1ba, 0x1c68fd75,
- 0x1c6618ae, 0x0ebf857d, 0x0ed03d5e, 0x1c5d63ca, 0x1c5a7aa4, 0x0ed5ceda, 0x0ee67fdf, 0x1c51b8a1,
- 0x1c4ecb1c, 0x0eec0f10, 0x0efcb92f, 0x1c45fc00, 0x1c430a1d, 0x0f024612, 0x0f12e941, 0x1c3a2ded,
- 0x1c3737b0, 0x0f1873d2, 0x0f291006, 0x1c2e4e72, 0x1c2b53db, 0x0f2e9842, 0x0f3f2d71, 0x1c225d94,
- 0x1c1f5ea6, 0x0f44b354, 0x0f554175, 0x1c165b5b, 0x1c135818, 0x0f5ac4fc, 0x0f6b4c03, 0x1c0a47cf,
- 0x1c074038, 0x0f70cd2a, 0x0f814d0e, 0x1bfe22f8, 0x1bfb170f, 0x0f86cbd3, 0x0f974489, 0x1bf1ecdb,
- 0x1beedca2, 0x0f9cc0e7, 0x0fad3265, 0x1be5a582, 0x1be290fb, 0x0fb2ac5a, 0x0fc31697, 0x1bd94cf4,
- 0x1bd63421, 0x0fc88e1e, 0x0fd8f10f, 0x1bcce337, 0x1bc9c61a, 0x0fde6626, 0x0feec1c0, 0x1bc06855,
- 0x1bbd46f0, 0x0ff43464, 0x1004889e, 0x1bb3dc55, 0x1bb0b6a9, 0x1009f8cb, 0x101a459a, 0x1ba73f3d,
- 0x1ba4154d, 0x101fb34d, 0x102ff8a8, 0x1b9a9117, 0x1b9762e4, 0x103563dc, 0x1045a1b9, 0x1b8dd1ea,
- 0x1b8a9f77, 0x104b0a6c, 0x105b40c1, 0x1b8101be, 0x1b7dcb0c, 0x1060a6ef, 0x1070d5b1, 0x1b74209b,
- 0x1b70e5ac, 0x10763958, 0x1086607e, 0x1b672e88, 0x1b63ef5f, 0x108bc19a, 0x109be119, 0x1b5a2b8e,
- 0x1b56e82c, 0x10a13fa6, 0x10b15775, 0x1b4d17b4, 0x1b49d01c, 0x10b6b371, 0x10c6c385, 0x1b3ff304,
- 0x1b3ca737, 0x10cc1cec, 0x10dc253c, 0x1b32bd84, 0x1b2f6d85, 0x10e17c0b, 0x10f17c8d, 0x1b25773d,
- 0x1b22230e, 0x10f6d0c0, 0x1106c96a, 0x1b182038, 0x1b14c7da, 0x110c1afe, 0x111c0bc6, 0x1b0ab87c,
- 0x1b075bf1, 0x11215ab8, 0x11314395, 0x1afd4012, 0x1af9df5d, 0x11368fe1, 0x114670c8, 0x1aefb702,
- 0x1aec5225, 0x114bba6b, 0x115b9354, 0x1ae21d54, 0x1adeb451, 0x1160da4b, 0x1170ab2a, 0x1ad47311,
- 0x1ad105e9, 0x1175ef72, 0x1185b83f, 0x1ac6b841, 0x1ac346f8, 0x118af9d4, 0x119aba84, 0x1ab8ecec,
- 0x1ab57784, 0x119ff964, 0x11afb1ee, 0x1aab111c, 0x1aa79796, 0x11b4ee14, 0x11c49e6f, 0x1a9d24d9,
- 0x1a99a737, 0x11c9d7d9, 0x11d97ff9, 0x1a8f282b, 0x1a8ba670, 0x11deb6a4, 0x11ee5682, 0x1a811b1b,
- 0x1a7d9549, 0x11f38a6a, 0x120321fa, 0x1a72fdb2, 0x1a6f73ca, 0x1208531c, 0x1217e256, 0x1a64cff8,
- 0x1a6141fd, 0x121d10af, 0x122c9789, 0x1a5691f5, 0x1a52ffeb, 0x1231c316, 0x12414186, 0x1a4843b4,
- 0x1a44ad9b, 0x12466a44, 0x1255e041, 0x1a39e53d, 0x1a364b17, 0x125b062b, 0x126a73ac, 0x1a2b7698,
- 0x1a27d868, 0x126f96c1, 0x127efbbb, 0x1a1cf7ce, 0x1a195597, 0x12841bf6, 0x12937861, 0x1a0e68e9,
- 0x1a0ac2ac, 0x129895c0, 0x12a7e991, 0x19ffc9f1, 0x19fc1fb1, 0x12ad0412, 0x12bc4f40, 0x19f11af0,
- 0x19ed6caf, 0x12c166de, 0x12d0a960, 0x19e25bee, 0x19dea9ae, 0x12d5be18, 0x12e4f7e5, 0x19d38cf4,
- 0x19cfd6b8, 0x12ea09b4, 0x12f93ac2, 0x19c4ae0c, 0x19c0f3d6, 0x12fe49a6, 0x130d71eb, 0x19b5bf3f,
- 0x19b20111, 0x13127de0, 0x13219d53, 0x19a6c096, 0x19a2fe73, 0x1326a656, 0x1335bcef, 0x1997b21b,
- 0x1993ec04, 0x133ac2fc, 0x1349d0b0, 0x198893d6, 0x1984c9ce, 0x134ed3c5, 0x135dd88c, 0x197965d0,
- 0x197597da, 0x1362d8a6, 0x1371d476, 0x196a2815, 0x19665632, 0x1376d191, 0x1385c461, 0x195adaab,
- 0x195704df, 0x138abe7b, 0x1399a841, 0x194b7d9e, 0x1947a3eb, 0x139e9f56, 0x13ad800a, 0x193c10f7,
- 0x1938335e, 0x13b27417, 0x13c14bb0, 0x192c94bf, 0x1928b343, 0x13c63cb2, 0x13d50b26, 0x191d08ff,
- 0x191923a3, 0x13d9f91b, 0x13e8be60, 0x190d6dc1, 0x19098488, 0x13eda944, 0x13fc6553, 0x18fdc310,
- 0x18f9d5fa, 0x14014d23, 0x140ffff1, 0x18ee08f4, 0x18ea1805, 0x1414e4aa, 0x14238e2f, 0x18de3f77,
- 0x18da4ab2, 0x14286fce, 0x14371001, 0x18ce66a3, 0x18ca6e0a, 0x143bee83, 0x144a855b, 0x18be7e82,
- 0x18ba8217, 0x144f60bd, 0x145dee30, 0x18ae871e, 0x18aa86e3, 0x1462c670, 0x14714a76, 0x189e8080,
- 0x189a7c78, 0x14761f8f, 0x14849a1f, 0x188e6ab2, 0x188a62e0, 0x14896c0f, 0x1497dd20, 0x187e45be,
- 0x187a3a25, 0x149cabe4, 0x14ab136d, 0x186e11af, 0x186a0250, 0x14afdf03, 0x14be3cfa, 0x185dce8e,
- 0x1859bb6c, 0x14c3055e, 0x14d159bc, 0x184d7c65, 0x18496583, 0x14d61eeb, 0x14e469a6, 0x183d1b3e,
- 0x1839009e, 0x14e92b9e, 0x14f76cad, 0x182cab24, 0x18288cc8, 0x14fc2b6a, 0x150a62c6, 0x181c2c20,
- 0x18180a0c, 0x150f1e45, 0x151d4be3, 0x180b9e3d, 0x18077873, 0x15220422, 0x153027fb, 0x17fb0185,
- 0x17f6d807, 0x1534dcf6, 0x1542f700, 0x17ea5602, 0x17e628d3, 0x1547a8b5, 0x1555b8e8, 0x17d99bbe,
- 0x17d56ae0, 0x155a6754, 0x15686da7, 0x17c8d2c4, 0x17c49e3b, 0x156d18c7, 0x157b1532, 0x17b7fb1f,
- 0x17b3c2ec, 0x157fbd03, 0x158daf7c, 0x17a714d7, 0x17a2d8fe, 0x159253fb, 0x15a03c7a, 0x17961ff9,
- 0x1791e07b, 0x15a4dda5, 0x15b2bc22, 0x17851c8e, 0x1780d96f, 0x15b759f5, 0x15c52e67, 0x17740aa1,
- 0x176fc3e3, 0x15c9c8e0, 0x15d7933f, 0x1762ea3d, 0x175e9fe2, 0x15dc2a5a, 0x15e9ea9d, 0x1751bb6b,
- 0x174d6d77, 0x15ee7e58, 0x15fc3477, 0x17407e37, 0x173c2cac, 0x1600c4cf, 0x160e70c1, 0x172f32ab,
- 0x172add8c, 0x1612fdb3, 0x16209f70, 0x171dd8d2, 0x17198021, 0x162528fa, 0x1632c078, 0x170c70b7,
- 0x17081477, 0x16374697, 0x1644d3d0, 0x16fafa64, 0x16f69a97, 0x16495680, 0x1656d96a, 0x16e975e4,
- 0x16e5128e, 0x165b58aa, 0x1668d13e, 0x16d7e341, 0x16d37c65, 0x166d4d0a, 0x167abb3e, 0x16c64288,
- 0x16c1d827, 0x167f3394, 0x168c9760, 0x16b493c2, 0x16b025e0, 0x16910c3d, 0x169e659a, 0x16a2d6fb
-};
-
-const int twidTab512[8*6 + 32*6 + 128*6] = {
+ 0x17a4f708, 0x159001d6, 0x15fe7cbe, 0x173e558e, 0x171bac96, 0x1622e450, 0x168ed1eb, 0x16b25ced, + /* 1024 */ + 0x1fffffd9, 0x0003243f, 0x0015fdba, 0x1ffff872, 0x1ffff382, 0x001c4637, 0x002f1fa6, 0x1fffdd4d, + 0x1fffd36f, 0x0035681d, 0x00484175, 0x1fffae6c, 0x1fff9f9e, 0x004e89e3, 0x00616318, 0x1fff6bce, + 0x1fff5811, 0x0067ab77, 0x007a847e, 0x1fff1572, 0x1ffefcc6, 0x0080cccc, 0x0093a599, 0x1ffeab5b, + 0x1ffe8dbf, 0x0099edd2, 0x00acc658, 0x1ffe2d86, 0x1ffe0afc, 0x00b30e78, 0x00c5e6ad, 0x1ffd9bf6, + 0x1ffd747c, 0x00cc2eb0, 0x00df0688, 0x1ffcf6aa, 0x1ffcca41, 0x00e54e6a, 0x00f825da, 0x1ffc3da2, + 0x1ffc0c4b, 0x00fe6d97, 0x01114492, 0x1ffb70e0, 0x1ffb3a9a, 0x01178c27, 0x012a62a2, 0x1ffa9063, + 0x1ffa552e, 0x0130aa0a, 0x01437ffa, 0x1ff99c2c, 0x1ff95c09, 0x0149c731, 0x015c9c8a, 0x1ff8943c, + 0x1ff84f2b, 0x0162e38d, 0x0175b843, 0x1ff77893, 0x1ff72e94, 0x017bff0e, 0x018ed316, 0x1ff64932, + 0x1ff5fa46, 0x019519a5, 0x01a7ecf2, 0x1ff5061b, 0x1ff4b240, 0x01ae3341, 0x01c105c9, 0x1ff3af4c, + 0x1ff35684, 0x01c74bd5, 0x01da1d8c, 0x1ff244c8, 0x1ff1e713, 0x01e0634f, 0x01f33429, 0x1ff0c68f, + 0x1ff063ed, 0x01f979a1, 0x020c4993, 0x1fef34a3, 0x1feecd14, 0x02128ebb, 0x02255db9, 0x1fed8f03, + 0x1fed2287, 0x022ba28f, 0x023e708d, 0x1febd5b2, 0x1feb644a, 0x0244b50b, 0x025781fe, 0x1fea08b0, + 0x1fe9925c, 0x025dc621, 0x027091fd, 0x1fe827fe, 0x1fe7acbe, 0x0276d5c1, 0x0289a07b, 0x1fe6339d, + 0x1fe5b372, 0x028fe3dd, 0x02a2ad69, 0x1fe42b90, 0x1fe3a679, 0x02a8f063, 0x02bbb8b6, 0x1fe20fd6, + 0x1fe185d5, 0x02c1fb46, 0x02d4c253, 0x1fdfe071, 0x1fdf5186, 0x02db0475, 0x02edca32, 0x1fdd9d64, + 0x1fdd098e, 0x02f40be2, 0x0306d042, 0x1fdb46ae, 0x1fdaadee, 0x030d117c, 0x031fd474, 0x1fd8dc51, + 0x1fd83ea8, 0x03261534, 0x0338d6b8, 0x1fd65e4f, 0x1fd5bbbd, 0x033f16fb, 0x0351d700, 0x1fd3ccaa, + 0x1fd32530, 0x035816c1, 0x036ad53c, 0x1fd12763, 0x1fd07b00, 0x03711477, 0x0383d15c, 0x1fce6e7c, + 0x1fcdbd31, 0x038a100e, 0x039ccb51, 0x1fcba1f5, 0x1fcaebc3, 0x03a30975, 0x03b5c30b, 0x1fc8c1d2, + 0x1fc806b9, 0x03bc009f, 0x03ceb87c, 0x1fc5ce14, 0x1fc50e14, 0x03d4f57a, 0x03e7ab93, 0x1fc2c6bd, + 0x1fc201d7, 0x03ede7f9, 0x04009c42, 0x1fbfabcd, 0x1fbee202, 0x0406d80b, 0x04198a78, 0x1fbc7d49, + 0x1fbbae99, 0x041fc5a1, 0x04327628, 0x1fb93b31, 0x1fb8679c, 0x0438b0ac, 0x044b5f40, 0x1fb5e587, + 0x1fb50d0e, 0x0451991d, 0x046445b2, 0x1fb27c4e, 0x1fb19ef1, 0x046a7ee3, 0x047d296f, 0x1faeff87, + 0x1fae1d47, 0x048361f0, 0x04960a67, 0x1fab6f35, 0x1faa8813, 0x049c4235, 0x04aee88b, 0x1fa7cb5a, + 0x1fa6df56, 0x04b51fa1, 0x04c7c3cb, 0x1fa413f8, 0x1fa32313, 0x04cdfa26, 0x04e09c18, 0x1fa04912, + 0x1f9f534c, 0x04e6d1b4, 0x04f97163, 0x1f9c6aa9, 0x1f9b7003, 0x04ffa63c, 0x0512439d, 0x1f9878c1, + 0x1f97793b, 0x051877af, 0x052b12b6, 0x1f94735b, 0x1f936ef6, 0x053145fd, 0x0543de9e, 0x1f905a7a, + 0x1f8f5137, 0x054a1117, 0x055ca748, 0x1f8c2e21, 0x1f8b2000, 0x0562d8ee, 0x05756ca2, 0x1f87ee52, + 0x1f86db55, 0x057b9d73, 0x058e2e9f, 0x1f839b10, 0x1f828336, 0x05945e95, 0x05a6ed2e, 0x1f7f345e, + 0x1f7e17a8, 0x05ad1c47, 0x05bfa840, 0x1f7aba3e, 0x1f7998ad, 0x05c5d678, 0x05d85fc7, 0x1f762cb2, + 0x1f750647, 0x05de8d19, 0x05f113b3, 0x1f718bbf, 0x1f70607a, 0x05f7401c, 0x0609c3f5, 0x1f6cd766, + 0x1f6ba748, 0x060fef71, 0x0622707d, 0x1f680fab, 0x1f66dab5, 0x06289b08, 0x063b193c, 0x1f633490, + 0x1f61fac3, 0x064142d3, 0x0653be23, 0x1f5e4619, 0x1f5d0775, 0x0659e6c2, 0x066c5f24, 0x1f594448, + 0x1f5800ce, 0x067286c6, 0x0684fc2e, 0x1f542f21, 0x1f52e6d2, 0x068b22d0, 0x069d9532, 0x1f4f06a6, + 0x1f4db983, 0x06a3bad0, 0x06b62a22, 0x1f49cadc, 0x1f4878e5, 0x06bc4eb9, 0x06cebaee, 0x1f447bc4, + 0x1f4324fb, 0x06d4de79, 0x06e74786, 0x1f3f1963, 0x1f3dbdc8, 0x06ed6a03, 0x06ffcfdd, 0x1f39a3bc, + 0x1f384350, 0x0705f147, 0x071853e3, 0x1f341ad2, 0x1f32b595, 0x071e7436, 0x0730d388, 0x1f2e7ea9, + 0x1f2d149d, 0x0736f2c0, 0x07494ebd, 0x1f28cf43, 0x1f276069, 0x074f6cd7, 0x0761c574, 0x1f230ca5, + 0x1f2198fd, 0x0767e26c, 0x077a379d, 0x1f1d36d2, 0x1f1bbe5d, 0x07805370, 0x0792a52a, 0x1f174dce, + 0x1f15d08d, 0x0798bfd3, 0x07ab0e0a, 0x1f11519c, 0x1f0fcf91, 0x07b12786, 0x07c37230, 0x1f0b4240, + 0x1f09bb6b, 0x07c98a7a, 0x07dbd18c, 0x1f051fbe, 0x1f03941f, 0x07e1e8a1, 0x07f42c0e, 0x1efeea19, + 0x1efd59b3, 0x07fa41eb, 0x080c81a9, 0x1ef8a155, 0x1ef70c28, 0x0812964a, 0x0824d24d, 0x1ef24577, + 0x1ef0ab84, 0x082ae5ad, 0x083d1dea, 0x1eebd682, 0x1eea37ca, 0x08433007, 0x08556473, 0x1ee5547a, + 0x1ee3b0fe, 0x085b7548, 0x086da5d8, 0x1edebf64, 0x1edd1724, 0x0873b562, 0x0885e209, 0x1ed81742, + 0x1ed66a41, 0x088bf044, 0x089e18f9, 0x1ed15c1a, 0x1ecfaa57, 0x08a425e1, 0x08b64a98, 0x1eca8def, + 0x1ec8d76c, 0x08bc562a, 0x08ce76d8, 0x1ec3acc6, 0x1ec1f184, 0x08d4810f, 0x08e69da8, 0x1ebcb8a3, + 0x1ebaf8a3, 0x08eca681, 0x08febefb, 0x1eb5b18a, 0x1eb3eccd, 0x0904c673, 0x0916dac2, 0x1eae977f, + 0x1eacce07, 0x091ce0d4, 0x092ef0ed, 0x1ea76a87, 0x1ea59c55, 0x0934f596, 0x0947016e, 0x1ea02aa7, + 0x1e9e57bb, 0x094d04aa, 0x095f0c36, 0x1e98d7e2, 0x1e97003e, 0x09650e01, 0x09771136, 0x1e91723e, + 0x1e8f95e3, 0x097d118d, 0x098f1060, 0x1e89f9bf, 0x1e8818ad, 0x09950f3f, 0x09a709a4, 0x1e826e69, + 0x1e8088a2, 0x09ad0707, 0x09befcf4, 0x1e7ad041, 0x1e78e5c7, 0x09c4f8d8, 0x09d6ea40, 0x1e731f4c, + 0x1e71301f, 0x09dce4a1, 0x09eed17b, 0x1e6b5b8f, 0x1e6967b1, 0x09f4ca56, 0x0a06b296, 0x1e63850e, + 0x1e618c80, 0x0a0ca9e6, 0x0a1e8d81, 0x1e5b9bce, 0x1e599e91, 0x0a248343, 0x0a36622e, 0x1e539fd4, + 0x1e519dea, 0x0a3c565e, 0x0a4e308f, 0x1e4b9126, 0x1e498a8e, 0x0a542329, 0x0a65f894, 0x1e436fc7, + 0x1e416485, 0x0a6be995, 0x0a7dba2f, 0x1e3b3bbd, 0x1e392bd1, 0x0a83a993, 0x0a957551, 0x1e32f50e, + 0x1e30e079, 0x0a9b6315, 0x0aad29ec, 0x1e2a9bbd, 0x1e288281, 0x0ab3160c, 0x0ac4d7f1, 0x1e222fd1, + 0x1e2011ee, 0x0acac26a, 0x0adc7f52, 0x1e19b14f, 0x1e178ec7, 0x0ae2681f, 0x0af41fff, 0x1e11203b, + 0x1e0ef910, 0x0afa071d, 0x0b0bb9eb, 0x1e087c9b, 0x1e0650ce, 0x0b119f56, 0x0b234d07, 0x1dffc674, + 0x1dfd9606, 0x0b2930bb, 0x0b3ad943, 0x1df6fdcc, 0x1df4c8bf, 0x0b40bb3e, 0x0b525e92, 0x1dee22a9, + 0x1debe8fd, 0x0b583ecf, 0x0b69dce6, 0x1de5350f, 0x1de2f6c6, 0x0b6fbb62, 0x0b81542f, 0x1ddc3504, + 0x1dd9f220, 0x0b8730e6, 0x0b98c45f, 0x1dd3228e, 0x1dd0db10, 0x0b9e9f4d, 0x0bb02d68, 0x1dc9fdb2, + 0x1dc7b19b, 0x0bb6068a, 0x0bc78f3b, 0x1dc0c676, 0x1dbe75c8, 0x0bcd668e, 0x0bdee9ca, 0x1db77cdf, + 0x1db5279c, 0x0be4bf4a, 0x0bf63d07, 0x1dae20f4, 0x1dabc71d, 0x0bfc10af, 0x0c0d88e2, 0x1da4b2ba, + 0x1da25450, 0x0c135ab0, 0x0c24cd4e, 0x1d9b3237, 0x1d98cf3b, 0x0c2a9d3e, 0x0c3c0a3d, 0x1d919f70, + 0x1d8f37e5, 0x0c41d84b, 0x0c533fa0, 0x1d87fa6d, 0x1d858e53, 0x0c590bc9, 0x0c6a6d68, 0x1d7e4332, + 0x1d7bd28b, 0x0c7037a8, 0x0c819388, 0x1d7479c5, 0x1d720493, 0x0c875bdb, 0x0c98b1f0, 0x1d6a9e2e, + 0x1d682472, 0x0c9e7854, 0x0cafc894, 0x1d60b070, 0x1d5e322c, 0x0cb58d04, 0x0cc6d764, 0x1d56b094, + 0x1d542dc9, 0x0ccc99de, 0x0cddde53, 0x1d4c9e9f, 0x1d4a174f, 0x0ce39ed2, 0x0cf4dd52, 0x1d427a97, + 0x1d3feec3, 0x0cfa9bd2, 0x0d0bd452, 0x1d384483, 0x1d35b42d, 0x0d1190d1, 0x0d22c347, 0x1d2dfc68, + 0x1d2b6791, 0x0d287dc1, 0x0d39aa21, 0x1d23a24e, 0x1d2108f8, 0x0d3f6292, 0x0d5088d3, 0x1d19363a, + 0x1d169867, 0x0d563f38, 0x0d675f4e, 0x1d0eb833, 0x1d0c15e4, 0x0d6d13a3, 0x0d7e2d85, 0x1d04283f, + 0x1d018176, 0x0d83dfc6, 0x0d94f369, 0x1cf98666, 0x1cf6db24, 0x0d9aa393, 0x0dabb0ec, 0x1ceed2ad, + 0x1cec22f4, 0x0db15efc, 0x0dc26600, 0x1ce40d1b, 0x1ce158ed, 0x0dc811f3, 0x0dd91298, 0x1cd935b7, + 0x1cd67d15, 0x0ddebc69, 0x0defb6a5, 0x1cce4c87, 0x1ccb8f74, 0x0df55e51, 0x0e065219, 0x1cc35192, + 0x1cc0900f, 0x0e0bf79c, 0x0e1ce4e6, 0x1cb844df, 0x1cb57eee, 0x0e22883e, 0x0e336eff, 0x1cad2675, + 0x1caa5c17, 0x0e391027, 0x0e49f055, 0x1ca1f65b, 0x1c9f2792, 0x0e4f8f4b, 0x0e6068db, 0x1c96b497, + 0x1c93e165, 0x0e66059a, 0x0e76d883, 0x1c8b6131, 0x1c888997, 0x0e7c7308, 0x0e8d3f3e, 0x1c7ffc2f, + 0x1c7d202f, 0x0e92d787, 0x0ea39d00, 0x1c748599, 0x1c71a535, 0x0ea93308, 0x0eb9f1ba, 0x1c68fd75, + 0x1c6618ae, 0x0ebf857d, 0x0ed03d5e, 0x1c5d63ca, 0x1c5a7aa4, 0x0ed5ceda, 0x0ee67fdf, 0x1c51b8a1, + 0x1c4ecb1c, 0x0eec0f10, 0x0efcb92f, 0x1c45fc00, 0x1c430a1d, 0x0f024612, 0x0f12e941, 0x1c3a2ded, + 0x1c3737b0, 0x0f1873d2, 0x0f291006, 0x1c2e4e72, 0x1c2b53db, 0x0f2e9842, 0x0f3f2d71, 0x1c225d94, + 0x1c1f5ea6, 0x0f44b354, 0x0f554175, 0x1c165b5b, 0x1c135818, 0x0f5ac4fc, 0x0f6b4c03, 0x1c0a47cf, + 0x1c074038, 0x0f70cd2a, 0x0f814d0e, 0x1bfe22f8, 0x1bfb170f, 0x0f86cbd3, 0x0f974489, 0x1bf1ecdb, + 0x1beedca2, 0x0f9cc0e7, 0x0fad3265, 0x1be5a582, 0x1be290fb, 0x0fb2ac5a, 0x0fc31697, 0x1bd94cf4, + 0x1bd63421, 0x0fc88e1e, 0x0fd8f10f, 0x1bcce337, 0x1bc9c61a, 0x0fde6626, 0x0feec1c0, 0x1bc06855, + 0x1bbd46f0, 0x0ff43464, 0x1004889e, 0x1bb3dc55, 0x1bb0b6a9, 0x1009f8cb, 0x101a459a, 0x1ba73f3d, + 0x1ba4154d, 0x101fb34d, 0x102ff8a8, 0x1b9a9117, 0x1b9762e4, 0x103563dc, 0x1045a1b9, 0x1b8dd1ea, + 0x1b8a9f77, 0x104b0a6c, 0x105b40c1, 0x1b8101be, 0x1b7dcb0c, 0x1060a6ef, 0x1070d5b1, 0x1b74209b, + 0x1b70e5ac, 0x10763958, 0x1086607e, 0x1b672e88, 0x1b63ef5f, 0x108bc19a, 0x109be119, 0x1b5a2b8e, + 0x1b56e82c, 0x10a13fa6, 0x10b15775, 0x1b4d17b4, 0x1b49d01c, 0x10b6b371, 0x10c6c385, 0x1b3ff304, + 0x1b3ca737, 0x10cc1cec, 0x10dc253c, 0x1b32bd84, 0x1b2f6d85, 0x10e17c0b, 0x10f17c8d, 0x1b25773d, + 0x1b22230e, 0x10f6d0c0, 0x1106c96a, 0x1b182038, 0x1b14c7da, 0x110c1afe, 0x111c0bc6, 0x1b0ab87c, + 0x1b075bf1, 0x11215ab8, 0x11314395, 0x1afd4012, 0x1af9df5d, 0x11368fe1, 0x114670c8, 0x1aefb702, + 0x1aec5225, 0x114bba6b, 0x115b9354, 0x1ae21d54, 0x1adeb451, 0x1160da4b, 0x1170ab2a, 0x1ad47311, + 0x1ad105e9, 0x1175ef72, 0x1185b83f, 0x1ac6b841, 0x1ac346f8, 0x118af9d4, 0x119aba84, 0x1ab8ecec, + 0x1ab57784, 0x119ff964, 0x11afb1ee, 0x1aab111c, 0x1aa79796, 0x11b4ee14, 0x11c49e6f, 0x1a9d24d9, + 0x1a99a737, 0x11c9d7d9, 0x11d97ff9, 0x1a8f282b, 0x1a8ba670, 0x11deb6a4, 0x11ee5682, 0x1a811b1b, + 0x1a7d9549, 0x11f38a6a, 0x120321fa, 0x1a72fdb2, 0x1a6f73ca, 0x1208531c, 0x1217e256, 0x1a64cff8, + 0x1a6141fd, 0x121d10af, 0x122c9789, 0x1a5691f5, 0x1a52ffeb, 0x1231c316, 0x12414186, 0x1a4843b4, + 0x1a44ad9b, 0x12466a44, 0x1255e041, 0x1a39e53d, 0x1a364b17, 0x125b062b, 0x126a73ac, 0x1a2b7698, + 0x1a27d868, 0x126f96c1, 0x127efbbb, 0x1a1cf7ce, 0x1a195597, 0x12841bf6, 0x12937861, 0x1a0e68e9, + 0x1a0ac2ac, 0x129895c0, 0x12a7e991, 0x19ffc9f1, 0x19fc1fb1, 0x12ad0412, 0x12bc4f40, 0x19f11af0, + 0x19ed6caf, 0x12c166de, 0x12d0a960, 0x19e25bee, 0x19dea9ae, 0x12d5be18, 0x12e4f7e5, 0x19d38cf4, + 0x19cfd6b8, 0x12ea09b4, 0x12f93ac2, 0x19c4ae0c, 0x19c0f3d6, 0x12fe49a6, 0x130d71eb, 0x19b5bf3f, + 0x19b20111, 0x13127de0, 0x13219d53, 0x19a6c096, 0x19a2fe73, 0x1326a656, 0x1335bcef, 0x1997b21b, + 0x1993ec04, 0x133ac2fc, 0x1349d0b0, 0x198893d6, 0x1984c9ce, 0x134ed3c5, 0x135dd88c, 0x197965d0, + 0x197597da, 0x1362d8a6, 0x1371d476, 0x196a2815, 0x19665632, 0x1376d191, 0x1385c461, 0x195adaab, + 0x195704df, 0x138abe7b, 0x1399a841, 0x194b7d9e, 0x1947a3eb, 0x139e9f56, 0x13ad800a, 0x193c10f7, + 0x1938335e, 0x13b27417, 0x13c14bb0, 0x192c94bf, 0x1928b343, 0x13c63cb2, 0x13d50b26, 0x191d08ff, + 0x191923a3, 0x13d9f91b, 0x13e8be60, 0x190d6dc1, 0x19098488, 0x13eda944, 0x13fc6553, 0x18fdc310, + 0x18f9d5fa, 0x14014d23, 0x140ffff1, 0x18ee08f4, 0x18ea1805, 0x1414e4aa, 0x14238e2f, 0x18de3f77, + 0x18da4ab2, 0x14286fce, 0x14371001, 0x18ce66a3, 0x18ca6e0a, 0x143bee83, 0x144a855b, 0x18be7e82, + 0x18ba8217, 0x144f60bd, 0x145dee30, 0x18ae871e, 0x18aa86e3, 0x1462c670, 0x14714a76, 0x189e8080, + 0x189a7c78, 0x14761f8f, 0x14849a1f, 0x188e6ab2, 0x188a62e0, 0x14896c0f, 0x1497dd20, 0x187e45be, + 0x187a3a25, 0x149cabe4, 0x14ab136d, 0x186e11af, 0x186a0250, 0x14afdf03, 0x14be3cfa, 0x185dce8e, + 0x1859bb6c, 0x14c3055e, 0x14d159bc, 0x184d7c65, 0x18496583, 0x14d61eeb, 0x14e469a6, 0x183d1b3e, + 0x1839009e, 0x14e92b9e, 0x14f76cad, 0x182cab24, 0x18288cc8, 0x14fc2b6a, 0x150a62c6, 0x181c2c20, + 0x18180a0c, 0x150f1e45, 0x151d4be3, 0x180b9e3d, 0x18077873, 0x15220422, 0x153027fb, 0x17fb0185, + 0x17f6d807, 0x1534dcf6, 0x1542f700, 0x17ea5602, 0x17e628d3, 0x1547a8b5, 0x1555b8e8, 0x17d99bbe, + 0x17d56ae0, 0x155a6754, 0x15686da7, 0x17c8d2c4, 0x17c49e3b, 0x156d18c7, 0x157b1532, 0x17b7fb1f, + 0x17b3c2ec, 0x157fbd03, 0x158daf7c, 0x17a714d7, 0x17a2d8fe, 0x159253fb, 0x15a03c7a, 0x17961ff9, + 0x1791e07b, 0x15a4dda5, 0x15b2bc22, 0x17851c8e, 0x1780d96f, 0x15b759f5, 0x15c52e67, 0x17740aa1, + 0x176fc3e3, 0x15c9c8e0, 0x15d7933f, 0x1762ea3d, 0x175e9fe2, 0x15dc2a5a, 0x15e9ea9d, 0x1751bb6b, + 0x174d6d77, 0x15ee7e58, 0x15fc3477, 0x17407e37, 0x173c2cac, 0x1600c4cf, 0x160e70c1, 0x172f32ab, + 0x172add8c, 0x1612fdb3, 0x16209f70, 0x171dd8d2, 0x17198021, 0x162528fa, 0x1632c078, 0x170c70b7, + 0x17081477, 0x16374697, 0x1644d3d0, 0x16fafa64, 0x16f69a97, 0x16495680, 0x1656d96a, 0x16e975e4, + 0x16e5128e, 0x165b58aa, 0x1668d13e, 0x16d7e341, 0x16d37c65, 0x166d4d0a, 0x167abb3e, 0x16c64288, + 0x16c1d827, 0x167f3394, 0x168c9760, 0x16b493c2, 0x16b025e0, 0x16910c3d, 0x169e659a, 0x16a2d6fb +}; + +const int twidTab512[8*6 + 32*6 + 128*6] = { 0x20000000, 0x00000000, 0x1d906bcf, 0x0c3ef153, 0x16a09e66, 0x16a09e66, 0x0c3ef153, 0x1d906bcf, 0x20000000, 0x00000000, 0x1f6297d0, 0x063e2e0f, 0x1d906bcf, 0x0c3ef153, 0x1a9b6629, 0x11c73b3a, 0x20000000, 0x00000000, 0x1a9b6629, 0x11c73b3a, 0x0c3ef153, 0x1d906bcf, 0xf9c1d1f1, 0x1f6297d0, @@ -628,10 +628,10 @@ const int twidTab512[8*6 + 32*6 + 128*6] = { 0xf6b5fce9, 0xe160bea9, 0xf7d823f9, 0xe10e875c, 0xf8fd1f65, 0xe0c70c54, 0xfa248988, 0xe08a665c, 0xe027725c, 0x0322f4d8, 0xe0163253, 0x025aa412, 0xe009de1d, 0x0191f65f, 0xe002779f, 0x00c90ab0, 0x0191f65f, 0x1ff621e3, 0x012d8657, 0x1ffa72f0, 0x00c90ab0, 0x1ffd8861, 0x00648748, 0x1fff6217, - 0xfb4dfbe4, 0xe058aa81, 0xfc790f47, 0xe031ea03, 0xfda55bee, 0xe0163253, 0xfed279a9, 0xe0058d10
-};
-
-const int twidTab64[4*6 + 16*6] = {
+ 0xfb4dfbe4, 0xe058aa81, 0xfc790f47, 0xe031ea03, 0xfda55bee, 0xe0163253, 0xfed279a9, 0xe0058d10 +}; + +const int twidTab64[4*6 + 16*6] = { 0x20000000, 0x00000000, 0x16a09e66, 0x16a09e66, 0x00000000, 0x20000000, 0xe95f619a, 0x16a09e66, 0x20000000, 0x00000000, 0x1d906bcf, 0x0c3ef153, 0x16a09e66, 0x16a09e66, 0x0c3ef153, 0x1d906bcf, 0x20000000, 0x00000000, 0x0c3ef153, 0x1d906bcf, 0xe95f619a, 0x16a09e66, 0xe26f9431, 0xf3c10ead, @@ -647,399 +647,399 @@ const int twidTab64[4*6 + 16*6] = { 0xe95f619a, 0x16a09e66, 0xe3c74d0e, 0x0f15ae9c, 0xe09d6830, 0x063e2e0f, 0xe027725c, 0xfcdd0b28, 0xe95f619a, 0x16a09e66, 0xe56499d7, 0x11c73b3a, 0xe26f9431, 0x0c3ef153, 0xe09d6830, 0x063e2e0f, 0x0c3ef153, 0x1d906bcf, 0x094a0317, 0x1e9f4157, 0x063e2e0f, 0x1f6297d0, 0x0322f4d8, 0x1fd88da4, - 0xe26f9431, 0xf3c10ead, 0xe7437f95, 0xebb30cdb, 0xee38c4c6, 0xe56499d7, 0xf6b5fce9, 0xe160bea9
-};
-
+ 0xe26f9431, 0xf3c10ead, 0xe7437f95, 0xebb30cdb, 0xee38c4c6, 0xe56499d7, 0xf6b5fce9, 0xe160bea9 +}; + #else -/*
- * Q30 for 128 and 1024
- *
- * for (i = 0; i < num/4; i++) {
- * angle = (i + 0.125) * M_PI / num;
- * x = cos(angle) * (1 << 30);
- * x = sin(angle) * (1 << 30);
- *
- * angle = (num/2 - 1 - i + 0.125) * M_PI / num;
- * x = cos(angle) * (1 << 30);
- * x = sin(angle) * (1 << 30);
- * }
- */
-const int cossintab[128 + 1024] = {
- /* 128 */
- 0x3fffec43, 0x003243f1, 0x015fd4d2, 0x3ffc38d1, 0x3ff9c13a, 0x01c454f5, 0x02f1b755, 0x3feea776,
- 0x3fe9b8a9, 0x03562038, 0x0483259d, 0x3fd73a4a, 0x3fcfd50b, 0x04e767c5, 0x0613e1c5, 0x3fb5f4ea,
- 0x3fac1a5b, 0x0677edbb, 0x07a3adff, 0x3f8adc77, 0x3f7e8e1e, 0x08077457, 0x09324ca7, 0x3f55f796,
- 0x3f473759, 0x0995bdfd, 0x0abf8043, 0x3f174e70, 0x3f061e95, 0x0b228d42, 0x0c4b0b94, 0x3eceeaad,
- 0x3ebb4ddb, 0x0cada4f5, 0x0dd4b19a, 0x3e7cd778, 0x3e66d0b4, 0x0e36c82a, 0x0f5c35a3, 0x3e212179,
- 0x3e08b42a, 0x0fbdba40, 0x10e15b4e, 0x3dbbd6d4, 0x3da106bd, 0x11423ef0, 0x1263e699, 0x3d4d0728,
- 0x3d2fd86c, 0x12c41a4f, 0x13e39be9, 0x3cd4c38b, 0x3cb53aaa, 0x144310dd, 0x15604013, 0x3c531e88,
- 0x3c314060, 0x15bee78c, 0x16d99864, 0x3bc82c1f, 0x3ba3fde7, 0x173763c9, 0x184f6aab, 0x3b3401bb,
- 0x3b0d8909, 0x18ac4b87, 0x19c17d44, 0x3a96b636, 0x3a6df8f8, 0x1a1d6544, 0x1b2f971e, 0x39f061d2,
- 0x39c5664f, 0x1b8a7815, 0x1c997fc4, 0x39411e33, 0x3913eb0e, 0x1cf34baf, 0x1dfeff67, 0x38890663,
- 0x3859a292, 0x1e57a86d, 0x1f5fdee6, 0x37c836c2, 0x3796a996, 0x1fb7575c, 0x20bbe7d8, 0x36fecd0e,
- 0x36cb1e2a, 0x21122240, 0x2212e492, 0x362ce855, 0x35f71fb1, 0x2267d3a0, 0x2364a02e, 0x3552a8f4,
- 0x351acedd, 0x23b836ca, 0x24b0e699, 0x34703095, 0x34364da6, 0x250317df, 0x25f78497, 0x3385a222,
- 0x3349bf48, 0x264843d9, 0x273847c8, 0x329321c7, 0x32554840, 0x27878893, 0x2872feb6, 0x3198d4ea,
- 0x31590e3e, 0x28c0b4d2, 0x29a778db, 0x3096e223, 0x30553828, 0x29f3984c, 0x2ad586a3, 0x2f8d713a,
- 0x2f49ee0f, 0x2b2003ac, 0x2bfcf97c, 0x2e7cab1c, 0x2e37592c, 0x2c45c8a0, 0x2d1da3d5, 0x2d64b9da,
- /* 1024 */
- 0x3fffffb1, 0x0006487f, 0x002bfb74, 0x3ffff0e3, 0x3fffe705, 0x00388c6e, 0x005e3f4c, 0x3fffba9b,
- 0x3fffa6de, 0x006ad03b, 0x009082ea, 0x3fff5cd8, 0x3fff3f3c, 0x009d13c5, 0x00c2c62f, 0x3ffed79b,
- 0x3ffeb021, 0x00cf56ef, 0x00f508fc, 0x3ffe2ae5, 0x3ffdf98c, 0x01019998, 0x01274b31, 0x3ffd56b5,
- 0x3ffd1b7e, 0x0133dba3, 0x01598cb1, 0x3ffc5b0c, 0x3ffc15f7, 0x01661cf0, 0x018bcd5b, 0x3ffb37ec,
- 0x3ffae8f9, 0x01985d60, 0x01be0d11, 0x3ff9ed53, 0x3ff99483, 0x01ca9cd4, 0x01f04bb4, 0x3ff87b44,
- 0x3ff81896, 0x01fcdb2e, 0x02228924, 0x3ff6e1bf, 0x3ff67534, 0x022f184d, 0x0254c544, 0x3ff520c5,
- 0x3ff4aa5d, 0x02615414, 0x0286fff3, 0x3ff33858, 0x3ff2b813, 0x02938e62, 0x02b93914, 0x3ff12878,
- 0x3ff09e56, 0x02c5c71a, 0x02eb7086, 0x3feef126, 0x3fee5d28, 0x02f7fe1c, 0x031da62b, 0x3fec9265,
- 0x3febf48b, 0x032a3349, 0x034fd9e5, 0x3fea0c35, 0x3fe96480, 0x035c6682, 0x03820b93, 0x3fe75e98,
- 0x3fe6ad08, 0x038e97a9, 0x03b43b17, 0x3fe48990, 0x3fe3ce26, 0x03c0c69e, 0x03e66852, 0x3fe18d1f,
- 0x3fe0c7da, 0x03f2f342, 0x04189326, 0x3fde6945, 0x3fdd9a27, 0x04251d77, 0x044abb73, 0x3fdb1e06,
- 0x3fda450f, 0x0457451d, 0x047ce11a, 0x3fd7ab64, 0x3fd6c894, 0x04896a16, 0x04af03fc, 0x3fd4115f,
- 0x3fd324b7, 0x04bb8c42, 0x04e123fa, 0x3fd04ffc, 0x3fcf597c, 0x04edab83, 0x051340f6, 0x3fcc673b,
- 0x3fcb66e4, 0x051fc7b9, 0x05455ad1, 0x3fc8571f, 0x3fc74cf3, 0x0551e0c7, 0x0577716b, 0x3fc41fac,
- 0x3fc30baa, 0x0583f68c, 0x05a984a6, 0x3fbfc0e3, 0x3fbea30c, 0x05b608eb, 0x05db9463, 0x3fbb3ac7,
- 0x3fba131b, 0x05e817c3, 0x060da083, 0x3fb68d5b, 0x3fb55bdc, 0x061a22f7, 0x063fa8e7, 0x3fb1b8a2,
- 0x3fb07d50, 0x064c2a67, 0x0671ad71, 0x3facbc9f, 0x3fab777b, 0x067e2df5, 0x06a3ae00, 0x3fa79954,
- 0x3fa64a5f, 0x06b02d81, 0x06d5aa77, 0x3fa24ec6, 0x3fa0f600, 0x06e228ee, 0x0707a2b7, 0x3f9cdcf7,
- 0x3f9b7a62, 0x0714201b, 0x073996a1, 0x3f9743eb, 0x3f95d787, 0x074612eb, 0x076b8616, 0x3f9183a5,
- 0x3f900d72, 0x0778013d, 0x079d70f7, 0x3f8b9c28, 0x3f8a1c29, 0x07a9eaf5, 0x07cf5726, 0x3f858d79,
- 0x3f8403ae, 0x07dbcff2, 0x08013883, 0x3f7f579b, 0x3f7dc405, 0x080db016, 0x083314f1, 0x3f78fa92,
- 0x3f775d31, 0x083f8b43, 0x0864ec4f, 0x3f727661, 0x3f70cf38, 0x08716159, 0x0896be80, 0x3f6bcb0e,
- 0x3f6a1a1c, 0x08a3323a, 0x08c88b65, 0x3f64f89b, 0x3f633de2, 0x08d4fdc6, 0x08fa52de, 0x3f5dff0e,
- 0x3f5c3a8f, 0x0906c3e0, 0x092c14ce, 0x3f56de6a, 0x3f551026, 0x09388469, 0x095dd116, 0x3f4f96b4,
- 0x3f4dbeac, 0x096a3f42, 0x098f8796, 0x3f4827f0, 0x3f464626, 0x099bf44c, 0x09c13831, 0x3f409223,
- 0x3f3ea697, 0x09cda368, 0x09f2e2c7, 0x3f38d552, 0x3f36e006, 0x09ff4c78, 0x0a24873a, 0x3f30f181,
- 0x3f2ef276, 0x0a30ef5e, 0x0a56256c, 0x3f28e6b6, 0x3f26ddec, 0x0a628bfa, 0x0a87bd3d, 0x3f20b4f5,
- 0x3f1ea26e, 0x0a94222f, 0x0ab94e8f, 0x3f185c43, 0x3f164001, 0x0ac5b1dc, 0x0aead944, 0x3f0fdca5,
- 0x3f0db6a9, 0x0af73ae5, 0x0b1c5d3d, 0x3f073621, 0x3f05066d, 0x0b28bd2a, 0x0b4dda5c, 0x3efe68bc,
- 0x3efc2f50, 0x0b5a388d, 0x0b7f5081, 0x3ef5747b, 0x3ef3315a, 0x0b8bacf0, 0x0bb0bf8f, 0x3eec5965,
- 0x3eea0c8e, 0x0bbd1a33, 0x0be22766, 0x3ee3177e, 0x3ee0c0f4, 0x0bee8038, 0x0c1387e9, 0x3ed9aecc,
- 0x3ed74e91, 0x0c1fdee1, 0x0c44e0f9, 0x3ed01f55, 0x3ecdb56a, 0x0c513610, 0x0c763278, 0x3ec66920,
- 0x3ec3f585, 0x0c8285a5, 0x0ca77c47, 0x3ebc8c31, 0x3eba0ee9, 0x0cb3cd84, 0x0cd8be47, 0x3eb2888f,
- 0x3eb0019c, 0x0ce50d8c, 0x0d09f85b, 0x3ea85e41, 0x3ea5cda3, 0x0d1645a0, 0x0d3b2a64, 0x3e9e0d4c,
- 0x3e9b7306, 0x0d4775a1, 0x0d6c5443, 0x3e9395b7, 0x3e90f1ca, 0x0d789d71, 0x0d9d75db, 0x3e88f788,
- 0x3e8649f5, 0x0da9bcf2, 0x0dce8f0d, 0x3e7e32c6, 0x3e7b7b90, 0x0ddad406, 0x0dff9fba, 0x3e734778,
- 0x3e70869f, 0x0e0be28e, 0x0e30a7c5, 0x3e6835a4, 0x3e656b2b, 0x0e3ce86b, 0x0e61a70f, 0x3e5cfd51,
- 0x3e5a2939, 0x0e6de580, 0x0e929d7a, 0x3e519e86, 0x3e4ec0d1, 0x0e9ed9af, 0x0ec38ae8, 0x3e46194a,
- 0x3e4331fa, 0x0ecfc4d9, 0x0ef46f3b, 0x3e3a6da4, 0x3e377cbb, 0x0f00a6df, 0x0f254a53, 0x3e2e9b9c,
- 0x3e2ba11b, 0x0f317fa5, 0x0f561c15, 0x3e22a338, 0x3e1f9f21, 0x0f624f0c, 0x0f86e460, 0x3e168480,
- 0x3e1376d5, 0x0f9314f5, 0x0fb7a317, 0x3e0a3f7b, 0x3e07283f, 0x0fc3d143, 0x0fe8581d, 0x3dfdd432,
- 0x3dfab365, 0x0ff483d7, 0x10190352, 0x3df142ab, 0x3dee1851, 0x10252c94, 0x1049a49a, 0x3de48aef,
- 0x3de15708, 0x1055cb5b, 0x107a3bd5, 0x3dd7ad05, 0x3dd46f94, 0x1086600e, 0x10aac8e6, 0x3dcaa8f5,
- 0x3dc761fc, 0x10b6ea90, 0x10db4baf, 0x3dbd7ec7, 0x3dba2e48, 0x10e76ac3, 0x110bc413, 0x3db02e84,
- 0x3dacd481, 0x1117e088, 0x113c31f3, 0x3da2b834, 0x3d9f54af, 0x11484bc2, 0x116c9531, 0x3d951bde,
- 0x3d91aed9, 0x1178ac53, 0x119cedaf, 0x3d87598c, 0x3d83e309, 0x11a9021d, 0x11cd3b50, 0x3d797145,
- 0x3d75f147, 0x11d94d02, 0x11fd7df6, 0x3d6b6313, 0x3d67d99b, 0x12098ce5, 0x122db583, 0x3d5d2efe,
- 0x3d599c0e, 0x1239c1a7, 0x125de1da, 0x3d4ed50f, 0x3d4b38aa, 0x1269eb2b, 0x128e02dc, 0x3d40554e,
- 0x3d3caf76, 0x129a0954, 0x12be186c, 0x3d31afc5, 0x3d2e007c, 0x12ca1c03, 0x12ee226c, 0x3d22e47c,
- 0x3d1f2bc5, 0x12fa231b, 0x131e20c0, 0x3d13f37e, 0x3d10315a, 0x132a1e7e, 0x134e1348, 0x3d04dcd2,
- 0x3d011145, 0x135a0e0e, 0x137df9e7, 0x3cf5a082, 0x3cf1cb8e, 0x1389f1af, 0x13add481, 0x3ce63e98,
- 0x3ce2603f, 0x13b9c943, 0x13dda2f7, 0x3cd6b71e, 0x3cd2cf62, 0x13e994ab, 0x140d652c, 0x3cc70a1c,
- 0x3cc318ff, 0x141953cb, 0x143d1b02, 0x3cb7379c, 0x3cb33d22, 0x14490685, 0x146cc45c, 0x3ca73fa9,
- 0x3ca33bd3, 0x1478acbc, 0x149c611d, 0x3c97224c, 0x3c93151d, 0x14a84652, 0x14cbf127, 0x3c86df8e,
- 0x3c82c909, 0x14d7d32a, 0x14fb745e, 0x3c76777b, 0x3c7257a2, 0x15075327, 0x152aeaa3, 0x3c65ea1c,
- 0x3c61c0f1, 0x1536c62b, 0x155a53d9, 0x3c55377b, 0x3c510501, 0x15662c18, 0x1589afe3, 0x3c445fa2,
- 0x3c4023dd, 0x159584d3, 0x15b8fea4, 0x3c33629d, 0x3c2f1d8e, 0x15c4d03e, 0x15e83fff, 0x3c224075,
- 0x3c1df21f, 0x15f40e3a, 0x161773d6, 0x3c10f935, 0x3c0ca19b, 0x16233eac, 0x16469a0d, 0x3bff8ce8,
- 0x3bfb2c0c, 0x16526176, 0x1675b286, 0x3bedfb99, 0x3be9917e, 0x1681767c, 0x16a4bd25, 0x3bdc4552,
- 0x3bd7d1fa, 0x16b07d9f, 0x16d3b9cc, 0x3bca6a1d, 0x3bc5ed8d, 0x16df76c3, 0x1702a85e, 0x3bb86a08,
- 0x3bb3e440, 0x170e61cc, 0x173188be, 0x3ba6451b, 0x3ba1b620, 0x173d3e9b, 0x17605ad0, 0x3b93fb63,
- 0x3b8f6337, 0x176c0d15, 0x178f1e76, 0x3b818ceb, 0x3b7ceb90, 0x179acd1c, 0x17bdd394, 0x3b6ef9be,
- 0x3b6a4f38, 0x17c97e93, 0x17ec7a0d, 0x3b5c41e8, 0x3b578e39, 0x17f8215e, 0x181b11c4, 0x3b496574,
- 0x3b44a8a0, 0x1826b561, 0x18499a9d, 0x3b36646e, 0x3b319e77, 0x18553a7d, 0x1878147a, 0x3b233ee1,
- 0x3b1e6fca, 0x1883b097, 0x18a67f3f, 0x3b0ff4d9, 0x3b0b1ca6, 0x18b21791, 0x18d4dad0, 0x3afc8663,
- 0x3af7a516, 0x18e06f50, 0x1903270f, 0x3ae8f38b, 0x3ae40926, 0x190eb7b7, 0x193163e1, 0x3ad53c5b,
- 0x3ad048e3, 0x193cf0a9, 0x195f9128, 0x3ac160e1, 0x3abc6458, 0x196b1a09, 0x198daec8, 0x3aad6129,
- 0x3aa85b92, 0x199933bb, 0x19bbbca6, 0x3a993d3e, 0x3a942e9d, 0x19c73da3, 0x19e9baa3, 0x3a84f52f,
- 0x3a7fdd86, 0x19f537a4, 0x1a17a8a5, 0x3a708906, 0x3a6b6859, 0x1a2321a2, 0x1a45868e, 0x3a5bf8d1,
- 0x3a56cf23, 0x1a50fb81, 0x1a735442, 0x3a47449c, 0x3a4211f0, 0x1a7ec524, 0x1aa111a6, 0x3a326c74,
- 0x3a2d30cd, 0x1aac7e6f, 0x1acebe9d, 0x3a1d7066, 0x3a182bc8, 0x1ada2746, 0x1afc5b0a, 0x3a08507f,
- 0x3a0302ed, 0x1b07bf8c, 0x1b29e6d2, 0x39f30ccc, 0x39edb649, 0x1b354727, 0x1b5761d8, 0x39dda55a,
- 0x39d845e9, 0x1b62bdf8, 0x1b84cc01, 0x39c81a36, 0x39c2b1da, 0x1b9023e5, 0x1bb22530, 0x39b26b6d,
- 0x39acfa2b, 0x1bbd78d2, 0x1bdf6d4a, 0x399c990d, 0x39971ee7, 0x1beabca1, 0x1c0ca432, 0x3986a324,
- 0x3981201e, 0x1c17ef39, 0x1c39c9cd, 0x397089bf, 0x396afddc, 0x1c45107c, 0x1c66ddfe, 0x395a4ceb,
- 0x3954b82e, 0x1c72204f, 0x1c93e0ab, 0x3943ecb6, 0x393e4f23, 0x1c9f1e96, 0x1cc0d1b6, 0x392d692f,
- 0x3927c2c9, 0x1ccc0b35, 0x1cedb106, 0x3916c262, 0x3911132d, 0x1cf8e611, 0x1d1a7e7d, 0x38fff85e,
- 0x38fa405e, 0x1d25af0d, 0x1d473a00, 0x38e90b31, 0x38e34a69, 0x1d52660f, 0x1d73e374, 0x38d1fae9,
- 0x38cc315d, 0x1d7f0afb, 0x1da07abc, 0x38bac795, 0x38b4f547, 0x1dab9db5, 0x1dccffbf, 0x38a37142,
- 0x389d9637, 0x1dd81e21, 0x1df9725f, 0x388bf7ff, 0x3886143b, 0x1e048c24, 0x1e25d282, 0x38745bdb,
- 0x386e6f60, 0x1e30e7a4, 0x1e52200c, 0x385c9ce3, 0x3856a7b6, 0x1e5d3084, 0x1e7e5ae2, 0x3844bb28,
- 0x383ebd4c, 0x1e8966a8, 0x1eaa82e9, 0x382cb6b7, 0x3826b030, 0x1eb589f7, 0x1ed69805, 0x38148f9f,
- 0x380e8071, 0x1ee19a54, 0x1f029a1c, 0x37fc45ef, 0x37f62e1d, 0x1f0d97a5, 0x1f2e8911, 0x37e3d9b7,
- 0x37ddb945, 0x1f3981ce, 0x1f5a64cb, 0x37cb4b04, 0x37c521f6, 0x1f6558b5, 0x1f862d2d, 0x37b299e7,
- 0x37ac6841, 0x1f911c3d, 0x1fb1e21d, 0x3799c66f, 0x37938c34, 0x1fbccc4d, 0x1fdd8381, 0x3780d0aa,
- 0x377a8ddf, 0x1fe868c8, 0x2009113c, 0x3767b8a9, 0x37616d51, 0x2013f196, 0x20348b35, 0x374e7e7b,
- 0x37482a9a, 0x203f6699, 0x205ff14f, 0x3735222f, 0x372ec5c9, 0x206ac7b8, 0x208b4372, 0x371ba3d4,
- 0x37153eee, 0x209614d9, 0x20b68181, 0x3702037c, 0x36fb9618, 0x20c14ddf, 0x20e1ab63, 0x36e84135,
- 0x36e1cb58, 0x20ec72b1, 0x210cc0fc, 0x36ce5d10, 0x36c7debd, 0x21178334, 0x2137c232, 0x36b4571b,
- 0x36add058, 0x21427f4d, 0x2162aeea, 0x369a2f69, 0x3693a038, 0x216d66e2, 0x218d870b, 0x367fe608,
- 0x36794e6e, 0x219839d8, 0x21b84a79, 0x36657b08, 0x365edb09, 0x21c2f815, 0x21e2f91a, 0x364aee7b,
- 0x3644461b, 0x21eda17f, 0x220d92d4, 0x36304070, 0x36298fb4, 0x221835fb, 0x2238178d, 0x361570f8,
- 0x360eb7e3, 0x2242b56f, 0x22628729, 0x35fa8023, 0x35f3beba, 0x226d1fc1, 0x228ce191, 0x35df6e03,
- 0x35d8a449, 0x229774d7, 0x22b726a8, 0x35c43aa7, 0x35bd68a1, 0x22c1b496, 0x22e15655, 0x35a8e621,
- 0x35a20bd3, 0x22ebdee5, 0x230b707e, 0x358d7081, 0x35868def, 0x2315f3a8, 0x23357509, 0x3571d9d9,
- 0x356aef08, 0x233ff2c8, 0x235f63dc, 0x35562239, 0x354f2f2c, 0x2369dc29, 0x23893cdd, 0x353a49b2,
- 0x35334e6f, 0x2393afb2, 0x23b2fff3, 0x351e5056, 0x35174ce0, 0x23bd6d48, 0x23dcad03, 0x35023636,
- 0x34fb2a92, 0x23e714d3, 0x240643f4, 0x34e5fb63, 0x34dee795, 0x2410a639, 0x242fc4ad, 0x34c99fef,
- 0x34c283fb, 0x243a215f, 0x24592f13, 0x34ad23eb, 0x34a5ffd5, 0x2463862c, 0x2482830d, 0x34908768,
- 0x34895b36, 0x248cd487, 0x24abc082, 0x3473ca79, 0x346c962f, 0x24b60c57, 0x24d4e757, 0x3456ed2f,
- 0x344fb0d1, 0x24df2d81, 0x24fdf775, 0x3439ef9c, 0x3432ab2e, 0x250837ed, 0x2526f0c1, 0x341cd1d2,
- 0x34158559, 0x25312b81, 0x254fd323, 0x33ff93e2, 0x33f83f62, 0x255a0823, 0x25789e80, 0x33e235df,
- 0x33dad95e, 0x2582cdbc, 0x25a152c0, 0x33c4b7db, 0x33bd535c, 0x25ab7c30, 0x25c9efca, 0x33a719e8,
- 0x339fad70, 0x25d41369, 0x25f27584, 0x33895c18, 0x3381e7ac, 0x25fc934b, 0x261ae3d6, 0x336b7e7e,
- 0x33640223, 0x2624fbbf, 0x26433aa7, 0x334d812d, 0x3345fce6, 0x264d4cac, 0x266b79dd, 0x332f6435,
- 0x3327d808, 0x267585f8, 0x2693a161, 0x331127ab, 0x3309939c, 0x269da78b, 0x26bbb119, 0x32f2cba1,
- 0x32eb2fb5, 0x26c5b14c, 0x26e3a8ec, 0x32d45029, 0x32ccac64, 0x26eda322, 0x270b88c2, 0x32b5b557,
- 0x32ae09be, 0x27157cf5, 0x27335082, 0x3296fb3d, 0x328f47d5, 0x273d3eac, 0x275b0014, 0x327821ee,
- 0x327066bc, 0x2764e82f, 0x27829760, 0x3259297d, 0x32516686, 0x278c7965, 0x27aa164c, 0x323a11fe,
- 0x32324746, 0x27b3f235, 0x27d17cc1, 0x321adb83, 0x3213090f, 0x27db5288, 0x27f8caa5, 0x31fb8620,
- 0x31f3abf5, 0x28029a45, 0x281fffe2, 0x31dc11e8, 0x31d4300b, 0x2829c954, 0x28471c5e, 0x31bc7eee,
- 0x31b49564, 0x2850df9d, 0x286e2002, 0x319ccd46, 0x3194dc14, 0x2877dd07, 0x28950ab6, 0x317cfd04,
- 0x3175042e, 0x289ec17a, 0x28bbdc61, 0x315d0e3b, 0x31550dc6, 0x28c58cdf, 0x28e294eb, 0x313d00ff,
- 0x3134f8f1, 0x28ec3f1e, 0x2909343e, 0x311cd564, 0x3114c5c0, 0x2912d81f, 0x292fba40, 0x30fc8b7d,
- 0x30f47449, 0x293957c9, 0x295626da, 0x30dc235e, 0x30d404a0, 0x295fbe06, 0x297c79f5, 0x30bb9d1c,
- 0x30b376d8, 0x29860abd, 0x29a2b378, 0x309af8ca, 0x3092cb05, 0x29ac3dd7, 0x29c8d34d, 0x307a367c,
- 0x3072013c, 0x29d2573c, 0x29eed95b, 0x30595648, 0x30511991, 0x29f856d5, 0x2a14c58b, 0x30385840,
- 0x30301418, 0x2a1e3c8a, 0x2a3a97c7, 0x30173c7a, 0x300ef0e5, 0x2a440844, 0x2a604ff5, 0x2ff6030a,
- 0x2fedb00d, 0x2a69b9ec, 0x2a85ee00, 0x2fd4ac04, 0x2fcc51a5, 0x2a8f516b, 0x2aab71d0, 0x2fb3377c,
- 0x2faad5c1, 0x2ab4cea9, 0x2ad0db4e, 0x2f91a589, 0x2f893c75, 0x2ada318e, 0x2af62a63, 0x2f6ff63d,
- 0x2f6785d7, 0x2aff7a05, 0x2b1b5ef8, 0x2f4e29af, 0x2f45b1fb, 0x2b24a7f6, 0x2b4078f5, 0x2f2c3ff2,
- 0x2f23c0f6, 0x2b49bb4a, 0x2b657844, 0x2f0a391d, 0x2f01b2de, 0x2b6eb3ea, 0x2b8a5cce, 0x2ee81543,
- 0x2edf87c6, 0x2b9391c0, 0x2baf267d, 0x2ec5d479, 0x2ebd3fc4, 0x2bb854b4, 0x2bd3d53a, 0x2ea376d6,
- 0x2e9adaee, 0x2bdcfcb0, 0x2bf868ed, 0x2e80fc6e, 0x2e785958, 0x2c01899e, 0x2c1ce181, 0x2e5e6556,
- 0x2e55bb17, 0x2c25fb66, 0x2c413edf, 0x2e3bb1a4, 0x2e330042, 0x2c4a51f3, 0x2c6580f1, 0x2e18e16d,
- 0x2e1028ed, 0x2c6e8d2e, 0x2c89a79f, 0x2df5f4c7, 0x2ded352f, 0x2c92ad01, 0x2cadb2d5, 0x2dd2ebc7,
- 0x2dca251c, 0x2cb6b155, 0x2cd1a27b, 0x2dafc683, 0x2da6f8ca, 0x2cda9a14, 0x2cf5767c, 0x2d8c8510,
- 0x2d83b04f, 0x2cfe6728, 0x2d192ec1, 0x2d692784, 0x2d604bc0, 0x2d22187a, 0x2d3ccb34, 0x2d45adf6
+/* + * Q30 for 128 and 1024 + * + * for (i = 0; i < num/4; i++) { + * angle = (i + 0.125) * M_PI / num; + * x = cos(angle) * (1 << 30); + * x = sin(angle) * (1 << 30); + * + * angle = (num/2 - 1 - i + 0.125) * M_PI / num; + * x = cos(angle) * (1 << 30); + * x = sin(angle) * (1 << 30); + * } + */ +const int cossintab[128 + 1024] = { + /* 128 */ + 0x3fffec43, 0x003243f1, 0x015fd4d2, 0x3ffc38d1, 0x3ff9c13a, 0x01c454f5, 0x02f1b755, 0x3feea776, + 0x3fe9b8a9, 0x03562038, 0x0483259d, 0x3fd73a4a, 0x3fcfd50b, 0x04e767c5, 0x0613e1c5, 0x3fb5f4ea, + 0x3fac1a5b, 0x0677edbb, 0x07a3adff, 0x3f8adc77, 0x3f7e8e1e, 0x08077457, 0x09324ca7, 0x3f55f796, + 0x3f473759, 0x0995bdfd, 0x0abf8043, 0x3f174e70, 0x3f061e95, 0x0b228d42, 0x0c4b0b94, 0x3eceeaad, + 0x3ebb4ddb, 0x0cada4f5, 0x0dd4b19a, 0x3e7cd778, 0x3e66d0b4, 0x0e36c82a, 0x0f5c35a3, 0x3e212179, + 0x3e08b42a, 0x0fbdba40, 0x10e15b4e, 0x3dbbd6d4, 0x3da106bd, 0x11423ef0, 0x1263e699, 0x3d4d0728, + 0x3d2fd86c, 0x12c41a4f, 0x13e39be9, 0x3cd4c38b, 0x3cb53aaa, 0x144310dd, 0x15604013, 0x3c531e88, + 0x3c314060, 0x15bee78c, 0x16d99864, 0x3bc82c1f, 0x3ba3fde7, 0x173763c9, 0x184f6aab, 0x3b3401bb, + 0x3b0d8909, 0x18ac4b87, 0x19c17d44, 0x3a96b636, 0x3a6df8f8, 0x1a1d6544, 0x1b2f971e, 0x39f061d2, + 0x39c5664f, 0x1b8a7815, 0x1c997fc4, 0x39411e33, 0x3913eb0e, 0x1cf34baf, 0x1dfeff67, 0x38890663, + 0x3859a292, 0x1e57a86d, 0x1f5fdee6, 0x37c836c2, 0x3796a996, 0x1fb7575c, 0x20bbe7d8, 0x36fecd0e, + 0x36cb1e2a, 0x21122240, 0x2212e492, 0x362ce855, 0x35f71fb1, 0x2267d3a0, 0x2364a02e, 0x3552a8f4, + 0x351acedd, 0x23b836ca, 0x24b0e699, 0x34703095, 0x34364da6, 0x250317df, 0x25f78497, 0x3385a222, + 0x3349bf48, 0x264843d9, 0x273847c8, 0x329321c7, 0x32554840, 0x27878893, 0x2872feb6, 0x3198d4ea, + 0x31590e3e, 0x28c0b4d2, 0x29a778db, 0x3096e223, 0x30553828, 0x29f3984c, 0x2ad586a3, 0x2f8d713a, + 0x2f49ee0f, 0x2b2003ac, 0x2bfcf97c, 0x2e7cab1c, 0x2e37592c, 0x2c45c8a0, 0x2d1da3d5, 0x2d64b9da, + /* 1024 */ + 0x3fffffb1, 0x0006487f, 0x002bfb74, 0x3ffff0e3, 0x3fffe705, 0x00388c6e, 0x005e3f4c, 0x3fffba9b, + 0x3fffa6de, 0x006ad03b, 0x009082ea, 0x3fff5cd8, 0x3fff3f3c, 0x009d13c5, 0x00c2c62f, 0x3ffed79b, + 0x3ffeb021, 0x00cf56ef, 0x00f508fc, 0x3ffe2ae5, 0x3ffdf98c, 0x01019998, 0x01274b31, 0x3ffd56b5, + 0x3ffd1b7e, 0x0133dba3, 0x01598cb1, 0x3ffc5b0c, 0x3ffc15f7, 0x01661cf0, 0x018bcd5b, 0x3ffb37ec, + 0x3ffae8f9, 0x01985d60, 0x01be0d11, 0x3ff9ed53, 0x3ff99483, 0x01ca9cd4, 0x01f04bb4, 0x3ff87b44, + 0x3ff81896, 0x01fcdb2e, 0x02228924, 0x3ff6e1bf, 0x3ff67534, 0x022f184d, 0x0254c544, 0x3ff520c5, + 0x3ff4aa5d, 0x02615414, 0x0286fff3, 0x3ff33858, 0x3ff2b813, 0x02938e62, 0x02b93914, 0x3ff12878, + 0x3ff09e56, 0x02c5c71a, 0x02eb7086, 0x3feef126, 0x3fee5d28, 0x02f7fe1c, 0x031da62b, 0x3fec9265, + 0x3febf48b, 0x032a3349, 0x034fd9e5, 0x3fea0c35, 0x3fe96480, 0x035c6682, 0x03820b93, 0x3fe75e98, + 0x3fe6ad08, 0x038e97a9, 0x03b43b17, 0x3fe48990, 0x3fe3ce26, 0x03c0c69e, 0x03e66852, 0x3fe18d1f, + 0x3fe0c7da, 0x03f2f342, 0x04189326, 0x3fde6945, 0x3fdd9a27, 0x04251d77, 0x044abb73, 0x3fdb1e06, + 0x3fda450f, 0x0457451d, 0x047ce11a, 0x3fd7ab64, 0x3fd6c894, 0x04896a16, 0x04af03fc, 0x3fd4115f, + 0x3fd324b7, 0x04bb8c42, 0x04e123fa, 0x3fd04ffc, 0x3fcf597c, 0x04edab83, 0x051340f6, 0x3fcc673b, + 0x3fcb66e4, 0x051fc7b9, 0x05455ad1, 0x3fc8571f, 0x3fc74cf3, 0x0551e0c7, 0x0577716b, 0x3fc41fac, + 0x3fc30baa, 0x0583f68c, 0x05a984a6, 0x3fbfc0e3, 0x3fbea30c, 0x05b608eb, 0x05db9463, 0x3fbb3ac7, + 0x3fba131b, 0x05e817c3, 0x060da083, 0x3fb68d5b, 0x3fb55bdc, 0x061a22f7, 0x063fa8e7, 0x3fb1b8a2, + 0x3fb07d50, 0x064c2a67, 0x0671ad71, 0x3facbc9f, 0x3fab777b, 0x067e2df5, 0x06a3ae00, 0x3fa79954, + 0x3fa64a5f, 0x06b02d81, 0x06d5aa77, 0x3fa24ec6, 0x3fa0f600, 0x06e228ee, 0x0707a2b7, 0x3f9cdcf7, + 0x3f9b7a62, 0x0714201b, 0x073996a1, 0x3f9743eb, 0x3f95d787, 0x074612eb, 0x076b8616, 0x3f9183a5, + 0x3f900d72, 0x0778013d, 0x079d70f7, 0x3f8b9c28, 0x3f8a1c29, 0x07a9eaf5, 0x07cf5726, 0x3f858d79, + 0x3f8403ae, 0x07dbcff2, 0x08013883, 0x3f7f579b, 0x3f7dc405, 0x080db016, 0x083314f1, 0x3f78fa92, + 0x3f775d31, 0x083f8b43, 0x0864ec4f, 0x3f727661, 0x3f70cf38, 0x08716159, 0x0896be80, 0x3f6bcb0e, + 0x3f6a1a1c, 0x08a3323a, 0x08c88b65, 0x3f64f89b, 0x3f633de2, 0x08d4fdc6, 0x08fa52de, 0x3f5dff0e, + 0x3f5c3a8f, 0x0906c3e0, 0x092c14ce, 0x3f56de6a, 0x3f551026, 0x09388469, 0x095dd116, 0x3f4f96b4, + 0x3f4dbeac, 0x096a3f42, 0x098f8796, 0x3f4827f0, 0x3f464626, 0x099bf44c, 0x09c13831, 0x3f409223, + 0x3f3ea697, 0x09cda368, 0x09f2e2c7, 0x3f38d552, 0x3f36e006, 0x09ff4c78, 0x0a24873a, 0x3f30f181, + 0x3f2ef276, 0x0a30ef5e, 0x0a56256c, 0x3f28e6b6, 0x3f26ddec, 0x0a628bfa, 0x0a87bd3d, 0x3f20b4f5, + 0x3f1ea26e, 0x0a94222f, 0x0ab94e8f, 0x3f185c43, 0x3f164001, 0x0ac5b1dc, 0x0aead944, 0x3f0fdca5, + 0x3f0db6a9, 0x0af73ae5, 0x0b1c5d3d, 0x3f073621, 0x3f05066d, 0x0b28bd2a, 0x0b4dda5c, 0x3efe68bc, + 0x3efc2f50, 0x0b5a388d, 0x0b7f5081, 0x3ef5747b, 0x3ef3315a, 0x0b8bacf0, 0x0bb0bf8f, 0x3eec5965, + 0x3eea0c8e, 0x0bbd1a33, 0x0be22766, 0x3ee3177e, 0x3ee0c0f4, 0x0bee8038, 0x0c1387e9, 0x3ed9aecc, + 0x3ed74e91, 0x0c1fdee1, 0x0c44e0f9, 0x3ed01f55, 0x3ecdb56a, 0x0c513610, 0x0c763278, 0x3ec66920, + 0x3ec3f585, 0x0c8285a5, 0x0ca77c47, 0x3ebc8c31, 0x3eba0ee9, 0x0cb3cd84, 0x0cd8be47, 0x3eb2888f, + 0x3eb0019c, 0x0ce50d8c, 0x0d09f85b, 0x3ea85e41, 0x3ea5cda3, 0x0d1645a0, 0x0d3b2a64, 0x3e9e0d4c, + 0x3e9b7306, 0x0d4775a1, 0x0d6c5443, 0x3e9395b7, 0x3e90f1ca, 0x0d789d71, 0x0d9d75db, 0x3e88f788, + 0x3e8649f5, 0x0da9bcf2, 0x0dce8f0d, 0x3e7e32c6, 0x3e7b7b90, 0x0ddad406, 0x0dff9fba, 0x3e734778, + 0x3e70869f, 0x0e0be28e, 0x0e30a7c5, 0x3e6835a4, 0x3e656b2b, 0x0e3ce86b, 0x0e61a70f, 0x3e5cfd51, + 0x3e5a2939, 0x0e6de580, 0x0e929d7a, 0x3e519e86, 0x3e4ec0d1, 0x0e9ed9af, 0x0ec38ae8, 0x3e46194a, + 0x3e4331fa, 0x0ecfc4d9, 0x0ef46f3b, 0x3e3a6da4, 0x3e377cbb, 0x0f00a6df, 0x0f254a53, 0x3e2e9b9c, + 0x3e2ba11b, 0x0f317fa5, 0x0f561c15, 0x3e22a338, 0x3e1f9f21, 0x0f624f0c, 0x0f86e460, 0x3e168480, + 0x3e1376d5, 0x0f9314f5, 0x0fb7a317, 0x3e0a3f7b, 0x3e07283f, 0x0fc3d143, 0x0fe8581d, 0x3dfdd432, + 0x3dfab365, 0x0ff483d7, 0x10190352, 0x3df142ab, 0x3dee1851, 0x10252c94, 0x1049a49a, 0x3de48aef, + 0x3de15708, 0x1055cb5b, 0x107a3bd5, 0x3dd7ad05, 0x3dd46f94, 0x1086600e, 0x10aac8e6, 0x3dcaa8f5, + 0x3dc761fc, 0x10b6ea90, 0x10db4baf, 0x3dbd7ec7, 0x3dba2e48, 0x10e76ac3, 0x110bc413, 0x3db02e84, + 0x3dacd481, 0x1117e088, 0x113c31f3, 0x3da2b834, 0x3d9f54af, 0x11484bc2, 0x116c9531, 0x3d951bde, + 0x3d91aed9, 0x1178ac53, 0x119cedaf, 0x3d87598c, 0x3d83e309, 0x11a9021d, 0x11cd3b50, 0x3d797145, + 0x3d75f147, 0x11d94d02, 0x11fd7df6, 0x3d6b6313, 0x3d67d99b, 0x12098ce5, 0x122db583, 0x3d5d2efe, + 0x3d599c0e, 0x1239c1a7, 0x125de1da, 0x3d4ed50f, 0x3d4b38aa, 0x1269eb2b, 0x128e02dc, 0x3d40554e, + 0x3d3caf76, 0x129a0954, 0x12be186c, 0x3d31afc5, 0x3d2e007c, 0x12ca1c03, 0x12ee226c, 0x3d22e47c, + 0x3d1f2bc5, 0x12fa231b, 0x131e20c0, 0x3d13f37e, 0x3d10315a, 0x132a1e7e, 0x134e1348, 0x3d04dcd2, + 0x3d011145, 0x135a0e0e, 0x137df9e7, 0x3cf5a082, 0x3cf1cb8e, 0x1389f1af, 0x13add481, 0x3ce63e98, + 0x3ce2603f, 0x13b9c943, 0x13dda2f7, 0x3cd6b71e, 0x3cd2cf62, 0x13e994ab, 0x140d652c, 0x3cc70a1c, + 0x3cc318ff, 0x141953cb, 0x143d1b02, 0x3cb7379c, 0x3cb33d22, 0x14490685, 0x146cc45c, 0x3ca73fa9, + 0x3ca33bd3, 0x1478acbc, 0x149c611d, 0x3c97224c, 0x3c93151d, 0x14a84652, 0x14cbf127, 0x3c86df8e, + 0x3c82c909, 0x14d7d32a, 0x14fb745e, 0x3c76777b, 0x3c7257a2, 0x15075327, 0x152aeaa3, 0x3c65ea1c, + 0x3c61c0f1, 0x1536c62b, 0x155a53d9, 0x3c55377b, 0x3c510501, 0x15662c18, 0x1589afe3, 0x3c445fa2, + 0x3c4023dd, 0x159584d3, 0x15b8fea4, 0x3c33629d, 0x3c2f1d8e, 0x15c4d03e, 0x15e83fff, 0x3c224075, + 0x3c1df21f, 0x15f40e3a, 0x161773d6, 0x3c10f935, 0x3c0ca19b, 0x16233eac, 0x16469a0d, 0x3bff8ce8, + 0x3bfb2c0c, 0x16526176, 0x1675b286, 0x3bedfb99, 0x3be9917e, 0x1681767c, 0x16a4bd25, 0x3bdc4552, + 0x3bd7d1fa, 0x16b07d9f, 0x16d3b9cc, 0x3bca6a1d, 0x3bc5ed8d, 0x16df76c3, 0x1702a85e, 0x3bb86a08, + 0x3bb3e440, 0x170e61cc, 0x173188be, 0x3ba6451b, 0x3ba1b620, 0x173d3e9b, 0x17605ad0, 0x3b93fb63, + 0x3b8f6337, 0x176c0d15, 0x178f1e76, 0x3b818ceb, 0x3b7ceb90, 0x179acd1c, 0x17bdd394, 0x3b6ef9be, + 0x3b6a4f38, 0x17c97e93, 0x17ec7a0d, 0x3b5c41e8, 0x3b578e39, 0x17f8215e, 0x181b11c4, 0x3b496574, + 0x3b44a8a0, 0x1826b561, 0x18499a9d, 0x3b36646e, 0x3b319e77, 0x18553a7d, 0x1878147a, 0x3b233ee1, + 0x3b1e6fca, 0x1883b097, 0x18a67f3f, 0x3b0ff4d9, 0x3b0b1ca6, 0x18b21791, 0x18d4dad0, 0x3afc8663, + 0x3af7a516, 0x18e06f50, 0x1903270f, 0x3ae8f38b, 0x3ae40926, 0x190eb7b7, 0x193163e1, 0x3ad53c5b, + 0x3ad048e3, 0x193cf0a9, 0x195f9128, 0x3ac160e1, 0x3abc6458, 0x196b1a09, 0x198daec8, 0x3aad6129, + 0x3aa85b92, 0x199933bb, 0x19bbbca6, 0x3a993d3e, 0x3a942e9d, 0x19c73da3, 0x19e9baa3, 0x3a84f52f, + 0x3a7fdd86, 0x19f537a4, 0x1a17a8a5, 0x3a708906, 0x3a6b6859, 0x1a2321a2, 0x1a45868e, 0x3a5bf8d1, + 0x3a56cf23, 0x1a50fb81, 0x1a735442, 0x3a47449c, 0x3a4211f0, 0x1a7ec524, 0x1aa111a6, 0x3a326c74, + 0x3a2d30cd, 0x1aac7e6f, 0x1acebe9d, 0x3a1d7066, 0x3a182bc8, 0x1ada2746, 0x1afc5b0a, 0x3a08507f, + 0x3a0302ed, 0x1b07bf8c, 0x1b29e6d2, 0x39f30ccc, 0x39edb649, 0x1b354727, 0x1b5761d8, 0x39dda55a, + 0x39d845e9, 0x1b62bdf8, 0x1b84cc01, 0x39c81a36, 0x39c2b1da, 0x1b9023e5, 0x1bb22530, 0x39b26b6d, + 0x39acfa2b, 0x1bbd78d2, 0x1bdf6d4a, 0x399c990d, 0x39971ee7, 0x1beabca1, 0x1c0ca432, 0x3986a324, + 0x3981201e, 0x1c17ef39, 0x1c39c9cd, 0x397089bf, 0x396afddc, 0x1c45107c, 0x1c66ddfe, 0x395a4ceb, + 0x3954b82e, 0x1c72204f, 0x1c93e0ab, 0x3943ecb6, 0x393e4f23, 0x1c9f1e96, 0x1cc0d1b6, 0x392d692f, + 0x3927c2c9, 0x1ccc0b35, 0x1cedb106, 0x3916c262, 0x3911132d, 0x1cf8e611, 0x1d1a7e7d, 0x38fff85e, + 0x38fa405e, 0x1d25af0d, 0x1d473a00, 0x38e90b31, 0x38e34a69, 0x1d52660f, 0x1d73e374, 0x38d1fae9, + 0x38cc315d, 0x1d7f0afb, 0x1da07abc, 0x38bac795, 0x38b4f547, 0x1dab9db5, 0x1dccffbf, 0x38a37142, + 0x389d9637, 0x1dd81e21, 0x1df9725f, 0x388bf7ff, 0x3886143b, 0x1e048c24, 0x1e25d282, 0x38745bdb, + 0x386e6f60, 0x1e30e7a4, 0x1e52200c, 0x385c9ce3, 0x3856a7b6, 0x1e5d3084, 0x1e7e5ae2, 0x3844bb28, + 0x383ebd4c, 0x1e8966a8, 0x1eaa82e9, 0x382cb6b7, 0x3826b030, 0x1eb589f7, 0x1ed69805, 0x38148f9f, + 0x380e8071, 0x1ee19a54, 0x1f029a1c, 0x37fc45ef, 0x37f62e1d, 0x1f0d97a5, 0x1f2e8911, 0x37e3d9b7, + 0x37ddb945, 0x1f3981ce, 0x1f5a64cb, 0x37cb4b04, 0x37c521f6, 0x1f6558b5, 0x1f862d2d, 0x37b299e7, + 0x37ac6841, 0x1f911c3d, 0x1fb1e21d, 0x3799c66f, 0x37938c34, 0x1fbccc4d, 0x1fdd8381, 0x3780d0aa, + 0x377a8ddf, 0x1fe868c8, 0x2009113c, 0x3767b8a9, 0x37616d51, 0x2013f196, 0x20348b35, 0x374e7e7b, + 0x37482a9a, 0x203f6699, 0x205ff14f, 0x3735222f, 0x372ec5c9, 0x206ac7b8, 0x208b4372, 0x371ba3d4, + 0x37153eee, 0x209614d9, 0x20b68181, 0x3702037c, 0x36fb9618, 0x20c14ddf, 0x20e1ab63, 0x36e84135, + 0x36e1cb58, 0x20ec72b1, 0x210cc0fc, 0x36ce5d10, 0x36c7debd, 0x21178334, 0x2137c232, 0x36b4571b, + 0x36add058, 0x21427f4d, 0x2162aeea, 0x369a2f69, 0x3693a038, 0x216d66e2, 0x218d870b, 0x367fe608, + 0x36794e6e, 0x219839d8, 0x21b84a79, 0x36657b08, 0x365edb09, 0x21c2f815, 0x21e2f91a, 0x364aee7b, + 0x3644461b, 0x21eda17f, 0x220d92d4, 0x36304070, 0x36298fb4, 0x221835fb, 0x2238178d, 0x361570f8, + 0x360eb7e3, 0x2242b56f, 0x22628729, 0x35fa8023, 0x35f3beba, 0x226d1fc1, 0x228ce191, 0x35df6e03, + 0x35d8a449, 0x229774d7, 0x22b726a8, 0x35c43aa7, 0x35bd68a1, 0x22c1b496, 0x22e15655, 0x35a8e621, + 0x35a20bd3, 0x22ebdee5, 0x230b707e, 0x358d7081, 0x35868def, 0x2315f3a8, 0x23357509, 0x3571d9d9, + 0x356aef08, 0x233ff2c8, 0x235f63dc, 0x35562239, 0x354f2f2c, 0x2369dc29, 0x23893cdd, 0x353a49b2, + 0x35334e6f, 0x2393afb2, 0x23b2fff3, 0x351e5056, 0x35174ce0, 0x23bd6d48, 0x23dcad03, 0x35023636, + 0x34fb2a92, 0x23e714d3, 0x240643f4, 0x34e5fb63, 0x34dee795, 0x2410a639, 0x242fc4ad, 0x34c99fef, + 0x34c283fb, 0x243a215f, 0x24592f13, 0x34ad23eb, 0x34a5ffd5, 0x2463862c, 0x2482830d, 0x34908768, + 0x34895b36, 0x248cd487, 0x24abc082, 0x3473ca79, 0x346c962f, 0x24b60c57, 0x24d4e757, 0x3456ed2f, + 0x344fb0d1, 0x24df2d81, 0x24fdf775, 0x3439ef9c, 0x3432ab2e, 0x250837ed, 0x2526f0c1, 0x341cd1d2, + 0x34158559, 0x25312b81, 0x254fd323, 0x33ff93e2, 0x33f83f62, 0x255a0823, 0x25789e80, 0x33e235df, + 0x33dad95e, 0x2582cdbc, 0x25a152c0, 0x33c4b7db, 0x33bd535c, 0x25ab7c30, 0x25c9efca, 0x33a719e8, + 0x339fad70, 0x25d41369, 0x25f27584, 0x33895c18, 0x3381e7ac, 0x25fc934b, 0x261ae3d6, 0x336b7e7e, + 0x33640223, 0x2624fbbf, 0x26433aa7, 0x334d812d, 0x3345fce6, 0x264d4cac, 0x266b79dd, 0x332f6435, + 0x3327d808, 0x267585f8, 0x2693a161, 0x331127ab, 0x3309939c, 0x269da78b, 0x26bbb119, 0x32f2cba1, + 0x32eb2fb5, 0x26c5b14c, 0x26e3a8ec, 0x32d45029, 0x32ccac64, 0x26eda322, 0x270b88c2, 0x32b5b557, + 0x32ae09be, 0x27157cf5, 0x27335082, 0x3296fb3d, 0x328f47d5, 0x273d3eac, 0x275b0014, 0x327821ee, + 0x327066bc, 0x2764e82f, 0x27829760, 0x3259297d, 0x32516686, 0x278c7965, 0x27aa164c, 0x323a11fe, + 0x32324746, 0x27b3f235, 0x27d17cc1, 0x321adb83, 0x3213090f, 0x27db5288, 0x27f8caa5, 0x31fb8620, + 0x31f3abf5, 0x28029a45, 0x281fffe2, 0x31dc11e8, 0x31d4300b, 0x2829c954, 0x28471c5e, 0x31bc7eee, + 0x31b49564, 0x2850df9d, 0x286e2002, 0x319ccd46, 0x3194dc14, 0x2877dd07, 0x28950ab6, 0x317cfd04, + 0x3175042e, 0x289ec17a, 0x28bbdc61, 0x315d0e3b, 0x31550dc6, 0x28c58cdf, 0x28e294eb, 0x313d00ff, + 0x3134f8f1, 0x28ec3f1e, 0x2909343e, 0x311cd564, 0x3114c5c0, 0x2912d81f, 0x292fba40, 0x30fc8b7d, + 0x30f47449, 0x293957c9, 0x295626da, 0x30dc235e, 0x30d404a0, 0x295fbe06, 0x297c79f5, 0x30bb9d1c, + 0x30b376d8, 0x29860abd, 0x29a2b378, 0x309af8ca, 0x3092cb05, 0x29ac3dd7, 0x29c8d34d, 0x307a367c, + 0x3072013c, 0x29d2573c, 0x29eed95b, 0x30595648, 0x30511991, 0x29f856d5, 0x2a14c58b, 0x30385840, + 0x30301418, 0x2a1e3c8a, 0x2a3a97c7, 0x30173c7a, 0x300ef0e5, 0x2a440844, 0x2a604ff5, 0x2ff6030a, + 0x2fedb00d, 0x2a69b9ec, 0x2a85ee00, 0x2fd4ac04, 0x2fcc51a5, 0x2a8f516b, 0x2aab71d0, 0x2fb3377c, + 0x2faad5c1, 0x2ab4cea9, 0x2ad0db4e, 0x2f91a589, 0x2f893c75, 0x2ada318e, 0x2af62a63, 0x2f6ff63d, + 0x2f6785d7, 0x2aff7a05, 0x2b1b5ef8, 0x2f4e29af, 0x2f45b1fb, 0x2b24a7f6, 0x2b4078f5, 0x2f2c3ff2, + 0x2f23c0f6, 0x2b49bb4a, 0x2b657844, 0x2f0a391d, 0x2f01b2de, 0x2b6eb3ea, 0x2b8a5cce, 0x2ee81543, + 0x2edf87c6, 0x2b9391c0, 0x2baf267d, 0x2ec5d479, 0x2ebd3fc4, 0x2bb854b4, 0x2bd3d53a, 0x2ea376d6, + 0x2e9adaee, 0x2bdcfcb0, 0x2bf868ed, 0x2e80fc6e, 0x2e785958, 0x2c01899e, 0x2c1ce181, 0x2e5e6556, + 0x2e55bb17, 0x2c25fb66, 0x2c413edf, 0x2e3bb1a4, 0x2e330042, 0x2c4a51f3, 0x2c6580f1, 0x2e18e16d, + 0x2e1028ed, 0x2c6e8d2e, 0x2c89a79f, 0x2df5f4c7, 0x2ded352f, 0x2c92ad01, 0x2cadb2d5, 0x2dd2ebc7, + 0x2dca251c, 0x2cb6b155, 0x2cd1a27b, 0x2dafc683, 0x2da6f8ca, 0x2cda9a14, 0x2cf5767c, 0x2d8c8510, + 0x2d83b04f, 0x2cfe6728, 0x2d192ec1, 0x2d692784, 0x2d604bc0, 0x2d22187a, 0x2d3ccb34, 0x2d45adf6 +}; + +const int twidTab512[8*6 + 32*6 + 128*6] = { + 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3b20d79e, 0x187de2a6, + 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, + 0x187de2a6, 0x3b20d79e, 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, + 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xe7821d5a, 0x3b20d79e, + 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, + 0xc4df2862, 0xe7821d5a, 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, + + 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3fb11b47, 0x0645e9af, + 0x3fec43c6, 0x0323ecbe, 0x3f4eaafe, 0x09640837, 0x3ec52f9f, 0x0c7c5c1e, 0x3fb11b47, 0x0645e9af, + 0x3d3e82ad, 0x1294062e, 0x3d3e82ad, 0x1294062e, 0x3f4eaafe, 0x09640837, 0x39daf5e8, 0x1b5d1009, + 0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x387165e3, 0x1e2b5d38, + 0x3e14fdf7, 0x0f8cfcbd, 0x2f6bbe44, 0x2afad269, 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, + 0x2899e64a, 0x317900d6, 0x317900d6, 0x2899e64a, 0x3c424209, 0x158f9a75, 0x20e70f32, 0x36e5068a, + 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x2899e64a, 0x317900d6, + 0x39daf5e8, 0x1b5d1009, 0x0f8cfcbd, 0x3e14fdf7, 0x238e7673, 0x3536cc52, 0x387165e3, 0x1e2b5d38, + 0x0645e9af, 0x3fb11b47, 0x1e2b5d38, 0x387165e3, 0x36e5068a, 0x20e70f32, 0xfcdc1342, 0x3fec43c6, + 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, 0x1294062e, 0x3d3e82ad, + 0x3367c08f, 0x261feff9, 0xea70658b, 0x3c424209, 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, + 0xe1d4a2c8, 0x387165e3, 0x0645e9af, 0x3fb11b47, 0x2f6bbe44, 0x2afad269, 0xd9e01007, 0x3367c08f, + 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xf9ba1651, 0x3fb11b47, + 0x2afad269, 0x2f6bbe44, 0xcc983f71, 0x261feff9, 0xf383a3e2, 0x3ec52f9f, 0x2899e64a, 0x317900d6, + 0xc78e9a1d, 0x1e2b5d38, 0xed6bf9d2, 0x3d3e82ad, 0x261feff9, 0x3367c08f, 0xc3bdbdf7, 0x158f9a75, + 0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xe1d4a2c8, 0x387165e3, + 0x20e70f32, 0x36e5068a, 0xc013bc3a, 0x0323ecbe, 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, + 0xc04ee4b9, 0xf9ba1651, 0xd76619b6, 0x317900d6, 0x1b5d1009, 0x39daf5e8, 0xc1eb0209, 0xf0730343, + 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xce86ff2a, 0x2899e64a, + 0x158f9a75, 0x3c424209, 0xc91af976, 0xdf18f0ce, 0xcac933ae, 0x238e7673, 0x1294062e, 0x3d3e82ad, + 0xce86ff2a, 0xd76619b6, 0xc78e9a1d, 0x1e2b5d38, 0x0f8cfcbd, 0x3e14fdf7, 0xd5052d97, 0xd09441bc, + 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, 0xc2c17d53, 0x1294062e, + 0x09640837, 0x3f4eaafe, 0xe4a2eff7, 0xc6250a18, 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, + 0xed6bf9d2, 0xc2c17d53, 0xc04ee4b9, 0x0645e9af, 0x0323ecbe, 0x3fec43c6, 0xf69bf7c9, 0xc0b15502, + + 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3ffb10c1, 0x0192155f, + 0x3ffec42d, 0x00c90e8f, 0x3ff4e5df, 0x025b0cae, 0x3fec43c6, 0x0323ecbe, 0x3ffb10c1, 0x0192155f, + 0x3fd39b5a, 0x04b54824, 0x3fd39b5a, 0x04b54824, 0x3ff4e5df, 0x025b0cae, 0x3f9c2bfa, 0x070de171, + 0x3fb11b47, 0x0645e9af, 0x3fec43c6, 0x0323ecbe, 0x3f4eaafe, 0x09640837, 0x3f84c8e1, 0x07d59395, + 0x3fe12acb, 0x03ecadcf, 0x3eeb3347, 0x0bb6ecef, 0x3f4eaafe, 0x09640837, 0x3fd39b5a, 0x04b54824, + 0x3e71e758, 0x0e05c135, 0x3f0ec9f4, 0x0af10a22, 0x3fc395f9, 0x057db402, 0x3de2f147, 0x104fb80e, + 0x3ec52f9f, 0x0c7c5c1e, 0x3fb11b47, 0x0645e9af, 0x3d3e82ad, 0x1294062e, 0x3e71e758, 0x0e05c135, + 0x3f9c2bfa, 0x070de171, 0x3c84d496, 0x14d1e242, 0x3e14fdf7, 0x0f8cfcbd, 0x3f84c8e1, 0x07d59395, + 0x3bb6276d, 0x17088530, 0x3dae81ce, 0x1111d262, 0x3f6af2e3, 0x089cf867, 0x3ad2c2e7, 0x19372a63, + 0x3d3e82ad, 0x1294062e, 0x3f4eaafe, 0x09640837, 0x39daf5e8, 0x1b5d1009, 0x3cc511d8, 0x14135c94, + 0x3f2ff249, 0x0a2abb58, 0x38cf1669, 0x1d79775b, 0x3c424209, 0x158f9a75, 0x3f0ec9f4, 0x0af10a22, + 0x37af8158, 0x1f8ba4db, 0x3bb6276d, 0x17088530, 0x3eeb3347, 0x0bb6ecef, 0x367c9a7d, 0x2192e09a, + 0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x3a8269a2, 0x19ef7943, + 0x3e9cc076, 0x0d415012, 0x33de87de, 0x257db64b, 0x39daf5e8, 0x1b5d1009, 0x3e71e758, 0x0e05c135, + 0x32744493, 0x275ff452, 0x392a9642, 0x1cc66e99, 0x3e44a5ee, 0x0ec9a7f2, 0x30f8801f, 0x29348937, + 0x387165e3, 0x1e2b5d38, 0x3e14fdf7, 0x0f8cfcbd, 0x2f6bbe44, 0x2afad269, 0x37af8158, 0x1f8ba4db, + 0x3de2f147, 0x104fb80e, 0x2dce88a9, 0x2cb2324b, 0x36e5068a, 0x20e70f32, 0x3dae81ce, 0x1111d262, + 0x2c216eaa, 0x2e5a106f, 0x361214b0, 0x223d66a8, 0x3d77b191, 0x11d3443f, 0x2a650525, 0x2ff1d9c6, + 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, 0x2899e64a, 0x317900d6, 0x34534f40, 0x24da0a99, + 0x3d02f756, 0x135410c2, 0x26c0b162, 0x32eefde9, 0x3367c08f, 0x261feff9, 0x3cc511d8, 0x14135c94, + 0x24da0a99, 0x34534f40, 0x32744493, 0x275ff452, 0x3c84d496, 0x14d1e242, 0x22e69ac7, 0x35a5793c, + 0x317900d6, 0x2899e64a, 0x3c424209, 0x158f9a75, 0x20e70f32, 0x36e5068a, 0x30761c17, 0x29cd9577, + 0x3bfd5cc4, 0x164c7ddd, 0x1edc1952, 0x3811884c, 0x2f6bbe44, 0x2afad269, 0x3bb6276d, 0x17088530, + 0x1cc66e99, 0x392a9642, 0x2e5a106f, 0x2c216eaa, 0x3b6ca4c4, 0x17c3a931, 0x1aa6c82b, 0x3a2fcee8, + 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x2c216eaa, 0x2e5a106f, + 0x3ad2c2e7, 0x19372a63, 0x164c7ddd, 0x3bfd5cc4, 0x2afad269, 0x2f6bbe44, 0x3a8269a2, 0x19ef7943, + 0x14135c94, 0x3cc511d8, 0x29cd9577, 0x30761c17, 0x3a2fcee8, 0x1aa6c82b, 0x11d3443f, 0x3d77b191, + 0x2899e64a, 0x317900d6, 0x39daf5e8, 0x1b5d1009, 0x0f8cfcbd, 0x3e14fdf7, 0x275ff452, 0x32744493, + 0x3983e1e7, 0x1c1249d8, 0x0d415012, 0x3e9cc076, 0x261feff9, 0x3367c08f, 0x392a9642, 0x1cc66e99, + 0x0af10a22, 0x3f0ec9f4, 0x24da0a99, 0x34534f40, 0x38cf1669, 0x1d79775b, 0x089cf867, 0x3f6af2e3, + 0x238e7673, 0x3536cc52, 0x387165e3, 0x1e2b5d38, 0x0645e9af, 0x3fb11b47, 0x223d66a8, 0x361214b0, + 0x3811884c, 0x1edc1952, 0x03ecadcf, 0x3fe12acb, 0x20e70f32, 0x36e5068a, 0x37af8158, 0x1f8ba4db, + 0x0192155f, 0x3ffb10c1, 0x1f8ba4db, 0x37af8158, 0x374b54ce, 0x2039f90e, 0xff36f171, 0x3ffec42d, + 0x1e2b5d38, 0x387165e3, 0x36e5068a, 0x20e70f32, 0xfcdc1342, 0x3fec43c6, 0x1cc66e99, 0x392a9642, + 0x367c9a7d, 0x2192e09a, 0xfa824bfe, 0x3fc395f9, 0x1b5d1009, 0x39daf5e8, 0x361214b0, 0x223d66a8, + 0xf82a6c6b, 0x3f84c8e1, 0x19ef7943, 0x3a8269a2, 0x35a5793c, 0x22e69ac7, 0xf5d544a8, 0x3f2ff249, + 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, 0x17088530, 0x3bb6276d, + 0x34c61236, 0x2434f332, 0xf136580e, 0x3e44a5ee, 0x158f9a75, 0x3c424209, 0x34534f40, 0x24da0a99, + 0xeeee2d9e, 0x3dae81ce, 0x14135c94, 0x3cc511d8, 0x33de87de, 0x257db64b, 0xecabef3e, 0x3d02f756, + 0x1294062e, 0x3d3e82ad, 0x3367c08f, 0x261feff9, 0xea70658b, 0x3c424209, 0x1111d262, 0x3dae81ce, + 0x32eefde9, 0x26c0b162, 0xe83c56cf, 0x3b6ca4c4, 0x0f8cfcbd, 0x3e14fdf7, 0x32744493, 0x275ff452, + 0xe61086bd, 0x3a8269a2, 0x0e05c135, 0x3e71e758, 0x31f79947, 0x27fdb2a6, 0xe3edb628, 0x3983e1e7, + 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, 0xe1d4a2c8, 0x387165e3, 0x0af10a22, 0x3f0ec9f4, + 0x30f8801f, 0x29348937, 0xdfc606f2, 0x374b54ce, 0x09640837, 0x3f4eaafe, 0x30761c17, 0x29cd9577, + 0xddc29958, 0x361214b0, 0x07d59395, 0x3f84c8e1, 0x2ff1d9c6, 0x2a650525, 0xdbcb0cce, 0x34c61236, + 0x0645e9af, 0x3fb11b47, 0x2f6bbe44, 0x2afad269, 0xd9e01007, 0x3367c08f, 0x04b54824, 0x3fd39b5a, + 0x2ee3cebe, 0x2b8ef77c, 0xd8024d5a, 0x31f79947, 0x0323ecbe, 0x3fec43c6, 0x2e5a106f, 0x2c216eaa, + 0xd6326a89, 0x30761c17, 0x0192155f, 0x3ffb10c1, 0x2dce88a9, 0x2cb2324b, 0xd4710884, 0x2ee3cebe, + 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xfe6deaa1, 0x3ffb10c1, + 0x2cb2324b, 0x2dce88a9, 0xd11c3142, 0x2b8ef77c, 0xfcdc1342, 0x3fec43c6, 0x2c216eaa, 0x2e5a106f, + 0xcf89e3e9, 0x29cd9577, 0xfb4ab7dc, 0x3fd39b5a, 0x2b8ef77c, 0x2ee3cebe, 0xce0866b9, 0x27fdb2a6, + 0xf9ba1651, 0x3fb11b47, 0x2afad269, 0x2f6bbe44, 0xcc983f71, 0x261feff9, 0xf82a6c6b, 0x3f84c8e1, + 0x2a650525, 0x2ff1d9c6, 0xcb39edca, 0x2434f332, 0xf69bf7c9, 0x3f4eaafe, 0x29cd9577, 0x30761c17, + 0xc9edeb50, 0x223d66a8, 0xf50ef5de, 0x3f0ec9f4, 0x29348937, 0x30f8801f, 0xc8b4ab32, 0x2039f90e, + 0xf383a3e2, 0x3ec52f9f, 0x2899e64a, 0x317900d6, 0xc78e9a1d, 0x1e2b5d38, 0xf1fa3ecb, 0x3e71e758, + 0x27fdb2a6, 0x31f79947, 0xc67c1e19, 0x1c1249d8, 0xf0730343, 0x3e14fdf7, 0x275ff452, 0x32744493, + 0xc57d965e, 0x19ef7943, 0xeeee2d9e, 0x3dae81ce, 0x26c0b162, 0x32eefde9, 0xc4935b3c, 0x17c3a931, + 0xed6bf9d2, 0x3d3e82ad, 0x261feff9, 0x3367c08f, 0xc3bdbdf7, 0x158f9a75, 0xebeca36c, 0x3cc511d8, + 0x257db64b, 0x33de87de, 0xc2fd08aa, 0x135410c2, 0xea70658b, 0x3c424209, 0x24da0a99, 0x34534f40, + 0xc2517e32, 0x1111d262, 0xe8f77ad0, 0x3bb6276d, 0x2434f332, 0x34c61236, 0xc1bb5a12, 0x0ec9a7f2, + 0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xe61086bd, 0x3a8269a2, + 0x22e69ac7, 0x35a5793c, 0xc0d00db7, 0x0a2abb58, 0xe4a2eff7, 0x39daf5e8, 0x223d66a8, 0x361214b0, + 0xc07b371f, 0x07d59395, 0xe3399167, 0x392a9642, 0x2192e09a, 0x367c9a7d, 0xc03c6a07, 0x057db402, + 0xe1d4a2c8, 0x387165e3, 0x20e70f32, 0x36e5068a, 0xc013bc3a, 0x0323ecbe, 0xe0745b25, 0x37af8158, + 0x2039f90e, 0x374b54ce, 0xc0013bd3, 0x00c90e8f, 0xdf18f0ce, 0x36e5068a, 0x1f8ba4db, 0x37af8158, + 0xc004ef3f, 0xfe6deaa1, 0xddc29958, 0x361214b0, 0x1edc1952, 0x3811884c, 0xc01ed535, 0xfc135231, + 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, 0xc04ee4b9, 0xf9ba1651, 0xdb25f567, 0x34534f40, + 0x1d79775b, 0x38cf1669, 0xc0950d1d, 0xf7630799, 0xd9e01007, 0x3367c08f, 0x1cc66e99, 0x392a9642, + 0xc0f1360c, 0xf50ef5de, 0xd8a00bae, 0x32744493, 0x1c1249d8, 0x3983e1e7, 0xc1633f8a, 0xf2beafee, + 0xd76619b6, 0x317900d6, 0x1b5d1009, 0x39daf5e8, 0xc1eb0209, 0xf0730343, 0xd6326a89, 0x30761c17, + 0x1aa6c82b, 0x3a2fcee8, 0xc2884e6f, 0xee2cbbc1, 0xd5052d97, 0x2f6bbe44, 0x19ef7943, 0x3a8269a2, + 0xc33aee28, 0xebeca36c, 0xd3de9156, 0x2e5a106f, 0x19372a63, 0x3ad2c2e7, 0xc402a33c, 0xe9b38223, + 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xd1a5ef91, 0x2c216eaa, + 0x17c3a931, 0x3b6ca4c4, 0xc5d03118, 0xe55937d5, 0xd09441bc, 0x2afad269, 0x17088530, 0x3bb6276d, + 0xc6d569be, 0xe3399167, 0xcf89e3e9, 0x29cd9577, 0x164c7ddd, 0x3bfd5cc4, 0xc7ee77b4, 0xe123e6ae, + 0xce86ff2a, 0x2899e64a, 0x158f9a75, 0x3c424209, 0xc91af976, 0xdf18f0ce, 0xcd8bbb6d, 0x275ff452, + 0x14d1e242, 0x3c84d496, 0xca5a86c4, 0xdd196539, 0xcc983f71, 0x261feff9, 0x14135c94, 0x3cc511d8, + 0xcbacb0c0, 0xdb25f567, 0xcbacb0c0, 0x24da0a99, 0x135410c2, 0x3d02f756, 0xcd110217, 0xd93f4e9e, + 0xcac933ae, 0x238e7673, 0x1294062e, 0x3d3e82ad, 0xce86ff2a, 0xd76619b6, 0xc9edeb50, 0x223d66a8, + 0x11d3443f, 0x3d77b191, 0xd00e263a, 0xd59afadb, 0xc91af976, 0x20e70f32, 0x1111d262, 0x3dae81ce, + 0xd1a5ef91, 0xd3de9156, 0xc8507ea8, 0x1f8ba4db, 0x104fb80e, 0x3de2f147, 0xd34dcdb5, 0xd2317757, + 0xc78e9a1d, 0x1e2b5d38, 0x0f8cfcbd, 0x3e14fdf7, 0xd5052d97, 0xd09441bc, 0xc6d569be, 0x1cc66e99, + 0x0ec9a7f2, 0x3e44a5ee, 0xd6cb76c9, 0xcf077fe1, 0xc6250a18, 0x1b5d1009, 0x0e05c135, 0x3e71e758, + 0xd8a00bae, 0xcd8bbb6d, 0xc57d965e, 0x19ef7943, 0x0d415012, 0x3e9cc076, 0xda8249b5, 0xcc217822, + 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, 0xc449d893, 0x17088530, + 0x0bb6ecef, 0x3eeb3347, 0xde6d1f66, 0xc9836583, 0xc3bdbdf7, 0x158f9a75, 0x0af10a22, 0x3f0ec9f4, + 0xe0745b25, 0xc8507ea8, 0xc33aee28, 0x14135c94, 0x0a2abb58, 0x3f2ff249, 0xe28688a5, 0xc730e997, + 0xc2c17d53, 0x1294062e, 0x09640837, 0x3f4eaafe, 0xe4a2eff7, 0xc6250a18, 0xc2517e32, 0x1111d262, + 0x089cf867, 0x3f6af2e3, 0xe6c8d59d, 0xc52d3d19, 0xc1eb0209, 0x0f8cfcbd, 0x07d59395, 0x3f84c8e1, + 0xe8f77ad0, 0xc449d893, 0xc18e18a8, 0x0e05c135, 0x070de171, 0x3f9c2bfa, 0xeb2e1dbe, 0xc37b2b6a, + 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, 0xed6bf9d2, 0xc2c17d53, 0xc0f1360c, 0x0af10a22, + 0x057db402, 0x3fc395f9, 0xefb047f2, 0xc21d0eb9, 0xc0b15502, 0x09640837, 0x04b54824, 0x3fd39b5a, + 0xf1fa3ecb, 0xc18e18a8, 0xc07b371f, 0x07d59395, 0x03ecadcf, 0x3fe12acb, 0xf4491311, 0xc114ccb9, + 0xc04ee4b9, 0x0645e9af, 0x0323ecbe, 0x3fec43c6, 0xf69bf7c9, 0xc0b15502, 0xc02c64a6, 0x04b54824, + 0x025b0cae, 0x3ff4e5df, 0xf8f21e8f, 0xc063d406, 0xc013bc3a, 0x0323ecbe, 0x0192155f, 0x3ffb10c1, + 0xfb4ab7dc, 0xc02c64a6, 0xc004ef3f, 0x0192155f, 0x00c90e8f, 0x3ffec42d, 0xfda4f352, 0xc00b1a21 }; -const int twidTab512[8*6 + 32*6 + 128*6] = {
- 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3b20d79e, 0x187de2a6,
- 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6,
- 0x187de2a6, 0x3b20d79e, 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f,
- 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xe7821d5a, 0x3b20d79e,
- 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e,
- 0xc4df2862, 0xe7821d5a, 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae,
-
- 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3fb11b47, 0x0645e9af,
- 0x3fec43c6, 0x0323ecbe, 0x3f4eaafe, 0x09640837, 0x3ec52f9f, 0x0c7c5c1e, 0x3fb11b47, 0x0645e9af,
- 0x3d3e82ad, 0x1294062e, 0x3d3e82ad, 0x1294062e, 0x3f4eaafe, 0x09640837, 0x39daf5e8, 0x1b5d1009,
- 0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x387165e3, 0x1e2b5d38,
- 0x3e14fdf7, 0x0f8cfcbd, 0x2f6bbe44, 0x2afad269, 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e,
- 0x2899e64a, 0x317900d6, 0x317900d6, 0x2899e64a, 0x3c424209, 0x158f9a75, 0x20e70f32, 0x36e5068a,
- 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x2899e64a, 0x317900d6,
- 0x39daf5e8, 0x1b5d1009, 0x0f8cfcbd, 0x3e14fdf7, 0x238e7673, 0x3536cc52, 0x387165e3, 0x1e2b5d38,
- 0x0645e9af, 0x3fb11b47, 0x1e2b5d38, 0x387165e3, 0x36e5068a, 0x20e70f32, 0xfcdc1342, 0x3fec43c6,
- 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, 0x1294062e, 0x3d3e82ad,
- 0x3367c08f, 0x261feff9, 0xea70658b, 0x3c424209, 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a,
- 0xe1d4a2c8, 0x387165e3, 0x0645e9af, 0x3fb11b47, 0x2f6bbe44, 0x2afad269, 0xd9e01007, 0x3367c08f,
- 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xf9ba1651, 0x3fb11b47,
- 0x2afad269, 0x2f6bbe44, 0xcc983f71, 0x261feff9, 0xf383a3e2, 0x3ec52f9f, 0x2899e64a, 0x317900d6,
- 0xc78e9a1d, 0x1e2b5d38, 0xed6bf9d2, 0x3d3e82ad, 0x261feff9, 0x3367c08f, 0xc3bdbdf7, 0x158f9a75,
- 0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xe1d4a2c8, 0x387165e3,
- 0x20e70f32, 0x36e5068a, 0xc013bc3a, 0x0323ecbe, 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3,
- 0xc04ee4b9, 0xf9ba1651, 0xd76619b6, 0x317900d6, 0x1b5d1009, 0x39daf5e8, 0xc1eb0209, 0xf0730343,
- 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xce86ff2a, 0x2899e64a,
- 0x158f9a75, 0x3c424209, 0xc91af976, 0xdf18f0ce, 0xcac933ae, 0x238e7673, 0x1294062e, 0x3d3e82ad,
- 0xce86ff2a, 0xd76619b6, 0xc78e9a1d, 0x1e2b5d38, 0x0f8cfcbd, 0x3e14fdf7, 0xd5052d97, 0xd09441bc,
- 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, 0xc2c17d53, 0x1294062e,
- 0x09640837, 0x3f4eaafe, 0xe4a2eff7, 0xc6250a18, 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47,
- 0xed6bf9d2, 0xc2c17d53, 0xc04ee4b9, 0x0645e9af, 0x0323ecbe, 0x3fec43c6, 0xf69bf7c9, 0xc0b15502,
-
- 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3ffb10c1, 0x0192155f,
- 0x3ffec42d, 0x00c90e8f, 0x3ff4e5df, 0x025b0cae, 0x3fec43c6, 0x0323ecbe, 0x3ffb10c1, 0x0192155f,
- 0x3fd39b5a, 0x04b54824, 0x3fd39b5a, 0x04b54824, 0x3ff4e5df, 0x025b0cae, 0x3f9c2bfa, 0x070de171,
- 0x3fb11b47, 0x0645e9af, 0x3fec43c6, 0x0323ecbe, 0x3f4eaafe, 0x09640837, 0x3f84c8e1, 0x07d59395,
- 0x3fe12acb, 0x03ecadcf, 0x3eeb3347, 0x0bb6ecef, 0x3f4eaafe, 0x09640837, 0x3fd39b5a, 0x04b54824,
- 0x3e71e758, 0x0e05c135, 0x3f0ec9f4, 0x0af10a22, 0x3fc395f9, 0x057db402, 0x3de2f147, 0x104fb80e,
- 0x3ec52f9f, 0x0c7c5c1e, 0x3fb11b47, 0x0645e9af, 0x3d3e82ad, 0x1294062e, 0x3e71e758, 0x0e05c135,
- 0x3f9c2bfa, 0x070de171, 0x3c84d496, 0x14d1e242, 0x3e14fdf7, 0x0f8cfcbd, 0x3f84c8e1, 0x07d59395,
- 0x3bb6276d, 0x17088530, 0x3dae81ce, 0x1111d262, 0x3f6af2e3, 0x089cf867, 0x3ad2c2e7, 0x19372a63,
- 0x3d3e82ad, 0x1294062e, 0x3f4eaafe, 0x09640837, 0x39daf5e8, 0x1b5d1009, 0x3cc511d8, 0x14135c94,
- 0x3f2ff249, 0x0a2abb58, 0x38cf1669, 0x1d79775b, 0x3c424209, 0x158f9a75, 0x3f0ec9f4, 0x0af10a22,
- 0x37af8158, 0x1f8ba4db, 0x3bb6276d, 0x17088530, 0x3eeb3347, 0x0bb6ecef, 0x367c9a7d, 0x2192e09a,
- 0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x3a8269a2, 0x19ef7943,
- 0x3e9cc076, 0x0d415012, 0x33de87de, 0x257db64b, 0x39daf5e8, 0x1b5d1009, 0x3e71e758, 0x0e05c135,
- 0x32744493, 0x275ff452, 0x392a9642, 0x1cc66e99, 0x3e44a5ee, 0x0ec9a7f2, 0x30f8801f, 0x29348937,
- 0x387165e3, 0x1e2b5d38, 0x3e14fdf7, 0x0f8cfcbd, 0x2f6bbe44, 0x2afad269, 0x37af8158, 0x1f8ba4db,
- 0x3de2f147, 0x104fb80e, 0x2dce88a9, 0x2cb2324b, 0x36e5068a, 0x20e70f32, 0x3dae81ce, 0x1111d262,
- 0x2c216eaa, 0x2e5a106f, 0x361214b0, 0x223d66a8, 0x3d77b191, 0x11d3443f, 0x2a650525, 0x2ff1d9c6,
- 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, 0x2899e64a, 0x317900d6, 0x34534f40, 0x24da0a99,
- 0x3d02f756, 0x135410c2, 0x26c0b162, 0x32eefde9, 0x3367c08f, 0x261feff9, 0x3cc511d8, 0x14135c94,
- 0x24da0a99, 0x34534f40, 0x32744493, 0x275ff452, 0x3c84d496, 0x14d1e242, 0x22e69ac7, 0x35a5793c,
- 0x317900d6, 0x2899e64a, 0x3c424209, 0x158f9a75, 0x20e70f32, 0x36e5068a, 0x30761c17, 0x29cd9577,
- 0x3bfd5cc4, 0x164c7ddd, 0x1edc1952, 0x3811884c, 0x2f6bbe44, 0x2afad269, 0x3bb6276d, 0x17088530,
- 0x1cc66e99, 0x392a9642, 0x2e5a106f, 0x2c216eaa, 0x3b6ca4c4, 0x17c3a931, 0x1aa6c82b, 0x3a2fcee8,
- 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x2c216eaa, 0x2e5a106f,
- 0x3ad2c2e7, 0x19372a63, 0x164c7ddd, 0x3bfd5cc4, 0x2afad269, 0x2f6bbe44, 0x3a8269a2, 0x19ef7943,
- 0x14135c94, 0x3cc511d8, 0x29cd9577, 0x30761c17, 0x3a2fcee8, 0x1aa6c82b, 0x11d3443f, 0x3d77b191,
- 0x2899e64a, 0x317900d6, 0x39daf5e8, 0x1b5d1009, 0x0f8cfcbd, 0x3e14fdf7, 0x275ff452, 0x32744493,
- 0x3983e1e7, 0x1c1249d8, 0x0d415012, 0x3e9cc076, 0x261feff9, 0x3367c08f, 0x392a9642, 0x1cc66e99,
- 0x0af10a22, 0x3f0ec9f4, 0x24da0a99, 0x34534f40, 0x38cf1669, 0x1d79775b, 0x089cf867, 0x3f6af2e3,
- 0x238e7673, 0x3536cc52, 0x387165e3, 0x1e2b5d38, 0x0645e9af, 0x3fb11b47, 0x223d66a8, 0x361214b0,
- 0x3811884c, 0x1edc1952, 0x03ecadcf, 0x3fe12acb, 0x20e70f32, 0x36e5068a, 0x37af8158, 0x1f8ba4db,
- 0x0192155f, 0x3ffb10c1, 0x1f8ba4db, 0x37af8158, 0x374b54ce, 0x2039f90e, 0xff36f171, 0x3ffec42d,
- 0x1e2b5d38, 0x387165e3, 0x36e5068a, 0x20e70f32, 0xfcdc1342, 0x3fec43c6, 0x1cc66e99, 0x392a9642,
- 0x367c9a7d, 0x2192e09a, 0xfa824bfe, 0x3fc395f9, 0x1b5d1009, 0x39daf5e8, 0x361214b0, 0x223d66a8,
- 0xf82a6c6b, 0x3f84c8e1, 0x19ef7943, 0x3a8269a2, 0x35a5793c, 0x22e69ac7, 0xf5d544a8, 0x3f2ff249,
- 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, 0x17088530, 0x3bb6276d,
- 0x34c61236, 0x2434f332, 0xf136580e, 0x3e44a5ee, 0x158f9a75, 0x3c424209, 0x34534f40, 0x24da0a99,
- 0xeeee2d9e, 0x3dae81ce, 0x14135c94, 0x3cc511d8, 0x33de87de, 0x257db64b, 0xecabef3e, 0x3d02f756,
- 0x1294062e, 0x3d3e82ad, 0x3367c08f, 0x261feff9, 0xea70658b, 0x3c424209, 0x1111d262, 0x3dae81ce,
- 0x32eefde9, 0x26c0b162, 0xe83c56cf, 0x3b6ca4c4, 0x0f8cfcbd, 0x3e14fdf7, 0x32744493, 0x275ff452,
- 0xe61086bd, 0x3a8269a2, 0x0e05c135, 0x3e71e758, 0x31f79947, 0x27fdb2a6, 0xe3edb628, 0x3983e1e7,
- 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, 0xe1d4a2c8, 0x387165e3, 0x0af10a22, 0x3f0ec9f4,
- 0x30f8801f, 0x29348937, 0xdfc606f2, 0x374b54ce, 0x09640837, 0x3f4eaafe, 0x30761c17, 0x29cd9577,
- 0xddc29958, 0x361214b0, 0x07d59395, 0x3f84c8e1, 0x2ff1d9c6, 0x2a650525, 0xdbcb0cce, 0x34c61236,
- 0x0645e9af, 0x3fb11b47, 0x2f6bbe44, 0x2afad269, 0xd9e01007, 0x3367c08f, 0x04b54824, 0x3fd39b5a,
- 0x2ee3cebe, 0x2b8ef77c, 0xd8024d5a, 0x31f79947, 0x0323ecbe, 0x3fec43c6, 0x2e5a106f, 0x2c216eaa,
- 0xd6326a89, 0x30761c17, 0x0192155f, 0x3ffb10c1, 0x2dce88a9, 0x2cb2324b, 0xd4710884, 0x2ee3cebe,
- 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xfe6deaa1, 0x3ffb10c1,
- 0x2cb2324b, 0x2dce88a9, 0xd11c3142, 0x2b8ef77c, 0xfcdc1342, 0x3fec43c6, 0x2c216eaa, 0x2e5a106f,
- 0xcf89e3e9, 0x29cd9577, 0xfb4ab7dc, 0x3fd39b5a, 0x2b8ef77c, 0x2ee3cebe, 0xce0866b9, 0x27fdb2a6,
- 0xf9ba1651, 0x3fb11b47, 0x2afad269, 0x2f6bbe44, 0xcc983f71, 0x261feff9, 0xf82a6c6b, 0x3f84c8e1,
- 0x2a650525, 0x2ff1d9c6, 0xcb39edca, 0x2434f332, 0xf69bf7c9, 0x3f4eaafe, 0x29cd9577, 0x30761c17,
- 0xc9edeb50, 0x223d66a8, 0xf50ef5de, 0x3f0ec9f4, 0x29348937, 0x30f8801f, 0xc8b4ab32, 0x2039f90e,
- 0xf383a3e2, 0x3ec52f9f, 0x2899e64a, 0x317900d6, 0xc78e9a1d, 0x1e2b5d38, 0xf1fa3ecb, 0x3e71e758,
- 0x27fdb2a6, 0x31f79947, 0xc67c1e19, 0x1c1249d8, 0xf0730343, 0x3e14fdf7, 0x275ff452, 0x32744493,
- 0xc57d965e, 0x19ef7943, 0xeeee2d9e, 0x3dae81ce, 0x26c0b162, 0x32eefde9, 0xc4935b3c, 0x17c3a931,
- 0xed6bf9d2, 0x3d3e82ad, 0x261feff9, 0x3367c08f, 0xc3bdbdf7, 0x158f9a75, 0xebeca36c, 0x3cc511d8,
- 0x257db64b, 0x33de87de, 0xc2fd08aa, 0x135410c2, 0xea70658b, 0x3c424209, 0x24da0a99, 0x34534f40,
- 0xc2517e32, 0x1111d262, 0xe8f77ad0, 0x3bb6276d, 0x2434f332, 0x34c61236, 0xc1bb5a12, 0x0ec9a7f2,
- 0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xe61086bd, 0x3a8269a2,
- 0x22e69ac7, 0x35a5793c, 0xc0d00db7, 0x0a2abb58, 0xe4a2eff7, 0x39daf5e8, 0x223d66a8, 0x361214b0,
- 0xc07b371f, 0x07d59395, 0xe3399167, 0x392a9642, 0x2192e09a, 0x367c9a7d, 0xc03c6a07, 0x057db402,
- 0xe1d4a2c8, 0x387165e3, 0x20e70f32, 0x36e5068a, 0xc013bc3a, 0x0323ecbe, 0xe0745b25, 0x37af8158,
- 0x2039f90e, 0x374b54ce, 0xc0013bd3, 0x00c90e8f, 0xdf18f0ce, 0x36e5068a, 0x1f8ba4db, 0x37af8158,
- 0xc004ef3f, 0xfe6deaa1, 0xddc29958, 0x361214b0, 0x1edc1952, 0x3811884c, 0xc01ed535, 0xfc135231,
- 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, 0xc04ee4b9, 0xf9ba1651, 0xdb25f567, 0x34534f40,
- 0x1d79775b, 0x38cf1669, 0xc0950d1d, 0xf7630799, 0xd9e01007, 0x3367c08f, 0x1cc66e99, 0x392a9642,
- 0xc0f1360c, 0xf50ef5de, 0xd8a00bae, 0x32744493, 0x1c1249d8, 0x3983e1e7, 0xc1633f8a, 0xf2beafee,
- 0xd76619b6, 0x317900d6, 0x1b5d1009, 0x39daf5e8, 0xc1eb0209, 0xf0730343, 0xd6326a89, 0x30761c17,
- 0x1aa6c82b, 0x3a2fcee8, 0xc2884e6f, 0xee2cbbc1, 0xd5052d97, 0x2f6bbe44, 0x19ef7943, 0x3a8269a2,
- 0xc33aee28, 0xebeca36c, 0xd3de9156, 0x2e5a106f, 0x19372a63, 0x3ad2c2e7, 0xc402a33c, 0xe9b38223,
- 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xd1a5ef91, 0x2c216eaa,
- 0x17c3a931, 0x3b6ca4c4, 0xc5d03118, 0xe55937d5, 0xd09441bc, 0x2afad269, 0x17088530, 0x3bb6276d,
- 0xc6d569be, 0xe3399167, 0xcf89e3e9, 0x29cd9577, 0x164c7ddd, 0x3bfd5cc4, 0xc7ee77b4, 0xe123e6ae,
- 0xce86ff2a, 0x2899e64a, 0x158f9a75, 0x3c424209, 0xc91af976, 0xdf18f0ce, 0xcd8bbb6d, 0x275ff452,
- 0x14d1e242, 0x3c84d496, 0xca5a86c4, 0xdd196539, 0xcc983f71, 0x261feff9, 0x14135c94, 0x3cc511d8,
- 0xcbacb0c0, 0xdb25f567, 0xcbacb0c0, 0x24da0a99, 0x135410c2, 0x3d02f756, 0xcd110217, 0xd93f4e9e,
- 0xcac933ae, 0x238e7673, 0x1294062e, 0x3d3e82ad, 0xce86ff2a, 0xd76619b6, 0xc9edeb50, 0x223d66a8,
- 0x11d3443f, 0x3d77b191, 0xd00e263a, 0xd59afadb, 0xc91af976, 0x20e70f32, 0x1111d262, 0x3dae81ce,
- 0xd1a5ef91, 0xd3de9156, 0xc8507ea8, 0x1f8ba4db, 0x104fb80e, 0x3de2f147, 0xd34dcdb5, 0xd2317757,
- 0xc78e9a1d, 0x1e2b5d38, 0x0f8cfcbd, 0x3e14fdf7, 0xd5052d97, 0xd09441bc, 0xc6d569be, 0x1cc66e99,
- 0x0ec9a7f2, 0x3e44a5ee, 0xd6cb76c9, 0xcf077fe1, 0xc6250a18, 0x1b5d1009, 0x0e05c135, 0x3e71e758,
- 0xd8a00bae, 0xcd8bbb6d, 0xc57d965e, 0x19ef7943, 0x0d415012, 0x3e9cc076, 0xda8249b5, 0xcc217822,
- 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, 0xc449d893, 0x17088530,
- 0x0bb6ecef, 0x3eeb3347, 0xde6d1f66, 0xc9836583, 0xc3bdbdf7, 0x158f9a75, 0x0af10a22, 0x3f0ec9f4,
- 0xe0745b25, 0xc8507ea8, 0xc33aee28, 0x14135c94, 0x0a2abb58, 0x3f2ff249, 0xe28688a5, 0xc730e997,
- 0xc2c17d53, 0x1294062e, 0x09640837, 0x3f4eaafe, 0xe4a2eff7, 0xc6250a18, 0xc2517e32, 0x1111d262,
- 0x089cf867, 0x3f6af2e3, 0xe6c8d59d, 0xc52d3d19, 0xc1eb0209, 0x0f8cfcbd, 0x07d59395, 0x3f84c8e1,
- 0xe8f77ad0, 0xc449d893, 0xc18e18a8, 0x0e05c135, 0x070de171, 0x3f9c2bfa, 0xeb2e1dbe, 0xc37b2b6a,
- 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, 0xed6bf9d2, 0xc2c17d53, 0xc0f1360c, 0x0af10a22,
- 0x057db402, 0x3fc395f9, 0xefb047f2, 0xc21d0eb9, 0xc0b15502, 0x09640837, 0x04b54824, 0x3fd39b5a,
- 0xf1fa3ecb, 0xc18e18a8, 0xc07b371f, 0x07d59395, 0x03ecadcf, 0x3fe12acb, 0xf4491311, 0xc114ccb9,
- 0xc04ee4b9, 0x0645e9af, 0x0323ecbe, 0x3fec43c6, 0xf69bf7c9, 0xc0b15502, 0xc02c64a6, 0x04b54824,
- 0x025b0cae, 0x3ff4e5df, 0xf8f21e8f, 0xc063d406, 0xc013bc3a, 0x0323ecbe, 0x0192155f, 0x3ffb10c1,
- 0xfb4ab7dc, 0xc02c64a6, 0xc004ef3f, 0x0192155f, 0x00c90e8f, 0x3ffec42d, 0xfda4f352, 0xc00b1a21
-};
-
-const int twidTab64[4*6 + 16*6] = {
- 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x2d413ccc, 0x2d413ccc,
- 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc,
- 0xd2bec334, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a,
-
- 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3ec52f9f, 0x0c7c5c1e,
- 0x3fb11b47, 0x0645e9af, 0x3d3e82ad, 0x1294062e, 0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e,
- 0x3536cc52, 0x238e7673, 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, 0x2899e64a, 0x317900d6,
- 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x238e7673, 0x3536cc52,
- 0x387165e3, 0x1e2b5d38, 0x0645e9af, 0x3fb11b47, 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673,
- 0xf383a3e2, 0x3ec52f9f, 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, 0xe1d4a2c8, 0x387165e3,
- 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xf383a3e2, 0x3ec52f9f,
- 0x2899e64a, 0x317900d6, 0xc78e9a1d, 0x1e2b5d38, 0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52,
- 0xc13ad061, 0x0c7c5c1e, 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, 0xc04ee4b9, 0xf9ba1651,
- 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xcac933ae, 0x238e7673,
- 0x1294062e, 0x3d3e82ad, 0xce86ff2a, 0xd76619b6, 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f,
- 0xdc71898d, 0xcac933ae, 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, 0xed6bf9d2, 0xc2c17d53
-};
-#endif //ARMV5E
-
-const int ShortWindowSine[FRAME_LEN_SHORT/2] ={
- 0x00c97fff, 0x025b7ffa, 0x03ed7ff1, 0x057f7fe2, 0x07117fce, 0x08a27fb5, 0x0a337f98, 0x0bc47f75,
- 0x0d547f4e, 0x0ee47f22, 0x10737ef0, 0x12017eba, 0x138f7e7f, 0x151c7e3f, 0x16a87dfb, 0x18337db1,
- 0x19be7d63, 0x1b477d0f, 0x1cd07cb7, 0x1e577c5a, 0x1fdd7bf9, 0x21627b92, 0x22e57b27, 0x24677ab7,
- 0x25e87a42, 0x276879c9, 0x28e5794a, 0x2a6278c8, 0x2bdc7840, 0x2d5577b4, 0x2ecc7723, 0x3042768e,
- 0x31b575f4, 0x33277556, 0x349774b3, 0x3604740b, 0x3770735f, 0x38d972af, 0x3a4071fa, 0x3ba57141,
- 0x3d087083, 0x3e686fc2, 0x3fc66efb, 0x41216e31, 0x427a6d62, 0x43d16c8f, 0x45246bb8, 0x46756add,
- 0x47c469fd, 0x490f691a, 0x4a586832, 0x4b9e6747, 0x4ce16657, 0x4e216564, 0x4f5e646c, 0x50986371,
- 0x51cf6272, 0x5303616f, 0x54336068, 0x55605f5e, 0x568a5e50, 0x57b15d3e, 0x58d45c29, 0x59f45b10
+const int twidTab64[4*6 + 16*6] = { + 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x2d413ccc, 0x2d413ccc, + 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, + 0xd2bec334, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, + + 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3ec52f9f, 0x0c7c5c1e, + 0x3fb11b47, 0x0645e9af, 0x3d3e82ad, 0x1294062e, 0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, + 0x3536cc52, 0x238e7673, 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, 0x2899e64a, 0x317900d6, + 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x238e7673, 0x3536cc52, + 0x387165e3, 0x1e2b5d38, 0x0645e9af, 0x3fb11b47, 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, + 0xf383a3e2, 0x3ec52f9f, 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, 0xe1d4a2c8, 0x387165e3, + 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xf383a3e2, 0x3ec52f9f, + 0x2899e64a, 0x317900d6, 0xc78e9a1d, 0x1e2b5d38, 0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, + 0xc13ad061, 0x0c7c5c1e, 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, 0xc04ee4b9, 0xf9ba1651, + 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xcac933ae, 0x238e7673, + 0x1294062e, 0x3d3e82ad, 0xce86ff2a, 0xd76619b6, 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, + 0xdc71898d, 0xcac933ae, 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, 0xed6bf9d2, 0xc2c17d53 +}; +#endif //ARMV5E + +const int ShortWindowSine[FRAME_LEN_SHORT/2] ={ + 0x00c97fff, 0x025b7ffa, 0x03ed7ff1, 0x057f7fe2, 0x07117fce, 0x08a27fb5, 0x0a337f98, 0x0bc47f75, + 0x0d547f4e, 0x0ee47f22, 0x10737ef0, 0x12017eba, 0x138f7e7f, 0x151c7e3f, 0x16a87dfb, 0x18337db1, + 0x19be7d63, 0x1b477d0f, 0x1cd07cb7, 0x1e577c5a, 0x1fdd7bf9, 0x21627b92, 0x22e57b27, 0x24677ab7, + 0x25e87a42, 0x276879c9, 0x28e5794a, 0x2a6278c8, 0x2bdc7840, 0x2d5577b4, 0x2ecc7723, 0x3042768e, + 0x31b575f4, 0x33277556, 0x349774b3, 0x3604740b, 0x3770735f, 0x38d972af, 0x3a4071fa, 0x3ba57141, + 0x3d087083, 0x3e686fc2, 0x3fc66efb, 0x41216e31, 0x427a6d62, 0x43d16c8f, 0x45246bb8, 0x46756add, + 0x47c469fd, 0x490f691a, 0x4a586832, 0x4b9e6747, 0x4ce16657, 0x4e216564, 0x4f5e646c, 0x50986371, + 0x51cf6272, 0x5303616f, 0x54336068, 0x55605f5e, 0x568a5e50, 0x57b15d3e, 0x58d45c29, 0x59f45b10 }; const int LongWindowKBD[FRAME_LEN_LONG/2]={ - 0x000a7fff, 0x000e7fff, 0x00127fff, 0x00157fff, 0x00197fff, 0x001c7fff, 0x00207fff, 0x00237fff,
- 0x00267fff, 0x002a7fff, 0x002d7fff, 0x00307fff, 0x00347fff, 0x00387fff, 0x003b7fff, 0x003f7fff,
- 0x00437fff, 0x00477fff, 0x004b7fff, 0x004f7fff, 0x00537fff, 0x00577fff, 0x005b7fff, 0x00607fff,
- 0x00647fff, 0x00697fff, 0x006d7fff, 0x00727fff, 0x00777fff, 0x007c7fff, 0x00817fff, 0x00867fff,
- 0x008b7fff, 0x00917fff, 0x00967fff, 0x009c7fff, 0x00a17fff, 0x00a77fff, 0x00ad7fff, 0x00b37fff,
- 0x00b97fff, 0x00bf7fff, 0x00c67fff, 0x00cc7fff, 0x00d37fff, 0x00da7fff, 0x00e07fff, 0x00e77fff,
- 0x00ee7fff, 0x00f57fff, 0x00fd7fff, 0x01047fff, 0x010c7fff, 0x01137fff, 0x011b7fff, 0x01237fff,
- 0x012b7fff, 0x01337fff, 0x013c7ffe, 0x01447ffe, 0x014d7ffe, 0x01567ffe, 0x015f7ffe, 0x01687ffe,
- 0x01717ffe, 0x017a7ffe, 0x01837ffe, 0x018d7ffe, 0x01977ffd, 0x01a17ffd, 0x01ab7ffd, 0x01b57ffd,
- 0x01bf7ffd, 0x01ca7ffd, 0x01d47ffd, 0x01df7ffc, 0x01ea7ffc, 0x01f57ffc, 0x02007ffc, 0x020c7ffc,
- 0x02177ffc, 0x02237ffb, 0x022f7ffb, 0x023b7ffb, 0x02477ffb, 0x02537ffb, 0x02607ffa, 0x026d7ffa,
- 0x027a7ffa, 0x02877ffa, 0x02947ff9, 0x02a17ff9, 0x02af7ff9, 0x02bc7ff9, 0x02ca7ff8, 0x02d87ff8,
- 0x02e77ff8, 0x02f57ff7, 0x03047ff7, 0x03127ff7, 0x03217ff6, 0x03317ff6, 0x03407ff5, 0x034f7ff5,
- 0x035f7ff5, 0x036f7ff4, 0x037f7ff4, 0x038f7ff3, 0x03a07ff3, 0x03b07ff2, 0x03c17ff2, 0x03d27ff1,
- 0x03e37ff1, 0x03f57ff0, 0x04067ff0, 0x04187fef, 0x042a7fef, 0x043c7fee, 0x044f7fed, 0x04617fed,
- 0x04747fec, 0x04877feb, 0x049a7feb, 0x04ae7fea, 0x04c17fe9, 0x04d57fe9, 0x04e97fe8, 0x04fd7fe7,
- 0x05127fe6, 0x05277fe5, 0x053b7fe5, 0x05507fe4, 0x05667fe3, 0x057b7fe2, 0x05917fe1, 0x05a77fe0,
- 0x05bd7fdf, 0x05d37fde, 0x05ea7fdd, 0x06017fdc, 0x06187fdb, 0x062f7fda, 0x06467fd9, 0x065e7fd7,
- 0x06767fd6, 0x068e7fd5, 0x06a67fd4, 0x06bf7fd2, 0x06d87fd1, 0x06f17fd0, 0x070a7fce, 0x07237fcd,
- 0x073d7fcc, 0x07577fca, 0x07717fc9, 0x078c7fc7, 0x07a67fc5, 0x07c17fc4, 0x07dc7fc2, 0x07f77fc0,
- 0x08137fbf, 0x082f7fbd, 0x084b7fbb, 0x08677fb9, 0x08847fb7, 0x08a07fb6, 0x08bd7fb4, 0x08da7fb2,
- 0x08f87faf, 0x09167fad, 0x09347fab, 0x09527fa9, 0x09707fa7, 0x098f7fa5, 0x09ae7fa2, 0x09cd7fa0,
- 0x09ec7f9d, 0x0a0c7f9b, 0x0a2c7f98, 0x0a4c7f96, 0x0a6c7f93, 0x0a8d7f91, 0x0aae7f8e, 0x0acf7f8b,
- 0x0af07f88, 0x0b127f85, 0x0b337f82, 0x0b557f7f, 0x0b787f7c, 0x0b9a7f79, 0x0bbd7f76, 0x0be07f73,
- 0x0c047f6f, 0x0c277f6c, 0x0c4b7f69, 0x0c6f7f65, 0x0c937f61, 0x0cb87f5e, 0x0cdd7f5a, 0x0d027f56,
- 0x0d277f53, 0x0d4d7f4f, 0x0d737f4b, 0x0d997f47, 0x0dbf7f43, 0x0de67f3e, 0x0e0c7f3a, 0x0e347f36,
- 0x0e5b7f31, 0x0e837f2d, 0x0eaa7f28, 0x0ed37f24, 0x0efb7f1f, 0x0f237f1a, 0x0f4c7f15, 0x0f757f10,
- 0x0f9f7f0b, 0x0fc87f06, 0x0ff27f01, 0x101c7efb, 0x10477ef6, 0x10717ef0, 0x109c7eeb, 0x10c87ee5,
- 0x10f37edf, 0x111f7eda, 0x114a7ed4, 0x11777ece, 0x11a37ec7, 0x11d07ec1, 0x11fd7ebb, 0x122a7eb4,
- 0x12577eae, 0x12857ea7, 0x12b37ea0, 0x12e17e9a, 0x130f7e93, 0x133e7e8c, 0x136d7e84, 0x139c7e7d,
- 0x13cc7e76, 0x13fb7e6e, 0x142b7e67, 0x145b7e5f, 0x148c7e57, 0x14bc7e4f, 0x14ed7e47, 0x151e7e3f,
- 0x15507e37, 0x15817e2e, 0x15b37e26, 0x15e57e1d, 0x16187e14, 0x164a7e0b, 0x167d7e02, 0x16b07df9,
- 0x16e47df0, 0x17177de6, 0x174b7ddd, 0x177f7dd3, 0x17b37dc9, 0x17e87dbf, 0x181d7db5, 0x18527dab,
- 0x18877da1, 0x18bc7d96, 0x18f27d8c, 0x19287d81, 0x195e7d76, 0x19957d6b, 0x19cb7d60, 0x1a027d54,
- 0x1a397d49, 0x1a717d3d, 0x1aa87d31, 0x1ae07d26, 0x1b187d19, 0x1b507d0d, 0x1b897d01, 0x1bc27cf4,
- 0x1bfb7ce8, 0x1c347cdb, 0x1c6d7cce, 0x1ca77cc1, 0x1ce17cb3, 0x1d1b7ca6, 0x1d557c98, 0x1d8f7c8a,
- 0x1dca7c7c, 0x1e057c6e, 0x1e407c60, 0x1e7b7c51, 0x1eb77c43, 0x1ef37c34, 0x1f2f7c25, 0x1f6b7c16,
- 0x1fa77c06, 0x1fe47bf7, 0x20217be7, 0x205e7bd7, 0x209b7bc7, 0x20d87bb7, 0x21167ba6, 0x21547b96,
- 0x21927b85, 0x21d07b74, 0x220e7b63, 0x224d7b52, 0x228c7b40, 0x22cb7b2e, 0x230a7b1c, 0x23497b0a,
- 0x23897af8, 0x23c87ae6, 0x24087ad3, 0x24487ac0, 0x24897aad, 0x24c97a9a, 0x250a7a86, 0x254b7a73,
- 0x258c7a5f, 0x25cd7a4b, 0x260e7a36, 0x26507a22, 0x26917a0d, 0x26d379f8, 0x271579e3, 0x275779ce,
- 0x279a79b8, 0x27dc79a3, 0x281f798d, 0x28627977, 0x28a57960, 0x28e8794a, 0x292b7933, 0x296f791c,
- 0x29b27905, 0x29f678ed, 0x2a3a78d6, 0x2a7e78be, 0x2ac278a6, 0x2b07788d, 0x2b4b7875, 0x2b90785c,
- 0x2bd47843, 0x2c19782a, 0x2c5e7810, 0x2ca477f7, 0x2ce977dd, 0x2d2e77c3, 0x2d7477a8, 0x2dba778e,
- 0x2dff7773, 0x2e457758, 0x2e8b773d, 0x2ed27721, 0x2f187706, 0x2f5e76ea, 0x2fa576cd, 0x2fec76b1,
- 0x30327694, 0x30797677, 0x30c0765a, 0x3107763d, 0x314e761f, 0x31967601, 0x31dd75e3, 0x322575c5,
- 0x326c75a6, 0x32b47588, 0x32fc7569, 0x33447549, 0x338c752a, 0x33d4750a, 0x341c74ea, 0x346474ca,
- 0x34ac74a9, 0x34f57488, 0x353d7467, 0x35857446, 0x35ce7424, 0x36177403, 0x365f73e1, 0x36a873be,
- 0x36f1739c, 0x373a7379, 0x37837356, 0x37cc7333, 0x3815730f, 0x385e72ec, 0x38a772c8, 0x38f172a3,
- 0x393a727f, 0x3983725a, 0x39cd7235, 0x3a167210, 0x3a6071ea, 0x3aa971c4, 0x3af3719e, 0x3b3c7178,
- 0x3b867151, 0x3bd0712b, 0x3c197104, 0x3c6370dc, 0x3cad70b5, 0x3cf7708d, 0x3d407065, 0x3d8a703c,
- 0x3dd47014, 0x3e1e6feb, 0x3e686fc2, 0x3eb16f98, 0x3efb6f6f, 0x3f456f45, 0x3f8f6f1b, 0x3fd96ef0,
- 0x40236ec6, 0x406d6e9b, 0x40b66e70, 0x41006e44, 0x414a6e19, 0x41946ded, 0x41de6dc1, 0x42286d94,
- 0x42716d68, 0x42bb6d3b, 0x43056d0d, 0x434f6ce0, 0x43986cb2, 0x43e26c84, 0x442c6c56, 0x44756c28,
- 0x44bf6bf9, 0x45086bca, 0x45526b9b, 0x459b6b6b, 0x45e56b3c, 0x462e6b0c, 0x46786adb, 0x46c16aab,
- 0x470a6a7a, 0x47536a49, 0x479c6a18, 0x47e569e7, 0x482e69b5, 0x48776983, 0x48c06951, 0x4909691e,
- 0x495268ec, 0x499b68b9, 0x49e36885, 0x4a2c6852, 0x4a74681e, 0x4abd67ea, 0x4b0567b6, 0x4b4d6782,
- 0x4b95674d, 0x4bde6718, 0x4c2666e3, 0x4c6d66ae, 0x4cb56678, 0x4cfd6642, 0x4d45660c, 0x4d8c65d6,
- 0x4dd4659f, 0x4e1b6568, 0x4e626531, 0x4ea964fa, 0x4ef064c3, 0x4f37648b, 0x4f7e6453, 0x4fc5641b,
- 0x500b63e2, 0x505263aa, 0x50986371, 0x50df6338, 0x512562fe, 0x516b62c5, 0x51b1628b, 0x51f66251,
- 0x523c6217, 0x528161dc, 0x52c761a2, 0x530c6167, 0x5351612c, 0x539660f1, 0x53db60b5, 0x54206079,
- 0x5464603d, 0x54a96001, 0x54ed5fc5, 0x55315f88, 0x55755f4b, 0x55b95f0e, 0x55fc5ed1, 0x56405e94,
- 0x56835e56, 0x56c75e18, 0x570a5dda, 0x574d5d9c, 0x578f5d5e, 0x57d25d1f, 0x58145ce0, 0x58565ca1,
+ 0x000a7fff, 0x000e7fff, 0x00127fff, 0x00157fff, 0x00197fff, 0x001c7fff, 0x00207fff, 0x00237fff, + 0x00267fff, 0x002a7fff, 0x002d7fff, 0x00307fff, 0x00347fff, 0x00387fff, 0x003b7fff, 0x003f7fff, + 0x00437fff, 0x00477fff, 0x004b7fff, 0x004f7fff, 0x00537fff, 0x00577fff, 0x005b7fff, 0x00607fff, + 0x00647fff, 0x00697fff, 0x006d7fff, 0x00727fff, 0x00777fff, 0x007c7fff, 0x00817fff, 0x00867fff, + 0x008b7fff, 0x00917fff, 0x00967fff, 0x009c7fff, 0x00a17fff, 0x00a77fff, 0x00ad7fff, 0x00b37fff, + 0x00b97fff, 0x00bf7fff, 0x00c67fff, 0x00cc7fff, 0x00d37fff, 0x00da7fff, 0x00e07fff, 0x00e77fff, + 0x00ee7fff, 0x00f57fff, 0x00fd7fff, 0x01047fff, 0x010c7fff, 0x01137fff, 0x011b7fff, 0x01237fff, + 0x012b7fff, 0x01337fff, 0x013c7ffe, 0x01447ffe, 0x014d7ffe, 0x01567ffe, 0x015f7ffe, 0x01687ffe, + 0x01717ffe, 0x017a7ffe, 0x01837ffe, 0x018d7ffe, 0x01977ffd, 0x01a17ffd, 0x01ab7ffd, 0x01b57ffd, + 0x01bf7ffd, 0x01ca7ffd, 0x01d47ffd, 0x01df7ffc, 0x01ea7ffc, 0x01f57ffc, 0x02007ffc, 0x020c7ffc, + 0x02177ffc, 0x02237ffb, 0x022f7ffb, 0x023b7ffb, 0x02477ffb, 0x02537ffb, 0x02607ffa, 0x026d7ffa, + 0x027a7ffa, 0x02877ffa, 0x02947ff9, 0x02a17ff9, 0x02af7ff9, 0x02bc7ff9, 0x02ca7ff8, 0x02d87ff8, + 0x02e77ff8, 0x02f57ff7, 0x03047ff7, 0x03127ff7, 0x03217ff6, 0x03317ff6, 0x03407ff5, 0x034f7ff5, + 0x035f7ff5, 0x036f7ff4, 0x037f7ff4, 0x038f7ff3, 0x03a07ff3, 0x03b07ff2, 0x03c17ff2, 0x03d27ff1, + 0x03e37ff1, 0x03f57ff0, 0x04067ff0, 0x04187fef, 0x042a7fef, 0x043c7fee, 0x044f7fed, 0x04617fed, + 0x04747fec, 0x04877feb, 0x049a7feb, 0x04ae7fea, 0x04c17fe9, 0x04d57fe9, 0x04e97fe8, 0x04fd7fe7, + 0x05127fe6, 0x05277fe5, 0x053b7fe5, 0x05507fe4, 0x05667fe3, 0x057b7fe2, 0x05917fe1, 0x05a77fe0, + 0x05bd7fdf, 0x05d37fde, 0x05ea7fdd, 0x06017fdc, 0x06187fdb, 0x062f7fda, 0x06467fd9, 0x065e7fd7, + 0x06767fd6, 0x068e7fd5, 0x06a67fd4, 0x06bf7fd2, 0x06d87fd1, 0x06f17fd0, 0x070a7fce, 0x07237fcd, + 0x073d7fcc, 0x07577fca, 0x07717fc9, 0x078c7fc7, 0x07a67fc5, 0x07c17fc4, 0x07dc7fc2, 0x07f77fc0, + 0x08137fbf, 0x082f7fbd, 0x084b7fbb, 0x08677fb9, 0x08847fb7, 0x08a07fb6, 0x08bd7fb4, 0x08da7fb2, + 0x08f87faf, 0x09167fad, 0x09347fab, 0x09527fa9, 0x09707fa7, 0x098f7fa5, 0x09ae7fa2, 0x09cd7fa0, + 0x09ec7f9d, 0x0a0c7f9b, 0x0a2c7f98, 0x0a4c7f96, 0x0a6c7f93, 0x0a8d7f91, 0x0aae7f8e, 0x0acf7f8b, + 0x0af07f88, 0x0b127f85, 0x0b337f82, 0x0b557f7f, 0x0b787f7c, 0x0b9a7f79, 0x0bbd7f76, 0x0be07f73, + 0x0c047f6f, 0x0c277f6c, 0x0c4b7f69, 0x0c6f7f65, 0x0c937f61, 0x0cb87f5e, 0x0cdd7f5a, 0x0d027f56, + 0x0d277f53, 0x0d4d7f4f, 0x0d737f4b, 0x0d997f47, 0x0dbf7f43, 0x0de67f3e, 0x0e0c7f3a, 0x0e347f36, + 0x0e5b7f31, 0x0e837f2d, 0x0eaa7f28, 0x0ed37f24, 0x0efb7f1f, 0x0f237f1a, 0x0f4c7f15, 0x0f757f10, + 0x0f9f7f0b, 0x0fc87f06, 0x0ff27f01, 0x101c7efb, 0x10477ef6, 0x10717ef0, 0x109c7eeb, 0x10c87ee5, + 0x10f37edf, 0x111f7eda, 0x114a7ed4, 0x11777ece, 0x11a37ec7, 0x11d07ec1, 0x11fd7ebb, 0x122a7eb4, + 0x12577eae, 0x12857ea7, 0x12b37ea0, 0x12e17e9a, 0x130f7e93, 0x133e7e8c, 0x136d7e84, 0x139c7e7d, + 0x13cc7e76, 0x13fb7e6e, 0x142b7e67, 0x145b7e5f, 0x148c7e57, 0x14bc7e4f, 0x14ed7e47, 0x151e7e3f, + 0x15507e37, 0x15817e2e, 0x15b37e26, 0x15e57e1d, 0x16187e14, 0x164a7e0b, 0x167d7e02, 0x16b07df9, + 0x16e47df0, 0x17177de6, 0x174b7ddd, 0x177f7dd3, 0x17b37dc9, 0x17e87dbf, 0x181d7db5, 0x18527dab, + 0x18877da1, 0x18bc7d96, 0x18f27d8c, 0x19287d81, 0x195e7d76, 0x19957d6b, 0x19cb7d60, 0x1a027d54, + 0x1a397d49, 0x1a717d3d, 0x1aa87d31, 0x1ae07d26, 0x1b187d19, 0x1b507d0d, 0x1b897d01, 0x1bc27cf4, + 0x1bfb7ce8, 0x1c347cdb, 0x1c6d7cce, 0x1ca77cc1, 0x1ce17cb3, 0x1d1b7ca6, 0x1d557c98, 0x1d8f7c8a, + 0x1dca7c7c, 0x1e057c6e, 0x1e407c60, 0x1e7b7c51, 0x1eb77c43, 0x1ef37c34, 0x1f2f7c25, 0x1f6b7c16, + 0x1fa77c06, 0x1fe47bf7, 0x20217be7, 0x205e7bd7, 0x209b7bc7, 0x20d87bb7, 0x21167ba6, 0x21547b96, + 0x21927b85, 0x21d07b74, 0x220e7b63, 0x224d7b52, 0x228c7b40, 0x22cb7b2e, 0x230a7b1c, 0x23497b0a, + 0x23897af8, 0x23c87ae6, 0x24087ad3, 0x24487ac0, 0x24897aad, 0x24c97a9a, 0x250a7a86, 0x254b7a73, + 0x258c7a5f, 0x25cd7a4b, 0x260e7a36, 0x26507a22, 0x26917a0d, 0x26d379f8, 0x271579e3, 0x275779ce, + 0x279a79b8, 0x27dc79a3, 0x281f798d, 0x28627977, 0x28a57960, 0x28e8794a, 0x292b7933, 0x296f791c, + 0x29b27905, 0x29f678ed, 0x2a3a78d6, 0x2a7e78be, 0x2ac278a6, 0x2b07788d, 0x2b4b7875, 0x2b90785c, + 0x2bd47843, 0x2c19782a, 0x2c5e7810, 0x2ca477f7, 0x2ce977dd, 0x2d2e77c3, 0x2d7477a8, 0x2dba778e, + 0x2dff7773, 0x2e457758, 0x2e8b773d, 0x2ed27721, 0x2f187706, 0x2f5e76ea, 0x2fa576cd, 0x2fec76b1, + 0x30327694, 0x30797677, 0x30c0765a, 0x3107763d, 0x314e761f, 0x31967601, 0x31dd75e3, 0x322575c5, + 0x326c75a6, 0x32b47588, 0x32fc7569, 0x33447549, 0x338c752a, 0x33d4750a, 0x341c74ea, 0x346474ca, + 0x34ac74a9, 0x34f57488, 0x353d7467, 0x35857446, 0x35ce7424, 0x36177403, 0x365f73e1, 0x36a873be, + 0x36f1739c, 0x373a7379, 0x37837356, 0x37cc7333, 0x3815730f, 0x385e72ec, 0x38a772c8, 0x38f172a3, + 0x393a727f, 0x3983725a, 0x39cd7235, 0x3a167210, 0x3a6071ea, 0x3aa971c4, 0x3af3719e, 0x3b3c7178, + 0x3b867151, 0x3bd0712b, 0x3c197104, 0x3c6370dc, 0x3cad70b5, 0x3cf7708d, 0x3d407065, 0x3d8a703c, + 0x3dd47014, 0x3e1e6feb, 0x3e686fc2, 0x3eb16f98, 0x3efb6f6f, 0x3f456f45, 0x3f8f6f1b, 0x3fd96ef0, + 0x40236ec6, 0x406d6e9b, 0x40b66e70, 0x41006e44, 0x414a6e19, 0x41946ded, 0x41de6dc1, 0x42286d94, + 0x42716d68, 0x42bb6d3b, 0x43056d0d, 0x434f6ce0, 0x43986cb2, 0x43e26c84, 0x442c6c56, 0x44756c28, + 0x44bf6bf9, 0x45086bca, 0x45526b9b, 0x459b6b6b, 0x45e56b3c, 0x462e6b0c, 0x46786adb, 0x46c16aab, + 0x470a6a7a, 0x47536a49, 0x479c6a18, 0x47e569e7, 0x482e69b5, 0x48776983, 0x48c06951, 0x4909691e, + 0x495268ec, 0x499b68b9, 0x49e36885, 0x4a2c6852, 0x4a74681e, 0x4abd67ea, 0x4b0567b6, 0x4b4d6782, + 0x4b95674d, 0x4bde6718, 0x4c2666e3, 0x4c6d66ae, 0x4cb56678, 0x4cfd6642, 0x4d45660c, 0x4d8c65d6, + 0x4dd4659f, 0x4e1b6568, 0x4e626531, 0x4ea964fa, 0x4ef064c3, 0x4f37648b, 0x4f7e6453, 0x4fc5641b, + 0x500b63e2, 0x505263aa, 0x50986371, 0x50df6338, 0x512562fe, 0x516b62c5, 0x51b1628b, 0x51f66251, + 0x523c6217, 0x528161dc, 0x52c761a2, 0x530c6167, 0x5351612c, 0x539660f1, 0x53db60b5, 0x54206079, + 0x5464603d, 0x54a96001, 0x54ed5fc5, 0x55315f88, 0x55755f4b, 0x55b95f0e, 0x55fc5ed1, 0x56405e94, + 0x56835e56, 0x56c75e18, 0x570a5dda, 0x574d5d9c, 0x578f5d5e, 0x57d25d1f, 0x58145ce0, 0x58565ca1, 0x58995c62, 0x58da5c23, 0x591c5be3, 0x595e5ba4, 0x599f5b64, 0x59e05b24, 0x5a215ae3, 0x5a625aa3 }; @@ -1334,15 +1334,15 @@ const Word32 mTab_4_3[512]={ 0x7f5571cd, 0x7f801003, 0x7faab1c8, 0x7fd5571d }; -
-const Word32 invSBF[24] = {
- 0x3FFD34FC, 0x2D3F8000, 0x24F18C7E, 0x1FFE9A7E,
- 0x1C9DF10C, 0x1A1F851A, 0x182FE994, 0x169FC000,
- 0x15542AAA, 0x143C31C2, 0x134B1B6C, 0x127920BE,
- 0x11BF2FCC, 0x111A749E, 0x1085FC42, 0x0FFFA7BE,
- 0x0F855818, 0x0F14EE56, 0x0EAE6A78, 0x0E4EF886,
- 0x0DF69880, 0x0DA49568, 0x0D578542, 0x0D101D0C
-};
+ +const Word32 invSBF[24] = { + 0x3FFD34FC, 0x2D3F8000, 0x24F18C7E, 0x1FFE9A7E, + 0x1C9DF10C, 0x1A1F851A, 0x182FE994, 0x169FC000, + 0x15542AAA, 0x143C31C2, 0x134B1B6C, 0x127920BE, + 0x11BF2FCC, 0x111A749E, 0x1085FC42, 0x0FFFA7BE, + 0x0F855818, 0x0F14EE56, 0x0EAE6A78, 0x0E4EF886, + 0x0DF69880, 0x0DA49568, 0x0D578542, 0x0D101D0C +}; const Word16 pow2tominusNover16[17] = { 0x7fff, 0x7a93, 0x7560, 0x7066, @@ -1350,21 +1350,21 @@ const Word16 pow2tominusNover16[17] = { 0x5a82, 0x56ac, 0x52ff, 0x4f7b, 0x4c1c, 0x48e2, 0x45cb, 0x42d5, 0x4000 -};
-
-const Word16 sideInfoTabLong[MAX_SFB_LONG + 1] = {
- 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14
-};
-
-const Word16 sideInfoTabShort[MAX_SFB_SHORT + 1] = {
- 7, 7, 7, 7, 7, 7, 7, 10, 10,
- 10, 10, 10, 10, 10, 13, 13
+}; + +const Word16 sideInfoTabLong[MAX_SFB_LONG + 1] = { + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14 +}; + +const Word16 sideInfoTabShort[MAX_SFB_SHORT + 1] = { + 7, 7, 7, 7, 7, 7, 7, 10, 10, + 10, 10, 10, 10, 10, 13, 13 }; Word32 specExpMantTableComb_enc[4][14] = @@ -1398,33 +1398,33 @@ const UWord8 specExpTableComb_enc[4][14] = {1, 3, 4, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19} }; -const Word16 quantBorders[4][4] = {
- /* pow(1.0-0.4054, 4/3)/16 * pow(2, (0..3)/4) */
- {0x0400, 0x0ee7, 0x1c86, 0x2c0d},
- /* pow(2.0-0.4054, 4/3)/16 * pow(2, (0..3)/4) */
- {0x04c2, 0x11b9, 0x21eb, 0x3463},
- /* pow(3.0-0.4054, 4/3)/16 * pow(2, (0..3)/4) */
- {0x05a8, 0x1514, 0x2856, 0x3e4c},
- /* pow(4.0-0.4054, 4/3)/16 * pow(2, (0..3)/4) */
- {0x06ba, 0x1911, 0x2ff8, 0x4a16},
-};
- -const Word16 quantRecon[4][3] = {
- {0x0800, 0x1429, 0x229d},
- {0x0983, 0x17f9, 0x292a},
- {0x0b50, 0x1c82, 0x30f4},
- {0x0d74, 0x21e7, 0x3a37},
+const Word16 quantBorders[4][4] = { + /* pow(1.0-0.4054, 4/3)/16 * pow(2, (0..3)/4) */ + {0x0400, 0x0ee7, 0x1c86, 0x2c0d}, + /* pow(2.0-0.4054, 4/3)/16 * pow(2, (0..3)/4) */ + {0x04c2, 0x11b9, 0x21eb, 0x3463}, + /* pow(3.0-0.4054, 4/3)/16 * pow(2, (0..3)/4) */ + {0x05a8, 0x1514, 0x2856, 0x3e4c}, + /* pow(4.0-0.4054, 4/3)/16 * pow(2, (0..3)/4) */ + {0x06ba, 0x1911, 0x2ff8, 0x4a16}, +}; + +const Word16 quantRecon[4][3] = { + {0x0800, 0x1429, 0x229d}, + {0x0983, 0x17f9, 0x292a}, + {0x0b50, 0x1c82, 0x30f4}, + {0x0d74, 0x21e7, 0x3a37}, }; -const int sampRateTab[NUM_SAMPLE_RATES] = {
- 96000, 88200, 64000, 48000, 44100, 32000,
- 24000, 22050, 16000, 12000, 11025, 8000
+const int sampRateTab[NUM_SAMPLE_RATES] = { + 96000, 88200, 64000, 48000, 44100, 32000, + 24000, 22050, 16000, 12000, 11025, 8000 }; -const int rates[8] = {
- 160, 240, 320, 400, 480, 560, 640, 0
-};
+const int rates[8] = { + 160, 240, 320, 400, 480, 560, 640, 0 +}; const int BandwithCoefTab[8][NUM_SAMPLE_RATES] = { { 7000, 7000, 4666, 3500, 3500, 2800, 2800, 2800, 2800, 2000, 2000, 2000}, @@ -1438,73 +1438,73 @@ const int BandwithCoefTab[8][NUM_SAMPLE_RATES] = { }; -/* total number of scale factor bands in one window */
-const UWord8 sfBandTotalShort[NUM_SAMPLE_RATES] = {
- 12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15
-};
-
-const UWord8 sfBandTotalLong[NUM_SAMPLE_RATES] = {
- 41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40
-};
-
-/* scale factor band tables */
-const int sfBandTabShortOffset[NUM_SAMPLE_RATES] = {0, 0, 0, 13, 13, 13, 28, 28, 44, 44, 44, 60};
-
-const short sfBandTabShort[76] = {
- /* short block 64, 88, 96 kHz [13] */
- 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128,
-
- /* short block 32, 44, 48 kHz [15] */
- 0, 4, 8, 12, 16, 20, 28, 36, 44, 56, 68, 80, 96, 112, 128,
-
- /* short block 22, 24 kHz [16] */
- 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 64, 76, 92, 108, 128,
-
- /* short block 11, 12, 16 kHz [16] */
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 60, 72, 88, 108, 128,
-
- /* short block 8 kHz [16] */
- 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 60, 72, 88, 108, 128
-};
-
-const int sfBandTabLongOffset[NUM_SAMPLE_RATES] = {0, 0, 42, 90, 90, 140, 192, 192, 240, 240, 240, 284};
-
-const short sfBandTabLong[325] = {
- /* long block 88, 96 kHz [42] */
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52,
- 56, 64, 72, 80, 88, 96, 108, 120, 132, 144, 156, 172, 188, 212,
- 240, 276, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024,
-
- /* long block 64 kHz [48] */
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64,
- 72, 80, 88, 100, 112, 124, 140, 156, 172, 192, 216, 240, 268, 304, 344, 384,
- 424, 464, 504, 544, 584, 624, 664, 704, 744, 784, 824, 864, 904, 944, 984, 1024,
-
- /* long block 44, 48 kHz [50] */
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 80, 88,
- 96, 108, 120, 132, 144, 160, 176, 196, 216, 240, 264, 292, 320, 352, 384, 416, 448,
- 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896, 928, 1024,
-
- /* long block 32 kHz [52] */
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 80, 88, 96,
- 108, 120, 132, 144, 160, 176, 196, 216, 240, 264, 292, 320, 352, 384, 416, 448, 480, 512,
- 544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896, 928, 960, 992, 1024,
-
- /* long block 22, 24 kHz [48] */
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 52, 60, 68, 76,
- 84, 92, 100, 108, 116, 124, 136, 148, 160, 172, 188, 204, 220, 240, 260, 284,
- 308, 336, 364, 396, 432, 468, 508, 552, 600, 652, 704, 768, 832, 896, 960, 1024,
-
- /* long block 11, 12, 16 kHz [44] */
- 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 100, 112, 124,
- 136, 148, 160, 172, 184, 196, 212, 228, 244, 260, 280, 300, 320, 344, 368,
- 396, 424, 456, 492, 532, 572, 616, 664, 716, 772, 832, 896, 960, 1024,
-
- /* long block 8 kHz [41] */
- 0, 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156,
- 172, 188, 204, 220, 236, 252, 268, 288, 308, 328, 348, 372, 396, 420,
- 448, 476, 508, 544, 580, 620, 664, 712, 764, 820, 880, 944, 1024
-};
+/* total number of scale factor bands in one window */ +const UWord8 sfBandTotalShort[NUM_SAMPLE_RATES] = { + 12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15 +}; + +const UWord8 sfBandTotalLong[NUM_SAMPLE_RATES] = { + 41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40 +}; + +/* scale factor band tables */ +const int sfBandTabShortOffset[NUM_SAMPLE_RATES] = {0, 0, 0, 13, 13, 13, 28, 28, 44, 44, 44, 60}; + +const short sfBandTabShort[76] = { + /* short block 64, 88, 96 kHz [13] */ + 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128, + + /* short block 32, 44, 48 kHz [15] */ + 0, 4, 8, 12, 16, 20, 28, 36, 44, 56, 68, 80, 96, 112, 128, + + /* short block 22, 24 kHz [16] */ + 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 64, 76, 92, 108, 128, + + /* short block 11, 12, 16 kHz [16] */ + 0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 60, 72, 88, 108, 128, + + /* short block 8 kHz [16] */ + 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 60, 72, 88, 108, 128 +}; + +const int sfBandTabLongOffset[NUM_SAMPLE_RATES] = {0, 0, 42, 90, 90, 140, 192, 192, 240, 240, 240, 284}; + +const short sfBandTabLong[325] = { + /* long block 88, 96 kHz [42] */ + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, + 56, 64, 72, 80, 88, 96, 108, 120, 132, 144, 156, 172, 188, 212, + 240, 276, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024, + + /* long block 64 kHz [48] */ + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64, + 72, 80, 88, 100, 112, 124, 140, 156, 172, 192, 216, 240, 268, 304, 344, 384, + 424, 464, 504, 544, 584, 624, 664, 704, 744, 784, 824, 864, 904, 944, 984, 1024, + + /* long block 44, 48 kHz [50] */ + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 80, 88, + 96, 108, 120, 132, 144, 160, 176, 196, 216, 240, 264, 292, 320, 352, 384, 416, 448, + 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896, 928, 1024, + + /* long block 32 kHz [52] */ + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 80, 88, 96, + 108, 120, 132, 144, 160, 176, 196, 216, 240, 264, 292, 320, 352, 384, 416, 448, 480, 512, + 544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896, 928, 960, 992, 1024, + + /* long block 22, 24 kHz [48] */ + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 52, 60, 68, 76, + 84, 92, 100, 108, 116, 124, 136, 148, 160, 172, 188, 204, 220, 240, 260, 284, + 308, 336, 364, 396, 432, 468, 508, 552, 600, 652, 704, 768, 832, 896, 960, 1024, + + /* long block 11, 12, 16 kHz [44] */ + 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 100, 112, 124, + 136, 148, 160, 172, 184, 196, 212, 228, 244, 260, 280, 300, 320, 344, 368, + 396, 424, 456, 492, 532, 572, 616, 664, 716, 772, 832, 896, 960, 1024, + + /* long block 8 kHz [41] */ + 0, 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, + 172, 188, 204, 220, 236, 252, 268, 288, 308, 328, 348, 372, 396, 420, + 448, 476, 508, 544, 580, 620, 664, 712, 764, 820, 880, 944, 1024 +}; /* these tables are used only for counting and @@ -2344,20 +2344,20 @@ const Word32 tnsCoeff4Borders[16]= }; -const unsigned char bitrevTab[17 + 129] =
-{
-/* 64 */
-0x01, 0x08, 0x02, 0x04, 0x03, 0x0c, 0x05, 0x0a, 0x07, 0x0e, 0x0b, 0x0d, 0x00, 0x06, 0x09, 0x0f,
-0x00,
-
-/* 512 */
-0x01, 0x40, 0x02, 0x20, 0x03, 0x60, 0x04, 0x10, 0x05, 0x50, 0x06, 0x30, 0x07, 0x70, 0x09, 0x48,
-0x0a, 0x28, 0x0b, 0x68, 0x0c, 0x18, 0x0d, 0x58, 0x0e, 0x38, 0x0f, 0x78, 0x11, 0x44, 0x12, 0x24,
-0x13, 0x64, 0x15, 0x54, 0x16, 0x34, 0x17, 0x74, 0x19, 0x4c, 0x1a, 0x2c, 0x1b, 0x6c, 0x1d, 0x5c,
-0x1e, 0x3c, 0x1f, 0x7c, 0x21, 0x42, 0x23, 0x62, 0x25, 0x52, 0x26, 0x32, 0x27, 0x72, 0x29, 0x4a,
-0x2b, 0x6a, 0x2d, 0x5a, 0x2e, 0x3a, 0x2f, 0x7a, 0x31, 0x46, 0x33, 0x66, 0x35, 0x56, 0x37, 0x76,
-0x39, 0x4e, 0x3b, 0x6e, 0x3d, 0x5e, 0x3f, 0x7e, 0x43, 0x61, 0x45, 0x51, 0x47, 0x71, 0x4b, 0x69,
-0x4d, 0x59, 0x4f, 0x79, 0x53, 0x65, 0x57, 0x75, 0x5b, 0x6d, 0x5f, 0x7d, 0x67, 0x73, 0x6f, 0x7b,
-0x00, 0x08, 0x14, 0x1c, 0x22, 0x2a, 0x36, 0x3e, 0x41, 0x49, 0x55, 0x5d, 0x63, 0x6b, 0x77, 0x7f,
-0x00,
+const unsigned char bitrevTab[17 + 129] = +{ +/* 64 */ +0x01, 0x08, 0x02, 0x04, 0x03, 0x0c, 0x05, 0x0a, 0x07, 0x0e, 0x0b, 0x0d, 0x00, 0x06, 0x09, 0x0f, +0x00, + +/* 512 */ +0x01, 0x40, 0x02, 0x20, 0x03, 0x60, 0x04, 0x10, 0x05, 0x50, 0x06, 0x30, 0x07, 0x70, 0x09, 0x48, +0x0a, 0x28, 0x0b, 0x68, 0x0c, 0x18, 0x0d, 0x58, 0x0e, 0x38, 0x0f, 0x78, 0x11, 0x44, 0x12, 0x24, +0x13, 0x64, 0x15, 0x54, 0x16, 0x34, 0x17, 0x74, 0x19, 0x4c, 0x1a, 0x2c, 0x1b, 0x6c, 0x1d, 0x5c, +0x1e, 0x3c, 0x1f, 0x7c, 0x21, 0x42, 0x23, 0x62, 0x25, 0x52, 0x26, 0x32, 0x27, 0x72, 0x29, 0x4a, +0x2b, 0x6a, 0x2d, 0x5a, 0x2e, 0x3a, 0x2f, 0x7a, 0x31, 0x46, 0x33, 0x66, 0x35, 0x56, 0x37, 0x76, +0x39, 0x4e, 0x3b, 0x6e, 0x3d, 0x5e, 0x3f, 0x7e, 0x43, 0x61, 0x45, 0x51, 0x47, 0x71, 0x4b, 0x69, +0x4d, 0x59, 0x4f, 0x79, 0x53, 0x65, 0x57, 0x75, 0x5b, 0x6d, 0x5f, 0x7d, 0x67, 0x73, 0x6f, 0x7b, +0x00, 0x08, 0x14, 0x1c, 0x22, 0x2a, 0x36, 0x3e, 0x41, 0x49, 0x55, 0x5d, 0x63, 0x6b, 0x77, 0x7f, +0x00, };
\ No newline at end of file diff --git a/media/libstagefright/codecs/aacenc/src/aacenc.c b/media/libstagefright/codecs/aacenc/src/aacenc.c index 552ae41..975f598 100644 --- a/media/libstagefright/codecs/aacenc/src/aacenc.c +++ b/media/libstagefright/codecs/aacenc/src/aacenc.c @@ -1,105 +1,105 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: aacenc.c
-
- Content: aac encoder interface functions
-
-*******************************************************************************/
-
-#include "voAAC.h"
-#include "typedef.h"
-#include "aacenc_core.h"
-#include "aac_rom.h"
-#include "cmnMemory.h"
-#include "memalign.h"
-
-/**
-* Init the audio codec module and return codec handle
-* \param phCodec [OUT] Return the video codec handle
-* \param vType [IN] The codec type if the module support multi codec.
-* \param pUserData [IN] The init param. It is memory operator or alloced memory
-* \retval VO_ERR_NONE Succeeded.
-*/
-VO_U32 VO_API voAACEncInit(VO_HANDLE * phCodec,VO_AUDIO_CODINGTYPE vType, VO_CODEC_INIT_USERDATA *pUserData)
-{
- AAC_ENCODER*hAacEnc;
- AACENC_CONFIG config;
- int error;
-
-#ifdef USE_DEAULT_MEM
- VO_MEM_OPERATOR voMemoprator;
-#endif
- VO_MEM_OPERATOR *pMemOP;
- int interMem;
-
- interMem = 0;
- error = 0;
-
- /* init the memory operator */
- if(pUserData == NULL || pUserData->memflag != VO_IMF_USERMEMOPERATOR || pUserData->memData == NULL )
- {
-#ifdef USE_DEAULT_MEM
- voMemoprator.Alloc = cmnMemAlloc;
- voMemoprator.Copy = cmnMemCopy;
- voMemoprator.Free = cmnMemFree;
- voMemoprator.Set = cmnMemSet;
- voMemoprator.Check = cmnMemCheck;
-
- interMem = 1;
-
- pMemOP = &voMemoprator;
-#else
- *phCodec = NULL;
- return VO_ERR_INVALID_ARG;
-#endif
- }
- else
- {
- pMemOP = (VO_MEM_OPERATOR *)pUserData->memData;
- }
-
- /* init the aac encoder handle */
- hAacEnc = (AAC_ENCODER*)mem_malloc(pMemOP, sizeof(AAC_ENCODER), 32, VO_INDEX_ENC_AAC);
- if(NULL == hAacEnc)
- {
- error = 1;
- }
-
- if(!error)
- {
- /* init the aac encoder intra memory */
- hAacEnc->intbuf = (short *)mem_malloc(pMemOP, AACENC_BLOCKSIZE*MAX_CHANNELS*sizeof(short), 32, VO_INDEX_ENC_AAC);
- if(NULL == hAacEnc->intbuf)
- {
- error = 1;
- }
- }
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: aacenc.c + + Content: aac encoder interface functions + +*******************************************************************************/ + +#include "voAAC.h" +#include "typedef.h" +#include "aacenc_core.h" +#include "aac_rom.h" +#include "cmnMemory.h" +#include "memalign.h" + +/** +* Init the audio codec module and return codec handle +* \param phCodec [OUT] Return the video codec handle +* \param vType [IN] The codec type if the module support multi codec. +* \param pUserData [IN] The init param. It is memory operator or alloced memory +* \retval VO_ERR_NONE Succeeded. +*/ +VO_U32 VO_API voAACEncInit(VO_HANDLE * phCodec,VO_AUDIO_CODINGTYPE vType, VO_CODEC_INIT_USERDATA *pUserData) +{ + AAC_ENCODER*hAacEnc; + AACENC_CONFIG config; + int error; + +#ifdef USE_DEAULT_MEM + VO_MEM_OPERATOR voMemoprator; +#endif + VO_MEM_OPERATOR *pMemOP; + int interMem; + + interMem = 0; + error = 0; + + /* init the memory operator */ + if(pUserData == NULL || pUserData->memflag != VO_IMF_USERMEMOPERATOR || pUserData->memData == NULL ) + { +#ifdef USE_DEAULT_MEM + voMemoprator.Alloc = cmnMemAlloc; + voMemoprator.Copy = cmnMemCopy; + voMemoprator.Free = cmnMemFree; + voMemoprator.Set = cmnMemSet; + voMemoprator.Check = cmnMemCheck; + + interMem = 1; + + pMemOP = &voMemoprator; +#else + *phCodec = NULL; + return VO_ERR_INVALID_ARG; +#endif + } + else + { + pMemOP = (VO_MEM_OPERATOR *)pUserData->memData; + } + + /* init the aac encoder handle */ + hAacEnc = (AAC_ENCODER*)mem_malloc(pMemOP, sizeof(AAC_ENCODER), 32, VO_INDEX_ENC_AAC); + if(NULL == hAacEnc) + { + error = 1; + } + + if(!error) + { + /* init the aac encoder intra memory */ + hAacEnc->intbuf = (short *)mem_malloc(pMemOP, AACENC_BLOCKSIZE*MAX_CHANNELS*sizeof(short), 32, VO_INDEX_ENC_AAC); + if(NULL == hAacEnc->intbuf) + { + error = 1; + } + } + if (!error) { /* init the aac encoder psychoacoustic */ error = (PsyNew(&hAacEnc->psyKernel, MAX_CHANNELS, pMemOP) || PsyOutNew(&hAacEnc->psyOut, pMemOP)); - }
-
+ } + if (!error) { /* init the aac encoder quantization elements */ error = QCOutNew(&hAacEnc->qcOut,MAX_CHANNELS, pMemOP); - }
-
+ } + if (!error) { /* init the aac encoder quantization state */ error = QCNew(&hAacEnc->qcKernel, pMemOP); @@ -116,380 +116,380 @@ VO_U32 VO_API voAACEncInit(VO_HANDLE * phCodec,VO_AUDIO_CODINGTYPE vType, VO_COD } *phCodec = NULL; return VO_ERR_OUTOF_MEMORY; - }
-
- /* init the aac encoder memory operator */
-#ifdef USE_DEAULT_MEM
- if(interMem)
- {
- hAacEnc->voMemoprator.Alloc = cmnMemAlloc;
- hAacEnc->voMemoprator.Copy = cmnMemCopy;
- hAacEnc->voMemoprator.Free = cmnMemFree;
- hAacEnc->voMemoprator.Set = cmnMemSet;
- hAacEnc->voMemoprator.Check = cmnMemCheck;
-
- pMemOP = &hAacEnc->voMemoprator;
- }
-#endif
- /* init the aac encoder default parameter */
- if(hAacEnc->initOK == 0)
- {
- AACENC_CONFIG config;
- config.adtsUsed = 1;
- config.bitRate = 128000;
- config.nChannelsIn = 2;
- config.nChannelsOut = 2;
- config.sampleRate = 44100;
- config.bandWidth = 20000;
-
- AacEncOpen(hAacEnc, config);
- }
-
- hAacEnc->voMemop = pMemOP;
-
- *phCodec = hAacEnc;
-
- return VO_ERR_NONE;
-}
-
-/**
-* Set input audio data.
-* \param hCodec [IN]] The Codec Handle which was created by Init function.
-* \param pInput [IN] The input buffer param.
-* \param pOutBuffer [OUT] The output buffer info.
-* \retval VO_ERR_NONE Succeeded.
-*/
-VO_U32 VO_API voAACEncSetInputData(VO_HANDLE hCodec, VO_CODECBUFFER * pInput)
-{
- AAC_ENCODER *hAacEnc;
- int length;
-
- if(NULL == hCodec || NULL == pInput || NULL == pInput->Buffer)
- {
- return VO_ERR_INVALID_ARG;
- }
-
- hAacEnc = (AAC_ENCODER *)hCodec;
-
- /* init input pcm buffer and length*/
- hAacEnc->inbuf = (short *)pInput->Buffer;
- hAacEnc->inlen = pInput->Length / sizeof(short);
- hAacEnc->uselength = 0;
-
- hAacEnc->encbuf = hAacEnc->inbuf;
- hAacEnc->enclen = hAacEnc->inlen;
-
- /* rebuild intra pcm buffer and length*/
- if(hAacEnc->intlen)
- {
- length = min(hAacEnc->config.nChannelsIn*AACENC_BLOCKSIZE - hAacEnc->intlen, hAacEnc->inlen);
- hAacEnc->voMemop->Copy(VO_INDEX_ENC_AAC, hAacEnc->intbuf + hAacEnc->intlen,
- hAacEnc->inbuf, length*sizeof(short));
-
- hAacEnc->encbuf = hAacEnc->intbuf;
- hAacEnc->enclen = hAacEnc->intlen + length;
-
- hAacEnc->inbuf += length;
- hAacEnc->inlen -= length;
- }
-
- return VO_ERR_NONE;
-}
-
-/**
-* Get the outut audio data
-* \param hCodec [IN]] The Codec Handle which was created by Init function.
-* \param pOutBuffer [OUT] The output audio data
-* \param pOutInfo [OUT] The dec module filled audio format and used the input size.
-* pOutInfo->InputUsed is total used the input size.
-* \retval VO_ERR_NONE Succeeded.
-* VO_ERR_INPUT_BUFFER_SMALL. The input was finished or the input data was not enought.
-*/
-VO_U32 VO_API voAACEncGetOutputData(VO_HANDLE hCodec, VO_CODECBUFFER * pOutput, VO_AUDIO_OUTPUTINFO * pOutInfo)
-{
- AAC_ENCODER* hAacEnc = (AAC_ENCODER*)hCodec;
- Word16 numAncDataBytes=0;
- Word32 inbuflen;
- int ret, length;
- if(NULL == hAacEnc)
- return VO_ERR_INVALID_ARG;
-
- inbuflen = AACENC_BLOCKSIZE*hAacEnc->config.nChannelsIn;
-
- /* check the input pcm buffer and length*/
- if(NULL == hAacEnc->encbuf || hAacEnc->enclen < inbuflen)
- {
- length = hAacEnc->enclen;
- if(hAacEnc->intlen == 0)
- {
- hAacEnc->voMemop->Copy(VO_INDEX_ENC_AAC, hAacEnc->intbuf,
- hAacEnc->encbuf, length*sizeof(short));
- hAacEnc->uselength += length*sizeof(short);
- }
- else
- {
- hAacEnc->uselength += (length - hAacEnc->intlen)*sizeof(short);
- }
-
- hAacEnc->intlen = length;
-
- pOutput->Length = 0;
- if(pOutInfo)
- pOutInfo->InputUsed = hAacEnc->uselength;
- return VO_ERR_INPUT_BUFFER_SMALL;
- }
-
- /* check the output aac buffer and length*/
- if(NULL == pOutput || NULL == pOutput->Buffer || pOutput->Length < (6144/8)*hAacEnc->config.nChannelsOut/(sizeof(Word32)))
- return VO_ERR_OUTPUT_BUFFER_SMALL;
-
- /* aac encoder core function */
- AacEncEncode( hAacEnc,
- (Word16*)hAacEnc->encbuf,
- NULL,
- &numAncDataBytes,
- pOutput->Buffer,
- &pOutput->Length);
-
- /* update the input pcm buffer and length*/
- if(hAacEnc->intlen)
- {
- length = inbuflen - hAacEnc->intlen;
- hAacEnc->encbuf = hAacEnc->inbuf;
- hAacEnc->enclen = hAacEnc->inlen;
- hAacEnc->uselength += length*sizeof(short);
- hAacEnc->intlen = 0;
- }
- else
- {
- hAacEnc->encbuf = hAacEnc->encbuf + inbuflen;
- hAacEnc->enclen = hAacEnc->enclen - inbuflen;
- hAacEnc->uselength += inbuflen*sizeof(short);
- }
-
- /* update the output aac information */
- if(pOutInfo)
- {
- pOutInfo->Format.Channels = hAacEnc->config.nChannelsOut;
- pOutInfo->Format.SampleRate = hAacEnc->config.sampleRate;
- pOutInfo->Format.SampleBits = 16;
- pOutInfo->InputUsed = hAacEnc->uselength;
- }
-
- return VO_ERR_NONE;
-}
-
-/**
-* Uninit the Codec.
-* \param hCodec [IN]] The Codec Handle which was created by Init function.
-* \retval VO_ERR_NONE Succeeded.
-*/
-VO_U32 VO_API voAACEncUninit(VO_HANDLE hCodec)
-{
- AAC_ENCODER* hAacEnc = (AAC_ENCODER*)hCodec;
-
- if(NULL != hAacEnc)
- {
- /* close the aac encoder */
- AacEncClose(hAacEnc, hAacEnc->voMemop);
-
- /* free the aac encoder handle*/
- mem_free(hAacEnc->voMemop, hAacEnc, VO_INDEX_ENC_AAC);
- hAacEnc = NULL;
- }
-
- return VO_ERR_NONE;
-}
-
-/**
-* Set the param for special target.
-* \param hCodec [IN]] The Codec Handle which was created by Init function.
-* \param uParamID [IN] The param ID.
-* \param pData [IN] The param value depend on the ID>
-* \retval VO_ERR_NONE Succeeded.
-*/
-VO_U32 VO_API voAACEncSetParam(VO_HANDLE hCodec, VO_S32 uParamID, VO_PTR pData)
-{
- AACENC_CONFIG config;
- AACENC_PARAM* pAAC_param;
- VO_AUDIO_FORMAT *pWAV_Format;
- AAC_ENCODER* hAacEnc = (AAC_ENCODER*)hCodec;
- int ret, i, bitrate, tmp;
- int SampleRateIdx;
-
- if(NULL == hAacEnc)
- return VO_ERR_INVALID_ARG;
-
- switch(uParamID)
- {
- case VO_PID_AAC_ENCPARAM: /* init aac encoder parameter*/
- AacInitDefaultConfig(&config);
- if(pData == NULL)
- return VO_ERR_INVALID_ARG;
- pAAC_param = (AACENC_PARAM*)pData;
- config.adtsUsed = pAAC_param->adtsUsed;
- config.bitRate = pAAC_param->bitRate;
- config.nChannelsIn = pAAC_param->nChannels;
- config.nChannelsOut = pAAC_param->nChannels;
- config.sampleRate = pAAC_param->sampleRate;
-
- /* check the channel */
- if(config.nChannelsIn< 1 || config.nChannelsIn > MAX_CHANNELS ||
- config.nChannelsOut < 1 || config.nChannelsOut > MAX_CHANNELS || config.nChannelsIn < config.nChannelsOut)
- return VO_ERR_AUDIO_UNSCHANNEL;
-
- /* check the samplerate */
- ret = -1;
- for(i = 0; i < NUM_SAMPLE_RATES; i++)
- {
- if(config.sampleRate == sampRateTab[i])
- {
- ret = 0;
- break;
- }
- }
- if(ret < 0)
- return VO_ERR_AUDIO_UNSSAMPLERATE;
-
- SampleRateIdx = i;
-
- tmp = 441;
- if(config.sampleRate%8000 == 0)
- tmp =480;
- /* check the bitrate */
- if(config.bitRate!=0 && (config.bitRate/config.nChannelsOut < 4000) ||
- (config.bitRate/config.nChannelsOut > 160000) ||
- (config.bitRate > config.sampleRate*6*config.nChannelsOut))
- {
- config.bitRate = 640*config.sampleRate/tmp*config.nChannelsOut;
-
- if(config.bitRate/config.nChannelsOut < 4000)
- config.bitRate = 4000 * config.nChannelsOut;
- else if(config.bitRate > config.sampleRate*6*config.nChannelsOut)
- config.bitRate = config.sampleRate*6*config.nChannelsOut;
- else if(config.bitRate/config.nChannelsOut > 160000)
- config.bitRate = config.nChannelsOut*160000;
- }
-
- /* check the bandwidth */
- bitrate = config.bitRate / config.nChannelsOut;
- bitrate = bitrate * tmp / config.sampleRate;
-
- for (i = 0; rates[i]; i++)
- {
- if (rates[i] >= bitrate)
- break;
- }
-
- config.bandWidth = BandwithCoefTab[i][SampleRateIdx];
-
- /* init aac encoder core */
- ret = AacEncOpen(hAacEnc, config);
- if(ret)
- return VO_ERR_AUDIO_UNSFEATURE;
- break;
- case VO_PID_AUDIO_FORMAT: /* init pcm channel and samplerate*/
- AacInitDefaultConfig(&config);
- if(pData == NULL)
- return VO_ERR_INVALID_ARG;
- pWAV_Format = (VO_AUDIO_FORMAT*)pData;
- config.adtsUsed = 1;
- config.nChannelsIn = pWAV_Format->Channels;
- config.nChannelsOut = pWAV_Format->Channels;
- config.sampleRate = pWAV_Format->SampleRate;
-
- /* check the channel */
- if(config.nChannelsIn< 1 || config.nChannelsIn > MAX_CHANNELS ||
- config.nChannelsOut < 1 || config.nChannelsOut > MAX_CHANNELS || config.nChannelsIn < config.nChannelsOut)
- return VO_ERR_AUDIO_UNSCHANNEL;
-
- /* check the samplebits */
- if(pWAV_Format->SampleBits != 16)
- {
- return VO_ERR_AUDIO_UNSFEATURE;
- }
-
- /* check the samplerate */
- ret = -1;
- for(i = 0; i < NUM_SAMPLE_RATES; i++)
- {
- if(config.sampleRate == sampRateTab[i])
- {
- ret = 0;
- break;
- }
- }
- if(ret < 0)
- return VO_ERR_AUDIO_UNSSAMPLERATE;
-
- SampleRateIdx = i;
-
- /* update the bitrates */
- tmp = 441;
- if(config.sampleRate%8000 == 0)
- tmp =480;
-
- config.bitRate = 640*config.sampleRate/tmp*config.nChannelsOut;
-
- if(config.bitRate/config.nChannelsOut < 4000)
- config.bitRate = 4000 * config.nChannelsOut;
- else if(config.bitRate > config.sampleRate*6*config.nChannelsOut)
- config.bitRate = config.sampleRate*6*config.nChannelsOut;
- else if(config.bitRate/config.nChannelsOut > 160000)
- config.bitRate = config.nChannelsOut*160000;
-
- /* check the bandwidth */
- bitrate = config.bitRate / config.nChannelsOut;
- bitrate = bitrate * tmp / config.sampleRate;
-
- for (i = 0; rates[i]; i++)
- {
- if (rates[i] >= bitrate)
- break;
- }
-
- config.bandWidth = BandwithCoefTab[i][SampleRateIdx];
-
- /* init aac encoder core */
- ret = AacEncOpen(hAacEnc, config);
- if(ret)
- return VO_ERR_AUDIO_UNSFEATURE;
- break;
- default:
- return VO_ERR_WRONG_PARAM_ID;
- }
-
- return VO_ERR_NONE;
-}
-
-/**
-* Get the param for special target.
-* \param hCodec [IN]] The Codec Handle which was created by Init function.
-* \param uParamID [IN] The param ID.
-* \param pData [IN] The param value depend on the ID>
-* \retval VO_ERR_NONE Succeeded.
-*/
-VO_U32 VO_API voAACEncGetParam(VO_HANDLE hCodec, VO_S32 uParamID, VO_PTR pData)
-{
- return VO_ERR_NONE;
-}
-
-/**
- * Get audio codec API interface
- * \param pEncHandle [out] Return the AAC Encoder handle.
- * \retval VO_ERR_OK Succeeded.
- */
-VO_S32 VO_API voGetAACEncAPI(VO_AUDIO_CODECAPI * pDecHandle)
-{
- if(pDecHandle == NULL)
- return VO_ERR_INVALID_ARG;
-
- pDecHandle->Init = voAACEncInit;
- pDecHandle->SetInputData = voAACEncSetInputData;
- pDecHandle->GetOutputData = voAACEncGetOutputData;
- pDecHandle->SetParam = voAACEncSetParam;
- pDecHandle->GetParam = voAACEncGetParam;
- pDecHandle->Uninit = voAACEncUninit;
-
- return VO_ERR_NONE;
+ } + + /* init the aac encoder memory operator */ +#ifdef USE_DEAULT_MEM + if(interMem) + { + hAacEnc->voMemoprator.Alloc = cmnMemAlloc; + hAacEnc->voMemoprator.Copy = cmnMemCopy; + hAacEnc->voMemoprator.Free = cmnMemFree; + hAacEnc->voMemoprator.Set = cmnMemSet; + hAacEnc->voMemoprator.Check = cmnMemCheck; + + pMemOP = &hAacEnc->voMemoprator; + } +#endif + /* init the aac encoder default parameter */ + if(hAacEnc->initOK == 0) + { + AACENC_CONFIG config; + config.adtsUsed = 1; + config.bitRate = 128000; + config.nChannelsIn = 2; + config.nChannelsOut = 2; + config.sampleRate = 44100; + config.bandWidth = 20000; + + AacEncOpen(hAacEnc, config); + } + + hAacEnc->voMemop = pMemOP; + + *phCodec = hAacEnc; + + return VO_ERR_NONE; +} + +/** +* Set input audio data. +* \param hCodec [IN]] The Codec Handle which was created by Init function. +* \param pInput [IN] The input buffer param. +* \param pOutBuffer [OUT] The output buffer info. +* \retval VO_ERR_NONE Succeeded. +*/ +VO_U32 VO_API voAACEncSetInputData(VO_HANDLE hCodec, VO_CODECBUFFER * pInput) +{ + AAC_ENCODER *hAacEnc; + int length; + + if(NULL == hCodec || NULL == pInput || NULL == pInput->Buffer) + { + return VO_ERR_INVALID_ARG; + } + + hAacEnc = (AAC_ENCODER *)hCodec; + + /* init input pcm buffer and length*/ + hAacEnc->inbuf = (short *)pInput->Buffer; + hAacEnc->inlen = pInput->Length / sizeof(short); + hAacEnc->uselength = 0; + + hAacEnc->encbuf = hAacEnc->inbuf; + hAacEnc->enclen = hAacEnc->inlen; + + /* rebuild intra pcm buffer and length*/ + if(hAacEnc->intlen) + { + length = min(hAacEnc->config.nChannelsIn*AACENC_BLOCKSIZE - hAacEnc->intlen, hAacEnc->inlen); + hAacEnc->voMemop->Copy(VO_INDEX_ENC_AAC, hAacEnc->intbuf + hAacEnc->intlen, + hAacEnc->inbuf, length*sizeof(short)); + + hAacEnc->encbuf = hAacEnc->intbuf; + hAacEnc->enclen = hAacEnc->intlen + length; + + hAacEnc->inbuf += length; + hAacEnc->inlen -= length; + } + + return VO_ERR_NONE; +} + +/** +* Get the outut audio data +* \param hCodec [IN]] The Codec Handle which was created by Init function. +* \param pOutBuffer [OUT] The output audio data +* \param pOutInfo [OUT] The dec module filled audio format and used the input size. +* pOutInfo->InputUsed is total used the input size. +* \retval VO_ERR_NONE Succeeded. +* VO_ERR_INPUT_BUFFER_SMALL. The input was finished or the input data was not enought. +*/ +VO_U32 VO_API voAACEncGetOutputData(VO_HANDLE hCodec, VO_CODECBUFFER * pOutput, VO_AUDIO_OUTPUTINFO * pOutInfo) +{ + AAC_ENCODER* hAacEnc = (AAC_ENCODER*)hCodec; + Word16 numAncDataBytes=0; + Word32 inbuflen; + int ret, length; + if(NULL == hAacEnc) + return VO_ERR_INVALID_ARG; + + inbuflen = AACENC_BLOCKSIZE*hAacEnc->config.nChannelsIn; + + /* check the input pcm buffer and length*/ + if(NULL == hAacEnc->encbuf || hAacEnc->enclen < inbuflen) + { + length = hAacEnc->enclen; + if(hAacEnc->intlen == 0) + { + hAacEnc->voMemop->Copy(VO_INDEX_ENC_AAC, hAacEnc->intbuf, + hAacEnc->encbuf, length*sizeof(short)); + hAacEnc->uselength += length*sizeof(short); + } + else + { + hAacEnc->uselength += (length - hAacEnc->intlen)*sizeof(short); + } + + hAacEnc->intlen = length; + + pOutput->Length = 0; + if(pOutInfo) + pOutInfo->InputUsed = hAacEnc->uselength; + return VO_ERR_INPUT_BUFFER_SMALL; + } + + /* check the output aac buffer and length*/ + if(NULL == pOutput || NULL == pOutput->Buffer || pOutput->Length < (6144/8)*hAacEnc->config.nChannelsOut/(sizeof(Word32))) + return VO_ERR_OUTPUT_BUFFER_SMALL; + + /* aac encoder core function */ + AacEncEncode( hAacEnc, + (Word16*)hAacEnc->encbuf, + NULL, + &numAncDataBytes, + pOutput->Buffer, + &pOutput->Length); + + /* update the input pcm buffer and length*/ + if(hAacEnc->intlen) + { + length = inbuflen - hAacEnc->intlen; + hAacEnc->encbuf = hAacEnc->inbuf; + hAacEnc->enclen = hAacEnc->inlen; + hAacEnc->uselength += length*sizeof(short); + hAacEnc->intlen = 0; + } + else + { + hAacEnc->encbuf = hAacEnc->encbuf + inbuflen; + hAacEnc->enclen = hAacEnc->enclen - inbuflen; + hAacEnc->uselength += inbuflen*sizeof(short); + } + + /* update the output aac information */ + if(pOutInfo) + { + pOutInfo->Format.Channels = hAacEnc->config.nChannelsOut; + pOutInfo->Format.SampleRate = hAacEnc->config.sampleRate; + pOutInfo->Format.SampleBits = 16; + pOutInfo->InputUsed = hAacEnc->uselength; + } + + return VO_ERR_NONE; +} + +/** +* Uninit the Codec. +* \param hCodec [IN]] The Codec Handle which was created by Init function. +* \retval VO_ERR_NONE Succeeded. +*/ +VO_U32 VO_API voAACEncUninit(VO_HANDLE hCodec) +{ + AAC_ENCODER* hAacEnc = (AAC_ENCODER*)hCodec; + + if(NULL != hAacEnc) + { + /* close the aac encoder */ + AacEncClose(hAacEnc, hAacEnc->voMemop); + + /* free the aac encoder handle*/ + mem_free(hAacEnc->voMemop, hAacEnc, VO_INDEX_ENC_AAC); + hAacEnc = NULL; + } + + return VO_ERR_NONE; +} + +/** +* Set the param for special target. +* \param hCodec [IN]] The Codec Handle which was created by Init function. +* \param uParamID [IN] The param ID. +* \param pData [IN] The param value depend on the ID> +* \retval VO_ERR_NONE Succeeded. +*/ +VO_U32 VO_API voAACEncSetParam(VO_HANDLE hCodec, VO_S32 uParamID, VO_PTR pData) +{ + AACENC_CONFIG config; + AACENC_PARAM* pAAC_param; + VO_AUDIO_FORMAT *pWAV_Format; + AAC_ENCODER* hAacEnc = (AAC_ENCODER*)hCodec; + int ret, i, bitrate, tmp; + int SampleRateIdx; + + if(NULL == hAacEnc) + return VO_ERR_INVALID_ARG; + + switch(uParamID) + { + case VO_PID_AAC_ENCPARAM: /* init aac encoder parameter*/ + AacInitDefaultConfig(&config); + if(pData == NULL) + return VO_ERR_INVALID_ARG; + pAAC_param = (AACENC_PARAM*)pData; + config.adtsUsed = pAAC_param->adtsUsed; + config.bitRate = pAAC_param->bitRate; + config.nChannelsIn = pAAC_param->nChannels; + config.nChannelsOut = pAAC_param->nChannels; + config.sampleRate = pAAC_param->sampleRate; + + /* check the channel */ + if(config.nChannelsIn< 1 || config.nChannelsIn > MAX_CHANNELS || + config.nChannelsOut < 1 || config.nChannelsOut > MAX_CHANNELS || config.nChannelsIn < config.nChannelsOut) + return VO_ERR_AUDIO_UNSCHANNEL; + + /* check the samplerate */ + ret = -1; + for(i = 0; i < NUM_SAMPLE_RATES; i++) + { + if(config.sampleRate == sampRateTab[i]) + { + ret = 0; + break; + } + } + if(ret < 0) + return VO_ERR_AUDIO_UNSSAMPLERATE; + + SampleRateIdx = i; + + tmp = 441; + if(config.sampleRate%8000 == 0) + tmp =480; + /* check the bitrate */ + if(config.bitRate!=0 && (config.bitRate/config.nChannelsOut < 4000) || + (config.bitRate/config.nChannelsOut > 160000) || + (config.bitRate > config.sampleRate*6*config.nChannelsOut)) + { + config.bitRate = 640*config.sampleRate/tmp*config.nChannelsOut; + + if(config.bitRate/config.nChannelsOut < 4000) + config.bitRate = 4000 * config.nChannelsOut; + else if(config.bitRate > config.sampleRate*6*config.nChannelsOut) + config.bitRate = config.sampleRate*6*config.nChannelsOut; + else if(config.bitRate/config.nChannelsOut > 160000) + config.bitRate = config.nChannelsOut*160000; + } + + /* check the bandwidth */ + bitrate = config.bitRate / config.nChannelsOut; + bitrate = bitrate * tmp / config.sampleRate; + + for (i = 0; rates[i]; i++) + { + if (rates[i] >= bitrate) + break; + } + + config.bandWidth = BandwithCoefTab[i][SampleRateIdx]; + + /* init aac encoder core */ + ret = AacEncOpen(hAacEnc, config); + if(ret) + return VO_ERR_AUDIO_UNSFEATURE; + break; + case VO_PID_AUDIO_FORMAT: /* init pcm channel and samplerate*/ + AacInitDefaultConfig(&config); + if(pData == NULL) + return VO_ERR_INVALID_ARG; + pWAV_Format = (VO_AUDIO_FORMAT*)pData; + config.adtsUsed = 1; + config.nChannelsIn = pWAV_Format->Channels; + config.nChannelsOut = pWAV_Format->Channels; + config.sampleRate = pWAV_Format->SampleRate; + + /* check the channel */ + if(config.nChannelsIn< 1 || config.nChannelsIn > MAX_CHANNELS || + config.nChannelsOut < 1 || config.nChannelsOut > MAX_CHANNELS || config.nChannelsIn < config.nChannelsOut) + return VO_ERR_AUDIO_UNSCHANNEL; + + /* check the samplebits */ + if(pWAV_Format->SampleBits != 16) + { + return VO_ERR_AUDIO_UNSFEATURE; + } + + /* check the samplerate */ + ret = -1; + for(i = 0; i < NUM_SAMPLE_RATES; i++) + { + if(config.sampleRate == sampRateTab[i]) + { + ret = 0; + break; + } + } + if(ret < 0) + return VO_ERR_AUDIO_UNSSAMPLERATE; + + SampleRateIdx = i; + + /* update the bitrates */ + tmp = 441; + if(config.sampleRate%8000 == 0) + tmp =480; + + config.bitRate = 640*config.sampleRate/tmp*config.nChannelsOut; + + if(config.bitRate/config.nChannelsOut < 4000) + config.bitRate = 4000 * config.nChannelsOut; + else if(config.bitRate > config.sampleRate*6*config.nChannelsOut) + config.bitRate = config.sampleRate*6*config.nChannelsOut; + else if(config.bitRate/config.nChannelsOut > 160000) + config.bitRate = config.nChannelsOut*160000; + + /* check the bandwidth */ + bitrate = config.bitRate / config.nChannelsOut; + bitrate = bitrate * tmp / config.sampleRate; + + for (i = 0; rates[i]; i++) + { + if (rates[i] >= bitrate) + break; + } + + config.bandWidth = BandwithCoefTab[i][SampleRateIdx]; + + /* init aac encoder core */ + ret = AacEncOpen(hAacEnc, config); + if(ret) + return VO_ERR_AUDIO_UNSFEATURE; + break; + default: + return VO_ERR_WRONG_PARAM_ID; + } + + return VO_ERR_NONE; +} + +/** +* Get the param for special target. +* \param hCodec [IN]] The Codec Handle which was created by Init function. +* \param uParamID [IN] The param ID. +* \param pData [IN] The param value depend on the ID> +* \retval VO_ERR_NONE Succeeded. +*/ +VO_U32 VO_API voAACEncGetParam(VO_HANDLE hCodec, VO_S32 uParamID, VO_PTR pData) +{ + return VO_ERR_NONE; +} + +/** + * Get audio codec API interface + * \param pEncHandle [out] Return the AAC Encoder handle. + * \retval VO_ERR_OK Succeeded. + */ +VO_S32 VO_API voGetAACEncAPI(VO_AUDIO_CODECAPI * pDecHandle) +{ + if(pDecHandle == NULL) + return VO_ERR_INVALID_ARG; + + pDecHandle->Init = voAACEncInit; + pDecHandle->SetInputData = voAACEncSetInputData; + pDecHandle->GetOutputData = voAACEncGetOutputData; + pDecHandle->SetParam = voAACEncSetParam; + pDecHandle->GetParam = voAACEncGetParam; + pDecHandle->Uninit = voAACEncUninit; + + return VO_ERR_NONE; }
\ No newline at end of file diff --git a/media/libstagefright/codecs/aacenc/src/aacenc_core.c b/media/libstagefright/codecs/aacenc/src/aacenc_core.c index 616475c..b69a017 100644 --- a/media/libstagefright/codecs/aacenc/src/aacenc_core.c +++ b/media/libstagefright/codecs/aacenc/src/aacenc_core.c @@ -1,23 +1,23 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: aacenc_core.c
-
- Content: aac encoder core functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: aacenc_core.c + + Content: aac encoder core functions + *******************************************************************************/ #include "typedef.h" @@ -58,9 +58,9 @@ Word16 AacEncOpen( AAC_ENCODER* hAacEnc, /* pointer to an encoder const AACENC_CONFIG config /* pre-initialized config struct */ ) { - Word32 i;
+ Word32 i; Word32 error = 0; - Word16 profile = 1;
+ Word16 profile = 1; ELEMENT_INFO *elInfo = NULL; @@ -76,7 +76,7 @@ Word16 AacEncOpen( AAC_ENCODER* hAacEnc, /* pointer to an encoder error = InitElementInfo (config.nChannelsOut, &hAacEnc->elInfo); } -
+ if (!error) { elInfo = &hAacEnc->elInfo; } @@ -95,8 +95,8 @@ Word16 AacEncOpen( AAC_ENCODER* hAacEnc, /* pointer to an encoder } /* use or not adts header */ - if(!error) {
- hAacEnc->qcOut.qcElement.adtsUsed = config.adtsUsed;
+ if(!error) { + hAacEnc->qcOut.qcElement.adtsUsed = config.adtsUsed; } /* init encoder quantization */ @@ -198,14 +198,14 @@ Word16 AacEncEncode(AAC_ENCODER *aacEnc, /*!< an encoder handle */ &aacEnc->qcOut, &aacEnc->psyOut, &globUsedBits, - ancBytes,
+ ancBytes, aacEnc->psyKernel.sampleRateIdx); updateBitres(&aacEnc->qcKernel, &aacEnc->qcOut); /* write out the bitstream */ - *numOutBytes = GetBitsAvail(aacEnc->hBitStream) >> 3;
+ *numOutBytes = GetBitsAvail(aacEnc->hBitStream) >> 3; return 0; } diff --git a/media/libstagefright/codecs/aacenc/src/adj_thr.c b/media/libstagefright/codecs/aacenc/src/adj_thr.c index 0dbd216..83b43a1 100644 --- a/media/libstagefright/codecs/aacenc/src/adj_thr.c +++ b/media/libstagefright/codecs/aacenc/src/adj_thr.c @@ -1,26 +1,26 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: adj_thr.c
-
- Content: Threshold compensation functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: adj_thr.c + + Content: Threshold compensation functions + *******************************************************************************/ -#include "basic_op.h"
+#include "basic_op.h" #include "oper_32b.h" #include "adj_thr_data.h" #include "adj_thr.h" @@ -29,14 +29,14 @@ #define minSnrLimit 0x6666 /* 1 dB */ -#define PEBITS_COEF 0x170a /* 0.18*(1 << 15)*/
-
-#define HOLE_THR_LONG 0x2873 /* 0.316*(1 << 15) */
-#define HOLE_THR_SHORT 0x4000 /* 0.5 *(1 << 15) */
-
-#define MS_THRSPREAD_COEF 0x7333 /* 0.9 * (1 << 15) */
-
-#define MIN_SNR_COEF 0x651f /* 3.16* (1 << (15 - 2)) */
+#define PEBITS_COEF 0x170a /* 0.18*(1 << 15)*/ + +#define HOLE_THR_LONG 0x2873 /* 0.316*(1 << 15) */ +#define HOLE_THR_SHORT 0x4000 /* 0.5 *(1 << 15) */ + +#define MS_THRSPREAD_COEF 0x7333 /* 0.9 * (1 << 15) */ + +#define MIN_SNR_COEF 0x651f /* 3.16* (1 << (15 - 2)) */ /* values for avoid hole flag */ enum _avoid_hole_state { @@ -67,15 +67,15 @@ static void calcThreshExp(Word32 thrExp[MAX_CHANNELS][MAX_GROUPED_SFB], PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], const Word16 nChannels) { - Word16 ch, sfb, sfbGrp;
+ Word16 ch, sfb, sfbGrp; Word32 *pthrExp, *psfbThre; for (ch=0; ch<nChannels; ch++) { - PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
- for(sfbGrp = 0; sfbGrp < psyOutChan->sfbCnt; sfbGrp+= psyOutChan->sfbPerGroup)
- pthrExp = &(thrExp[ch][sfbGrp]);
- psfbThre = psyOutChan->sfbThreshold + sfbGrp;
+ PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch]; + for(sfbGrp = 0; sfbGrp < psyOutChan->sfbCnt; sfbGrp+= psyOutChan->sfbPerGroup) + pthrExp = &(thrExp[ch][sfbGrp]); + psfbThre = psyOutChan->sfbThreshold + sfbGrp; for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { - *pthrExp = rsqrt(rsqrt(*psfbThre,INT_BITS),INT_BITS);
+ *pthrExp = rsqrt(rsqrt(*psfbThre,INT_BITS),INT_BITS); pthrExp++; psfbThre++; } } @@ -112,7 +112,7 @@ static void adaptMinSnr(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], } if (nSfb > 0) { - avgEn = avgEn / nSfb;
+ avgEn = avgEn / nSfb; log_avgEn = iLog4(avgEn); startRatio_x_avgEn = fixmul(msaParam->startRatio, avgEn); @@ -172,18 +172,18 @@ static void initAvoidHoleFlag(Word16 ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB], if (psyOutChan->windowSequence != SHORT_WINDOW) { for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){ - psfbSpreadEn = psyOutChan->sfbSpreadedEnergy + sfbGrp;
+ psfbSpreadEn = psyOutChan->sfbSpreadedEnergy + sfbGrp; for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { - *psfbSpreadEn = *psfbSpreadEn >> 1; /* 0.5 */
+ *psfbSpreadEn = *psfbSpreadEn >> 1; /* 0.5 */ ++psfbSpreadEn; } } } else { - for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){
+ for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){ psfbSpreadEn = psyOutChan->sfbSpreadedEnergy + sfbGrp; for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { - *psfbSpreadEn = (*psfbSpreadEn >> 1) + (*psfbSpreadEn >> 3); /* 0.63 */
+ *psfbSpreadEn = (*psfbSpreadEn >> 1) + (*psfbSpreadEn >> 3); /* 0.63 */ ++psfbSpreadEn; } } @@ -201,7 +201,7 @@ static void initAvoidHoleFlag(Word16 ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB], threshold = HOLE_THR_SHORT; for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){ - Word16 *psfbMinSnr = psyOutChan->sfbMinSnr + sfbGrp;
+ Word16 *psfbMinSnr = psyOutChan->sfbMinSnr + sfbGrp; for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { Word32 sfbEn, sfbEnm1, sfbEnp1, avgEn; @@ -219,7 +219,7 @@ static void initAvoidHoleFlag(Word16 ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB], if (sfbEn > avgEn && avgEn > 0) { Word32 tmpMinSnr; - shift = norm_l(sfbEn);
+ shift = norm_l(sfbEn); tmpMinSnr = Div_32(L_mpy_ls(avgEn, minSnrLimit) << shift, sfbEn << shift ); tmpMinSnr = max(tmpMinSnr, HOLE_THR_LONG); tmpMinSnr = max(tmpMinSnr, threshold); @@ -231,7 +231,7 @@ static void initAvoidHoleFlag(Word16 ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB], Word32 tmpMinSnr; Word32 minSnrEn = L_mpy_wx(avgEn, *psfbMinSnr); - if(minSnrEn < sfbEn) {
+ if(minSnrEn < sfbEn) { shift = norm_l(sfbEn); tmpMinSnr = Div_32( minSnrEn << shift, sfbEn<<shift); } @@ -242,7 +242,7 @@ static void initAvoidHoleFlag(Word16 ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB], *psfbMinSnr = (min((tmpMinSnr >> 2), mult(*psfbMinSnr, MIN_SNR_COEF)) << 2); - }
+ } psfbMinSnr++; } } @@ -266,17 +266,17 @@ static void initAvoidHoleFlag(Word16 ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB], psyOutChanM->sfbMinSnr[sfb] = MAX_16; } else { - shift = norm_l(sfbEnM);
- psyOutChanM->sfbMinSnr[sfb] = min(max(psyOutChanM->sfbMinSnr[sfb],
+ shift = norm_l(sfbEnM); + psyOutChanM->sfbMinSnr[sfb] = min(max(psyOutChanM->sfbMinSnr[sfb], round16(Div_32(maxThr<<shift, sfbEnM << shift))), minSnrLimit); } if(maxThr >= sfbEnS) { psyOutChanS->sfbMinSnr[sfb] = MAX_16; } - else {
+ else { shift = norm_l(sfbEnS); - psyOutChanS->sfbMinSnr[sfb] = min(max(psyOutChanS->sfbMinSnr[sfb],
+ psyOutChanS->sfbMinSnr[sfb] = min(max(psyOutChanS->sfbMinSnr[sfb], round16(Div_32(maxThr << shift, sfbEnS << shift))), minSnrLimit); } @@ -295,7 +295,7 @@ static void initAvoidHoleFlag(Word16 ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB], for(ch=0; ch<nChannels; ch++) { PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch]; for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){ - Word16 *pahFlag = ahFlag[ch] + sfbGrp;
+ Word16 *pahFlag = ahFlag[ch] + sfbGrp; for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { if ((psyOutChan->sfbSpreadedEnergy[sfbGrp+sfb] > psyOutChan->sfbEnergy[sfbGrp+sfb]) || @@ -328,7 +328,7 @@ static void calcPeNoAH(Word16 *pe, PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], const Word16 nChannels) { - Word16 ch, sfb, sfbGrp;
+ Word16 ch, sfb, sfbGrp; int ipe, iconstPart, inActiveLines; ipe = 0; @@ -347,7 +347,7 @@ static void calcPeNoAH(Word16 *pe, } } } - }
+ } *pe = saturate(ipe); *constPart = saturate(iconstPart); @@ -367,14 +367,14 @@ static void reduceThresholds(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], const Word32 redVal) { Word32 sfbThrReduced; - Word32 *psfbEn, *psfbThr;
- Word16 ch, sfb, sfbGrp;
+ Word32 *psfbEn, *psfbThr; + Word16 ch, sfb, sfbGrp; for(ch=0; ch<nChannels; ch++) { PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch]; for(sfbGrp=0; sfbGrp<psyOutChan->sfbCnt; sfbGrp+=psyOutChan->sfbPerGroup) { - psfbEn = psyOutChan->sfbEnergy + sfbGrp;
- psfbThr = psyOutChan->sfbThreshold + sfbGrp;
+ psfbEn = psyOutChan->sfbEnergy + sfbGrp; + psfbThr = psyOutChan->sfbThreshold + sfbGrp; for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { if (*psfbEn > *psfbThr) { @@ -391,8 +391,8 @@ static void reduceThresholds(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], ahFlag[ch][sfbGrp+sfb] = AH_ACTIVE; } *psfbThr = sfbThrReduced; - }
-
+ } + psfbEn++; psfbThr++; } } @@ -419,8 +419,8 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], PSY_OUT_CHANNEL *psyOutChan; PE_CHANNEL_DATA *peChanData; Word32 deltaSfbPe; - Word32 normFactor;
- Word32 *psfbPeFactors;
+ Word32 normFactor; + Word32 *psfbPeFactors; Word16 *psfbNActiveLines, *pahFlag; Word32 sfbEn, sfbThr; Word32 sfbThrReduced; @@ -431,9 +431,9 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], psyOutChan = &psyOutChannel[ch]; peChanData = &peData->peChannelData[ch]; for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){ - psfbPeFactors = peData->sfbPeFactors[ch] + sfbGrp;
- psfbNActiveLines = peChanData->sfbNActiveLines + sfbGrp;
- pahFlag = ahFlag[ch] + sfbGrp;
+ psfbPeFactors = peData->sfbPeFactors[ch] + sfbGrp; + psfbNActiveLines = peChanData->sfbNActiveLines + sfbGrp; + pahFlag = ahFlag[ch] + sfbGrp; for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { Word32 redThrExp = thrExp[ch][sfbGrp+sfb] + redVal; @@ -444,8 +444,8 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], } else { *psfbPeFactors = 0; - }
- psfbPeFactors++;
+ } + psfbPeFactors++; pahFlag++; psfbNActiveLines++; } } @@ -457,9 +457,9 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], psyOutChan = &psyOutChannel[ch]; peChanData = &peData->peChannelData[ch]; for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){ - psfbPeFactors = peData->sfbPeFactors[ch] + sfbGrp;
- psfbNActiveLines = peChanData->sfbNActiveLines + sfbGrp;
- pahFlag = ahFlag[ch] + sfbGrp;
+ psfbPeFactors = peData->sfbPeFactors[ch] + sfbGrp; + psfbNActiveLines = peChanData->sfbNActiveLines + sfbGrp; + pahFlag = ahFlag[ch] + sfbGrp; for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { /* pe difference for this sfb */ deltaSfbPe = *psfbPeFactors * deltaPe; @@ -487,7 +487,7 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], if(thrFactor > sfbThr) { - shift = norm_l(thrFactor);
+ shift = norm_l(thrFactor); sfbThrReduced = Div_32( sfbThr << shift, thrFactor<<shift ); } else { @@ -506,8 +506,8 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], } psyOutChan->sfbThreshold[sfbGrp+sfb] = sfbThrReduced; - }
-
+ } + pahFlag++; psfbNActiveLines++; psfbPeFactors++; } } @@ -539,8 +539,8 @@ static void reduceMinSnr(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], for (sfb=sfbSubWin; sfb<psyOutChannel[0].sfbCnt; sfb+=psyOutChannel[0].sfbPerGroup) { /* loop over all channels */ - PE_CHANNEL_DATA* peChan = peData->peChannelData;
- PSY_OUT_CHANNEL* psyOutCh = psyOutChannel;
+ PE_CHANNEL_DATA* peChan = peData->peChannelData; + PSY_OUT_CHANNEL* psyOutCh = psyOutChannel; for (ch=0; ch<nChannels; ch++) { if (ahFlag[ch][sfb] != NO_AH && psyOutCh->sfbMinSnr[sfb] < minSnrLimit) { @@ -553,7 +553,7 @@ static void reduceMinSnr(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], peChan->sfbPe[sfb]; peData->pe = peData->pe + deltaPe; peChan->pe = peChan->pe + deltaPe; - }
+ } peChan += 1; psyOutCh += 1; } /* stop if enough has been saved */ @@ -659,7 +659,7 @@ static void allowMoreHoles(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], if(ahCnt) { Word32 iahCnt; - shift = norm_l(ahCnt);
+ shift = norm_l(ahCnt); iahCnt = Div_32( 1 << shift, ahCnt << shift ); avgEn = fixmul(avgEn, iahCnt); } @@ -831,7 +831,7 @@ static Word16 calcBitSave(Word16 fillLevel, fillLevel = max(fillLevel, clipLow); fillLevel = min(fillLevel, clipHigh); - if(clipHigh-clipLow)
+ if(clipHigh-clipLow) bitsave = (maxBitSave - (((maxBitSave-minBitSave)*(fillLevel-clipLow))/ (clipHigh-clipLow))); @@ -860,7 +860,7 @@ static Word16 calcBitSpend(Word16 fillLevel, fillLevel = max(fillLevel, clipLow); fillLevel = min(fillLevel, clipHigh); - if(clipHigh-clipLow)
+ if(clipHigh-clipLow) bitspend = (minBitSpend + ((maxBitSpend - minBitSpend)*(fillLevel - clipLow) / (clipHigh-clipLow))); @@ -964,7 +964,7 @@ static Word16 bitresCalcBitFac( const Word16 bitresBits, bresParam->clipSpendLow, bresParam->clipSpendHigh, bresParam->minBitSpend, bresParam->maxBitSpend); - if(adjThrChan->peMax != adjThrChan->peMin)
+ if(adjThrChan->peMax != adjThrChan->peMin) bitresFac = (100 - bitSave) + extract_l(((bitSpend + bitSave) * (pex - adjThrChan->peMin)) / (adjThrChan->peMax - adjThrChan->peMin)); else @@ -1196,7 +1196,7 @@ void AdjustThresholds(ADJ_THR_STATE *adjThrState, if (peOffsDiff > 0) { Word32 temp = 1000 - (nChannels * 200); - chBitDistribution[ch] = chBitDistribution[ch] +
+ chBitDistribution[ch] = chBitDistribution[ch] + (temp * peData.peChannelData[ch].pe) / peOffsDiff; } } diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/AutoCorrelation_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/AutoCorrelation_v5.s index 48edd4f..e0885f1 100644 --- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/AutoCorrelation_v5.s +++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/AutoCorrelation_v5.s @@ -1,167 +1,167 @@ -@/*
-@ ** Copyright 2003-2010, VisualOn, Inc.
-@ **
-@ ** Licensed under the Apache License, Version 2.0 (the "License");
-@ ** you may not use this file except in compliance with the License.
-@ ** You may obtain a copy of the License at
-@ **
-@ ** http://www.apache.org/licenses/LICENSE-2.0
-@ **
-@ ** Unless required by applicable law or agreed to in writing, software
-@ ** distributed under the License is distributed on an "AS IS" BASIS,
-@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@ ** See the License for the specific language governing permissions and
-@ ** limitations under the License.
-@ */
-
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-@ File: AutoCorrelation_v5.s
-@
-@ Content: AutoCorrelation function armv5 assemble
-@
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
-
- .section .text
- .global AutoCorrelation
-
-AutoCorrelation:
- stmdb sp!, {r4 - r11, lr}
-
- sub r13, r13, #20
-
- mov r5, r0
- mov r7, r1
- mov r9, r3
- mov r2, r2, lsl #16
- mov r0, #0
- mov r4, r2, asr #16
- mov r8, #0
- cmp r4, #0
- ble L136
-
- cmp r4, #8
- mov r2, #0
- blt L133
-
- sub r12, r4, #8
-L132:
- ldr r6, [r5, r2]
- add r2, r2, #4
- smulbb r3, r6, r6
- ldr r1, [r5, r2]
- smultt r10, r6, r6
- mov r3, r3, asr #9
- smulbb r6, r1, r1
- mov r10, r10, asr #9
- qadd r0, r0, r3
- smultt r11, r1, r1
- add r2, r2, #4
- qadd r0, r0, r10
- mov r6, r6, asr #9
- mov r11, r11, asr #9
- ldr r1, [r5, r2]
- qadd r0, r0, r6
- smulbb r10, r1, r1
- smultt r6, r1, r1
- qadd r0, r0, r11
- mov r10, r10, asr #9
- mov r6, r6, asr #9
- qadd r0, r0, r10
- add r2, r2, #4
- add r8, r8, #6
-
- qadd r0, r0, r6
- cmp r8, r12
- blt L132
-L133:
- ldrsh r6, [r5, r2]
- mul r10, r6, r6
- add r2, r2, #2
- mov r1, r10, asr #9
- qadd r0, r0, r1
-L134:
- add r8, r8, #1
- cmp r8, r4
- blt L133
-L135:
-L136:
- str r0, [r7, #0]
- cmp r0, #0
- beq L1320
-L137:
- mov r2, r9, lsl #16
- mov r8, #1
- mov r2, r2, asr #16
- cmp r2, #1
- ble L1319
-L138:
-L139:
- sub r4, r4, #1
- mov r14, #0
- mov r3, #0
- cmp r4, #0
- ble L1317
-L1310:
- cmp r4, #6
- addlt r6, r5, r8, lsl #1
- blt L1314
-L1311:
- add r6, r5, r8, lsl #1
- sub r12, r4, #6
- str r8, [r13, #8]
- str r7, [r13, #4]
-L1312:
- mov r1, r3, lsl #1
- ldrsh r7, [r6, r1]
- ldrsh r10, [r5, r1]
- add r8, r1, r6
- add r9, r5, r1
- mul r7, r10, r7
- ldrsh r1, [r8, #2]
- ldrsh r10, [r8, #4]
- add r7, r14, r7, asr #9
- ldrsh r0, [r9, #2]
- ldrsh r11, [r9, #4]
- mul r1, r0, r1
- ldrsh r14, [r8, #6]
- mul r10, r11, r10
- add r7, r7, r1, asr #9
- ldrsh r8, [r8, #8]
- add r3, r3, #5
- ldrsh r11, [r9, #6]
- ldrsh r1, [r9, #8]
- mul r14, r11, r14
- add r7, r7, r10, asr #9
- mul r1, r1, r8
- add r14, r7, r14, asr #9
- cmp r3, r12
- add r14, r14, r1, asr #9
- ble L1312
-L1313:
- ldr r8, [r13, #8]
- ldr r7, [r13, #4]
-L1314:
-L1315:
- mov r12, r3, lsl #1
- ldrsh r9, [r6, r12]
- ldrsh r12, [r5, r12]
- add r3, r3, #1
- cmp r3, r4
- mul r12, r12, r9
- add r14, r14, r12, asr #9
- blt L1315
-L1316:
-L1317:
- str r14, [r7, +r8, lsl #2]
- add r8, r8, #1
- cmp r8, r2
- blt L139
-
-L1319:
-L1320:
- add r13, r13, #20
- ldmia sp!, {r4 - r11, pc}
-
- @ENDP @ |AutoCorrelation|
- .end
+@/* +@ ** Copyright 2003-2010, VisualOn, Inc. +@ ** +@ ** Licensed under the Apache License, Version 2.0 (the "License"); +@ ** you may not use this file except in compliance with the License. +@ ** You may obtain a copy of the License at +@ ** +@ ** http://www.apache.org/licenses/LICENSE-2.0 +@ ** +@ ** Unless required by applicable law or agreed to in writing, software +@ ** distributed under the License is distributed on an "AS IS" BASIS, +@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@ ** See the License for the specific language governing permissions and +@ ** limitations under the License. +@ */ + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ File: AutoCorrelation_v5.s +@ +@ Content: AutoCorrelation function armv5 assemble +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + + .section .text + .global AutoCorrelation + +AutoCorrelation: + stmdb sp!, {r4 - r11, lr} + + sub r13, r13, #20 + + mov r5, r0 + mov r7, r1 + mov r9, r3 + mov r2, r2, lsl #16 + mov r0, #0 + mov r4, r2, asr #16 + mov r8, #0 + cmp r4, #0 + ble L136 + + cmp r4, #8 + mov r2, #0 + blt L133 + + sub r12, r4, #8 +L132: + ldr r6, [r5, r2] + add r2, r2, #4 + smulbb r3, r6, r6 + ldr r1, [r5, r2] + smultt r10, r6, r6 + mov r3, r3, asr #9 + smulbb r6, r1, r1 + mov r10, r10, asr #9 + qadd r0, r0, r3 + smultt r11, r1, r1 + add r2, r2, #4 + qadd r0, r0, r10 + mov r6, r6, asr #9 + mov r11, r11, asr #9 + ldr r1, [r5, r2] + qadd r0, r0, r6 + smulbb r10, r1, r1 + smultt r6, r1, r1 + qadd r0, r0, r11 + mov r10, r10, asr #9 + mov r6, r6, asr #9 + qadd r0, r0, r10 + add r2, r2, #4 + add r8, r8, #6 + + qadd r0, r0, r6 + cmp r8, r12 + blt L132 +L133: + ldrsh r6, [r5, r2] + mul r10, r6, r6 + add r2, r2, #2 + mov r1, r10, asr #9 + qadd r0, r0, r1 +L134: + add r8, r8, #1 + cmp r8, r4 + blt L133 +L135: +L136: + str r0, [r7, #0] + cmp r0, #0 + beq L1320 +L137: + mov r2, r9, lsl #16 + mov r8, #1 + mov r2, r2, asr #16 + cmp r2, #1 + ble L1319 +L138: +L139: + sub r4, r4, #1 + mov r14, #0 + mov r3, #0 + cmp r4, #0 + ble L1317 +L1310: + cmp r4, #6 + addlt r6, r5, r8, lsl #1 + blt L1314 +L1311: + add r6, r5, r8, lsl #1 + sub r12, r4, #6 + str r8, [r13, #8] + str r7, [r13, #4] +L1312: + mov r1, r3, lsl #1 + ldrsh r7, [r6, r1] + ldrsh r10, [r5, r1] + add r8, r1, r6 + add r9, r5, r1 + mul r7, r10, r7 + ldrsh r1, [r8, #2] + ldrsh r10, [r8, #4] + add r7, r14, r7, asr #9 + ldrsh r0, [r9, #2] + ldrsh r11, [r9, #4] + mul r1, r0, r1 + ldrsh r14, [r8, #6] + mul r10, r11, r10 + add r7, r7, r1, asr #9 + ldrsh r8, [r8, #8] + add r3, r3, #5 + ldrsh r11, [r9, #6] + ldrsh r1, [r9, #8] + mul r14, r11, r14 + add r7, r7, r10, asr #9 + mul r1, r1, r8 + add r14, r7, r14, asr #9 + cmp r3, r12 + add r14, r14, r1, asr #9 + ble L1312 +L1313: + ldr r8, [r13, #8] + ldr r7, [r13, #4] +L1314: +L1315: + mov r12, r3, lsl #1 + ldrsh r9, [r6, r12] + ldrsh r12, [r5, r12] + add r3, r3, #1 + cmp r3, r4 + mul r12, r12, r9 + add r14, r14, r12, asr #9 + blt L1315 +L1316: +L1317: + str r14, [r7, +r8, lsl #2] + add r8, r8, #1 + cmp r8, r2 + blt L139 + +L1319: +L1320: + add r13, r13, #20 + ldmia sp!, {r4 - r11, pc} + + @ENDP @ |AutoCorrelation| + .end diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/CalcWindowEnergy_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/CalcWindowEnergy_v5.s index 7997e98..75b916c 100644 --- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/CalcWindowEnergy_v5.s +++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/CalcWindowEnergy_v5.s @@ -1,112 +1,112 @@ -@/*
-@ ** Copyright 2003-2010, VisualOn, Inc.
-@ **
-@ ** Licensed under the Apache License, Version 2.0 (the "License");
-@ ** you may not use this file except in compliance with the License.
-@ ** You may obtain a copy of the License at
-@ **
-@ ** http://www.apache.org/licenses/LICENSE-2.0
-@ **
-@ ** Unless required by applicable law or agreed to in writing, software
-@ ** distributed under the License is distributed on an "AS IS" BASIS,
-@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@ ** See the License for the specific language governing permissions and
-@ ** limitations under the License.
-@ */
-
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-@ File: CalcWindowEnergy_v5.s
-@
-@ Content: CalcWindowEnergy function armv5 assemble
-@
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
- .section .text
-
- .global CalcWindowEnergy
-
-CalcWindowEnergy:
- stmdb sp!, {r4 - r11, lr}
- sub r13, r13, #20
-
- mov r3, r3, lsl #16
- ldr r10, [r0, #168] @ states0 = blockSwitchingControl->iirStates[0];
- mov r3, r3, asr #16
- ldr r11, [r0, #172] @ states1 = blockSwitchingControl->iirStates[1];
-
- mov r2, r2, lsl #16
- ldr r12, hiPassCoeff @ Coeff0 = hiPassCoeff[0];
- mov r2, r2, asr #16
- ldr r14, hiPassCoeff + 4 @ Coeff1 = hiPassCoeff[1];
-
- mov r8, #0 @ w=0
- mov r5, #0 @ wOffset = 0;
-
-BLOCK_BEGIN:
- mov r6, #0 @ accuUE = 0;
- mov r7, #0 @ accuFE = 0;
- mov r4, #0 @ i=0
-
- str r8, [r13, #4]
- str r0, [r13, #8]
- str r3, [r13, #12]
-
-ENERGY_BEG:
- mov r9, r5, lsl #1
- ldrsh r9, [r1, r9] @ tempUnfiltered = timeSignal[tidx];
-
- add r5, r5, r2 @ tidx = tidx + chIncrement;
-
- smulwb r3, r14, r9 @ accu1 = L_mpy_ls(Coeff1, tempUnfiltered);
- smull r0, r8, r12, r11 @ accu2 = fixmul( Coeff0, states1 );
-
- mov r3, r3, lsl #1
- mov r8, r8, lsl #1
-
- sub r0, r3, r10 @ accu3 = accu1 - states0;
- sub r8, r0, r8 @ out = accu3 - accu2;
-
- mov r10, r3 @ states0 = accu1;
- mov r11, r8 @ states1 = out;
-
- mul r3, r9, r9
- mov r8, r8, asr #16
-
- add r4, r4, #1
- add r6, r6, r3, asr #7
-
- mul r9, r8, r8
- ldr r3, [r13, #12]
-
- add r7, r7, r9, asr #7
-
- cmp r4, r3
- blt ENERGY_BEG
-
- ldr r0, [r13, #8]
- ldr r8, [r13, #4]
-
-ENERGY_END:
- add r4, r0, r8, lsl #2
-
- str r6, [r4, #72]
- add r8, r8, #1
- str r7, [r4, #136]
-
- cmp r8, #8
- blt BLOCK_BEGIN
-
-BLOCK_END:
- str r10, [r0, #168]
- str r11, [r0, #172]
- mov r0, #1
-
- add r13, r13, #20
- ldmia sp!, {r4 - r11, pc}
-
-hiPassCoeff:
- .word 0xbec8b439
- .word 0x609d4952
-
- @ENDP
- .end
+@/* +@ ** Copyright 2003-2010, VisualOn, Inc. +@ ** +@ ** Licensed under the Apache License, Version 2.0 (the "License"); +@ ** you may not use this file except in compliance with the License. +@ ** You may obtain a copy of the License at +@ ** +@ ** http://www.apache.org/licenses/LICENSE-2.0 +@ ** +@ ** Unless required by applicable law or agreed to in writing, software +@ ** distributed under the License is distributed on an "AS IS" BASIS, +@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@ ** See the License for the specific language governing permissions and +@ ** limitations under the License. +@ */ + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ File: CalcWindowEnergy_v5.s +@ +@ Content: CalcWindowEnergy function armv5 assemble +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + .section .text + + .global CalcWindowEnergy + +CalcWindowEnergy: + stmdb sp!, {r4 - r11, lr} + sub r13, r13, #20 + + mov r3, r3, lsl #16 + ldr r10, [r0, #168] @ states0 = blockSwitchingControl->iirStates[0]; + mov r3, r3, asr #16 + ldr r11, [r0, #172] @ states1 = blockSwitchingControl->iirStates[1]; + + mov r2, r2, lsl #16 + ldr r12, hiPassCoeff @ Coeff0 = hiPassCoeff[0]; + mov r2, r2, asr #16 + ldr r14, hiPassCoeff + 4 @ Coeff1 = hiPassCoeff[1]; + + mov r8, #0 @ w=0 + mov r5, #0 @ wOffset = 0; + +BLOCK_BEGIN: + mov r6, #0 @ accuUE = 0; + mov r7, #0 @ accuFE = 0; + mov r4, #0 @ i=0 + + str r8, [r13, #4] + str r0, [r13, #8] + str r3, [r13, #12] + +ENERGY_BEG: + mov r9, r5, lsl #1 + ldrsh r9, [r1, r9] @ tempUnfiltered = timeSignal[tidx]; + + add r5, r5, r2 @ tidx = tidx + chIncrement; + + smulwb r3, r14, r9 @ accu1 = L_mpy_ls(Coeff1, tempUnfiltered); + smull r0, r8, r12, r11 @ accu2 = fixmul( Coeff0, states1 ); + + mov r3, r3, lsl #1 + mov r8, r8, lsl #1 + + sub r0, r3, r10 @ accu3 = accu1 - states0; + sub r8, r0, r8 @ out = accu3 - accu2; + + mov r10, r3 @ states0 = accu1; + mov r11, r8 @ states1 = out; + + mul r3, r9, r9 + mov r8, r8, asr #16 + + add r4, r4, #1 + add r6, r6, r3, asr #7 + + mul r9, r8, r8 + ldr r3, [r13, #12] + + add r7, r7, r9, asr #7 + + cmp r4, r3 + blt ENERGY_BEG + + ldr r0, [r13, #8] + ldr r8, [r13, #4] + +ENERGY_END: + add r4, r0, r8, lsl #2 + + str r6, [r4, #72] + add r8, r8, #1 + str r7, [r4, #136] + + cmp r8, #8 + blt BLOCK_BEGIN + +BLOCK_END: + str r10, [r0, #168] + str r11, [r0, #172] + mov r0, #1 + + add r13, r13, #20 + ldmia sp!, {r4 - r11, pc} + +hiPassCoeff: + .word 0xbec8b439 + .word 0x609d4952 + + @ENDP + .end diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/PrePostMDCT_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/PrePostMDCT_v5.s index d4d3edb..38fe092 100644 --- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/PrePostMDCT_v5.s +++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/PrePostMDCT_v5.s @@ -1,131 +1,131 @@ -@/*
-@ ** Copyright 2003-2010, VisualOn, Inc.
-@ **
-@ ** Licensed under the Apache License, Version 2.0 (the "License");
-@ ** you may not use this file except in compliance with the License.
-@ ** You may obtain a copy of the License at
-@ **
-@ ** http://www.apache.org/licenses/LICENSE-2.0
-@ **
-@ ** Unless required by applicable law or agreed to in writing, software
-@ ** distributed under the License is distributed on an "AS IS" BASIS,
-@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@ ** See the License for the specific language governing permissions and
-@ ** limitations under the License.
-@ */
-
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-@ File: PrePostMDCT_v5.s
-@
-@ Content: premdct and postmdct function armv5 assemble
-@
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
- .section .text
- .global PreMDCT
-
-PreMDCT:
- stmdb sp!, {r4 - r11, lr}
-
- add r9, r0, r1, lsl #2
- sub r3, r9, #8
-
- movs r1, r1, asr #2
- beq PreMDCT_END
-
-PreMDCT_LOOP:
- ldr r8, [r2], #4
- ldr r9, [r2], #4
-
- ldrd r4, [r0]
- ldrd r6, [r3]
-
- smull r14, r11, r4, r8 @ MULHIGH(tr1, cosa)
- smull r10, r12, r7, r8 @ MULHIGH(ti1, cosa)
-
- smull r14, r8, r7, r9 @ MULHIGH(ti1, sina)
- smull r7, r10, r4, r9 @ MULHIGH(tr1, sina)
-
- add r11, r11, r8 @ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@
- sub r7, r12, r10 @ MULHIGH(ti1, cosa) - MULHIGH(tr1, sina)
-
- ldr r8, [r2], #4
- ldr r9, [r2], #4
-
- smull r14, r4, r6, r8 @ MULHIGH(tr2, cosa)
- smull r10, r12, r5, r8 @ MULHIGH(ti2, cosa)
-
- smull r14, r8, r5, r9 @ MULHIGH(ti2, sina)
- smull r5, r10, r6, r9 @ MULHIGH(tr2, sina)
-
- add r8, r8, r4
- sub r9, r12, r10
-
- mov r6, r11
-
- strd r6, [r0]
- strd r8, [r3]
-
- subs r1, r1, #1
- sub r3, r3, #8
- add r0, r0, #8
- bne PreMDCT_LOOP
-
-PreMDCT_END:
- ldmia sp!, {r4 - r11, pc}
- @ENDP @ |PreMDCT|
-
- .section .text
- .global PostMDCT
-
-PostMDCT:
- stmdb sp!, {r4 - r11, lr}
-
- add r9, r0, r1, lsl #2
- sub r3, r9, #8
-
- movs r1, r1, asr #2
- beq PostMDCT_END
-
-PostMDCT_LOOP:
- ldr r8, [r2], #4
- ldr r9, [r2], #4
-
- ldrd r4, [r0]
- ldrd r6, [r3]
-
- smull r14, r11, r4, r8 @ MULHIGH(tr1, cosa)
- smull r10, r12, r5, r8 @ MULHIGH(ti1, cosa)
-
- smull r14, r8, r5, r9 @ MULHIGH(ti1, sina)
- smull r5, r10, r4, r9 @ MULHIGH(tr1, sina)
-
- add r4, r11, r8 @ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@
- sub r11, r10, r12 @ MULHIGH(ti1, cosa) - MULHIGH(tr1, sina)@
-
- ldr r8, [r2], #4 @
- ldr r9, [r2], #4
-
- smull r14, r5, r6, r8 @ MULHIGH(tr2, cosa)
- smull r10, r12, r7, r8 @ MULHIGH(ti2, cosa)
-
- smull r14, r8, r7, r9 @ MULHIGH(ti2, sina)
- smull r7, r10, r6, r9 @ MULHIGH(tr2, sina)
-
- add r6, r8, r5 @ MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2)@
- sub r5, r10, r12 @ MULHIGH(sinb, tr2) - MULHIGH(cosb, ti2)@
-
- mov r7, r11
-
- strd r4, [r0]
- strd r6, [r3]
-
- subs r1, r1, #1
- sub r3, r3, #8
- add r0, r0, #8
- bne PostMDCT_LOOP
-
-PostMDCT_END:
- ldmia sp!, {r4 - r11, pc}
- @ENDP @ |PostMDCT|
+@/* +@ ** Copyright 2003-2010, VisualOn, Inc. +@ ** +@ ** Licensed under the Apache License, Version 2.0 (the "License"); +@ ** you may not use this file except in compliance with the License. +@ ** You may obtain a copy of the License at +@ ** +@ ** http://www.apache.org/licenses/LICENSE-2.0 +@ ** +@ ** Unless required by applicable law or agreed to in writing, software +@ ** distributed under the License is distributed on an "AS IS" BASIS, +@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@ ** See the License for the specific language governing permissions and +@ ** limitations under the License. +@ */ + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ File: PrePostMDCT_v5.s +@ +@ Content: premdct and postmdct function armv5 assemble +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + .section .text + .global PreMDCT + +PreMDCT: + stmdb sp!, {r4 - r11, lr} + + add r9, r0, r1, lsl #2 + sub r3, r9, #8 + + movs r1, r1, asr #2 + beq PreMDCT_END + +PreMDCT_LOOP: + ldr r8, [r2], #4 + ldr r9, [r2], #4 + + ldrd r4, [r0] + ldrd r6, [r3] + + smull r14, r11, r4, r8 @ MULHIGH(tr1, cosa) + smull r10, r12, r7, r8 @ MULHIGH(ti1, cosa) + + smull r14, r8, r7, r9 @ MULHIGH(ti1, sina) + smull r7, r10, r4, r9 @ MULHIGH(tr1, sina) + + add r11, r11, r8 @ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@ + sub r7, r12, r10 @ MULHIGH(ti1, cosa) - MULHIGH(tr1, sina) + + ldr r8, [r2], #4 + ldr r9, [r2], #4 + + smull r14, r4, r6, r8 @ MULHIGH(tr2, cosa) + smull r10, r12, r5, r8 @ MULHIGH(ti2, cosa) + + smull r14, r8, r5, r9 @ MULHIGH(ti2, sina) + smull r5, r10, r6, r9 @ MULHIGH(tr2, sina) + + add r8, r8, r4 + sub r9, r12, r10 + + mov r6, r11 + + strd r6, [r0] + strd r8, [r3] + + subs r1, r1, #1 + sub r3, r3, #8 + add r0, r0, #8 + bne PreMDCT_LOOP + +PreMDCT_END: + ldmia sp!, {r4 - r11, pc} + @ENDP @ |PreMDCT| + + .section .text + .global PostMDCT + +PostMDCT: + stmdb sp!, {r4 - r11, lr} + + add r9, r0, r1, lsl #2 + sub r3, r9, #8 + + movs r1, r1, asr #2 + beq PostMDCT_END + +PostMDCT_LOOP: + ldr r8, [r2], #4 + ldr r9, [r2], #4 + + ldrd r4, [r0] + ldrd r6, [r3] + + smull r14, r11, r4, r8 @ MULHIGH(tr1, cosa) + smull r10, r12, r5, r8 @ MULHIGH(ti1, cosa) + + smull r14, r8, r5, r9 @ MULHIGH(ti1, sina) + smull r5, r10, r4, r9 @ MULHIGH(tr1, sina) + + add r4, r11, r8 @ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@ + sub r11, r10, r12 @ MULHIGH(ti1, cosa) - MULHIGH(tr1, sina)@ + + ldr r8, [r2], #4 @ + ldr r9, [r2], #4 + + smull r14, r5, r6, r8 @ MULHIGH(tr2, cosa) + smull r10, r12, r7, r8 @ MULHIGH(ti2, cosa) + + smull r14, r8, r7, r9 @ MULHIGH(ti2, sina) + smull r7, r10, r6, r9 @ MULHIGH(tr2, sina) + + add r6, r8, r5 @ MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2)@ + sub r5, r10, r12 @ MULHIGH(sinb, tr2) - MULHIGH(cosb, ti2)@ + + mov r7, r11 + + strd r4, [r0] + strd r6, [r3] + + subs r1, r1, #1 + sub r3, r3, #8 + add r0, r0, #8 + bne PostMDCT_LOOP + +PostMDCT_END: + ldmia sp!, {r4 - r11, pc} + @ENDP @ |PostMDCT| .end
\ No newline at end of file diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/R4R8First_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/R4R8First_v5.s index 370daf4..b30881a 100644 --- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/R4R8First_v5.s +++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/R4R8First_v5.s @@ -1,252 +1,252 @@ -@/*
-@ ** Copyright 2003-2010, VisualOn, Inc.
-@ **
-@ ** Licensed under the Apache License, Version 2.0 (the "License");
-@ ** you may not use this file except in compliance with the License.
-@ ** You may obtain a copy of the License at
-@ **
-@ ** http://www.apache.org/licenses/LICENSE-2.0
-@ **
-@ ** Unless required by applicable law or agreed to in writing, software
-@ ** distributed under the License is distributed on an "AS IS" BASIS,
-@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@ ** See the License for the specific language governing permissions and
-@ ** limitations under the License.
-@ */
-
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-@ File: R4R8First_v5.s
-@
-@ Content: Radix8First and Radix4First function armv5 assemble
-@
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
- .section .text
- .global Radix4First
-
-Radix4First:
- stmdb sp!, {r4 - r11, lr}
-
- movs r10, r1
- mov r11, r0
- beq Radix4First_END
-
-Radix4First_LOOP:
- ldrd r0, [r11]
- ldrd r2, [r11, #8]
- ldrd r4, [r11, #16]
- ldrd r6, [r11, #24]
-
- add r8, r0, r2
- add r9, r1, r3
-
- sub r0, r0, r2
- sub r1, r1, r3
-
- add r2, r4, r6
- add r3, r5, r7
-
- sub r4, r4, r6
- sub r5, r5, r7
-
- add r6, r8, r2
- add r7, r9, r3
-
- sub r8, r8, r2
- sub r9, r9, r3
-
- add r2, r0, r5
- sub r3, r1, r4
-
- sub r0, r0, r5
- add r1, r1, r4
-
- strd r6, [r11]
- strd r2, [r11, #8]
- strd r8, [r11, #16]
- strd r0, [r11, #24]
-
- subs r10, r10, #1
- add r11, r11, #32
- bne Radix4First_LOOP
-
-Radix4First_END:
- ldmia sp!, {r4 - r11, pc}
- @ENDP @ |Radix4First|
-
- .section .text
- .global Radix8First
-
-Radix8First:
- stmdb sp!, {r4 - r11, lr}
- sub sp, sp, #0x24
-
- mov r12, r1
- mov r14, r0
- cmp r12, #0
- beq Radix8First_END
-
-Radix8First_LOOP:
- ldrd r0, [r14]
- ldrd r2, [r14, #8]
- ldrd r4, [r14, #16]
- ldrd r6, [r14, #24]
-
- add r8, r0, r2 @ r0 = buf[0] + buf[2]@
- add r9, r1, r3 @ i0 = buf[1] + buf[3]@
-
- sub r0, r0, r2 @ r1 = buf[0] - buf[2]@
- sub r1, r1, r3 @ i1 = buf[1] - buf[3]@
-
- add r2, r4, r6 @ r2 = buf[4] + buf[6]@
- add r3, r5, r7 @ i2 = buf[5] + buf[7]@
-
- sub r4, r4, r6 @ r3 = buf[4] - buf[6]@
- sub r5, r5, r7 @ i3 = buf[5] - buf[7]@
-
- add r6, r8, r2 @ r4 = (r0 + r2) >> 1@
- add r7, r9, r3 @ i4 = (i0 + i2) >> 1@
-
- sub r8, r8, r2 @ r5 = (r0 - r2) >> 1@
- sub r9, r9, r3 @ i5 = (i0 - i2) >> 1@
-
- sub r2, r0, r5 @ r6 = (r1 - i3) >> 1@
- add r3, r1, r4 @ i6 = (i1 + r3) >> 1@
-
- add r0, r0, r5 @ r7 = (r1 + i3) >> 1@
- sub r1, r1, r4 @ i7 = (i1 - r3) >> 1@
-
- mov r6, r6, asr #1 @
- mov r7, r7, asr #1 @
-
- mov r8, r8, asr #1
- mov r9, r9, asr #1
-
- mov r2, r2, asr #1
- mov r3, r3, asr #1
-
- mov r0, r0, asr #1
- mov r1, r1, asr #1
-
- str r6, [sp]
- str r7, [sp, #4]
-
- str r8, [sp, #8]
- str r9, [sp, #12]
-
- str r2, [sp, #16]
- str r3, [sp, #20]
-
- str r0, [sp, #24]
- str r1, [sp, #28]
-
- ldrd r2, [r14, #32]
- ldrd r4, [r14, #40]
- ldrd r6, [r14, #48]
- ldrd r8, [r14, #56]
-
- add r0, r2, r4 @ r0 = buf[ 8] + buf[10]@
- add r1, r3, r5 @ i0 = buf[ 9] + buf[11]@
-
- sub r2, r2, r4 @ r1 = buf[ 8] - buf[10]@
- sub r3, r3, r5 @ i1 = buf[ 9] - buf[11]@
-
- add r4, r6, r8 @ r2 = buf[12] + buf[14]@
- add r5, r7, r9 @ i2 = buf[13] + buf[15]@
-
- sub r6, r6, r8 @ r3 = buf[12] - buf[14]@
- sub r7, r7, r9 @ i3 = buf[13] - buf[15]@
-
- add r8, r0, r4 @ t0 = (r0 + r2)
- add r9, r1, r5 @ t1 = (i0 + i2)
-
- sub r0, r0, r4 @ t2 = (r0 - r2)
- sub r1, r1, r5 @ t3 = (i0 - i2)
-
- mov r8, r8, asr #1
- ldr r4, [sp]
-
- mov r9, r9, asr #1
- ldr r5, [sp, #4]
-
- mov r0, r0, asr #1
- mov r1, r1, asr #1
-
- add r10, r4, r8 @ buf[ 0] = r4 + t0@
- add r11, r5, r9 @ buf[ 1] = i4 + t1@
-
- sub r4, r4, r8 @ buf[ 8] = r4 - t0@
- sub r5, r5, r9 @ buf[ 9] = i4 - t1@
-
- strd r10, [r14]
- strd r4, [r14, #32]
-
- ldr r10, [sp, #8]
- ldr r11, [sp, #12]
-
- add r4, r10, r1 @ buf[ 4] = r5 + t3@
- sub r5, r11, r0 @ buf[ 5] = i5 - t2@
-
- sub r10, r10, r1 @ buf[12] = r5 - t3@
- add r11, r11, r0 @ buf[13] = i5 + t2@
-
- strd r4, [r14, #16]
- strd r10, [r14, #48]
-
- sub r0, r2, r7 @ r0 = r1 - i3@
- add r1, r3, r6 @ i0 = i1 + r3@
-
- ldr r11, DATATab
-
- add r2, r2, r7 @ r2 = r1 + i3@
- sub r3, r3, r6 @ i2 = i1 - r3@
-
- sub r4, r0, r1 @ r0 - i0
- add r5, r0, r1 @ r0 + i0
-
- sub r0, r2, r3 @ r2 - i2
- add r1, r2, r3 @ r2 + i2
-
- smull r8, r6, r4, r11
- smull r9, r7, r5, r11
-
- ldr r2, [sp, #16]
- ldr r3, [sp, #20]
-
- smull r8, r4, r0, r11
- smull r9, r5, r1, r11
-
- ldr r10, [sp, #24]
- ldr r11, [sp, #28]
-
- sub r8, r2, r6
- sub r9, r3, r7
-
- add r2, r2, r6
- add r3, r3, r7
-
- add r6, r10, r5
- sub r7, r11, r4
-
- sub r0, r10, r5
- add r1, r11, r4
-
- strd r6, [r14, #8]
- strd r8, [r14, #24]
- strd r0, [r14, #40]
- strd r2, [r14, #56]
-
- subs r12, r12, #1
- add r14, r14, #64
-
- bne Radix8First_LOOP
-
-Radix8First_END:
- add sp, sp, #0x24
- ldmia sp!, {r4 - r11, pc}
-
-DATATab:
- .word 0x5a82799a
-
- @ENDP @ |Radix8First|
+@/* +@ ** Copyright 2003-2010, VisualOn, Inc. +@ ** +@ ** Licensed under the Apache License, Version 2.0 (the "License"); +@ ** you may not use this file except in compliance with the License. +@ ** You may obtain a copy of the License at +@ ** +@ ** http://www.apache.org/licenses/LICENSE-2.0 +@ ** +@ ** Unless required by applicable law or agreed to in writing, software +@ ** distributed under the License is distributed on an "AS IS" BASIS, +@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@ ** See the License for the specific language governing permissions and +@ ** limitations under the License. +@ */ + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ File: R4R8First_v5.s +@ +@ Content: Radix8First and Radix4First function armv5 assemble +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + .section .text + .global Radix4First + +Radix4First: + stmdb sp!, {r4 - r11, lr} + + movs r10, r1 + mov r11, r0 + beq Radix4First_END + +Radix4First_LOOP: + ldrd r0, [r11] + ldrd r2, [r11, #8] + ldrd r4, [r11, #16] + ldrd r6, [r11, #24] + + add r8, r0, r2 + add r9, r1, r3 + + sub r0, r0, r2 + sub r1, r1, r3 + + add r2, r4, r6 + add r3, r5, r7 + + sub r4, r4, r6 + sub r5, r5, r7 + + add r6, r8, r2 + add r7, r9, r3 + + sub r8, r8, r2 + sub r9, r9, r3 + + add r2, r0, r5 + sub r3, r1, r4 + + sub r0, r0, r5 + add r1, r1, r4 + + strd r6, [r11] + strd r2, [r11, #8] + strd r8, [r11, #16] + strd r0, [r11, #24] + + subs r10, r10, #1 + add r11, r11, #32 + bne Radix4First_LOOP + +Radix4First_END: + ldmia sp!, {r4 - r11, pc} + @ENDP @ |Radix4First| + + .section .text + .global Radix8First + +Radix8First: + stmdb sp!, {r4 - r11, lr} + sub sp, sp, #0x24 + + mov r12, r1 + mov r14, r0 + cmp r12, #0 + beq Radix8First_END + +Radix8First_LOOP: + ldrd r0, [r14] + ldrd r2, [r14, #8] + ldrd r4, [r14, #16] + ldrd r6, [r14, #24] + + add r8, r0, r2 @ r0 = buf[0] + buf[2]@ + add r9, r1, r3 @ i0 = buf[1] + buf[3]@ + + sub r0, r0, r2 @ r1 = buf[0] - buf[2]@ + sub r1, r1, r3 @ i1 = buf[1] - buf[3]@ + + add r2, r4, r6 @ r2 = buf[4] + buf[6]@ + add r3, r5, r7 @ i2 = buf[5] + buf[7]@ + + sub r4, r4, r6 @ r3 = buf[4] - buf[6]@ + sub r5, r5, r7 @ i3 = buf[5] - buf[7]@ + + add r6, r8, r2 @ r4 = (r0 + r2) >> 1@ + add r7, r9, r3 @ i4 = (i0 + i2) >> 1@ + + sub r8, r8, r2 @ r5 = (r0 - r2) >> 1@ + sub r9, r9, r3 @ i5 = (i0 - i2) >> 1@ + + sub r2, r0, r5 @ r6 = (r1 - i3) >> 1@ + add r3, r1, r4 @ i6 = (i1 + r3) >> 1@ + + add r0, r0, r5 @ r7 = (r1 + i3) >> 1@ + sub r1, r1, r4 @ i7 = (i1 - r3) >> 1@ + + mov r6, r6, asr #1 @ + mov r7, r7, asr #1 @ + + mov r8, r8, asr #1 + mov r9, r9, asr #1 + + mov r2, r2, asr #1 + mov r3, r3, asr #1 + + mov r0, r0, asr #1 + mov r1, r1, asr #1 + + str r6, [sp] + str r7, [sp, #4] + + str r8, [sp, #8] + str r9, [sp, #12] + + str r2, [sp, #16] + str r3, [sp, #20] + + str r0, [sp, #24] + str r1, [sp, #28] + + ldrd r2, [r14, #32] + ldrd r4, [r14, #40] + ldrd r6, [r14, #48] + ldrd r8, [r14, #56] + + add r0, r2, r4 @ r0 = buf[ 8] + buf[10]@ + add r1, r3, r5 @ i0 = buf[ 9] + buf[11]@ + + sub r2, r2, r4 @ r1 = buf[ 8] - buf[10]@ + sub r3, r3, r5 @ i1 = buf[ 9] - buf[11]@ + + add r4, r6, r8 @ r2 = buf[12] + buf[14]@ + add r5, r7, r9 @ i2 = buf[13] + buf[15]@ + + sub r6, r6, r8 @ r3 = buf[12] - buf[14]@ + sub r7, r7, r9 @ i3 = buf[13] - buf[15]@ + + add r8, r0, r4 @ t0 = (r0 + r2) + add r9, r1, r5 @ t1 = (i0 + i2) + + sub r0, r0, r4 @ t2 = (r0 - r2) + sub r1, r1, r5 @ t3 = (i0 - i2) + + mov r8, r8, asr #1 + ldr r4, [sp] + + mov r9, r9, asr #1 + ldr r5, [sp, #4] + + mov r0, r0, asr #1 + mov r1, r1, asr #1 + + add r10, r4, r8 @ buf[ 0] = r4 + t0@ + add r11, r5, r9 @ buf[ 1] = i4 + t1@ + + sub r4, r4, r8 @ buf[ 8] = r4 - t0@ + sub r5, r5, r9 @ buf[ 9] = i4 - t1@ + + strd r10, [r14] + strd r4, [r14, #32] + + ldr r10, [sp, #8] + ldr r11, [sp, #12] + + add r4, r10, r1 @ buf[ 4] = r5 + t3@ + sub r5, r11, r0 @ buf[ 5] = i5 - t2@ + + sub r10, r10, r1 @ buf[12] = r5 - t3@ + add r11, r11, r0 @ buf[13] = i5 + t2@ + + strd r4, [r14, #16] + strd r10, [r14, #48] + + sub r0, r2, r7 @ r0 = r1 - i3@ + add r1, r3, r6 @ i0 = i1 + r3@ + + ldr r11, DATATab + + add r2, r2, r7 @ r2 = r1 + i3@ + sub r3, r3, r6 @ i2 = i1 - r3@ + + sub r4, r0, r1 @ r0 - i0 + add r5, r0, r1 @ r0 + i0 + + sub r0, r2, r3 @ r2 - i2 + add r1, r2, r3 @ r2 + i2 + + smull r8, r6, r4, r11 + smull r9, r7, r5, r11 + + ldr r2, [sp, #16] + ldr r3, [sp, #20] + + smull r8, r4, r0, r11 + smull r9, r5, r1, r11 + + ldr r10, [sp, #24] + ldr r11, [sp, #28] + + sub r8, r2, r6 + sub r9, r3, r7 + + add r2, r2, r6 + add r3, r3, r7 + + add r6, r10, r5 + sub r7, r11, r4 + + sub r0, r10, r5 + add r1, r11, r4 + + strd r6, [r14, #8] + strd r8, [r14, #24] + strd r0, [r14, #40] + strd r2, [r14, #56] + + subs r12, r12, #1 + add r14, r14, #64 + + bne Radix8First_LOOP + +Radix8First_END: + add sp, sp, #0x24 + ldmia sp!, {r4 - r11, pc} + +DATATab: + .word 0x5a82799a + + @ENDP @ |Radix8First| .end
\ No newline at end of file diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/Radix4FFT_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/Radix4FFT_v5.s index db8e5d8..bc069b4 100644 --- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/Radix4FFT_v5.s +++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/Radix4FFT_v5.s @@ -1,169 +1,169 @@ -@/*
-@ ** Copyright 2003-2010, VisualOn, Inc.
-@ **
-@ ** Licensed under the Apache License, Version 2.0 (the "License");
-@ ** you may not use this file except in compliance with the License.
-@ ** You may obtain a copy of the License at
-@ **
-@ ** http://www.apache.org/licenses/LICENSE-2.0
-@ **
-@ ** Unless required by applicable law or agreed to in writing, software
-@ ** distributed under the License is distributed on an "AS IS" BASIS,
-@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@ ** See the License for the specific language governing permissions and
-@ ** limitations under the License.
-@ */
-
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-@ File: Radix4FFT_v5.s
-@
-@ Content: Radix4FFT armv5 assemble
-@
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- .section .text
- .global Radix4FFT
-
-Radix4FFT:
- stmdb sp!, {r4 - r11, lr}
- sub sp, sp, #32
-
- mov r1, r1, asr #2
- cmp r1, #0
- beq Radix4FFT_END
-
-Radix4FFT_LOOP1:
- mov r14, r0 @ xptr = buf@
- mov r10, r1 @ i = num@
- mov r9, r2, lsl #3 @ step = 2*bgn@
- cmp r10, #0
- str r0, [sp]
- str r1, [sp, #4]
- str r2, [sp, #8]
- str r3, [sp, #12]
- beq Radix4FFT_LOOP1_END
-
-Radix4FFT_LOOP2:
- mov r12, r3 @ csptr = twidTab@
- mov r11, r2 @ j = bgn
- cmp r11, #0
- str r10, [sp, #16]
- beq Radix4FFT_LOOP2_END
-
-Radix4FFT_LOOP3:
- str r11, [sp, #20]
-
- ldrd r0, [r14, #0] @ r0 = xptr[0]@ r1 = xptr[1]@
- add r14, r14, r9 @ xptr += step@
-
- ldrd r10, [r14, #0] @ r2 = xptr[0]@ r3 = xptr[1]@
- ldr r8, [r12], #4 @ cosxsinx = csptr[0]@
-
- smulwt r4, r10, r8 @ L_mpy_wx(cosx, t0)
- smulwt r3, r11, r8 @ L_mpy_wx(cosx, t1)
-
- smlawb r2, r11, r8, r4 @ r2 = L_mpy_wx(cosx, t0) + L_mpy_wx(sinx, t1)@
- smulwb r5, r10, r8 @ L_mpy_wx(sinx, t0)
-
- mov r10, r0, asr #2 @ t0 = r0 >> 2@
- mov r11, r1, asr #2 @ t1 = r1 >> 2@
-
- sub r3, r3, r5 @ r3 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@
- add r14, r14, r9 @ xptr += step@
-
- sub r0, r10, r2 @ r0 = t0 - r2@
- sub r1, r11, r3 @ r1 = t1 - r3@
-
- add r2, r10, r2 @ r2 = t0 + r2@
- add r3, r11, r3 @ r3 = t1 + r3@
-
- str r2, [sp, #24]
- str r3, [sp, #28]
-
- ldrd r10, [r14, #0] @ r4 = xptr[0]@ r5 = xptr[1]@
- ldr r8, [r12], #4 @ cosxsinx = csptr[1]@
-
- smulwt r6, r10, r8 @ L_mpy_wx(cosx, t0)
- smulwt r5, r11, r8 @ L_mpy_wx(cosx, t1)
-
- smlawb r4, r11, r8, r6 @ r4 = L_mpy_wx(cosx, t0) + L_mpy_wx(sinx, t1)@
- smulwb r7, r10, r8 @ L_mpy_wx(sinx, t0)
-
- add r14, r14, r9 @ xptr += step@
- sub r5, r5, r7 @ r5 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@
-
- ldrd r10, [r14] @ r6 = xptr[0]@ r7 = xptr[1]@
- ldr r8, [r12], #4 @ cosxsinx = csptr[1]@
-
- smulwt r2, r10, r8 @ L_mpy_wx(cosx, t0)
- smulwt r7, r11, r8 @ L_mpy_wx(cosx, t1)
-
- smlawb r6, r11, r8, r2 @ r4 = L_mpy_wx(cosx, t0) + L_mpy_wx(sinx, t1)@
- smulwb r3, r10, r8 @ L_mpy_wx(sinx, t0)
-
- mov r10, r4 @ t0 = r4@
- mov r11, r5 @ t1 = r5@
-
- sub r7, r7, r3 @ r5 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@
-
-
- add r4, r10, r6 @ r4 = t0 + r6@
- sub r5, r7, r11 @ r5 = r7 - t1@
-
- sub r6, r10, r6 @ r6 = t0 - r6@
- add r7, r7, r11 @ r7 = r7 + t1@
-
- ldr r2, [sp, #24]
- ldr r3, [sp, #28]
-
- add r10, r0, r5 @ xptr[0] = r0 + r5@
- add r11, r1, r6 @ xptr[0] = r1 + r6
-
- strd r10, [r14]
- sub r14, r14, r9 @ xptr -= step@
-
- sub r10, r2, r4 @ xptr[0] = r2 - r4@
- sub r11, r3, r7 @ xptr[1] = r3 - r7@
-
- strd r10, [r14]
- sub r14, r14, r9 @ xptr -= step@
-
- sub r10, r0, r5 @ xptr[0] = r0 - r5@
- sub r11, r1, r6 @ xptr[0] = r1 - r6
-
- strd r10, [r14]
- sub r14, r14, r9 @ xptr -= step@
-
- add r10, r2, r4 @ xptr[0] = r2 - r4@
- add r11, r3, r7 @ xptr[1] = r3 - r7@
-
- strd r10, [r14]
- add r14, r14, #8 @ xptr += 2@
-
- ldr r11, [sp, #20]
- subs r11, r11, #1
- bne Radix4FFT_LOOP3
-
-Radix4FFT_LOOP2_END:
- ldr r10, [sp, #16]
- ldr r3, [sp, #12]
- ldr r2, [sp, #8]
- rsb r8, r9, r9, lsl #2
- sub r10, r10, #1
- add r14, r14, r8
- cmp r10, #0
- bhi Radix4FFT_LOOP2
-
-Radix4FFT_LOOP1_END:
- ldr r0, [sp]
- ldr r1, [sp, #4]
- add r3, r3, r8, asr #1
- mov r2, r2, lsl #2
- movs r1, r1, asr #2
- bne Radix4FFT_LOOP1
-
-Radix4FFT_END:
- add sp, sp, #32
- ldmia sp!, {r4 - r11, pc}
-
- @ENDP @ |Radix4FFT|
+@/* +@ ** Copyright 2003-2010, VisualOn, Inc. +@ ** +@ ** Licensed under the Apache License, Version 2.0 (the "License"); +@ ** you may not use this file except in compliance with the License. +@ ** You may obtain a copy of the License at +@ ** +@ ** http://www.apache.org/licenses/LICENSE-2.0 +@ ** +@ ** Unless required by applicable law or agreed to in writing, software +@ ** distributed under the License is distributed on an "AS IS" BASIS, +@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@ ** See the License for the specific language governing permissions and +@ ** limitations under the License. +@ */ + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ File: Radix4FFT_v5.s +@ +@ Content: Radix4FFT armv5 assemble +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + .section .text + .global Radix4FFT + +Radix4FFT: + stmdb sp!, {r4 - r11, lr} + sub sp, sp, #32 + + mov r1, r1, asr #2 + cmp r1, #0 + beq Radix4FFT_END + +Radix4FFT_LOOP1: + mov r14, r0 @ xptr = buf@ + mov r10, r1 @ i = num@ + mov r9, r2, lsl #3 @ step = 2*bgn@ + cmp r10, #0 + str r0, [sp] + str r1, [sp, #4] + str r2, [sp, #8] + str r3, [sp, #12] + beq Radix4FFT_LOOP1_END + +Radix4FFT_LOOP2: + mov r12, r3 @ csptr = twidTab@ + mov r11, r2 @ j = bgn + cmp r11, #0 + str r10, [sp, #16] + beq Radix4FFT_LOOP2_END + +Radix4FFT_LOOP3: + str r11, [sp, #20] + + ldrd r0, [r14, #0] @ r0 = xptr[0]@ r1 = xptr[1]@ + add r14, r14, r9 @ xptr += step@ + + ldrd r10, [r14, #0] @ r2 = xptr[0]@ r3 = xptr[1]@ + ldr r8, [r12], #4 @ cosxsinx = csptr[0]@ + + smulwt r4, r10, r8 @ L_mpy_wx(cosx, t0) + smulwt r3, r11, r8 @ L_mpy_wx(cosx, t1) + + smlawb r2, r11, r8, r4 @ r2 = L_mpy_wx(cosx, t0) + L_mpy_wx(sinx, t1)@ + smulwb r5, r10, r8 @ L_mpy_wx(sinx, t0) + + mov r10, r0, asr #2 @ t0 = r0 >> 2@ + mov r11, r1, asr #2 @ t1 = r1 >> 2@ + + sub r3, r3, r5 @ r3 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@ + add r14, r14, r9 @ xptr += step@ + + sub r0, r10, r2 @ r0 = t0 - r2@ + sub r1, r11, r3 @ r1 = t1 - r3@ + + add r2, r10, r2 @ r2 = t0 + r2@ + add r3, r11, r3 @ r3 = t1 + r3@ + + str r2, [sp, #24] + str r3, [sp, #28] + + ldrd r10, [r14, #0] @ r4 = xptr[0]@ r5 = xptr[1]@ + ldr r8, [r12], #4 @ cosxsinx = csptr[1]@ + + smulwt r6, r10, r8 @ L_mpy_wx(cosx, t0) + smulwt r5, r11, r8 @ L_mpy_wx(cosx, t1) + + smlawb r4, r11, r8, r6 @ r4 = L_mpy_wx(cosx, t0) + L_mpy_wx(sinx, t1)@ + smulwb r7, r10, r8 @ L_mpy_wx(sinx, t0) + + add r14, r14, r9 @ xptr += step@ + sub r5, r5, r7 @ r5 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@ + + ldrd r10, [r14] @ r6 = xptr[0]@ r7 = xptr[1]@ + ldr r8, [r12], #4 @ cosxsinx = csptr[1]@ + + smulwt r2, r10, r8 @ L_mpy_wx(cosx, t0) + smulwt r7, r11, r8 @ L_mpy_wx(cosx, t1) + + smlawb r6, r11, r8, r2 @ r4 = L_mpy_wx(cosx, t0) + L_mpy_wx(sinx, t1)@ + smulwb r3, r10, r8 @ L_mpy_wx(sinx, t0) + + mov r10, r4 @ t0 = r4@ + mov r11, r5 @ t1 = r5@ + + sub r7, r7, r3 @ r5 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@ + + + add r4, r10, r6 @ r4 = t0 + r6@ + sub r5, r7, r11 @ r5 = r7 - t1@ + + sub r6, r10, r6 @ r6 = t0 - r6@ + add r7, r7, r11 @ r7 = r7 + t1@ + + ldr r2, [sp, #24] + ldr r3, [sp, #28] + + add r10, r0, r5 @ xptr[0] = r0 + r5@ + add r11, r1, r6 @ xptr[0] = r1 + r6 + + strd r10, [r14] + sub r14, r14, r9 @ xptr -= step@ + + sub r10, r2, r4 @ xptr[0] = r2 - r4@ + sub r11, r3, r7 @ xptr[1] = r3 - r7@ + + strd r10, [r14] + sub r14, r14, r9 @ xptr -= step@ + + sub r10, r0, r5 @ xptr[0] = r0 - r5@ + sub r11, r1, r6 @ xptr[0] = r1 - r6 + + strd r10, [r14] + sub r14, r14, r9 @ xptr -= step@ + + add r10, r2, r4 @ xptr[0] = r2 - r4@ + add r11, r3, r7 @ xptr[1] = r3 - r7@ + + strd r10, [r14] + add r14, r14, #8 @ xptr += 2@ + + ldr r11, [sp, #20] + subs r11, r11, #1 + bne Radix4FFT_LOOP3 + +Radix4FFT_LOOP2_END: + ldr r10, [sp, #16] + ldr r3, [sp, #12] + ldr r2, [sp, #8] + rsb r8, r9, r9, lsl #2 + sub r10, r10, #1 + add r14, r14, r8 + cmp r10, #0 + bhi Radix4FFT_LOOP2 + +Radix4FFT_LOOP1_END: + ldr r0, [sp] + ldr r1, [sp, #4] + add r3, r3, r8, asr #1 + mov r2, r2, lsl #2 + movs r1, r1, asr #2 + bne Radix4FFT_LOOP1 + +Radix4FFT_END: + add sp, sp, #32 + ldmia sp!, {r4 - r11, pc} + + @ENDP @ |Radix4FFT| .end
\ No newline at end of file diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/band_nrg_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/band_nrg_v5.s index a463dfd..3b88810 100644 --- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/band_nrg_v5.s +++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/band_nrg_v5.s @@ -1,204 +1,204 @@ -@/*
-@ ** Copyright 2003-2010, VisualOn, Inc.
-@ **
-@ ** Licensed under the Apache License, Version 2.0 (the "License");
-@ ** you may not use this file except in compliance with the License.
-@ ** You may obtain a copy of the License at
-@ **
-@ ** http://www.apache.org/licenses/LICENSE-2.0
-@ **
-@ ** Unless required by applicable law or agreed to in writing, software
-@ ** distributed under the License is distributed on an "AS IS" BASIS,
-@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@ ** See the License for the specific language governing permissions and
-@ ** limitations under the License.
-@ */
-
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-@ File: band_nrg_v5.s
-@
-@ Content: CalcBandEnergy and CalcBandEnergyMS function armv5 assemble
-@
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
- .section .text
-
- .global CalcBandEnergy
-
-CalcBandEnergy:
- stmdb sp!, {r4 - r11, lr}
-
- mov r2, r2, lsl #16
- ldr r12, [r13, #36]
- mov r9, #0
- mov r5, r2, asr #16
- mov r4, #0
- cmp r5, #0
- ble L212
-
-L22:
- mov r2, r4, lsl #1
- ldrsh r10, [r1, r2]
- add r11, r1, r2
- ldrsh r2, [r11, #2]
- mov r14, #0
- cmp r10, r2
- bge L28
-
-L23:
- ldr r11, [r0, +r10, lsl #2]
- add r10, r10, #1
- ldr r6, [r0, +r10, lsl #2]
- smull r11, r7, r11, r11
- add r10, r10, #1
- smull r6, r8, r6, r6
- ldr r11, [r0, +r10, lsl #2]
- qadd r14, r14, r7
- add r10, r10, #1
- smull r11, r7, r11, r11
- ldr r6, [r0, +r10, lsl #2]
- qadd r14, r14, r8
- smull r6, r8, r6, r6
- add r10, r10, #1
- qadd r14, r14, r7
- cmp r10, r2
- qadd r14, r14, r8
- blt L23
-
-L28:
- qadd r14, r14, r14
- str r14, [r3, +r4, lsl #2]
- add r4, r4, #1
- qadd r9, r9, r14
- cmp r4, r5
-
- blt L22
-
-L212:
- str r9, [r12, #0]
- ldmia sp!, {r4 - r11, pc}
-
- @ENDP ; |CalcBandEnergy|
-
- .global CalcBandEnergyMS
-
-CalcBandEnergyMS:
- stmdb sp!, {r4 - r11, lr}
- sub r13, r13, #24
-
- mov r12, #0
- mov r3, r3, lsl #16
- mov r14, #0
- mov r3, r3, asr #16
- cmp r3, #0
- mov r4, #0
- ble L315
-
-L32:
- mov r5, r4, lsl #1
- mov r6, #0
- ldrsh r10, [r2, r5]
- add r5, r2, r5
- mov r7, #0
- ldrsh r11, [r5, #2]
- cmp r10, r11
- bge L39
-
- str r3, [r13, #4]
- str r4, [r13, #8]
- str r12, [r13, #12]
- str r14, [r13, #16]
-
-L33:
- ldr r8, [r0, +r10, lsl #2]
- ldr r9, [r1, +r10, lsl #2]
- mov r8, r8, asr #1
- add r10, r10, #1
- mov r9, r9, asr #1
-
- ldr r12, [r0, +r10, lsl #2]
- add r5, r8, r9
- ldr r14, [r1, +r10, lsl #2]
- sub r8, r8, r9
-
- smull r5, r3, r5, r5
- mov r12, r12, asr #1
- smull r8, r4, r8, r8
- mov r14, r14, asr #1
-
- qadd r6, r6, r3
- add r5, r12, r14
- qadd r7, r7, r4
- sub r8, r12, r14
-
- smull r5, r3, r5, r5
- add r10, r10, #1
- smull r8, r4, r8, r8
-
- qadd r6, r6, r3
- qadd r7, r7, r4
-
- ldr r8, [r0, +r10, lsl #2]
- ldr r9, [r1, +r10, lsl #2]
- mov r8, r8, asr #1
- add r10, r10, #1
- mov r9, r9, asr #1
-
- ldr r12, [r0, +r10, lsl #2]
- add r5, r8, r9
- ldr r14, [r1, +r10, lsl #2]
- sub r8, r8, r9
-
- smull r5, r3, r5, r5
- mov r12, r12, asr #1
- smull r8, r4, r8, r8
- mov r14, r14, asr #1
-
- qadd r6, r6, r3
- add r5, r12, r14
- qadd r7, r7, r4
- sub r8, r12, r14
-
- smull r5, r3, r5, r5
- add r10, r10, #1
- smull r8, r4, r8, r8
-
- qadd r6, r6, r3
- qadd r7, r7, r4
-
- cmp r10, r11
-
- blt L33
-
- ldr r3, [r13, #4]
- ldr r4, [r13, #8]
- ldr r12, [r13, #12]
- ldr r14, [r13, #16]
-L39:
- qadd r6, r6, r6
- qadd r7, r7, r7
-
- ldr r8, [r13, #60]
- ldr r9, [r13, #68]
-
- qadd r12, r12, r6
- qadd r14, r14, r7
-
- str r6, [r8, +r4, lsl #2]
- str r7, [r9, +r4, lsl #2]
-
- add r4, r4, #1
- cmp r4, r3
- blt L32
-
-L315:
- ldr r8, [r13, #64]
- ldr r9, [r13, #72]
- str r12, [r8, #0]
- str r14, [r9, #0]
-
- add r13, r13, #24
- ldmia sp!, {r4 - r11, pc}
- @ENDP ; |CalcBandEnergyMS|
-
- .end
+@/* +@ ** Copyright 2003-2010, VisualOn, Inc. +@ ** +@ ** Licensed under the Apache License, Version 2.0 (the "License"); +@ ** you may not use this file except in compliance with the License. +@ ** You may obtain a copy of the License at +@ ** +@ ** http://www.apache.org/licenses/LICENSE-2.0 +@ ** +@ ** Unless required by applicable law or agreed to in writing, software +@ ** distributed under the License is distributed on an "AS IS" BASIS, +@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@ ** See the License for the specific language governing permissions and +@ ** limitations under the License. +@ */ + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ File: band_nrg_v5.s +@ +@ Content: CalcBandEnergy and CalcBandEnergyMS function armv5 assemble +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + .section .text + + .global CalcBandEnergy + +CalcBandEnergy: + stmdb sp!, {r4 - r11, lr} + + mov r2, r2, lsl #16 + ldr r12, [r13, #36] + mov r9, #0 + mov r5, r2, asr #16 + mov r4, #0 + cmp r5, #0 + ble L212 + +L22: + mov r2, r4, lsl #1 + ldrsh r10, [r1, r2] + add r11, r1, r2 + ldrsh r2, [r11, #2] + mov r14, #0 + cmp r10, r2 + bge L28 + +L23: + ldr r11, [r0, +r10, lsl #2] + add r10, r10, #1 + ldr r6, [r0, +r10, lsl #2] + smull r11, r7, r11, r11 + add r10, r10, #1 + smull r6, r8, r6, r6 + ldr r11, [r0, +r10, lsl #2] + qadd r14, r14, r7 + add r10, r10, #1 + smull r11, r7, r11, r11 + ldr r6, [r0, +r10, lsl #2] + qadd r14, r14, r8 + smull r6, r8, r6, r6 + add r10, r10, #1 + qadd r14, r14, r7 + cmp r10, r2 + qadd r14, r14, r8 + blt L23 + +L28: + qadd r14, r14, r14 + str r14, [r3, +r4, lsl #2] + add r4, r4, #1 + qadd r9, r9, r14 + cmp r4, r5 + + blt L22 + +L212: + str r9, [r12, #0] + ldmia sp!, {r4 - r11, pc} + + @ENDP ; |CalcBandEnergy| + + .global CalcBandEnergyMS + +CalcBandEnergyMS: + stmdb sp!, {r4 - r11, lr} + sub r13, r13, #24 + + mov r12, #0 + mov r3, r3, lsl #16 + mov r14, #0 + mov r3, r3, asr #16 + cmp r3, #0 + mov r4, #0 + ble L315 + +L32: + mov r5, r4, lsl #1 + mov r6, #0 + ldrsh r10, [r2, r5] + add r5, r2, r5 + mov r7, #0 + ldrsh r11, [r5, #2] + cmp r10, r11 + bge L39 + + str r3, [r13, #4] + str r4, [r13, #8] + str r12, [r13, #12] + str r14, [r13, #16] + +L33: + ldr r8, [r0, +r10, lsl #2] + ldr r9, [r1, +r10, lsl #2] + mov r8, r8, asr #1 + add r10, r10, #1 + mov r9, r9, asr #1 + + ldr r12, [r0, +r10, lsl #2] + add r5, r8, r9 + ldr r14, [r1, +r10, lsl #2] + sub r8, r8, r9 + + smull r5, r3, r5, r5 + mov r12, r12, asr #1 + smull r8, r4, r8, r8 + mov r14, r14, asr #1 + + qadd r6, r6, r3 + add r5, r12, r14 + qadd r7, r7, r4 + sub r8, r12, r14 + + smull r5, r3, r5, r5 + add r10, r10, #1 + smull r8, r4, r8, r8 + + qadd r6, r6, r3 + qadd r7, r7, r4 + + ldr r8, [r0, +r10, lsl #2] + ldr r9, [r1, +r10, lsl #2] + mov r8, r8, asr #1 + add r10, r10, #1 + mov r9, r9, asr #1 + + ldr r12, [r0, +r10, lsl #2] + add r5, r8, r9 + ldr r14, [r1, +r10, lsl #2] + sub r8, r8, r9 + + smull r5, r3, r5, r5 + mov r12, r12, asr #1 + smull r8, r4, r8, r8 + mov r14, r14, asr #1 + + qadd r6, r6, r3 + add r5, r12, r14 + qadd r7, r7, r4 + sub r8, r12, r14 + + smull r5, r3, r5, r5 + add r10, r10, #1 + smull r8, r4, r8, r8 + + qadd r6, r6, r3 + qadd r7, r7, r4 + + cmp r10, r11 + + blt L33 + + ldr r3, [r13, #4] + ldr r4, [r13, #8] + ldr r12, [r13, #12] + ldr r14, [r13, #16] +L39: + qadd r6, r6, r6 + qadd r7, r7, r7 + + ldr r8, [r13, #60] + ldr r9, [r13, #68] + + qadd r12, r12, r6 + qadd r14, r14, r7 + + str r6, [r8, +r4, lsl #2] + str r7, [r9, +r4, lsl #2] + + add r4, r4, #1 + cmp r4, r3 + blt L32 + +L315: + ldr r8, [r13, #64] + ldr r9, [r13, #72] + str r12, [r8, #0] + str r14, [r9, #0] + + add r13, r13, #24 + ldmia sp!, {r4 - r11, pc} + @ENDP ; |CalcBandEnergyMS| + + .end diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/PrePostMDCT_v7.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/PrePostMDCT_v7.s index bf7dcba..a04c105 100644 --- a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/PrePostMDCT_v7.s +++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/PrePostMDCT_v7.s @@ -1,135 +1,135 @@ -@/*
-@ ** Copyright 2003-2010, VisualOn, Inc.
-@ **
-@ ** Licensed under the Apache License, Version 2.0 (the "License");
-@ ** you may not use this file except in compliance with the License.
-@ ** You may obtain a copy of the License at
-@ **
-@ ** http://www.apache.org/licenses/LICENSE-2.0
-@ **
-@ ** Unless required by applicable law or agreed to in writing, software
-@ ** distributed under the License is distributed on an "AS IS" BASIS,
-@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@ ** See the License for the specific language governing permissions and
-@ ** limitations under the License.
-@ */
-
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-@ File: PrePostMDCT_v7.s
-@
-@ Content: premdct and postmdct function armv7 assemble
-@
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
- .section .text
- .global PreMDCT
-
-PreMDCT:
- stmdb sp!, {r4 - r11, lr}
-
- add r9, r0, r1, lsl #2
- sub r3, r9, #32
-
- movs r1, r1, asr #2
- beq PreMDCT_END
-
-PreMDCT_LOOP:
- VLD4.I32 {d0, d2, d4, d6}, [r2]! @ cosa = *csptr++@ sina = *csptr++@
- VLD4.I32 {d1, d3, d5, d7}, [r2]! @ cosb = *csptr++@ sinb = *csptr++@
- VLD2.I32 {d8, d9, d10, d11}, [r0] @ tr1 = *(buf0 + 0)@ ti2 = *(buf0 + 1)@
- VLD2.I32 {d13, d15}, [r3]! @ tr2 = *(buf1 - 1)@ ti1 = *(buf1 + 0)@
- VLD2.I32 {d12, d14}, [r3]! @ tr2 = *(buf1 - 1)@ ti1 = *(buf1 + 0)@
-
- VREV64.32 Q8, Q7
- VREV64.32 Q9, Q6
-
-
- VQDMULH.S32 Q10, Q0, Q4 @ MULHIGH(cosa, tr1)
- VQDMULH.S32 Q11, Q1, Q8 @ MULHIGH(sina, ti1)
- VQDMULH.S32 Q12, Q0, Q8 @ MULHIGH(cosa, ti1)
- VQDMULH.S32 Q13, Q1, Q4 @ MULHIGH(sina, tr1)
-
- VADD.S32 Q0, Q10, Q11 @ *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@
- VSUB.S32 Q1, Q12, Q13 @ *buf0++ = MULHIGH(cosa, ti1) - MULHIGH(sina, tr1)@
-
- VST2.I32 {d0, d1, d2, d3}, [r0]!
- sub r3, r3, #32
-
- VQDMULH.S32 Q10, Q2, Q9 @ MULHIGH(cosb, tr2)
- VQDMULH.S32 Q11, Q3, Q5 @ MULHIGH(sinb, ti2)
- VQDMULH.S32 Q12, Q2, Q5 @ MULHIGH(cosb, ti2)
- VQDMULH.S32 Q13, Q3, Q9 @ MULHIGH(sinb, tr2)
-
- VADD.S32 Q0, Q10, Q11 @ MULHIGH(cosa, tr2) + MULHIGH(sina, ti2)@
- VSUB.S32 Q1, Q12, Q13 @ MULHIGH(cosa, ti2) - MULHIGH(sina, tr2)@
-
- VREV64.32 Q3, Q1
- VREV64.32 Q2, Q0
-
- VST2.I32 {d5, d7}, [r3]!
- VST2.I32 {d4, d6}, [r3]!
-
- subs r1, r1, #4
- sub r3, r3, #64
- bne PreMDCT_LOOP
-
-PreMDCT_END:
- ldmia sp!, {r4 - r11, pc}
- @ENDP @ |PreMDCT|
-
- .section .text
- .global PostMDCT
-
-PostMDCT:
- stmdb sp!, {r4 - r11, lr}
-
- add r9, r0, r1, lsl #2
- sub r3, r9, #32
-
- movs r1, r1, asr #2
- beq PostMDCT_END
-
-PostMDCT_LOOP:
- VLD4.I32 {d0, d2, d4, d6}, [r2]! @ cosa = *csptr++@ sina = *csptr++@
- VLD4.I32 {d1, d3, d5, d7}, [r2]! @ cosb = *csptr++@ sinb = *csptr++@
- VLD2.I32 {d8, d9, d10, d11}, [r0] @ tr1 = *(zbuf1 + 0)@ ti1 = *(zbuf1 + 1)@
- VLD2.I32 {d13, d15}, [r3]! @ tr2 = *(zbuf2 - 1)@ ti2 = *(zbuf2 + 0)@
- VLD2.I32 {d12, d14}, [r3]! @ tr2 = *(zbuf2 - 1)@ ti2 = *(zbuf2 + 0)@
-
- VREV64.32 Q8, Q6
- VREV64.32 Q9, Q7
-
- VQDMULH.S32 Q10, Q0, Q4 @ MULHIGH(cosa, tr1)
- VQDMULH.S32 Q11, Q1, Q5 @ MULHIGH(sina, ti1)
- VQDMULH.S32 Q12, Q0, Q5 @ MULHIGH(cosa, ti1)
- VQDMULH.S32 Q13, Q1, Q4 @ MULHIGH(sina, tr1)
-
- VADD.S32 Q0, Q10, Q11 @ *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@
- VSUB.S32 Q5, Q13, Q12 @ *buf1-- = MULHIGH(sina, tr1) - MULHIGH(cosa, ti1)@
-
- VQDMULH.S32 Q10, Q2, Q8 @ MULHIGH(cosb, tr2)
- VQDMULH.S32 Q11, Q3, Q9 @ MULHIGH(sinb, ti2)
- VQDMULH.S32 Q12, Q2, Q9 @ MULHIGH(cosb, ti2)
- VQDMULH.S32 Q13, Q3, Q8 @ MULHIGH(sinb, tr2)
-
- VADD.S32 Q4, Q10, Q11 @ *buf1-- = MULHIGH(cosa, tr2) + MULHIGH(sina, ti2)@
- VSUB.S32 Q1, Q13, Q12 @ *buf0++ = MULHIGH(sina, tr2) - MULHIGH(cosa, ti2)@
-
- VREV64.32 Q2, Q4
- VREV64.32 Q3, Q5
-
- sub r3, r3, #32
- VST2.I32 {d0, d1, d2, d3}, [r0]!
-
- VST2.I32 {d5, d7}, [r3]!
- VST2.I32 {d4, d6}, [r3]!
-
- subs r1, r1, #4
- sub r3, r3, #64
- bne PostMDCT_LOOP
-
-PostMDCT_END:
- ldmia sp!, {r4 - r11, pc}
-
- @ENDP @ |PostMDCT|
+@/* +@ ** Copyright 2003-2010, VisualOn, Inc. +@ ** +@ ** Licensed under the Apache License, Version 2.0 (the "License"); +@ ** you may not use this file except in compliance with the License. +@ ** You may obtain a copy of the License at +@ ** +@ ** http://www.apache.org/licenses/LICENSE-2.0 +@ ** +@ ** Unless required by applicable law or agreed to in writing, software +@ ** distributed under the License is distributed on an "AS IS" BASIS, +@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@ ** See the License for the specific language governing permissions and +@ ** limitations under the License. +@ */ + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ File: PrePostMDCT_v7.s +@ +@ Content: premdct and postmdct function armv7 assemble +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + .section .text + .global PreMDCT + +PreMDCT: + stmdb sp!, {r4 - r11, lr} + + add r9, r0, r1, lsl #2 + sub r3, r9, #32 + + movs r1, r1, asr #2 + beq PreMDCT_END + +PreMDCT_LOOP: + VLD4.I32 {d0, d2, d4, d6}, [r2]! @ cosa = *csptr++@ sina = *csptr++@ + VLD4.I32 {d1, d3, d5, d7}, [r2]! @ cosb = *csptr++@ sinb = *csptr++@ + VLD2.I32 {d8, d9, d10, d11}, [r0] @ tr1 = *(buf0 + 0)@ ti2 = *(buf0 + 1)@ + VLD2.I32 {d13, d15}, [r3]! @ tr2 = *(buf1 - 1)@ ti1 = *(buf1 + 0)@ + VLD2.I32 {d12, d14}, [r3]! @ tr2 = *(buf1 - 1)@ ti1 = *(buf1 + 0)@ + + VREV64.32 Q8, Q7 + VREV64.32 Q9, Q6 + + + VQDMULH.S32 Q10, Q0, Q4 @ MULHIGH(cosa, tr1) + VQDMULH.S32 Q11, Q1, Q8 @ MULHIGH(sina, ti1) + VQDMULH.S32 Q12, Q0, Q8 @ MULHIGH(cosa, ti1) + VQDMULH.S32 Q13, Q1, Q4 @ MULHIGH(sina, tr1) + + VADD.S32 Q0, Q10, Q11 @ *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@ + VSUB.S32 Q1, Q12, Q13 @ *buf0++ = MULHIGH(cosa, ti1) - MULHIGH(sina, tr1)@ + + VST2.I32 {d0, d1, d2, d3}, [r0]! + sub r3, r3, #32 + + VQDMULH.S32 Q10, Q2, Q9 @ MULHIGH(cosb, tr2) + VQDMULH.S32 Q11, Q3, Q5 @ MULHIGH(sinb, ti2) + VQDMULH.S32 Q12, Q2, Q5 @ MULHIGH(cosb, ti2) + VQDMULH.S32 Q13, Q3, Q9 @ MULHIGH(sinb, tr2) + + VADD.S32 Q0, Q10, Q11 @ MULHIGH(cosa, tr2) + MULHIGH(sina, ti2)@ + VSUB.S32 Q1, Q12, Q13 @ MULHIGH(cosa, ti2) - MULHIGH(sina, tr2)@ + + VREV64.32 Q3, Q1 + VREV64.32 Q2, Q0 + + VST2.I32 {d5, d7}, [r3]! + VST2.I32 {d4, d6}, [r3]! + + subs r1, r1, #4 + sub r3, r3, #64 + bne PreMDCT_LOOP + +PreMDCT_END: + ldmia sp!, {r4 - r11, pc} + @ENDP @ |PreMDCT| + + .section .text + .global PostMDCT + +PostMDCT: + stmdb sp!, {r4 - r11, lr} + + add r9, r0, r1, lsl #2 + sub r3, r9, #32 + + movs r1, r1, asr #2 + beq PostMDCT_END + +PostMDCT_LOOP: + VLD4.I32 {d0, d2, d4, d6}, [r2]! @ cosa = *csptr++@ sina = *csptr++@ + VLD4.I32 {d1, d3, d5, d7}, [r2]! @ cosb = *csptr++@ sinb = *csptr++@ + VLD2.I32 {d8, d9, d10, d11}, [r0] @ tr1 = *(zbuf1 + 0)@ ti1 = *(zbuf1 + 1)@ + VLD2.I32 {d13, d15}, [r3]! @ tr2 = *(zbuf2 - 1)@ ti2 = *(zbuf2 + 0)@ + VLD2.I32 {d12, d14}, [r3]! @ tr2 = *(zbuf2 - 1)@ ti2 = *(zbuf2 + 0)@ + + VREV64.32 Q8, Q6 + VREV64.32 Q9, Q7 + + VQDMULH.S32 Q10, Q0, Q4 @ MULHIGH(cosa, tr1) + VQDMULH.S32 Q11, Q1, Q5 @ MULHIGH(sina, ti1) + VQDMULH.S32 Q12, Q0, Q5 @ MULHIGH(cosa, ti1) + VQDMULH.S32 Q13, Q1, Q4 @ MULHIGH(sina, tr1) + + VADD.S32 Q0, Q10, Q11 @ *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@ + VSUB.S32 Q5, Q13, Q12 @ *buf1-- = MULHIGH(sina, tr1) - MULHIGH(cosa, ti1)@ + + VQDMULH.S32 Q10, Q2, Q8 @ MULHIGH(cosb, tr2) + VQDMULH.S32 Q11, Q3, Q9 @ MULHIGH(sinb, ti2) + VQDMULH.S32 Q12, Q2, Q9 @ MULHIGH(cosb, ti2) + VQDMULH.S32 Q13, Q3, Q8 @ MULHIGH(sinb, tr2) + + VADD.S32 Q4, Q10, Q11 @ *buf1-- = MULHIGH(cosa, tr2) + MULHIGH(sina, ti2)@ + VSUB.S32 Q1, Q13, Q12 @ *buf0++ = MULHIGH(sina, tr2) - MULHIGH(cosa, ti2)@ + + VREV64.32 Q2, Q4 + VREV64.32 Q3, Q5 + + sub r3, r3, #32 + VST2.I32 {d0, d1, d2, d3}, [r0]! + + VST2.I32 {d5, d7}, [r3]! + VST2.I32 {d4, d6}, [r3]! + + subs r1, r1, #4 + sub r3, r3, #64 + bne PostMDCT_LOOP + +PostMDCT_END: + ldmia sp!, {r4 - r11, pc} + + @ENDP @ |PostMDCT| .end
\ No newline at end of file diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/R4R8First_v7.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/R4R8First_v7.s index 99ee68b..defd45d 100644 --- a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/R4R8First_v7.s +++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/R4R8First_v7.s @@ -1,146 +1,146 @@ -@/*
-@ ** Copyright 2003-2010, VisualOn, Inc.
-@ **
-@ ** Licensed under the Apache License, Version 2.0 (the "License");
-@ ** you may not use this file except in compliance with the License.
-@ ** You may obtain a copy of the License at
-@ **
-@ ** http://www.apache.org/licenses/LICENSE-2.0
-@ **
-@ ** Unless required by applicable law or agreed to in writing, software
-@ ** distributed under the License is distributed on an "AS IS" BASIS,
-@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@ ** See the License for the specific language governing permissions and
-@ ** limitations under the License.
-@ */
-
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-@ File: R4R8First_v7.s
-@
-@ Content: Radix8First and Radix4First function armv7 assemble
-@
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
- .section .text
- .global Radix8First
-
-Radix8First:
- stmdb sp!, {r4 - r11, lr}
-
- ldr r3, SQRT1_2
- cmp r1, #0
-
- VDUP.I32 Q15, r3
- beq Radix8First_END
-
-Radix8First_LOOP:
- VLD1.I32 {d0, d1, d2, d3}, [r0]!
- VLD1.I32 {d8, d9, d10, d11}, [r0]!
-
- VADD.S32 d4, d0, d1 @ r0 = buf[0] + buf[2]@i0 = buf[1] + buf[3]@
- VSUB.S32 d5, d0, d1 @ r1 = buf[0] - buf[2]@i1 = buf[1] - buf[3]@
- VSUB.S32 d7, d2, d3 @ r2 = buf[4] - buf[6]@i2 = buf[5] - buf[7]@
- VADD.S32 d6, d2, d3 @ r3 = buf[4] + buf[6]@i3 = buf[5] + buf[7]@
- VREV64.I32 d7, d7
-
- VADD.S32 Q0, Q2, Q3 @ r4 = (r0 + r2)@i4 = (i0 + i2)@i6 = (i1 + r3)@r7 = (r1 + i3)
- VSUB.S32 Q1, Q2, Q3 @ r5 = (r0 - r2)@i5 = (i0 - i2)@r6 = (r1 - i3)@i7 = (i1 - r3)@
-
- VREV64.I32 d3, d3
-
- VADD.S32 d4, d8, d9 @ r0 = buf[ 8] + buf[10]@i0 = buf[ 9] + buf[11]@
- VSUB.S32 d7, d10, d11 @ r1 = buf[12] - buf[14]@i1 = buf[13] - buf[15]@
- VADD.S32 d6, d10, d11 @ r2 = buf[12] + buf[14]@i2 = buf[13] + buf[15]@
- VREV64.I32 d7, d7
- VSUB.S32 d5, d8, d9 @ r3 = buf[ 8] - buf[10]@i3 = buf[ 9] - buf[11]@
-
- VTRN.32 d1, d3
-
- VADD.S32 Q4, Q2, Q3 @ t0 = (r0 + r2) >> 1@t1 = (i0 + i2) >> 1@i0 = i1 + r3@r2 = r1 + i3@
- VSUB.S32 Q5, Q2, Q3 @ t2 = (r0 - r2) >> 1@t3 = (i0 - i2) >> 1@r0 = r1 - i3@i2 = i1 - r3@
-
- VREV64.I32 d3, d3
-
- VSHR.S32 d8, d8, #1
- VSHR.S32 Q0, Q0, #1
- VREV64.I32 d10, d10
- VTRN.32 d11, d9
- VSHR.S32 Q1, Q1, #1
- VSHR.S32 d10, d10, #1
- VREV64.I32 d9, d9
-
- sub r0, r0, #0x40
-
- VADD.S32 d12, d0, d8
- VSUB.S32 d16, d0, d8
- VADD.S32 d14, d2, d10
- VSUB.S32 d18, d2, d10
-
- VSUB.S32 d4, d11, d9
- VADD.S32 d5, d11, d9
-
- VREV64.I32 d18, d18
-
- VQDMULH.S32 Q3, Q2, Q15
- VTRN.32 d14, d18
- VTRN.32 d6, d7
- VREV64.I32 d18, d18
-
- VSUB.S32 d15, d3, d6
- VREV64.I32 d7, d7
- VADD.S32 d19, d3, d6
- VADD.S32 d13, d1, d7
- VSUB.S32 d17, d1, d7
-
- VREV64.I32 d17, d17
- VTRN.32 d13, d17
- VREV64.I32 d17, d17
-
- subs r1, r1, #1
-
- VST1.I32 {d12, d13, d14, d15}, [r0]!
- VST1.I32 {d16, d17, d18, d19}, [r0]!
- bne Radix8First_LOOP
-
-Radix8First_END:
- ldmia sp!, {r4 - r11, pc}
-SQRT1_2:
- .word 0x2d413ccd
-
- @ENDP @ |Radix8First|
-
- .section .text
- .global Radix4First
-
-Radix4First:
- stmdb sp!, {r4 - r11, lr}
-
- cmp r1, #0
- beq Radix4First_END
-
-Radix4First_LOOP:
- VLD1.I32 {d0, d1, d2, d3}, [r0]
-
- VADD.S32 d4, d0, d1 @ r0 = buf[0] + buf[2]@ r1 = buf[1] + buf[3]@
- VSUB.S32 d5, d0, d1 @ r2 = buf[0] - buf[2]@ r3 = buf[1] - buf[3]@
- VSUB.S32 d7, d2, d3 @ r4 = buf[4] + buf[6]@ r5 = buf[5] + buf[7]@
- VADD.S32 d6, d2, d3 @ r6 = buf[4] - buf[6]@ r7 = buf[5] - buf[7]@
-
- VREV64.I32 d7, d7 @
-
- VADD.S32 Q4, Q2, Q3
- VSUB.S32 Q5, Q2, Q3
-
- VREV64.I32 d11, d11
- VTRN.32 d9, d11
- subs r1, r1, #1
- VREV64.I32 d11, d11
- VST1.I32 {d8, d9, d10, d11}, [r0]!
-
- bne Radix4First_LOOP
-
-Radix4First_END:
- ldmia sp!, {r4 - r11, pc}
-
- @ENDP @ |Radix4First|
+@/* +@ ** Copyright 2003-2010, VisualOn, Inc. +@ ** +@ ** Licensed under the Apache License, Version 2.0 (the "License"); +@ ** you may not use this file except in compliance with the License. +@ ** You may obtain a copy of the License at +@ ** +@ ** http://www.apache.org/licenses/LICENSE-2.0 +@ ** +@ ** Unless required by applicable law or agreed to in writing, software +@ ** distributed under the License is distributed on an "AS IS" BASIS, +@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@ ** See the License for the specific language governing permissions and +@ ** limitations under the License. +@ */ + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ File: R4R8First_v7.s +@ +@ Content: Radix8First and Radix4First function armv7 assemble +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + .section .text + .global Radix8First + +Radix8First: + stmdb sp!, {r4 - r11, lr} + + ldr r3, SQRT1_2 + cmp r1, #0 + + VDUP.I32 Q15, r3 + beq Radix8First_END + +Radix8First_LOOP: + VLD1.I32 {d0, d1, d2, d3}, [r0]! + VLD1.I32 {d8, d9, d10, d11}, [r0]! + + VADD.S32 d4, d0, d1 @ r0 = buf[0] + buf[2]@i0 = buf[1] + buf[3]@ + VSUB.S32 d5, d0, d1 @ r1 = buf[0] - buf[2]@i1 = buf[1] - buf[3]@ + VSUB.S32 d7, d2, d3 @ r2 = buf[4] - buf[6]@i2 = buf[5] - buf[7]@ + VADD.S32 d6, d2, d3 @ r3 = buf[4] + buf[6]@i3 = buf[5] + buf[7]@ + VREV64.I32 d7, d7 + + VADD.S32 Q0, Q2, Q3 @ r4 = (r0 + r2)@i4 = (i0 + i2)@i6 = (i1 + r3)@r7 = (r1 + i3) + VSUB.S32 Q1, Q2, Q3 @ r5 = (r0 - r2)@i5 = (i0 - i2)@r6 = (r1 - i3)@i7 = (i1 - r3)@ + + VREV64.I32 d3, d3 + + VADD.S32 d4, d8, d9 @ r0 = buf[ 8] + buf[10]@i0 = buf[ 9] + buf[11]@ + VSUB.S32 d7, d10, d11 @ r1 = buf[12] - buf[14]@i1 = buf[13] - buf[15]@ + VADD.S32 d6, d10, d11 @ r2 = buf[12] + buf[14]@i2 = buf[13] + buf[15]@ + VREV64.I32 d7, d7 + VSUB.S32 d5, d8, d9 @ r3 = buf[ 8] - buf[10]@i3 = buf[ 9] - buf[11]@ + + VTRN.32 d1, d3 + + VADD.S32 Q4, Q2, Q3 @ t0 = (r0 + r2) >> 1@t1 = (i0 + i2) >> 1@i0 = i1 + r3@r2 = r1 + i3@ + VSUB.S32 Q5, Q2, Q3 @ t2 = (r0 - r2) >> 1@t3 = (i0 - i2) >> 1@r0 = r1 - i3@i2 = i1 - r3@ + + VREV64.I32 d3, d3 + + VSHR.S32 d8, d8, #1 + VSHR.S32 Q0, Q0, #1 + VREV64.I32 d10, d10 + VTRN.32 d11, d9 + VSHR.S32 Q1, Q1, #1 + VSHR.S32 d10, d10, #1 + VREV64.I32 d9, d9 + + sub r0, r0, #0x40 + + VADD.S32 d12, d0, d8 + VSUB.S32 d16, d0, d8 + VADD.S32 d14, d2, d10 + VSUB.S32 d18, d2, d10 + + VSUB.S32 d4, d11, d9 + VADD.S32 d5, d11, d9 + + VREV64.I32 d18, d18 + + VQDMULH.S32 Q3, Q2, Q15 + VTRN.32 d14, d18 + VTRN.32 d6, d7 + VREV64.I32 d18, d18 + + VSUB.S32 d15, d3, d6 + VREV64.I32 d7, d7 + VADD.S32 d19, d3, d6 + VADD.S32 d13, d1, d7 + VSUB.S32 d17, d1, d7 + + VREV64.I32 d17, d17 + VTRN.32 d13, d17 + VREV64.I32 d17, d17 + + subs r1, r1, #1 + + VST1.I32 {d12, d13, d14, d15}, [r0]! + VST1.I32 {d16, d17, d18, d19}, [r0]! + bne Radix8First_LOOP + +Radix8First_END: + ldmia sp!, {r4 - r11, pc} +SQRT1_2: + .word 0x2d413ccd + + @ENDP @ |Radix8First| + + .section .text + .global Radix4First + +Radix4First: + stmdb sp!, {r4 - r11, lr} + + cmp r1, #0 + beq Radix4First_END + +Radix4First_LOOP: + VLD1.I32 {d0, d1, d2, d3}, [r0] + + VADD.S32 d4, d0, d1 @ r0 = buf[0] + buf[2]@ r1 = buf[1] + buf[3]@ + VSUB.S32 d5, d0, d1 @ r2 = buf[0] - buf[2]@ r3 = buf[1] - buf[3]@ + VSUB.S32 d7, d2, d3 @ r4 = buf[4] + buf[6]@ r5 = buf[5] + buf[7]@ + VADD.S32 d6, d2, d3 @ r6 = buf[4] - buf[6]@ r7 = buf[5] - buf[7]@ + + VREV64.I32 d7, d7 @ + + VADD.S32 Q4, Q2, Q3 + VSUB.S32 Q5, Q2, Q3 + + VREV64.I32 d11, d11 + VTRN.32 d9, d11 + subs r1, r1, #1 + VREV64.I32 d11, d11 + VST1.I32 {d8, d9, d10, d11}, [r0]! + + bne Radix4First_LOOP + +Radix4First_END: + ldmia sp!, {r4 - r11, pc} + + @ENDP @ |Radix4First| .end
\ No newline at end of file diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/Radix4FFT_v7.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/Radix4FFT_v7.s index e1a8438..84a4a80 100644 --- a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/Radix4FFT_v7.s +++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/Radix4FFT_v7.s @@ -1,143 +1,143 @@ -@/*
-@ ** Copyright 2003-2010, VisualOn, Inc.
-@ **
-@ ** Licensed under the Apache License, Version 2.0 (the "License");
-@ ** you may not use this file except in compliance with the License.
-@ ** You may obtain a copy of the License at
-@ **
-@ ** http://www.apache.org/licenses/LICENSE-2.0
-@ **
-@ ** Unless required by applicable law or agreed to in writing, software
-@ ** distributed under the License is distributed on an "AS IS" BASIS,
-@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@ ** See the License for the specific language governing permissions and
-@ ** limitations under the License.
-@ */
-
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-@ File: Radix4FFT_v7.s
-@
-@ Content: Radix4FFT armv7 assemble
-@
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
- .section .text
- .global Radix4FFT
-
-Radix4FFT:
- stmdb sp!, {r4 - r11, lr}
-
- mov r1, r1, asr #2
- cmp r1, #0
- beq Radix4FFT_END
-
-Radix4FFT_LOOP1:
- mov r5, r2, lsl #1
- mov r8, r0
- mov r7, r1
- mov r5, r5, lsl #2
- cmp r1, #0
- rsbeq r12, r5, r5, lsl #2
- beq Radix4FFT_LOOP1_END
-
- rsb r12, r5, r5, lsl #2
-
-Radix4FFT_LOOP2:
- mov r6, r3
- mov r4, r2
- cmp r2, #0
- beq Radix4FFT_LOOP2_END
-
-Radix4FFT_LOOP3:
- @r0 = xptr[0]@
- @r1 = xptr[1]@
- VLD2.I32 {D0, D1, D2, D3}, [r8]
- VLD2.I32 {D28, D29, D30, D31}, [r6]! @ cosx = csptr[0]@ sinx = csptr[1]@
-
- add r8, r8, r5 @ xptr += step@
- VLD2.I32 {D4, D5, D6,D7}, [r8] @ r2 = xptr[0]@ r3 = xptr[1]@
-
- VQDMULH.S32 Q10, Q2, Q14 @ MULHIGH(cosx, t0)
- VQDMULH.S32 Q11, Q3, Q15 @ MULHIGH(sinx, t1)
- VQDMULH.S32 Q12, Q3, Q14 @ MULHIGH(cosx, t1)
- VQDMULH.S32 Q13, Q2, Q15 @ MULHIGH(sinx, t0)
-
- VADD.S32 Q2, Q10, Q11 @ MULHIGH(cosx, t0) + MULHIGH(sinx, t1)
- VSUB.S32 Q3, Q12, Q13 @ MULHIGH(cosx, t1) - MULHIGH(sinx, t0)
-
- add r8, r8, r5 @ xptr += step@
- VSHR.S32 Q10, Q0, #2 @ t0 = r0 >> 2@
- VSHR.S32 Q11, Q1, #2 @ t1 = r1 >> 2@
-
- VSUB.S32 Q0, Q10, Q2 @ r0 = t0 - r2@
- VSUB.S32 Q1, Q11, Q3 @ r1 = t1 - r3@
- VADD.S32 Q2, Q10, Q2 @ r2 = t0 + r2@
- VADD.S32 Q3, Q11, Q3 @ r3 = t1 + r3@
-
- VLD2.I32 {D8, D9, D10, D11}, [r8]
- VLD2.I32 {D28, D29, D30, D31}, [r6]!
- add r8, r8, r5
-
- VQDMULH.S32 Q10, Q4, Q14 @ MULHIGH(cosx, t0)
- VQDMULH.S32 Q11, Q5, Q15 @ MULHIGH(sinx, t1)
- VQDMULH.S32 Q12, Q5, Q14 @ MULHIGH(cosx, t1)
- VQDMULH.S32 Q13, Q4, Q15 @ MULHIGH(sinx, t0)
-
- VADD.S32 Q8, Q10, Q11 @ MULHIGH(cosx, t0) + MULHIGH(sinx, t1)
- VSUB.S32 Q9, Q12, Q13 @ MULHIGH(cosx, t1) - MULHIGH(sinx, t0)
-
- VLD2.I32 {D12, D13, D14, D15}, [r8]
- VLD2.I32 {D28, D29, D30, D31}, [r6]!
-
- VQDMULH.S32 Q10, Q6, Q14 @ MULHIGH(cosx, t0)
- VQDMULH.S32 Q11, Q7, Q15 @ MULHIGH(sinx, t1)
- VQDMULH.S32 Q12, Q7, Q14 @ MULHIGH(cosx, t1)
- VQDMULH.S32 Q13, Q6, Q15 @ MULHIGH(sinx, t0)
-
- VADD.S32 Q6, Q10, Q11 @ MULHIGH(cosx, t0) + MULHIGH(sinx, t1)
- VSUB.S32 Q7, Q12, Q13 @ MULHIGH(cosx, t1) - MULHIGH(sinx, t0)
-
- VADD.S32 Q4, Q8, Q6 @ r4 = t0 + r6@
- VSUB.S32 Q5, Q7, Q9 @ r5 = r7 - t1@
- VSUB.S32 Q6, Q8, Q6 @ r6 = t0 - r6@
- VADD.S32 Q7, Q7, Q9 @ r7 = r7 + t1@
-
- VADD.S32 Q8, Q0, Q5 @ xptr[0] = r0 + r5@
- VADD.S32 Q9, Q1, Q6 @ xptr[1] = r1 + r6@
- VST2.I32 {D16, D17, D18, D19}, [r8]
-
- VSUB.S32 Q10, Q2, Q4 @ xptr[0] = r2 - r4@
- sub r8, r8, r5 @ xptr -= step@
- VSUB.S32 Q11, Q3, Q7 @ xptr[1] = r3 - r7@
- VST2.I32 {D20, D21, D22, D23}, [r8]
-
- VSUB.S32 Q8, Q0, Q5 @ xptr[0] = r0 - r5@
- sub r8, r8, r5 @ xptr -= step@
- VSUB.S32 Q9, Q1, Q6 @ xptr[1] = r1 - r6@
- VST2.I32 {D16, D17, D18, D19}, [r8]
-
- VADD.S32 Q10, Q2, Q4 @ xptr[0] = r2 + r4@
- sub r8, r8, r5 @ xptr -= step@
- VADD.S32 Q11, Q3, Q7 @ xptr[1] = r3 + r7@
- VST2.I32 {D20, D21, D22, D23}, [r8]!
-
- subs r4, r4, #4
- bne Radix4FFT_LOOP3
-
-Radix4FFT_LOOP2_END:
- add r8, r8, r12
- sub r7, r7, #1
- cmp r7, #0
- bhi Radix4FFT_LOOP2
-
-Radix4FFT_LOOP1_END:
- add r3, r12, r3
- mov r2, r2, lsl #2
- movs r1, r1, asr #2
- bne Radix4FFT_LOOP1
-
-Radix4FFT_END:
- ldmia sp!, {r4 - r11, pc}
-
- @ENDP @ |Radix4FFT|
+@/* +@ ** Copyright 2003-2010, VisualOn, Inc. +@ ** +@ ** Licensed under the Apache License, Version 2.0 (the "License"); +@ ** you may not use this file except in compliance with the License. +@ ** You may obtain a copy of the License at +@ ** +@ ** http://www.apache.org/licenses/LICENSE-2.0 +@ ** +@ ** Unless required by applicable law or agreed to in writing, software +@ ** distributed under the License is distributed on an "AS IS" BASIS, +@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@ ** See the License for the specific language governing permissions and +@ ** limitations under the License. +@ */ + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ File: Radix4FFT_v7.s +@ +@ Content: Radix4FFT armv7 assemble +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + .section .text + .global Radix4FFT + +Radix4FFT: + stmdb sp!, {r4 - r11, lr} + + mov r1, r1, asr #2 + cmp r1, #0 + beq Radix4FFT_END + +Radix4FFT_LOOP1: + mov r5, r2, lsl #1 + mov r8, r0 + mov r7, r1 + mov r5, r5, lsl #2 + cmp r1, #0 + rsbeq r12, r5, r5, lsl #2 + beq Radix4FFT_LOOP1_END + + rsb r12, r5, r5, lsl #2 + +Radix4FFT_LOOP2: + mov r6, r3 + mov r4, r2 + cmp r2, #0 + beq Radix4FFT_LOOP2_END + +Radix4FFT_LOOP3: + @r0 = xptr[0]@ + @r1 = xptr[1]@ + VLD2.I32 {D0, D1, D2, D3}, [r8] + VLD2.I32 {D28, D29, D30, D31}, [r6]! @ cosx = csptr[0]@ sinx = csptr[1]@ + + add r8, r8, r5 @ xptr += step@ + VLD2.I32 {D4, D5, D6,D7}, [r8] @ r2 = xptr[0]@ r3 = xptr[1]@ + + VQDMULH.S32 Q10, Q2, Q14 @ MULHIGH(cosx, t0) + VQDMULH.S32 Q11, Q3, Q15 @ MULHIGH(sinx, t1) + VQDMULH.S32 Q12, Q3, Q14 @ MULHIGH(cosx, t1) + VQDMULH.S32 Q13, Q2, Q15 @ MULHIGH(sinx, t0) + + VADD.S32 Q2, Q10, Q11 @ MULHIGH(cosx, t0) + MULHIGH(sinx, t1) + VSUB.S32 Q3, Q12, Q13 @ MULHIGH(cosx, t1) - MULHIGH(sinx, t0) + + add r8, r8, r5 @ xptr += step@ + VSHR.S32 Q10, Q0, #2 @ t0 = r0 >> 2@ + VSHR.S32 Q11, Q1, #2 @ t1 = r1 >> 2@ + + VSUB.S32 Q0, Q10, Q2 @ r0 = t0 - r2@ + VSUB.S32 Q1, Q11, Q3 @ r1 = t1 - r3@ + VADD.S32 Q2, Q10, Q2 @ r2 = t0 + r2@ + VADD.S32 Q3, Q11, Q3 @ r3 = t1 + r3@ + + VLD2.I32 {D8, D9, D10, D11}, [r8] + VLD2.I32 {D28, D29, D30, D31}, [r6]! + add r8, r8, r5 + + VQDMULH.S32 Q10, Q4, Q14 @ MULHIGH(cosx, t0) + VQDMULH.S32 Q11, Q5, Q15 @ MULHIGH(sinx, t1) + VQDMULH.S32 Q12, Q5, Q14 @ MULHIGH(cosx, t1) + VQDMULH.S32 Q13, Q4, Q15 @ MULHIGH(sinx, t0) + + VADD.S32 Q8, Q10, Q11 @ MULHIGH(cosx, t0) + MULHIGH(sinx, t1) + VSUB.S32 Q9, Q12, Q13 @ MULHIGH(cosx, t1) - MULHIGH(sinx, t0) + + VLD2.I32 {D12, D13, D14, D15}, [r8] + VLD2.I32 {D28, D29, D30, D31}, [r6]! + + VQDMULH.S32 Q10, Q6, Q14 @ MULHIGH(cosx, t0) + VQDMULH.S32 Q11, Q7, Q15 @ MULHIGH(sinx, t1) + VQDMULH.S32 Q12, Q7, Q14 @ MULHIGH(cosx, t1) + VQDMULH.S32 Q13, Q6, Q15 @ MULHIGH(sinx, t0) + + VADD.S32 Q6, Q10, Q11 @ MULHIGH(cosx, t0) + MULHIGH(sinx, t1) + VSUB.S32 Q7, Q12, Q13 @ MULHIGH(cosx, t1) - MULHIGH(sinx, t0) + + VADD.S32 Q4, Q8, Q6 @ r4 = t0 + r6@ + VSUB.S32 Q5, Q7, Q9 @ r5 = r7 - t1@ + VSUB.S32 Q6, Q8, Q6 @ r6 = t0 - r6@ + VADD.S32 Q7, Q7, Q9 @ r7 = r7 + t1@ + + VADD.S32 Q8, Q0, Q5 @ xptr[0] = r0 + r5@ + VADD.S32 Q9, Q1, Q6 @ xptr[1] = r1 + r6@ + VST2.I32 {D16, D17, D18, D19}, [r8] + + VSUB.S32 Q10, Q2, Q4 @ xptr[0] = r2 - r4@ + sub r8, r8, r5 @ xptr -= step@ + VSUB.S32 Q11, Q3, Q7 @ xptr[1] = r3 - r7@ + VST2.I32 {D20, D21, D22, D23}, [r8] + + VSUB.S32 Q8, Q0, Q5 @ xptr[0] = r0 - r5@ + sub r8, r8, r5 @ xptr -= step@ + VSUB.S32 Q9, Q1, Q6 @ xptr[1] = r1 - r6@ + VST2.I32 {D16, D17, D18, D19}, [r8] + + VADD.S32 Q10, Q2, Q4 @ xptr[0] = r2 + r4@ + sub r8, r8, r5 @ xptr -= step@ + VADD.S32 Q11, Q3, Q7 @ xptr[1] = r3 + r7@ + VST2.I32 {D20, D21, D22, D23}, [r8]! + + subs r4, r4, #4 + bne Radix4FFT_LOOP3 + +Radix4FFT_LOOP2_END: + add r8, r8, r12 + sub r7, r7, #1 + cmp r7, #0 + bhi Radix4FFT_LOOP2 + +Radix4FFT_LOOP1_END: + add r3, r12, r3 + mov r2, r2, lsl #2 + movs r1, r1, asr #2 + bne Radix4FFT_LOOP1 + +Radix4FFT_END: + ldmia sp!, {r4 - r11, pc} + + @ENDP @ |Radix4FFT| .end
\ No newline at end of file diff --git a/media/libstagefright/codecs/aacenc/src/band_nrg.c b/media/libstagefright/codecs/aacenc/src/band_nrg.c index 666c4ca..89c39b6 100644 --- a/media/libstagefright/codecs/aacenc/src/band_nrg.c +++ b/media/libstagefright/codecs/aacenc/src/band_nrg.c @@ -1,35 +1,35 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: band_nrg.c
-
- Content: Band/Line energy calculations functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: band_nrg.c + + Content: Band/Line energy calculations functions + *******************************************************************************/ -#include "basic_op.h"
+#include "basic_op.h" #include "band_nrg.h" -#ifndef ARMV5E
+#ifndef ARMV5E /******************************************************************************** * * function name: CalcBandEnergy * description: Calc sfb-bandwise mdct-energies for left and right channel * -**********************************************************************************/
+**********************************************************************************/ void CalcBandEnergy(const Word32 *mdctSpectrum, const Word16 *bandOffset, const Word16 numBands, @@ -42,8 +42,8 @@ void CalcBandEnergy(const Word32 *mdctSpectrum, for (i=0; i<numBands; i++) { Word32 accu = 0; for (j=bandOffset[i]; j<bandOffset[i+1]; j++) - accu = L_add(accu, MULHIGH(mdctSpectrum[j], mdctSpectrum[j]));
-
+ accu = L_add(accu, MULHIGH(mdctSpectrum[j], mdctSpectrum[j])); + accu = L_add(accu, accu); accuSum = L_add(accuSum, accu); bandEnergy[i] = accu; @@ -86,9 +86,9 @@ void CalcBandEnergyMS(const Word32 *mdctSpectrumLeft, accuMid = L_add(accuMid, MULHIGH(specm, specm)); accuSide = L_add(accuSide, MULHIGH(specs, specs)); } -
- accuMid = L_add(accuMid, accuMid);
- accuSide = L_add(accuSide, accuSide);
+ + accuMid = L_add(accuMid, accuMid); + accuSide = L_add(accuSide, accuSide); bandEnergyMid[i] = accuMid; accuMidSum = L_add(accuMidSum, accuMid); bandEnergySide[i] = accuSide; diff --git a/media/libstagefright/codecs/aacenc/src/bit_cnt.c b/media/libstagefright/codecs/aacenc/src/bit_cnt.c index 24837e8..dd0b9b4 100644 --- a/media/libstagefright/codecs/aacenc/src/bit_cnt.c +++ b/media/libstagefright/codecs/aacenc/src/bit_cnt.c @@ -1,23 +1,23 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: bit_cnt.c
-
- Content: Huffman Bitcounter & coder functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: bit_cnt.c + + Content: Huffman Bitcounter & coder functions + *******************************************************************************/ #include "bit_cnt.h" @@ -45,7 +45,7 @@ static void count1_2_3_4_5_6_7_8_9_10_11(const Word16 *values, { Word32 t0,t1,t2,t3,i; Word32 bc1_2,bc3_4,bc5_6,bc7_8,bc9_10; - Word16 bc11,sc;
+ Word16 bc11,sc; bc1_2=0; bc3_4=0; @@ -162,7 +162,7 @@ static void count3_4_5_6_7_8_9_10_11(const Word16 *values, sc = sc + (t0>0) + (t1>0) + (t2>0) + (t3>0); - }
+ } bitCount[1]=INVALID_BITCOUNT; bitCount[2]=INVALID_BITCOUNT; @@ -196,7 +196,7 @@ static void count5_6_7_8_9_10_11(const Word16 *values, Word32 t0,t1,i; Word32 bc5_6,bc7_8,bc9_10; - Word16 bc11,sc;
+ Word16 bc11,sc; bc5_6=0; bc7_8=0; @@ -294,43 +294,43 @@ static void count7_8_9_10_11(const Word16 *values, * output: bitCount for tables 9-11 * *****************************************************************************/ -static void count9_10_11(const Word16 *values,
- const Word16 width,
- Word16 *bitCount)
-{
-
- Word32 t0,t1,i;
- Word32 bc9_10;
- Word16 bc11,sc;
-
- bc9_10=0;
- bc11=0;
- sc=0;
-
- for(i=0;i<width;i+=2){
-
- t0=ABS(values[i+0]);
- t1=ABS(values[i+1]);
-
-
- bc9_10 += EXPAND(huff_ltab9_10[t0][t1]);
- bc11 = bc11 + huff_ltab11[t0][t1];
-
-
- sc = sc + (t0>0) + (t1>0);
- }
- bitCount[1]=INVALID_BITCOUNT;
- bitCount[2]=INVALID_BITCOUNT;
- bitCount[3]=INVALID_BITCOUNT;
- bitCount[4]=INVALID_BITCOUNT;
- bitCount[5]=INVALID_BITCOUNT;
- bitCount[6]=INVALID_BITCOUNT;
- bitCount[7]=INVALID_BITCOUNT;
- bitCount[8]=INVALID_BITCOUNT;
- bitCount[9]=extract_h(bc9_10) + sc;
- bitCount[10]=extract_l(bc9_10) + sc;
- bitCount[11]=bc11 + sc;
-
+static void count9_10_11(const Word16 *values, + const Word16 width, + Word16 *bitCount) +{ + + Word32 t0,t1,i; + Word32 bc9_10; + Word16 bc11,sc; + + bc9_10=0; + bc11=0; + sc=0; + + for(i=0;i<width;i+=2){ + + t0=ABS(values[i+0]); + t1=ABS(values[i+1]); + + + bc9_10 += EXPAND(huff_ltab9_10[t0][t1]); + bc11 = bc11 + huff_ltab11[t0][t1]; + + + sc = sc + (t0>0) + (t1>0); + } + bitCount[1]=INVALID_BITCOUNT; + bitCount[2]=INVALID_BITCOUNT; + bitCount[3]=INVALID_BITCOUNT; + bitCount[4]=INVALID_BITCOUNT; + bitCount[5]=INVALID_BITCOUNT; + bitCount[6]=INVALID_BITCOUNT; + bitCount[7]=INVALID_BITCOUNT; + bitCount[8]=INVALID_BITCOUNT; + bitCount[9]=extract_h(bc9_10) + sc; + bitCount[10]=extract_l(bc9_10) + sc; + bitCount[11]=bc11 + sc; + } /***************************************************************************** @@ -342,35 +342,35 @@ static void count9_10_11(const Word16 *values, * output: bitCount for table 11 * *****************************************************************************/ - static void count11(const Word16 *values,
- const Word16 width,
- Word16 *bitCount)
-{
- Word32 t0,t1,i;
- Word16 bc11,sc;
-
- bc11=0;
- sc=0;
- for(i=0;i<width;i+=2){
- t0=ABS(values[i+0]);
- t1=ABS(values[i+1]);
- bc11 = bc11 + huff_ltab11[t0][t1];
-
-
- sc = sc + (t0>0) + (t1>0);
- }
-
- bitCount[1]=INVALID_BITCOUNT;
- bitCount[2]=INVALID_BITCOUNT;
- bitCount[3]=INVALID_BITCOUNT;
- bitCount[4]=INVALID_BITCOUNT;
- bitCount[5]=INVALID_BITCOUNT;
- bitCount[6]=INVALID_BITCOUNT;
- bitCount[7]=INVALID_BITCOUNT;
- bitCount[8]=INVALID_BITCOUNT;
- bitCount[9]=INVALID_BITCOUNT;
- bitCount[10]=INVALID_BITCOUNT;
- bitCount[11]=bc11 + sc;
+ static void count11(const Word16 *values, + const Word16 width, + Word16 *bitCount) +{ + Word32 t0,t1,i; + Word16 bc11,sc; + + bc11=0; + sc=0; + for(i=0;i<width;i+=2){ + t0=ABS(values[i+0]); + t1=ABS(values[i+1]); + bc11 = bc11 + huff_ltab11[t0][t1]; + + + sc = sc + (t0>0) + (t1>0); + } + + bitCount[1]=INVALID_BITCOUNT; + bitCount[2]=INVALID_BITCOUNT; + bitCount[3]=INVALID_BITCOUNT; + bitCount[4]=INVALID_BITCOUNT; + bitCount[5]=INVALID_BITCOUNT; + bitCount[6]=INVALID_BITCOUNT; + bitCount[7]=INVALID_BITCOUNT; + bitCount[8]=INVALID_BITCOUNT; + bitCount[9]=INVALID_BITCOUNT; + bitCount[10]=INVALID_BITCOUNT; + bitCount[11]=bc11 + sc; } /***************************************************************************** @@ -383,54 +383,54 @@ static void count9_10_11(const Word16 *values, * *****************************************************************************/ -static void countEsc(const Word16 *values,
- const Word16 width,
- Word16 *bitCount)
-{
- Word32 t0,t1,t00,t01,i;
- Word16 bc11,ec,sc;
-
- bc11=0;
- sc=0;
- ec=0;
- for(i=0;i<width;i+=2){
- t0=ABS(values[i+0]);
- t1=ABS(values[i+1]);
-
-
- sc = sc + (t0>0) + (t1>0);
-
- t00 = min(t0,16);
- t01 = min(t1,16);
- bc11 = bc11 + huff_ltab11[t00][t01];
-
-
- if(t0 >= 16){
- ec = ec + 5;
- while(sub(t0=(t0 >> 1), 16) >= 0) {
- ec = ec + 2;
- }
- }
-
-
- if(t1 >= 16){
- ec = ec + 5;
- while(sub(t1=(t1 >> 1), 16) >= 0) {
- ec = ec + 2;
- }
- }
- }
- bitCount[1]=INVALID_BITCOUNT;
- bitCount[2]=INVALID_BITCOUNT;
- bitCount[3]=INVALID_BITCOUNT;
- bitCount[4]=INVALID_BITCOUNT;
- bitCount[5]=INVALID_BITCOUNT;
- bitCount[6]=INVALID_BITCOUNT;
- bitCount[7]=INVALID_BITCOUNT;
- bitCount[8]=INVALID_BITCOUNT;
- bitCount[9]=INVALID_BITCOUNT;
- bitCount[10]=INVALID_BITCOUNT;
- bitCount[11]=bc11 + sc + ec;
+static void countEsc(const Word16 *values, + const Word16 width, + Word16 *bitCount) +{ + Word32 t0,t1,t00,t01,i; + Word16 bc11,ec,sc; + + bc11=0; + sc=0; + ec=0; + for(i=0;i<width;i+=2){ + t0=ABS(values[i+0]); + t1=ABS(values[i+1]); + + + sc = sc + (t0>0) + (t1>0); + + t00 = min(t0,16); + t01 = min(t1,16); + bc11 = bc11 + huff_ltab11[t00][t01]; + + + if(t0 >= 16){ + ec = ec + 5; + while(sub(t0=(t0 >> 1), 16) >= 0) { + ec = ec + 2; + } + } + + + if(t1 >= 16){ + ec = ec + 5; + while(sub(t1=(t1 >> 1), 16) >= 0) { + ec = ec + 2; + } + } + } + bitCount[1]=INVALID_BITCOUNT; + bitCount[2]=INVALID_BITCOUNT; + bitCount[3]=INVALID_BITCOUNT; + bitCount[4]=INVALID_BITCOUNT; + bitCount[5]=INVALID_BITCOUNT; + bitCount[6]=INVALID_BITCOUNT; + bitCount[7]=INVALID_BITCOUNT; + bitCount[8]=INVALID_BITCOUNT; + bitCount[9]=INVALID_BITCOUNT; + bitCount[10]=INVALID_BITCOUNT; + bitCount[11]=bc11 + sc + ec; } @@ -492,376 +492,376 @@ Word16 bitCount(const Word16 *values, * description: write huffum bits * *****************************************************************************/ -Word16 codeValues(Word16 *values, Word16 width, Word16 codeBook, HANDLE_BIT_BUF hBitstream)
-{
-
- Word32 i, t0, t1, t2, t3, t00, t01;
- Word16 codeWord, codeLength;
- Word16 sign, signLength;
-
-
- switch (codeBook) {
- case CODE_BOOK_ZERO_NO:
- break;
-
- case CODE_BOOK_1_NO:
- for(i=0; i<width; i+=4) {
- t0 = values[i+0];
- t1 = values[i+1];
- t2 = values[i+2];
- t3 = values[i+3];
- codeWord = huff_ctab1[t0+1][t1+1][t2+1][t3+1];
- codeLength = HI_LTAB(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]);
- WriteBits(hBitstream, codeWord, codeLength);
- }
- break;
-
- case CODE_BOOK_2_NO:
- for(i=0; i<width; i+=4) {
- t0 = values[i+0];
- t1 = values[i+1];
- t2 = values[i+2];
- t3 = values[i+3];
- codeWord = huff_ctab2[t0+1][t1+1][t2+1][t3+1];
- codeLength = LO_LTAB(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]);
- WriteBits(hBitstream,codeWord,codeLength);
- }
- break;
-
- case CODE_BOOK_3_NO:
- for(i=0; i<width; i+=4) {
- sign=0;
- signLength=0;
- t0 = values[i+0];
-
- if(t0 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t0 < 0){
- sign|=1;
- t0=-t0;
- }
- }
- t1 = values[i+1];
-
- if(t1 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t1 < 0){
- sign|=1;
- t1=-t1;
- }
- }
- t2 = values[i+2];
-
- if(t2 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t2 < 0){
- sign|=1;
- t2=-t2;
- }
- }
- t3 = values[i+3];
- if(t3 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t3 < 0){
- sign|=1;
- t3=-t3;
- }
- }
-
- codeWord = huff_ctab3[t0][t1][t2][t3];
- codeLength = HI_LTAB(huff_ltab3_4[t0][t1][t2][t3]);
- WriteBits(hBitstream,codeWord,codeLength);
- WriteBits(hBitstream,sign,signLength);
- }
- break;
-
- case CODE_BOOK_4_NO:
- for(i=0; i<width; i+=4) {
- sign=0;
- signLength=0;
- t0 = values[i+0];
-
- if(t0 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
- if(t0 < 0){
- sign|=1;
- t0=-t0;
- }
- }
- t1 = values[i+1];
-
- if(t1 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t1 < 0){
- sign|=1;
- t1=-t1;
- }
- }
- t2 = values[i+2];
-
- if(t2 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t2 < 0){
- sign|=1;
- t2=-t2;
- }
- }
- t3 = values[i+3];
-
- if(t3 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t3 < 0){
- sign|=1;
- t3=-t3;
- }
- }
- codeWord = huff_ctab4[t0][t1][t2][t3];
- codeLength = LO_LTAB(huff_ltab3_4[t0][t1][t2][t3]);
- WriteBits(hBitstream,codeWord,codeLength);
- WriteBits(hBitstream,sign,signLength);
- }
- break;
-
- case CODE_BOOK_5_NO:
- for(i=0; i<width; i+=2) {
- t0 = values[i+0];
- t1 = values[i+1];
- codeWord = huff_ctab5[t0+4][t1+4];
- codeLength = HI_LTAB(huff_ltab5_6[t0+4][t1+4]);
- WriteBits(hBitstream,codeWord,codeLength);
- }
- break;
-
- case CODE_BOOK_6_NO:
- for(i=0; i<width; i+=2) {
- t0 = values[i+0];
- t1 = values[i+1];
- codeWord = huff_ctab6[t0+4][t1+4];
- codeLength = LO_LTAB(huff_ltab5_6[t0+4][t1+4]);
- WriteBits(hBitstream,codeWord,codeLength);
- }
- break;
-
- case CODE_BOOK_7_NO:
- for(i=0; i<width; i+=2){
- sign=0;
- signLength=0;
- t0 = values[i+0];
-
- if(t0 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t0 < 0){
- sign|=1;
- t0=-t0;
- }
- }
-
- t1 = values[i+1];
-
- if(t1 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t1 < 0){
- sign|=1;
- t1=-t1;
- }
- }
- codeWord = huff_ctab7[t0][t1];
- codeLength = HI_LTAB(huff_ltab7_8[t0][t1]);
- WriteBits(hBitstream,codeWord,codeLength);
- WriteBits(hBitstream,sign,signLength);
- }
- break;
-
- case CODE_BOOK_8_NO:
- for(i=0; i<width; i+=2) {
- sign=0;
- signLength=0;
- t0 = values[i+0];
-
- if(t0 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t0 < 0){
- sign|=1;
- t0=-t0;
- }
- }
-
- t1 = values[i+1];
-
- if(t1 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t1 < 0){
- sign|=1;
- t1=-t1;
- }
- }
- codeWord = huff_ctab8[t0][t1];
- codeLength = LO_LTAB(huff_ltab7_8[t0][t1]);
- WriteBits(hBitstream,codeWord,codeLength);
- WriteBits(hBitstream,sign,signLength);
- }
- break;
-
- case CODE_BOOK_9_NO:
- for(i=0; i<width; i+=2) {
- sign=0;
- signLength=0;
- t0 = values[i+0];
-
- if(t0 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t0 < 0){
- sign|=1;
- t0=-t0;
- }
- }
-
- t1 = values[i+1];
-
- if(t1 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t1 < 0){
- sign|=1;
- t1=-t1;
- }
- }
- codeWord = huff_ctab9[t0][t1];
- codeLength = HI_LTAB(huff_ltab9_10[t0][t1]);
- WriteBits(hBitstream,codeWord,codeLength);
- WriteBits(hBitstream,sign,signLength);
- }
- break;
-
- case CODE_BOOK_10_NO:
- for(i=0; i<width; i+=2) {
- sign=0;
- signLength=0;
- t0 = values[i+0];
-
- if(t0 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t0 < 0){
- sign|=1;
- t0=-t0;
- }
- }
-
- t1 = values[i+1];
-
- if(t1 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t1 < 0){
- sign|=1;
- t1=-t1;
- }
- }
- codeWord = huff_ctab10[t0][t1];
- codeLength = LO_LTAB(huff_ltab9_10[t0][t1]);
- WriteBits(hBitstream,codeWord,codeLength);
- WriteBits(hBitstream,sign,signLength);
- }
- break;
-
- case CODE_BOOK_ESC_NO:
- for(i=0; i<width; i+=2) {
- sign=0;
- signLength=0;
- t0 = values[i+0];
-
- if(t0 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t0 < 0){
- sign|=1;
- t0=-t0;
- }
- }
-
- t1 = values[i+1];
-
- if(t1 != 0){
- signLength = signLength + 1;
- sign = sign << 1;
-
- if(t1 < 0){
- sign|=1;
- t1=-t1;
- }
- }
- t00 = min(t0,16);
- t01 = min(t1,16);
-
- codeWord = huff_ctab11[t00][t01];
- codeLength = huff_ltab11[t00][t01];
- WriteBits(hBitstream,codeWord,codeLength);
- WriteBits(hBitstream,sign,signLength);
-
- if(t0 >= 16){
- Word16 n, p;
- n=0;
- p=t0;
- while(sub(p=(p >> 1), 16) >= 0){
-
- WriteBits(hBitstream,1,1);
- n = n + 1;
- }
- WriteBits(hBitstream,0,1);
- n = n + 4;
- WriteBits(hBitstream,(t0 - (1 << n)),n);
- }
-
- if(t1 >= 16){
- Word16 n, p;
- n=0;
- p=t1;
- while(sub(p=(p >> 1), 16) >= 0){
-
- WriteBits(hBitstream,1,1);
- n = n + 1;
- }
- WriteBits(hBitstream,0,1);
- n = n + 4;
- WriteBits(hBitstream,(t1 - (1 << n)),n);
- }
- }
- break;
-
- default:
- break;
- }
- return(0);
+Word16 codeValues(Word16 *values, Word16 width, Word16 codeBook, HANDLE_BIT_BUF hBitstream) +{ + + Word32 i, t0, t1, t2, t3, t00, t01; + Word16 codeWord, codeLength; + Word16 sign, signLength; + + + switch (codeBook) { + case CODE_BOOK_ZERO_NO: + break; + + case CODE_BOOK_1_NO: + for(i=0; i<width; i+=4) { + t0 = values[i+0]; + t1 = values[i+1]; + t2 = values[i+2]; + t3 = values[i+3]; + codeWord = huff_ctab1[t0+1][t1+1][t2+1][t3+1]; + codeLength = HI_LTAB(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]); + WriteBits(hBitstream, codeWord, codeLength); + } + break; + + case CODE_BOOK_2_NO: + for(i=0; i<width; i+=4) { + t0 = values[i+0]; + t1 = values[i+1]; + t2 = values[i+2]; + t3 = values[i+3]; + codeWord = huff_ctab2[t0+1][t1+1][t2+1][t3+1]; + codeLength = LO_LTAB(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]); + WriteBits(hBitstream,codeWord,codeLength); + } + break; + + case CODE_BOOK_3_NO: + for(i=0; i<width; i+=4) { + sign=0; + signLength=0; + t0 = values[i+0]; + + if(t0 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t0 < 0){ + sign|=1; + t0=-t0; + } + } + t1 = values[i+1]; + + if(t1 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t1 < 0){ + sign|=1; + t1=-t1; + } + } + t2 = values[i+2]; + + if(t2 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t2 < 0){ + sign|=1; + t2=-t2; + } + } + t3 = values[i+3]; + if(t3 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t3 < 0){ + sign|=1; + t3=-t3; + } + } + + codeWord = huff_ctab3[t0][t1][t2][t3]; + codeLength = HI_LTAB(huff_ltab3_4[t0][t1][t2][t3]); + WriteBits(hBitstream,codeWord,codeLength); + WriteBits(hBitstream,sign,signLength); + } + break; + + case CODE_BOOK_4_NO: + for(i=0; i<width; i+=4) { + sign=0; + signLength=0; + t0 = values[i+0]; + + if(t0 != 0){ + signLength = signLength + 1; + sign = sign << 1; + if(t0 < 0){ + sign|=1; + t0=-t0; + } + } + t1 = values[i+1]; + + if(t1 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t1 < 0){ + sign|=1; + t1=-t1; + } + } + t2 = values[i+2]; + + if(t2 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t2 < 0){ + sign|=1; + t2=-t2; + } + } + t3 = values[i+3]; + + if(t3 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t3 < 0){ + sign|=1; + t3=-t3; + } + } + codeWord = huff_ctab4[t0][t1][t2][t3]; + codeLength = LO_LTAB(huff_ltab3_4[t0][t1][t2][t3]); + WriteBits(hBitstream,codeWord,codeLength); + WriteBits(hBitstream,sign,signLength); + } + break; + + case CODE_BOOK_5_NO: + for(i=0; i<width; i+=2) { + t0 = values[i+0]; + t1 = values[i+1]; + codeWord = huff_ctab5[t0+4][t1+4]; + codeLength = HI_LTAB(huff_ltab5_6[t0+4][t1+4]); + WriteBits(hBitstream,codeWord,codeLength); + } + break; + + case CODE_BOOK_6_NO: + for(i=0; i<width; i+=2) { + t0 = values[i+0]; + t1 = values[i+1]; + codeWord = huff_ctab6[t0+4][t1+4]; + codeLength = LO_LTAB(huff_ltab5_6[t0+4][t1+4]); + WriteBits(hBitstream,codeWord,codeLength); + } + break; + + case CODE_BOOK_7_NO: + for(i=0; i<width; i+=2){ + sign=0; + signLength=0; + t0 = values[i+0]; + + if(t0 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t0 < 0){ + sign|=1; + t0=-t0; + } + } + + t1 = values[i+1]; + + if(t1 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t1 < 0){ + sign|=1; + t1=-t1; + } + } + codeWord = huff_ctab7[t0][t1]; + codeLength = HI_LTAB(huff_ltab7_8[t0][t1]); + WriteBits(hBitstream,codeWord,codeLength); + WriteBits(hBitstream,sign,signLength); + } + break; + + case CODE_BOOK_8_NO: + for(i=0; i<width; i+=2) { + sign=0; + signLength=0; + t0 = values[i+0]; + + if(t0 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t0 < 0){ + sign|=1; + t0=-t0; + } + } + + t1 = values[i+1]; + + if(t1 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t1 < 0){ + sign|=1; + t1=-t1; + } + } + codeWord = huff_ctab8[t0][t1]; + codeLength = LO_LTAB(huff_ltab7_8[t0][t1]); + WriteBits(hBitstream,codeWord,codeLength); + WriteBits(hBitstream,sign,signLength); + } + break; + + case CODE_BOOK_9_NO: + for(i=0; i<width; i+=2) { + sign=0; + signLength=0; + t0 = values[i+0]; + + if(t0 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t0 < 0){ + sign|=1; + t0=-t0; + } + } + + t1 = values[i+1]; + + if(t1 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t1 < 0){ + sign|=1; + t1=-t1; + } + } + codeWord = huff_ctab9[t0][t1]; + codeLength = HI_LTAB(huff_ltab9_10[t0][t1]); + WriteBits(hBitstream,codeWord,codeLength); + WriteBits(hBitstream,sign,signLength); + } + break; + + case CODE_BOOK_10_NO: + for(i=0; i<width; i+=2) { + sign=0; + signLength=0; + t0 = values[i+0]; + + if(t0 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t0 < 0){ + sign|=1; + t0=-t0; + } + } + + t1 = values[i+1]; + + if(t1 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t1 < 0){ + sign|=1; + t1=-t1; + } + } + codeWord = huff_ctab10[t0][t1]; + codeLength = LO_LTAB(huff_ltab9_10[t0][t1]); + WriteBits(hBitstream,codeWord,codeLength); + WriteBits(hBitstream,sign,signLength); + } + break; + + case CODE_BOOK_ESC_NO: + for(i=0; i<width; i+=2) { + sign=0; + signLength=0; + t0 = values[i+0]; + + if(t0 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t0 < 0){ + sign|=1; + t0=-t0; + } + } + + t1 = values[i+1]; + + if(t1 != 0){ + signLength = signLength + 1; + sign = sign << 1; + + if(t1 < 0){ + sign|=1; + t1=-t1; + } + } + t00 = min(t0,16); + t01 = min(t1,16); + + codeWord = huff_ctab11[t00][t01]; + codeLength = huff_ltab11[t00][t01]; + WriteBits(hBitstream,codeWord,codeLength); + WriteBits(hBitstream,sign,signLength); + + if(t0 >= 16){ + Word16 n, p; + n=0; + p=t0; + while(sub(p=(p >> 1), 16) >= 0){ + + WriteBits(hBitstream,1,1); + n = n + 1; + } + WriteBits(hBitstream,0,1); + n = n + 4; + WriteBits(hBitstream,(t0 - (1 << n)),n); + } + + if(t1 >= 16){ + Word16 n, p; + n=0; + p=t1; + while(sub(p=(p >> 1), 16) >= 0){ + + WriteBits(hBitstream,1,1); + n = n + 1; + } + WriteBits(hBitstream,0,1); + n = n + 4; + WriteBits(hBitstream,(t1 - (1 << n)),n); + } + } + break; + + default: + break; + } + return(0); } Word16 bitCountScalefactorDelta(Word16 delta) diff --git a/media/libstagefright/codecs/aacenc/src/bitbuffer.c b/media/libstagefright/codecs/aacenc/src/bitbuffer.c index 3248f0b..ef13c13 100644 --- a/media/libstagefright/codecs/aacenc/src/bitbuffer.c +++ b/media/libstagefright/codecs/aacenc/src/bitbuffer.c @@ -1,23 +1,23 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: bitbuffer.c
-
- Content: Bit Buffer Management functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: bitbuffer.c + + Content: Bit Buffer Management functions + *******************************************************************************/ #include "bitbuffer.h" @@ -81,7 +81,7 @@ HANDLE_BIT_BUF CreateBitBuffer(HANDLE_BIT_BUF hBitBuf, *****************************************************************************/ void DeleteBitBuffer(HANDLE_BIT_BUF *hBitBuf) { - if(*hBitBuf)
+ if(*hBitBuf) (*hBitBuf)->isValid = 0; *hBitBuf = NULL; } diff --git a/media/libstagefright/codecs/aacenc/src/bitenc.c b/media/libstagefright/codecs/aacenc/src/bitenc.c index 588c2da..ea34407 100644 --- a/media/libstagefright/codecs/aacenc/src/bitenc.c +++ b/media/libstagefright/codecs/aacenc/src/bitenc.c @@ -1,23 +1,23 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: bitenc.c
-
- Content: Bitstream encoder functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: bitenc.c + + Content: Bitstream encoder functions + *******************************************************************************/ #include "bitenc.h" @@ -49,7 +49,7 @@ static Word32 encodeSpectralData(Word16 *sfbOffset, dbgVal = GetBitsAvail(hBitStream); for(i=0; i<sectionData->noOfSections; i++) { - psectioninfo = &(sectionData->sectionInfo[i]);
+ psectioninfo = &(sectionData->sectionInfo[i]); /* huffencode spectral data for this section */ @@ -564,7 +564,7 @@ static void writeFillElement( const UWord8 *ancBytes, } } } -
+ /***************************************************************************** * * function name: WriteBitStream @@ -577,39 +577,39 @@ Word16 WriteBitstream (HANDLE_BIT_BUF hBitStream, QC_OUT *qcOut, PSY_OUT *psyOut, Word16 *globUsedBits, - const UWord8 *ancBytes,
+ const UWord8 *ancBytes, Word16 sampindex ) /* returns error code */ { Word16 bitMarkUp; Word16 elementUsedBits; - Word16 frameBits=0;
-
- /* struct bitbuffer bsWriteCopy; */
- bitMarkUp = GetBitsAvail(hBitStream);
- if(qcOut->qcElement.adtsUsed) /* write adts header*/
- {
- WriteBits(hBitStream, 0xFFF, 12); /* 12 bit Syncword */
- WriteBits(hBitStream, 1, 1); /* ID == 0 for MPEG4 AAC, 1 for MPEG2 AAC */
- WriteBits(hBitStream, 0, 2); /* layer == 0 */
- WriteBits(hBitStream, 1, 1); /* protection absent */
- WriteBits(hBitStream, 1, 2); /* profile */
- WriteBits(hBitStream, sampindex, 4); /* sampling rate */
- WriteBits(hBitStream, 0, 1); /* private bit */
- WriteBits(hBitStream, elInfo.nChannelsInEl, 3); /* ch. config (must be > 0) */
- /* simply using numChannels only works for
- 6 channels or less, else a channel
- configuration should be written */
- WriteBits(hBitStream, 0, 1); /* original/copy */
- WriteBits(hBitStream, 0, 1); /* home */
-
- /* Variable ADTS header */
- WriteBits(hBitStream, 0, 1); /* copyr. id. bit */
- WriteBits(hBitStream, 0, 1); /* copyr. id. start */
- WriteBits(hBitStream, *globUsedBits >> 3, 13);
- WriteBits(hBitStream, 0x7FF, 11); /* buffer fullness (0x7FF for VBR) */
- WriteBits(hBitStream, 0, 2); /* raw data blocks (0+1=1) */
- }
+ Word16 frameBits=0; + + /* struct bitbuffer bsWriteCopy; */ + bitMarkUp = GetBitsAvail(hBitStream); + if(qcOut->qcElement.adtsUsed) /* write adts header*/ + { + WriteBits(hBitStream, 0xFFF, 12); /* 12 bit Syncword */ + WriteBits(hBitStream, 1, 1); /* ID == 0 for MPEG4 AAC, 1 for MPEG2 AAC */ + WriteBits(hBitStream, 0, 2); /* layer == 0 */ + WriteBits(hBitStream, 1, 1); /* protection absent */ + WriteBits(hBitStream, 1, 2); /* profile */ + WriteBits(hBitStream, sampindex, 4); /* sampling rate */ + WriteBits(hBitStream, 0, 1); /* private bit */ + WriteBits(hBitStream, elInfo.nChannelsInEl, 3); /* ch. config (must be > 0) */ + /* simply using numChannels only works for + 6 channels or less, else a channel + configuration should be written */ + WriteBits(hBitStream, 0, 1); /* original/copy */ + WriteBits(hBitStream, 0, 1); /* home */ + + /* Variable ADTS header */ + WriteBits(hBitStream, 0, 1); /* copyr. id. bit */ + WriteBits(hBitStream, 0, 1); /* copyr. id. start */ + WriteBits(hBitStream, *globUsedBits >> 3, 13); + WriteBits(hBitStream, 0x7FF, 11); /* buffer fullness (0x7FF for VBR) */ + WriteBits(hBitStream, 0, 2); /* raw data blocks (0+1=1) */ + } *globUsedBits=0; diff --git a/media/libstagefright/codecs/aacenc/src/block_switch.c b/media/libstagefright/codecs/aacenc/src/block_switch.c index c0054f7..d54e32f 100644 --- a/media/libstagefright/codecs/aacenc/src/block_switch.c +++ b/media/libstagefright/codecs/aacenc/src/block_switch.c @@ -1,27 +1,27 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: block_switch.c
-
- Content: Block switching functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: block_switch.c + + Content: Block switching functions + *******************************************************************************/ -#include "typedef.h"
-#include "basic_op.h"
+#include "typedef.h" +#include "basic_op.h" #include "oper_32b.h" #include "psy_const.h" #include "block_switch.h" @@ -132,7 +132,7 @@ Word16 BlockSwitching(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, for (i=0; i<MAX_NO_OF_GROUPS; i++) { blockSwitchingControl->groupLen[i] = suggestedGroupingTable[blockSwitchingControl->attackIndex][i]; - }
+ } /* if the samplerate is less than 16000, it should be all the short block, avoid pre&post echo */ if(sampleRate >= 16000) { @@ -274,7 +274,7 @@ static Word32 SrchMaxWithIndex(const Word32 in[], Word16 *index, Word16 n) * returns: TRUE if success * **********************************************************************************/ -#ifndef ARMV5E
+#ifndef ARMV5E Word32 CalcWindowEnergy(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, Word16 *timeSignal, Word16 chIncrement, @@ -283,14 +283,14 @@ Word32 CalcWindowEnergy(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, Word32 w, i, wOffset, tidx, ch; Word32 accuUE, accuFE; Word32 tempUnfiltered; - Word32 tempFiltered;
- Word32 states0, states1;
- Word32 Coeff0, Coeff1;
-
- - states0 = blockSwitchingControl->iirStates[0];
- states1 = blockSwitchingControl->iirStates[1];
- Coeff0 = hiPassCoeff[0];
+ Word32 tempFiltered; + Word32 states0, states1; + Word32 Coeff0, Coeff1; + + + states0 = blockSwitchingControl->iirStates[0]; + states1 = blockSwitchingControl->iirStates[1]; + Coeff0 = hiPassCoeff[0]; Coeff1 = hiPassCoeff[1]; tidx = 0; for (w=0; w < BLOCK_SWITCH_WINDOWS; w++) { @@ -299,19 +299,19 @@ Word32 CalcWindowEnergy(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, accuFE = 0; for(i=0; i<windowLen; i++) { - Word32 accu1, accu2, accu3;
- Word32 out;
+ Word32 accu1, accu2, accu3; + Word32 out; tempUnfiltered = timeSignal[tidx]; tidx = tidx + chIncrement; -
- accu1 = L_mpy_ls(Coeff1, tempUnfiltered);
- accu2 = fixmul( Coeff0, states1 );
- accu3 = accu1 - states0;
- out = accu3 - accu2;
-
- states0 = accu1;
- states1 = out;
-
+ + accu1 = L_mpy_ls(Coeff1, tempUnfiltered); + accu2 = fixmul( Coeff0, states1 ); + accu3 = accu1 - states0; + out = accu3 - accu2; + + states0 = accu1; + states1 = out; + tempFiltered = extract_h(out); accuUE += (tempUnfiltered * tempUnfiltered) >> ENERGY_SHIFT; accuFE += (tempFiltered * tempFiltered) >> ENERGY_SHIFT; @@ -320,9 +320,9 @@ Word32 CalcWindowEnergy(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, blockSwitchingControl->windowNrg[1][w] = accuUE; blockSwitchingControl->windowNrgF[1][w] = accuFE; - }
-
- blockSwitchingControl->iirStates[0] = states0;
+ } + + blockSwitchingControl->iirStates[0] = states0; blockSwitchingControl->iirStates[1] = states1; return(TRUE); diff --git a/media/libstagefright/codecs/aacenc/src/channel_map.c b/media/libstagefright/codecs/aacenc/src/channel_map.c index 247293b..2d41f8c 100644 --- a/media/libstagefright/codecs/aacenc/src/channel_map.c +++ b/media/libstagefright/codecs/aacenc/src/channel_map.c @@ -1,23 +1,23 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: channel_map.c
-
- Content: channel mapping functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: channel_map.c + + Content: channel mapping functions + *******************************************************************************/ #include "channel_map.h" diff --git a/media/libstagefright/codecs/aacenc/src/dyn_bits.c b/media/libstagefright/codecs/aacenc/src/dyn_bits.c index 3deacca..f3b3e02 100644 --- a/media/libstagefright/codecs/aacenc/src/dyn_bits.c +++ b/media/libstagefright/codecs/aacenc/src/dyn_bits.c @@ -1,23 +1,23 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: dyn_bits.c
-
- Content: Noiseless coder module functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: dyn_bits.c + + Content: Noiseless coder module functions + *******************************************************************************/ #include "aac_rom.h" @@ -177,14 +177,14 @@ gmStage1(SECTION_INFO * sectionInfo, const Word16 maxSfb, const Word16 *sideInfoTab) { - SECTION_INFO * sectionInfo_s;
- SECTION_INFO * sectionInfo_e;
+ SECTION_INFO * sectionInfo_s; + SECTION_INFO * sectionInfo_e; Word32 mergeStart, mergeEnd; mergeStart = 0; do { - sectionInfo_s = sectionInfo + mergeStart;
+ sectionInfo_s = sectionInfo + mergeStart; for (mergeEnd=mergeStart+1; mergeEnd<maxSfb; mergeEnd++) { sectionInfo_e = sectionInfo + mergeEnd; if (sectionInfo_s->codeBook != sectionInfo_e->codeBook) @@ -372,9 +372,9 @@ static void scfCount(const Word16 *scalefacGain, SECTION_DATA * sectionData) { - SECTION_INFO *psectionInfo;
- SECTION_INFO *psectionInfom;
-
+ SECTION_INFO *psectionInfo; + SECTION_INFO *psectionInfom; + /* counter */ Word32 i = 0; /* section counter */ Word32 j = 0; /* sfb counter */ @@ -397,7 +397,7 @@ static void scfCount(const Word16 *scalefacGain, } lastValScf = 0; - sectionData->firstScf = 0;
+ sectionData->firstScf = 0; psectionInfo = sectionData->sectionInfo; for (i=0; i<sectionData->noOfSections; i++) { @@ -406,9 +406,9 @@ static void scfCount(const Word16 *scalefacGain, sectionData->firstScf = psectionInfo->sfbStart; lastValScf = scalefacGain[sectionData->firstScf]; break; - }
+ } psectionInfo += 1; - }
+ } psectionInfo = sectionData->sectionInfo; for (i=0; i<sectionData->noOfSections; i++, psectionInfo += 1) { @@ -451,7 +451,7 @@ static void scfCount(const Word16 *scalefacGain, scfSkipCounter = scfSkipCounter + 1; } } -
+ psectionInfom = psectionInfo + 1; /* search for the next maxValueInSfb[] != 0 in all other sections */ for (m = i + 1; (m < sectionData->noOfSections) && (found == 0); m++) { @@ -477,8 +477,8 @@ static void scfCount(const Word16 *scalefacGain, /* count scalefactor skip */ scfSkipCounter = scfSkipCounter + 1; } - }
-
+ } + psectionInfom += 1; } @@ -490,7 +490,7 @@ static void scfCount(const Word16 *scalefacGain, else { deltaScf = 0; scfSkipCounter = scfSkipCounter - 1; - }
+ } } else { deltaScf = lastValScf - scalefacGain[j]; @@ -539,7 +539,7 @@ dynBitCount(const Word16 *quantSpectrum, sectionData); - return (sectionData->huffmanBits + sectionData->sideInfoBits +
+ return (sectionData->huffmanBits + sectionData->sideInfoBits + sectionData->scalefacBits); } diff --git a/media/libstagefright/codecs/aacenc/src/grp_data.c b/media/libstagefright/codecs/aacenc/src/grp_data.c index 08d9a76..fb88654 100644 --- a/media/libstagefright/codecs/aacenc/src/grp_data.c +++ b/media/libstagefright/codecs/aacenc/src/grp_data.c @@ -1,26 +1,26 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: grp_data.c
-
- Content: Short block grouping function
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: grp_data.c + + Content: Short block grouping function + *******************************************************************************/ -#include "basic_op.h"
+#include "basic_op.h" #include "psy_const.h" #include "interface.h" #include "grp_data.h" @@ -179,9 +179,9 @@ groupShortData(Word32 *mdctSpectrum, } for(i=0;i<FRAME_LEN_LONG;i+=4) { - mdctSpectrum[i] = tmpSpectrum[i];
- mdctSpectrum[i+1] = tmpSpectrum[i+1];
- mdctSpectrum[i+2] = tmpSpectrum[i+2];
+ mdctSpectrum[i] = tmpSpectrum[i]; + mdctSpectrum[i+1] = tmpSpectrum[i+1]; + mdctSpectrum[i+2] = tmpSpectrum[i+2]; mdctSpectrum[i+3] = tmpSpectrum[i+3]; } } diff --git a/media/libstagefright/codecs/aacenc/src/interface.c b/media/libstagefright/codecs/aacenc/src/interface.c index 304b1d4..34fee00 100644 --- a/media/libstagefright/codecs/aacenc/src/interface.c +++ b/media/libstagefright/codecs/aacenc/src/interface.c @@ -1,27 +1,27 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: interface.c
-
- Content: Interface psychoaccoustic/quantizer functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: interface.c + + Content: Interface psychoaccoustic/quantizer functions + *******************************************************************************/ -#include "basic_op.h"
-#include "oper_32b.h"
+#include "basic_op.h" +#include "oper_32b.h" #include "psy_const.h" #include "interface.h" @@ -50,7 +50,7 @@ void BuildInterface(Word32 *groupedMdctSpectrum, { Word32 j; Word32 grp; - Word32 mask;
+ Word32 mask; Word16 *tmpV; /* @@ -70,11 +70,11 @@ void BuildInterface(Word32 *groupedMdctSpectrum, psyOutCh->sfbThreshold = groupedSfbThreshold->sfbLong; psyOutCh->sfbSpreadedEnergy = groupedSfbSpreadedEnergy->sfbLong; - tmpV = psyOutCh->sfbOffsets;
+ tmpV = psyOutCh->sfbOffsets; for(j=0; j<groupedSfbCnt + 1; j++) { *tmpV++ = groupedSfbOffset[j]; } -
+ tmpV = psyOutCh->sfbMinSnr; for(j=0;j<groupedSfbCnt; j++) { *tmpV++ = groupedSfbMinSnr[j]; @@ -98,8 +98,8 @@ void BuildInterface(Word32 *groupedMdctSpectrum, else { Word32 i; Word32 accuSumMS=0; - Word32 accuSumLR=0;
- Word32 *pSumMS = sfbEnergySumMS.sfbShort;
+ Word32 accuSumLR=0; + Word32 *pSumMS = sfbEnergySumMS.sfbShort; Word32 *pSumLR = sfbEnergySumLR.sfbShort; for (i=TRANS_FAC; i; i--) { diff --git a/media/libstagefright/codecs/aacenc/src/line_pe.c b/media/libstagefright/codecs/aacenc/src/line_pe.c index da57647..5e93cd0 100644 --- a/media/libstagefright/codecs/aacenc/src/line_pe.c +++ b/media/libstagefright/codecs/aacenc/src/line_pe.c @@ -1,26 +1,26 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: line_pe.c
-
- Content: Perceptual entropie module functions
-
-*******************************************************************************/
- -#include "basic_op.h"
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: line_pe.c + + Content: Perceptual entropie module functions + +*******************************************************************************/ + +#include "basic_op.h" #include "oper_32b.h" #include "typedef.h" #include "line_pe.h" @@ -75,7 +75,7 @@ void calcSfbPe(PE_DATA *peData, Word32 ch; Word32 sfbGrp, sfb; Word32 nLines4; - Word32 ldThr, ldRatio;
+ Word32 ldThr, ldRatio; Word32 pe, constPart, nActiveLines; peData->pe = peData->offset; @@ -95,7 +95,7 @@ void calcSfbPe(PE_DATA *peData, for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { Word32 nrg = sfbEnergy[sfbGrp+sfb]; Word32 thres = sfbThreshold[sfbGrp+sfb]; - Word32 sfbLDEn = peChanData->sfbLdEnergy[sfbGrp+sfb];
+ Word32 sfbLDEn = peChanData->sfbLdEnergy[sfbGrp+sfb]; if (nrg > thres) { ldThr = iLog4(thres); @@ -111,10 +111,10 @@ void calcSfbPe(PE_DATA *peData, } else { /* sfbPe = nl*(c2 + c3*log2(en/thr))*/ - peChanData->sfbPe[sfbGrp+sfb] = extract_l((L_mpy_wx(
- (C2_I + C3_I * ldRatio * 2) << 4, nLines4) + 4) >> 3);
- peChanData->sfbConstPart[sfbGrp+sfb] = extract_l(( L_mpy_wx(
- (C2_I + C3_I * sfbLDEn * 2) << 4, nLines4) + 4) >> 3);
+ peChanData->sfbPe[sfbGrp+sfb] = extract_l((L_mpy_wx( + (C2_I + C3_I * ldRatio * 2) << 4, nLines4) + 4) >> 3); + peChanData->sfbConstPart[sfbGrp+sfb] = extract_l(( L_mpy_wx( + (C2_I + C3_I * sfbLDEn * 2) << 4, nLines4) + 4) >> 3); nLines4 = (nLines4 * C3_I + (1024<<1)) >> 10; } peChanData->sfbNActiveLines[sfbGrp+sfb] = nLines4 >> 2; @@ -129,10 +129,10 @@ void calcSfbPe(PE_DATA *peData, nActiveLines = nActiveLines + peChanData->sfbNActiveLines[sfbGrp+sfb]; } } -
- peChanData->pe = saturate(pe);
- peChanData->constPart = saturate(constPart);
- peChanData->nActiveLines = saturate(nActiveLines);
+ + peChanData->pe = saturate(pe); + peChanData->constPart = saturate(constPart); + peChanData->nActiveLines = saturate(nActiveLines); pe += peData->pe; diff --git a/media/libstagefright/codecs/aacenc/src/ms_stereo.c b/media/libstagefright/codecs/aacenc/src/ms_stereo.c index c83d07b..44d45cc 100644 --- a/media/libstagefright/codecs/aacenc/src/ms_stereo.c +++ b/media/libstagefright/codecs/aacenc/src/ms_stereo.c @@ -1,26 +1,26 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: ms_stereo.c
-
- Content: MS stereo processing function
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: ms_stereo.c + + Content: MS stereo processing function + *******************************************************************************/ -#include "basic_op.h"
+#include "basic_op.h" #include "oper_32b.h" #include "psy_const.h" #include "ms_stereo.h" @@ -74,10 +74,10 @@ void MsStereoProcessing(Word32 *sfbEnergyLeft, minThreshold = min(thrL, thrR); nrgL = max(nrgL,thrL) + 1; - shift = norm_l(nrgL);
+ shift = norm_l(nrgL); nrgL = Div_32(thrL << shift, nrgL << shift); nrgR = max(nrgR,thrR) + 1; - shift = norm_l(nrgR);
+ shift = norm_l(nrgR); nrgR = Div_32(thrR << shift, nrgR << shift); pnlr = fixmul(nrgL, nrgR); @@ -86,11 +86,11 @@ void MsStereoProcessing(Word32 *sfbEnergyLeft, nrgR = sfbEnergySide[idx]; nrgL = max(nrgL,minThreshold) + 1; - shift = norm_l(nrgL);
+ shift = norm_l(nrgL); nrgL = Div_32(minThreshold << shift, nrgL << shift); nrgR = max(nrgR,minThreshold) + 1; - shift = norm_l(nrgR);
+ shift = norm_l(nrgR); nrgR = Div_32(minThreshold << shift, nrgR << shift); pnms = fixmul(nrgL, nrgR); diff --git a/media/libstagefright/codecs/aacenc/src/pre_echo_control.c b/media/libstagefright/codecs/aacenc/src/pre_echo_control.c index f59216e..1e818a2 100644 --- a/media/libstagefright/codecs/aacenc/src/pre_echo_control.c +++ b/media/libstagefright/codecs/aacenc/src/pre_echo_control.c @@ -1,27 +1,27 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: pre_echo_control.c
-
- Content: Pre echo control functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: pre_echo_control.c + + Content: Pre echo control functions + *******************************************************************************/ -#include "basic_op.h"
-#include "oper_32b.h"
+#include "basic_op.h" +#include "oper_32b.h" #include "oper_32b.h" #include "pre_echo_control.h" diff --git a/media/libstagefright/codecs/aacenc/src/psy_configuration.c b/media/libstagefright/codecs/aacenc/src/psy_configuration.c index 586e00f..8e599b0 100644 --- a/media/libstagefright/codecs/aacenc/src/psy_configuration.c +++ b/media/libstagefright/codecs/aacenc/src/psy_configuration.c @@ -1,26 +1,26 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: psy_configuration.c
-
- Content: Psychoaccoustic configuration functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: psy_configuration.c + + Content: Psychoaccoustic configuration functions + *******************************************************************************/ -#include "basic_op.h"
+#include "basic_op.h" #include "oper_32b.h" #include "psy_configuration.h" #include "adj_thr.h" @@ -29,10 +29,10 @@ #define BARC_SCALE 100 /* integer barc values are scaled with 100 */ -#define LOG2_1000 301 /* log2*1000 */
-#define PI2_1000 1571 /* pi/2*1000*/
-#define ATAN_COEF1 3560 /* 1000/0.280872f*/
-#define ATAN_COEF2 281 /* 1000*0.280872f*/
+#define LOG2_1000 301 /* log2*1000 */ +#define PI2_1000 1571 /* pi/2*1000*/ +#define ATAN_COEF1 3560 /* 1000/0.280872f*/ +#define ATAN_COEF2 281 /* 1000*0.280872f*/ typedef struct{ @@ -57,30 +57,30 @@ static const Word16 maskLowSprEnLong = 30; /* in 1dB/bark */ static const Word16 maskHighSprEnLong = 20; /* in 1dB/bark */ static const Word16 maskHighSprEnLongLowBr = 15; /* in 1dB/bark */ static const Word16 maskLowSprEnShort = 20; /* in 1dB/bark */ -static const Word16 maskHighSprEnShort = 15; /* in 1dB/bark */
-static const Word16 c_minRemainingThresholdFactor = 0x0148; /* 0.01 *(1 << 15)*/
-static const Word32 c_maxsnr = 0x66666666; /* upper limit is -1 dB */
-static const Word32 c_minsnr = 0x00624dd3; /* lower limit is -25 dB */
-
-static const Word32 c_maxClipEnergyLong = 0x77359400; /* 2.0e9f*/
-static const Word32 c_maxClipEnergyShort = 0x01dcd650; /* 2.0e9f/(AACENC_TRANS_FAC*AACENC_TRANS_FAC)*/
-
-
-Word32 GetSRIndex(Word32 sampleRate)
-{
- if (92017 <= sampleRate) return 0;
- if (75132 <= sampleRate) return 1;
- if (55426 <= sampleRate) return 2;
- if (46009 <= sampleRate) return 3;
- if (37566 <= sampleRate) return 4;
- if (27713 <= sampleRate) return 5;
- if (23004 <= sampleRate) return 6;
- if (18783 <= sampleRate) return 7;
- if (13856 <= sampleRate) return 8;
- if (11502 <= sampleRate) return 9;
- if (9391 <= sampleRate) return 10;
-
- return 11;
+static const Word16 maskHighSprEnShort = 15; /* in 1dB/bark */ +static const Word16 c_minRemainingThresholdFactor = 0x0148; /* 0.01 *(1 << 15)*/ +static const Word32 c_maxsnr = 0x66666666; /* upper limit is -1 dB */ +static const Word32 c_minsnr = 0x00624dd3; /* lower limit is -25 dB */ + +static const Word32 c_maxClipEnergyLong = 0x77359400; /* 2.0e9f*/ +static const Word32 c_maxClipEnergyShort = 0x01dcd650; /* 2.0e9f/(AACENC_TRANS_FAC*AACENC_TRANS_FAC)*/ + + +Word32 GetSRIndex(Word32 sampleRate) +{ + if (92017 <= sampleRate) return 0; + if (75132 <= sampleRate) return 1; + if (55426 <= sampleRate) return 2; + if (46009 <= sampleRate) return 3; + if (37566 <= sampleRate) return 4; + if (27713 <= sampleRate) return 5; + if (23004 <= sampleRate) return 6; + if (18783 <= sampleRate) return 7; + if (13856 <= sampleRate) return 8; + if (11502 <= sampleRate) return 9; + if (9391 <= sampleRate) return 10; + + return 11; } @@ -89,8 +89,8 @@ Word32 GetSRIndex(Word32 sampleRate) * function name: atan_1000 * description: calculates 1000*atan(x/1000) * based on atan approx for x > 0 -* atan(x) = x/((float)1.0f+(float)0.280872f*x*x) if x < 1
-* = pi/2 - x/((float)0.280872f +x*x) if x >= 1
+* atan(x) = x/((float)1.0f+(float)0.280872f*x*x) if x < 1 +* = pi/2 - x/((float)0.280872f +x*x) if x >= 1 * return: 1000*atan(x/1000) * **********************************************************************************/ @@ -272,7 +272,7 @@ static void initBarcValues(Word16 numPb, * * function name: initMinSnr * description: calculate min snr parameter -* minSnr(n) = 1/(2^sfbPemin(n)/w(n) - 1.5)
+* minSnr(n) = 1/(2^sfbPemin(n)/w(n) - 1.5) * *****************************************************************************/ static void initMinSnr(const Word32 bitrate, @@ -303,7 +303,7 @@ static void initMinSnr(const Word32 bitrate, barcWidth = pbVal1 - pbVal0; pbVal0 = pbVal1; - /* allow at least 2.4% of pe for each active barc */
+ /* allow at least 2.4% of pe for each active barc */ pePart = ((pePerWindow * 24) * (max_bark * barcWidth)) / (pbBarcVal[sfbActive-1] * (sfbOffset[sfb+1] - sfbOffset[sfb])); @@ -311,15 +311,15 @@ static void initMinSnr(const Word32 bitrate, pePart = min(pePart, 8400); pePart = max(pePart, 1400); - /* minSnr(n) = 1/(2^sfbPemin(n)/w(n) - 1.5)*/
+ /* minSnr(n) = 1/(2^sfbPemin(n)/w(n) - 1.5)*/ /* we add an offset of 2^16 to the pow functions */ - /* 0xc000 = 1.5*(1 << 15)*/
+ /* 0xc000 = 1.5*(1 << 15)*/ snr = pow2_xy((pePart - 16*1000),1000) - 0x0000c000; - if(snr > 0x00008000)
- {
- shift = norm_l(snr);
+ if(snr > 0x00008000) + { + shift = norm_l(snr); snr = Div_32(0x00008000 << shift, snr << shift); } else @@ -347,16 +347,16 @@ Word16 InitPsyConfigurationLong(Word32 bitrate, Word16 bandwidth, PSY_CONFIGURATION_LONG *psyConf) { - Word32 samplerateindex;
- Word16 sfbBarcVal[MAX_SFB_LONG];
+ Word32 samplerateindex; + Word16 sfbBarcVal[MAX_SFB_LONG]; Word16 sfb; /* init sfb table - */
- samplerateindex = GetSRIndex(samplerate);
- psyConf->sfbCnt = sfBandTotalLong[samplerateindex];
- psyConf->sfbOffset = sfBandTabLong + sfBandTabLongOffset[samplerateindex];
+ */ + samplerateindex = GetSRIndex(samplerate); + psyConf->sfbCnt = sfBandTotalLong[samplerateindex]; + psyConf->sfbOffset = sfBandTabLong + sfBandTabLongOffset[samplerateindex]; psyConf->sampRateIdx = samplerateindex; /* @@ -429,7 +429,7 @@ Word16 InitPsyConfigurationLong(Word32 bitrate, Word16 InitPsyConfigurationShort(Word32 bitrate, Word32 samplerate, Word16 bandwidth, - PSY_CONFIGURATION_SHORT *psyConf)
+ PSY_CONFIGURATION_SHORT *psyConf) { Word32 samplerateindex; Word16 sfbBarcVal[MAX_SFB_SHORT]; @@ -437,8 +437,8 @@ Word16 InitPsyConfigurationShort(Word32 bitrate, /* init sfb table */ - samplerateindex = GetSRIndex(samplerate);
- psyConf->sfbCnt = sfBandTotalShort[samplerateindex];
+ samplerateindex = GetSRIndex(samplerate); + psyConf->sfbCnt = sfBandTotalShort[samplerateindex]; psyConf->sfbOffset = sfBandTabShort + sfBandTabShortOffset[samplerateindex]; psyConf->sampRateIdx = samplerateindex; /* diff --git a/media/libstagefright/codecs/aacenc/src/psy_main.c b/media/libstagefright/codecs/aacenc/src/psy_main.c index 8746a72..3d0a355 100644 --- a/media/libstagefright/codecs/aacenc/src/psy_main.c +++ b/media/libstagefright/codecs/aacenc/src/psy_main.c @@ -1,27 +1,27 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: psy_main.c
-
- Content: Psychoacoustic major functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: psy_main.c + + Content: Psychoacoustic major functions + *******************************************************************************/ -#include "typedef.h"
-#include "basic_op.h"
+#include "typedef.h" +#include "basic_op.h" #include "oper_32b.h" #include "psy_const.h" #include "block_switch.h" @@ -77,27 +77,27 @@ static Word16 advancePsychShortMS (PSY_DATA psyData[MAX_CHANNELS], *****************************************************************************/ Word16 PsyNew(PSY_KERNEL *hPsy, Word32 nChan, VO_MEM_OPERATOR *pMemOP) { - Word16 i;
- Word32 *mdctSpectrum;
- Word32 *scratchTNS;
- Word16 *mdctDelayBuffer;
-
- mdctSpectrum = (Word32 *)mem_malloc(pMemOP, nChan * FRAME_LEN_LONG * sizeof(Word32), 32, VO_INDEX_ENC_AAC);
- if(NULL == mdctSpectrum)
- return 1;
-
- scratchTNS = (Word32 *)mem_malloc(pMemOP, nChan * FRAME_LEN_LONG * sizeof(Word32), 32, VO_INDEX_ENC_AAC);
- if(NULL == scratchTNS)
- {
- return 1;
- }
-
- mdctDelayBuffer = (Word16 *)mem_malloc(pMemOP, nChan * BLOCK_SWITCHING_OFFSET * sizeof(Word16), 32, VO_INDEX_ENC_AAC);
- if(NULL == mdctDelayBuffer)
- {
+ Word16 i; + Word32 *mdctSpectrum; + Word32 *scratchTNS; + Word16 *mdctDelayBuffer; + + mdctSpectrum = (Word32 *)mem_malloc(pMemOP, nChan * FRAME_LEN_LONG * sizeof(Word32), 32, VO_INDEX_ENC_AAC); + if(NULL == mdctSpectrum) + return 1; + + scratchTNS = (Word32 *)mem_malloc(pMemOP, nChan * FRAME_LEN_LONG * sizeof(Word32), 32, VO_INDEX_ENC_AAC); + if(NULL == scratchTNS) + { return 1; - }
-
+ } + + mdctDelayBuffer = (Word16 *)mem_malloc(pMemOP, nChan * BLOCK_SWITCHING_OFFSET * sizeof(Word16), 32, VO_INDEX_ENC_AAC); + if(NULL == mdctDelayBuffer) + { + return 1; + } + for (i=0; i<nChan; i++){ hPsy->psyData[i].mdctDelayBuffer = mdctDelayBuffer + i*BLOCK_SWITCHING_OFFSET; hPsy->psyData[i].mdctSpectrum = mdctSpectrum + i*FRAME_LEN_LONG; @@ -118,27 +118,27 @@ Word16 PsyNew(PSY_KERNEL *hPsy, Word32 nChan, VO_MEM_OPERATOR *pMemOP) *****************************************************************************/ Word16 PsyDelete(PSY_KERNEL *hPsy, VO_MEM_OPERATOR *pMemOP) { - Word32 nch;
-
- if(hPsy)
- {
- if(hPsy->psyData[0].mdctDelayBuffer)
- mem_free(pMemOP, hPsy->psyData[0].mdctDelayBuffer, VO_INDEX_ENC_AAC);
-
- if(hPsy->psyData[0].mdctSpectrum)
- mem_free(pMemOP, hPsy->psyData[0].mdctSpectrum, VO_INDEX_ENC_AAC);
-
- for (nch=0; nch<MAX_CHANNELS; nch++){
- hPsy->psyData[nch].mdctDelayBuffer = NULL;
- hPsy->psyData[nch].mdctSpectrum = NULL;
- }
-
- if(hPsy->pScratchTns)
- {
- mem_free(pMemOP, hPsy->pScratchTns, VO_INDEX_ENC_AAC);
- hPsy->pScratchTns = NULL;
- }
- }
+ Word32 nch; + + if(hPsy) + { + if(hPsy->psyData[0].mdctDelayBuffer) + mem_free(pMemOP, hPsy->psyData[0].mdctDelayBuffer, VO_INDEX_ENC_AAC); + + if(hPsy->psyData[0].mdctSpectrum) + mem_free(pMemOP, hPsy->psyData[0].mdctSpectrum, VO_INDEX_ENC_AAC); + + for (nch=0; nch<MAX_CHANNELS; nch++){ + hPsy->psyData[nch].mdctDelayBuffer = NULL; + hPsy->psyData[nch].mdctSpectrum = NULL; + } + + if(hPsy->pScratchTns) + { + mem_free(pMemOP, hPsy->pScratchTns, VO_INDEX_ENC_AAC); + hPsy->pScratchTns = NULL; + } + } return 0; } @@ -196,10 +196,10 @@ Word16 psyMainInit(PSY_KERNEL *hPsy, err = InitPsyConfigurationLong(channelBitRate, sampleRate, bandwidth, - &(hPsy->psyConfLong));
-
+ &(hPsy->psyConfLong)); + if (!err) { - hPsy->sampleRateIdx = hPsy->psyConfLong.sampRateIdx;
+ hPsy->sampleRateIdx = hPsy->psyConfLong.sampRateIdx; err = InitTnsConfigurationLong(bitRate, sampleRate, channels, &hPsy->psyConfLong.tnsConf, &hPsy->psyConfLong, tnsMask&2); } @@ -263,7 +263,7 @@ Word16 psyMain(Word16 nChannels, channels = elemInfo->nChannelsInEl; maxScale = 0; - /* block switching */
+ /* block switching */ for(ch = 0; ch < channels; ch++) { BlockSwitching(&psyData[ch].blockSwitchingControl, timeSignal+elemInfo->ChannelIndex[ch], @@ -477,11 +477,11 @@ static Word16 advancePsychLong(PSY_DATA* psyData, { Word32 i; Word32 normEnergyShift = (psyData->mdctScale + 1) << 1; /* in reference code, mdct spectrum must be multipied with 2, so +1 */ - Word32 clipEnergy = hPsyConfLong->clipEnergy >> normEnergyShift;
+ Word32 clipEnergy = hPsyConfLong->clipEnergy >> normEnergyShift; Word32 *data0, *data1, tdata; /* low pass */ - data0 = psyData->mdctSpectrum + hPsyConfLong->lowpassLine;
+ data0 = psyData->mdctSpectrum + hPsyConfLong->lowpassLine; for(i=hPsyConfLong->lowpassLine; i<FRAME_LEN_LONG; i++) { *data0++ = 0; } @@ -525,11 +525,11 @@ static Word16 advancePsychLong(PSY_DATA* psyData, psyData->blockSwitchingControl.windowSequence); /* first part of threshold calculation */ - data0 = psyData->sfbEnergy.sfbLong;
- data1 = psyData->sfbThreshold.sfbLong;
+ data0 = psyData->sfbEnergy.sfbLong; + data1 = psyData->sfbThreshold.sfbLong; for (i=hPsyConfLong->sfbCnt; i; i--) { tdata = L_mpy_ls(*data0++, hPsyConfLong->ratio); - *data1++ = min(tdata, clipEnergy);
+ *data1++ = min(tdata, clipEnergy); } /* Calc sfb-bandwise mdct-energies for left and right channel again */ @@ -540,12 +540,12 @@ static Word16 advancePsychLong(PSY_DATA* psyData, hPsyConfLong->sfbActive - tnsStartBand, psyData->sfbEnergy.sfbLong+tnsStartBand, &psyData->sfbEnergySum.sfbLong); -
- data0 = psyData->sfbEnergy.sfbLong;
- tdata = psyData->sfbEnergySum.sfbLong;
+ + data0 = psyData->sfbEnergy.sfbLong; + tdata = psyData->sfbEnergySum.sfbLong; for (i=0; i<tnsStartBand; i++) - tdata += *data0++;
-
+ tdata += *data0++; + psyData->sfbEnergySum.sfbLong = tdata; } @@ -557,20 +557,20 @@ static Word16 advancePsychLong(PSY_DATA* psyData, psyData->sfbThreshold.sfbLong); /* threshold in quiet */ - data0 = psyData->sfbThreshold.sfbLong;
- data1 = hPsyConfLong->sfbThresholdQuiet;
+ data0 = psyData->sfbThreshold.sfbLong; + data1 = hPsyConfLong->sfbThresholdQuiet; for (i=hPsyConfLong->sfbCnt; i; i--) - {
- *data0 = max(*data0, (*data1 >> normEnergyShift));
- data0++; data1++;
+ { + *data0 = max(*data0, (*data1 >> normEnergyShift)); + data0++; data1++; } /* preecho control */ if (psyData->blockSwitchingControl.windowSequence == STOP_WINDOW) { - data0 = psyData->sfbThresholdnm1;
- for (i=hPsyConfLong->sfbCnt; i; i--) {
- *data0++ = MAX_32;
- }
+ data0 = psyData->sfbThresholdnm1; + for (i=hPsyConfLong->sfbCnt; i; i--) { + *data0++ = MAX_32; + } psyData->mdctScalenm1 = 0; } @@ -585,7 +585,7 @@ static Word16 advancePsychLong(PSY_DATA* psyData, if (psyData->blockSwitchingControl.windowSequence== START_WINDOW) { - data0 = psyData->sfbThresholdnm1;
+ data0 = psyData->sfbThresholdnm1; for (i=hPsyConfLong->sfbCnt; i; i--) { *data0++ = MAX_32; } @@ -600,10 +600,10 @@ static Word16 advancePsychLong(PSY_DATA* psyData, /* spreaded energy */ - data0 = psyData->sfbSpreadedEnergy.sfbLong;
- data1 = psyData->sfbEnergy.sfbLong;
+ data0 = psyData->sfbSpreadedEnergy.sfbLong; + data1 = psyData->sfbEnergy.sfbLong; for (i=hPsyConfLong->sfbCnt; i; i--) { - //psyData->sfbSpreadedEnergy.sfbLong[i] = psyData->sfbEnergy.sfbLong[i];
+ //psyData->sfbSpreadedEnergy.sfbLong[i] = psyData->sfbEnergy.sfbLong[i]; *data0++ = *data1++; } @@ -657,14 +657,14 @@ static Word16 advancePsychShort(PSY_DATA* psyData, Word32 w; Word32 normEnergyShift = (psyData->mdctScale + 1) << 1; /* in reference code, mdct spectrum must be multipied with 2, so +1 */ Word32 clipEnergy = hPsyConfShort->clipEnergy >> normEnergyShift; - Word32 wOffset = 0;
+ Word32 wOffset = 0; Word32 *data0, *data1; for(w = 0; w < TRANS_FAC; w++) { Word32 i, tdata; /* low pass */ - data0 = psyData->mdctSpectrum + wOffset + hPsyConfShort->lowpassLine;
+ data0 = psyData->mdctSpectrum + wOffset + hPsyConfShort->lowpassLine; for(i=hPsyConfShort->lowpassLine; i<FRAME_LEN_SHORT; i++){ *data0++ = 0; } @@ -706,11 +706,11 @@ static Word16 advancePsychShort(PSY_DATA* psyData, psyData->blockSwitchingControl.windowSequence); /* first part of threshold calculation */ - data0 = psyData->sfbThreshold.sfbShort[w];
- data1 = psyData->sfbEnergy.sfbShort[w];
+ data0 = psyData->sfbThreshold.sfbShort[w]; + data1 = psyData->sfbEnergy.sfbShort[w]; for (i=hPsyConfShort->sfbCnt; i; i--) { tdata = L_mpy_ls(*data1++, hPsyConfShort->ratio); - *data0++ = min(tdata, clipEnergy);
+ *data0++ = min(tdata, clipEnergy); } /* Calc sfb-bandwise mdct-energies for left and right channel again */ @@ -720,13 +720,13 @@ static Word16 advancePsychShort(PSY_DATA* psyData, hPsyConfShort->sfbOffset+tnsStartBand, (hPsyConfShort->sfbActive - tnsStartBand), psyData->sfbEnergy.sfbShort[w]+tnsStartBand, - &psyData->sfbEnergySum.sfbShort[w]);
+ &psyData->sfbEnergySum.sfbShort[w]); - tdata = psyData->sfbEnergySum.sfbShort[w];
- data0 = psyData->sfbEnergy.sfbShort[w];
+ tdata = psyData->sfbEnergySum.sfbShort[w]; + data0 = psyData->sfbEnergy.sfbShort[w]; for (i=tnsStartBand; i; i--) - tdata += *data0++;
-
+ tdata += *data0++; + psyData->sfbEnergySum.sfbShort[w] = tdata; } @@ -738,14 +738,14 @@ static Word16 advancePsychShort(PSY_DATA* psyData, /* threshold in quiet */ - data0 = psyData->sfbThreshold.sfbShort[w];
- data1 = hPsyConfShort->sfbThresholdQuiet;
+ data0 = psyData->sfbThreshold.sfbShort[w]; + data1 = hPsyConfShort->sfbThresholdQuiet; for (i=hPsyConfShort->sfbCnt; i; i--) - {
- *data0 = max(*data0, (*data1 >> normEnergyShift));
-
- data0++; data1++;
- }
+ { + *data0 = max(*data0, (*data1 >> normEnergyShift)); + + data0++; data1++; + } /* preecho */ @@ -764,8 +764,8 @@ static Word16 advancePsychShort(PSY_DATA* psyData, psyData->sfbThreshold.sfbShort[w]); /* spreaded energy */ - data0 = psyData->sfbSpreadedEnergy.sfbShort[w];
- data1 = psyData->sfbEnergy.sfbShort[w];
+ data0 = psyData->sfbSpreadedEnergy.sfbShort[w]; + data1 = psyData->sfbEnergy.sfbShort[w]; for (i=hPsyConfShort->sfbCnt; i; i--) { *data0++ = *data1++; } diff --git a/media/libstagefright/codecs/aacenc/src/qc_main.c b/media/libstagefright/codecs/aacenc/src/qc_main.c index a568020..e8c39e4 100644 --- a/media/libstagefright/codecs/aacenc/src/qc_main.c +++ b/media/libstagefright/codecs/aacenc/src/qc_main.c @@ -1,27 +1,27 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: qc_main.c
-
- Content: Quantizing & coding functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: qc_main.c + + Content: Quantizing & coding functions + *******************************************************************************/ -#include "basic_op.h"
-#include "oper_32b.h"
+#include "basic_op.h" +#include "oper_32b.h" #include "qc_main.h" #include "quantize.h" #include "interface.h" @@ -120,25 +120,25 @@ static Word16 framePadding(Word32 bitRate, Word16 QCOutNew(QC_OUT *hQC, Word16 nChannels, VO_MEM_OPERATOR *pMemOP) { - Word32 i;
- Word16 *quantSpec;
- Word16 *scf;
+ Word32 i; + Word16 *quantSpec; + Word16 *scf; UWord16 *maxValueInSfb; -
- quantSpec = (Word16 *)mem_malloc(pMemOP, nChannels * FRAME_LEN_LONG * sizeof(Word16), 32, VO_INDEX_ENC_AAC);
- if(NULL == quantSpec)
+ + quantSpec = (Word16 *)mem_malloc(pMemOP, nChannels * FRAME_LEN_LONG * sizeof(Word16), 32, VO_INDEX_ENC_AAC); + if(NULL == quantSpec) + return 1; + scf = (Word16 *)mem_malloc(pMemOP, nChannels * MAX_GROUPED_SFB * sizeof(Word16), 32, VO_INDEX_ENC_AAC); + if(NULL == scf) + { return 1; - scf = (Word16 *)mem_malloc(pMemOP, nChannels * MAX_GROUPED_SFB * sizeof(Word16), 32, VO_INDEX_ENC_AAC);
- if(NULL == scf)
- {
- return 1;
} - maxValueInSfb = (UWord16 *)mem_malloc(pMemOP, nChannels * MAX_GROUPED_SFB * sizeof(UWord16), 32, VO_INDEX_ENC_AAC);
- if(NULL == maxValueInSfb)
- {
- return 1;
- }
-
+ maxValueInSfb = (UWord16 *)mem_malloc(pMemOP, nChannels * MAX_GROUPED_SFB * sizeof(UWord16), 32, VO_INDEX_ENC_AAC); + if(NULL == maxValueInSfb) + { + return 1; + } + for (i=0; i<nChannels; i++) { hQC->qcChannel[i].quantSpec = quantSpec + i*FRAME_LEN_LONG; @@ -160,25 +160,25 @@ Word16 QCOutNew(QC_OUT *hQC, Word16 nChannels, VO_MEM_OPERATOR *pMemOP) **********************************************************************************/ void QCOutDelete(QC_OUT* hQC, VO_MEM_OPERATOR *pMemOP) { - Word32 i;
- if(hQC)
- {
- if(hQC->qcChannel[0].quantSpec);
- mem_free(pMemOP, hQC->qcChannel[0].quantSpec, VO_INDEX_ENC_AAC);
-
- if(hQC->qcChannel[0].maxValueInSfb)
- mem_free(pMemOP, hQC->qcChannel[0].maxValueInSfb, VO_INDEX_ENC_AAC);
-
- if(hQC->qcChannel[0].scf)
- mem_free(pMemOP, hQC->qcChannel[0].scf, VO_INDEX_ENC_AAC);
-
- for (i=0; i<MAX_CHANNELS; i++) {
- hQC->qcChannel[i].quantSpec = NULL;
-
- hQC->qcChannel[i].maxValueInSfb = NULL;
-
- hQC->qcChannel[i].scf = NULL;
- }
+ Word32 i; + if(hQC) + { + if(hQC->qcChannel[0].quantSpec); + mem_free(pMemOP, hQC->qcChannel[0].quantSpec, VO_INDEX_ENC_AAC); + + if(hQC->qcChannel[0].maxValueInSfb) + mem_free(pMemOP, hQC->qcChannel[0].maxValueInSfb, VO_INDEX_ENC_AAC); + + if(hQC->qcChannel[0].scf) + mem_free(pMemOP, hQC->qcChannel[0].scf, VO_INDEX_ENC_AAC); + + for (i=0; i<MAX_CHANNELS; i++) { + hQC->qcChannel[i].quantSpec = NULL; + + hQC->qcChannel[i].maxValueInSfb = NULL; + + hQC->qcChannel[i].scf = NULL; + } } } @@ -278,7 +278,7 @@ Word16 QCMain(QC_STATE* hQC, qcOutElement->staticBitsUsed = countStaticBitdemand(psyOutChannel, psyOutElement, - nChannels,
+ nChannels, qcOutElement->adtsUsed); @@ -474,8 +474,8 @@ void updateBitres(QC_STATE* qcKernel, Word16 FinalizeBitConsumption(QC_STATE *qcKernel, QC_OUT* qcOut) { - Word32 nFullFillElem;
- Word32 totFillBits;
+ Word32 nFullFillElem; + Word32 totFillBits; Word16 diffBits; Word16 bitsUsed; @@ -491,7 +491,7 @@ Word16 FinalizeBitConsumption(QC_STATE *qcKernel, totFillBits += qcOut->qcElement.fillBits; } - nFullFillElem = (max((qcOut->totFillBits - 1), 0) / maxFillElemBits) * maxFillElemBits;
+ nFullFillElem = (max((qcOut->totFillBits - 1), 0) / maxFillElemBits) * maxFillElemBits; qcOut->totFillBits = qcOut->totFillBits - nFullFillElem; diff --git a/media/libstagefright/codecs/aacenc/src/quantize.c b/media/libstagefright/codecs/aacenc/src/quantize.c index 205f167..973554e 100644 --- a/media/libstagefright/codecs/aacenc/src/quantize.c +++ b/media/libstagefright/codecs/aacenc/src/quantize.c @@ -1,27 +1,27 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: quantize.c
-
- Content: quantization functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: quantize.c + + Content: quantization functions + *******************************************************************************/ -#include "typedef.h"
-#include "basic_op.h"
+#include "typedef.h" +#include "basic_op.h" #include "oper_32b.h" #include "quantize.h" #include "aac_rom.h" @@ -77,14 +77,14 @@ static Word16 quantizeSingleLine(const Word16 gain, const Word32 absSpectrum) x += XROUND >> (INT_BITS - finalShift); - /* shift and quantize */
- finalShift--;
-
- if(finalShift >= 0)
- x >>= finalShift;
- else
- x <<= (-finalShift);
-
+ /* shift and quantize */ + finalShift--; + + if(finalShift >= 0) + x >>= finalShift; + else + x <<= (-finalShift); + qua = saturate(x); } } @@ -108,29 +108,29 @@ static void quantizeLines(const Word16 gain, { Word32 line; Word32 m = gain&3; - Word32 g = (gain >> 2) + 4;
- Word32 mdctSpeL;
+ Word32 g = (gain >> 2) + 4; + Word32 mdctSpeL; Word16 *pquat; - /* gain&3 */
-
- pquat = quantBorders[m];
-
- g += 16;
-
- if(g >= 0)
- {
+ /* gain&3 */ + + pquat = quantBorders[m]; + + g += 16; + + if(g >= 0) + { for (line=0; line<noOfLines; line++) { Word32 qua; qua = 0; -
- mdctSpeL = mdctSpectrum[line];
+ + mdctSpeL = mdctSpectrum[line]; if (mdctSpeL) { Word32 sa; Word32 saShft; sa = L_abs(mdctSpeL); - //saShft = L_shr(sa, 16 + g);
+ //saShft = L_shr(sa, 16 + g); saShft = sa >> g; if (saShft > pquat[0]) { @@ -163,54 +163,54 @@ static void quantizeLines(const Word16 gain, } } quaSpectrum[line] = qua ; - }
- }
- else
- {
- for (line=0; line<noOfLines; line++) {
- Word32 qua;
- qua = 0;
-
- mdctSpeL = mdctSpectrum[line];
-
- if (mdctSpeL) {
- Word32 sa;
- Word32 saShft;
-
- sa = L_abs(mdctSpeL);
- saShft = sa << g;
-
- if (saShft > pquat[0]) {
-
- if (saShft < pquat[1]) {
-
- qua = mdctSpeL>0 ? 1 : -1;
- }
- else {
-
- if (saShft < pquat[2]) {
-
- qua = mdctSpeL>0 ? 2 : -2;
- }
- else {
-
- if (saShft < pquat[3]) {
-
- qua = mdctSpeL>0 ? 3 : -3;
- }
- else {
- qua = quantizeSingleLine(gain, sa);
- /* adjust the sign. Since 0 < qua < 1, this cannot overflow. */
-
- if (mdctSpeL < 0)
- qua = -qua;
- }
- }
- }
- }
- }
- quaSpectrum[line] = qua ;
- }
+ } + } + else + { + for (line=0; line<noOfLines; line++) { + Word32 qua; + qua = 0; + + mdctSpeL = mdctSpectrum[line]; + + if (mdctSpeL) { + Word32 sa; + Word32 saShft; + + sa = L_abs(mdctSpeL); + saShft = sa << g; + + if (saShft > pquat[0]) { + + if (saShft < pquat[1]) { + + qua = mdctSpeL>0 ? 1 : -1; + } + else { + + if (saShft < pquat[2]) { + + qua = mdctSpeL>0 ? 2 : -2; + } + else { + + if (saShft < pquat[3]) { + + qua = mdctSpeL>0 ? 3 : -3; + } + else { + qua = quantizeSingleLine(gain, sa); + /* adjust the sign. Since 0 < qua < 1, this cannot overflow. */ + + if (mdctSpeL < 0) + qua = -qua; + } + } + } + } + } + quaSpectrum[line] = qua ; + } } } @@ -266,10 +266,10 @@ static void iquantizeLines(const Word16 gain, /* get approperiate exponent shifter */ specExp = specExpTableComb_enc[iquantizermod][specExp]; - specExp += iquantizershift + 1;
- if(specExp >= 0)
- mdctSpectrum[line] = accu << specExp;
- else
+ specExp += iquantizershift + 1; + if(specExp >= 0) + mdctSpectrum[line] = accu << specExp; + else mdctSpectrum[line] = accu >> (-specExp); } else { @@ -331,19 +331,69 @@ Word32 calcSfbDist(const Word32 *spec, Word32 line; Word32 dist; Word32 m = gain&3; - Word32 g = (gain >> 2) + 4;
- Word32 g2 = (g << 1) + 1;
- Word16 *pquat, *repquat;
+ Word32 g = (gain >> 2) + 4; + Word32 g2 = (g << 1) + 1; + Word16 *pquat, *repquat; /* gain&3 */ -
- pquat = quantBorders[m];
+ + pquat = quantBorders[m]; repquat = quantRecon[m]; -
- dist = 0;
- g += 16;
- if(g2 < 0 && g >= 0)
+ + dist = 0; + g += 16; + if(g2 < 0 && g >= 0) { - g2 = -g2;
+ g2 = -g2; + for(line=0; line<sfbWidth; line++) { + if (spec[line]) { + Word32 diff; + Word32 distSingle; + Word32 sa; + Word32 saShft; + sa = L_abs(spec[line]); + //saShft = round16(L_shr(sa, g)); + //saShft = L_shr(sa, 16+g); + saShft = sa >> g; + + if (saShft < pquat[0]) { + distSingle = (saShft * saShft) >> g2; + } + else { + + if (saShft < pquat[1]) { + diff = saShft - repquat[0]; + distSingle = (diff * diff) >> g2; + } + else { + + if (saShft < pquat[2]) { + diff = saShft - repquat[1]; + distSingle = (diff * diff) >> g2; + } + else { + + if (saShft < pquat[3]) { + diff = saShft - repquat[2]; + distSingle = (diff * diff) >> g2; + } + else { + Word16 qua = quantizeSingleLine(gain, sa); + Word32 iqval, diff32; + /* now that we have quantized x, re-quantize it. */ + iquantizeLines(gain, 1, &qua, &iqval); + diff32 = sa - iqval; + distSingle = fixmul(diff32, diff32); + } + } + } + } + + dist = L_add(dist, distSingle); + } + } + } + else + { for(line=0; line<sfbWidth; line++) { if (spec[line]) { Word32 diff; @@ -352,93 +402,43 @@ Word32 calcSfbDist(const Word32 *spec, Word32 saShft; sa = L_abs(spec[line]); //saShft = round16(L_shr(sa, g)); - //saShft = L_shr(sa, 16+g);
- saShft = sa >> g;
- - if (saShft < pquat[0]) {
- distSingle = (saShft * saShft) >> g2;
- }
- else {
-
- if (saShft < pquat[1]) {
- diff = saShft - repquat[0];
- distSingle = (diff * diff) >> g2;
- }
- else {
-
- if (saShft < pquat[2]) {
- diff = saShft - repquat[1];
- distSingle = (diff * diff) >> g2;
- }
- else {
-
- if (saShft < pquat[3]) {
- diff = saShft - repquat[2];
- distSingle = (diff * diff) >> g2;
- }
- else {
- Word16 qua = quantizeSingleLine(gain, sa);
- Word32 iqval, diff32;
- /* now that we have quantized x, re-quantize it. */
- iquantizeLines(gain, 1, &qua, &iqval);
- diff32 = sa - iqval;
- distSingle = fixmul(diff32, diff32);
- }
- }
- }
- }
-
- dist = L_add(dist, distSingle);
+ saShft = L_shr(sa, g); + + if (saShft < pquat[0]) { + distSingle = L_shl((saShft * saShft), g2); + } + else { + + if (saShft < pquat[1]) { + diff = saShft - repquat[0]; + distSingle = L_shl((diff * diff), g2); + } + else { + + if (saShft < pquat[2]) { + diff = saShft - repquat[1]; + distSingle = L_shl((diff * diff), g2); + } + else { + + if (saShft < pquat[3]) { + diff = saShft - repquat[2]; + distSingle = L_shl((diff * diff), g2); + } + else { + Word16 qua = quantizeSingleLine(gain, sa); + Word32 iqval, diff32; + /* now that we have quantized x, re-quantize it. */ + iquantizeLines(gain, 1, &qua, &iqval); + diff32 = sa - iqval; + distSingle = fixmul(diff32, diff32); + } + } + } + } + dist = L_add(dist, distSingle); } - }
- }
- else
- {
- for(line=0; line<sfbWidth; line++) {
- if (spec[line]) {
- Word32 diff;
- Word32 distSingle;
- Word32 sa;
- Word32 saShft;
- sa = L_abs(spec[line]);
- //saShft = round16(L_shr(sa, g));
- saShft = L_shr(sa, g);
-
- if (saShft < pquat[0]) {
- distSingle = L_shl((saShft * saShft), g2);
- }
- else {
-
- if (saShft < pquat[1]) {
- diff = saShft - repquat[0];
- distSingle = L_shl((diff * diff), g2);
- }
- else {
-
- if (saShft < pquat[2]) {
- diff = saShft - repquat[1];
- distSingle = L_shl((diff * diff), g2);
- }
- else {
-
- if (saShft < pquat[3]) {
- diff = saShft - repquat[2];
- distSingle = L_shl((diff * diff), g2);
- }
- else {
- Word16 qua = quantizeSingleLine(gain, sa);
- Word32 iqval, diff32;
- /* now that we have quantized x, re-quantize it. */
- iquantizeLines(gain, 1, &qua, &iqval);
- diff32 = sa - iqval;
- distSingle = fixmul(diff32, diff32);
- }
- }
- }
- }
- dist = L_add(dist, distSingle);
- }
- }
+ } } return dist; diff --git a/media/libstagefright/codecs/aacenc/src/sf_estim.c b/media/libstagefright/codecs/aacenc/src/sf_estim.c index d34b365..ffe2e83 100644 --- a/media/libstagefright/codecs/aacenc/src/sf_estim.c +++ b/media/libstagefright/codecs/aacenc/src/sf_estim.c @@ -1,26 +1,26 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: sf_estim.c
-
- Content: Scale factor estimation functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: sf_estim.c + + Content: Scale factor estimation functions + *******************************************************************************/ -#include "basic_op.h"
+#include "basic_op.h" #include "oper_32b.h" #include "sf_estim.h" #include "quantize.h" @@ -45,12 +45,12 @@ constants reference in comments #define FF_SQRT_BITS 7 #define FF_SQRT_TABLE_SIZE (1<<FF_SQRT_BITS - 1<<(FF_SQRT_BITS-2)) -#define COEF08_31 0x66666666 /* 0.8*(1 << 31) */
-#define PE_C1_8 24 /* PE_C1*8 */
-#define PE_C2_16 21 /* PE_C2*8/PE_C3 */
-#define PE_SCALE 0x059a /* 0.7 * (1 << (15 - 1 - 3))*/
-
-#define SCALE_ESTIMATE_COEF 0x5555 /* (8.8585/(4*log2(10))) * (1 << 15)*/
+#define COEF08_31 0x66666666 /* 0.8*(1 << 31) */ +#define PE_C1_8 24 /* PE_C1*8 */ +#define PE_C2_16 21 /* PE_C2*8/PE_C3 */ +#define PE_SCALE 0x059a /* 0.7 * (1 << (15 - 1 - 3))*/ + +#define SCALE_ESTIMATE_COEF 0x5555 /* (8.8585/(4*log2(10))) * (1 << 15)*/ /********************************************************************************* * @@ -69,17 +69,17 @@ __inline Word32 formfac_sqrt(Word32 x) postshift = preshift >> 1; preshift = postshift << 1; postshift = postshift + 8; /* sqrt/256 */ - if(preshift >= 0)
- y = x << preshift; /* now 1/4 <= y < 1 */
- else
- y = x >> (-preshift);
- y = formfac_sqrttable[y-32];
-
- if(postshift >= 0)
- y = y >> postshift;
- else
- y = y << (-postshift);
-
+ if(preshift >= 0) + y = x << preshift; /* now 1/4 <= y < 1 */ + else + y = x >> (-preshift); + y = formfac_sqrttable[y-32]; + + if(postshift >= 0) + y = y >> postshift; + else + y = y << (-postshift); + return y; } @@ -97,25 +97,25 @@ CalcFormFactorChannel(Word16 *logSfbFormFactor, Word16 *logSfbEnergy, PSY_OUT_CHANNEL *psyOutChan) { - Word32 sfbw, sfbw1;
+ Word32 sfbw, sfbw1; Word32 i, j; Word32 sfbOffs, sfb, shift; -
- sfbw = sfbw1 = 0;
+ + sfbw = sfbw1 = 0; for (sfbOffs=0; sfbOffs<psyOutChan->sfbCnt; sfbOffs+=psyOutChan->sfbPerGroup){ for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) { i = sfbOffs+sfb; if (psyOutChan->sfbEnergy[i] > psyOutChan->sfbThreshold[i]) { - Word32 accu, avgFormFactor,iSfbWidth;
+ Word32 accu, avgFormFactor,iSfbWidth; Word32 *mdctSpec; - sfbw = psyOutChan->sfbOffsets[i+1] - psyOutChan->sfbOffsets[i];
- iSfbWidth = invSBF[(sfbw >> 2) - 1];
+ sfbw = psyOutChan->sfbOffsets[i+1] - psyOutChan->sfbOffsets[i]; + iSfbWidth = invSBF[(sfbw >> 2) - 1]; mdctSpec = psyOutChan->mdctSpectrum + psyOutChan->sfbOffsets[i]; accu = 0; /* calc sum of sqrt(spec) */ - for (j=sfbw; j; j--) {
- accu += formfac_sqrt(L_abs(*mdctSpec)); mdctSpec++;
+ for (j=sfbw; j; j--) { + accu += formfac_sqrt(L_abs(*mdctSpec)); mdctSpec++; } logSfbFormFactor[i] = iLog4(accu); logSfbEnergy[i] = iLog4(psyOutChan->sfbEnergy[i]); @@ -158,8 +158,8 @@ static Word16 improveScf(Word32 *spec, /* calc real distortion */ sfbDist = calcSfbDist(spec, sfbWidth, scf); - *minScfCalculated = scf;
- if(!sfbDist)
+ *minScfCalculated = scf; + if(!sfbDist) return scfBest; if (sfbDist > thresh125) { @@ -194,7 +194,7 @@ static Word16 improveScf(Word32 *spec, } *minScfCalculated = scf; cnt = cnt + 1; - }
+ } *dist = sfbDistBest; } else { @@ -419,7 +419,7 @@ static void assimilateSingleScf(PSY_OUT_CHANNEL *psyOutChan, prevScfLast[j] = MAX_16; prevScfNext[j] = MAX_16; deltaPeLast[j] = MAX_16; - }
+ } sfbLast = -1; sfbAct = -1; @@ -713,20 +713,20 @@ EstimateScaleFactorsChannel(PSY_OUT_CHANNEL *psyOutChan, for (i=0; i<psyOutChan->sfbCnt; i++) { - Word32 sbfwith, sbfStart;
+ Word32 sbfwith, sbfStart; Word32 *mdctSpec; thresh = psyOutChan->sfbThreshold[i]; energy = psyOutChan->sfbEnergy[i]; -
- sbfStart = psyOutChan->sfbOffsets[i];
- sbfwith = psyOutChan->sfbOffsets[i+1] - sbfStart;
- mdctSpec = psyOutChan->mdctSpectrum+sbfStart;
+ + sbfStart = psyOutChan->sfbOffsets[i]; + sbfwith = psyOutChan->sfbOffsets[i+1] - sbfStart; + mdctSpec = psyOutChan->mdctSpectrum+sbfStart; maxSpec = 0; /* maximum of spectrum */ - for (j=sbfwith; j; j-- ) {
- Word32 absSpec = L_abs(*mdctSpec); mdctSpec++;
- maxSpec |= absSpec;
+ for (j=sbfwith; j; j-- ) { + Word32 absSpec = L_abs(*mdctSpec); mdctSpec++; + maxSpec |= absSpec; } /* scfs without energy or with thresh>energy are marked with MIN_16 */ @@ -737,7 +737,7 @@ EstimateScaleFactorsChannel(PSY_OUT_CHANNEL *psyOutChan, energyPart = logSfbFormFactor[i]; thresholdPart = iLog4(thresh); - /* -20 = 4*log2(6.75) - 32 */
+ /* -20 = 4*log2(6.75) - 32 */ scfInt = ((thresholdPart - energyPart - 20) * SCALE_ESTIMATE_COEF) >> 15; minSfMaxQuant[i] = iLog4(maxSpec) - 68; /* 68 -16/3*log(MAX_QUANT+0.5-logCon)/log(2) + 1 */ @@ -748,9 +748,9 @@ EstimateScaleFactorsChannel(PSY_OUT_CHANNEL *psyOutChan, } /* find better scalefactor with analysis by synthesis */ - scfInt = improveScf(psyOutChan->mdctSpectrum+sbfStart,
- sbfwith,
- thresh, scfInt, minSfMaxQuant[i],
+ scfInt = improveScf(psyOutChan->mdctSpectrum+sbfStart, + sbfwith, + thresh, scfInt, minSfMaxQuant[i], &sfbDist[i], &minScfCalculated[i]); scf[i] = scfInt; diff --git a/media/libstagefright/codecs/aacenc/src/spreading.c b/media/libstagefright/codecs/aacenc/src/spreading.c index e6fc7da..aaf2fff 100644 --- a/media/libstagefright/codecs/aacenc/src/spreading.c +++ b/media/libstagefright/codecs/aacenc/src/spreading.c @@ -1,29 +1,29 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: spreading.c
-
- Content: Spreading of energy function
-
-*******************************************************************************/
-
-#include "basic_op.h"
-#include "oper_32b.h"
-#include "spreading.h"
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: spreading.c + + Content: Spreading of energy function + +*******************************************************************************/ + +#include "basic_op.h" +#include "oper_32b.h" +#include "spreading.h" + /********************************************************************************* * * function name: SpreadingMax @@ -31,22 +31,22 @@ * higher frequencies thr(n) = max(thr(n), sh(n)*thr(n-1)) * lower frequencies thr(n) = max(thr(n), sl(n)*thr(n+1)) * -**********************************************************************************/
-void SpreadingMax(const Word16 pbCnt,
- const Word16 *maskLowFactor,
- const Word16 *maskHighFactor,
- Word32 *pbSpreadedEnergy)
-{
- Word32 i;
-
- /* slope to higher frequencies */
- for (i=1; i<pbCnt; i++) {
- pbSpreadedEnergy[i] = max(pbSpreadedEnergy[i],
- L_mpy_ls(pbSpreadedEnergy[i-1], maskHighFactor[i]));
- }
- /* slope to lower frequencies */
- for (i=pbCnt - 2; i>=0; i--) {
- pbSpreadedEnergy[i] = max(pbSpreadedEnergy[i],
- L_mpy_ls(pbSpreadedEnergy[i+1], maskLowFactor[i]));
- }
-}
+**********************************************************************************/ +void SpreadingMax(const Word16 pbCnt, + const Word16 *maskLowFactor, + const Word16 *maskHighFactor, + Word32 *pbSpreadedEnergy) +{ + Word32 i; + + /* slope to higher frequencies */ + for (i=1; i<pbCnt; i++) { + pbSpreadedEnergy[i] = max(pbSpreadedEnergy[i], + L_mpy_ls(pbSpreadedEnergy[i-1], maskHighFactor[i])); + } + /* slope to lower frequencies */ + for (i=pbCnt - 2; i>=0; i--) { + pbSpreadedEnergy[i] = max(pbSpreadedEnergy[i], + L_mpy_ls(pbSpreadedEnergy[i+1], maskLowFactor[i])); + } +} diff --git a/media/libstagefright/codecs/aacenc/src/stat_bits.c b/media/libstagefright/codecs/aacenc/src/stat_bits.c index 556104e..baa289c 100644 --- a/media/libstagefright/codecs/aacenc/src/stat_bits.c +++ b/media/libstagefright/codecs/aacenc/src/stat_bits.c @@ -1,23 +1,23 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: stat_bits.c
-
- Content: Static bit counter functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: stat_bits.c + + Content: Static bit counter functions + *******************************************************************************/ #include "stat_bits.h" @@ -82,10 +82,10 @@ static Word16 tnsCount(TNS_INFO *tnsInfo, Word16 blockType) Flag tnsPresent; Word32 numOfWindows; Word32 count; - Word32 coefBits;
+ Word32 coefBits; Word16 *ptcoef; - count = 0;
+ count = 0; if (blockType == 2) numOfWindows = 8; @@ -127,7 +127,7 @@ static Word16 tnsCount(TNS_INFO *tnsInfo, Word16 blockType) count += 1; /*coef_compression */ if (tnsInfo->coefRes[i] == 4) { - ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT;
+ ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT; coefBits = 3; for(k=0; k<tnsInfo->order[i]; k++) { @@ -139,7 +139,7 @@ static Word16 tnsCount(TNS_INFO *tnsInfo, Word16 blockType) } else { coefBits = 2; - ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT;
+ ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT; for(k=0; k<tnsInfo->order[i]; k++) { if ((ptcoef[k] > 1) || (ptcoef[k] < -2)) { @@ -154,7 +154,7 @@ static Word16 tnsCount(TNS_INFO *tnsInfo, Word16 blockType) } } } - }
+ } return count; } @@ -178,14 +178,14 @@ static Word16 countTnsBits(TNS_INFO *tnsInfo,Word16 blockType) **********************************************************************************/ Word16 countStaticBitdemand(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], PSY_OUT_ELEMENT *psyOutElement, - Word16 channels,
+ Word16 channels, Word16 adtsUsed) { Word32 statBits; Word32 ch; - statBits = 0;
-
+ statBits = 0; + /* if adts used, add 56 bits */ if(adtsUsed) statBits += 56; diff --git a/media/libstagefright/codecs/aacenc/src/tns.c b/media/libstagefright/codecs/aacenc/src/tns.c index 96d890e..473e0a0 100644 --- a/media/libstagefright/codecs/aacenc/src/tns.c +++ b/media/libstagefright/codecs/aacenc/src/tns.c @@ -1,27 +1,27 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: tns.c
-
- Content: Definition TNS tools functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: tns.c + + Content: Definition TNS tools functions + *******************************************************************************/ -#include "basic_op.h"
-#include "oper_32b.h"
+#include "basic_op.h" +#include "oper_32b.h" #include "assert.h" #include "aac_rom.h" #include "psy_const.h" @@ -32,23 +32,23 @@ #define TNS_MODIFY_BEGIN 2600 /* Hz */ #define RATIO_PATCH_LOWER_BORDER 380 /* Hz */ -#define TNS_GAIN_THRESH 141 /* 1.41*100 */
-#define NORM_COEF 0x028f5c28
- -static const Word32 TNS_PARCOR_THRESH = 0x0ccccccd; /* 0.1*(1 << 31) */
-/* Limit bands to > 2.0 kHz */
-static unsigned short tnsMinBandNumberLong[12] =
-{ 11, 12, 15, 16, 17, 20, 25, 26, 24, 28, 30, 31 };
-static unsigned short tnsMinBandNumberShort[12] =
-{ 2, 2, 2, 3, 3, 4, 6, 6, 8, 10, 10, 12 };
-
-/**************************************/
-/* Main/Low Profile TNS Parameters */
-/**************************************/
-static unsigned short tnsMaxBandsLongMainLow[12] =
-{ 31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39 };
-
-static unsigned short tnsMaxBandsShortMainLow[12] =
+#define TNS_GAIN_THRESH 141 /* 1.41*100 */ +#define NORM_COEF 0x028f5c28 + +static const Word32 TNS_PARCOR_THRESH = 0x0ccccccd; /* 0.1*(1 << 31) */ +/* Limit bands to > 2.0 kHz */ +static unsigned short tnsMinBandNumberLong[12] = +{ 11, 12, 15, 16, 17, 20, 25, 26, 24, 28, 30, 31 }; +static unsigned short tnsMinBandNumberShort[12] = +{ 2, 2, 2, 3, 3, 4, 6, 6, 8, 10, 10, 12 }; + +/**************************************/ +/* Main/Low Profile TNS Parameters */ +/**************************************/ +static unsigned short tnsMaxBandsLongMainLow[12] = +{ 31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39 }; + +static unsigned short tnsMaxBandsShortMainLow[12] = { 9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14 }; @@ -178,8 +178,8 @@ Word16 InitTnsConfigurationLong(Word32 bitRate, /*!< bitrate */ tC->lpcStopBand = tnsMaxBandsLongMainLow[pC->sampRateIdx]; tC->lpcStopBand = min(tC->lpcStopBand, pC->sfbActive); - tC->lpcStopLine = pC->sfbOffset[tC->lpcStopBand];
-
+ tC->lpcStopLine = pC->sfbOffset[tC->lpcStopBand]; + tC->lpcStartBand = tnsMinBandNumberLong[pC->sampRateIdx]; tC->lpcStartLine = pC->sfbOffset[tC->lpcStartBand]; @@ -241,13 +241,13 @@ Word16 InitTnsConfigurationShort(Word32 bitRate, /*!< bitrate */ tC->tnsStartLine = pC->sfbOffset[tC->tnsStartBand]; - tC->lpcStopBand = tnsMaxBandsShortMainLow[pC->sampRateIdx];
+ tC->lpcStopBand = tnsMaxBandsShortMainLow[pC->sampRateIdx]; tC->lpcStopBand = min(tC->lpcStopBand, pC->sfbActive); tC->lpcStopLine = pC->sfbOffset[tC->lpcStopBand]; - tC->lpcStartBand = tnsMinBandNumberShort[pC->sampRateIdx];
+ tC->lpcStartBand = tnsMinBandNumberShort[pC->sampRateIdx]; tC->lpcStartLine = pC->sfbOffset[tC->lpcStartBand]; @@ -399,12 +399,12 @@ Word16 TnsEncode(TNS_INFO* tnsInfo, /*!< tns info structure (modified) */ { Word32 i; Word32 temp_s; - Word32 temp;
+ Word32 temp; TNS_SUBBLOCK_INFO *psubBlockInfo; temp_s = blockType - SHORT_WINDOW; if ( temp_s != 0) { - psubBlockInfo = &tnsData->dataRaw.tnsLong.subBlockInfo;
+ psubBlockInfo = &tnsData->dataRaw.tnsLong.subBlockInfo; if (psubBlockInfo->tnsActive == 0) { tnsInfo->tnsActive[subBlockNumber] = 0; return(0); @@ -449,7 +449,7 @@ Word16 TnsEncode(TNS_INFO* tnsInfo, /*!< tns info structure (modified) */ } } /* if (blockType!=SHORT_WINDOW) */ else /*short block*/ { - psubBlockInfo = &tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber];
+ psubBlockInfo = &tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber]; if (psubBlockInfo->tnsActive == 0) { tnsInfo->tnsActive[subBlockNumber] = 0; return(0); @@ -556,9 +556,9 @@ static void CalcWeightedSpectrum(const Word32 spectrum[], /*!< input sp tmp2 = sfbEnergy[sfb] - 2; if( tmp2 > 0) { tmp = rsqrt(sfbEnergy[sfb], INT_BITS); - if(tmp > INT_BITS_SCAL)
- {
- shift = norm_l(tmp);
+ if(tmp > INT_BITS_SCAL) + { + shift = norm_l(tmp); tmp = Div_32( INT_BITS_SCAL << shift, tmp << shift ); } else @@ -601,20 +601,20 @@ static void CalcWeightedSpectrum(const Word32 spectrum[], /*!< input sp maxWS |= L_abs(pWork32[i]); } maxShift = norm_l(maxWS); -
- maxShift = 16 - maxShift;
- if(maxShift >= 0)
- {
- for (i=lpcStartLine; i<lpcStopLine; i++){
- weightedSpectrum[i] = pWork32[i] >> maxShift;
- }
- }
- else
- {
- maxShift = -maxShift;
- for (i=lpcStartLine; i<lpcStopLine; i++){
- weightedSpectrum[i] = saturate(pWork32[i] << maxShift);
- }
+ + maxShift = 16 - maxShift; + if(maxShift >= 0) + { + for (i=lpcStartLine; i<lpcStopLine; i++){ + weightedSpectrum[i] = pWork32[i] >> maxShift; + } + } + else + { + maxShift = -maxShift; + for (i=lpcStartLine; i<lpcStopLine; i++){ + weightedSpectrum[i] = saturate(pWork32[i] << maxShift); + } } } @@ -669,7 +669,7 @@ static Word16 CalcTnsFilter(const Word16 *signal, * output: acf values * *****************************************************************************/ -#ifndef ARMV5E
+#ifndef ARMV5E void AutoCorrelation(const Word16 input[], Word32 corr[], Word16 samples, @@ -679,12 +679,12 @@ void AutoCorrelation(const Word16 input[], Word32 scf; scf = 10 - 1; -
+ isamples = samples; /* calc first corrCoef: R[0] = sum { t[i] * t[i] } ; i = 0..N-1 */ accu = 0; for(j=0; j<isamples; j++) { - accu = L_add(accu, ((input[j] * input[j]) >> scf));
+ accu = L_add(accu, ((input[j] * input[j]) >> scf)); } corr[0] = accu; @@ -696,7 +696,7 @@ void AutoCorrelation(const Word16 input[], isamples = isamples - 1; accu = 0; for(j=0; j<isamples; j++) { - accu = L_add(accu, ((input[j] * input[j+i]) >> scf));
+ accu = L_add(accu, ((input[j] * input[j+i]) >> scf)); } corr[i] = accu; } @@ -737,7 +737,7 @@ static Word16 AutoToParcor(Word32 workBuffer[], Word32 reflCoeff[], Word16 numOf if (workBuffer[0] < L_abs(workBuffer[i + numOfCoeff])) { return 0 ; } - shift = norm_l(workBuffer[0]);
+ shift = norm_l(workBuffer[0]); workBuffer0 = Div_32(1 << shift, workBuffer[0] << shift); /* calculate refc = -workBuffer[numOfCoeff+i] / workBuffer[0]; -1 <= refc < 1 */ refc = L_negate(fixmul(workBuffer[numOfCoeff + i], workBuffer0)); @@ -758,8 +758,8 @@ static Word16 AutoToParcor(Word32 workBuffer[], Word32 reflCoeff[], Word16 numOf denom = MULHIGH(workBuffer[0], NORM_COEF); if (denom != 0) { - Word32 temp;
- shift = norm_l(denom);
+ Word32 temp; + shift = norm_l(denom); temp = Div_32(1 << shift, denom << shift); predictionGain = fixmul(num, temp); } diff --git a/media/libstagefright/codecs/aacenc/src/transform.c b/media/libstagefright/codecs/aacenc/src/transform.c index af17b5a..4d11f78 100644 --- a/media/libstagefright/codecs/aacenc/src/transform.c +++ b/media/libstagefright/codecs/aacenc/src/transform.c @@ -1,37 +1,37 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: transform.c
-
- Content: MDCT Transform functionss
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: transform.c + + Content: MDCT Transform functionss + *******************************************************************************/ -#include "basic_op.h"
+#include "basic_op.h" #include "psy_const.h" #include "transform.h" #include "aac_rom.h" -
-
-#define LS_TRANS ((FRAME_LEN_LONG-FRAME_LEN_SHORT)/2) /* 448 */
-#define SQRT1_2 0x5a82799a /* sqrt(1/2) in Q31 */
-#define swap2(p0,p1) \
- t = p0; t1 = *(&(p0)+1); \
- p0 = p1; *(&(p0)+1) = *(&(p1)+1); \
- p1 = t; *(&(p1)+1) = t1
+ + +#define LS_TRANS ((FRAME_LEN_LONG-FRAME_LEN_SHORT)/2) /* 448 */ +#define SQRT1_2 0x5a82799a /* sqrt(1/2) in Q31 */ +#define swap2(p0,p1) \ + t = p0; t1 = *(&(p0)+1); \ + p0 = p1; *(&(p0)+1) = *(&(p1)+1); \ + p1 = t; *(&(p1)+1) = t1 /********************************************************************************* * @@ -39,343 +39,343 @@ * description: Shuffle points prepared function for fft * **********************************************************************************/ -static void Shuffle(int *buf, int num, const unsigned char* bitTab)
-{
- int *part0, *part1;
- int i, j;
- int t, t1;
-
- part0 = buf;
- part1 = buf + num;
-
- while ((i = *bitTab++) != 0) {
- j = *bitTab++;
-
- swap2(part0[4*i+0], part0[4*j+0]);
- swap2(part0[4*i+2], part1[4*j+0]);
- swap2(part1[4*i+0], part0[4*j+2]);
- swap2(part1[4*i+2], part1[4*j+2]);
- }
-
- do {
- swap2(part0[4*i+2], part1[4*i+0]);
- } while ((i = *bitTab++) != 0);
-}
-
-#if !defined(ARMV5E) && !defined(ARMV7Neon)
+static void Shuffle(int *buf, int num, const unsigned char* bitTab) +{ + int *part0, *part1; + int i, j; + int t, t1; + + part0 = buf; + part1 = buf + num; + + while ((i = *bitTab++) != 0) { + j = *bitTab++; + + swap2(part0[4*i+0], part0[4*j+0]); + swap2(part0[4*i+2], part1[4*j+0]); + swap2(part1[4*i+0], part0[4*j+2]); + swap2(part1[4*i+2], part1[4*j+2]); + } + + do { + swap2(part0[4*i+2], part1[4*i+0]); + } while ((i = *bitTab++) != 0); +} + +#if !defined(ARMV5E) && !defined(ARMV7Neon) /***************************************************************************** * * function name: Radix4First * description: Radix 4 point prepared function for fft * -**********************************************************************************/
-static void Radix4First(int *buf, int num)
-{
- int r0, r1, r2, r3;
- int r4, r5, r6, r7;
-
- for (; num != 0; num--)
- {
- r0 = buf[0] + buf[2];
- r1 = buf[1] + buf[3];
- r2 = buf[0] - buf[2];
- r3 = buf[1] - buf[3];
- r4 = buf[4] + buf[6];
- r5 = buf[5] + buf[7];
- r6 = buf[4] - buf[6];
- r7 = buf[5] - buf[7];
-
- buf[0] = r0 + r4;
- buf[1] = r1 + r5;
- buf[4] = r0 - r4;
- buf[5] = r1 - r5;
- buf[2] = r2 + r7;
- buf[3] = r3 - r6;
- buf[6] = r2 - r7;
- buf[7] = r3 + r6;
-
- buf += 8;
- }
-}
-
+**********************************************************************************/ +static void Radix4First(int *buf, int num) +{ + int r0, r1, r2, r3; + int r4, r5, r6, r7; + + for (; num != 0; num--) + { + r0 = buf[0] + buf[2]; + r1 = buf[1] + buf[3]; + r2 = buf[0] - buf[2]; + r3 = buf[1] - buf[3]; + r4 = buf[4] + buf[6]; + r5 = buf[5] + buf[7]; + r6 = buf[4] - buf[6]; + r7 = buf[5] - buf[7]; + + buf[0] = r0 + r4; + buf[1] = r1 + r5; + buf[4] = r0 - r4; + buf[5] = r1 - r5; + buf[2] = r2 + r7; + buf[3] = r3 - r6; + buf[6] = r2 - r7; + buf[7] = r3 + r6; + + buf += 8; + } +} + /***************************************************************************** * * function name: Radix8First * description: Radix 8 point prepared function for fft * -**********************************************************************************/
-static void Radix8First(int *buf, int num)
-{
- int r0, r1, r2, r3;
- int i0, i1, i2, i3;
- int r4, r5, r6, r7;
- int i4, i5, i6, i7;
- int t0, t1, t2, t3;
-
- for ( ; num != 0; num--)
- {
- r0 = buf[0] + buf[2];
- i0 = buf[1] + buf[3];
- r1 = buf[0] - buf[2];
- i1 = buf[1] - buf[3];
- r2 = buf[4] + buf[6];
- i2 = buf[5] + buf[7];
- r3 = buf[4] - buf[6];
- i3 = buf[5] - buf[7];
-
- r4 = (r0 + r2) >> 1;
- i4 = (i0 + i2) >> 1;
- r5 = (r0 - r2) >> 1;
- i5 = (i0 - i2) >> 1;
- r6 = (r1 - i3) >> 1;
- i6 = (i1 + r3) >> 1;
- r7 = (r1 + i3) >> 1;
- i7 = (i1 - r3) >> 1;
-
- r0 = buf[ 8] + buf[10];
- i0 = buf[ 9] + buf[11];
- r1 = buf[ 8] - buf[10];
- i1 = buf[ 9] - buf[11];
- r2 = buf[12] + buf[14];
- i2 = buf[13] + buf[15];
- r3 = buf[12] - buf[14];
- i3 = buf[13] - buf[15];
-
- t0 = (r0 + r2) >> 1;
- t1 = (i0 + i2) >> 1;
- t2 = (r0 - r2) >> 1;
- t3 = (i0 - i2) >> 1;
-
- buf[ 0] = r4 + t0;
- buf[ 1] = i4 + t1;
- buf[ 8] = r4 - t0;
- buf[ 9] = i4 - t1;
- buf[ 4] = r5 + t3;
- buf[ 5] = i5 - t2;
- buf[12] = r5 - t3;
- buf[13] = i5 + t2;
-
- r0 = r1 - i3;
- i0 = i1 + r3;
- r2 = r1 + i3;
- i2 = i1 - r3;
-
- t0 = MULHIGH(SQRT1_2, r0 - i0);
- t1 = MULHIGH(SQRT1_2, r0 + i0);
- t2 = MULHIGH(SQRT1_2, r2 - i2);
- t3 = MULHIGH(SQRT1_2, r2 + i2);
-
- buf[ 6] = r6 - t0;
- buf[ 7] = i6 - t1;
- buf[14] = r6 + t0;
- buf[15] = i6 + t1;
- buf[ 2] = r7 + t3;
- buf[ 3] = i7 - t2;
- buf[10] = r7 - t3;
- buf[11] = i7 + t2;
-
- buf += 16;
- }
-}
-
+**********************************************************************************/ +static void Radix8First(int *buf, int num) +{ + int r0, r1, r2, r3; + int i0, i1, i2, i3; + int r4, r5, r6, r7; + int i4, i5, i6, i7; + int t0, t1, t2, t3; + + for ( ; num != 0; num--) + { + r0 = buf[0] + buf[2]; + i0 = buf[1] + buf[3]; + r1 = buf[0] - buf[2]; + i1 = buf[1] - buf[3]; + r2 = buf[4] + buf[6]; + i2 = buf[5] + buf[7]; + r3 = buf[4] - buf[6]; + i3 = buf[5] - buf[7]; + + r4 = (r0 + r2) >> 1; + i4 = (i0 + i2) >> 1; + r5 = (r0 - r2) >> 1; + i5 = (i0 - i2) >> 1; + r6 = (r1 - i3) >> 1; + i6 = (i1 + r3) >> 1; + r7 = (r1 + i3) >> 1; + i7 = (i1 - r3) >> 1; + + r0 = buf[ 8] + buf[10]; + i0 = buf[ 9] + buf[11]; + r1 = buf[ 8] - buf[10]; + i1 = buf[ 9] - buf[11]; + r2 = buf[12] + buf[14]; + i2 = buf[13] + buf[15]; + r3 = buf[12] - buf[14]; + i3 = buf[13] - buf[15]; + + t0 = (r0 + r2) >> 1; + t1 = (i0 + i2) >> 1; + t2 = (r0 - r2) >> 1; + t3 = (i0 - i2) >> 1; + + buf[ 0] = r4 + t0; + buf[ 1] = i4 + t1; + buf[ 8] = r4 - t0; + buf[ 9] = i4 - t1; + buf[ 4] = r5 + t3; + buf[ 5] = i5 - t2; + buf[12] = r5 - t3; + buf[13] = i5 + t2; + + r0 = r1 - i3; + i0 = i1 + r3; + r2 = r1 + i3; + i2 = i1 - r3; + + t0 = MULHIGH(SQRT1_2, r0 - i0); + t1 = MULHIGH(SQRT1_2, r0 + i0); + t2 = MULHIGH(SQRT1_2, r2 - i2); + t3 = MULHIGH(SQRT1_2, r2 + i2); + + buf[ 6] = r6 - t0; + buf[ 7] = i6 - t1; + buf[14] = r6 + t0; + buf[15] = i6 + t1; + buf[ 2] = r7 + t3; + buf[ 3] = i7 - t2; + buf[10] = r7 - t3; + buf[11] = i7 + t2; + + buf += 16; + } +} + /***************************************************************************** * * function name: Radix4FFT * description: Radix 4 point fft core function * -**********************************************************************************/
-static void Radix4FFT(int *buf, int num, int bgn, int *twidTab)
-{
- int r0, r1, r2, r3;
- int r4, r5, r6, r7;
- int t0, t1;
- int sinx, cosx;
- int i, j, step;
- int *xptr, *csptr;
-
- for (num >>= 2; num != 0; num >>= 2)
- {
- step = 2*bgn;
- xptr = buf;
-
- for (i = num; i != 0; i--)
- {
- csptr = twidTab;
-
- for (j = bgn; j != 0; j--)
- {
- r0 = xptr[0];
- r1 = xptr[1];
- xptr += step;
-
- t0 = xptr[0];
- t1 = xptr[1];
- cosx = csptr[0];
- sinx = csptr[1];
- r2 = MULHIGH(cosx, t0) + MULHIGH(sinx, t1); /* cos*br + sin*bi */
- r3 = MULHIGH(cosx, t1) - MULHIGH(sinx, t0); /* cos*bi - sin*br */
- xptr += step;
-
- t0 = r0 >> 2;
- t1 = r1 >> 2;
- r0 = t0 - r2;
- r1 = t1 - r3;
- r2 = t0 + r2;
- r3 = t1 + r3;
-
- t0 = xptr[0];
- t1 = xptr[1];
- cosx = csptr[2];
- sinx = csptr[3];
- r4 = MULHIGH(cosx, t0) + MULHIGH(sinx, t1); /* cos*cr + sin*ci */
- r5 = MULHIGH(cosx, t1) - MULHIGH(sinx, t0); /* cos*ci - sin*cr */
- xptr += step;
-
- t0 = xptr[0];
- t1 = xptr[1];
- cosx = csptr[4];
- sinx = csptr[5];
- r6 = MULHIGH(cosx, t0) + MULHIGH(sinx, t1); /* cos*cr + sin*ci */
- r7 = MULHIGH(cosx, t1) - MULHIGH(sinx, t0); /* cos*ci - sin*cr */
- csptr += 6;
-
- t0 = r4;
- t1 = r5;
- r4 = t0 + r6;
- r5 = r7 - t1;
- r6 = t0 - r6;
- r7 = r7 + t1;
-
- xptr[0] = r0 + r5;
- xptr[1] = r1 + r6;
- xptr -= step;
-
- xptr[0] = r2 - r4;
- xptr[1] = r3 - r7;
- xptr -= step;
-
- xptr[0] = r0 - r5;
- xptr[1] = r1 - r6;
- xptr -= step;
-
- xptr[0] = r2 + r4;
- xptr[1] = r3 + r7;
- xptr += 2;
- }
- xptr += 3*step;
- }
- twidTab += 3*step;
- bgn <<= 2;
- }
-}
-
+**********************************************************************************/ +static void Radix4FFT(int *buf, int num, int bgn, int *twidTab) +{ + int r0, r1, r2, r3; + int r4, r5, r6, r7; + int t0, t1; + int sinx, cosx; + int i, j, step; + int *xptr, *csptr; + + for (num >>= 2; num != 0; num >>= 2) + { + step = 2*bgn; + xptr = buf; + + for (i = num; i != 0; i--) + { + csptr = twidTab; + + for (j = bgn; j != 0; j--) + { + r0 = xptr[0]; + r1 = xptr[1]; + xptr += step; + + t0 = xptr[0]; + t1 = xptr[1]; + cosx = csptr[0]; + sinx = csptr[1]; + r2 = MULHIGH(cosx, t0) + MULHIGH(sinx, t1); /* cos*br + sin*bi */ + r3 = MULHIGH(cosx, t1) - MULHIGH(sinx, t0); /* cos*bi - sin*br */ + xptr += step; + + t0 = r0 >> 2; + t1 = r1 >> 2; + r0 = t0 - r2; + r1 = t1 - r3; + r2 = t0 + r2; + r3 = t1 + r3; + + t0 = xptr[0]; + t1 = xptr[1]; + cosx = csptr[2]; + sinx = csptr[3]; + r4 = MULHIGH(cosx, t0) + MULHIGH(sinx, t1); /* cos*cr + sin*ci */ + r5 = MULHIGH(cosx, t1) - MULHIGH(sinx, t0); /* cos*ci - sin*cr */ + xptr += step; + + t0 = xptr[0]; + t1 = xptr[1]; + cosx = csptr[4]; + sinx = csptr[5]; + r6 = MULHIGH(cosx, t0) + MULHIGH(sinx, t1); /* cos*cr + sin*ci */ + r7 = MULHIGH(cosx, t1) - MULHIGH(sinx, t0); /* cos*ci - sin*cr */ + csptr += 6; + + t0 = r4; + t1 = r5; + r4 = t0 + r6; + r5 = r7 - t1; + r6 = t0 - r6; + r7 = r7 + t1; + + xptr[0] = r0 + r5; + xptr[1] = r1 + r6; + xptr -= step; + + xptr[0] = r2 - r4; + xptr[1] = r3 - r7; + xptr -= step; + + xptr[0] = r0 - r5; + xptr[1] = r1 - r6; + xptr -= step; + + xptr[0] = r2 + r4; + xptr[1] = r3 + r7; + xptr += 2; + } + xptr += 3*step; + } + twidTab += 3*step; + bgn <<= 2; + } +} + /********************************************************************************* * * function name: PreMDCT * description: prepare MDCT process for next FFT compute * -**********************************************************************************/
-static void PreMDCT(int *buf0, int num, const int *csptr)
-{
- int i;
- int tr1, ti1, tr2, ti2;
- int cosa, sina, cosb, sinb;
- int *buf1;
-
- buf1 = buf0 + num - 1;
-
- for(i = num >> 2; i != 0; i--)
- {
- cosa = *csptr++;
- sina = *csptr++;
- cosb = *csptr++;
- sinb = *csptr++;
-
- tr1 = *(buf0 + 0);
- ti2 = *(buf0 + 1);
- tr2 = *(buf1 - 1);
- ti1 = *(buf1 + 0);
-
- *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1);
- *buf0++ = MULHIGH(cosa, ti1) - MULHIGH(sina, tr1);
-
- *buf1-- = MULHIGH(cosb, ti2) - MULHIGH(sinb, tr2);
- *buf1-- = MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2);
- }
-}
-
+**********************************************************************************/ +static void PreMDCT(int *buf0, int num, const int *csptr) +{ + int i; + int tr1, ti1, tr2, ti2; + int cosa, sina, cosb, sinb; + int *buf1; + + buf1 = buf0 + num - 1; + + for(i = num >> 2; i != 0; i--) + { + cosa = *csptr++; + sina = *csptr++; + cosb = *csptr++; + sinb = *csptr++; + + tr1 = *(buf0 + 0); + ti2 = *(buf0 + 1); + tr2 = *(buf1 - 1); + ti1 = *(buf1 + 0); + + *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1); + *buf0++ = MULHIGH(cosa, ti1) - MULHIGH(sina, tr1); + + *buf1-- = MULHIGH(cosb, ti2) - MULHIGH(sinb, tr2); + *buf1-- = MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2); + } +} + /********************************************************************************* * * function name: PostMDCT * description: post MDCT process after next FFT for MDCT * -**********************************************************************************/
-static void PostMDCT(int *buf0, int num, const int *csptr)
-{
- int i;
- int tr1, ti1, tr2, ti2;
- int cosa, sina, cosb, sinb;
- int *buf1;
-
- buf1 = buf0 + num - 1;
-
- for(i = num >> 2; i != 0; i--)
- {
- cosa = *csptr++;
- sina = *csptr++;
- cosb = *csptr++;
- sinb = *csptr++;
-
- tr1 = *(buf0 + 0);
- ti1 = *(buf0 + 1);
- ti2 = *(buf1 + 0);
- tr2 = *(buf1 - 1);
-
- *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1);
- *buf1-- = MULHIGH(sina, tr1) - MULHIGH(cosa, ti1);
-
- *buf0++ = MULHIGH(sinb, tr2) - MULHIGH(cosb, ti2);
- *buf1-- = MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2);
- }
-}
-#endif
-
-
+**********************************************************************************/ +static void PostMDCT(int *buf0, int num, const int *csptr) +{ + int i; + int tr1, ti1, tr2, ti2; + int cosa, sina, cosb, sinb; + int *buf1; + + buf1 = buf0 + num - 1; + + for(i = num >> 2; i != 0; i--) + { + cosa = *csptr++; + sina = *csptr++; + cosb = *csptr++; + sinb = *csptr++; + + tr1 = *(buf0 + 0); + ti1 = *(buf0 + 1); + ti2 = *(buf1 + 0); + tr2 = *(buf1 - 1); + + *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1); + *buf1-- = MULHIGH(sina, tr1) - MULHIGH(cosa, ti1); + + *buf0++ = MULHIGH(sinb, tr2) - MULHIGH(cosb, ti2); + *buf1-- = MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2); + } +} +#endif + + /********************************************************************************** * * function name: Mdct_Long * description: the long block mdct, include long_start block, end_long block * -**********************************************************************************/
-void Mdct_Long(int *buf)
-{
- PreMDCT(buf, 1024, cossintab + 128);
-
- Shuffle(buf, 512, bitrevTab + 17);
- Radix8First(buf, 512 >> 3);
- Radix4FFT(buf, 512 >> 3, 8, (int *)twidTab512);
-
- PostMDCT(buf, 1024, cossintab + 128);
-}
-
-
+**********************************************************************************/ +void Mdct_Long(int *buf) +{ + PreMDCT(buf, 1024, cossintab + 128); + + Shuffle(buf, 512, bitrevTab + 17); + Radix8First(buf, 512 >> 3); + Radix4FFT(buf, 512 >> 3, 8, (int *)twidTab512); + + PostMDCT(buf, 1024, cossintab + 128); +} + + /********************************************************************************** * * function name: Mdct_Short * description: the short block mdct * -**********************************************************************************/
-void Mdct_Short(int *buf)
-{
- PreMDCT(buf, 128, cossintab);
-
- Shuffle(buf, 64, bitrevTab);
- Radix4First(buf, 64 >> 2);
- Radix4FFT(buf, 64 >> 2, 4, (int *)twidTab64);
-
- PostMDCT(buf, 128, cossintab);
-}
+**********************************************************************************/ +void Mdct_Short(int *buf) +{ + PreMDCT(buf, 128, cossintab); + + Shuffle(buf, 64, bitrevTab); + Radix4First(buf, 64 >> 2); + Radix4FFT(buf, 64 >> 2, 4, (int *)twidTab64); + + PostMDCT(buf, 128, cossintab); +} /***************************************************************************** @@ -419,31 +419,31 @@ static void shiftMdctDelayBuffer(Word16 *mdctDelayBuffer, /*! start of mdct dela *srBuf++ = *dsBuf; dsBuf += chIncrement; *srBuf++ = *dsBuf; dsBuf += chIncrement; } -}
-
-
+} + + /***************************************************************************** * * function name: getScalefactorOfShortVectorStride * description: Calculate max possible scale factor for input vector of shorts * returns: Maximum scale factor * -**********************************************************************************/
-static Word16 getScalefactorOfShortVectorStride(const Word16 *vector, /*!< Pointer to input vector */
- Word16 len, /*!< Length of input vector */
- Word16 stride) /*!< Stride of input vector */
-{
- Word16 maxVal = 0;
- Word16 absVal;
- Word16 i;
-
- for(i=0; i<len; i++){
- absVal = abs_s(vector[i*stride]);
- maxVal |= absVal;
- }
-
- return( maxVal ? norm_s(maxVal) : 15);
-}
+**********************************************************************************/ +static Word16 getScalefactorOfShortVectorStride(const Word16 *vector, /*!< Pointer to input vector */ + Word16 len, /*!< Length of input vector */ + Word16 stride) /*!< Stride of input vector */ +{ + Word16 maxVal = 0; + Word16 absVal; + Word16 i; + + for(i=0; i<len; i++){ + absVal = abs_s(vector[i*stride]); + maxVal |= absVal; + } + + return( maxVal ? norm_s(maxVal) : 15); +} /***************************************************************************** @@ -464,8 +464,8 @@ void Transform_Real(Word16 *mdctDelayBuffer, Word32 i,w; Word32 timeSignalSample; Word32 ws1,ws2; - Word16 *dctIn0, *dctIn1;
- Word32 *outData0, *outData1;
+ Word16 *dctIn0, *dctIn1; + Word32 *outData0, *outData1; Word32 *winPtr; Word32 delayBufferSf,timeSignalSf,minSf; @@ -517,8 +517,8 @@ void Transform_Real(Word16 *mdctDelayBuffer, *outData0-- = -((ws1 >> 2) + (ws2 >> 2)); } - Mdct_Long(realOut);
- /* update scale factor */
+ Mdct_Long(realOut); + /* update scale factor */ minSf = 14 - minSf; *mdctScale=minSf; break; @@ -543,7 +543,7 @@ void Transform_Real(Word16 *mdctDelayBuffer, timeSignalSample = (*dctIn1--) << minSf; ws2 = timeSignalSample * (*winPtr & 0xffff); winPtr ++; - *outData0++ = (ws1 >> 2) - (ws2 >> 2); /* shift 2 to avoid overflow next */
+ *outData0++ = (ws1 >> 2) - (ws2 >> 2); /* shift 2 to avoid overflow next */ } shiftMdctDelayBuffer(mdctDelayBuffer,timeSignal,chIncrement); @@ -564,7 +564,7 @@ void Transform_Real(Word16 *mdctDelayBuffer, timeSignalSample= (*dctIn1--) << minSf; ws2 = timeSignalSample * (*winPtr >> 16); winPtr++; - *outData0-- = -((ws1 >> 2) + (ws2 >> 2)); /* shift 2 to avoid overflow next */
+ *outData0-- = -((ws1 >> 2) + (ws2 >> 2)); /* shift 2 to avoid overflow next */ } Mdct_Long(realOut); @@ -600,7 +600,7 @@ void Transform_Real(Word16 *mdctDelayBuffer, timeSignalSample= (*dctIn1--) << minSf; ws2 = timeSignalSample * (*winPtr & 0xffff); winPtr++; - *outData0++ = (ws1 >> 2) - (ws2 >> 2); /* shift 2 to avoid overflow next */
+ *outData0++ = (ws1 >> 2) - (ws2 >> 2); /* shift 2 to avoid overflow next */ } shiftMdctDelayBuffer(mdctDelayBuffer,timeSignal,chIncrement); @@ -615,8 +615,8 @@ void Transform_Real(Word16 *mdctDelayBuffer, ws1 = timeSignalSample *(*winPtr & 0xffff); timeSignalSample= (*dctIn1--) << minSf; ws2 = timeSignalSample * (*winPtr >> 16); - *outData0-- = -((ws1 >> 2) + (ws2 >> 2)); /* shift 2 to avoid overflow next */
- winPtr++;
+ *outData0-- = -((ws1 >> 2) + (ws2 >> 2)); /* shift 2 to avoid overflow next */ + winPtr++; } Mdct_Long(realOut); @@ -645,23 +645,23 @@ void Transform_Real(Word16 *mdctDelayBuffer, ws1 = timeSignalSample * (*winPtr >> 16); timeSignalSample= *dctIn1 << minSf; ws2 = timeSignalSample * (*winPtr & 0xffff); - *outData0++ = (ws1 >> 2) - (ws2 >> 2); /* shift 2 to avoid overflow next */
+ *outData0++ = (ws1 >> 2) - (ws2 >> 2); /* shift 2 to avoid overflow next */ timeSignalSample= *(dctIn0 + FRAME_LEN_SHORT) << minSf; ws1 = timeSignalSample * (*winPtr & 0xffff); timeSignalSample= *(dctIn1 + FRAME_LEN_SHORT) << minSf; ws2 = timeSignalSample * (*winPtr >> 16); - *outData1-- = -((ws1 >> 2) + (ws2 >> 2)); /* shift 2 to avoid overflow next */
-
- winPtr++;
- dctIn0++;
- dctIn1--;
+ *outData1-- = -((ws1 >> 2) + (ws2 >> 2)); /* shift 2 to avoid overflow next */ + + winPtr++; + dctIn0++; + dctIn1--; } Mdct_Short(realOut); realOut += FRAME_LEN_SHORT; } -
+ minSf = 11 - minSf; *mdctScale = minSf; /* update scale factor */ |