diff --git a/src/cascade.h b/src/cascade.h deleted file mode 100644 index 232d30f65..000000000 --- a/src/cascade.h +++ /dev/null @@ -1,28 +0,0 @@ -const int8_t stages_array[13]={ -9,16,27,32,52,53,62,72,83,91,99,115,127 -}; - -const int16_t stages_thresh_array[13]={ --1290,-1275,-1191,-1140,-1122,-1057,-1029,-994,-983,-933,-990,-951,-912 -}; - -const int16_t weights_array[2514]={ --4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,8192,8192,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,8192,8192,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,12288,0,-4096,8192,0,-4096,12288,0,-4096,8192,8192,-4096,12288,0,-4096,12288,0,-4096,12288,0,-4096,12288,0 -}; - -const int16_t tree_thresh_array[838]={ --129,50,89,23,61,407,11,-77,24,-86,83,87,375,148,-78,33,75,-28,-40,64,-84,-563,58,41,374,285,129,58,59,-12,134,-29,206,192,-284,-200,347,-7,473,-210,-174,1522,79,71,162,-37,7,123,-322,8,110,-184,-269,64,596,25,27,75,81,-1136,37,-154,75,-45,138,-146,-46,-267,-173,7,-529,93,-139,107,91,-23,178,234,9,53,-108,-23,-67,-279,163,770,319,0,348,36,36,-96,28,138,-13,119,-34,-44,-100,15,-50,-19,314,117,80,-119,-119,80,17,-145,-66,-90,-93,68,-54,-138,69,13,342,1056,-149,-67,-15,-26,-15,-186,-98,-317,96,-10,491,9,285,-191,-205,123,373,52,65,9,130,11,-49,87,124,-184,-293,242,27,168,-3,-124,-52,153,100,233,-66,-722,721,-30,249,-119,-186,152,-99,-244,-123,30,-8,85,-27,76,-181,93,-4,70,-141,274,973,-52,43,69,-29,43,25,53,12,-447,33,128,130,27,107,52,107,-61,-159,-23,-6,-116,271,36,46,-11,46,29,130,103,30,134,-11,-155,-159,11,-221,-34,138,-460,-42,-20,-38,-48,-95,69,-98,-151,-252,88,-15,183,234,-46,-49,92,-81,65,-37,-18,521,195,219,-162,-275,546,-856,-268,253,-104,-142,-74,61,189,63,52,201,51,-76,171,-210,-290,68,-25,-161,0,-91,7,4,160,254,8,3,-28,-97,-420,-39,163,-53,-207,102,-31,175,0,37,45,-214,-942,-67,-70,-150,-42,-56,120,98,25,-91,-28,-166,-100,10,-80,-121,-61,-248,-52,-82,-125,-84,-7,-128,77,25,-41,-5,-16,-180,-248,-134,-603,-48,594,210,12,-178,528,-373,58,134,51,60,-137,583,-25,74,102,190,-36,167,-140,-162,10,112,143,18,11,144,106,-64,-31,85,245,159,88,-112,42,101,-65,199,5,-360,75,144,-835,-68,154,9,-60,-197,-120,-189,-114,-23,-41,46,212,136,-59,-140,-330,-3,397,149,211,-100,1340,31,662,-19,-75,318,77,-325,-278,-24,130,-122,-329,15,137,33,413,-40,29,102,1143,-181,-57,564,141,76,102,234,61,36,124,-180,75,43,-188,339,-36,175,-35,-17,33,396,-125,-249,-156,-39,200,-170,-82,-4,-137,79,-1,-1,-382,-318,69,-87,-52,32,421,-153,104,2,-1182,373,493,-302,-135,-179,741,-48,18,28,-97,-275,-267,93,-77,-28,-164,-166,-50,-111,-361,-32,-171,187,-577,-242,17,-8,1127,-108,167,22,130,-169,-393,-47,75,-139,-100,200,-84,-94,264,51,-49,-108,-104,160,-24,-139,166,104,817,50,160,-126,-145,-252,-48,274,-84,-91,4,146,125,22,-25,-124,-39,-233,16,138,-141,192,-35,268,-180,70,135,-86,121,226,-137,80,-85,133,-44,-40,-15,-171,-140,41,-368,106,-15,130,79,7,-180,-183,-440,-526,-183,-180,-502,-81,-63,-200,229,-40,55,26,29,19,39,-112,-161,-125,-6,781,21,98,-108,22,222,0,62,69,124,26,580,79,-70,-25,-65,-414,-30,181,-476,19,91,-49,229,-35,27,-74,-93,52,-56,128,381,106,67,-7,-36,92,-154,-22,-97,-108,50,395,-112,-64,-8,49,-63,-17,-86,-69,-167,-33,-78,-181,-255,-4,97,87,82,-117,14,233,-384,72,935,-749,-286,62,27,-65,53,53,-163,61,-84,-91,-32,62,-129,-126,-63,144,-73,-13,64,122,12,347,-240,183,165,154,248,-81,-679,282,46,6,326,-234,30,-73,387,22,28,141,-212,-283,-22,280,-274,-86,83,-192,768,-177,81,33,111,-375,-51,60,119,35,-224,-60,102,190,72,668,53,-64,329,144,135,49,176,124,145,-59,51,41,118,2,198,132,136,26,-23,52,24,10,-69,115,42,40,106,-104,-14,37,86,-209,-255,-135,-153,508,-36,-245,25,-72,72,21,-43,855,-108,241,-47,188,-93,-33,14,202,14,-126,354,-559,-23,-73,-81,-235,-340,-220,-34,226,-275,-97,22,87,-100,-80,-218,29,-92,-337,536,58,26,-188,236,-24,-213,190,30,88,-73,-152,-1,102,38,132,-25,210,-108,-63,79,137,118,0,-201,313,97,15,-366,-61,-45,387,2254,169,101,208,-69,-498,-14,474,151,47,-82,-117,-23,-227,-60,-29,-184,263,-60,184,-4,202,119,142,-25,63,11,-219,-78,-226,230,-97,7,-154,-98 -}; - -const int16_t alpha1_array[838]={ -534,-477,-386,-223,-199,142,-432,-378,-219,318,-414,-497,-142,68,-684,-277,-90,237,296,-107,373,286,-89,-155,99,-259,-421,118,-167,-357,-129,93,-77,-103,269,-416,72,-259,-42,388,451,-80,-25,-103,43,227,-95,16,-447,-240,-13,-468,295,-400,-147,-373,-213,-80,-111,381,-246,-626,44,124,45,-501,253,-660,368,-126,-596,-216,-369,46,17,100,37,63,-193,-93,-594,108,284,-851,-311,-123,-276,-307,-112,-47,77,319,-152,72,123,68,-335,116,-443,-49,-412,190,-68,-15,-89,-268,211,52,52,-332,-335,-269,-351,-9,-255,370,-95,-147,4,-20,-294,95,67,193,57,-323,222,-355,16,-137,-90,-150,-85,178,220,49,-228,-322,-220,-191,-323,-251,164,-61,-87,281,402,-70,-280,78,66,-315,104,-24,-105,64,-240,318,-83,89,14,-262,263,55,-408,-263,-378,-61,74,-59,-309,62,-350,54,83,-72,-591,73,-69,-392,19,36,-282,3,-88,51,-104,-569,-73,-227,-285,-258,66,-146,-141,-329,446,-269,145,334,-118,-106,92,-228,75,-203,39,8,-100,22,141,-473,-123,-115,-216,90,47,-320,-208,-237,144,205,-217,-103,-391,161,150,-65,74,-101,53,112,240,2,-259,-96,-206,-270,51,-97,54,-262,-263,-53,225,267,35,-425,204,-245,50,-265,-315,-194,-99,-183,141,-114,-279,214,-65,80,-268,41,-176,63,-129,10,36,-229,-116,86,-202,-584,100,8,-277,-481,37,-260,39,-197,-29,17,-450,245,119,181,-281,-279,-67,-56,47,-237,502,54,-300,-287,-43,211,-295,-268,-279,108,-235,-408,-169,49,-162,-48,-27,-276,87,121,249,-556,-164,-377,108,6,40,-103,-510,-159,259,-262,-291,-145,78,-440,59,-311,83,-81,-28,101,0,192,-212,-152,40,8,-133,-136,51,11,-233,23,54,-69,-26,16,-237,34,50,-292,43,-121,-553,11,-8,-337,94,-65,-19,-201,435,198,-382,-546,145,173,63,3,-2,115,-243,-515,101,-63,-14,11,-125,-76,-153,-7,95,-255,36,-54,-337,126,108,-7,-202,-576,-65,-57,-73,-8,152,-122,58,-66,-153,181,-143,-182,-285,-104,-97,-179,-139,-25,216,67,39,-509,-82,152,5,-112,-228,54,3,257,-376,-208,29,33,-301,161,47,-238,9,93,50,-429,-787,54,-293,214,-71,45,246,2,-136,210,-50,-6,-347,-165,215,49,-186,-92,14,120,-290,251,-72,-163,95,-334,-523,198,44,-384,73,354,-57,-406,-305,-39,66,-22,192,31,-93,-19,200,-229,211,4,289,-147,-5,-139,-313,37,-71,-62,-219,177,-42,112,-250,-231,-202,-77,-230,-107,117,233,-376,-268,74,-329,-219,41,40,5,-42,-249,252,121,-245,-134,43,-290,66,50,-13,272,-47,-7,255,-7,0,-391,8,196,41,-250,118,65,-206,-336,51,249,-48,-174,48,-60,63,-266,131,414,764,154,-158,169,-287,-275,207,-5,173,14,-33,-96,-149,-77,151,248,233,-154,11,-239,46,-330,-11,-3,-68,-131,106,-63,-57,16,48,-242,94,246,-785,58,0,243,-25,2,165,-9,177,-103,-165,250,-26,156,-260,-105,-149,-237,30,-148,-98,301,-220,-191,235,68,-72,-157,147,83,22,88,60,-190,-231,-88,-239,-136,235,-181,-222,-58,-77,68,-302,-139,-69,-233,-112,6,202,205,-51,-11,-231,90,-50,-358,0,-125,-312,95,-75,-368,-577,96,-75,-255,12,38,-3,-36,-4,-443,-61,1,9,19,-434,161,-85,58,49,23,-446,-61,301,35,-139,-55,16,175,445,78,-54,-203,95,-3,310,-5,-271,-8,9,-20,-491,123,-50,50,-49,463,199,39,-42,-26,-9,-14,71,32,5,48,18,12,-69,13,97,39,6,41,-157,-217,-208,-93,-304,84,-130,-268,-129,-254,-24,59,-26,0,-167,72,39,-74,349,312,-209,-312,30,-299,-273,-92,125,150,-19,70,-1,210,33,-232,2,455,146,-82,49,17,-99,-6,-491,-328,-103,-186,148,234,-132,61,42,-349,-437,-80,38,190,-104,208,84,-321,353,-9,-47,-114,173,-3,86,-271,37,-62,33,-268,-387,35,73,-69,47,83,29,-283,205,-67,4,3,-78,-411,19,-1,-61,490,-64,-177,46,-7,16,2,38,99,-397,55,-12,-65,-46,139,-177,75,236,-203,84,-351,16,92,-39,34,27,-2,0,-120,-2,-88,383,-254,-147,-8,102,46,139,174 -}; - -const int16_t alpha2_array[838]={ --567,339,272,301,322,-479,112,113,218,-402,302,179,442,-558,116,137,238,-169,-76,347,-50,-135,292,197,-387,375,256,-408,212,108,269,-344,371,310,-117,39,-400,59,327,-77,-13,393,239,246,-757,-112,102,-677,72,59,275,25,-274,196,353,132,149,299,244,-35,70,60,-343,-230,-418,46,-97,63,-75,161,13,99,25,-322,-609,-70,-291,-324,69,181,9,-12,-89,54,277,359,189,96,323,117,-245,11,138,-381,-134,-409,39,-184,17,174,19,-55,335,312,217,76,-83,-214,-171,35,19,49,17,199,31,3,135,100,-542,252,24,-37,-148,-43,-163,64,-69,60,-323,77,135,61,132,-3,-66,-151,267,141,163,136,92,92,-128,218,292,-46,-80,267,50,-340,-179,57,-131,158,121,-175,29,-14,211,-45,-396,61,-81,-211,13,33,9,126,-146,163,16,-255,9,-266,-138,113,0,-165,205,54,-270,-219,16,162,144,-385,96,31,173,243,125,127,-320,152,77,57,-25,47,-119,-67,106,151,-117,36,-249,46,-339,-536,131,-328,-118,11,88,109,42,-120,-427,9,59,25,-48,-97,50,129,59,-81,-3,266,-213,116,-384,-98,-27,-430,61,119,45,18,-395,96,-317,13,58,314,-11,-55,-486,1,-21,16,-195,210,75,148,229,129,-180,181,68,-98,66,-150,43,-224,60,-144,98,-355,-273,50,111,-114,57,-1,-133,-386,47,0,-568,15,-303,31,181,-269,49,-64,-54,-71,62,14,50,269,-440,15,7,-123,41,10,82,-67,38,10,39,-108,47,0,79,-166,39,391,166,9,-25,-87,-4,-7,42,0,-45,-327,-388,83,38,284,-157,101,73,115,-174,15,-442,31,-207,172,215,-121,242,-80,45,63,-109,-409,96,63,-369,-348,69,-208,-191,207,220,-253,39,-180,-103,18,-184,67,37,-275,311,3,-39,180,85,19,12,-62,31,-6,-30,-68,-165,-317,260,-92,52,-5,-75,277,311,-272,43,132,63,-592,-83,18,-441,260,38,-74,-86,-600,39,-7,60,236,79,-693,-8,58,-267,196,71,-65,280,135,103,189,188,97,93,203,-84,-247,-271,34,154,-54,-375,52,26,-102,-411,-34,2,66,-183,-421,6,-26,-137,51,-258,-70,-136,53,-9,-182,4,-16,203,-175,-55,319,37,-3,276,291,-1,61,-52,-312,13,74,-171,4,6,7,151,67,-85,40,-6,-11,-114,36,-97,16,203,29,-1,104,-98,196,-57,-372,66,124,-56,37,-51,69,-48,40,-419,61,-1,-115,112,64,6,0,389,-55,5,164,147,336,74,136,-114,-70,52,17,-133,11,47,-176,-215,-349,66,16,-4,-83,51,57,-274,9,-183,-136,249,-60,117,-682,6,-555,191,2,254,-63,-156,7,-34,-133,38,0,-157,-53,122,28,-383,208,-17,12,-1,-47,24,-69,40,-60,50,5,-4,-444,-14,-197,171,79,65,105,4,-53,10,43,209,6,-87,0,64,-366,85,33,-79,181,49,-227,-70,6,-44,-51,29,-116,100,-51,52,-261,-23,-493,-17,47,56,-47,95,-68,147,258,144,79,-286,84,134,-8,30,53,-72,-179,187,39,-87,-33,-245,-119,-134,55,16,55,12,44,-56,46,14,134,143,-179,11,66,148,50,54,197,-63,-9,282,184,11,-96,286,49,-297,42,-3,-21,152,34,-8,4,136,41,-192,-167,-314,110,-305,36,138,144,-203,379,-7,8,76,-97,-135,538,-10,91,-45,-332,35,100,-184,16,-42,-42,187,52,-75,103,-44,178,0,137,-191,85,-9,4,186,-125,197,17,-47,-410,304,100,-412,138,-81,-263,-202,-214,-160,402,98,134,-72,-78,-223,-51,20,145,114,173,49,-182,29,51,93,32,147,-134,122,-398,48,-114,-54,133,7,-57,37,4,-252,5,50,97,-37,-71,154,-96,264,-57,-303,11,274,-44,-18,102,-311,-182,46,-395,42,-4,60,14,-4,-54,47,-101,-657,-3,42,84,-124,-57,48,-53,-153,-5,15,-394,95,35,-4,-313,0,-3,-317,131,-181,0,37,-119,-106,111,-243,-78,-506,-2,-8,99,150,-242,54,-7,297,-285,53,-40,46,11,-191,-428,195,-226,-630,-76,41,-95,152,141,104,-60,40,-87,24,8,-13,-5,234,-73,136,-113,-655,-283,145,32,223,53,14,-2,43,-355,0,-106,4,-50 -}; - -const int8_t rectangles_array[10056]={ -6,4,12,9,6,7,12,3,0,0,0,0,6,4,12,7,10,4,4,7,0,0,0,0,3,9,18,9,3,12,18,3,0,0,0,0,8,18,9,6,8,20,9,2,0,0,0,0,3,5,4,19,5,5,2,19,0,0,0,0,6,5,12,16,6,13,12,8,0,0,0,0,5,8,12,6,5,11,12,3,0,0,0,0,11,14,4,10,11,19,4,5,0,0,0,0,4,0,7,6,4,3,7,3,0,0,0,0,6,6,12,6,6,8,12,2,0,0,0,0,6,4,12,7,10,4,4,7,0,0,0,0,1,8,19,12,1,12,19,4,0,0,0,0,0,2,24,3,8,2,8,3,0,0,0,0,9,9,6,15,9,14,6,5,0,0,0,0,5,6,14,10,5,11,14,5,0,0,0,0,5,0,14,9,5,3,14,3,0,0,0,0,13,11,9,6,16,11,3,6,0,0,0,0,7,5,6,10,9,5,2,10,0,0,0,0,10,8,6,10,12,8,2,10,0,0,0,0,2,5,4,9,4,5,2,9,0,0,0,0,18,0,6,11,20,0,2,11,0,0,0,0,0,6,24,13,8,6,8,13,0,0,0,0,9,6,6,9,11,6,2,9,0,0,0,0,7,18,10,6,7,20,10,2,0,0,0,0,5,7,14,12,5,13,14,6,0,0,0,0,0,3,24,3,8,3,8,3,0,0,0,0,5,8,15,6,5,11,15,3,0,0,0,0,9,6,5,14,9,13,5,7,0,0,0,0,9,5,6,10,11,5,2,10,0,0,0,0,6,6,3,12,6,12,3,6,0,0,0,0,3,21,18,3,9,21,6,3,0,0,0,0,5,6,13,6,5,8,13,2,0,0,0,0,18,1,6,15,18,1,3,15,0,0,0,0,1,1,6,15,4,1,3,15,0,0,0,0,0,8,24,15,8,8,8,15,0,0,0,0,5,6,14,12,5,6,7,6,12,12,7,6,2,12,21,12,2,16,21,4,0,0,0,0,8,1,4,10,10,1,2,10,0,0,0,0,2,13,20,10,2,13,10,10,0,0,0,0,0,1,6,13,2,1,2,13,0,0,0,0,20,2,4,13,20,2,2,13,0,0,0,0,0,5,22,19,11,5,11,19,0,0,0,0,18,4,6,9,20,4,2,9,0,0,0,0,0,3,6,11,2,3,2,11,0,0,0,0,12,1,4,9,12,1,2,9,0,0,0,0,0,6,19,3,0,7,19,1,0,0,0,0,12,1,4,9,12,1,2,9,0,0,0,0,8,1,4,9,10,1,2,9,0,0,0,0,5,5,14,14,12,5,7,7,5,12,7,7,1,10,18,2,1,11,18,1,0,0,0,0,17,13,4,11,17,13,2,11,0,0,0,0,0,4,6,9,0,7,6,3,0,0,0,0,6,4,12,9,6,7,12,3,0,0,0,0,6,5,12,6,10,5,4,6,0,0,0,0,0,1,24,5,8,1,8,5,0,0,0,0,4,10,18,6,4,12,18,2,0,0,0,0,2,17,12,6,2,17,6,3,8,20,6,3,19,3,4,13,19,3,2,13,0,0,0,0,1,3,4,13,3,3,2,13,0,0,0,0,0,1,24,23,8,1,8,23,0,0,0,0,1,7,8,12,1,11,8,4,0,0,0,0,14,7,3,14,14,14,3,7,0,0,0,0,3,12,16,6,3,12,8,3,11,15,8,3,6,6,12,6,6,8,12,2,0,0,0,0,8,7,6,12,8,13,6,6,0,0,0,0,15,15,9,6,15,17,9,2,0,0,0,0,1,17,18,3,1,18,18,1,0,0,0,0,4,4,16,12,4,10,16,6,0,0,0,0,0,1,4,20,2,1,2,20,0,0,0,0,3,0,18,2,3,1,18,1,0,0,0,0,1,5,20,14,1,5,10,7,11,12,10,7,5,8,14,12,5,12,14,4,0,0,0,0,3,14,7,9,3,17,7,3,0,0,0,0,14,15,9,6,14,17,9,2,0,0,0,0,1,15,9,6,1,17,9,2,0,0,0,0,11,6,8,10,15,6,4,5,11,11,4,5,5,5,14,14,5,5,7,7,12,12,7,7,6,0,12,5,10,0,4,5,0,0,0,0,9,0,6,9,9,3,6,3,0,0,0,0,9,6,6,9,11,6,2,9,0,0,0,0,7,0,6,9,9,0,2,9,0,0,0,0,10,6,6,9,12,6,2,9,0,0,0,0,8,6,6,9,10,6,2,9,0,0,0,0,3,8,18,4,9,8,6,4,0,0,0,0,6,0,12,9,6,3,12,3,0,0,0,0,0,0,24,6,8,0,8,6,0,0,0,0,4,7,16,12,4,11,16,4,0,0,0,0,11,6,6,6,11,6,3,6,0,0,0,0,0,20,24,3,8,20,8,3,0,0,0,0,11,6,4,9,11,6,2,9,0,0,0,0,4,13,15,4,9,13,5,4,0,0,0,0,11,6,4,9,11,6,2,9,0,0,0,0,9,6,4,9,11,6,2,9,0,0,0,0,9,12,6,12,9,18,6,6,0,0,0,0,1,22,18,2,1,23,18,1,0,0,0,0,10,7,4,10,10,12,4,5,0,0,0,0,6,7,8,10,6,12,8,5,0,0,0,0,7,6,10,6,7,8,10,2,0,0,0,0,0,14,10,4,0,16,10,2,0,0,0,0,6,18,18,2,6,19,18,1,0,0,0,0,1,1,22,3,1,2,22,1,0,0,0,0,6,16,18,3,6,17,18,1,0,0,0,0,2,4,6,15,5,4,3,15,0,0,0,0,20,4,4,10,20,4,2,10,0,0,0,0,0,4,4,10,2,4,2,10,0,0,0,0,2,16,20,6,12,16,10,3,2,19,10,3,0,12,8,9,4,12,4,9,0,0,0,0,12,0,6,9,14,0,2,9,0,0,0,0,5,10,6,6,8,10,3,6,0,0,0,0,11,8,12,6,17,8,6,3,11,11,6,3,0,8,12,6,0,8,6,3,6,11,6,3,12,0,6,9,14,0,2,9,0,0,0,0,6,0,6,9,8,0,2,9,0,0,0,0,8,14,9,6,8,16,9,2,0,0,0,0,0,16,9,6,0,18,9,2,0,0,0,0,10,8,6,10,12,8,2,10,0,0,0,0,3,19,12,3,9,19,6,3,0,0,0,0,2,10,20,2,2,11,20,1,0,0,0,0,2,9,18,12,2,9,9,6,11,15,9,6,3,0,18,24,3,0,9,24,0,0,0,0,5,6,14,10,5,6,7,5,12,11,7,5,9,5,10,12,14,5,5,6,9,11,5,6,4,5,12,12,4,5,6,6,10,11,6,6,4,14,18,3,4,15,18,1,0,0,0,0,6,13,8,8,6,17,8,4,0,0,0,0,3,16,18,6,3,19,18,3,0,0,0,0,0,0,6,6,3,0,3,6,0,0,0,0,6,6,12,18,10,6,4,18,0,0,0,0,6,1,4,14,8,1,2,14,0,0,0,0,3,2,19,2,3,3,19,1,0,0,0,0,1,8,22,13,12,8,11,13,0,0,0,0,8,9,11,4,8,11,11,2,0,0,0,0,0,12,15,10,5,12,5,10,0,0,0,0,12,16,12,6,16,16,4,6,0,0,0,0,0,16,12,6,4,16,4,6,0,0,0,0,19,1,5,12,19,5,5,4,0,0,0,0,0,2,24,4,8,2,8,4,0,0,0,0,6,8,12,4,6,10,12,2,0,0,0,0,7,5,9,6,10,5,3,6,0,0,0,0,9,17,6,6,9,20,6,3,0,0,0,0,0,7,22,15,0,12,22,5,0,0,0,0,4,1,17,9,4,4,17,3,0,0,0,0,7,5,6,10,9,5,2,10,0,0,0,0,18,1,6,8,18,1,3,8,0,0,0,0,0,1,6,7,3,1,3,7,0,0,0,0,18,0,6,22,18,0,3,22,0,0,0,0,0,0,6,22,3,0,3,22,0,0,0,0,16,7,8,16,16,7,4,16,0,0,0,0,2,10,19,6,2,12,19,2,0,0,0,0,9,9,6,12,9,13,6,4,0,0,0,0,2,15,17,6,2,17,17,2,0,0,0,0,14,7,3,14,14,14,3,7,0,0,0,0,5,6,8,10,5,6,4,5,9,11,4,5,15,8,9,11,18,8,3,11,0,0,0,0,0,8,9,11,3,8,3,11,0,0,0,0,8,6,10,18,8,15,10,9,0,0,0,0,7,7,3,14,7,14,3,7,0,0,0,0,0,14,24,8,8,14,8,8,0,0,0,0,1,10,18,14,10,10,9,14,0,0,0,0,14,12,6,6,14,15,6,3,0,0,0,0,7,0,10,16,7,0,5,8,12,8,5,8,10,0,9,6,13,0,3,6,0,0,0,0,4,3,16,4,12,3,8,4,0,0,0,0,10,0,9,6,13,0,3,6,0,0,0,0,1,1,20,4,1,1,10,2,11,3,10,2,10,0,9,6,13,0,3,6,0,0,0,0,5,0,9,6,8,0,3,6,0,0,0,0,8,18,10,6,8,20,10,2,0,0,0,0,6,3,6,9,8,3,2,9,0,0,0,0,7,3,12,6,7,5,12,2,0,0,0,0,0,10,18,3,0,11,18,1,0,0,0,0,1,10,22,3,1,11,22,1,0,0,0,0,5,11,8,8,9,11,4,8,0,0,0,0,12,11,6,6,12,11,3,6,0,0,0,0,6,11,6,6,9,11,3,6,0,0,0,0,7,10,11,6,7,12,11,2,0,0,0,0,0,13,24,4,0,13,12,2,12,15,12,2,2,4,22,12,13,4,11,6,2,10,11,6,2,0,20,17,12,0,10,17,0,0,0,0,14,0,2,24,14,0,1,24,0,0,0,0,8,0,2,24,9,0,1,24,0,0,0,0,14,1,2,22,14,1,1,22,0,0,0,0,8,1,2,22,9,1,1,22,0,0,0,0,17,6,3,18,18,6,1,18,0,0,0,0,6,14,9,6,6,16,9,2,0,0,0,0,13,14,9,4,13,16,9,2,0,0,0,0,3,18,18,3,3,19,18,1,0,0,0,0,9,4,8,18,13,4,4,9,9,13,4,9,0,17,18,3,0,18,18,1,0,0,0,0,0,2,12,4,6,2,6,4,0,0,0,0,6,8,14,6,6,11,14,3,0,0,0,0,7,5,6,6,10,5,3,6,0,0,0,0,10,5,6,16,10,13,6,8,0,0,0,0,1,4,9,16,4,4,3,16,0,0,0,0,5,0,18,9,5,3,18,3,0,0,0,0,9,15,5,8,9,19,5,4,0,0,0,0,20,0,4,9,20,0,2,9,0,0,0,0,2,0,18,3,2,1,18,1,0,0,0,0,5,22,19,2,5,23,19,1,0,0,0,0,0,0,4,9,2,0,2,9,0,0,0,0,5,6,19,18,5,12,19,6,0,0,0,0,0,1,6,9,2,1,2,9,0,0,0,0,6,5,14,12,13,5,7,6,6,11,7,6,0,1,20,2,0,2,20,1,0,0,0,0,1,2,22,3,1,3,22,1,0,0,0,0,2,8,7,9,2,11,7,3,0,0,0,0,2,12,22,4,13,12,11,2,2,14,11,2,0,12,22,4,0,12,11,2,11,14,11,2,9,7,6,11,11,7,2,11,0,0,0,0,7,1,9,6,10,1,3,6,0,0,0,0,11,2,4,10,11,7,4,5,0,0,0,0,6,4,12,12,6,10,12,6,0,0,0,0,18,1,6,15,18,6,6,5,0,0,0,0,3,15,18,3,3,16,18,1,0,0,0,0,18,5,6,9,18,8,6,3,0,0,0,0,1,5,16,6,1,5,8,3,9,8,8,3,11,0,6,9,13,0,2,9,0,0,0,0,0,4,24,14,0,4,12,7,12,11,12,7,13,0,4,13,13,0,2,13,0,0,0,0,7,0,4,13,9,0,2,13,0,0,0,0,11,6,6,9,13,6,2,9,0,0,0,0,8,7,6,9,10,7,2,9,0,0,0,0,13,17,9,6,13,19,9,2,0,0,0,0,2,18,14,6,2,18,7,3,9,21,7,3,3,18,18,4,12,18,9,2,3,20,9,2,0,20,15,4,5,20,5,4,0,0,0,0,9,15,15,9,14,15,5,9,0,0,0,0,4,4,16,4,4,6,16,2,0,0,0,0,7,6,10,6,7,8,10,2,0,0,0,0,0,14,15,10,5,14,5,10,0,0,0,0,7,9,10,14,12,9,5,7,7,16,5,7,7,6,6,9,9,6,2,9,0,0,0,0,3,6,18,3,3,7,18,1,0,0,0,0,0,10,18,3,0,11,18,1,0,0,0,0,3,16,18,4,12,16,9,2,3,18,9,2,4,6,14,6,4,6,7,3,11,9,7,3,13,0,2,18,13,0,1,18,0,0,0,0,9,0,2,18,10,0,1,18,0,0,0,0,5,7,15,10,10,7,5,10,0,0,0,0,1,20,21,4,8,20,7,4,0,0,0,0,10,5,5,18,10,14,5,9,0,0,0,0,0,2,24,6,0,2,12,3,12,5,12,3,1,1,22,8,12,1,11,4,1,5,11,4,4,0,15,9,4,3,15,3,0,0,0,0,0,0,24,19,8,0,8,19,0,0,0,0,2,21,18,3,11,21,9,3,0,0,0,0,9,7,10,4,9,7,5,4,0,0,0,0,5,7,10,4,10,7,5,4,0,0,0,0,17,8,6,16,20,8,3,8,17,16,3,8,1,15,20,4,1,15,10,2,11,17,10,2,14,15,10,6,14,17,10,2,0,0,0,0,3,0,16,9,3,3,16,3,0,0,0,0,15,6,7,15,15,11,7,5,0,0,0,0,9,1,6,13,11,1,2,13,0,0,0,0,17,2,6,14,17,2,3,14,0,0,0,0,3,14,12,10,3,14,6,5,9,19,6,5,7,6,10,6,7,8,10,2,0,0,0,0,1,2,6,14,4,2,3,14,0,0,0,0,10,4,5,12,10,8,5,4,0,0,0,0,0,17,24,5,8,17,8,5,0,0,0,0,15,7,5,12,15,11,5,4,0,0,0,0,3,1,6,12,3,1,3,6,6,7,3,6,12,13,6,6,12,16,6,3,0,0,0,0,6,13,6,6,6,16,6,3,0,0,0,0,14,6,3,16,14,14,3,8,0,0,0,0,1,12,13,6,1,14,13,2,0,0,0,0,13,1,4,9,13,1,2,9,0,0,0,0,7,0,9,6,10,0,3,6,0,0,0,0,12,2,6,9,12,2,3,9,0,0,0,0,6,2,6,9,9,2,3,9,0,0,0,0,6,18,12,6,6,20,12,2,0,0,0,0,7,6,6,9,9,6,2,9,0,0,0,0,7,7,12,3,7,7,6,3,0,0,0,0,8,3,8,21,8,10,8,7,0,0,0,0,7,4,10,12,7,8,10,4,0,0,0,0,0,1,6,9,0,4,6,3,0,0,0,0,15,2,2,20,15,2,1,20,0,0,0,0,0,3,6,9,0,6,6,3,0,0,0,0,15,3,2,21,15,3,1,21,0,0,0,0,7,0,2,23,8,0,1,23,0,0,0,0,15,8,9,4,15,10,9,2,0,0,0,0,0,8,9,4,0,10,9,2,0,0,0,0,8,14,9,6,8,16,9,2,0,0,0,0,0,14,9,6,0,16,9,2,0,0,0,0,3,10,18,4,9,10,6,4,0,0,0,0,0,0,24,19,8,0,8,19,0,0,0,0,9,1,8,12,9,7,8,6,0,0,0,0,10,6,4,10,12,6,2,10,0,0,0,0,7,9,10,12,12,9,5,6,7,15,5,6,5,0,3,19,6,0,1,19,0,0,0,0,14,0,6,10,16,0,2,10,0,0,0,0,2,0,6,12,2,0,3,6,5,6,3,6,0,11,24,2,0,12,24,1,0,0,0,0,4,9,13,4,4,11,13,2,0,0,0,0,9,8,6,9,9,11,6,3,0,0,0,0,0,12,16,4,0,14,16,2,0,0,0,0,18,12,6,9,18,15,6,3,0,0,0,0,0,12,6,9,0,15,6,3,0,0,0,0,8,7,10,4,8,7,5,4,0,0,0,0,8,7,6,9,10,7,2,9,0,0,0,0,11,0,6,9,13,0,2,9,0,0,0,0,7,0,6,9,9,0,2,9,0,0,0,0,12,3,6,15,14,3,2,15,0,0,0,0,6,3,6,15,8,3,2,15,0,0,0,0,15,2,9,4,15,4,9,2,0,0,0,0,5,10,6,7,8,10,3,7,0,0,0,0,9,14,6,10,9,19,6,5,0,0,0,0,7,13,5,8,7,17,5,4,0,0,0,0,14,5,3,16,14,13,3,8,0,0,0,0,2,17,18,3,2,18,18,1,0,0,0,0,5,18,19,3,5,19,19,1,0,0,0,0,9,0,6,9,11,0,2,9,0,0,0,0,12,4,3,18,13,4,1,18,0,0,0,0,9,4,3,18,10,4,1,18,0,0,0,0,3,3,18,9,9,3,6,9,0,0,0,0,6,1,6,14,8,1,2,14,0,0,0,0,12,16,9,6,12,19,9,3,0,0,0,0,1,3,20,16,1,3,10,8,11,11,10,8,12,5,6,12,15,5,3,6,12,11,3,6,1,2,22,16,1,2,11,8,12,10,11,8,10,14,5,10,10,19,5,5,0,0,0,0,3,21,18,3,3,22,18,1,0,0,0,0,10,14,6,10,12,14,2,10,0,0,0,0,0,2,24,4,8,2,8,4,0,0,0,0,6,4,12,9,6,7,12,3,0,0,0,0,6,6,12,5,10,6,4,5,0,0,0,0,5,8,14,12,5,12,14,4,0,0,0,0,4,14,8,10,4,14,4,5,8,19,4,5,11,6,5,14,11,13,5,7,0,0,0,0,7,6,3,16,7,14,3,8,0,0,0,0,3,7,18,8,9,7,6,8,0,0,0,0,2,3,20,2,2,4,20,1,0,0,0,0,3,12,19,6,3,14,19,2,0,0,0,0,8,6,6,9,10,6,2,9,0,0,0,0,16,6,6,14,16,6,3,14,0,0,0,0,7,9,6,12,9,9,2,12,0,0,0,0,18,6,6,18,21,6,3,9,18,15,3,9,0,6,6,18,0,6,3,9,3,15,3,9,18,2,6,9,18,5,6,3,0,0,0,0,3,18,15,6,3,20,15,2,0,0,0,0,18,2,6,9,18,5,6,3,0,0,0,0,0,2,6,9,0,5,6,3,0,0,0,0,5,10,18,2,5,11,18,1,0,0,0,0,6,0,12,6,6,2,12,2,0,0,0,0,10,0,6,9,12,0,2,9,0,0,0,0,8,0,6,9,10,0,2,9,0,0,0,0,15,12,9,6,15,14,9,2,0,0,0,0,3,6,13,6,3,8,13,2,0,0,0,0,15,12,9,6,15,14,9,2,0,0,0,0,2,5,6,15,5,5,3,15,0,0,0,0,8,8,9,6,11,8,3,6,0,0,0,0,8,6,3,14,8,13,3,7,0,0,0,0,15,12,9,6,15,14,9,2,0,0,0,0,4,12,10,4,9,12,5,4,0,0,0,0,13,1,4,19,13,1,2,19,0,0,0,0,7,1,4,19,9,1,2,19,0,0,0,0,18,9,6,9,18,12,6,3,0,0,0,0,1,21,18,3,1,22,18,1,0,0,0,0,14,13,10,9,14,16,10,3,0,0,0,0,1,13,22,4,1,13,11,2,12,15,11,2,4,6,16,6,12,6,8,3,4,9,8,3,1,0,18,22,1,0,9,11,10,11,9,11,10,7,8,14,14,7,4,7,10,14,4,7,0,4,6,20,0,4,3,10,3,14,3,10,15,0,6,9,17,0,2,9,0,0,0,0,3,0,6,9,5,0,2,9,0,0,0,0,15,12,6,12,18,12,3,6,15,18,3,6,3,12,6,12,3,12,3,6,6,18,3,6,15,12,9,6,15,14,9,2,0,0,0,0,0,12,9,6,0,14,9,2,0,0,0,0,4,14,19,3,4,15,19,1,0,0,0,0,2,13,19,3,2,14,19,1,0,0,0,0,14,15,10,6,14,17,10,2,0,0,0,0,6,0,10,12,6,0,5,6,11,6,5,6,17,1,6,12,20,1,3,6,17,7,3,6,1,1,6,12,1,1,3,6,4,7,3,6,16,14,6,9,16,17,6,3,0,0,0,0,7,3,9,12,7,9,9,6,0,0,0,0,12,1,4,12,12,7,4,6,0,0,0,0,4,0,14,8,4,4,14,4,0,0,0,0,10,6,6,9,12,6,2,9,0,0,0,0,2,10,18,3,8,10,6,3,0,0,0,0,15,15,9,6,15,17,9,2,0,0,0,0,0,1,21,23,7,1,7,23,0,0,0,0,6,9,17,4,6,11,17,2,0,0,0,0,1,0,11,18,1,6,11,6,0,0,0,0,6,15,13,6,6,17,13,2,0,0,0,0,0,15,9,6,0,17,9,2,0,0,0,0,8,7,15,4,13,7,5,4,0,0,0,0,9,12,6,9,9,15,6,3,0,0,0,0,6,8,18,3,12,8,6,3,0,0,0,0,0,14,24,4,8,14,8,4,0,0,0,0,16,10,3,12,16,16,3,6,0,0,0,0,0,3,24,3,0,4,24,1,0,0,0,0,14,17,10,6,14,19,10,2,0,0,0,0,1,13,18,3,7,13,6,3,0,0,0,0,5,0,18,9,5,3,18,3,0,0,0,0,4,3,16,9,4,6,16,3,0,0,0,0,16,5,3,12,16,11,3,6,0,0,0,0,0,7,18,4,6,7,6,4,0,0,0,0,10,6,6,9,12,6,2,9,0,0,0,0,9,8,6,10,11,8,2,10,0,0,0,0,9,15,6,9,11,15,2,9,0,0,0,0,3,1,18,21,12,1,9,21,0,0,0,0,6,8,12,7,6,8,6,7,0,0,0,0,8,5,6,9,10,5,2,9,0,0,0,0,0,2,24,4,8,2,8,4,0,0,0,0,14,7,5,12,14,11,5,4,0,0,0,0,5,7,5,12,5,11,5,4,0,0,0,0,9,6,6,9,11,6,2,9,0,0,0,0,0,1,6,17,3,1,3,17,0,0,0,0,3,1,19,9,3,4,19,3,0,0,0,0,3,18,12,6,3,18,6,3,9,21,6,3,20,4,4,19,20,4,2,19,0,0,0,0,0,16,10,7,5,16,5,7,0,0,0,0,8,7,10,12,13,7,5,6,8,13,5,6,6,7,10,12,6,7,5,6,11,13,5,6,9,2,9,6,12,2,3,6,0,0,0,0,1,20,21,4,8,20,7,4,0,0,0,0,9,12,9,6,9,14,9,2,0,0,0,0,7,2,9,6,10,2,3,6,0,0,0,0,13,0,4,14,13,0,2,14,0,0,0,0,7,0,4,14,9,0,2,14,0,0,0,0,14,15,9,6,14,17,9,2,0,0,0,0,2,8,18,5,8,8,6,5,0,0,0,0,18,3,6,11,20,3,2,11,0,0,0,0,6,5,11,14,6,12,11,7,0,0,0,0,18,4,6,9,18,7,6,3,0,0,0,0,7,6,9,6,7,8,9,2,0,0,0,0,18,4,6,9,18,7,6,3,0,0,0,0,0,4,6,9,0,7,6,3,0,0,0,0,9,4,9,4,9,6,9,2,0,0,0,0,0,22,19,2,0,23,19,1,0,0,0,0,17,14,6,9,17,17,6,3,0,0,0,0,1,14,6,9,1,17,6,3,0,0,0,0,14,11,4,9,14,11,2,9,0,0,0,0,6,11,4,9,8,11,2,9,0,0,0,0,3,9,18,7,9,9,6,7,0,0,0,0,9,12,6,10,9,17,6,5,0,0,0,0,12,0,6,9,14,0,2,9,0,0,0,0,6,0,6,9,8,0,2,9,0,0,0,0,6,17,18,3,6,18,18,1,0,0,0,0,1,17,18,3,1,18,18,1,0,0,0,0,10,6,11,12,10,12,11,6,0,0,0,0,5,6,14,6,5,6,7,3,12,9,7,3,5,4,15,4,5,6,15,2,0,0,0,0,0,0,22,2,0,1,22,1,0,0,0,0,0,0,24,24,8,0,8,24,0,0,0,0,1,15,18,4,10,15,9,4,0,0,0,0,6,8,12,9,6,11,12,3,0,0,0,0,4,12,7,12,4,16,7,4,0,0,0,0,1,2,22,6,12,2,11,3,1,5,11,3,5,20,14,3,12,20,7,3,0,0,0,0,0,0,24,16,12,0,12,8,0,8,12,8,3,13,18,4,3,13,9,2,12,15,9,2,2,10,22,2,2,11,22,1,0,0,0,0,6,3,11,8,6,7,11,4,0,0,0,0,14,5,6,6,14,8,6,3,0,0,0,0,0,7,24,6,0,9,24,2,0,0,0,0,14,0,10,10,19,0,5,5,14,5,5,5,0,0,10,10,0,0,5,5,5,5,5,5,0,1,24,4,12,1,12,2,0,3,12,2,0,17,18,3,0,18,18,1,0,0,0,0,5,15,16,6,13,15,8,3,5,18,8,3,3,15,16,6,3,15,8,3,11,18,8,3,6,16,18,3,6,17,18,1,0,0,0,0,0,13,21,10,0,18,21,5,0,0,0,0,13,0,6,24,15,0,2,24,0,0,0,0,7,4,6,11,9,4,2,11,0,0,0,0,9,5,9,6,12,5,3,6,0,0,0,0,1,4,2,20,1,14,2,10,0,0,0,0,13,0,6,24,15,0,2,24,0,0,0,0,5,0,6,24,7,0,2,24,0,0,0,0,16,7,6,14,19,7,3,7,16,14,3,7,4,7,4,12,6,7,2,12,0,0,0,0,0,5,24,14,8,5,8,14,0,0,0,0,5,13,10,6,5,15,10,2,0,0,0,0,12,0,6,9,14,0,2,9,0,0,0,0,2,7,6,14,2,7,3,7,5,14,3,7,15,2,9,15,18,2,3,15,0,0,0,0,0,2,6,9,2,2,2,9,0,0,0,0,12,2,10,14,17,2,5,7,12,9,5,7,11,6,2,18,12,6,1,18,0,0,0,0,9,5,15,6,14,5,5,6,0,0,0,0,8,6,6,10,10,6,2,10,0,0,0,0,12,0,6,9,14,0,2,9,0,0,0,0,3,3,9,7,6,3,3,7,0,0,0,0,6,7,14,3,6,7,7,3,0,0,0,0,7,7,8,6,11,7,4,6,0,0,0,0,12,7,7,12,12,13,7,6,0,0,0,0,10,6,4,18,10,6,2,9,12,15,2,9,16,14,6,9,16,17,6,3,0,0,0,0,4,0,6,13,6,0,2,13,0,0,0,0,2,2,21,3,9,2,7,3,0,0,0,0,5,4,5,12,5,8,5,4,0,0,0,0,10,3,4,10,10,8,4,5,0,0,0,0,8,4,5,8,8,8,5,4,0,0,0,0,6,0,11,9,6,3,11,3,0,0,0,0,6,6,12,5,10,6,4,5,0,0,0,0,0,0,24,5,8,0,8,5,0,0,0,0,1,10,23,6,1,12,23,2,0,0,0,0,3,21,18,3,9,21,6,3,0,0,0,0,3,6,21,6,3,8,21,2,0,0,0,0,0,5,6,12,2,5,2,12,0,0,0,0,10,2,4,15,10,7,4,5,0,0,0,0,8,7,8,10,8,12,8,5,0,0,0,0,5,7,15,12,10,7,5,12,0,0,0,0,0,17,10,6,0,19,10,2,0,0,0,0,14,18,9,6,14,20,9,2,0,0,0,0,9,6,6,16,9,14,6,8,0,0,0,0,14,18,9,6,14,20,9,2,0,0,0,0,1,18,9,6,1,20,9,2,0,0,0,0,15,9,9,6,15,11,9,2,0,0,0,0,0,9,9,6,0,11,9,2,0,0,0,0,17,3,6,9,19,3,2,9,0,0,0,0,2,17,18,3,2,18,18,1,0,0,0,0,3,15,21,6,3,17,21,2,0,0,0,0,9,17,6,6,9,20,6,3,0,0,0,0,18,3,6,9,18,6,6,3,0,0,0,0,0,3,6,9,0,6,6,3,0,0,0,0,4,0,16,10,12,0,8,5,4,5,8,5,2,0,10,16,2,0,5,8,7,8,5,8,14,0,10,5,14,0,5,5,0,0,0,0,0,0,10,5,5,0,5,5,0,0,0,0,18,3,6,10,18,3,3,10,0,0,0,0,5,11,12,6,5,11,6,3,11,14,6,3,21,0,3,18,22,0,1,18,0,0,0,0,6,0,6,9,8,0,2,9,0,0,0,0,8,8,9,7,11,8,3,7,0,0,0,0,7,12,8,10,7,12,4,5,11,17,4,5,21,0,3,18,22,0,1,18,0,0,0,0,10,6,4,9,12,6,2,9,0,0,0,0,15,0,9,6,15,2,9,2,0,0,0,0,0,2,24,3,0,3,24,1,0,0,0,0,11,7,6,9,13,7,2,9,0,0,0,0,7,6,6,10,9,6,2,10,0,0,0,0,12,1,6,12,14,1,2,12,0,0,0,0,6,4,12,12,6,10,12,6,0,0,0,0,14,3,2,21,14,3,1,21,0,0,0,0,6,1,12,8,6,5,12,4,0,0,0,0,3,0,18,8,3,4,18,4,0,0,0,0,3,0,18,3,3,1,18,1,0,0,0,0,0,13,24,4,12,13,12,2,0,15,12,2,10,5,4,9,12,5,2,9,0,0,0,0,11,1,6,9,13,1,2,9,0,0,0,0,6,2,6,22,8,2,2,22,0,0,0,0,16,10,8,14,20,10,4,7,16,17,4,7,3,4,16,15,3,9,16,5,0,0,0,0,16,10,8,14,20,10,4,7,16,17,4,7,0,10,8,14,0,10,4,7,4,17,4,7,10,14,11,6,10,17,11,3,0,0,0,0,0,7,24,9,8,7,8,9,0,0,0,0,13,1,4,16,13,1,2,16,0,0,0,0,7,1,4,16,9,1,2,16,0,0,0,0,5,5,16,8,13,5,8,4,5,9,8,4,0,9,6,9,0,12,6,3,0,0,0,0,6,16,18,3,6,17,18,1,0,0,0,0,3,12,6,9,3,15,6,3,0,0,0,0,8,14,9,6,8,16,9,2,0,0,0,0,2,13,8,10,2,13,4,5,6,18,4,5,15,5,3,18,15,11,3,6,0,0,0,0,3,5,18,3,3,6,18,1,0,0,0,0,17,5,6,11,19,5,2,11,0,0,0,0,1,5,6,11,3,5,2,11,0,0,0,0,19,1,4,9,19,1,2,9,0,0,0,0,1,1,4,9,3,1,2,9,0,0,0,0,4,15,18,9,4,15,9,9,0,0,0,0,6,9,12,4,6,11,12,2,0,0,0,0,15,2,9,6,15,4,9,2,0,0,0,0,0,2,9,6,0,4,9,2,0,0,0,0,15,0,6,17,17,0,2,17,0,0,0,0,3,0,6,17,5,0,2,17,0,0,0,0,8,17,9,4,8,19,9,2,0,0,0,0,6,5,3,18,6,11,3,6,0,0,0,0,5,2,14,12,5,8,14,6,0,0,0,0,10,2,3,12,10,8,3,6,0,0,0,0,10,7,14,15,10,12,14,5,0,0,0,0,0,7,14,15,0,12,14,5,0,0,0,0,15,0,9,6,15,2,9,2,0,0,0,0,0,0,9,6,0,2,9,2,0,0,0,0,12,6,6,14,14,6,2,14,0,0,0,0,9,7,6,9,11,7,2,9,0,0,0,0,12,6,6,15,14,6,2,15,0,0,0,0,6,6,6,15,8,6,2,15,0,0,0,0,15,3,8,9,15,3,4,9,0,0,0,0,0,0,9,21,3,0,3,21,0,0,0,0,11,9,8,12,11,13,8,4,0,0,0,0,6,7,10,12,6,7,5,6,11,13,5,6,10,6,4,18,12,6,2,9,10,15,2,9,0,0,6,9,0,3,6,3,0,0,0,0,3,14,18,3,3,15,18,1,0,0,0,0,3,14,8,10,3,14,4,5,7,19,4,5,0,12,24,4,12,12,12,2,0,14,12,2,0,2,3,20,1,2,1,20,0,0,0,0,12,16,10,8,17,16,5,4,12,20,5,4,2,16,10,8,2,16,5,4,7,20,5,4,7,0,10,9,7,3,10,3,0,0,0,0,0,0,24,3,8,0,8,3,0,0,0,0,3,8,15,4,3,10,15,2,0,0,0,0,6,5,12,6,10,5,4,6,0,0,0,0,5,13,14,6,5,16,14,3,0,0,0,0,11,14,4,10,11,19,4,5,0,0,0,0,0,6,6,7,3,6,3,7,0,0,0,0,18,0,6,6,18,0,3,6,0,0,0,0,3,1,18,3,3,2,18,1,0,0,0,0,9,6,14,18,9,12,14,6,0,0,0,0,0,0,6,6,3,0,3,6,0,0,0,0,13,11,6,6,13,11,3,6,0,0,0,0,0,20,24,3,8,20,8,3,0,0,0,0,13,11,6,7,13,11,3,7,0,0,0,0,4,12,10,6,4,14,10,2,0,0,0,0,13,11,6,6,13,11,3,6,0,0,0,0,5,11,6,7,8,11,3,7,0,0,0,0,7,4,11,12,7,8,11,4,0,0,0,0,6,15,10,4,6,17,10,2,0,0,0,0,14,0,6,9,16,0,2,9,0,0,0,0,4,0,6,9,6,0,2,9,0,0,0,0,11,2,4,15,11,7,4,5,0,0,0,0,0,0,20,3,0,1,20,1,0,0,0,0,13,18,10,6,13,20,10,2,0,0,0,0,2,7,6,11,5,7,3,11,0,0,0,0,10,14,10,9,10,17,10,3,0,0,0,0,8,2,4,9,10,2,2,9,0,0,0,0,14,3,10,4,14,3,5,4,0,0,0,0,6,6,12,6,6,6,6,3,12,9,6,3,8,8,8,10,12,8,4,5,8,13,4,5,7,4,4,16,7,12,4,8,0,0,0,0,8,8,9,4,8,10,9,2,0,0,0,0,5,2,14,9,5,5,14,3,0,0,0,0,3,16,19,8,3,20,19,4,0,0,0,0,0,0,10,8,5,0,5,8,0,0,0,0,5,2,16,18,5,2,8,18,0,0,0,0,0,11,24,11,8,11,8,11,0,0,0,0,3,3,18,5,3,3,9,5,0,0,0,0,1,16,18,3,1,17,18,1,0,0,0,0,5,17,18,3,5,18,18,1,0,0,0,0,1,13,9,6,1,15,9,2,0,0,0,0,1,9,23,10,1,14,23,5,0,0,0,0,3,7,18,3,3,8,18,1,0,0,0,0,6,8,12,3,6,8,6,3,0,0,0,0,6,2,3,22,7,2,1,22,0,0,0,0,14,17,10,6,14,19,10,2,0,0,0,0,1,18,10,6,1,20,10,2,0,0,0,0,11,3,6,12,13,3,2,12,0,0,0,0,10,6,4,9,12,6,2,9,0,0,0,0,11,0,6,9,13,0,2,9,0,0,0,0,7,0,6,9,9,0,2,9,0,0,0,0,12,10,9,6,15,10,3,6,0,0,0,0,2,11,6,9,5,11,3,9,0,0,0,0,14,5,3,19,15,5,1,19,0,0,0,0,6,6,9,6,6,8,9,2,0,0,0,0,14,5,3,19,15,5,1,19,0,0,0,0,0,3,6,9,0,6,6,3,0,0,0,0,5,21,18,3,5,22,18,1,0,0,0,0,1,10,18,4,7,10,6,4,0,0,0,0,13,4,8,10,17,4,4,5,13,9,4,5,7,8,9,6,10,8,3,6,0,0,0,0,12,9,9,8,15,9,3,8,0,0,0,0,0,6,5,12,0,10,5,4,0,0,0,0,7,6,14,6,14,6,7,3,7,9,7,3,7,5,3,19,8,5,1,19,0,0,0,0,8,4,15,20,13,4,5,20,0,0,0,0,1,4,15,20,6,4,5,20,0,0,0,0,13,10,6,6,13,10,3,6,0,0,0,0,5,10,6,6,8,10,3,6,0,0,0,0,14,2,6,14,17,2,3,7,14,9,3,7,4,2,6,14,4,2,3,7,7,9,3,7,12,4,6,7,12,4,3,7,0,0,0,0,9,4,6,9,11,4,2,9,0,0,0,0,11,4,8,10,11,4,4,10,0,0,0,0,5,4,8,10,9,4,4,10,0,0,0,0,8,18,10,6,8,20,10,2,0,0,0,0,1,18,21,6,1,20,21,2,0,0,0,0,9,2,12,6,9,2,6,6,0,0,0,0,3,2,12,6,9,2,6,6,0,0,0,0,12,5,12,6,18,5,6,3,12,8,6,3,8,8,6,9,8,11,6,3,0,0,0,0,2,7,20,6,2,9,20,2,0,0,0,0,0,5,12,6,0,5,6,3,6,8,6,3,14,14,8,10,18,14,4,5,14,19,4,5,2,14,8,10,2,14,4,5,6,19,4,5,2,11,20,13,2,11,10,13,0,0,0,0,6,9,12,5,12,9,6,5,0,0,0,0,5,6,16,6,13,6,8,3,5,9,8,3,1,19,9,4,1,21,9,2,0,0,0,0,7,5,12,5,11,5,4,5,0,0,0,0,3,5,14,12,3,5,7,6,10,11,7,6,9,4,9,6,12,4,3,6,0,0,0,0,2,6,19,3,2,7,19,1,0,0,0,0,18,10,6,9,18,13,6,3,0,0,0,0,3,7,18,2,3,8,18,1,0,0,0,0,20,2,4,18,22,2,2,9,20,11,2,9,2,18,20,3,2,19,20,1,0,0,0,0,1,9,22,3,1,10,22,1,0,0,0,0,0,2,4,18,0,2,2,9,2,11,2,9,19,0,4,23,19,0,2,23,0,0,0,0,0,3,6,19,3,3,3,19,0,0,0,0,18,2,6,9,20,2,2,9,0,0,0,0,0,5,10,6,0,7,10,2,0,0,0,0,7,0,12,12,13,0,6,6,7,6,6,6,0,3,24,6,0,3,12,3,12,6,12,3,10,14,4,10,10,19,4,5,0,0,0,0,8,9,4,15,8,14,4,5,0,0,0,0,4,11,17,6,4,14,17,3,0,0,0,0,2,5,18,8,2,5,9,4,11,9,9,4,7,6,14,6,14,6,7,3,7,9,7,3,3,6,14,6,3,6,7,3,10,9,7,3,16,5,3,18,17,5,1,18,0,0,0,0,5,5,3,18,6,5,1,18,0,0,0,0,10,10,14,4,10,12,14,2,0,0,0,0,4,10,9,4,4,12,9,2,0,0,0,0,2,0,18,9,2,3,18,3,0,0,0,0,6,3,12,8,10,3,4,8,0,0,0,0,1,1,8,5,5,1,4,5,0,0,0,0,12,7,7,8,12,11,7,4,0,0,0,0,0,12,22,4,0,14,22,2,0,0,0,0,15,6,4,15,15,11,4,5,0,0,0,0,5,7,7,8,5,11,7,4,0,0,0,0,8,18,9,4,8,20,9,2,0,0,0,0,1,2,22,4,1,4,22,2,0,0,0,0,17,3,6,17,19,3,2,17,0,0,0,0,8,2,8,18,8,11,8,9,0,0,0,0,17,0,6,12,20,0,3,6,17,6,3,6,7,0,6,9,9,0,2,9,0,0,0,0,15,5,9,12,15,11,9,6,0,0,0,0,2,22,18,2,2,23,18,1,0,0,0,0,10,10,12,6,16,10,6,3,10,13,6,3,0,1,4,11,2,1,2,11,0,0,0,0,20,0,4,10,20,0,2,10,0,0,0,0,1,3,6,17,3,3,2,17,0,0,0,0,15,15,9,6,15,17,9,2,0,0,0,0,0,13,8,9,0,16,8,3,0,0,0,0,16,8,6,12,16,12,6,4,0,0,0,0,2,8,6,12,2,12,6,4,0,0,0,0,10,2,4,15,10,7,4,5,0,0,0,0,1,5,19,3,1,6,19,1,0,0,0,0,11,8,9,7,14,8,3,7,0,0,0,0,3,8,12,9,3,11,12,3,0,0,0,0,3,6,18,3,3,7,18,1,0,0,0,0,10,0,4,12,10,6,4,6,0,0,0,0,3,9,18,14,3,9,9,14,0,0,0,0,0,0,4,9,2,0,2,9,0,0,0,0,12,5,4,18,12,5,2,18,0,0,0,0,8,5,4,18,10,5,2,18,0,0,0,0,10,5,6,10,12,5,2,10,0,0,0,0,9,4,4,11,11,4,2,11,0,0,0,0,4,16,18,3,4,17,18,1,0,0,0,0,0,16,20,3,0,17,20,1,0,0,0,0,9,9,6,12,9,13,6,4,0,0,0,0,8,13,8,8,8,17,8,4,0,0,0,0,13,10,3,12,13,16,3,6,0,0,0,0,5,9,14,14,5,9,7,7,12,16,7,7,0,0,24,10,12,0,12,5,0,5,12,5,1,11,18,2,1,12,18,1,0,0,0,0,19,5,5,12,19,9,5,4,0,0,0,0,0,5,5,12,0,9,5,4,0,0,0,0,16,6,8,18,20,6,4,9,16,15,4,9,0,6,8,18,0,6,4,9,4,15,4,9,12,5,12,12,18,5,6,6,12,11,6,6,7,6,6,9,9,6,2,9,0,0,0,0,9,13,6,11,11,13,2,11,0,0,0,0,0,5,12,12,0,5,6,6,6,11,6,6,1,2,23,3,1,3,23,1,0,0,0,0,1,15,19,3,1,16,19,1,0,0,0,0,13,17,11,4,13,19,11,2,0,0,0,0,0,13,8,5,4,13,4,5,0,0,0,0,12,10,10,4,12,10,5,4,0,0,0,0,4,6,9,9,4,9,9,3,0,0,0,0,15,14,9,6,15,16,9,2,0,0,0,0,1,12,9,6,1,14,9,2,0,0,0,0,3,10,20,8,13,10,10,4,3,14,10,4,2,0,9,18,5,0,3,18,0,0,0,0,13,11,9,10,16,11,3,10,0,0,0,0,1,2,8,5,5,2,4,5,0,0,0,0,3,4,21,6,10,4,7,6,0,0,0,0,7,0,10,14,7,0,5,7,12,7,5,7,12,17,12,4,12,19,12,2,0,0,0,0,0,6,23,4,0,8,23,2,0,0,0,0,13,10,8,10,17,10,4,5,13,15,4,5,0,16,18,3,0,17,18,1,0,0,0,0,15,16,9,4,15,18,9,2,0,0,0,0,0,16,9,4,0,18,9,2,0,0,0,0,13,11,6,6,13,11,3,6,0,0,0,0,5,11,6,6,8,11,3,6,0,0,0,0,0,3,24,6,12,3,12,3,0,6,12,3,2,4,18,3,2,5,18,1,0,0,0,0,0,0,24,4,12,0,12,2,0,2,12,2,1,16,18,3,1,17,18,1,0,0,0,0,15,15,9,6,15,17,9,2,0,0,0,0,0,15,9,6,0,17,9,2,0,0,0,0,6,17,18,3,6,18,18,1,0,0,0,0,8,8,6,10,10,8,2,10,0,0,0,0,10,6,6,9,12,6,2,9,0,0,0,0,8,8,5,8,8,12,5,4,0,0,0,0,12,8,6,8,12,12,6,4,0,0,0,0,6,5,6,11,8,5,2,11,0,0,0,0,13,6,8,9,13,9,8,3,0,0,0,0,1,7,21,6,1,9,21,2,0,0,0,0,15,5,3,12,15,11,3,6,0,0,0,0,6,9,11,12,6,13,11,4,0,0,0,0,13,8,10,8,18,8,5,4,13,12,5,4,5,8,12,3,11,8,6,3,0,0,0,0,6,11,18,4,12,11,6,4,0,0,0,0,0,0,22,22,0,11,22,11,0,0,0,0,11,2,6,8,11,6,6,4,0,0,0,0,9,0,6,9,11,0,2,9,0,0,0,0,10,0,6,9,12,0,2,9,0,0,0,0,8,3,6,14,8,3,3,7,11,10,3,7,3,10,18,8,9,10,6,8,0,0,0,0,10,0,3,14,10,7,3,7,0,0,0,0,4,3,16,20,4,13,16,10,0,0,0,0,9,4,6,10,11,4,2,10,0,0,0,0,5,0,16,4,5,2,16,2,0,0,0,0,2,5,18,4,8,5,6,4,0,0,0,0,13,0,6,9,15,0,2,9,0,0,0,0,8,4,8,5,12,4,4,5,0,0,0,0,12,10,10,4,12,10,5,4,0,0,0,0,2,10,10,4,7,10,5,4,0,0,0,0,7,11,12,5,11,11,4,5,0,0,0,0,3,10,8,10,3,10,4,5,7,15,4,5,11,12,9,8,14,12,3,8,0,0,0,0,0,21,24,3,8,21,8,3,0,0,0,0,3,20,18,4,9,20,6,4,0,0,0,0,1,15,9,6,1,17,9,2,0,0,0,0,11,17,10,4,11,19,10,2,0,0,0,0,9,12,4,12,9,18,4,6,0,0,0,0,9,6,9,6,12,6,3,6,0,0,0,0,1,13,6,9,1,16,6,3,0,0,0,0,6,16,12,4,6,18,12,2,0,0,0,0,1,5,20,3,1,6,20,1,0,0,0,0,8,1,9,9,8,4,9,3,0,0,0,0,2,19,9,4,2,21,9,2,0,0,0,0,11,1,4,18,11,7,4,6,0,0,0,0,7,2,8,12,7,2,4,6,11,8,4,6,11,10,9,8,14,10,3,8,0,0,0,0,5,11,12,5,9,11,4,5,0,0,0,0,11,9,9,6,14,9,3,6,0,0,0,0,5,10,6,9,7,10,2,9,0,0,0,0 -}; - diff --git a/src/imlib.c b/src/imlib.c index f00d784fa..5baff070f 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -5,7 +5,7 @@ #include #include "array.h" #include "imlib.h" -#include "cascade.h" +#include "ff.h" #define MIN(a,b) \ ({ __typeof__ (a) _a = (a); \ @@ -270,47 +270,33 @@ void imlib_histeq(struct image *src) /* Viola-Jones face detector implementation * Original Author: Francesco Comaschi (f.comaschi@tue.nl) */ -static int evalWeakClassifier(struct integral_image *sum, int std, int p_offset, int tree_index, int w_index, int r_index ) +static int evalWeakClassifier(struct cascade *cascade, int std, int p_offset, int tree_index, int w_index, int r_index ) { + int i, sumw=0; struct rectangle tr; - + struct integral_image *sum = &cascade->sum; /* the node threshold is multiplied by the standard deviation of the image */ - int t = tree_thresh_array[tree_index] * std; + int t = cascade->tree_thresh_array[tree_index] * std; - /* this is just a hack will be removed when - we add the number of rects to the classifier */ - tr.x = rectangles_array[r_index + 8]; - tr.y = rectangles_array[r_index + 9]; - tr.w = rectangles_array[r_index + 10]; - tr.h = rectangles_array[r_index + 11]; - - int i,k, sumw=0; - - if ((tr.x)&& (tr.y) &&(tr.w) &&(tr.h)) { - k = 3; - } else { - k = 2; - } - - for (i=0; inum_rectangles_array[tree_index]; i++) { + tr.x = cascade->rectangles_array[r_index + i*4 + 0]; + tr.y = cascade->rectangles_array[r_index + i*4 + 1]; + tr.w = cascade->rectangles_array[r_index + i*4 + 2]; + tr.h = cascade->rectangles_array[r_index + i*4 + 3]; sumw += ( *((sum->data + sum->w*(tr.y ) + (tr.x )) + p_offset) - *((sum->data + sum->w*(tr.y ) + (tr.x + tr.w)) + p_offset) - *((sum->data + sum->w*(tr.y + tr.h) + (tr.x )) + p_offset) + *((sum->data + sum->w*(tr.y + tr.h) + (tr.x + tr.w)) + p_offset)) - * weights_array[w_index + i]; + * cascade->weights_array[w_index + i]*4096; } if (sumw >= t) { - return alpha2_array[tree_index]; + return cascade->alpha2_array[tree_index]; } - return alpha1_array[tree_index]; + return cascade->alpha1_array[tree_index]; } static int runCascadeClassifier(struct cascade* cascade, struct point pt, int start_stage) @@ -329,8 +315,8 @@ static int runCascadeClassifier(struct cascade* cascade, struct point pt, int st uint32_t sumsq=0; vec_t v0, v1; - for (y=pt.y; y<24; y++) { - for (x=pt.x; x<24; x+=2) { + for (y=pt.y; ywindow.w; y++) { + for (x=pt.x; xwindow.w; x+=2) { offset = y*cascade->img->w+x; v0.s0 = cascade->img->pixels[offset+0]; v0.s1 = cascade->img->pixels[offset+1]; @@ -356,13 +342,15 @@ static int runCascadeClassifier(struct cascade* cascade, struct point pt, int st for (i=start_stage; in_stages; i++) { stage_sum = 0; - for (j=0; jstages_array[i]; j++, tree_index++) { /* send the shifted window to a haar filter */ - stage_sum += evalWeakClassifier(&cascade->sum, std, p_offset, tree_index, w_index, r_index); + stage_sum += evalWeakClassifier(cascade, std, p_offset, tree_index, w_index, r_index); + w_index+=cascade->num_rectangles_array[tree_index]; + r_index+=4 * cascade->num_rectangles_array[tree_index]; } /* If the sum is below the stage threshold, no faces are detected */ - if (stage_sum < 0.4*stages_thresh_array[i]) { + if (stage_sum < 0.4*cascade->stages_thresh_array[i]) { return -i; } } @@ -549,10 +537,130 @@ struct array *imlib_detect_objects(struct image *image, struct cascade *cascade) /* process the current scale with the cascaded fitler. */ ScaleImageInvoker(cascade, factor, sum.h, sum.w, objects); - } + } //free(sum.data); objects = imlib_merge_detections(objects); return objects; } + +int imlib_load_cascade(struct cascade* cascade, const char *path) +{ + int i; + UINT n_out; + + FIL fp; + FRESULT res=FR_OK; + + res = f_open(&fp, path, FA_READ|FA_OPEN_EXISTING); + if (res != FR_OK) { + return res; + } + + /* read detection window size */ + res = f_read(&fp, &cascade->window, sizeof(cascade->window), &n_out); + if (res != FR_OK || n_out != sizeof(cascade->window)) { + goto error; + } + + /* read num stages */ + res = f_read(&fp, &cascade->n_stages, sizeof(cascade->n_stages), &n_out); + if (res != FR_OK || n_out != sizeof(cascade->n_stages)) { + goto error; + } + + cascade->stages_array = malloc (sizeof(*cascade->stages_array) * cascade->n_stages); + cascade->stages_thresh_array = malloc (sizeof(*cascade->stages_thresh_array) * cascade->n_stages); + + if (cascade->stages_array == NULL || + cascade->stages_thresh_array == NULL) { + res = 20; + goto error; + } + + /* read num features in each stages */ + res = f_read(&fp, cascade->stages_array, sizeof(uint8_t) * cascade->n_stages, &n_out); + if (res != FR_OK || n_out != sizeof(uint8_t) * cascade->n_stages) { + goto error; + } + + /* sum num of features in each stages*/ + for (i=0, cascade->n_features=0; in_stages; i++) { + cascade->n_features += cascade->stages_array[i]; + } + + /* alloc features thresh array, alpha1, alpha 2,rects weights and rects*/ + cascade->tree_thresh_array = malloc (sizeof(*cascade->tree_thresh_array) * cascade->n_features); + cascade->alpha1_array = malloc (sizeof(*cascade->alpha1_array) * cascade->n_features); + cascade->alpha2_array = malloc (sizeof(*cascade->alpha2_array) * cascade->n_features); + cascade->num_rectangles_array = malloc (sizeof(*cascade->num_rectangles_array) * cascade->n_features); + + if (cascade->tree_thresh_array == NULL || + cascade->alpha1_array == NULL || + cascade->alpha2_array == NULL || + cascade->num_rectangles_array == NULL) { + res = 20; + goto error; + } + + /* read stages thresholds */ + res = f_read(&fp, cascade->stages_thresh_array, sizeof(int16_t)*cascade->n_stages, &n_out); + if (res != FR_OK || n_out != sizeof(int16_t)*cascade->n_stages) { + goto error; + } + + /* read features thresholds */ + res = f_read(&fp, cascade->tree_thresh_array, sizeof(*cascade->tree_thresh_array)*cascade->n_features, &n_out); + if (res != FR_OK || n_out != sizeof(*cascade->tree_thresh_array)*cascade->n_features) { + goto error; + } + + /* read alpha 1 */ + res = f_read(&fp, cascade->alpha1_array, sizeof(*cascade->alpha1_array)*cascade->n_features, &n_out); + if (res != FR_OK || n_out != sizeof(*cascade->alpha1_array)*cascade->n_features) { + goto error; + } + + /* read alpha 2 */ + res = f_read(&fp, cascade->alpha2_array, sizeof(*cascade->alpha2_array)*cascade->n_features, &n_out); + if (res != FR_OK || n_out != sizeof(*cascade->alpha2_array)*cascade->n_features) { + goto error; + } + + /* read num rectangles per feature*/ + res = f_read(&fp, cascade->num_rectangles_array, sizeof(*cascade->num_rectangles_array)*cascade->n_features, &n_out); + if (res != FR_OK || n_out != sizeof(*cascade->num_rectangles_array)*cascade->n_features) { + goto error; + } + + /* sum num of recatngles per feature*/ + for (i=0, cascade->n_rectangles=0; in_features; i++) { + cascade->n_rectangles += cascade->num_rectangles_array[i]; + } + + cascade->weights_array = malloc (sizeof(*cascade->weights_array) * cascade->n_rectangles); + cascade->rectangles_array = malloc (sizeof(*cascade->rectangles_array) * cascade->n_rectangles * 4); + + if (cascade->weights_array == NULL || + cascade->rectangles_array == NULL) { + res = 20; + goto error; + } + + /* read rectangles weights */ + res =f_read(&fp, cascade->weights_array, sizeof(*cascade->weights_array)*cascade->n_rectangles, &n_out); + if (res != FR_OK || n_out != sizeof(*cascade->weights_array)*cascade->n_rectangles) { + goto error; + } + + /* read rectangles num rectangles * 4 points */ + res = f_read(&fp, cascade->rectangles_array, sizeof(*cascade->rectangles_array)*cascade->n_rectangles *4, &n_out); + if (res != FR_OK || n_out != sizeof(*cascade->rectangles_array)*cascade->n_rectangles *4) { + goto error; + } + +error: + f_close(&fp); + return res; +} diff --git a/src/imlib.h b/src/imlib.h index de0ae7e2a..0aee087ce 100644 --- a/src/imlib.h +++ b/src/imlib.h @@ -72,12 +72,25 @@ struct cascade { float scale_factor; /* number of stages in the cascade */ int n_stages; + /* number of features in the cascade */ + int n_features; + /* number of rectangles in the cascade */ + int n_rectangles; /* size of the window used in the training set */ struct size window; - /* pointer to current integral image */ - struct integral_image sum; /* pointer to current scaled image in the pyramid */ struct image *img; + /* pointer to current integral image */ + struct integral_image sum; + /* haar cascade arrays */ + uint8_t *stages_array; + int16_t *stages_thresh_array; + int16_t *tree_thresh_array; + int16_t *alpha1_array; + int16_t *alpha2_array; + int8_t *num_rectangles_array; + int8_t *weights_array; + int8_t *rectangles_array; }; float imlib_distance(struct color *c0, struct color *c1); @@ -90,4 +103,5 @@ void imlib_integral_image(struct image *src, struct integral_image *sum); void imlib_draw_rectangle(struct image *image, struct rectangle *r); void imlib_histeq(struct image *src); struct array *imlib_detect_objects(struct image *image, struct cascade* cascade); +int imlib_load_cascade(struct cascade* cascade, const char *path); #endif //__IMLIB_H__ diff --git a/src/py/py_imlib.c b/src/py/py_imlib.c index e3f143303..3c63f2b98 100644 --- a/src/py/py_imlib.c +++ b/src/py/py_imlib.c @@ -5,9 +5,40 @@ #include "py_image.h" #include "py_imlib.h" #include "py_assert.h" +#include "py_file.h" + +typedef struct _py_cascade_obj_t { + mp_obj_base_t base; + struct cascade _cobj; +} py_cascade_obj_t; extern struct sensor_dev sensor; +static void py_cascade_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) +{ + py_cascade_obj_t *self = self_in; + + /* print some info */ + print(env, "width:%d height:%d n_stages:%d n_features:%d n_rectangles:%d\n", + self->_cobj.window.w, + self->_cobj.window.h, + self->_cobj.n_stages, + self->_cobj.n_features, + self->_cobj.n_rectangles); +} + +static const mp_obj_type_t py_cascade_type = { + { &mp_const_type }, + "Cascade", + .print = py_cascade_print, +}; + +void *py_cascade_cobj(mp_obj_t cascade) +{ + PY_ASSERT_TYPE(cascade, &py_cascade_type); + return &((py_cascade_obj_t *)cascade)->_cobj; +} + mp_obj_t py_imlib_histeq(mp_obj_t image_obj) { struct image *image; @@ -69,49 +100,66 @@ mp_obj_t py_imlib_detect_color(mp_obj_t image_obj, mp_obj_t color_obj, mp_obj_t return rt_build_tuple(4, rec_obj); } -mp_obj_t py_imlib_detect_objects(mp_obj_t image_obj) +mp_obj_t py_imlib_detect_objects(mp_obj_t image_obj, mp_obj_t cascade_obj) { struct image *image = NULL; - struct array *objects=NULL; - mp_obj_t mp_objects = mp_const_none; + struct cascade *cascade = NULL; - /* detection parameters */ - struct cascade cascade = { - .step = 2, - .n_stages = 12, - .window = {24, 24}, - .scale_factor = 1.25f, - }; + struct array *objects_array=NULL; + mp_obj_t objects_list = mp_const_none; /* sanity checks */ PY_ASSERT_TRUE(sensor.framesize <= FRAMESIZE_QQVGA); PY_ASSERT_TRUE(sensor.pixformat == PIXFORMAT_GRAYSCALE); - /* get image pointer */ - image = (struct image*) py_image_cobj(image_obj); + /* get C image pointer */ + image = py_image_cobj(image_obj); + /* get C cascade pointer */ + cascade = py_cascade_cobj(cascade_obj); - objects = imlib_detect_objects(image, &cascade); - - int size = array_length(objects); + /* detect objects */ + objects_array = imlib_detect_objects(image, cascade); + int size = array_length(objects_array); if (size) { int i; + objects_list = rt_build_list(0, NULL); for (i=0; ix); + rec_obj[1] = mp_obj_new_int(r->y); + rec_obj[2] = mp_obj_new_int(r->w); + rec_obj[3] = mp_obj_new_int(r->h); + rt_list_append(objects_list, rt_build_tuple(4, rec_obj)); } - - struct rectangle *r = array_at(objects, 0); - mp_obj_t rec_obj[4]; - rec_obj[0] = mp_obj_new_int(r->x); - rec_obj[1] = mp_obj_new_int(r->y); - rec_obj[2] = mp_obj_new_int(r->w); - rec_obj[3] = mp_obj_new_int(r->h); - mp_objects = rt_build_tuple(4, rec_obj); } /* free objects array */ - array_free(objects); + array_free(objects_array); - return mp_objects; + return objects_list; +} + +mp_obj_t py_imlib_load_cascade(mp_obj_t path_obj) +{ + py_cascade_obj_t *o =NULL; + + /* detection parameters */ + struct cascade cascade = { + .step = 2, + .scale_factor = 1.25f, + }; + + const char *path = mp_obj_str_get_str(path_obj); + int res = imlib_load_cascade(&cascade, path); + if (res != FR_OK) { + nlr_jump(mp_obj_new_exception_msg(qstr_from_str("Imlib"), ffs_strerror(res))); + } + + o = m_new_obj(py_cascade_obj_t); + o->base.type = &py_cascade_type; + o->_cobj = cascade; + return o; } void py_imlib_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) @@ -128,7 +176,8 @@ mp_obj_t py_imlib_init() rt_store_attr(m, qstr_from_str("histeq"), rt_make_function_n(1, py_imlib_histeq)); rt_store_attr(m, qstr_from_str("draw_rectangle"), rt_make_function_n(2, py_imlib_draw_rectangle)); rt_store_attr(m, qstr_from_str("detect_color"), rt_make_function_n(3, py_imlib_detect_color)); - rt_store_attr(m, qstr_from_str("detect_objects"), rt_make_function_n(1, py_imlib_detect_objects)); + rt_store_attr(m, qstr_from_str("detect_objects"), rt_make_function_n(2, py_imlib_detect_objects)); + rt_store_attr(m, qstr_from_str("load_cascade"), rt_make_function_n(1, py_imlib_load_cascade)); return m; }