ysf tx initial checkin

This commit is contained in:
Max 2017-02-26 17:18:22 -05:00
parent cb410c1f95
commit fa76f07e56
4 changed files with 893 additions and 0 deletions

View File

@ -0,0 +1,57 @@
/* -*- c++ -*- */
/*
* DMR Encoder (C) Copyright 2017 Max H. Parke KA1RBI
* This file is part of OP25
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_OP25_REPEATER_YSF_TX_SB_H
#define INCLUDED_OP25_REPEATER_YSF_TX_SB_H
#include <op25_repeater/api.h>
#include <gnuradio/block.h>
namespace gr {
namespace op25_repeater {
/*!
* \brief <+description of block+>
* \ingroup op25_repeater
*
*/
class OP25_REPEATER_API ysf_tx_sb : virtual public gr::block
{
public:
typedef boost::shared_ptr<ysf_tx_sb> sptr;
/*!
* \brief Return a shared_ptr to a new instance of op25_repeater::ysf_tx_sb.
*
* To avoid accidental use of raw pointers, op25_repeater::ysf_tx_sb's
* constructor is in a private implementation
* class. op25_repeater::ysf_tx_sb::make is the public interface for
* creating new instances.
*/
static sptr make(int versbose_flag, const char * conf_file, bool fullrate_mode);
};
} // namespace op25_repeater
} // namespace gr
#endif /* INCLUDED_OP25_REPEATER_YSF_TX_SB_H */

View File

