FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ra144.c
Go to the documentation of this file.
1 /*
2  * Real Audio 1.0 (14.4K)
3  * Copyright (c) 2003 The FFmpeg project
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include <stdint.h>
23 #include "avcodec.h"
24 #include "celp_filters.h"
25 #include "mathops.h"
26 #include "ra144.h"
27 
28 const int16_t ff_gain_val_tab[256][3] = {
29  { 541, 956, 768}, { 877, 581, 568}, { 675,1574, 635}, {1248,1464, 668},
30  {1246, 839, 1394}, {2560,1386, 991}, { 925, 687, 608}, {2208, 797, 1144},
31  { 535, 832, 799}, { 762, 605, 1154}, { 832,1122, 1003}, {1180, 687, 1176},
32  {1292, 901, 732}, {1656, 689, 896}, {1750,1248, 848}, {2284, 942, 1022},
33  { 824,1472, 643}, { 517, 765, 512}, { 562,1816, 1522}, { 694,1826, 2700},
34  { 704, 524, 672}, {1442, 757, 2232}, { 884, 551, 1266}, {2232,1007, 1692},
35  { 932, 746, 777}, {1132, 822, 926}, {1226, 771, 611}, {2948,1342, 1008},
36  {1302, 594, 1158}, {1602, 636, 1128}, {3408, 910, 1438}, {1996, 614, 575},
37  { 665, 935, 628}, { 631,1192, 829}, { 644, 926, 1052}, { 879, 988, 1226},
38  { 941,2768, 2772}, { 565,1344, 2304}, { 547, 628, 740}, { 639, 532, 1074},
39  { 955,1208, 598}, {1124,1160, 900}, {1206, 899, 1242}, { 746, 533, 624},
40  {1458,1028, 735}, {1706,1102, 692}, {1898,1018, 1004}, {2176, 988, 735},
41  {1578, 782, 1642}, { 897, 516, 754}, {2068, 702, 1656}, {2344, 818, 1526},
42  { 907, 652, 592}, {1056, 652, 642}, {2124,1416, 780}, {2664,1250, 727},
43  {1894, 727, 1108}, {2196, 657, 981}, {4840, 920, 1704}, {4992,1238, 983},
44  {2420, 909, 1094}, {2760, 935, 1032}, {2800, 612, 853}, {3068, 832, 574},
45  { 523,1796, 923}, { 722,1916, 1382}, {1226,1542, 928}, { 758, 757, 584},
46  { 512,1134, 577}, { 615,1276, 698}, { 574,2568, 2356}, { 993,2728, 3512},
47  { 539, 890, 913}, { 694, 928, 1088}, { 805, 600, 1360}, {2160, 951, 3128},
48  { 816, 950, 590}, { 955, 847, 811}, {1094, 883, 556}, {1304, 888, 604},
49  { 863,1170, 855}, {1023, 997, 1032}, { 932,1228, 1280}, { 627, 564, 573},
50  { 876, 900, 1448}, {1030, 857, 1792}, {1294, 953, 1758}, {1612, 854, 1714},
51  {1090,1166, 631}, {1314,1202, 751}, {1480, 905, 795}, {1682,1016, 568},
52  {1494,1178, 983}, { 878, 613, 526}, {1728,1446, 779}, {2136,1348, 774},
53  { 950, 649, 939}, {1180, 703, 899}, {1236, 527, 1158}, {1450, 647, 972},
54  {1282, 647, 707}, {1460, 663, 644}, {1614, 572, 578}, {3516,1222, 821},
55  {2668, 729, 1682}, {3128, 585, 1502}, {3208, 733, 976}, {6800, 871, 1416},
56  {3480, 743, 1408}, {3764, 899, 1170}, {3772, 632, 875}, {4092, 732, 638},
57  {3112, 753, 2620}, {3372, 945, 1890}, {3768, 969, 2288}, {2016, 559, 854},
58  {1736, 729, 787}, {1940, 686, 547}, {2140, 635, 674}, {4480,1272, 828},
59  {3976, 592, 1666}, {4384, 621, 1388}, {4400, 801, 955}, {4656, 522, 646},
60  {4848, 625, 1636}, {4984, 591, 874}, {5352, 535, 1001}, {11216,938, 1184},
61  { 925,3280, 1476}, { 735,1580, 1088}, {1150,1576, 674}, { 655, 783, 528},
62  { 527,2052, 1354}, { 782,1704, 1880}, { 578, 910, 1026}, { 692, 882, 1468},
63  { 586, 683, 715}, { 739, 609, 717}, { 778, 773, 697}, { 922, 785, 813},
64  { 766, 651, 984}, { 978, 596, 1030}, {1070, 757, 1080}, {1324, 687, 1178},
65  {1108,2144, 979}, { 723, 982, 690}, { 936, 956, 527}, {1180,1002, 547},
66  { 517,1306, 825}, { 832,1184, 974}, {1024, 957, 903}, {1262,1090, 906},
67  {1028, 720, 649}, {1192, 679, 694}, {2468,1480, 979}, {2844,1370, 877},
68  {1310, 835, 848}, {1508, 839, 698}, {1742,1030, 769}, {1910, 852, 573},
69  {1280, 859, 1174}, {1584, 863, 1108}, {1686, 708, 1364}, {1942, 768, 1104},
70  { 891, 536, 690}, {1016, 560, 663}, {2172, 870, 1348}, {2404, 999, 1170},
71  {1890, 966, 889}, {2116, 912, 777}, {2296,1020, 714}, {4872,1844, 932},
72  {2392, 778, 929}, {2604, 772, 744}, {2764, 957, 722}, {5832,1532, 984},
73  {2188, 519, 1264}, {2332, 532, 922}, {5064, 995, 2412}, {2708, 571, 874},
74  {2408, 545, 666}, {5016,1084, 875}, {5376, 983, 1196}, {5536, 979, 730},
75  {5344, 634, 1744}, {5688, 706, 1348}, {5912, 977, 1190}, {6072, 905, 763},
76  {6048, 582, 1526}, {11968,1013,1816}, {12864,937, 1900}, {12560,1086, 998},
77  {1998, 684, 1884}, {2504, 633, 1992}, {1252, 567, 835}, {1478, 571, 973},
78  {2620, 769, 1414}, {2808, 952, 1142}, {2908, 712, 1028}, {2976, 686, 741},
79  {1462, 552, 714}, {3296, 991, 1452}, {1590, 615, 544}, {3480,1150, 824},
80  {3212, 832, 923}, {3276, 839, 531}, {3548, 786, 852}, {3732, 764, 570},
81  {5728, 906, 2616}, {6272, 804, 2252}, {3096, 535, 876}, {3228, 598, 649},
82  {6536, 759, 1436}, {6648, 993, 846}, {6864, 567, 1210},{14016,1012, 1302},
83  {3408, 548, 1098}, {7160,1008, 1742}, {7136,1000, 1182}, {7480,1032, 836},
84  {7448, 612, 1552}, {7744, 614, 816}, {8384, 777, 1438}, {8784, 694, 786},
85  { 882,1508, 1068}, { 597, 837, 766}, {1270, 954, 1408}, { 803, 550, 798},
86  {1398,1308, 798}, {1848,1534, 738}, { 970, 675, 608}, {1264, 706, 684},
87  {1716, 767, 1126}, {2108, 765, 1404}, {2236, 924, 1003}, {2472,1048, 611},
88  { 999, 942, 963}, {1094, 857, 935}, {2936, 926, 1138}, {1934, 746, 551},
89  {3336, 633, 1762}, {3764, 701, 1454}, {1890, 564, 636}, {4096,1126, 793},
90  {3936, 556, 1140}, {3936, 540, 740}, {4216, 764, 874}, {8480,1328, 1014},
91  {2184, 515, 1042}, {4432, 934, 1344}, {4784, 945, 1112}, {5016,1062, 733},
92  {9216,1020, 2028}, {9968, 924, 1188}, {5424, 909, 1206}, {6512, 744, 1086}
93 };
94 
95 const uint8_t ff_gain_exp_tab[256] = {
96  15, 15, 15, 15, 15, 16, 14, 15, 14, 14, 14, 14, 14, 14, 14, 14,
97  14, 13, 14, 14, 13, 14, 13, 14, 13, 13, 13, 14, 13, 13, 14, 13,
98  13, 13, 13, 13, 14, 13, 12, 12, 13, 13, 13, 12, 13, 13, 13, 13,
99  13, 12, 13, 13, 12, 12, 13, 13, 13, 13, 14, 14, 13, 13, 13, 13,
100  13, 13, 13, 12, 12, 12, 13, 13, 12, 12, 12, 13, 12, 12, 12, 12,
101  12, 12, 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12,
102  12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 13, 13, 13, 13,
103  13, 13, 13, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14,
104  13, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
105  12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 11, 11, 11, 11,
106  12, 12, 12, 12, 11, 11, 12, 12, 12, 12, 12, 13, 12, 12, 12, 13,
107  12, 12, 13, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14,
108  12, 12, 11, 11, 12, 12, 12, 12, 11, 12, 11, 12, 12, 12, 12, 12,
109  13, 13, 12, 12, 13, 13, 13, 14, 12, 13, 13, 13, 13, 13, 13, 13,
110  11, 10, 11, 10, 11, 11, 10, 10, 11, 11, 11, 11, 10, 9, 11, 10,
111  12, 12, 11, 12, 12, 12, 12, 13, 11, 12, 12, 12, 13, 13, 12, 12
112 };
113 
114 const int8_t ff_cb1_vects[128][40]={
115  {
116  38, -4, 15, -4, 14, -13, 12, -11, -2, -6,
117  -6, -11, -45, -16, -11, -13, -7, 6, -12, 4,
118  -20, 3, -16, 12, -1, 12, 46, 24, 0, 33,
119  -3, 9, -12, -12, -8, -7, 17, -6, 0, -2,
120  }, {
121  60, -16, 3, -22, 10, -32, 0, -28, -17, -18,
122  -3, -25, -37, -23, -10, 3, 2, 3, 0, 3,
123  -14, 0, -14, -1, 0, 2, 32, 9, -1, 25,
124  7, 13, -5, 13, 8, 1, 2, 8, -10, 6,
125  }, {
126  27, -12, 28, -2, 6, -7, 15, 9, -11, 1,
127  -13, -11, -40, 4, -29, -14, -19, -5, -23, -8,
128  -30, -13, -17, 0, -14, 12, 34, 20, -2, 25,
129  2, -16, -4, -12, 15, 16, 29, 7, 24, 10,
130  }, {
131  49, -24, 16, -20, 2, -26, 2, -7, -25, -10,
132  -11, -25, -32, -3, -27, 2, -8, -8, -11, -9,
133  -24, -17, -16, -14, -13, 2, 20, 5, -4, 17,
134  14, -12, 3, 13, 33, 25, 14, 23, 15, 19,
135  }, {
136  46, -6, 21, 8, -2, -16, -5, -8, -11, 4,
137  8, 15, -24, 4, -2, -26, -3, -16, -16, -14,
138  -9, -2, -1, 4, 19, 7, 36, 17, 9, 13,
139  0, 31, -5, -12, 7, -8, 11, -15, -13, -4,
140  }, {
141  68, -18, 9, -9, -6, -35, -18, -25, -26, -7,
142  10, 1, -16, -3, -1, -9, 6, -19, -4, -15,
143  -4, -6, 0, -8, 20, -2, 23, 2, 7, 5,
144  12, 35, 1, 13, 24, 0, -3, 0, -22, 4,
145  }, {
146  35, -14, 34, 10, -10, -10, -1, 12, -20, 12,
147  0, 15, -18, 24, -20, -27, -14, -28, -27, -27,
148  -20, -19, -2, -8, 5, 7, 25, 13, 5, 5,
149  6, 5, 2, -12, 31, 15, 23, -1, 12, 8,
150  }, {
151  57, -26, 22, -7, -14, -28, -14, -3, -35, 0,
152  3, 1, -11, 16, -18, -10, -4, -31, -15, -28,
153  -14, -23, -1, -21, 7, -2, 11, -1, 3, -1,
154  18, 9, 10, 13, 49, 24, 8, 14, 2, 16,
155  }, {
156  25, 15, 22, 11, 18, 4, 15, -22, 8, -2,
157  -17, -9, -48, -20, -30, -17, -16, 11, -1, 16,
158  2, 10, -5, 26, -2, -4, 22, 0, 2, 10,
159  -6, 13, -14, 10, -23, 0, 10, -2, 1, 0,
160  }, {
161  47, 3, 11, -6, 15, -13, 2, -38, -6, -13,
162  -15, -22, -40, -28, -28, 0, -5, 8, 10, 15,
163  7, 7, -4, 13, -1, -14, 9, -14, 0, 2,
164  4, 18, -7, 36, -6, 8, -3, 13, -7, 8,
165  }, {
166  14, 7, 36, 13, 10, 10, 18, 0, 0, 5,
167  -25, -8, -43, 0, -48, -18, -27, 0, -12, 3,
168  -7, -6, -7, 13, -15, -5, 11, -3, 0, 2,
169  0, -12, -6, 10, 0, 23, 22, 11, 26, 12,
170  }, {
171  36, -5, 24, -4, 7, -7, 6, -17, -14, -5,
172  -22, -22, -35, -8, -46, -1, -17, -3, 0, 2,
173  -2, -10, -5, 0, -14, -15, -2, -18, -2, -4,
174  11, -7, 1, 36, 18, 32, 7, 27, 17, 20,
175  }, {
176  33, 13, 29, 24, 1, 1, -2, -18, 0, 9,
177  -3, 17, -27, 0, -21, -30, -12, -11, -5, -2,
178  12, 4, 9, 19, 18, -9, 13, -6, 11, -8,
179  -2, 35, -8, 10, -7, -1, 4, -11, -10, -2,
180  }, {
181  55, 1, 17, 6, -1, -16, -15, -35, -15, -2,
182  0, 4, -19, -8, -20, -13, -1, -14, 7, -3,
183  18, 0, 10, 5, 19, -19, 0, -21, 8, -16,
184  9, 39, 0, 36, 10, 7, -9, 4, -20, 5,
185  }, {
186  22, 5, 42, 26, -6, 8, 1, 2, -9, 17,
187  -10, 18, -21, 19, -39, -31, -23, -23, -16, -15,
188  2, -12, 7, 6, 5, -9, 1, -10, 7, -16,
189  4, 9, 0, 10, 17, 22, 16, 2, 14, 9,
190  }, {
191  44, -6, 30, 8, -9, -10, -11, -14, -23, 5,
192  -8, 4, -14, 12, -37, -14, -12, -26, -4, -16,
193  8, -16, 9, -7, 6, -19, -12, -25, 5, -24,
194  15, 13, 8, 36, 34, 31, 1, 18, 4, 18,
195  }, {
196  -3, -5, -9, -7, 15, -1, 5, 13, 2, 12,
197  5, 2, -21, -23, -2, -16, 0, 5, -6, 13,
198  -23, 3, -32, 10, -15, 8, 44, 28, 9, 37,
199  -2, 13, -9, -15, -12, -27, -7, -12, 0, -11,
200  }, {
201  18, -17, -21, -25, 11, -19, -6, -3, -11, 0,
202  7, -11, -13, -31, -1, 0, 9, 1, 5, 12,
203  -18, 0, -31, -2, -13, -1, 30, 14, 7, 29,
204  9, 18, -1, 10, 4, -18, -22, 3, -10, -2,
205  }, {
206  -13, -13, 3, -5, 7, 4, 9, 34, -5, 20,
207  -2, 3, -16, -3, -20, -17, -11, -7, -17, 0,
208  -34, -13, -33, -2, -28, 8, 32, 24, 5, 29,
209  3, -12, 0, -15, 11, -3, 3, 2, 24, 1,
210  }, {
211  8, -25, -8, -23, 3, -13, -3, 17, -20, 8,
212  0, -10, -8, -11, -18, 0, -1, -10, -5, 0,
213  -28, -17, -32, -15, -26, -1, 19, 9, 3, 21,
214  15, -7, 6, 9, 29, 5, -10, 17, 15, 9,
215  }, {
216  4, -6, -3, 5, -1, -4, -11, 16, -6, 23,
217  19, 29, 0, -3, 6, -30, 3, -17, -10, -5,
218  -13, -2, -17, 3, 5, 3, 35, 21, 17, 17,
219  2, 35, -2, -15, 3, -28, -13, -21, -13, -13,
220  }, {
221  26, -19, -15, -12, -5, -22, -24, 0, -21, 12,
222  21, 15, 8, -11, 7, -12, 14, -20, 2, -6,
223  -7, -6, -16, -9, 6, -5, 21, 7, 15, 10,
224  13, 39, 5, 10, 20, -19, -28, -5, -22, -5,
225  }, {
226  -5, -15, 9, 7, -9, 2, -8, 37, -14, 31,
227  11, 29, 5, 16, -11, -30, -7, -29, -21, -18,
228  -23, -19, -18, -9, -7, 3, 23, 17, 14, 9,
229  8, 9, 6, -15, 27, -4, -2, -6, 12, -1,
230  }, {
231  16, -27, -2, -10, -13, -16, -20, 20, -29, 20,
232  14, 16, 13, 8, -9, -13, 2, -33, -9, -19,
233  -17, -23, -17, -22, -6, -6, 9, 2, 12, 2,
234  20, 13, 13, 10, 45, 4, -16, 8, 2, 7,
235  }, {
236  -16, 14, -2, 8, 20, 17, 9, 2, 14, 16,
237  -6, 5, -24, -28, -21, -20, -8, 9, 4, 25,
238  -1, 11, -22, 24, -15, -8, 21, 5, 11, 14,
239  -5, 18, -11, 7, -27, -20, -14, -7, 1, -9,
240  }, {
241  6, 2, -14, -9, 16, -1, -3, -14, 0, 5,
242  -3, -8, -16, -36, -19, -3, 1, 6, 17, 24,
243  4, 7, -21, 11, -14, -18, 7, -9, 9, 7,
244  6, 22, -3, 33, -10, -11, -28, 7, -7, 0,
245  }, {
246  -26, 6, 11, 10, 12, 23, 12, 23, 5, 24,
247  -13, 5, -19, -8, -38, -21, -20, -2, -6, 12,
248  -11, -5, -23, 11, -29, -9, 9, 0, 7, 6,
249  1, -7, -2, 7, -3, 3, -2, 6, 27, 3,
250  }, {
251  -4, -6, 0, -7, 8, 4, 0, 6, -9, 13,
252  -11, -7, -11, -15, -37, -4, -9, -5, 5, 11,
253  -5, -9, -22, -1, -27, -18, -4, -14, 5, 0,
254  12, -3, 4, 32, 14, 12, -17, 22, 17, 11,
255  }, {
256  -8, 12, 3, 21, 3, 14, -8, 5, 4, 28,
257  7, 32, -2, -8, -12, -34, -4, -12, 1, 6,
258  9, 4, -7, 17, 4, -13, 11, -1, 19, -4,
259  0, 39, -4, 7, -11, -21, -20, -16, -10, -11,
260  }, {
261  13, 0, -8, 3, 0, -4, -21, -11, -9, 16,
262  10, 18, 5, -16, -10, -16, 5, -15, 13, 5,
263  15, 1, -6, 4, 6, -23, -2, -16, 17, -12,
264  10, 44, 3, 33, 6, -12, -34, -1, -20, -3,
265  }, {
266  -18, 4, 17, 23, -4, 20, -4, 26, -3, 36,
267  0, 32, 2, 12, -29, -34, -16, -24, -10, -6,
268  0, -12, -8, 4, -8, -13, 0, -6, 16, -12,
269  5, 13, 3, 7, 13, 3, -8, -2, 14, 0,
270  }, {
271  3, -7, 5, 5, -8, 2, -17, 9, -18, 24,
272  2, 19, 10, 4, -28, -17, -5, -28, 2, -7,
273  4, -15, -7, -8, -6, -23, -13, -21, 14, -20,
274  17, 18, 11, 33, 30, 11, -23, 13, 5, 9,
275  }, {
276  60, 10, 7, -1, 9, -8, 6, -13, 2, -15,
277  -1, -10, -13, -11, 15, 0, 6, 9, -1, 0,
278  -13, 1, -11, -3, -13, 21, 13, 26, -7, 31,
279  -10, -7, -16, -33, -31, -10, 22, -8, 1, -2,
280  }, {
281  82, -1, -4, -19, 6, -27, -6, -29, -12, -26,
282  1, -24, -5, -18, 17, 17, 17, 6, 10, 0,
283  -7, -2, -9, -16, -12, 11, 0, 11, -9, 23,
284  0, -3, -8, -8, -13, -1, 8, 7, -7, 6,
285  }, {
286  49, 2, 21, 0, 1, -2, 9, 8, -6, -6,
287  -8, -10, -8, 9, -2, 0, -4, -2, -13, -12,
288  -23, -15, -12, -16, -26, 21, 2, 21, -11, 23,
289  -4, -33, -7, -33, -6, 13, 34, 5, 27, 10,
290  }, {
291  71, -10, 9, -17, -1, -20, -3, -8, -21, -18,
292  -6, -24, 0, 1, 0, 16, 6, -5, 0, -13,
293  -17, -19, -11, -29, -25, 11, -11, 6, -13, 15,
294  7, -29, 0, -8, 11, 22, 20, 21, 17, 18,
295  }, {
296  67, 8, 14, 11, -7, -11, -11, -9, -7, -3,
297  13, 16, 8, 9, 24, -12, 10, -13, -5, -17,
298  -2, -4, 3, -10, 6, 17, 4, 19, 0, 11,
299  -6, 13, -9, -33, -14, -10, 16, -17, -10, -4,
300  }, {
301  90, -3, 2, -6, -10, -29, -24, -26, -21, -15,
302  15, 2, 16, 1, 25, 4, 21, -16, 6, -18,
303  3, -8, 5, -24, 8, 7, -9, 4, -1, 3,
304  5, 18, -1, -7, 2, -1, 2, -1, -19, 3,
305  }, {
306  57, 0, 27, 13, -14, -5, -7, 11, -15, 4,
307  5, 16, 13, 29, 6, -13, 0, -25, -16, -31,
308  -12, -22, 2, -23, -6, 16, -7, 14, -2, 3,
309  0, -12, 0, -33, 9, 13, 28, -3, 14, 7,
310  }, {
311  79, -11, 15, -4, -18, -23, -20, -5, -30, -7,
312  7, 2, 21, 21, 8, 3, 10, -28, -4, -31,
313  -6, -25, 3, -37, -4, 7, -20, 0, -4, -4,
314  11, -7, 6, -8, 27, 22, 14, 12, 5, 16,
315  }, {
316  47, 30, 15, 14, 14, 9, 9, -23, 13, -10,
317  -12, -7, -16, -15, -3, -3, -1, 14, 9, 12,
318  9, 8, 0, 10, -14, 4, -9, 2, -5, 8,
319  -13, -3, -18, -10, -45, -3, 16, -4, 4, 0,
320  }, {
321  69, 17, 3, -3, 10, -8, -3, -40, -1, -21,
322  -10, -21, -8, -23, -1, 13, 8, 11, 21, 11,
323  15, 4, 0, -2, -13, -5, -23, -12, -7, 0,
324  -1, 0, -10, 14, -28, 5, 1, 11, -5, 7,
325  }, {
326  36, 21, 28, 16, 6, 16, 12, -2, 4, -2,
327  -20, -7, -11, 4, -20, -4, -12, 2, -1, 0,
328  0, -8, -2, -2, -27, 4, -21, -2, -9, 0,
329  -6, -29, -9, -10, -21, 21, 28, 10, 29, 11,
330  }, {
331  58, 9, 16, -1, 2, -2, 0, -19, -10, -13,
332  -17, -21, -3, -3, -19, 12, -2, 0, 10, -1,
333  5, -12, 0, -15, -26, -5, -34, -16, -11, -7,
334  4, -25, -2, 14, -3, 29, 13, 25, 20, 20,
335  }, {
336  55, 28, 21, 27, -2, 7, -8, -20, 4, 1,
337  1, 18, 5, 4, 5, -16, 2, -8, 5, -5,
338  19, 2, 14, 3, 6, 0, -18, -4, 2, -11,
339  -8, 18, -11, -10, -29, -3, 10, -13, -8, -3,
340  }, {
341  77, 16, 9, 9, -6, -11, -21, -37, -10, -10,
342  4, 5, 13, -3, 7, 0, 13, -11, 17, -6,
343  25, -1, 15, -9, 7, -9, -32, -19, 0, -18,
344  2, 22, -3, 15, -12, 5, -4, 2, -17, 5,
345  }, {
346  44, 20, 34, 29, -10, 13, -4, 0, -4, 9,
347  -5, 19, 10, 24, -11, -17, -8, -20, -5, -19,
348  9, -14, 12, -9, -6, 0, -30, -9, 0, -19,
349  -2, -7, -2, -10, -5, 20, 21, 1, 17, 9,
350  }, {
351  66, 8, 23, 11, -14, -5, -17, -16, -19, -2,
352  -3, 5, 18, 17, -10, 0, 1, -23, 6, -20,
353  15, -18, 14, -22, -5, -10, -44, -23, -2, -26,
354  9, -3, 4, 14, 12, 29, 7, 16, 7, 18,
355  }, {
356  18, 9, -17, -4, 11, 3, 0, 11, 7, 4,
357  10, 3, 10, -18, 24, -3, 14, 7, 4, 10,
358  -16, 1, -27, -4, -27, 17, 12, 30, 0, 35,
359  -9, -3, -12, -36, -35, -30, -2, -13, 2, -11,
360  }, {
361  40, -2, -29, -22, 7, -14, -12, -5, -7, -7,
362  12, -9, 18, -26, 26, 14, 24, 4, 16, 9,
363  -10, -2, -26, -18, -26, 7, -1, 15, -1, 27,
364  2, 0, -4, -11, -17, -21, -16, 1, -7, -3,
365  }, {
366  8, 1, -3, -2, 3, 10, 3, 32, -1, 12,
367  2, 4, 15, 1, 7, -3, 2, -4, -6, -3,
368  -26, -15, -29, -17, -40, 17, 0, 26, -2, 27,
369  -2, -29, -4, -36, -10, -6, 9, 0, 27, 0,
370  }, {
371  30, -11, -15, -20, 0, -8, -9, 15, -15, 0,
372  5, -9, 23, -6, 8, 13, 13, -7, 5, -3,
373  -20, -19, -27, -31, -39, 7, -13, 11, -4, 19,
374  8, -25, 3, -11, 7, 2, -4, 16, 18, 9,
375  }, {
376  26, 7, -11, 8, -5, 1, -17, 14, -1, 15,
377  24, 30, 32, 1, 33, -16, 18, -14, 0, -8,
378  -6, -4, -12, -12, -6, 13, 2, 23, 8, 15,
379  -4, 17, -5, -36, -18, -30, -8, -22, -10, -14,
380  }, {
381  48, -4, -23, -9, -9, -17, -30, -2, -16, 3,
382  26, 16, 40, -6, 35, 1, 28, -17, 12, -9,
383  0, -8, -11, -25, -5, 3, -10, 8, 6, 7,
384  6, 22, 1, -11, -1, -21, -22, -7, -19, -5,
385  }, {
386  15, 0, 2, 10, -13, 7, -14, 35, -10, 23,
387  16, 31, 37, 21, 16, -17, 6, -26, -10, -21,
388  -16, -21, -13, -25, -19, 13, -8, 19, 5, 7,
389  1, -8, 2, -36, 5, -6, 3, -8, 15, -1,
390  }, {
391  37, -12, -9, -7, -17, -11, -26, 18, -25, 12,
392  19, 17, 45, 14, 17, 0, 17, -30, 1, -22,
393  -10, -25, -12, -38, -18, 3, -22, 4, 3, 0,
394  13, -3, 10, -11, 23, 2, -10, 7, 5, 7,
395  }, {
396  5, 29, -9, 11, 15, 22, 3, 0, 18, 8,
397  -1, 6, 7, -23, 6, -6, 5, 12, 15, 21,
398  5, 8, -17, 9, -28, 0, -11, 6, 2, 12,
399  -11, 0, -14, -13, -49, -22, -8, -9, 4, -9,
400  }, {
401  27, 16, -21, -6, 12, 3, -9, -16, 3, -2,
402  1, -7, 15, -31, 7, 10, 16, 9, 27, 21,
403  11, 5, -16, -3, -26, -9, -24, -7, 0, 4,
404  0, 4, -6, 11, -32, -14, -23, 6, -5, -1,
405  }, {
406  -4, 20, 3, 13, 8, 28, 6, 21, 10, 16,
407  -8, 7, 12, -3, -11, -7, -5, 0, 4, 8,
408  -4, -8, -18, -3, -41, 0, -22, 2, 0, 4,
409  -5, -25, -6, -14, -25, 1, 2, 4, 29, 2,
410  }, {
411  17, 8, -8, -4, 4, 10, -6, 5, -4, 5,
412  -6, -6, 20, -10, -9, 9, 4, -2, 16, 7,
413  1, -12, -17, -16, -39, -9, -36, -12, -2, -3,
414  6, -21, 1, 11, -7, 10, -11, 20, 20, 11,
415  }, {
416  13, 27, -3, 24, -1, 19, -14, 3, 9, 20,
417  12, 33, 29, -3, 15, -20, 9, -9, 11, 3,
418  16, 2, -2, 2, -7, -3, -20, 0, 10, -7,
419  -7, 22, -7, -13, -33, -23, -14, -18, -7, -12,
420  }, {
421  35, 15, -15, 6, -4, 1, -27, -12, -5, 8,
422  15, 19, 37, -11, 16, -2, 20, -12, 23, 2,
423  22, -1, -1, -11, -5, -13, -34, -14, 8, -14,
424  4, 26, 0, 11, -16, -14, -29, -2, -17, -3,
425  }, {
426  3, 19, 9, 26, -8, 26, -10, 24, 0, 28,
427  5, 33, 34, 17, -2, -20, -1, -22, 0, -10,
428  6, -14, -3, -10, -20, -4, -32, -4, 7, -15,
429  0, -3, 0, -13, -9, 0, -3, -4, 17, 0,
430  }, {
431  25, 7, -2, 8, -12, 7, -23, 8, -13, 16,
432  7, 20, 42, 9, 0, -3, 9, -25, 12, -10,
433  12, -18, -2, -24, -19, -13, -46, -19, 5, -22,
434  10, 0, 8, 11, 8, 9, -17, 11, 7, 8,
435  }, {
436  -25, -7, 2, -8, 12, -7, 23, -8, 13, -16,
437  -7, -20, -42, -9, 0, 3, -9, 25, -12, 10,
438  -12, 18, 2, 24, 19, 13, 46, 19, -5, 22,
439  -10, 0, -8, -11, -8, -9, 17, -11, -7, -8,
440  }, {
441  -3, -19, -9, -26, 8, -26, 10, -24, 0, -28,
442  -5, -33, -34, -17, 2, 20, 1, 22, 0, 10,
443  -6, 14, 3, 10, 20, 4, 32, 4, -7, 15,
444  0, 3, 0, 13, 9, 0, 3, 4, -17, 0,
445  }, {
446  -35, -15, 15, -6, 4, -1, 27, 12, 5, -8,
447  -15, -19, -37, 11, -16, 2, -20, 12, -23, -2,
448  -22, 1, 1, 11, 5, 13, 34, 14, -8, 14,
449  -4, -26, 0, -11, 16, 14, 29, 2, 17, 3,
450  }, {
451  -13, -27, 3, -24, 1, -19, 14, -3, -9, -20,
452  -12, -33, -29, 3, -15, 20, -9, 9, -11, -3,
453  -16, -2, 2, -2, 7, 3, 20, 0, -10, 7,
454  7, -22, 7, 13, 33, 23, 14, 18, 7, 12,
455  }, {
456  -17, -8, 8, 4, -4, -10, 6, -5, 4, -5,
457  6, 6, -20, 10, 9, -9, -4, 2, -16, -7,
458  -1, 12, 17, 16, 39, 9, 36, 12, 2, 3,
459  -6, 21, -1, -11, 7, -10, 11, -20, -20, -11,
460  }, {
461  4, -20, -3, -13, -8, -28, -6, -21, -10, -16,
462  8, -7, -12, 3, 11, 7, 5, 0, -4, -8,
463  4, 8, 18, 3, 41, 0, 22, -2, 0, -4,
464  5, 25, 6, 14, 25, -1, -2, -4, -29, -2,
465  }, {
466  -27, -16, 21, 6, -12, -3, 9, 16, -3, 2,
467  -1, 7, -15, 31, -7, -10, -16, -9, -27, -21,
468  -11, -5, 16, 3, 26, 9, 24, 7, 0, -4,
469  0, -4, 6, -11, 32, 14, 23, -6, 5, 1,
470  }, {
471  -5, -29, 9, -11, -15, -22, -3, 0, -18, -8,
472  1, -6, -7, 23, -6, 6, -5, -12, -15, -21,
473  -5, -8, 17, -9, 28, 0, 11, -6, -2, -12,
474  11, 0, 14, 13, 49, 22, 8, 9, -4, 9,
475  }, {
476  -37, 12, 9, 7, 17, 11, 26, -18, 25, -12,
477  -19, -17, -45, -14, -17, 0, -17, 30, -1, 22,
478  10, 25, 12, 38, 18, -3, 22, -4, -3, 0,
479  -13, 3, -10, 11, -23, -2, 10, -7, -5, -7,
480  }, {
481  -15, 0, -2, -10, 13, -7, 14, -35, 10, -23,
482  -16, -31, -37, -21, -16, 17, -6, 26, 10, 21,
483  16, 21, 13, 25, 19, -13, 8, -19, -5, -7,
484  -1, 8, -2, 36, -5, 6, -3, 8, -15, 1,
485  }, {
486  -48, 4, 23, 9, 9, 17, 30, 2, 16, -3,
487  -26, -16, -40, 6, -35, -1, -28, 17, -12, 9,
488  0, 8, 11, 25, 5, -3, 10, -8, -6, -7,
489  -6, -22, -1, 11, 1, 21, 22, 7, 19, 5,
490  }, {
491  -26, -7, 11, -8, 5, -1, 17, -14, 1, -15,
492  -24, -30, -32, -1, -33, 16, -18, 14, 0, 8,
493  6, 4, 12, 12, 6, -13, -2, -23, -8, -15,
494  4, -17, 5, 36, 18, 30, 8, 22, 10, 14,
495  }, {
496  -30, 11, 15, 20, 0, 8, 9, -15, 15, 0,
497  -5, 9, -23, 6, -8, -13, -13, 7, -5, 3,
498  20, 19, 27, 31, 39, -7, 13, -11, 4, -19,
499  -8, 25, -3, 11, -7, -2, 4, -16, -18, -9,
500  }, {
501  -8, -1, 3, 2, -3, -10, -3, -32, 1, -12,
502  -2, -4, -15, -1, -7, 3, -2, 4, 6, 3,
503  26, 15, 29, 17, 40, -17, 0, -26, 2, -27,
504  2, 29, 4, 36, 10, 6, -9, 0, -27, 0,
505  }, {
506  -40, 2, 29, 22, -7, 14, 12, 5, 7, 7,
507  -12, 9, -18, 26, -26, -14, -24, -4, -16, -9,
508  10, 2, 26, 18, 26, -7, 1, -15, 1, -27,
509  -2, 0, 4, 11, 17, 21, 16, -1, 7, 3,
510  }, {
511  -18, -9, 17, 4, -11, -3, 0, -11, -7, -4,
512  -10, -3, -10, 18, -24, 3, -14, -7, -4, -10,
513  16, -1, 27, 4, 27, -17, -12, -30, 0, -35,
514  9, 3, 12, 36, 35, 30, 2, 13, -2, 11,
515  }, {
516  -66, -8, -23, -11, 14, 5, 17, 16, 19, 2,
517  3, -5, -18, -17, 10, 0, -1, 23, -6, 20,
518  -15, 18, -14, 22, 5, 10, 44, 23, 2, 26,
519  -9, 3, -4, -14, -12, -29, -7, -16, -7, -18,
520  }, {
521  -44, -20, -34, -29, 10, -13, 4, 0, 4, -9,
522  5, -19, -10, -24, 11, 17, 8, 20, 5, 19,
523  -9, 14, -12, 9, 6, 0, 30, 9, 0, 19,
524  2, 7, 2, 10, 5, -20, -21, -1, -17, -9,
525  }, {
526  -77, -16, -9, -9, 6, 11, 21, 37, 10, 10,
527  -4, -5, -13, 3, -7, 0, -13, 11, -17, 6,
528  -25, 1, -15, 9, -7, 9, 32, 19, 0, 18,
529  -2, -22, 3, -15, 12, -5, 4, -2, 17, -5,
530  }, {
531  -55, -28, -21, -27, 2, -7, 8, 20, -4, -1,
532  -1, -18, -5, -4, -5, 16, -2, 8, -5, 5,
533  -19, -2, -14, -3, -6, 0, 18, 4, -2, 11,
534  8, -18, 11, 10, 29, 3, -10, 13, 8, 3,
535  }, {
536  -58, -9, -16, 1, -2, 2, 0, 19, 10, 13,
537  17, 21, 3, 3, 19, -12, 2, 0, -10, 1,
538  -5, 12, 0, 15, 26, 5, 34, 16, 11, 7,
539  -4, 25, 2, -14, 3, -29, -13, -25, -20, -20,
540  }, {
541  -36, -21, -28, -16, -6, -16, -12, 2, -4, 2,
542  20, 7, 11, -4, 20, 4, 12, -2, 1, 0,
543  0, 8, 2, 2, 27, -4, 21, 2, 9, 0,
544  6, 29, 9, 10, 21, -21, -28, -10, -29, -11,
545  }, {
546  -69, -17, -3, 3, -10, 8, 3, 40, 1, 21,
547  10, 21, 8, 23, 1, -13, -8, -11, -21, -11,
548  -15, -4, 0, 2, 13, 5, 23, 12, 7, 0,
549  1, 0, 10, -14, 28, -5, -1, -11, 5, -7,
550  }, {
551  -47, -30, -15, -14, -14, -9, -9, 23, -13, 10,
552  12, 7, 16, 15, 3, 3, 1, -14, -9, -12,
553  -9, -8, 0, -10, 14, -4, 9, -2, 5, -8,
554  13, 3, 18, 10, 45, 3, -16, 4, -4, 0,
555  }, {
556  -79, 11, -15, 4, 18, 23, 20, 5, 30, 7,
557  -7, -2, -21, -21, -8, -3, -10, 28, 4, 31,
558  6, 25, -3, 37, 4, -7, 20, 0, 4, 4,
559  -11, 7, -6, 8, -27, -22, -14, -12, -5, -16,
560  }, {
561  -57, 0, -27, -13, 14, 5, 7, -11, 15, -4,
562  -5, -16, -13, -29, -6, 13, 0, 25, 16, 31,
563  12, 22, -2, 23, 6, -16, 7, -14, 2, -3,
564  0, 12, 0, 33, -9, -13, -28, 3, -14, -7,
565  }, {
566  -90, 3, -2, 6, 10, 29, 24, 26, 21, 15,
567  -15, -2, -16, -1, -25, -4, -21, 16, -6, 18,
568  -3, 8, -5, 24, -8, -7, 9, -4, 1, -3,
569  -5, -18, 1, 7, -2, 1, -2, 1, 19, -3,
570  }, {
571  -67, -8, -14, -11, 7, 11, 11, 9, 7, 3,
572  -13, -16, -8, -9, -24, 12, -10, 13, 5, 17,
573  2, 4, -3, 10, -6, -17, -4, -19, 0, -11,
574  6, -13, 9, 33, 14, 10, -16, 17, 10, 4,
575  }, {
576  -71, 10, -9, 17, 1, 20, 3, 8, 21, 18,
577  6, 24, 0, -1, 0, -16, -6, 5, 0, 13,
578  17, 19, 11, 29, 25, -11, 11, -6, 13, -15,
579  -7, 29, 0, 8, -11, -22, -20, -21, -17, -18,
580  }, {
581  -49, -2, -21, 0, -1, 2, -9, -8, 6, 6,
582  8, 10, 8, -9, 2, 0, 4, 2, 13, 12,
583  23, 15, 12, 16, 26, -21, -2, -21, 11, -23,
584  4, 33, 7, 33, 6, -13, -34, -5, -27, -10,
585  }, {
586  -82, 1, 4, 19, -6, 27, 6, 29, 12, 26,
587  -1, 24, 5, 18, -17, -17, -17, -6, -10, 0,
588  7, 2, 9, 16, 12, -11, 0, -11, 9, -23,
589  0, 3, 8, 8, 13, 1, -8, -7, 7, -6,
590  }, {
591  -60, -10, -7, 1, -9, 8, -6, 13, -2, 15,
592  1, 10, 13, 11, -15, 0, -6, -9, 1, 0,
593  13, -1, 11, 3, 13, -21, -13, -26, 7, -31,
594  10, 7, 16, 33, 31, 10, -22, 8, -1, 2,
595  }, {
596  -3, 7, -5, -5, 8, -2, 17, -9, 18, -24,
597  -2, -19, -10, -4, 28, 17, 5, 28, -2, 7,
598  -4, 15, 7, 8, 6, 23, 13, 21, -14, 20,
599  -17, -18, -11, -33, -30, -11, 23, -13, -5, -9,
600  }, {
601  18, -4, -17, -23, 4, -20, 4, -26, 3, -36,
602  0, -32, -2, -12, 29, 34, 16, 24, 10, 6,
603  0, 12, 8, -4, 8, 13, 0, 6, -16, 12,
604  -5, -13, -3, -7, -13, -3, 8, 2, -14, 0,
605  }, {
606  -13, 0, 8, -3, 0, 4, 21, 11, 9, -16,
607  -10, -18, -5, 16, 10, 16, -5, 15, -13, -5,
608  -15, -1, 6, -4, -6, 23, 2, 16, -17, 12,
609  -10, -44, -3, -33, -6, 12, 34, 1, 20, 3,
610  }, {
611  8, -12, -3, -21, -3, -14, 8, -5, -4, -28,
612  -7, -32, 2, 8, 12, 34, 4, 12, -1, -6,
613  -9, -4, 7, -17, -4, 13, -11, 1, -19, 4,
614  0, -39, 4, -7, 11, 21, 20, 16, 10, 11,
615  }, {
616  4, 6, 0, 7, -8, -4, 0, -6, 9, -13,
617  11, 7, 11, 15, 37, 4, 9, 5, -5, -11,
618  5, 9, 22, 1, 27, 18, 4, 14, -5, 0,
619  -12, 3, -4, -32, -14, -12, 17, -22, -17, -11,
620  }, {
621  26, -6, -11, -10, -12, -23, -12, -23, -5, -24,
622  13, -5, 19, 8, 38, 21, 20, 2, 6, -12,
623  11, 5, 23, -11, 29, 9, -9, 0, -7, -6,
624  -1, 7, 2, -7, 3, -3, 2, -6, -27, -3,
625  }, {
626  -6, -2, 14, 9, -16, 1, 3, 14, 0, -5,
627  3, 8, 16, 36, 19, 3, -1, -6, -17, -24,
628  -4, -7, 21, -11, 14, 18, -7, 9, -9, -7,
629  -6, -22, 3, -33, 10, 11, 28, -7, 7, 0,
630  }, {
631  16, -14, 2, -8, -20, -17, -9, -2, -14, -16,
632  6, -5, 24, 28, 21, 20, 8, -9, -4, -25,
633  1, -11, 22, -24, 15, 8, -21, -5, -11, -14,
634  5, -18, 11, -7, 27, 20, 14, 7, -1, 9,
635  }, {
636  -16, 27, 2, 10, 13, 16, 20, -20, 29, -20,
637  -14, -16, -13, -8, 9, 13, -2, 33, 9, 19,
638  17, 23, 17, 22, 6, 6, -9, -2, -12, -2,
639  -20, -13, -13, -10, -45, -4, 16, -8, -2, -7,
640  }, {
641  5, 15, -9, -7, 9, -2, 8, -37, 14, -31,
642  -11, -29, -5, -16, 11, 30, 7, 29, 21, 18,
643  23, 19, 18, 9, 7, -3, -23, -17, -14, -9,
644  -8, -9, -6, 15, -27, 4, 2, 6, -12, 1,
645  }, {
646  -26, 19, 15, 12, 5, 22, 24, 0, 21, -12,
647  -21, -15, -8, 11, -7, 12, -14, 20, -2, 6,
648  7, 6, 16, 9, -6, 5, -21, -7, -15, -10,
649  -13, -39, -5, -10, -20, 19, 28, 5, 22, 5,
650  }, {
651  -4, 6, 3, -5, 1, 4, 11, -16, 6, -23,
652  -19, -29, 0, 3, -6, 30, -3, 17, 10, 5,
653  13, 2, 17, -3, -5, -3, -35, -21, -17, -17,
654  -2, -35, 2, 15, -3, 28, 13, 21, 13, 13,
655  }, {
656  -8, 25, 8, 23, -3, 13, 3, -17, 20, -8,
657  0, 10, 8, 11, 18, 0, 1, 10, 5, 0,
658  28, 17, 32, 15, 26, 1, -19, -9, -3, -21,
659  -15, 7, -6, -9, -29, -5, 10, -17, -15, -9,
660  }, {
661  13, 13, -3, 5, -7, -4, -9, -34, 5, -20,
662  2, -3, 16, 3, 20, 17, 11, 7, 17, 0,
663  34, 13, 33, 2, 28, -8, -32, -24, -5, -29,
664  -3, 12, 0, 15, -11, 3, -3, -2, -24, -1,
665  }, {
666  -18, 17, 21, 25, -11, 19, 6, 3, 11, 0,
667  -7, 11, 13, 31, 1, 0, -9, -1, -5, -12,
668  18, 0, 31, 2, 13, 1, -30, -14, -7, -29,
669  -9, -18, 1, -10, -4, 18, 22, -3, 10, 2,
670  }, {
671  3, 5, 9, 7, -15, 1, -5, -13, -2, -12,
672  -5, -2, 21, 23, 2, 16, 0, -5, 6, -13,
673  23, -3, 32, -10, 15, -8, -44, -28, -9, -37,
674  2, -13, 9, 15, 12, 27, 7, 12, 0, 11,
675  }, {
676  -44, 6, -30, -8, 9, 10, 11, 14, 23, -5,
677  8, -4, 14, -12, 37, 14, 12, 26, 4, 16,
678  -8, 16, -9, 7, -6, 19, 12, 25, -5, 24,
679  -15, -13, -8, -36, -34, -31, -1, -18, -4, -18,
680  }, {
681  -22, -5, -42, -26, 6, -8, -1, -2, 9, -17,
682  10, -18, 21, -19, 39, 31, 23, 23, 16, 15,
683  -2, 12, -7, -6, -5, 9, -1, 10, -7, 16,
684  -4, -9, 0, -10, -17, -22, -16, -2, -14, -9,
685  }, {
686  -55, -1, -17, -6, 1, 16, 15, 35, 15, 2,
687  0, -4, 19, 8, 20, 13, 1, 14, -7, 3,
688  -18, 0, -10, -5, -19, 19, 0, 21, -8, 16,
689  -9, -39, 0, -36, -10, -7, 9, -4, 20, -5,
690  }, {
691  -33, -13, -29, -24, -1, -1, 2, 18, 0, -9,
692  3, -17, 27, 0, 21, 30, 12, 11, 5, 2,
693  -12, -4, -9, -19, -18, 9, -13, 6, -11, 8,
694  2, -35, 8, -10, 7, 1, -4, 11, 10, 2,
695  }, {
696  -36, 5, -24, 4, -7, 7, -6, 17, 14, 5,
697  22, 22, 35, 8, 46, 1, 17, 3, 0, -2,
698  2, 10, 5, 0, 14, 15, 2, 18, 2, 4,
699  -11, 7, -1, -36, -18, -32, -7, -27, -17, -20,
700  }, {
701  -14, -7, -36, -13, -10, -10, -18, 0, 0, -5,
702  25, 8, 43, 0, 48, 18, 27, 0, 12, -3,
703  7, 6, 7, -13, 15, 5, -11, 3, 0, -2,
704  0, 12, 6, -10, 0, -23, -22, -11, -26, -12,
705  }, {
706  -47, -3, -11, 6, -15, 13, -2, 38, 6, 13,
707  15, 22, 40, 28, 28, 0, 5, -8, -10, -15,
708  -7, -7, 4, -13, 1, 14, -9, 14, 0, -2,
709  -4, -18, 7, -36, 6, -8, 3, -13, 7, -8,
710  }, {
711  -25, -15, -22, -11, -18, -4, -15, 22, -8, 2,
712  17, 9, 48, 20, 30, 17, 16, -11, 1, -16,
713  -2, -10, 5, -26, 2, 4, -22, 0, -2, -10,
714  6, -13, 14, -10, 23, 0, -10, 2, -1, 0,
715  }, {
716  -57, 26, -22, 7, 14, 28, 14, 3, 35, 0,
717  -3, -1, 11, -16, 18, 10, 4, 31, 15, 28,
718  14, 23, 1, 21, -7, 2, -11, 1, -3, 1,
719  -18, -9, -10, -13, -49, -24, -8, -14, -2, -16,
720  }, {
721  -35, 14, -34, -10, 10, 10, 1, -12, 20, -12,
722  0, -15, 18, -24, 20, 27, 14, 28, 27, 27,
723  20, 19, 2, 8, -5, -7, -25, -13, -5, -5,
724  -6, -5, -2, 12, -31, -15, -23, 1, -12, -8,
725  }, {
726  -68, 18, -9, 9, 6, 35, 18, 25, 26, 7,
727  -10, -1, 16, 3, 1, 9, -6, 19, 4, 15,
728  4, 6, 0, 8, -20, 2, -23, -2, -7, -5,
729  -12, -35, -1, -13, -24, 0, 3, 0, 22, -4,
730  }, {
731  -46, 6, -21, -8, 2, 16, 5, 8, 11, -4,
732  -8, -15, 24, -4, 2, 26, 3, 16, 16, 14,
733  9, 2, 1, -4, -19, -7, -36, -17, -9, -13,
734  0, -31, 5, 12, -7, 8, -11, 15, 13, 4,
735  }, {
736  -49, 24, -16, 20, -2, 26, -2, 7, 25, 10,
737  11, 25, 32, 3, 27, -2, 8, 8, 11, 9,
738  24, 17, 16, 14, 13, -2, -20, -5, 4, -17,
739  -14, 12, -3, -13, -33, -25, -14, -23, -15, -19,
740  }, {
741  -27, 12, -28, 2, -6, 7, -15, -9, 11, -1,
742  13, 11, 40, -4, 29, 14, 19, 5, 23, 8,
743  30, 13, 17, 0, 14, -12, -34, -20, 2, -25,
744  -2, 16, 4, 12, -15, -16, -29, -7, -24, -10,
745  }, {
746  -60, 16, -3, 22, -10, 32, 0, 28, 17, 18,
747  3, 25, 37, 23, 10, -3, -2, -3, 0, -3,
748  14, 0, 14, 1, 0, -2, -32, -9, 1, -25,
749  -7, -13, 5, -13, -8, -1, -2, -8, 10, -6,
750  }, {
751  -38, 4, -15, 4, -14, 13, -12, 11, 2, 6,
752  6, 11, 45, 16, 11, 13, 7, -6, 12, -4,
753  20, -3, 16, -12, 1, -12, -46, -24, 0, -33,
754  3, -9, 12, 12, 8, 7, -17, 6, 0, 2
755  }
756 };
757 
758 const int8_t ff_cb2_vects[128][40]={
759  {
760  73, -32, -60, -15, -26, 59, 2, -33, 30, -10,
761  -3, -17, 8, 30, -1, -26, -4, -22, 10, 16,
762  -36, -5, -11, 56, 37, 6, -10, -5, -13, -3,
763  6, -5, 11, 4, -19, -5, -16, 41, 24, 13,
764  }, {
765  4, -11, -37, 23, -5, 46, -2, -29, -5, -39,
766  -21, -9, 0, 49, 12, -9, -16, -26, 22, 15,
767  -45, -20, -5, 40, 22, 17, -26, 31, -14, 2,
768  -14, 10, 30, 20, -27, -9, -39, 39, 18, 5,
769  }, {
770  34, -25, -48, -28, -11, 34, -2, -41, 9, -7,
771  -17, 21, 20, 24, -17, -33, 0, -24, 10, 42,
772  3, -5, 10, 42, 11, 8, -3, 3, 16, 9,
773  22, -2, 0, -33, -10, 18, 7, 58, 10, 28,
774  }, {
775  -34, -4, -25, 10, 9, 21, -7, -36, -26, -36,
776  -35, 28, 12, 42, -3, -16, -12, -28, 21, 42,
777  -5, -21, 16, 26, -4, 19, -19, 39, 15, 15,
778  1, 13, 19, -17, -17, 14, -15, 55, 4, 19,
779  }, {
780  28, -20, -51, -14, -6, 7, 0, -26, 27, -4,
781  18, -40, -6, 16, -1, -15, 0, -55, -5, -16,
782  -19, 14, -3, 49, 14, 1, -22, -30, -12, 0,
783  24, 15, 9, -17, -45, -29, 4, 28, 51, 35,
784  }, {
785  -40, 0, -28, 24, 14, -5, -4, -21, -7, -33,
786  0, -32, -15, 35, 12, 1, -11, -58, 5, -16,
787  -28, 0, 1, 33, 0, 11, -39, 5, -14, 6,
788  3, 31, 28, -1, -53, -33, -19, 25, 46, 26,
789  }, {
790  -11, -14, -39, -27, 9, -17, -4, -33, 6, 0,
791  4, -1, 5, 10, -17, -22, 5, -57, -5, 9,
792  20, 13, 18, 35, -11, 3, -16, -22, 17, 13,
793  40, 19, -1, -55, -35, -5, 27, 44, 37, 49,
794  }, {
795  -80, 6, -16, 11, 30, -30, -9, -28, -28, -29,
796  -13, 6, -2, 28, -3, -5, -7, -60, 5, 9,
797  11, -1, 24, 19, -27, 13, -32, 13, 15, 19,
798  19, 35, 17, -39, -43, -9, 4, 42, 32, 41,
799  }, {
800  78, -21, -43, 4, -38, 17, 17, -5, 55, 24,
801  -15, -36, 14, 4, 24, -24, 12, 5, 17, 31,
802  -54, -5, -2, 27, 43, -12, 2, 9, -9, -15,
803  22, -3, 28, 21, -20, 3, 20, 28, 9, -5,
804  }, {
805  9, -1, -20, 43, -17, 3, 12, 0, 20, -4,
806  -33, -29, 6, 22, 38, -7, 0, 1, 29, 30,
807  -63, -21, 3, 11, 27, -1, -14, 45, -10, -9,
808  1, 12, 47, 37, -28, 0, -2, 26, 4, -13,
809  }, {
810  39, -14, -30, -8, -22, -8, 12, -12, 34, 27,
811  -29, 2, 26, -2, 8, -31, 16, 3, 17, 57,
812  -14, -6, 19, 13, 16, -10, 8, 17, 20, -2,
813  38, 0, 17, -16, -11, 27, 44, 45, -4, 8,
814  }, {
815  -29, 5, -7, 30, -1, -21, 7, -7, 0, 0,
816  -47, 9, 18, 15, 22, -14, 4, 0, 28, 57,
817  -23, -21, 25, -2, 1, 0, -7, 53, 19, 3,
818  17, 15, 36, 0, -19, 24, 21, 43, -9, 0,
819  }, {
820  33, -10, -34, 5, -17, -35, 15, 1, 53, 30,
821  6, -59, 0, -10, 24, -13, 17, -27, 1, -1,
822  -37, 13, 4, 20, 20, -18, -10, -16, -8, -11,
823  39, 18, 26, 0, -46, -20, 41, 15, 37, 15,
824  }, {
825  -35, 10, -11, 44, 3, -48, 10, 6, 17, 2,
826  -11, -51, -8, 8, 38, 3, 4, -31, 12, -2,
827  -46, -1, 10, 4, 5, -7, -26, 19, -10, -5,
828  18, 34, 45, 15, -54, -24, 18, 13, 31, 7,
829  }, {
830  -5, -3, -21, -7, -2, -60, 10, -5, 32, 34,
831  -7, -20, 11, -16, 8, -20, 21, -29, 1, 24,
832  2, 13, 27, 6, -5, -15, -3, -8, 21, 1,
833  55, 21, 15, -38, -37, 3, 65, 32, 23, 30,
834  }, {
835  -74, 17, 0, 31, 18, -73, 5, 0, -3, 5,
836  -25, -12, 3, 1, 22, -3, 9, -33, 12, 24,
837  -6, -2, 33, -9, -21, -5, -20, 27, 19, 7,
838  34, 37, 34, -22, -44, 0, 41, 29, 17, 21,
839  }, {
840  76, -35, -31, -28, -49, 43, -40, 0, 29, -14,
841  8, 5, 10, 18, -26, -46, 0, 7, 6, 3,
842  -25, -7, -2, 40, 28, 14, 18, -3, -27, -28,
843  -8, -45, -13, 34, -13, -27, -15, 31, 12, 3,
844  }, {
845  7, -15, -9, 9, -28, 29, -45, 5, -6, -43,
846  -9, 12, 2, 36, -12, -30, -11, 3, 17, 3,
847  -34, -22, 3, 24, 12, 24, 2, 32, -28, -22,
848  -29, -29, 5, 50, -21, -31, -38, 29, 7, -5,
849  }, {
850  36, -29, -19, -41, -34, 18, -45, -6, 8, -10,
851  -5, 43, 23, 11, -42, -53, 5, 5, 6, 30,
852  14, -8, 20, 26, 1, 16, 25, 4, 3, -15,
853  7, -41, -23, -3, -4, -3, 8, 48, -1, 17,
854  }, {
855  -32, -8, 3, -2, -13, 4, -50, -1, -27, -39,
856  -23, 51, 15, 30, -27, -37, -7, 1, 17, 29,
857  5, -23, 25, 10, -14, 26, 8, 41, 1, -9,
858  -13, -26, -5, 12, -12, -7, -14, 45, -6, 9,
859  }, {
860  31, -24, -23, -27, -29, -9, -43, 8, 26, -7,
861  30, -17, -4, 3, -26, -35, 5, -24, -10, -28,
862  -9, 12, 5, 33, 5, 8, 5, -29, -26, -24,
863  9, -23, -14, 12, -39, -52, 5, 18, 39, 24,
864  }, {
865  -37, -3, 0, 10, -7, -22, -48, 12, -8, -36,
866  12, -9, -12, 22, -12, -19, -6, -28, 0, -29,
867  -18, -3, 11, 17, -10, 18, -10, 7, -27, -18,
868  -11, -7, 3, 28, -47, -55, -18, 15, 34, 16,
869  }, {
870  -8, -17, -10, -40, -13, -34, -47, 0, 5, -4,
871  16, 21, 8, -2, -42, -43, 10, -26, -10, -2,
872  31, 11, 27, 19, -21, 10, 12, -20, 3, -11,
873  25, -20, -25, -25, -29, -28, 28, 34, 25, 38,
874  }, {
875  -77, 2, 11, -1, 7, -47, -52, 5, -29, -33,
876  -1, 28, 0, 15, -28, -26, -2, -30, 0, -2,
877  22, -4, 33, 3, -36, 21, -3, 15, 2, -5,
878  4, -4, -6, -9, -37, -31, 5, 32, 20, 30,
879  }, {
880  81, -25, -14, -8, -61, 0, -25, 28, 54, 20,
881  -3, -14, 17, -8, 0, -44, 16, 35, 13, 18,
882  -43, -7, 6, 11, 33, -4, 30, 11, -22, -40,
883  6, -43, 3, 50, -14, -18, 22, 18, -1, -16,
884  }, {
885  12, -4, 8, 29, -39, -12, -30, 33, 19, -8,
886  -21, -6, 8, 9, 13, -28, 4, 31, 24, 18,
887  -52, -23, 12, -4, 18, 5, 14, 47, -24, -34,
888  -14, -27, 22, 66, -22, -22, -1, 16, -6, -24,
889  }, {
890  41, -18, -2, -21, -45, -24, -30, 21, 33, 24,
891  -17, 24, 29, -15, -16, -51, 21, 33, 13, 45,
892  -3, -8, 28, -2, 7, -2, 37, 19, 7, -27,
893  22, -39, -7, 12, -5, 5, 45, 35, -15, -1,
894  }, {
895  -27, 1, 20, 17, -24, -38, -35, 26, -1, -4,
896  -35, 32, 21, 3, -2, -35, 8, 29, 24, 44,
897  -12, -24, 34, -18, -8, 7, 21, 55, 5, -21,
898  2, -23, 11, 28, -13, 1, 22, 33, -21, -10,
899  }, {
900  36, -13, -5, -7, -40, -51, -28, 36, 52, 27,
901  18, -36, 2, -22, 0, -33, 21, 2, -3, -13,
902  -26, 11, 14, 4, 10, -10, 18, -14, -22, -36,
903  24, -21, 1, 28, -40, -42, 42, 5, 25, 5,
904  }, {
905  -32, 6, 17, 31, -19, -65, -33, 41, 16, -1,
906  0, -29, -6, -4, 13, -17, 9, -1, 8, -14,
907  -35, -3, 19, -11, -4, 0, 1, 21, -23, -30,
908  3, -5, 20, 44, -48, -46, 19, 3, 20, -3,
909  }, {
910  -3, -7, 6, -20, -25, -77, -32, 29, 31, 30,
911  4, 2, 14, -29, -16, -40, 26, 0, -3, 12,
912  13, 10, 36, -9, -15, -8, 24, -6, 7, -22,
913  40, -17, -8, -9, -31, -18, 66, 22, 11, 19,
914  }, {
915  -72, 13, 29, 18, -4, -90, -37, 34, -4, 1,
916  -13, 9, 6, -11, -2, -24, 13, -3, 7, 11,
917  4, -4, 42, -25, -31, 1, 8, 29, 6, -17,
918  19, -2, 10, 6, -38, -22, 42, 19, 6, 11,
919  }, {
920  116, -20, -68, -30, -28, 83, 28, -18, 32, -22,
921  -13, -21, 5, 28, 5, -7, -24, -8, -22, 17,
922  -23, 30, -25, 45, 15, -9, -11, -18, 22, -10,
923  4, -2, 19, -12, 23, 3, -43, 2, 12, -4,
924  }, {
925  47, 0, -45, 7, -7, 69, 23, -13, -2, -51,
926  -32, -14, -3, 47, 19, 8, -37, -11, -10, 16,
927  -32, 15, -19, 29, 0, 1, -28, 18, 20, -4,
928  -16, 13, 38, 3, 15, 0, -66, 0, 7, -13,
929  }, {
930  77, -13, -56, -43, -13, 57, 23, -26, 11, -19,
931  -27, 16, 17, 22, -10, -15, -19, -10, -22, 43,
932  16, 30, -2, 31, -11, -6, -5, -9, 52, 2,
933  20, 0, 8, -50, 33, 27, -19, 19, -1, 9,
934  }, {
935  8, 6, -33, -4, 7, 44, 18, -21, -23, -48,
936  -46, 24, 9, 40, 3, 1, -32, -13, -11, 43,
937  7, 14, 3, 15, -26, 3, -21, 26, 50, 8,
938  0, 16, 27, -34, 25, 23, -43, 17, -6, 1,
939  }, {
940  71, -9, -59, -29, -8, 30, 26, -11, 30, -16,
941  8, -44, -9, 14, 5, 2, -19, -40, -38, -15,
942  -7, 50, -17, 38, -7, -14, -24, -43, 22, -6,
943  22, 19, 17, -34, -2, -20, -23, -10, 39, 16,
944  }, {
945  2, 11, -36, 9, 13, 17, 21, -6, -5, -45,
946  -10, -36, -18, 33, 19, 19, -31, -44, -27, -15,
947  -16, 34, -11, 22, -22, -4, -40, -7, 21, 0,
948  1, 35, 36, -18, -10, -24, -46, -12, 34, 8,
949  }, {
950  32, -2, -47, -42, 7, 5, 21, -18, 9, -12,
951  -5, -5, 2, 8, -10, -4, -14, -42, -38, 10,
952  33, 49, 5, 24, -33, -12, -17, -35, 52, 6,
953  38, 22, 7, -72, 7, 3, 0, 6, 25, 30,
954  }, {
955  -36, 18, -24, -3, 28, -7, 16, -13, -26, -41,
956  -24, 1, -5, 26, 3, 12, -27, -46, -27, 10,
957  24, 34, 10, 8, -49, -2, -34, 0, 51, 12,
958  17, 38, 25, -56, 0, 0, -22, 3, 20, 22,
959  }, {
960  121, -9, -50, -10, -40, 40, 43, 9, 58, 12,
961  -25, -41, 11, 2, 31, -5, -8, 19, -15, 32,
962  -41, 30, -16, 16, 20, -28, 0, -3, 26, -22,
963  19, 0, 36, 4, 22, 12, -6, -9, -1, -24,
964  }, {
965  52, 10, -27, 27, -18, 26, 38, 14, 23, -16,
966  -44, -33, 3, 20, 45, 10, -20, 15, -3, 31,
967  -50, 14, -10, 0, 5, -17, -15, 32, 24, -16,
968  -1, 15, 55, 20, 14, 8, -29, -12, -7, -32,
969  }, {
970  82, -3, -38, -23, -24, 15, 38, 2, 37, 15,
971  -39, -2, 23, -4, 15, -12, -3, 17, -15, 58,
972  -1, 29, 6, 2, -5, -26, 7, 4, 56, -9,
973  35, 3, 25, -33, 32, 36, 17, 7, -15, -9,
974  }, {
975  13, 17, -15, 15, -3, 1, 33, 7, 1, -12,
976  -58, 5, 15, 13, 29, 3, -16, 13, -4, 57,
977  -10, 13, 11, -13, -21, -15, -9, 40, 55, -3,
978  14, 19, 44, -17, 24, 32, -5, 4, -21, -18,
979  }, {
980  76, 1, -41, -9, -19, -12, 41, 17, 55, 18,
981  -3, -63, -3, -12, 30, 5, -3, -12, -31, 0,
982  -24, 49, -8, 9, -1, -33, -12, -29, 27, -18,
983  37, 21, 34, -17, -3, -11, 14, -23, 25, -2,
984  }, {
985  7, 22, -18, 29, 1, -25, 36, 21, 20, -9,
986  -22, -56, -11, 6, 45, 21, -15, -16, -20, -1,
987  -33, 34, -2, -6, -17, -23, -28, 6, 25, -12,
988  16, 37, 53, -1, -11, -15, -8, -25, 20, -11,
989  }, {
990  37, 8, -29, -22, -4, -37, 36, 9, 34, 22,
991  -17, -24, 8, -18, 15, -2, 1, -14, -31, 25,
992  15, 48, 13, -4, -28, -31, -5, -21, 57, -4,
993  53, 24, 23, -55, 6, 12, 37, -6, 11, 11,
994  }, {
995  -31, 28, -6, 16, 16, -50, 31, 14, 0, -6,
996  -36, -17, 0, 0, 29, 14, -11, -18, -20, 25,
997  6, 33, 19, -20, -43, -21, -21, 14, 55, 0,
998  32, 40, 42, -39, -1, 8, 14, -8, 6, 3,
999  }, {
1000  119, -24, -39, -44, -51, 66, -14, 15, 31, -26,
1001  -1, 0, 7, 16, -19, -28, -19, 22, -26, 4,
1002  -13, 28, -16, 29, 5, -1, 16, -16, 8, -35,
1003  -10, -42, -4, 17, 29, -19, -42, -7, 0, -15,
1004  }, {
1005  50, -3, -16, -5, -30, 53, -19, 20, -3, -55,
1006  -19, 8, 0, 34, -5, -11, -32, 18, -15, 4,
1007  -22, 13, -10, 13, -9, 8, 0, 19, 7, -29,
1008  -31, -26, 13, 33, 21, -22, -65, -9, -4, -23,
1009  }, {
1010  79, -17, -27, -56, -36, 41, -19, 8, 10, -22,
1011  -15, 39, 20, 9, -35, -35, -15, 20, -26, 31,
1012  26, 27, 6, 15, -20, 0, 23, -8, 38, -22,
1013  5, -38, -15, -20, 39, 4, -18, 9, -13, -1,
1014  }, {
1015  10, 3, -4, -18, -15, 27, -24, 13, -24, -51,
1016  -34, 47, 12, 28, -21, -19, -27, 16, -15, 30,
1017  17, 12, 12, 0, -36, 10, 7, 27, 37, -16,
1018  -15, -22, 3, -4, 31, 1, -42, 7, -18, -9,
1019  }, {
1020  74, -12, -30, -42, -30, 14, -16, 23, 29, -19,
1021  20, -21, -7, 1, -19, -17, -14, -10, -43, -27,
1022  3, 48, -8, 22, -16, -7, 4, -42, 9, -31,
1023  6, -20, -6, -4, 3, -43, -22, -20, 28, 5,
1024  }, {
1025  5, 7, -7, -4, -9, 0, -21, 28, -6, -48,
1026  2, -14, -15, 20, -5, 0, -27, -14, -32, -28,
1027  -5, 32, -2, 6, -32, 3, -12, -5, 8, -25,
1028  -14, -4, 12, 11, -4, -47, -45, -22, 22, -2,
1029  }, {
1030  34, -6, -18, -55, -15, -11, -21, 16, 8, -16,
1031  6, 16, 5, -4, -35, -24, -10, -12, -43, -1,
1032  43, 47, 14, 8, -43, -5, 10, -34, 39, -18,
1033  22, -16, -17, -42, 13, -19, 1, -3, 14, 20,
1034  }, {
1035  -34, 14, 4, -17, 5, -24, -26, 20, -27, -45,
1036  -12, 24, -2, 13, -21, -8, -22, -16, -32, -2,
1037  34, 31, 20, -7, -58, 5, -5, 2, 38, -12,
1038  2, -1, 1, -26, 5, -23, -21, -6, 8, 11,
1039  }, {
1040  124, -13, -21, -23, -62, 23, 0, 43, 57, 8,
1041  -13, -18, 14, -10, 6, -26, -3, 49, -19, 19,
1042  -31, 27, -7, 0, 11, -20, 29, -1, 12, -47,
1043  4, -39, 11, 34, 28, -9, -5, -19, -13, -34,
1044  }, {
1045  55, 6, 1, 14, -41, 10, -4, 48, 22, -20,
1046  -31, -10, 5, 7, 20, -9, -16, 45, -8, 19,
1047  -40, 12, -1, -15, -4, -10, 12, 34, 11, -41,
1048  -16, -24, 30, 49, 20, -13, -28, -22, -18, -43,
1049  }, {
1050  84, -6, -9, -36, -47, -1, -4, 36, 36, 12,
1051  -27, 20, 26, -17, -9, -33, 1, 47, -19, 46,
1052  9, 27, 15, -13, -15, -18, 35, 6, 42, -33,
1053  20, -36, 1, -4, 38, 14, 18, -2, -27, -20,
1054  }, {
1055  15, 13, 13, 1, -26, -14, -9, 41, 1, -16,
1056  -46, 27, 18, 1, 4, -16, -11, 43, -8, 45,
1057  0, 11, 21, -29, -30, -8, 19, 42, 41, -28,
1058  0, -20, 20, 11, 30, 10, -4, -5, -32, -28,
1059  }, {
1060  79, -2, -12, -22, -42, -28, -1, 51, 54, 15,
1061  8, -41, 0, -24, 6, -15, 1, 17, -36, -12,
1062  -14, 47, 0, -6, -11, -26, 16, -27, 13, -43,
1063  22, -18, 10, 12, 2, -34, 15, -33, 13, -13,
1064  }, {
1065  10, 18, 10, 15, -21, -41, -6, 56, 19, -13,
1066  -9, -33, -9, -6, 20, 1, -11, 13, -24, -13,
1067  -23, 32, 6, -22, -26, -15, 0, 8, 12, -37,
1068  1, -2, 28, 27, -5, -37, -7, -35, 8, -21,
1069  }, {
1070  39, 4, 0, -35, -27, -53, -6, 44, 33, 18,
1071  -5, -2, 11, -31, -9, -22, 6, 15, -36, 13,
1072  25, 46, 23, -20, -37, -24, 23, -19, 43, -29,
1073  38, -14, 0, -26, 12, -10, 38, -16, 0, 0,
1074  }, {
1075  -29, 25, 22, 2, -6, -67, -11, 49, -1, -10,
1076  -24, 5, 3, -13, 4, -5, -6, 11, -25, 12,
1077  16, 31, 28, -36, -53, -13, 6, 16, 42, -24,
1078  17, 1, 18, -10, 4, -13, 15, -18, -5, -7,
1079  }, {
1080  29, -25, -22, -2, 6, 67, 11, -49, 1, 10,
1081  24, -5, -3, 13, -4, 5, 6, -11, 25, -12,
1082  -16, -31, -28, 36, 53, 13, -6, -16, -42, 24,
1083  -17, -1, -18, 10, -4, 13, -15, 18, 5, 7,
1084  }, {
1085  -39, -4, 0, 35, 27, 53, 6, -44, -33, -18,
1086  5, 2, -11, 31, 9, 22, -6, -15, 36, -13,
1087  -25, -46, -23, 20, 37, 24, -23, 19, -43, 29,
1088  -38, 14, 0, 26, -12, 10, -38, 16, 0, 0,
1089  }, {
1090  -10, -18, -10, -15, 21, 41, 6, -56, -19, 13,
1091  9, 33, 9, 6, -20, -1, 11, -13, 24, 13,
1092  23, -32, -6, 22, 26, 15, 0, -8, -12, 37,
1093  -1, 2, -28, -27, 5, 37, 7, 35, -8, 21,
1094  }, {
1095  -79, 2, 12, 22, 42, 28, 1, -51, -54, -15,
1096  -8, 41, 0, 24, -6, 15, -1, -17, 36, 12,
1097  14, -47, 0, 6, 11, 26, -16, 27, -13, 43,
1098  -22, 18, -10, -12, -2, 34, -15, 33, -13, 13,
1099  }, {
1100  -15, -13, -13, -1, 26, 14, 9, -41, -1, 16,
1101  46, -27, -18, -1, -4, 16, 11, -43, 8, -45,
1102  0, -11, -21, 29, 30, 8, -19, -42, -41, 28,
1103  0, 20, -20, -11, -30, -10, 4, 5, 32, 28,
1104  }, {
1105  -84, 6, 9, 36, 47, 1, 4, -36, -36, -12,
1106  27, -20, -26, 17, 9, 33, -1, -47, 19, -46,
1107  -9, -27, -15, 13, 15, 18, -35, -6, -42, 33,
1108  -20, 36, -1, 4, -38, -14, -18, 2, 27, 20,
1109  }, {
1110  -55, -6, -1, -14, 41, -10, 4, -48, -22, 20,
1111  31, 10, -5, -7, -20, 9, 16, -45, 8, -19,
1112  40, -12, 1, 15, 4, 10, -12, -34, -11, 41,
1113  16, 24, -30, -49, -20, 13, 28, 22, 18, 43,
1114  }, {
1115  -124, 13, 21, 23, 62, -23, 0, -43, -57, -8,
1116  13, 18, -14, 10, -6, 26, 3, -49, 19, -19,
1117  31, -27, 7, 0, -11, 20, -29, 1, -12, 47,
1118  -4, 39, -11, -34, -28, 9, 5, 19, 13, 34,
1119  }, {
1120  34, -14, -4, 17, -5, 24, 26, -20, 27, 45,
1121  12, -24, 2, -13, 21, 8, 22, 16, 32, 2,
1122  -34, -31, -20, 7, 58, -5, 5, -2, -38, 12,
1123  -2, 1, -1, 26, -5, 23, 21, 6, -8, -11,
1124  }, {
1125  -34, 6, 18, 55, 15, 11, 21, -16, -8, 16,
1126  -6, -16, -5, 4, 35, 24, 10, 12, 43, 1,
1127  -43, -47, -14, -8, 43, 5, -10, 34, -39, 18,
1128  -22, 16, 17, 42, -13, 19, -1, 3, -14, -20,
1129  }, {
1130  -5, -7, 7, 4, 9, 0, 21, -28, 6, 48,
1131  -2, 14, 15, -20, 5, 0, 27, 14, 32, 28,
1132  5, -32, 2, -6, 32, -3, 12, 5, -8, 25,
1133  14, 4, -12, -11, 4, 47, 45, 22, -22, 2,
1134  }, {
1135  -74, 12, 30, 42, 30, -14, 16, -23, -29, 19,
1136  -20, 21, 7, -1, 19, 17, 14, 10, 43, 27,
1137  -3, -48, 8, -22, 16, 7, -4, 42, -9, 31,
1138  -6, 20, 6, 4, -3, 43, 22, 20, -28, -5,
1139  }, {
1140  -10, -3, 4, 18, 15, -27, 24, -13, 24, 51,
1141  34, -47, -12, -28, 21, 19, 27, -16, 15, -30,
1142  -17, -12, -12, 0, 36, -10, -7, -27, -37, 16,
1143  15, 22, -3, 4, -31, -1, 42, -7, 18, 9,
1144  }, {
1145  -79, 17, 27, 56, 36, -41, 19, -8, -10, 22,
1146  15, -39, -20, -9, 35, 35, 15, -20, 26, -31,
1147  -26, -27, -6, -15, 20, 0, -23, 8, -38, 22,
1148  -5, 38, 15, 20, -39, -4, 18, -9, 13, 1,
1149  }, {
1150  -50, 3, 16, 5, 30, -53, 19, -20, 3, 55,
1151  19, -8, 0, -34, 5, 11, 32, -18, 15, -4,
1152  22, -13, 10, -13, 9, -8, 0, -19, -7, 29,
1153  31, 26, -13, -33, -21, 22, 65, 9, 4, 23,
1154  }, {
1155  -119, 24, 39, 44, 51, -66, 14, -15, -31, 26,
1156  1, 0, -7, -16, 19, 28, 19, -22, 26, -4,
1157  13, -28, 16, -29, -5, 1, -16, 16, -8, 35,
1158  10, 42, 4, -17, -29, 19, 42, 7, 0, 15,
1159  }, {
1160  31, -28, 6, -16, -16, 50, -31, -14, 0, 6,
1161  36, 17, 0, 0, -29, -14, 11, 18, 20, -25,
1162  -6, -33, -19, 20, 43, 21, 21, -14, -55, 0,
1163  -32, -40, -42, 39, 1, -8, -14, 8, -6, -3,
1164  }, {
1165  -37, -8, 29, 22, 4, 37, -36, -9, -34, -22,
1166  17, 24, -8, 18, -15, 2, -1, 14, 31, -25,
1167  -15, -48, -13, 4, 28, 31, 5, 21, -57, 4,
1168  -53, -24, -23, 55, -6, -12, -37, 6, -11, -11,
1169  }, {
1170  -7, -22, 18, -29, -1, 25, -36, -21, -20, 9,
1171  22, 56, 11, -6, -45, -21, 15, 16, 20, 1,
1172  33, -34, 2, 6, 17, 23, 28, -6, -25, 12,
1173  -16, -37, -53, 1, 11, 15, 8, 25, -20, 11,
1174  }, {
1175  -76, -1, 41, 9, 19, 12, -41, -17, -55, -18,
1176  3, 63, 3, 12, -30, -5, 3, 12, 31, 0,
1177  24, -49, 8, -9, 1, 33, 12, 29, -27, 18,
1178  -37, -21, -34, 17, 3, 11, -14, 23, -25, 2,
1179  }, {
1180  -13, -17, 15, -15, 3, -1, -33, -7, -1, 12,
1181  58, -5, -15, -13, -29, -3, 16, -13, 4, -57,
1182  10, -13, -11, 13, 21, 15, 9, -40, -55, 3,
1183  -14, -19, -44, 17, -24, -32, 5, -4, 21, 18,
1184  }, {
1185  -82, 3, 38, 23, 24, -15, -38, -2, -37, -15,
1186  39, 2, -23, 4, -15, 12, 3, -17, 15, -58,
1187  1, -29, -6, -2, 5, 26, -7, -4, -56, 9,
1188  -35, -3, -25, 33, -32, -36, -17, -7, 15, 9,
1189  }, {
1190  -52, -10, 27, -27, 18, -26, -38, -14, -23, 16,
1191  44, 33, -3, -20, -45, -10, 20, -15, 3, -31,
1192  50, -14, 10, 0, -5, 17, 15, -32, -24, 16,
1193  1, -15, -55, -20, -14, -8, 29, 12, 7, 32,
1194  }, {
1195  -121, 9, 50, 10, 40, -40, -43, -9, -58, -12,
1196  25, 41, -11, -2, -31, 5, 8, -19, 15, -32,
1197  41, -30, 16, -16, -20, 28, 0, 3, -26, 22,
1198  -19, 0, -36, -4, -22, -12, 6, 9, 1, 24,
1199  }, {
1200  36, -18, 24, 3, -28, 7, -16, 13, 26, 41,
1201  24, -1, 5, -26, -3, -12, 27, 46, 27, -10,
1202  -24, -34, -10, -8, 49, 2, 34, 0, -51, -12,
1203  -17, -38, -25, 56, 0, 0, 22, -3, -20, -22,
1204  }, {
1205  -32, 2, 47, 42, -7, -5, -21, 18, -9, 12,
1206  5, 5, -2, -8, 10, 4, 14, 42, 38, -10,
1207  -33, -49, -5, -24, 33, 12, 17, 35, -52, -6,
1208  -38, -22, -7, 72, -7, -3, 0, -6, -25, -30,
1209  }, {
1210  -2, -11, 36, -9, -13, -17, -21, 6, 5, 45,
1211  10, 36, 18, -33, -19, -19, 31, 44, 27, 15,
1212  16, -34, 11, -22, 22, 4, 40, 7, -21, 0,
1213  -1, -35, -36, 18, 10, 24, 46, 12, -34, -8,
1214  }, {
1215  -71, 9, 59, 29, 8, -30, -26, 11, -30, 16,
1216  -8, 44, 9, -14, -5, -2, 19, 40, 38, 15,
1217  7, -50, 17, -38, 7, 14, 24, 43, -22, 6,
1218  -22, -19, -17, 34, 2, 20, 23, 10, -39, -16,
1219  }, {
1220  -8, -6, 33, 4, -7, -44, -18, 21, 23, 48,
1221  46, -24, -9, -40, -3, -1, 32, 13, 11, -43,
1222  -7, -14, -3, -15, 26, -3, 21, -26, -50, -8,
1223  0, -16, -27, 34, -25, -23, 43, -17, 6, -1,
1224  }, {
1225  -77, 13, 56, 43, 13, -57, -23, 26, -11, 19,
1226  27, -16, -17, -22, 10, 15, 19, 10, 22, -43,
1227  -16, -30, 2, -31, 11, 6, 5, 9, -52, -2,
1228  -20, 0, -8, 50, -33, -27, 19, -19, 1, -9,
1229  }, {
1230  -47, 0, 45, -7, 7, -69, -23, 13, 2, 51,
1231  32, 14, 3, -47, -19, -8, 37, 11, 10, -16,
1232  32, -15, 19, -29, 0, -1, 28, -18, -20, 4,
1233  16, -13, -38, -3, -15, 0, 66, 0, -7, 13,
1234  }, {
1235  -116, 20, 68, 30, 28, -83, -28, 18, -32, 22,
1236  13, 21, -5, -28, -5, 7, 24, 8, 22, -17,
1237  23, -30, 25, -45, -15, 9, 11, 18, -22, 10,
1238  -4, 2, -19, 12, -23, -3, 43, -2, -12, 4,
1239  }, {
1240  72, -13, -29, -18, 4, 90, 37, -34, 4, -1,
1241  13, -9, -6, 11, 2, 24, -13, 3, -7, -11,
1242  -4, 4, -42, 25, 31, -1, -8, -29, -6, 17,
1243  -19, 2, -10, -6, 38, 22, -42, -19, -6, -11,
1244  }, {
1245  3, 7, -6, 20, 25, 77, 32, -29, -31, -30,
1246  -4, -2, -14, 29, 16, 40, -26, 0, 3, -12,
1247  -13, -10, -36, 9, 15, 8, -24, 6, -7, 22,
1248  -40, 17, 8, 9, 31, 18, -66, -22, -11, -19,
1249  }, {
1250  32, -6, -17, -31, 19, 65, 33, -41, -16, 1,
1251  0, 29, 6, 4, -13, 17, -9, 1, -8, 14,
1252  35, 3, -19, 11, 4, 0, -1, -21, 23, 30,
1253  -3, 5, -20, -44, 48, 46, -19, -3, -20, 3,
1254  }, {
1255  -36, 13, 5, 7, 40, 51, 28, -36, -52, -27,
1256  -18, 36, -2, 22, 0, 33, -21, -2, 3, 13,
1257  26, -11, -14, -4, -10, 10, -18, 14, 22, 36,
1258  -24, 21, -1, -28, 40, 42, -42, -5, -25, -5,
1259  }, {
1260  27, -1, -20, -17, 24, 38, 35, -26, 1, 4,
1261  35, -32, -21, -3, 2, 35, -8, -29, -24, -44,
1262  12, 24, -34, 18, 8, -7, -21, -55, -5, 21,
1263  -2, 23, -11, -28, 13, -1, -22, -33, 21, 10,
1264  }, {
1265  -41, 18, 2, 21, 45, 24, 30, -21, -33, -24,
1266  17, -24, -29, 15, 16, 51, -21, -33, -13, -45,
1267  3, 8, -28, 2, -7, 2, -37, -19, -7, 27,
1268  -22, 39, 7, -12, 5, -5, -45, -35, 15, 1,
1269  }, {
1270  -12, 4, -8, -29, 39, 12, 30, -33, -19, 8,
1271  21, 6, -8, -9, -13, 28, -4, -31, -24, -18,
1272  52, 23, -12, 4, -18, -5, -14, -47, 24, 34,
1273  14, 27, -22, -66, 22, 22, 1, -16, 6, 24,
1274  }, {
1275  -81, 25, 14, 8, 61, 0, 25, -28, -54, -20,
1276  3, 14, -17, 8, 0, 44, -16, -35, -13, -18,
1277  43, 7, -6, -11, -33, 4, -30, -11, 22, 40,
1278  -6, 43, -3, -50, 14, 18, -22, -18, 1, 16,
1279  }, {
1280  77, -2, -11, 1, -7, 47, 52, -5, 29, 33,
1281  1, -28, 0, -15, 28, 26, 2, 30, 0, 2,
1282  -22, 4, -33, -3, 36, -21, 3, -15, -2, 5,
1283  -4, 4, 6, 9, 37, 31, -5, -32, -20, -30,
1284  }, {
1285  8, 17, 10, 40, 13, 34, 47, 0, -5, 4,
1286  -16, -21, -8, 2, 42, 43, -10, 26, 10, 2,
1287  -31, -11, -27, -19, 21, -10, -12, 20, -3, 11,
1288  -25, 20, 25, 25, 29, 28, -28, -34, -25, -38,
1289  }, {
1290  37, 3, 0, -10, 7, 22, 48, -12, 8, 36,
1291  -12, 9, 12, -22, 12, 19, 6, 28, 0, 29,
1292  18, 3, -11, -17, 10, -18, 10, -7, 27, 18,
1293  11, 7, -3, -28, 47, 55, 18, -15, -34, -16,
1294  }, {
1295  -31, 24, 23, 27, 29, 9, 43, -8, -26, 7,
1296  -30, 17, 4, -3, 26, 35, -5, 24, 10, 28,
1297  9, -12, -5, -33, -5, -8, -5, 29, 26, 24,
1298  -9, 23, 14, -12, 39, 52, -5, -18, -39, -24,
1299  }, {
1300  32, 8, -3, 2, 13, -4, 50, 1, 27, 39,
1301  23, -51, -15, -30, 27, 37, 7, -1, -17, -29,
1302  -5, 23, -25, -10, 14, -26, -8, -41, -1, 9,
1303  13, 26, 5, -12, 12, 7, 14, -45, 6, -9,
1304  }, {
1305  -36, 29, 19, 41, 34, -18, 45, 6, -8, 10,
1306  5, -43, -23, -11, 42, 53, -5, -5, -6, -30,
1307  -14, 8, -20, -26, -1, -16, -25, -4, -3, 15,
1308  -7, 41, 23, 3, 4, 3, -8, -48, 1, -17,
1309  }, {
1310  -7, 15, 9, -9, 28, -29, 45, -5, 6, 43,
1311  9, -12, -2, -36, 12, 30, 11, -3, -17, -3,
1312  34, 22, -3, -24, -12, -24, -2, -32, 28, 22,
1313  29, 29, -5, -50, 21, 31, 38, -29, -7, 5,
1314  }, {
1315  -76, 35, 31, 28, 49, -43, 40, 0, -29, 14,
1316  -8, -5, -10, -18, 26, 46, 0, -7, -6, -3,
1317  25, 7, 2, -40, -28, -14, -18, 3, 27, 28,
1318  8, 45, 13, -34, 13, 27, 15, -31, -12, -3,
1319  }, {
1320  74, -17, 0, -31, -18, 73, -5, 0, 3, -5,
1321  25, 12, -3, -1, -22, 3, -9, 33, -12, -24,
1322  6, 2, -33, 9, 21, 5, 20, -27, -19, -7,
1323  -34, -37, -34, 22, 44, 0, -41, -29, -17, -21,
1324  }, {
1325  5, 3, 21, 7, 2, 60, -10, 5, -32, -34,
1326  7, 20, -11, 16, -8, 20, -21, 29, -1, -24,
1327  -2, -13, -27, -6, 5, 15, 3, 8, -21, -1,
1328  -55, -21, -15, 38, 37, -3, -65, -32, -23, -30,
1329  }, {
1330  35, -10, 11, -44, -3, 48, -10, -6, -17, -2,
1331  11, 51, 8, -8, -38, -3, -4, 31, -12, 2,
1332  46, 1, -10, -4, -5, 7, 26, -19, 10, 5,
1333  -18, -34, -45, -15, 54, 24, -18, -13, -31, -7,
1334  }, {
1335  -33, 10, 34, -5, 17, 35, -15, -1, -53, -30,
1336  -6, 59, 0, 10, -24, 13, -17, 27, -1, 1,
1337  37, -13, -4, -20, -20, 18, 10, 16, 8, 11,
1338  -39, -18, -26, 0, 46, 20, -41, -15, -37, -15,
1339  }, {
1340  29, -5, 7, -30, 1, 21, -7, 7, 0, 0,
1341  47, -9, -18, -15, -22, 14, -4, 0, -28, -57,
1342  23, 21, -25, 2, -1, 0, 7, -53, -19, -3,
1343  -17, -15, -36, 0, 19, -24, -21, -43, 9, 0,
1344  }, {
1345  -39, 14, 30, 8, 22, 8, -12, 12, -34, -27,
1346  29, -2, -26, 2, -8, 31, -16, -3, -17, -57,
1347  14, 6, -19, -13, -16, 10, -8, -17, -20, 2,
1348  -38, 0, -17, 16, 11, -27, -44, -45, 4, -8,
1349  }, {
1350  -9, 1, 20, -43, 17, -3, -12, 0, -20, 4,
1351  33, 29, -6, -22, -38, 7, 0, -1, -29, -30,
1352  63, 21, -3, -11, -27, 1, 14, -45, 10, 9,
1353  -1, -12, -47, -37, 28, 0, 2, -26, -4, 13,
1354  }, {
1355  -78, 21, 43, -4, 38, -17, -17, 5, -55, -24,
1356  15, 36, -14, -4, -24, 24, -12, -5, -17, -31,
1357  54, 5, 2, -27, -43, 12, -2, -9, 9, 15,
1358  -22, 3, -28, -21, 20, -3, -20, -28, -9, 5,
1359  }, {
1360  80, -6, 16, -11, -30, 30, 9, 28, 28, 29,
1361  13, -6, 2, -28, 3, 5, 7, 60, -5, -9,
1362  -11, 1, -24, -19, 27, -13, 32, -13, -15, -19,
1363  -19, -35, -17, 39, 43, 9, -4, -42, -32, -41,
1364  }, {
1365  11, 14, 39, 27, -9, 17, 4, 33, -6, 0,
1366  -4, 1, -5, -10, 17, 22, -5, 57, 5, -9,
1367  -20, -13, -18, -35, 11, -3, 16, 22, -17, -13,
1368  -40, -19, 1, 55, 35, 5, -27, -44, -37, -49,
1369  }, {
1370  40, 0, 28, -24, -14, 5, 4, 21, 7, 33,
1371  0, 32, 15, -35, -12, -1, 11, 58, -5, 16,
1372  28, 0, -1, -33, 0, -11, 39, -5, 14, -6,
1373  -3, -31, -28, 1, 53, 33, 19, -25, -46, -26,
1374  }, {
1375  -28, 20, 51, 14, 6, -7, 0, 26, -27, 4,
1376  -18, 40, 6, -16, 1, 15, 0, 55, 5, 16,
1377  19, -14, 3, -49, -14, -1, 22, 30, 12, 0,
1378  -24, -15, -9, 17, 45, 29, -4, -28, -51, -35,
1379  }, {
1380  34, 4, 25, -10, -9, -21, 7, 36, 26, 36,
1381  35, -28, -12, -42, 3, 16, 12, 28, -21, -42,
1382  5, 21, -16, -26, 4, -19, 19, -39, -15, -15,
1383  -1, -13, -19, 17, 17, -14, 15, -55, -4, -19,
1384  }, {
1385  -34, 25, 48, 28, 11, -34, 2, 41, -9, 7,
1386  17, -21, -20, -24, 17, 33, 0, 24, -10, -42,
1387  -3, 5, -10, -42, -11, -8, 3, -3, -16, -9,
1388  -22, 2, 0, 33, 10, -18, -7, -58, -10, -28,
1389  }, {
1390  -4, 11, 37, -23, 5, -46, 2, 29, 5, 39,
1391  21, 9, 0, -49, -12, 9, 16, 26, -22, -15,
1392  45, 20, 5, -40, -22, -17, 26, -31, 14, -2,
1393  14, -10, -30, -20, 27, 9, 39, -39, -18, -5,
1394  }, {
1395  -73, 32, 60, 15, 26, -59, -2, 33, -30, 10,
1396  3, 17, -8, -30, 1, 26, 4, 22, -10, -16,
1397  36, 5, 11, -56, -37, -6, 10, 5, 13, 3,
1398  -6, 5, -11, -4, 19, 5, 16, -41, -24, -13
1399  }
1400 };
1401 
1402 const uint16_t ff_cb1_base[128]={
1403  19657, 18474, 18365, 17520, 21048, 18231, 18584, 16671,
1404  20363, 19069, 19409, 18430, 21844, 18753, 19613, 17411,
1405  20389, 21772, 20129, 21702, 20978, 20472, 19627, 19387,
1406  21477, 23134, 21841, 23919, 22089, 21519, 21134, 20852,
1407  19675, 17821, 19044, 17477, 19986, 16955, 18446, 16086,
1408  21138, 18899, 20952, 18929, 21452, 17833, 20104, 17159,
1409  19770, 20056, 20336, 20866, 19329, 18217, 18908, 18004,
1410  21556, 21948, 23079, 23889, 20922, 19544, 20984, 19781,
1411  19781, 20984, 19544, 20922, 23889, 23079, 21948, 21556,
1412  18004, 18908, 18217, 19329, 20866, 20336, 20056, 19770,
1413  17159, 20104, 17833, 21452, 18929, 20952, 18899, 21138,
1414  16086, 18446, 16955, 19986, 17477, 19044, 17821, 19675,
1415  20852, 21134, 21519, 22089, 23919, 21841, 23134, 21477,
1416  19387, 19627, 20472, 20978, 21702, 20129, 21772, 20389,
1417  17411, 19613, 18753, 21844, 18430, 19409, 19069, 20363,
1418  16671, 18584, 18231, 21048, 17520, 18365, 18474, 19657,
1419 };
1420 
1421 const uint16_t ff_cb2_base[128]={
1422  12174, 13380, 13879, 13832, 13170, 13227, 13204, 12053,
1423  12410, 13988, 14348, 14631, 13100, 13415, 13224, 12268,
1424  11982, 13825, 13499, 14210, 13877, 14788, 13811, 13109,
1425  11449, 13275, 12833, 13717, 12728, 13696, 12759, 12405,
1426  10230, 12185, 11628, 13161, 11762, 13458, 12312, 12818,
1427  10443, 12773, 12011, 14020, 11818, 13825, 12453, 13226,
1428  10446, 13162, 11881, 14300, 12859, 16288, 13490, 15053,
1429  10155, 12820, 11519, 13973, 12041, 15081, 12635, 14198,
1430  14198, 12635, 15081, 12041, 13973, 11519, 12820, 10155,
1431  15053, 13490, 16288, 12859, 14300, 11881, 13162, 10446,
1432  13226, 12453, 13825, 11818, 14020, 12011, 12773, 10443,
1433  12818, 12312, 13458, 11762, 13161, 11628, 12185, 10230,
1434  12405, 12759, 13696, 12728, 13717, 12833, 13275, 11449,
1435  13109, 13811, 14788, 13877, 14210, 13499, 13825, 11982,
1436  12268, 13224, 13415, 13100, 14631, 14348, 13988, 12410,
1437  12053, 13204, 13227, 13170, 13832, 13879, 13380, 12174,
1438 };
1439 
1440 const int16_t ff_energy_tab[32]={
1441  0, 16, 20, 25, 32, 41, 51, 65,
1442  81, 103, 129, 163, 205, 259, 326, 410,
1443  516, 650, 819, 1031, 1298, 1634, 2057, 2590,
1444  3261, 4105, 5168, 6507, 8192, 10313, 12983, 16345
1445 };
1446 
1447 static const int16_t lpc_refl_cb1[64]={
1448  -4041, -4018, -3998, -3977, -3954, -3930, -3906, -3879,
1449  -3852, -3825, -3795, -3764, -3731, -3699, -3666, -3631,
1450  -3594, -3555, -3513, -3468, -3420, -3372, -3321, -3268,
1451  -3212, -3153, -3090, -3021, -2944, -2863, -2772, -2676,
1452  -2565, -2445, -2328, -2202, -2072, -1941, -1808, -1660,
1453  -1508, -1348, -1185, -994, -798, -600, -374, -110,
1454  152, 447, 720, 982, 1229, 1456, 1682, 1916,
1455  2130, 2353, 2595, 2853, 3118, 3363, 3588, 3814
1456 };
1457 
1458 static const int16_t lpc_refl_cb2[32]={
1459  -3091, -2386, -1871, -1425, -1021, -649, -316, -20,
1460  267, 544, 810, 1065, 1305, 1534, 1756, 1970,
1461  2171, 2359, 2536, 2700, 2854, 2996, 3133, 3263,
1462  3386, 3499, 3603, 3701, 3789, 3870, 3947, 4020
1463 };
1464 
1465 static const int16_t lpc_refl_cb3[32]={
1466  -3525, -3295, -3081, -2890, -2696, -2511, -2328, -2149,
1467  -1979, -1817, -1658, -1498, -1341, -1188, -1032, -876,
1468  -721, -561, -394, -228, -54, 119, 296, 484,
1469  683, 895, 1123, 1373, 1651, 1965, 2360, 2854
1470 };
1471 
1472 static const int16_t lpc_refl_cb4[16]={
1473  -1845, -1057, -522, -77, 301, 647, 975, 1285,
1474  1582, 1873, 2163, 2452, 2735, 3017, 3299, 3569
1475 };
1476 
1477 static const int16_t lpc_refl_cb5[16]={
1478  -2691, -2187, -1788, -1435, -1118, -837, -571, -316,
1479  -59, 201, 470, 759, 1077, 1457, 1908, 2495
1480 };
1481 
1482 static const int16_t lpc_refl_cb6[8]={
1483  -1372, -474, 133, 632, 1100, 1571, 2075, 2672
1484 };
1485 
1486 static const int16_t lpc_refl_cb7[8]={
1487  -2389, -1787, -1231, -717, -239, 234, 770, 1474
1488 };
1489 
1490 static const int16_t lpc_refl_cb8[8]={
1491  -1569, -864, -296, 200, 670, 1151, 1709, 2385
1492 };
1493 
1494 static const int16_t lpc_refl_cb9[8]={
1495  -2200, -1608, -1062, -569, -120, 338, 863, 1621
1496 };
1497 
1498 static const int16_t lpc_refl_cb10[4]={
1499  -617, 190, 802, 1483
1500 };
1501 
1502 const int16_t * const ff_lpc_refl_cb[10]={
1505 };
1506 
1507 static void add_wav(int16_t *dest, int n, int skip_first, int *m,
1508  const int16_t *s1, const int8_t *s2, const int8_t *s3)
1509 {
1510  int i;
1511  int v[3];
1512 
1513  v[0] = 0;
1514  for (i=!skip_first; i<3; i++)
1515  v[i] = (ff_gain_val_tab[n][i] * (unsigned)m[i]) >> ff_gain_exp_tab[n];
1516 
1517  if (v[0]) {
1518  for (i=0; i < BLOCKSIZE; i++)
1519  dest[i] = (s1[i]*v[0] + s2[i]*v[1] + s3[i]*v[2]) >> 12;
1520  } else {
1521  for (i=0; i < BLOCKSIZE; i++)
1522  dest[i] = ( s2[i]*v[1] + s3[i]*v[2]) >> 12;
1523  }
1524 }
1525 
1526 /**
1527  * Copy the last offset values of *source to *target. If those values are not
1528  * enough to fill the target buffer, fill it with another copy of those values.
1529  */
1530 void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset)
1531 {
1532  source += BUFFERSIZE - offset;
1533 
1534  memcpy(target, source, FFMIN(BLOCKSIZE, offset)*sizeof(*target));
1535  if (offset < BLOCKSIZE)
1536  memcpy(target + offset, source, (BLOCKSIZE - offset)*sizeof(*target));
1537 }
1538 
1539 /**
1540  * Evaluate the reflection coefficients from the filter coefficients.
1541  *
1542  * @return 1 if one of the reflection coefficients is greater than
1543  * 4095, 0 if not.
1544  */
1545 int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx)
1546 {
1547  int b, i, j;
1548  int buffer1[LPC_ORDER];
1549  int buffer2[LPC_ORDER];
1550  int *bp1 = buffer1;
1551  int *bp2 = buffer2;
1552 
1553  for (i=0; i < LPC_ORDER; i++)
1554  buffer2[i] = coefs[i];
1555 
1556  refl[LPC_ORDER-1] = bp2[LPC_ORDER-1];
1557 
1558  if ((unsigned) bp2[LPC_ORDER-1] + 0x1000 > 0x1fff) {
1559  av_log(avctx, AV_LOG_ERROR, "Overflow. Broken sample?\n");
1560  return 1;
1561  }
1562 
1563  for (i = LPC_ORDER-2; i >= 0; i--) {
1564  b = 0x1000-((bp2[i+1] * bp2[i+1]) >> 12);
1565 
1566  if (!b)
1567  b = -2;
1568 
1569  b = 0x1000000 / b;
1570  for (j=0; j <= i; j++) {
1571 #if CONFIG_FTRAPV
1572  int a = bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12);
1573  if((int)(a*(unsigned)b) != a*(int64_t)b)
1574  return 1;
1575 #endif
1576  bp1[j] = (int)((bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12)) * (unsigned)b) >> 12;
1577  }
1578 
1579  if ((unsigned) bp1[i] + 0x1000 > 0x1fff)
1580  return 1;
1581 
1582  refl[i] = bp1[i];
1583 
1584  FFSWAP(int *, bp1, bp2);
1585  }
1586  return 0;
1587 }
1588 
1589 /**
1590  * Evaluate the LPC filter coefficients from the reflection coefficients.
1591  * Does the inverse of the ff_eval_refl() function.
1592  */
1593 void ff_eval_coefs(int *coefs, const int *refl)
1594 {
1595  int buffer[LPC_ORDER];
1596  int *b1 = buffer;
1597  int *b2 = coefs;
1598  int i, j;
1599 
1600  for (i=0; i < LPC_ORDER; i++) {
1601  b1[i] = refl[i] * 16;
1602 
1603  for (j=0; j < i; j++)
1604  b1[j] = ((int)(refl[i] * (unsigned)b2[i-j-1]) >> 12) + b2[j];
1605 
1606  FFSWAP(int *, b1, b2);
1607  }
1608 
1609  for (i=0; i < LPC_ORDER; i++)
1610  coefs[i] >>= 4;
1611 }
1612 
1613 void ff_int_to_int16(int16_t *out, const int *inp)
1614 {
1615  int i;
1616 
1617  for (i = 0; i < LPC_ORDER; i++)
1618  *out++ = *inp++;
1619 }
1620 
1621 /**
1622  * Evaluate sqrt(x << 24). x must fit in 20 bits. This value is evaluated in an
1623  * odd way to make the output identical to the binary decoder.
1624  */
1625 int ff_t_sqrt(unsigned int x)
1626 {
1627  int s = 2;
1628  while (x > 0xfff) {
1629  s++;
1630  x >>= 2;
1631  }
1632 
1633  return ff_sqrt(x << 20) << s;
1634 }
1635 
1636 unsigned int ff_rms(const int *data)
1637 {
1638  int i;
1639  unsigned int res = 0x10000;
1640  int b = LPC_ORDER;
1641 
1642  for (i = 0; i < LPC_ORDER; i++) {
1643  res = (((0x1000000 - data[i]*data[i]) >> 12) * res) >> 12;
1644 
1645  if (res == 0)
1646  return 0;
1647 
1648  while (res <= 0x3fff) {
1649  b++;
1650  res <<= 2;
1651  }
1652  }
1653 
1654  return ff_t_sqrt(res) >> b;
1655 }
1656 
1657 int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold, int energy)
1658 {
1659  int work[LPC_ORDER];
1660  int b = NBLOCKS - a;
1661  int i;
1662 
1663  // Interpolate block coefficients from the this frame's forth block and
1664  // last frame's forth block.
1665  for (i = 0; i < LPC_ORDER; i++)
1666  out[i] = (a * ractx->lpc_coef[0][i] + b * ractx->lpc_coef[1][i])>> 2;
1667 
1668  if (ff_eval_refl(work, out, ractx->avctx)) {
1669  // The interpolated coefficients are unstable, copy either new or old
1670  // coefficients.
1671  ff_int_to_int16(out, ractx->lpc_coef[copyold]);
1672  return ff_rescale_rms(ractx->lpc_refl_rms[copyold], energy);
1673  } else {
1674  return ff_rescale_rms(ff_rms(work), energy);
1675  }
1676 }
1677 
1678 unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy)
1679 {
1680  return (rms * energy) >> 10;
1681 }
1682 
1683 /** inverse root mean square */
1684 int ff_irms(AudioDSPContext *adsp, const int16_t *data)
1685 {
1686  unsigned int sum = adsp->scalarproduct_int16(data, data, BLOCKSIZE);
1687 
1688  if (sum == 0)
1689  return 0; /* OOPS - division by zero */
1690 
1691  return 0x20000000 / (ff_t_sqrt(sum) >> 8);
1692 }
1693 
1694 void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs,
1695  int cba_idx, int cb1_idx, int cb2_idx,
1696  int gval, int gain)
1697 {
1698  int16_t *block;
1699  int m[3];
1700 
1701  if (cba_idx) {
1702  cba_idx += BLOCKSIZE/2 - 1;
1703  ff_copy_and_dup(ractx->buffer_a, ractx->adapt_cb, cba_idx);
1704  m[0] = (ff_irms(&ractx->adsp, ractx->buffer_a) * (unsigned)gval) >> 12;
1705  } else {
1706  m[0] = 0;
1707  }
1708  m[1] = (ff_cb1_base[cb1_idx] * gval) >> 8;
1709  m[2] = (ff_cb2_base[cb2_idx] * gval) >> 8;
1710  memmove(ractx->adapt_cb, ractx->adapt_cb + BLOCKSIZE,
1711  (BUFFERSIZE - BLOCKSIZE) * sizeof(*ractx->adapt_cb));
1712 
1713  block = ractx->adapt_cb + BUFFERSIZE - BLOCKSIZE;
1714 
1715  add_wav(block, gain, cba_idx, m, cba_idx? ractx->buffer_a: NULL,
1716  ff_cb1_vects[cb1_idx], ff_cb2_vects[cb2_idx]);
1717 
1718  memcpy(ractx->curr_sblock, ractx->curr_sblock + BLOCKSIZE,
1719  LPC_ORDER*sizeof(*ractx->curr_sblock));
1720 
1721  if (ff_celp_lp_synthesis_filter(ractx->curr_sblock + LPC_ORDER, lpc_coefs,
1722  block, BLOCKSIZE, LPC_ORDER, 1, 0, 0xfff))
1723  memset(ractx->curr_sblock, 0, (LPC_ORDER+BLOCKSIZE)*sizeof(*ractx->curr_sblock));
1724 }
#define NULL
Definition: coverity.c:32
const char * s
Definition: avisynth_c.h:768
int32_t(* scalarproduct_int16)(const int16_t *v1, const int16_t *v2, int len)
Calculate scalar product of two vectors.
Definition: audiodsp.h:29
int ff_t_sqrt(unsigned int x)
Evaluate sqrt(x << 24).
Definition: ra144.c:1625
const int16_t *const ff_lpc_refl_cb[10]
Definition: ra144.c:1502
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
static const int16_t lpc_refl_cb7[8]
Definition: ra144.c:1486
int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs, const int16_t *in, int buffer_length, int filter_length, int stop_on_overflow, int shift, int rounder)
LP synthesis filter.
Definition: celp_filters.c:60
const char * b
Definition: vf_curves.c:113
int16_t adapt_cb[146+2]
Adaptive codebook, its size is two units bigger to avoid a buffer overflow.
Definition: ra144.h:61
static int16_t block[64]
Definition: dct.c:115
#define NBLOCKS
number of subblocks within a block
Definition: ra144.h:30
static const int16_t lpc_refl_cb10[4]
Definition: ra144.c:1498
uint8_t
unsigned int lpc_refl_rms[2]
Definition: ra144.h:52
#define LPC_ORDER
Definition: g723_1.h:40
unsigned int ff_rms(const int *data)
Definition: ra144.c:1636
const uint16_t ff_cb2_base[128]
Definition: ra144.c:1421
#define av_log(a,...)
#define ff_sqrt
Definition: mathops.h:206
AVCodecContext * avctx
Definition: ra144.h:38
void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs, int cba_idx, int cb1_idx, int cb2_idx, int gval, int gain)
Definition: ra144.c:1694
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
unsigned int * lpc_coef[2]
LPC coefficients: lpc_coef[0] is the coefficients of the current frame and lpc_coef[1] of the previou...
Definition: ra144.h:50
#define s2
Definition: regdef.h:39
const int8_t ff_cb1_vects[128][40]
Definition: ra144.c:114
static const uint8_t offset[127][2]
Definition: vf_spp.c:92
static const int16_t lpc_refl_cb8[8]
Definition: ra144.c:1490
static const int16_t lpc_refl_cb1[64]
Definition: ra144.c:1447
#define FFMIN(a, b)
Definition: common.h:96
int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold, int energy)
Definition: ra144.c:1657
void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset)
Copy the last offset values of *source to *target.
Definition: ra144.c:1530
int n
Definition: avisynth_c.h:684
void ff_int_to_int16(int16_t *out, const int *inp)
Definition: ra144.c:1613
const int16_t ff_gain_val_tab[256][3]
Definition: ra144.c:28
#define s3
Definition: regdef.h:40
static const int16_t lpc_refl_cb5[16]
Definition: ra144.c:1477
static const int16_t lpc_refl_cb6[8]
Definition: ra144.c:1482
#define BLOCKSIZE
subblock size in 16-bit words
Definition: ra144.h:31
void ff_eval_coefs(int *coefs, const int *refl)
Evaluate the LPC filter coefficients from the reflection coefficients.
Definition: ra144.c:1593
Libavcodec external API header.
main external API structure.
Definition: avcodec.h:1732
static const int16_t lpc_refl_cb9[8]
Definition: ra144.c:1494
static const int16_t lpc_refl_cb2[32]
Definition: ra144.c:1458
int16_t buffer_a[FFALIGN(BLOCKSIZE, 16)]
Definition: ra144.h:63
int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx)
Evaluate the reflection coefficients from the filter coefficients.
Definition: ra144.c:1545
#define s1
Definition: regdef.h:38
#define BUFFERSIZE
the size of the adaptive codebook
Definition: ra144.h:32
unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy)
Definition: ra144.c:1678
const int8_t ff_cb2_vects[128][40]
Definition: ra144.c:758
int
AudioDSPContext adsp
Definition: ra144.h:39
const int16_t ff_energy_tab[32]
Definition: ra144.c:1440
static const int16_t lpc_refl_cb3[32]
Definition: ra144.c:1465
const uint8_t ff_gain_exp_tab[256]
Definition: ra144.c:95
int16_t curr_sblock[50]
The current subblock padded by the last 10 values of the previous one.
Definition: ra144.h:57
static void add_wav(int16_t *dest, int n, int skip_first, int *m, const int16_t *s1, const int8_t *s2, const int8_t *s3)
Definition: ra144.c:1507
static const int16_t lpc_refl_cb4[16]
Definition: ra144.c:1472
FILE * out
Definition: movenc.c:54
const uint16_t ff_cb1_base[128]
Definition: ra144.c:1402
#define FFSWAP(type, a, b)
Definition: common.h:99
int ff_irms(AudioDSPContext *adsp, const int16_t *data)
inverse root mean square
Definition: ra144.c:1684
GLuint buffer
Definition: opengl_enc.c:102