Home | History | Annotate | Download | only in encoder
      1 /******************************************************************************
      2  *
      3  * Copyright (C) 2018 The Android Open Source Project
      4  *
      5  * Licensed under the Apache License, Version 2.0 (the "License");
      6  * you may not use this file except in compliance with the License.
      7  * You may obtain a copy of the License at:
      8  *
      9  * http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  *
     17  *****************************************************************************
     18  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
     19 */
     20 /*!
     21 ******************************************************************************
     22 * \file common_rom.c
     23 *
     24 * \brief
     25 *    This file contain square root Table
     26 *
     27 * \date
     28 *
     29 * \author
     30 *    ittiam
     31 *
     32 ******************************************************************************
     33 */
     34 /*****************************************************************************/
     35 /* File Includes                                                             */
     36 /*****************************************************************************/
     37 /* System include files */
     38 #include <stdio.h>
     39 #include <stdlib.h>
     40 
     41 /* User include files */
     42 #include "ia_type_def.h"
     43 
     44 const WORD32 gi4_sqrt_tab[513] = /*sqrt_tab in Q15*/
     45     {
     46 
     47         1073741824,
     48 
     49         1074789888,
     50 
     51         1075836928,
     52 
     53         1076882944,
     54 
     55         1077927936,
     56 
     57         1078971904,
     58 
     59         1080014976,
     60 
     61         1081056896,
     62 
     63         1082097920,
     64 
     65         1083137920,
     66 
     67         1084176896,
     68 
     69         1085214848,
     70 
     71         1086251904,
     72 
     73         1087287808,
     74 
     75         1088322944,
     76 
     77         1089356928,
     78 
     79         1090390016,
     80 
     81         1091422080,
     82 
     83         1092453120,
     84 
     85         1093483264,
     86 
     87         1094512512,
     88 
     89         1095540608,
     90 
     91         1096567936,
     92 
     93         1097594112,
     94 
     95         1098619392,
     96 
     97         1099643776,
     98 
     99         1100667264,
    100 
    101         1101689600,
    102 
    103         1102711168,
    104 
    105         1103731712,
    106 
    107         1104751360,
    108 
    109         1105769984,
    110 
    111         1106787712,
    112 
    113         1107804544,
    114 
    115         1108820352,
    116 
    117         1109835392,
    118 
    119         1110849408,
    120 
    121         1111862400,
    122 
    123         1112874624,
    124 
    125         1113885824,
    126 
    127         1114896128,
    128 
    129         1115905536,
    130 
    131         1116914048,
    132 
    133         1117921664,
    134 
    135         1118928384,
    136 
    137         1119934208,
    138 
    139         1120939008,
    140 
    141         1121943040,
    142 
    143         1122946048,
    144 
    145         1123948288,
    146 
    147         1124949504,
    148 
    149         1125949952,
    150 
    151         1126949504,
    152 
    153         1127948032,
    154 
    155         1128945792,
    156 
    157         1129942656,
    158 
    159         1130938624,
    160 
    161         1131933824,
    162 
    163         1132928000,
    164 
    165         1133921408,
    166 
    167         1134913920,
    168 
    169         1135905536,
    170 
    171         1136896256,
    172 
    173         1137886208,
    174 
    175         1138875136,
    176 
    177         1139863424,
    178 
    179         1140850688,
    180 
    181         1141837184,
    182 
    183         1142822784,
    184 
    185         1143807488,
    186 
    187         1144791424,
    188 
    189         1145774592,
    190 
    191         1146756736,
    192 
    193         1147738112,
    194 
    195         1148718720,
    196 
    197         1149698432,
    198 
    199         1150677376,
    200 
    201         1151655424,
    202 
    203         1152632576,
    204 
    205         1153608960,
    206 
    207         1154584576,
    208 
    209         1155559296,
    210 
    211         1156533248,
    212 
    213         1157506304,
    214 
    215         1158478592,
    216 
    217         1159450112,
    218 
    219         1160420736,
    220 
    221         1161390592,
    222 
    223         1162359680,
    224 
    225         1163327872,
    226 
    227         1164295296,
    228 
    229         1165261952,
    230 
    231         1166227712,
    232 
    233         1167192704,
    234 
    235         1168156928,
    236 
    237         1169120384,
    238 
    239         1170083072,
    240 
    241         1171044864,
    242 
    243         1172005888,
    244 
    245         1172966144,
    246 
    247         1173925632,
    248 
    249         1174884352,
    250 
    251         1175842304,
    252 
    253         1176799488,
    254 
    255         1177755776,
    256 
    257         1178711424,
    258 
    259         1179666176,
    260 
    261         1180620160,
    262 
    263         1181573504,
    264 
    265         1182525952,
    266 
    267         1183477760,
    268 
    269         1184428672,
    270 
    271         1185378816,
    272 
    273         1186328320,
    274 
    275         1187277056,
    276 
    277         1188224896,
    278 
    279         1189172096,
    280 
    281         1190118528,
    282 
    283         1191064192,
    284 
    285         1192009088,
    286 
    287         1192953216,
    288 
    289         1193896704,
    290 
    291         1194839296,
    292 
    293         1195781248,
    294 
    295         1196722432,
    296 
    297         1197662976,
    298 
    299         1198602624,
    300 
    301         1199541632,
    302 
    303         1200479872,
    304 
    305         1201417344,
    306 
    307         1202354176,
    308 
    309         1203290240,
    310 
    311         1204225536,
    312 
    313         1205160064,
    314 
    315         1206093952,
    316 
    317         1207027072,
    318 
    319         1207959552,
    320 
    321         1208891264,
    322 
    323         1209822208,
    324 
    325         1210752512,
    326 
    327         1211682048,
    328 
    329         1212610944,
    330 
    331         1213539072,
    332 
    333         1214466560,
    334 
    335         1215393280,
    336 
    337         1216319232,
    338 
    339         1217244544,
    340 
    341         1218169088,
    342 
    343         1219092992,
    344 
    345         1220016256,
    346 
    347         1220938752,
    348 
    349         1221860608,
    350 
    351         1222781696,
    352 
    353         1223702144,
    354 
    355         1224621824,
    356 
    357         1225540864,
    358 
    359         1226459264,
    360 
    361         1227376896,
    362 
    363         1228293888,
    364 
    365         1229210240,
    366 
    367         1230125824,
    368 
    369         1231040768,
    370 
    371         1231954944,
    372 
    373         1232868608,
    374 
    375         1233781504,
    376 
    377         1234693632,
    378 
    379         1235605248,
    380 
    381         1236516096,
    382 
    383         1237426304,
    384 
    385         1238335872,
    386 
    387         1239244672,
    388 
    389         1240152960,
    390 
    391         1241060480,
    392 
    393         1241967360,
    394 
    395         1242873600,
    396 
    397         1243779072,
    398 
    399         1244684032,
    400 
    401         1245588224,
    402 
    403         1246491776,
    404 
    405         1247394816,
    406 
    407         1248297088,
    408 
    409         1249198592,
    410 
    411         1250099584,
    412 
    413         1250999936,
    414 
    415         1251899648,
    416 
    417         1252798592,
    418 
    419         1253697024,
    420 
    421         1254594816,
    422 
    423         1255491840,
    424 
    425         1256388352,
    426 
    427         1257284224,
    428 
    429         1258179328,
    430 
    431         1259073920,
    432 
    433         1259967744,
    434 
    435         1260861056,
    436 
    437         1261753728,
    438 
    439         1262645760,
    440 
    441         1263537152,
    442 
    443         1264427904,
    444 
    445         1265318016,
    446 
    447         1266207488,
    448 
    449         1267096448,
    450 
    451         1267984640,
    452 
    453         1268872320,
    454 
    455         1269759232,
    456 
    457         1270645632,
    458 
    459         1271531520,
    460 
    461         1272416640,
    462 
    463         1273301120,
    464 
    465         1274185088,
    466 
    467         1275068416,
    468 
    469         1275951104,
    470 
    471         1276833280,
    472 
    473         1277714688,
    474 
    475         1278595584,
    476 
    477         1279475840,
    478 
    479         1280355584,
    480 
    481         1281234560,
    482 
    483         1282113024,
    484 
    485         1282990848,
    486 
    487         1283868160,
    488 
    489         1284744832,
    490 
    491         1285620864,
    492 
    493         1286496384,
    494 
    495         1287371264,
    496 
    497         1288245504,
    498 
    499         1289119232,
    500 
    501         1289992320,
    502 
    503         1290864768,
    504 
    505         1291736704,
    506 
    507         1292608000,
    508 
    509         1293478784,
    510 
    511         1294348928,
    512 
    513         1295218432,
    514 
    515         1296087424,
    516 
    517         1296955904,
    518 
    519         1297823616,
    520 
    521         1298690944,
    522 
    523         1299557504,
    524 
    525         1300423680,
    526 
    527         1301289216,
    528 
    529         1302154112,
    530 
    531         1303018496,
    532 
    533         1303882240,
    534 
    535         1304745472,
    536 
    537         1305608064,
    538 
    539         1306470144,
    540 
    541         1307331712,
    542 
    543         1308192640,
    544 
    545         1309052928,
    546 
    547         1309912704,
    548 
    549         1310771968,
    550 
    551         1311630720,
    552 
    553         1312488832,
    554 
    555         1313346304,
    556 
    557         1314203392,
    558 
    559         1315059840,
    560 
    561         1315915648,
    562 
    563         1316770944,
    564 
    565         1317625728,
    566 
    567         1318480000,
    568 
    569         1319333632,
    570 
    571         1320186752,
    572 
    573         1321039360,
    574 
    575         1321891328,
    576 
    577         1322742784,
    578 
    579         1323593728,
    580 
    581         1324444032,
    582 
    583         1325293824,
    584 
    585         1326143104,
    586 
    587         1326991872,
    588 
    589         1327840128,
    590 
    591         1328687744,
    592 
    593         1329534848,
    594 
    595         1330381440,
    596 
    597         1331227392,
    598 
    599         1332072960,
    600 
    601         1332917888,
    602 
    603         1333762304,
    604 
    605         1334606208,
    606 
    607         1335449472,
    608 
    609         1336292352,
    610 
    611         1337134592,
    612 
    613         1337976448,
    614 
    615         1338817664,
    616 
    617         1339658368,
    618 
    619         1340498560,
    620 
    621         1341338112,
    622 
    623         1342177280,
    624 
    625         1343015936,
    626 
    627         1343853952,
    628 
    629         1344691456,
    630 
    631         1345528576,
    632 
    633         1346365056,
    634 
    635         1347201024,
    636 
    637         1348036480,
    638 
    639         1348871424,
    640 
    641         1349705856,
    642 
    643         1350539776,
    644 
    645         1351373184,
    646 
    647         1352206080,
    648 
    649         1353038464,
    650 
    651         1353870336,
    652 
    653         1354701696,
    654 
    655         1355532544,
    656 
    657         1356363008,
    658 
    659         1357192832,
    660 
    661         1358022144,
    662 
    663         1358850944,
    664 
    665         1359679232,
    666 
    667         1360507008,
    668 
    669         1361334400,
    670 
    671         1362161152,
    672 
    673         1362987520,
    674 
    675         1363813248,
    676 
    677         1364638592,
    678 
    679         1365463424,
    680 
    681         1366287744,
    682 
    683         1367111552,
    684 
    685         1367934848,
    686 
    687         1368757632,
    688 
    689         1369579904,
    690 
    691         1370401792,
    692 
    693         1371223168,
    694 
    695         1372043904,
    696 
    697         1372864384,
    698 
    699         1373684224,
    700 
    701         1374503552,
    702 
    703         1375322496,
    704 
    705         1376140800,
    706 
    707         1376958720,
    708 
    709         1377776256,
    710 
    711         1378593152,
    712 
    713         1379409536,
    714 
    715         1380225536,
    716 
    717         1381041024,
    718 
    719         1381856128,
    720 
    721         1382670592,
    722 
    723         1383484672,
    724 
    725         1384298240,
    726 
    727         1385111296,
    728 
    729         1385923968,
    730 
    731         1386736128,
    732 
    733         1387547776,
    734 
    735         1388358912,
    736 
    737         1389169664,
    738 
    739         1389979904,
    740 
    741         1390789760,
    742 
    743         1391598976,
    744 
    745         1392407808,
    746 
    747         1393216256,
    748 
    749         1394024064,
    750 
    751         1394831488,
    752 
    753         1395638528,
    754 
    755         1396445056,
    756 
    757         1397251072,
    758 
    759         1398056576,
    760 
    761         1398861696,
    762 
    763         1399666304,
    764 
    765         1400470528,
    766 
    767         1401274240,
    768 
    769         1402077440,
    770 
    771         1402880256,
    772 
    773         1403682560,
    774 
    775         1404484480,
    776 
    777         1405285888,
    778 
    779         1406086912,
    780 
    781         1406887296,
    782 
    783         1407687424,
    784 
    785         1408487040,
    786 
    787         1409286144,
    788 
    789         1410084864,
    790 
    791         1410883072,
    792 
    793         1411680896,
    794 
    795         1412478208,
    796 
    797         1413275136,
    798 
    799         1414071552,
    800 
    801         1414867456,
    802 
    803         1415662976,
    804 
    805         1416458112,
    806 
    807         1417252736,
    808 
    809         1418046976,
    810 
    811         1418840704,
    812 
    813         1419634048,
    814 
    815         1420426880,
    816 
    817         1421219328,
    818 
    819         1422011392,
    820 
    821         1422802816,
    822 
    823         1423593984,
    824 
    825         1424384640,
    826 
    827         1425174912,
    828 
    829         1425964672,
    830 
    831         1426754048,
    832 
    833         1427542912,
    834 
    835         1428331392,
    836 
    837         1429119488,
    838 
    839         1429907072,
    840 
    841         1430694272,
    842 
    843         1431480960,
    844 
    845         1432267264,
    846 
    847         1433053184,
    848 
    849         1433838592,
    850 
    851         1434623616,
    852 
    853         1435408256,
    854 
    855         1436192384,
    856 
    857         1436976128,
    858 
    859         1437759488,
    860 
    861         1438542336,
    862 
    863         1439324800,
    864 
    865         1440106752,
    866 
    867         1440888448,
    868 
    869         1441669632,
    870 
    871         1442450304,
    872 
    873         1443230720,
    874 
    875         1444010624,
    876 
    877         1444790144,
    878 
    879         1445569152,
    880 
    881         1446347776,
    882 
    883         1447126016,
    884 
    885         1447903872,
    886 
    887         1448681216,
    888 
    889         1449458304,
    890 
    891         1450234880,
    892 
    893         1451010944,
    894 
    895         1451786752,
    896 
    897         1452562048,
    898 
    899         1453336960,
    900 
    901         1454111360,
    902 
    903         1454885504,
    904 
    905         1455659136,
    906 
    907         1456432384,
    908 
    909         1457205248,
    910 
    911         1457977728,
    912 
    913         1458749696,
    914 
    915         1459521408,
    916 
    917         1460292608,
    918 
    919         1461063424,
    920 
    921         1461833728,
    922 
    923         1462603776,
    924 
    925         1463373312,
    926 
    927         1464142592,
    928 
    929         1464911360,
    930 
    931         1465679744,
    932 
    933         1466447744,
    934 
    935         1467215232,
    936 
    937         1467982464,
    938 
    939         1468749184,
    940 
    941         1469515520,
    942 
    943         1470281600,
    944 
    945         1471047168,
    946 
    947         1471812352,
    948 
    949         1472577024,
    950 
    951         1473341440,
    952 
    953         1474105472,
    954 
    955         1474868992,
    956 
    957         1475632256,
    958 
    959         1476395008,
    960 
    961         1477157376,
    962 
    963         1477919360,
    964 
    965         1478681088,
    966 
    967         1479442304,
    968 
    969         1480203136,
    970 
    971         1480963584,
    972 
    973         1481723648,
    974 
    975         1482483200,
    976 
    977         1483242496,
    978 
    979         1484001408,
    980 
    981         1484759936,
    982 
    983         1485518080,
    984 
    985         1486275712,
    986 
    987         1487033088,
    988 
    989         1487790080,
    990 
    991         1488546560,
    992 
    993         1489302784,
    994 
    995         1490058624,
    996 
    997         1490813952,
    998 
    999         1491569024,
   1000 
   1001         1492323712,
   1002 
   1003         1493078016,
   1004 
   1005         1493831808,
   1006 
   1007         1494585344,
   1008 
   1009         1495338496,
   1010 
   1011         1496091264,
   1012 
   1013         1496843648,
   1014 
   1015         1497595648,
   1016 
   1017         1498347264,
   1018 
   1019         1499098496,
   1020 
   1021         1499849344,
   1022 
   1023         1500599808,
   1024 
   1025         1501349888,
   1026 
   1027         1502099712,
   1028 
   1029         1502849024,
   1030 
   1031         1503598080,
   1032 
   1033         1504346624,
   1034 
   1035         1505094912,
   1036 
   1037         1505842816,
   1038 
   1039         1506590208,
   1040 
   1041         1507337344,
   1042 
   1043         1508084096,
   1044 
   1045         1508830592,
   1046 
   1047         1509576576,
   1048 
   1049         1510322176,
   1050 
   1051         1511067520,
   1052 
   1053         1511812480,
   1054 
   1055         1512556928,
   1056 
   1057         1513301120,
   1058 
   1059         1514044928,
   1060 
   1061         1514788480,
   1062 
   1063         1515531520,
   1064 
   1065         1516274304,
   1066 
   1067         1517016576,
   1068 
   1069         1517758592,
   1070 
   1071         1518500249
   1072 
   1073     };
   1074