@ -0,0 +1,300 @@
//
// YSF Encoder (C) Copyright 2017 Max H. Parke KA1RBI
//
// This file is part of OP25
//
// OP25 is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// OP25 is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with OP25; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Boston, MA
// 02110-1301, USA.
#ifndef INCLUDED_YSF_CONST_H
#define INCLUDED_YSF_CONST_H
static const int gly_24_12[] = {
0, 6379, 10558, 12757, 19095, 21116, 25513, 31554, 36294, 38189, 42232, 48147, 51025, 57274, 61039, 63108,
66407, 72588, 76377, 78514, 84464, 86299, 90318, 96293, 102049, 104010, 108447, 114548, 115766, 122077, 126216, 128483,
132813, 138790, 143347, 145176, 150618, 152753, 157028, 163215, 166667, 168928, 172597, 178910, 180636, 186743, 190626, 192585,
198058, 204097, 208020, 210047, 216893, 219094, 222723, 229096, 231532, 233607, 237906, 244153, 246523, 252432, 256965, 258862,
265625, 267634, 271527, 277580, 280334, 286693, 290352, 292571, 295007, 301236, 305505, 307594, 314056, 315939, 320502, 326429,
331518, 333333, 337856, 343851, 345193, 351362, 355671, 357820, 361272, 367571, 371206, 373485, 379311, 381252, 385169, 391290,
396116, 398271, 402026, 408193, 410051, 416040, 420093, 421910, 427666, 433785, 438188, 440135, 445445, 447726, 451899, 458192,
460851, 463064, 467213, 473574, 475812, 481871, 486298, 488305, 493045, 498974, 502987, 504864, 511842, 513929, 517724, 523959,
525274, 531249, 535268, 537103, 543053, 545190, 548979, 555160, 560668, 562935, 567074, 573385, 574603, 580704, 585141, 587102,
590013, 596054, 600451, 602472, 608810, 611009, 615188, 621567, 626043, 628112, 631877, 638126, 641004, 646919, 650962, 652857,
656663, 663036, 666665, 668866, 675712, 677739, 681662, 687701, 690385, 692282, 696815, 702724, 705094, 711341, 715640, 717715,
722544, 728731, 733006, 735141, 740583, 742412, 746969, 752946, 756662, 758621, 762504, 768611, 770337, 776650, 780319, 782580,
790083, 792232, 796541, 802710, 804052, 810047, 814570, 816385, 820101, 826222, 830139, 832080, 837906, 840185, 843820, 850119,
855332, 857551, 861210, 867569, 870323, 876376, 880269, 882278, 884962, 890889, 895452, 897335, 903797, 905886, 910155, 916384,
919694, 921701, 926128, 932187, 934425, 940786, 944935, 947148, 951624, 957859, 961654, 963741, 970719, 972596, 976609, 982538,
986089, 987906, 991959, 997948, 999806, 1005973, 1009728, 1011883, 1017391, 1023684, 1027857, 1030138, 1035448, 1037395, 1041798, 1047917,
1050548, 1056607, 1060490, 1062497, 1068323, 1070536, 1074205, 1080566, 1084018, 1086105, 1090380, 1096615, 1097957, 1103886, 1108443, 1110320,
1115347, 1121336, 1125869, 1127686, 1134148, 1136303, 1140602, 1146769, 1149205, 1151486, 1155115, 1161408, 1164162, 1170281, 1174204, 1176151,
1180025, 1186194, 1189959, 1192108, 1199086, 1200901, 1204944, 1210939, 1215679, 1217620, 1222017, 1228138, 1230376, 1236675, 1240854, 1243133,
1245726, 1252085, 1256224, 1258443, 1263753, 1265762, 1270199, 1276252, 1282008, 1283891, 1287910, 1293837, 1295695, 1301924, 1305713, 1307802,
1313325, 1315526, 1319699, 1326072, 1327290, 1333329, 1337732, 1339759, 1345515, 1351424, 1355477, 1357374, 1363324, 1365399, 1369154, 1375401,
1378634, 1380769, 1384564, 1390751, 1393629, 1399606, 1403619, 1405448, 1410188, 1416295, 1420722, 1422681, 1429019, 1431280, 1435429, 1441742,
1445088, 1446923, 1451486, 1457461, 1459831, 1466012, 1470281, 1472418, 1474854, 1481165, 1484824, 1487091, 1493937, 1495898, 1499791, 1505892,
1511303, 1513324, 1517241, 1523282, 1525008, 1531387, 1535022, 1537221, 1540673, 1546922, 1551231, 1553300, 1558742, 1560637, 1565160, 1571075,
1573998, 1580165, 1584464, 1586619, 1593081, 1594898, 1599431, 1605420, 1608104, 1610051, 1613974, 1620093, 1622847, 1629140, 1632769, 1635050,
1640201, 1646562, 1650231, 1652444, 1658270, 1660277, 1664160, 1670219, 1673935, 1675812, 1680369, 1686298, 1687640, 1693875, 1698150, 1700237,
1704611, 1710664, 1715101, 1717110, 1722420, 1724639, 1728778, 1735137, 1740645, 1742734, 1746523, 1752752, 1754610, 1760537, 1764556, 1766439,
1769924, 1775919, 1779962, 1781777, 1788755, 1790904, 1794669, 1800838, 1805314, 1807593, 1811772, 1818071, 1820309, 1826430, 1830827, 1832768,
1837559, 1839388, 1843401, 1849378, 1852256, 1858443, 1862238, 1864373, 1868849, 1875162, 1879311, 1881572, 1887910, 1889869, 1894296, 1900403,
1903248, 1905275, 1909678, 1915717, 1916935, 1923308, 1927481, 1929682, 1935190, 1941437, 1945192, 1947267, 1953217, 1955114, 1959167, 1965076,
1969978, 1972177, 1975812, 1982191, 1983917, 1989958, 1993875, 1995896, 1999612, 2005527, 2010050, 2011945, 2017387, 2019456, 2023765, 2030014,
2034781, 2036918, 2041187, 2047368, 2049738, 2055713, 2060276, 2062111, 2064795, 2070896, 2074789, 2076750, 2083596, 2085863, 2089522, 2095833,
2101096, 2103171, 2106966, 2113213, 2115071, 2120980, 2124993, 2126890, 2130606, 2136645, 2141072, 2143099, 2148409, 2150610, 2154759, 2161132,
2165775, 2168036, 2172209, 2178522, 2180760, 2186867, 2191270, 2193229, 2195913, 2201890, 2205943, 2207772, 2214750, 2216885, 2220640, 2226827,
2230693, 2232654, 2236571, 2242672, 2245426, 2251737, 2255372, 2257639, 2262115, 2268296, 2272605, 2274742, 2281204, 2283039, 2287562, 2293537,
2296514, 2298409, 2302972, 2308887, 2310229, 2316478, 2320747, 2322816, 2328324, 2334703, 2338362, 2340561, 2346387, 2348408, 2352301, 2358342,
2360049, 2365978, 2370511, 2372388, 2377830, 2379917, 2384216, 2390451, 2395959, 2398172, 2401801, 2408162, 2409888, 2415947, 2419870, 2421877,
2425238, 2431357, 2435240, 2437187, 2444033, 2446314, 2449983, 2456276, 2460752, 2462907, 2467182, 2473349, 2475719, 2481708, 2486265, 2488082,
2491452, 2497751, 2501890, 2504169, 2510507, 2512448, 2516885, 2523006, 2525690, 2527505, 2531524, 2537519, 2540397, 2546566, 2550355, 2552504,
2557787, 2564016, 2567781, 2569870, 2575820, 2577703, 2581746, 2587673, 2591389, 2593398, 2597795, 2603848, 2605066, 2611425, 2615604, 2617823,
2624690, 2626649, 2631052, 2637159, 2639397, 2645710, 2649883, 2652144, 2654580, 2660767, 2664522, 2666657, 2673635, 2675464, 2679517, 2685494,
2691029, 2692926, 2696939, 2702848, 2704706, 2710953, 2714748, 2716823, 2720275, 2726648, 2730797, 2732998, 2738308, 2740335, 2744762, 2750801,
2755199, 2757268, 2761537, 2767786, 2769128, 2775043, 2779606, 2781501, 2787257, 2793298, 2797191, 2799212, 2805038, 2807237, 2810896, 2817275,
2820376, 2822643, 2826278, 2832589, 2835343, 2841444, 2845361, 2847322, 2852062, 2858037, 2862560, 2864395, 2870857, 2872994, 2877303, 2883484,
2883883, 2890176, 2893845, 2896126, 2902972, 2904919, 2908802, 2914921, 2919661, 2921478, 2926035, 2932024, 2934394, 2940561, 2944836, 2946991,
2949708, 2955943, 2960242, 2962329, 2967771, 2969648, 2974181, 2980110, 2985866, 2987873, 2991796, 2997855, 2999581, 3005942, 3009571, 3011784,
3016678, 3022605, 3026648, 3028531, 3034481, 3036570, 3040335, 3046564, 3050016, 3052235, 3056414, 3062773, 3063991, 3070044, 3074441, 3076450,
3081345, 3087466, 3091903, 3093844, 3100182, 3102461, 3106600, 3112899, 3115335, 3117484, 3121273, 3127442, 3130320, 3136315, 3140334, 3142149,
3147996, 3149879, 3154402, 3160329, 3162699, 3168928, 3173237, 3175326, 3179802, 3186161, 3189796, 3192015, 3198861, 3200870, 3204787, 3210840,
3214267, 3216208, 3220101, 3226222, 3227948, 3234247, 3237906, 3240185, 3245693, 3251862, 3256131, 3258280, 3263722, 3265537, 3270100, 3276095,
3280401, 3282682, 3286831, 3293124, 3294342, 3300461, 3304888, 3306835, 3310551, 3316540, 3320553, 3322370, 3328320, 3330475, 3334270, 3340437,
3345782, 3347869, 3351624, 3357859, 3360737, 3366666, 3370719, 3372596, 3375280, 3381339, 3385742, 3387749, 3394087, 3396300, 3400473, 3406834,
3409221, 3415470, 3419259, 3421328, 3428306, 3430201, 3434220, 3440135, 3442819, 3444840, 3449277, 3455318, 3457556, 3463935, 3468074, 3470273,
3474978, 3481289, 3485468, 3487735, 3493045, 3495006, 3499403, 3505504, 3509220, 3511055, 3515098, 3521073, 3522931, 3529112, 3532877, 3535014,
3539848, 3545955, 3549878, 3551837, 3557663, 3559924, 3563553, 3569866, 3575374, 3577509, 3581808, 3587995, 3589337, 3595314, 3599847, 3601676,
3604719, 3610628, 3615185, 3617082, 3623544, 3625619, 3629894, 3636141, 3640617, 3642818, 3646487, 3652860, 3655614, 3661653, 3665536, 3667563,
3672838, 3675117, 3678776, 3685075, 3686801, 3692922, 3696815, 3698756, 3704512, 3710507, 3715070, 3716885, 3722327, 3724476, 3728745, 3734914,
3737697, 3739786, 3744095, 3750324, 3752694, 3758621, 3763144, 3765027, 3769767, 3775820, 3779737, 3781746, 3788592, 3790811, 3794446, 3800805,
3804619, 3806496, 3810549, 3816478, 3819356, 3825591, 3829346, 3831433, 3833869, 3840230, 3844403, 3846616, 3852954, 3854961, 3859364, 3865423,
3870380, 3872327, 3876754, 3882873, 3884091, 3890384, 3894533, 3896814, 3900266, 3906433, 3910228, 3912383, 3918333, 3920150, 3924163, 3930152,
3933855, 3939956, 3944353, 3946314, 3951624, 3953891, 3958070, 3964381, 3967833, 3969970, 3973735, 3979916, 3981774, 3987749, 3991792, 3993627,
3999224, 4005139, 4009158, 4011053, 4018031, 4020100, 4023889, 4030138, 4032574, 4034773, 4038912, 4045291, 4047529, 4053570, 4058007, 4060028,
4063314, 4069561, 4073836, 4075911, 4082373, 4084270, 4088827, 4094736, 4099476, 4101503, 4105386, 4111425, 4114179, 4120552, 4124221, 4126422,
4129589, 4135902, 4139531, 4141792, 4147618, 4149577, 4153500, 4159607, 4165363, 4167192, 4171725, 4177702, 4179044, 4185231, 4189530, 4191665,
4195899, 4202192, 4206341, 4208622, 4213932, 4215879, 4220306, 4226425, 4230141, 4231958, 4235971, 4241960, 4243818, 4249985, 4253780, 4255935,
4261212, 4267447, 4271202, 4273289, 4280267, 4282144, 4286197, 4292126, 4294810, 4296817, 4301220, 4307279, 4309517, 4315878, 4320051, 4322264,
4325622, 4331549, 4336072, 4337955, 4344417, 4346506, 4350815, 4357044, 4361520, 4363739, 4367374, 4373733, 4376487, 4382540, 4386457, 4388466,
4391825, 4397946, 4401839, 4403780, 4409606, 4411885, 4415544, 4421843, 4427351, 4429500, 4433769, 4439938, 4441280, 4447275, 4451838, 4453653,
4459426, 4461385, 4465308, 4471415, 4473141, 4479454, 4483083, 4485344, 4490852, 4497039, 4501338, 4503473, 4508915, 4510744, 4515277, 4521254,
4524229, 4526126, 4530683, 4536592, 4538962, 4545209, 4549484, 4551559, 4556035, 4562408, 4566077, 4568278, 4575124, 4577151, 4581034, 4587073,
4590959, 4593028, 4596817, 4603066, 4605944, 4611859, 4615878, 4617773, 4620457, 4626498, 4630935, 4632956, 4639294, 4641493, 4645632, 4652011,
4656648, 4658915, 4663094, 4669405, 4670623, 4676724, 4681121, 4683082, 4686798, 4692773, 4696816, 4698651, 4704601, 4706738, 4710503, 4716684,
4720097, 4726026, 4730079, 4731956, 4738934, 4741021, 4744776, 4751011, 4753447, 4755660, 4759833, 4766194, 4768432, 4774491, 4778894, 4780901,
4785798, 4791917, 4796344, 4798291, 4803601, 4805882, 4810031, 4816324, 4819776, 4821931, 4825726, 4831893, 4833751, 4839740, 4843753, 4845570,
4850476, 4856775, 4860434, 4862713, 4868539, 4870480, 4874373, 4880494, 4886250, 4888065, 4892628, 4898623, 4899965, 4906134, 4910403, 4912552,
4915275, 4921504, 4925813, 4927902, 4934364, 4936247, 4940770, 4946697, 4951437, 4953446, 4957363, 4963416, 4966170, 4972529, 4976164, 4978383,
4982904, 4984979, 4989254, 4995501, 4997871, 5003780, 5008337, 5010234, 5014974, 5021013, 5024896, 5026923, 5033769, 5035970, 5039639, 5046012,
5049119, 5051380, 5055009, 5061322, 5063048, 5069155, 5073078, 5075037, 5080793, 5086770, 5091303, 5093132, 5098574, 5100709, 5105008, 5111195,
5115573, 5117534, 5121931, 5128032, 5129250, 5135561, 5139740, 5142007, 5145459, 5151640, 5155405, 5157542, 5163492, 5165327, 5169370, 5175345,
5180882, 5182777, 5186796, 5192711, 5195589, 5201838, 5205627, 5207696, 5210132, 5216511, 5220650, 5222849, 5229187, 5231208, 5235645, 5241686,
5243279, 5249380, 5253297, 5255258, 5262104, 5264371, 5268006, 5274317, 5278793, 5280930, 5285239, 5291420, 5293790, 5299765, 5304288, 5306123,
5309160, 5315075, 5319638, 5321533, 5326975, 5329044, 5333313, 5339562, 5345070, 5347269, 5350928, 5357307, 5359033, 5365074, 5368967, 5370988,
5375810, 5382057, 5385852, 5387927, 5393877, 5395774, 5399787, 5405696, 5409412, 5411439, 5415866, 5421905, 5423123, 5429496, 5433645, 5435846,
5440549, 5446862, 5451035, 5453296, 5459634, 5461593, 5465996, 5472103, 5474787, 5476616, 5480669, 5486646, 5489524, 5495711, 5499466, 5501601,
5508118, 5510397, 5514536, 5520835, 5523073, 5529194, 5533631, 5535572, 5538256, 5544251, 5548270, 5550085, 5557063, 5559212, 5563001, 5569170,
5574513, 5576602, 5580367, 5586596, 5588454, 5594381, 5598424, 5600307, 5604023, 5610076, 5614473, 5616482, 5621792, 5624011, 5628190, 5634549,
5638875, 5640752, 5645285, 5651214, 5652556, 5658791, 5663090, 5665177, 5670685, 5677046, 5680675, 5682888, 5688714, 5690721, 5694644, 5700703,
5704124, 5706071, 5709954, 5716073, 5718827, 5725120, 5728789, 5731070, 5735546, 5741713, 5745988, 5748143, 5754605, 5756422, 5760979, 5766968,
5767765, 5774014, 5778283, 5780352, 5785794, 5787689, 5792252, 5798167, 5803923, 5805944, 5809837, 5815878, 5817604, 5823983, 5827642, 5829841,
5833010, 5839321, 5842956, 5845223, 5852069, 5854030, 5857947, 5864048, 5868788, 5870623, 5875146, 5881121, 5883491, 5889672, 5893981, 5896118,
5899416, 5905523, 5909926, 5911885, 5918223, 5920484, 5924657, 5930970, 5933406, 5935541, 5939296, 5945483, 5948361, 5954338, 5958391, 5960220,
5965823, 5971732, 5975745, 5977642, 5983592, 5985667, 5989462, 5995709, 5999161, 6001362, 6005511, 6011884, 6013102, 6019141, 6023568, 6025595,
6033356, 6035239, 6039282, 6045209, 6047067, 6053296, 6057061, 6059150, 6062602, 6068961, 6073140, 6075359, 6080669, 6082678, 6087075, 6093128,
6098091, 6100032, 6104469, 6110590, 6112828, 6119127, 6123266, 6125545, 6127981, 6134150, 6137939, 6140088, 6147066, 6148881, 6152900, 6158895,
6162689, 6164970, 6168639, 6174932, 6177686, 6183805, 6187688, 6189635, 6194375, 6200364, 6204921, 6206738, 6213200, 6215355, 6219630, 6225797,
6228582, 6230669, 6234968, 6241203, 6242545, 6248474, 6253007, 6254884, 6260640, 6266699, 6270622, 6272629, 6278455, 6280668, 6284297, 6290658,
6293843, 6295992, 6299757, 6305926, 6308804, 6314799, 6318842, 6320657, 6325397, 6331518, 6335915, 6337856, 6344194, 6346473, 6350652, 6356951,
6359604, 6361823, 6365962, 6372321, 6373539, 6379592, 6384029, 6386038, 6391794, 6397721, 6401740, 6403623, 6409573, 6411662, 6415451, 6421680,
6426526, 6428533, 6432416, 6438475, 6440201, 6446562, 6450231, 6452444, 6455896, 6462131, 6466406, 6468493, 6473935, 6475812, 6480369, 6486298,
6491385, 6493202, 6497735, 6503724, 6506094, 6512261, 6516560, 6518715, 6521151, 6527444, 6531073, 6533354, 6540200, 6542147, 6546070, 6552189,
6554826, 6560801, 6565364, 6567199, 6573661, 6575798, 6580067, 6586248, 6588684, 6590951, 6594610, 6600921, 6603675, 6609776, 6613669, 6615630,
6621101, 6627142, 6631059, 6633080, 6638906, 6641105, 6644740, 6651119, 6654571, 6656640, 6660949, 6667198, 6668540, 6674455, 6678978, 6680873,
6685191, 6691564, 6695737, 6697938, 6703248, 6705275, 6709678, 6715717, 6721473, 6723370, 6727423, 6733332, 6735190, 6741437, 6745192, 6747267,
6750560, 6756747, 6760542, 6762677, 6769655, 6771484, 6775497, 6781474, 6786214, 6788173, 6792600, 6798707, 6800945, 6807258, 6811407, 6813668,
6818441, 6820450, 6824887, 6830940, 6832158, 6838517, 6842656, 6844875, 6850383, 6856612, 6860401, 6862490, 6868440, 6870323, 6874342, 6880269,
6883822, 6885637, 6889680, 6895675, 6898553, 6904722, 6908487, 6910636, 6915112, 6921411, 6925590, 6927869, 6934207, 6936148, 6940545, 6946666,
6949956, 6952111, 6956410, 6962577, 6964947, 6970936, 6975469, 6977286, 6979970, 6986089, 6990012, 6991959, 6998805, 7001086, 7004715, 7011008,
7016227, 7018440, 7022109, 7028470, 7030196, 7036255, 7040138, 7042145, 7045861, 7051790, 7056347, 7058224, 7063666, 7065753, 7070028, 7076263,
7079696, 7086075, 7089710, 7091909, 7097735, 7099756, 7103673, 7109714, 7113430, 7115325, 7119848, 7125763, 7127105, 7133354, 7137663, 7139732,
7144567, 7150748, 7155017, 7157154, 7163616, 7165451, 7170014, 7175989, 7178673, 7180634, 7184527, 7190628, 7193382, 7199693, 7203352, 7205619,
7209437, 7215414, 7219427, 7221256, 7228234, 7230369, 7234164, 7240351, 7244827, 7247088, 7251237, 7257550, 7259788, 7265895, 7270322, 7272281,
7275194, 7281233, 7285636, 7287663, 7292973, 7295174, 7299347, 7305720, 7311228, 7313303, 7317058, 7323305, 7325163, 7331072, 7335125, 7337022,
7343847, 7345676, 7350233, 7356210, 7357552, 7363739, 7368014, 7370149, 7373601, 7379914, 7383583, 7385844, 7391670, 7393629, 7397512, 7403619,
7409024, 7411051, 7414974, 7421013, 7423767, 7430140, 7433769, 7435970, 7438406, 7444653, 7448952, 7451027, 7457489, 7459386, 7463919, 7469828,
7473194, 7475393, 7479572, 7485951, 7488189, 7494230, 7498627, 7500648, 7505388, 7511303, 7515346, 7517241, 7524219, 7526288, 7530053, 7536302,
7539533, 7541670, 7545459, 7551640, 7553498, 7559473, 7563492, 7565327, 7571083, 7577184, 7581621, 7583582, 7588892, 7591159, 7595298, 7601609,
7603070, 7609237, 7612992, 7615147, 7621097, 7622914, 7626967, 7632956, 7638712, 7640659, 7645062, 7651181, 7652399, 7658692, 7662865, 7665146,
7667737, 7674098, 7678247, 7680460, 7686798, 7688805, 7693232, 7699291, 7704031, 7705908, 7709921, 7715850, 7718728, 7724963, 7728758, 7730845,
7734707, 7740760, 7744653, 7746662, 7753508, 7755727, 7759386, 7765745, 7768181, 7770270, 7774539, 7780768, 7783138, 7789065, 7793628, 7795511,
7800532, 7806527, 7811050, 7812865, 7818307, 7820456, 7824765, 7830934, 7834386, 7836665, 7840300, 7846599, 7848325, 7854446, 7858363, 7860304,
7867709, 7869910, 7873539, 7879912, 7882666, 7888705, 7892628, 7894655, 7897339, 7903248, 7907781, 7909678, 7916140, 7918215, 7922514, 7928761,
7933530, 7935665, 7939940, 7946127, 7947469, 7953446, 7958003, 7959832, 7963548, 7969655, 7973538, 7975497, 7981323, 7983584, 7987253, 7993566,
7998448, 8000283, 8004302, 8010277, 8012135, 8018316, 8022105, 8024242, 8029750, 8036061, 8040200, 8042467, 8047777, 8049738, 8054175, 8060276,
8063127, 8065148, 8069545, 8075586, 8077824, 8084203, 8088382, 8090581, 8095057, 8101306, 8105071, 8107140, 8114118, 8116013, 8120056, 8125971,
8126628, 8132687, 8137114, 8139121, 8145459, 8147672, 8151821, 8158182, 8162658, 8164745, 8168540, 8174775, 8177653, 8183582, 8187595, 8189472,
8192963, 8198952, 8203005, 8204822, 8210772, 8212927, 8216682, 8222849, 8228357, 8230638, 8234811, 8241104, 8242322, 8248441, 8252844, 8254791,
8259177, 8265346, 8269655, 8271804, 8277246, 8279061, 8283584, 8289579, 8293295, 8295236, 8299153, 8305274, 8307000, 8313299, 8316934, 8319213,
8324366, 8330725, 8334384, 8336603, 8343449, 8345458, 8349351, 8355404, 8358088, 8359971, 8364534, 8370461, 8372831, 8379060, 8383329, 8385418,
8391797, 8393886, 8398155, 8404384, 8406754, 8412681, 8417244, 8419127, 8421811, 8427864, 8431757, 8433766, 8440612, 8442831, 8446490, 8452849,
8458002, 8460281, 8463916, 8470215, 8471941, 8478062, 8481979, 8483920, 8487636, 8493631, 8498154, 8499969, 8505411, 8507560, 8511869, 8518038,
8522424, 8524371, 8528774, 8534893, 8536111, 8542404, 8546577, 8548858, 8554366, 8560533, 8564288, 8566443, 8572393, 8574210, 8578263, 8584252,
8587743, 8589620, 8593633, 8599562, 8602440, 8608675, 8612470, 8614557, 8619033, 8625394, 8629543, 8631756, 8638094, 8640101, 8644528, 8650587,
8651244, 8657159, 8661202, 8663097, 8670075, 8672144, 8675909, 8682158, 8686634, 8688833, 8693012, 8699391, 8701629, 8707670, 8712067, 8714088,
8716939, 8723040, 8727477, 8729438, 8734748, 8737015, 8741154, 8747465, 8752973, 8755110, 8758899, 8765080, 8766938, 8772913, 8776932, 8778767,
8783649, 8789962, 8793631, 8795892, 8801718, 8803677, 8807560, 8813667, 8817383, 8819212, 8823769, 8829746, 8831088, 8837275, 8841550, 8843685,
8848454, 8854701, 8859000, 8861075, 8867537, 8869434, 8873967, 8879876, 8882560, 8884587, 8888510, 8894549, 8897303, 8903676, 8907305, 8909506,
8916911, 8918852, 8922769, 8928890, 8930616, 8936915, 8940550, 8942829, 8946281, 8952450, 8956759, 8958908, 8964350, 8966165, 8970688, 8976683,
8981704, 8983587, 8988150, 8994077, 8996447, 9002676, 9006945, 9009034, 9011470, 9017829, 9021488, 9023707, 9030553, 9032562, 9036455, 9042508,
9046370, 9048457, 9052252, 9058487, 9061365, 9067294, 9071307, 9073184, 9077924, 9083983, 9088410, 9090417, 9096755, 9098968, 9103117, 9109478,
9112069, 9114350, 9118523, 9124816, 9126034, 9132153, 9136556, 9138503, 9144259, 9150248, 9154301, 9156118, 9162068, 9164223, 9167978, 9174145,
9175606, 9181917, 9186056, 9188323, 9193633, 9195594, 9200031, 9206132, 9211888, 9213723, 9217742, 9223717, 9225575, 9231756, 9235545, 9237682,
9240913, 9247162, 9250927, 9252996, 9259974, 9261869, 9265912, 9271827, 9276567, 9278588, 9282985, 9289026, 9291264, 9297643, 9301822, 9304021,
9307387, 9313296, 9317829, 9319726, 9326188, 9328263, 9332562, 9338809, 9341245, 9343446, 9347075, 9353448, 9356202, 9362241, 9366164, 9368191,
9373596, 9379703, 9383586, 9385545, 9391371, 9393632, 9397301, 9403614, 9407066, 9409201, 9413476, 9419663, 9421005, 9426982, 9431539, 9433368,
9440193, 9442090, 9446143, 9452052, 9453910, 9460157, 9463912, 9465987, 9471495, 9477868, 9482041, 9484242, 9489552, 9491579, 9495982, 9502021,
9504934, 9506893, 9511320, 9517427, 9519665, 9525978, 9530127, 9532388, 9536864, 9543051, 9546846, 9548981, 9555959, 9557788, 9561801, 9567778,
9571596, 9573863, 9577522, 9583833, 9586587, 9592688, 9596581, 9598542, 9601226, 9607201, 9611764, 9613599, 9620061, 9622198, 9626467, 9632648,
9637483, 9639552, 9643861, 9650110, 9651452, 9657367, 9661890, 9663785, 9667501, 9673542, 9677459, 9679480, 9685306, 9687505, 9691140, 9697519,
9700952, 9707187, 9711462, 9713549, 9718991, 9720868, 9725425, 9731354, 9735070, 9737077, 9740960, 9747019, 9748745, 9755106, 9758775, 9760988,
9766207, 9772500, 9776129, 9778410, 9785256, 9787203, 9791126, 9797245, 9799929, 9801746, 9806279, 9812268, 9814638, 9820805, 9825104, 9827259,
9830549, 9836670, 9841067, 9843008, 9849346, 9851625, 9855804, 9862103, 9866579, 9868728, 9872493, 9878662, 9881540, 9887535, 9891578, 9893393,
9896946, 9902873, 9906892, 9908775, 9914725, 9916814, 9920603, 9926832, 9932340, 9934559, 9938698, 9945057, 9946275, 9952328, 9956765, 9958774,
9963547, 9965808, 9969957, 9976270, 9978508, 9984615, 9989042, 9991001, 9995741, 10001718, 10005731, 10007560, 10014538, 10016673, 10020468, 10026655,
10029948, 10032023, 10035778, 10042025, 10043883, 10049792, 10053845, 10055742, 10061498, 10067537, 10071940, 10073967, 10079277, 10081478, 10085651, 10092024,
10096342, 10098237, 10102760, 10108675, 10110017, 10116266, 10120575, 10122644, 10126096, 10132475, 10136110, 10138309, 10144135, 10146156, 10150073, 10156114,
10161585, 10163546, 10167439, 10173540, 10176294, 10182605, 10186264, 10188531, 10190967, 10197148, 10201417, 10203554, 10210016, 10211851, 10216414, 10222389,
10225026, 10231145, 10235068, 10237015, 10243861, 10246142, 10249771, 10256064, 10258500, 10260655, 10264954, 10271121, 10273491, 10279480, 10284013, 10285830,
10290917, 10296846, 10301403, 10303280, 10308722, 10310809, 10315084, 10321319, 10324771, 10326984, 10330653, 10337014, 10338740, 10344799, 10348682, 10350689,
10355535, 10361764, 10365553, 10367642, 10373592, 10375475, 10379494, 10385421, 10391177, 10393186, 10397623, 10403676, 10404894, 10411253, 10415392, 10417611,
10420264, 10426563, 10430742, 10433021, 10439359, 10441300, 10445697, 10451818, 10456558, 10458373, 10462416, 10468411, 10471289, 10477458, 10481223, 10483372,
10486557, 10492918, 10496547, 10498760, 10504586, 10506593, 10510516, 10516575, 10522331, 10524208, 10528741, 10534670, 10536012, 10542247, 10546546, 10548633,
10551418, 10557585, 10561860, 10564015, 10570477, 10572294, 10576851, 10582840, 10587580, 10589527, 10593410, 10599529, 10602283, 10608576, 10612245, 10614526,
10618320, 10624315, 10628334, 10630149, 10637127, 10639276, 10643065, 10649234, 10651670, 10653949, 10658088, 10664387, 10666625, 10672746, 10677183, 10679124,
10684087, 10690140, 10694537, 10696546, 10701856, 10704075, 10708254, 10714613, 10718065, 10720154, 10723919, 10730148, 10732006, 10737933, 10741976, 10743859,
10751620, 10753647, 10758074, 10764113, 10765331, 10771704, 10775853, 10778054, 10781506, 10787753, 10791548, 10793623, 10799573, 10801470, 10805483, 10811392,
10816995, 10818824, 10822877, 10828854, 10831732, 10837919, 10841674, 10843809, 10846245, 10852558, 10856731, 10858992, 10865330, 10867289, 10871692, 10877799,
10881097, 10883234, 10887543, 10893724, 10896094, 10902069, 10906592, 10908427, 10913167, 10919268, 10923185, 10925146, 10931992, 10934259, 10937894, 10944205,
10947374, 10949573, 10953232, 10959611, 10961337, 10967378, 10971271, 10973292, 10979048, 10984963, 10989526, 10991421, 10996863, 10998932, 11003201, 11009450,
11010247, 11016236, 11020793, 11022610, 11029072, 11031227, 11035502, 11041669, 11046145, 11048426, 11052095, 11058388, 11061142, 11067261, 11071144, 11073091,
11076512, 11082571, 11086494, 11088501, 11094327, 11096540, 11100169, 11106530, 11112038, 11114125, 11118424, 11124659, 11126001, 11131930, 11136463, 11138340,
11142666, 11149025, 11153204, 11155423, 11160733, 11162742, 11167139, 11173192, 11176908, 11178791, 11182834, 11188761, 11190619, 11196848, 11200613, 11202702,
11208045, 11214214, 11218003, 11220152, 11227130, 11228945, 11232964, 11238959, 11241643, 11243584, 11248021, 11254142, 11256380, 11262679, 11266818, 11269097,
11275614, 11277749, 11281504, 11287691, 11290569, 11296546, 11300599, 11302428, 11305112, 11311219, 11315622, 11317581, 11323919, 11326180, 11330353, 11336666,
11341369, 11343570, 11347719, 11354092, 11355310, 11361349, 11365776, 11367803, 11371519, 11377428, 11381441, 11383338, 11389288, 11391363, 11395158, 11401405,
11406227, 11408248, 11412141, 11418182, 11419908, 11426287, 11429946, 11432145, 11437653, 11443902, 11448171, 11450240, 11455682, 11457577, 11462140, 11468055,
11471092, 11472927, 11477450, 11483425, 11485795, 11491976, 11496285, 11498422, 11502898, 11509209, 11512844, 11515111, 11521957, 11523918, 11527835, 11533936,
11535529, 11541570, 11546007, 11548028, 11554366, 11556565, 11560704, 11567083, 11569519, 11571588, 11575377, 11581626, 11584504, 11590419, 11594438, 11596333,
11601870, 11607845, 11611888, 11613723, 11619673, 11621810, 11625575, 11631756, 11635208, 11637475, 11641654, 11647965, 11649183, 11655284, 11659681, 11661642,
11666020, 11672207, 11676506, 11678641, 11684083, 11685912, 11690445, 11696422, 11702178, 11704137, 11708060, 11714167, 11715893, 11722206, 11725835, 11728096,
11731203, 11737576, 11741245, 11743446, 11750292, 11752319, 11756202, 11762241, 11766981, 11768878, 11773435, 11779344, 11781714, 11787961, 11792236, 11794311,
11798832, 11801051, 11804686, 11811045, 11813799, 11819852, 11823769, 11825778, 11830518, 11836445, 11840968, 11842851, 11849313, 11851402, 11855711, 11861940,
11864663, 11866812, 11871081, 11877250, 11878592, 11884587, 11889150, 11890965, 11896721, 11902842, 11906735, 11908676, 11914502, 11916781, 11920440, 11926739,
11931645, 11933462, 11937475, 11943464, 11945322, 11951489, 11955284, 11957439, 11960891, 11967184, 11971333, 11973614, 11978924, 11980871, 11985298, 11991417,
11996314, 11998321, 12002724, 12008783, 12011021, 12017382, 12021555, 12023768, 12026204, 12032439, 12036194, 12038281, 12045259, 12047136, 12051189, 12057118,
12060531, 12066712, 12070477, 12072614, 12078564, 12080399, 12084442, 12090417, 12094133, 12096094, 12100491, 12106592, 12107810, 12114121, 12118300, 12120567,
12125204, 12131583, 12135722, 12137921, 12144259, 12146280, 12150717, 12156758, 12159442, 12161337, 12165356, 12171271, 12174149, 12180398, 12184187, 12186256,
12190142, 12196181, 12200064, 12202091, 12208937, 12211138, 12214807, 12221180, 12225656, 12227731, 12232006, 12238253, 12240623, 12246532, 12251089, 12252986,
12255961, 12261938, 12266471, 12268300, 12273742, 12275877, 12280176, 12286363, 12291871, 12294132, 12297761, 12304074, 12305800, 12311907, 12315830, 12317789,
12323562, 12325377, 12329940, 12335935, 12337277, 12343446, 12347715, 12349864, 12355372, 12361671, 12365330, 12367609, 12373435, 12375376, 12379269, 12385390,
12388749, 12390758, 12394675, 12400728, 12403482, 12409841, 12413476, 12415695, 12420171, 12426400, 12430709, 12432798, 12439260, 12441143, 12445666, 12451593,
12454951, 12457164, 12461337, 12467698, 12469936, 12475995, 12480398, 12482405, 12485089, 12491018, 12495071, 12496948, 12503926, 12506013, 12509768, 12516003,
12521280, 12523435, 12527230, 12533397, 12535255, 12541244, 12545257, 12547074, 12550790, 12556909, 12561336, 12563283, 12568593, 12570874, 12575023, 12581316,
12585550, 12587685, 12591984, 12598171, 12599513, 12605490, 12610023, 12611852, 12617608, 12623715, 12627638, 12629597, 12635423, 12637684, 12641313, 12647626,
12650793, 12652994, 12656663, 12663036, 12665790, 12671829, 12675712, 12677739, 12682479, 12688388, 12692945, 12694842, 12701304, 12703379, 12707654, 12713901,
12717187, 12719208, 12723645, 12729686, 12731924, 12738303, 12742442, 12744641, 12747077, 12753326, 12757115, 12759184, 12766162, 12768057, 12772076, 12777991,
12783588, 12785423, 12789466, 12795441, 12797299, 12803480, 12807245, 12809382, 12812834, 12819145, 12823324, 12825591, 12830901, 12832862, 12837259, 12843360,
12847063, 12853052, 12857065, 12858882, 12864832, 12866987, 12870782, 12876949, 12880401, 12882682, 12886831, 12893124, 12894342, 12900461, 12904888, 12906835,
12911792, 12917851, 12922254, 12924261, 12930599, 12932812, 12936985, 12943346, 12945782, 12947869, 12951624, 12957859, 12960737, 12966666, 12970719, 12972596,
12976410, 12982769, 12986404, 12988623, 12995469, 12997478, 13001395, 13007448, 13012188, 13014071, 13018594, 13024521, 13026891, 13033120, 13037429, 13039518,
13042301, 13048470, 13052739, 13054888, 13060330, 13062145, 13066708, 13072703, 13078459, 13080400, 13084293, 13090414, 13092140, 13098439, 13102098, 13104377,
13109652, 13111679, 13115562, 13121601, 13124355, 13130728, 13134397, 13136598, 13141074, 13147321, 13151596, 13153671, 13160133, 13162030, 13166587, 13172496,
13175539, 13177368, 13181901, 13187878, 13189220, 13195407, 13199706, 13201841, 13207349, 13213662, 13217291, 13219552, 13225378, 13227337, 13231260, 13237367,
13242201, 13244338, 13248103, 13254284, 13256142, 13262117, 13266160, 13267995, 13271711, 13277812, 13282209, 13284170, 13289480, 13291747, 13295926, 13302237,
13306942, 13309141, 13313280, 13319659, 13321897, 13327938, 13332375, 13334396, 13337080, 13342995, 13347014, 13348909, 13355887, 13357956, 13361745, 13367994,
13370381, 13376742, 13380915, 13383128, 13389466, 13391473, 13395876, 13401935, 13404619, 13406496, 13410549, 13416478, 13419356, 13425591, 13429346, 13431433,
13436778, 13442945, 13446740, 13448895, 13454845, 13456662, 13460675, 13466664, 13470380, 13472327, 13476754, 13482873, 13484091, 13490384, 13494533, 13496814,
13501120, 13507115, 13511678, 13513493, 13518935, 13521084, 13525353, 13531522, 13537030, 13539309, 13542968, 13549267, 13550993, 13557114, 13561007, 13562948,
13566375, 13572428, 13576345, 13578354, 13585200, 13587419, 13591054, 13597413, 13601889, 13603978, 13608287, 13614516, 13616886, 13622813, 13627336, 13629219,
13635066, 13636881, 13640900, 13646895, 13649773, 13655942, 13659731, 13661880, 13664316, 13670615, 13674754, 13677033, 13683371, 13685312, 13689749, 13695870,
13700765, 13702774, 13707171, 13713224, 13714442, 13720801, 13724980, 13727199, 13730651, 13736880, 13740645, 13742734, 13748684, 13750567, 13754610, 13760537,
13765431, 13767644, 13771273, 13777634, 13779360, 13785419, 13789342, 13791349, 13797105, 13803034, 13807567, 13809444, 13814886, 13816973, 13821272, 13827507,
13830224, 13832379, 13836654, 13842821, 13845191, 13851180, 13855737, 13857554, 13862294, 13868413, 13872296, 13874243, 13881089, 13883370, 13887039, 13893332,
13893731, 13899912, 13904221, 13906358, 13912820, 13914655, 13919178, 13925153, 13929893, 13931854, 13935771, 13941872, 13944626, 13950937, 13954572, 13956839,
13959940, 13966319, 13969978, 13972177, 13978003, 13980024, 13983917, 13989958, 13995714, 13997609, 14002172, 14008087, 14009429, 14015678, 14019947, 14022016,
14026414, 14032453, 14036880, 14038907, 14044217, 14046418, 14050567, 14056940, 14060392, 14062467, 14066262, 14072509, 14074367, 14080276, 14084289, 14086186,
14091721, 14097698, 14101751, 14103580, 14110558, 14112693, 14116448, 14122635, 14125071, 14127332, 14131505, 14137818, 14140056, 14146163, 14150566, 14152525,
14159392, 14161611, 14165790, 14172149, 14173367, 14179420, 14183817, 14185826, 14189542, 14195469, 14199512, 14201395, 14207345, 14209434, 14213199, 14219428,
14224711, 14226860, 14230649, 14236818, 14239696, 14245691, 14249710, 14251525, 14254209, 14260330, 14264767, 14266708, 14273046, 14275325, 14279464, 14285763,
14289133, 14290950, 14295507, 14301496, 14303866, 14310033, 14314308, 14316463, 14320939, 14327232, 14330901, 14333182, 14340028, 14341975, 14345858, 14351977,
14355338, 14357345, 14361268, 14367327, 14369053, 14375414, 14379043, 14381256, 14386764, 14392999, 14397298, 14399385, 14404827, 14406704, 14411237, 14417166,
14418873, 14424914, 14428807, 14430828, 14436654, 14438853, 14442512, 14448891, 14454399, 14456468, 14460737, 14466986, 14468328, 14474243, 14478806, 14480701,
14483678, 14489653, 14494176, 14496011, 14502473, 14504610, 14508919, 14515100, 14519576, 14521843, 14525478, 14531789, 14534543, 14540644, 14544561, 14546522,
14550388, 14556575, 14560330, 14562465, 14569443, 14571272, 14575325, 14581302, 14583986, 14585945, 14590348, 14596455, 14598693, 14605006, 14609179, 14611440,
14616083, 14622456, 14626605, 14628806, 14634116, 14636143, 14640570, 14646609, 14650325, 14652222, 14656235, 14662144, 14664002, 14670249, 14674044, 14676119,
14681382, 14687693, 14691352, 14693619, 14700465, 14702426, 14706319, 14712420, 14715104, 14716939, 14721502, 14727477, 14729847, 14736028, 14740297, 14742434,
14747201, 14753450, 14757759, 14759828, 14765270, 14767165, 14771688, 14777603, 14781319, 14783340, 14787257, 14793298, 14795024, 14801403, 14805038, 14807237,
14812139, 14818048, 14822101, 14823998, 14829948, 14832023, 14835778, 14842025, 14847533, 14849734, 14853907, 14860280, 14861498, 14867537, 14871940, 14873967,
14876812, 14882919, 14887346, 14889305, 14895643, 14897904, 14902053, 14908366, 14912842, 14914977, 14918772, 14924959, 14927837, 14933814, 14937827, 14939656,
14944447, 14946388, 14950785, 14956906, 14959144, 14965443, 14969622, 14971901, 14976377, 14982546, 14986311, 14988460, 14995438, 14997253, 15001296, 15007291,
15010776, 15012659, 15016678, 15022605, 15024463, 15030692, 15034481, 15036570, 15042078, 15048437, 15052576, 15054795, 15060105, 15062114, 15066551, 15072604,
15076978, 15079065, 15083340, 15089575, 15090917, 15096846, 15101403, 15103280, 15106996, 15113055, 15116938, 15118945, 15124771, 15126984, 15130653, 15137014,
15142165, 15144446, 15148075, 15154368, 15157122, 15163241, 15167164, 15169111, 15171795, 15177784, 15182317, 15184134, 15190596, 15192751, 15197050, 15203217,
15206140, 15212055, 15216578, 15218473, 15223915, 15225984, 15230293, 15236542, 15239994, 15242193, 15245828, 15252207, 15253933, 15259974, 15263891, 15265912,
15271323, 15277424, 15281317, 15283278, 15290124, 15292391, 15296050, 15302361, 15304797, 15306934, 15311203, 15317384, 15319754, 15325729, 15330292, 15332127,
15335473, 15341786, 15345935, 15348196, 15354534, 15356493, 15360920, 15367027, 15371767, 15373596, 15377609, 15383586, 15386464, 15392651, 15396446, 15398581,
15401814, 15408061, 15411816, 15413891, 15419841, 15421738, 15425791, 15431700, 15437456, 15439483, 15443886, 15449925, 15451143, 15457516, 15461689, 15463890,
15469413, 15471502, 15475291, 15481520, 15483378, 15489305, 15493324, 15495207, 15500963, 15507016, 15511453, 15513462, 15518772, 15520991, 15525130, 15531489,
15534082, 15536361, 15540540, 15546839, 15549077, 15555198, 15559595, 15561536, 15566276, 15572271, 15576314, 15578129, 15585107, 15587256, 15591021, 15597190,
15601064, 15603011, 15606934, 15613053, 15615807, 15622100, 15625729, 15628010, 15630446, 15636613, 15640912, 15643067, 15649529, 15651346, 15655879, 15661868,
15666895, 15668772, 15673329, 15679258, 15680600, 15686835, 15691110, 15693197, 15696649, 15703010, 15706679, 15708892, 15714718, 15716725, 15720608, 15726667,
15729298, 15735417, 15739820, 15741767, 15747077, 15749358, 15753531, 15759824, 15765332, 15767487, 15771242, 15777409, 15779267, 15785256, 15789309, 15791126,
15794677, 15800606, 15804619, 15806496, 15813474, 15815561, 15819356, 15825591, 15830067, 15832280, 15836429, 15842790, 15845028, 15851087, 15855514, 15857521,
15860831, 15867060, 15871329, 15873418, 15879880, 15881763, 15886326, 15892253, 15894937, 15896946, 15900839, 15906892, 15909646, 15916005, 15919664, 15921883,
15927096, 15933395, 15937030, 15939309, 15945135, 15947076, 15950993, 15957114, 15960830, 15962645, 15967168, 15973163, 15974505, 15980674, 15984983, 15987132,
15994635, 15996896, 16000565, 16006878, 16008604, 16014711, 16018594, 16020553, 16024269, 16030246, 16034803, 16036632, 16042074, 16044209, 16048484, 16054671,
16059500, 16061575, 16065874, 16072121, 16074491, 16080400, 16084933, 16086830, 16089514, 16095553, 16099476, 16101503, 16108349, 16110550, 16114179, 16120552,
16124358, 16126253, 16130296, 16136211, 16139089, 16145338, 16149103, 16151172, 16155648, 16162027, 16166206, 16168405, 16174743, 16176764, 16181161, 16187202,
16190113, 16192074, 16196511, 16202612, 16203830, 16210141, 16214280, 16216547, 16222055, 16228236, 16232025, 16234162, 16240112, 16241947, 16245966, 16251941,
16253256, 16259491, 16263286, 16265373, 16272351, 16274228, 16278241, 16284170, 16288910, 16290917, 16295344, 16301403, 16303641, 16310002, 16314151, 16316364,
16319023, 16325316, 16329489, 16331770, 16337080, 16339027, 16343430, 16349549, 16355305, 16357122, 16361175, 16367164, 16369022, 16375189, 16378944, 16381099,
16385925, 16392046, 16395963, 16397904, 16403730, 16406009, 16409644, 16415943, 16419395, 16421544, 16425853, 16432022, 16433364, 16439359, 16443882, 16445697,
16450786, 16456713, 16461276, 16463159, 16469621, 16471710, 16475979, 16482208, 16484644, 16486863, 16490522, 16496881, 16499635, 16505688, 16509581, 16511590,
16518353, 16520250, 16524783, 16530692, 16533062, 16539309, 16543608, 16545683, 16548119, 16554492, 16558121, 16560322, 16567168, 16569195, 16573118, 16579157,
16584630, 16586589, 16590472, 16596579, 16598305, 16604618, 16608287, 16610548, 16614000, 16620187, 16624462, 16626597, 16632039, 16633868, 16638425, 16644402,
16648732, 16650999, 16655138, 16661449, 16662667, 16668768, 16673205, 16675166, 16680922, 16686897, 16690916, 16692751, 16698701, 16700838, 16704627, 16710808,
16714107, 16716176, 16719941, 16726190, 16729068, 16734983, 16739026, 16740921, 16745661, 16751702, 16756099, 16758120, 16764458, 16766657, 16770836, 16777215 };
static const uint8_t scramble_code[180] = {
1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1,
0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1,
1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1,
0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0,
1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1,
1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0,
1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
};
// frame sync dibits
static const uint8_t ysf_fs[20] = { 3, 1, 1, 0, 1, 3, 0, 1, 3, 0, 2, 1, 1, 2, 0, 3, 1, 0, 3, 1 };
#endif /* INCLUDED_YSF_CONST_H */

View File

@ -0,0 +1,452 @@
/* -*- c++ -*- */
/*
* YSF Encoder (C) Copyright 2017 Max H. Parke KA1RBI
*
* This file is part of OP25
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "mbelib.h"
#include "p25p2_vf.h"
#include "ysf_tx_sb_impl.h"
#include "ysf_const.h"
#include <op25_imbe_frame.h>
#include <vector>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <assert.h>
#if 0
static inline void print_result(char title[], const uint8_t r[], int len) {
uint8_t buf[256];
for (int i=0; i<len; i++){
buf[i] = r[i] + '0';
}
buf[len] = 0;
printf("%s: %s\n", title, buf);
}
#endif
static inline int store_i(int reg, uint8_t val[], int len) {
for (int i=0; i<len; i++){
val[i] = (reg >> (len-1-i)) & 1;
}
}
static inline void bits_to_dibits(uint8_t* dest, const uint8_t* src, int n_dibits) {
for (int i=0; i<n_dibits; i++) {
dest[i] = src[i*2] * 2 + src[i*2+1];
}
}
static inline void bool_to_dibits(uint8_t* dest, const std::vector<bool> src, int n_dibits) {
for (int i=0; i<n_dibits; i++) {
int l = src[i*2] ? 1 : 0;
int r = src[i*2+1] ? 1 : 0;
dest[i] = l * 2 + r;
}
}
static inline int load_i(const uint8_t val[], int len) {
int acc = 0;
for (int i=0; i<len; i++){
acc = (acc << 1) + (val[i] & 1);
}
return acc;
}
// unpacks bytes into bits, len is length of result
static inline void unpack_bytes(uint8_t result[], const char src[], int len) {
static const int nbytes = len / 8;
int outp = 0;
for (int i=0; i < len; i++) {
result[i] = (src[i>>3] >> (7-(i%8))) & 1;
}
}
static inline uint16_t crc16(const uint8_t buf[], int len) {
uint32_t poly = (1<<12) + (1<<5) + (1<<0);
uint32_t crc = 0;
for(int i=0; i<len; i++) {
uint8_t bit = buf[i] & 1;
crc = ((crc << 1) | bit) & 0x1ffff;
if (crc & 0x10000)
crc = (crc & 0xffff) ^ poly;
}
crc = crc ^ 0xffff;
return crc & 0xffff;
}
// trellis_1_2 encode: source is in bits, result in dibits
static inline void trellis_encode(uint8_t result[], const uint8_t source[], int result_len)
{
static const int pc[] = {0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1};
int reg = 0;
for (int i=0; i<result_len; i++) {
reg = (reg << 1) | source[i];
result[i] = (pc[reg & 0x19]<<1) + pc[reg & 0x17];
}
}
static inline void trellis_interleave(uint8_t result[], const uint8_t input[], int x, int y)
{
static uint8_t tmp_result[200];
assert (x*y <= sizeof(tmp_result));
trellis_encode(tmp_result, input, x*y);
for (int i=0; i<x; i++) {
for (int j=0; j<y; j++) {
result[i+j*x] = tmp_result[j+i*y];
}
}
}
static inline void generate_fich(uint8_t result[100], int fi, int cs, int cm, int bn, int bt, int fn, int ft, int rsv, int dev, int mr, int voip, int dt, int sql, int sc)
{
int reg;
reg = fi & 3;
reg = (reg << 2) + (cs & 3);
reg = (reg << 2) + (cm & 3);
reg = (reg << 2) + (bn & 3);
reg = (reg << 2) + (bt & 3);
reg = (reg << 3) + (fn & 7);
reg = (reg << 3) + (ft & 7);
reg = (reg << 1) + (rsv & 1);
reg = (reg << 1) + (dev & 1);
reg = (reg << 3) + (mr & 7);
reg = (reg << 1) + (voip & 1);
reg = (reg << 2) + (dt & 3);
reg = (reg << 1) + (sql & 1);
reg = (reg << 7) + (sc & 0x7f);
uint8_t fich_bits[48];
memset(fich_bits, 0, sizeof(fich_bits));
store_i(reg, fich_bits, 32);
uint16_t crc = crc16(fich_bits, 48);
store_i(crc, fich_bits+32, 16);
uint8_t pre_trellis[100];
store_i(gly_24_12[ load_i(fich_bits+12*0, 12) ], pre_trellis+24*0, 24);
store_i(gly_24_12[ load_i(fich_bits+12*1, 12) ], pre_trellis+24*1, 24);
store_i(gly_24_12[ load_i(fich_bits+12*2, 12) ], pre_trellis+24*2, 24);
store_i(gly_24_12[ load_i(fich_bits+12*3, 12) ], pre_trellis+24*3, 24);
pre_trellis[96] = 0;
pre_trellis[97] = 0;
pre_trellis[98] = 0;
pre_trellis[99] = 0;
trellis_interleave(result, pre_trellis, 20, 5);
}
static inline void scramble(uint8_t buf[], int len)
{
assert(len <= sizeof(scramble_code));
for (int i=0; i<len; i++) {
buf[i] = buf[i] ^ scramble_code[i];
}
}
// encode DCH - input is bits, result is dibits
static inline void generate_dch(uint8_t result[180], const uint8_t input[160])
{
uint8_t pre_trellis[180];
memset(pre_trellis, 0, sizeof(pre_trellis));
memcpy(pre_trellis, input, 160);
scramble(pre_trellis, 160);
uint16_t crc = crc16(pre_trellis, 176);
store_i(crc, pre_trellis+160, 16);
pre_trellis[176] = 0;
pre_trellis[177] = 0;
pre_trellis[178] = 0;
pre_trellis[179] = 0;
trellis_interleave(result, pre_trellis, 20, 9);
}
// encode DCH V/D mode type 2 - input is bits, result is dibits
static inline void generate_dch_vd2(uint8_t result[100], const uint8_t input[80])
{
uint8_t pre_trellis[100];
memset(pre_trellis, 0, sizeof(pre_trellis));
memcpy(pre_trellis, input, 80);
scramble(pre_trellis, 80);
uint16_t crc = crc16(pre_trellis, 96);
store_i(crc, pre_trellis+80, 16);
pre_trellis[96] = 0;
pre_trellis[97] = 0;
pre_trellis[98] = 0;
pre_trellis[99] = 0;
trellis_interleave(result, pre_trellis, 20, 5);
}
// encode VCH V/D mode type 2 - input is bits, result is dibits
static inline void generate_vch_vd2(uint8_t result[52], const uint8_t input[49])
{
uint8_t buf[104];
for (int i=0; i<27; i++) {
buf[0+i*3] = input[i];
buf[1+i*3] = input[i];
buf[2+i*3] = input[i];
}
memcpy(buf+81, input+27, 22);
buf[103] = 0;
scramble(buf, 104);
uint8_t bit_result[104];
int x=4;
int y=26;
for (int i=0; i<x; i++) {
for (int j=0; j<y; j++) {
bit_result[i+j*x] = buf[j+i*y];
}
}
bits_to_dibits(result, bit_result, 52);
}
namespace gr {
namespace op25_repeater {
ysf_tx_sb::sptr
ysf_tx_sb::make(int verbose_flag, const char * config_file, bool fullrate_mode)
{
return gnuradio::get_initial_sptr
(new ysf_tx_sb_impl(verbose_flag, config_file, fullrate_mode));
}
//////////////////////////////////////////////////////////////////////////
static const int MIN_IN = 1;
static const int MAX_IN = 1;
static const int MIN_OUT = 1;
static const int MAX_OUT = 1;
/*
* The private constructor
*/
ysf_tx_sb_impl::ysf_tx_sb_impl(int verbose_flag, const char * config_file, bool fullrate_mode)
: gr::block("ysf_tx_sb",
gr::io_signature::make (MIN_IN, MAX_IN, sizeof(short)),
gr::io_signature::make (MIN_OUT, MAX_OUT, sizeof(char))),
d_verbose_flag(verbose_flag),
d_config_file(config_file),
d_fullrate_mode(fullrate_mode),
d_ft(0),
d_mr(0),
d_sq(0),
d_sc(0),
d_dev(0),
d_voip(0)
{
memset(d_dest, ' ', 10);
memset(d_src, ' ', 10);
memset(d_down, ' ', 10);
memset(d_up, ' ', 10);
memset(d_rem12, ' ', 10);
memset(d_rem34, ' ', 10);
set_output_multiple(480);
d_halfrate_encoder.set_49bit_mode();
config();
}
/*
* Our virtual destructor.
*/
ysf_tx_sb_impl::~ysf_tx_sb_impl()
{
}
void ysf_tx_sb_impl::write_fich(uint8_t result[100]) {
}
static inline void sstring(const char s[], char dest[10]) {
memset(dest, ' ', 10);
memcpy(dest, s, std::min(strlen(s), 10UL));
for (int i=0; i<10; i++) {
if (dest[i] < ' ')
dest [i] = ' ';
}
}
void
ysf_tx_sb_impl::config()
{
FILE * fp1 = fopen(d_config_file, "r");
char line[256];
char * cp;
if (!fp1) {
fprintf(stderr, "ysf_tx_sb_impl:config: failed to open %s\n", d_config_file);
return;
}
for (;;) {
cp = fgets(line, sizeof(line) - 2, fp1);
if (!cp) break;
if (line[0] == '#') continue;
if (memcmp(line, "ft=", 3) == 0)
sscanf(&line[3], "%d", &d_ft);
else if (memcmp(line, "mr=", 3) == 0)
sscanf(&line[3], "%d", &d_mr);
else if (memcmp(line, "sq=", 3) == 0)
sscanf(&line[3], "%d", &d_sq);
else if (memcmp(line, "sc=", 3) == 0)
sscanf(&line[3], "%d", &d_sc);
else if (memcmp(line, "dev=", 4) == 0)
sscanf(&line[4], "%d", &d_dev);
else if (memcmp(line, "voip=", 5) == 0)
sscanf(&line[5], "%d", &d_voip);
else if (memcmp(line, "dest=", 5) == 0)
sstring(&line[5], d_dest);
else if (memcmp(line, "src=", 4) == 0)
sstring(&line[4], d_src);
else if (memcmp(line, "down=", 5) == 0)
sstring(&line[5], d_down);
else if (memcmp(line, "up=", 3) == 0)
sstring(&line[3], d_up);
else if (memcmp(line, "rem12=", 6) == 0)
sstring(&line[6], d_rem12);
else if (memcmp(line, "rem34=", 6) == 0)
sstring(&line[6], d_rem34);
}
fclose(fp1);
d_ft &= 0x7;
d_mr &= 0x7;
d_sq &= 0x1;
d_sc &= 0x7f;
d_dev &= 0x1;
int dt = (d_fullrate_mode) ? 3 : 2;
uint8_t tmp80[80];
if (d_fullrate_mode) {
generate_fich(d_fich[0], 1, 2, 0, 0, 0, 0, 0, 0, d_dev, d_mr, d_voip, dt, d_sq, d_sc);
} else {
generate_fich(d_fich[0], 1, 2, 0, 0, 0, 0, d_ft, 0, d_dev, d_mr, d_voip, dt, d_sq, d_sc);
generate_fich(d_fich[1], 1, 2, 0, 0, 0, 1, d_ft, 0, d_dev, d_mr, d_voip, dt, d_sq, d_sc);
generate_fich(d_fich[2], 1, 2, 0, 0, 0, 2, d_ft, 0, d_dev, d_mr, d_voip, dt, d_sq, d_sc);
generate_fich(d_fich[3], 1, 2, 0, 0, 0, 3, d_ft, 0, d_dev, d_mr, d_voip, dt, d_sq, d_sc);
generate_fich(d_fich[4], 1, 2, 0, 0, 0, 4, d_ft, 0, d_dev, d_mr, d_voip, dt, d_sq, d_sc);
generate_fich(d_fich[5], 1, 2, 0, 0, 0, 5, d_ft, 0, d_dev, d_mr, d_voip, dt, d_sq, d_sc);
unpack_bytes(tmp80, d_dest, 80);
generate_dch_vd2(d_vd2_dch[0], tmp80);
unpack_bytes(tmp80, d_src, 80);
generate_dch_vd2(d_vd2_dch[1], tmp80);
unpack_bytes(tmp80, d_down, 80);
generate_dch_vd2(d_vd2_dch[2], tmp80);
unpack_bytes(tmp80, d_up, 80);
generate_dch_vd2(d_vd2_dch[3], tmp80);
unpack_bytes(tmp80, d_rem12, 80);
generate_dch_vd2(d_vd2_dch[4], tmp80);
unpack_bytes(tmp80, d_rem34, 80);
generate_dch_vd2(d_vd2_dch[5], tmp80);
d_next_fn = 0;
}
}
void
ysf_tx_sb_impl::forecast(int nof_output_items, gr_vector_int &nof_input_items_reqd)
{
// each 480-dibit output frame contains five voice code words=800 samples
const size_t nof_inputs = nof_input_items_reqd.size();
const int nof_vcw = nof_output_items / 480.0;
const int nof_samples_reqd = nof_vcw * 5 * 160;
std::fill(&nof_input_items_reqd[0], &nof_input_items_reqd[nof_inputs], nof_samples_reqd);
}
int
ysf_tx_sb_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
int nconsumed = 0;
int16_t *in;
in = (int16_t *) input_items[0];
uint8_t *out = reinterpret_cast<uint8_t*>(output_items[0]);
int nframes=0;
int16_t frame_vector[8];
voice_codeword cw(voice_codeword_sz);
uint8_t ambe_49bit_codeword[49];
for (int n=0;n < (noutput_items/480);n++) {
// need (at least) five voice codewords worth of samples
if (ninput_items[0] - nconsumed < 5*160) break;
memcpy(out, ysf_fs, sizeof(ysf_fs));
if (d_fullrate_mode) {
memcpy(out+20, d_fich[0], 100);
} else {
d_next_fn = (d_next_fn + 1) % (d_ft+1);
memcpy(out+20, d_fich[d_next_fn], 100);
}
// TODO: would be nice to multithread these 5
for (int vcw = 0; vcw < 5; vcw++) {
if (d_fullrate_mode) {
d_fullrate_encoder.imbe_encode(frame_vector, in+vcw*160);
imbe_header_encode(cw, frame_vector[0], frame_vector[1], frame_vector[2], frame_vector[3], frame_vector[4], frame_vector[5], frame_vector[6], frame_vector[7]);
bool_to_dibits(out + vcw*72 + 120, cw, 72);
} else { /* halfrate mode */
d_halfrate_encoder.encode(in+vcw*160, ambe_49bit_codeword);
generate_vch_vd2(out + vcw*72 + 120 + 20, ambe_49bit_codeword);
memcpy(out + vcw*72 + 120,d_vd2_dch[d_next_fn]+vcw*20, 20);
}
in += 160;
nconsumed += 160;
}
nframes += 1;
out += 480;
}
// Tell runtime system how many input items we consumed on
// each input stream.
if (nconsumed)
consume_each(nconsumed);
// Tell runtime system how many output items we produced.
return (nframes * 480);
}
} /* namespace op25_repeater */
} /* namespace gr */

View File

@ -0,0 +1,84 @@
/* -*- c++ -*- */
/*
* YSF Encoder (C) Copyright 2017 Max H. Parke KA1RBI
*
* This file is part of OP25
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_OP25_REPEATER_YSF_TX_SB_IMPL_H
#define INCLUDED_OP25_REPEATER_YSF_TX_SB_IMPL_H
#include <op25_repeater/ysf_tx_sb.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <stdint.h>
#include <vector>
#include <deque>
#include <algorithm>
#include "imbe_vocoder/imbe_vocoder.h"
#include "ambe_encoder.h"
namespace gr {
namespace op25_repeater {
class ysf_tx_sb_impl : public ysf_tx_sb
{
private:
void config(void);
public:
ysf_tx_sb_impl(int verbose_flag, const char * config_file, bool fullrate_mode);
~ysf_tx_sb_impl();
void forecast (int noutput_items, gr_vector_int &ninput_items_required);
int general_work(int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
private:
int d_verbose_flag;
int d_fullrate_mode;
const char * d_config_file;
imbe_vocoder d_fullrate_encoder;
ambe_encoder d_halfrate_encoder;
void write_fich(uint8_t result[]);
int d_ft;
int d_mr;
int d_sq;
int d_sc;
int d_dev;
int d_voip;
char d_dest[10];
char d_src[10];
char d_down[10];
char d_up[10];
char d_rem12[10];
char d_rem34[10];
uint8_t d_fich[8][100];
uint8_t d_vd2_dch[8][100];
int d_next_fn;
};
} // namespace op25_repeater
} // namespace gr
#endif /* INCLUDED_OP25_REPEATER_YSF_TX_SB_IMPL_H */