lte_dfts.c 1.14 MB
Newer Older
ghaddab's avatar
ghaddab committed
1
/*******************************************************************************
2
    OpenAirInterface
ghaddab's avatar
ghaddab committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16
    Copyright(c) 1999 - 2014 Eurecom

    OpenAirInterface 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 of the License, or
    (at your option) any later version.


    OpenAirInterface 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
17 18
    along with OpenAirInterface.The full GNU General Public License is
   included in this distribution in the file called "COPYING". If not,
ghaddab's avatar
ghaddab committed
19 20 21 22 23
   see <http://www.gnu.org/licenses/>.

  Contact Information
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
24
  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
25

ghaddab's avatar
ghaddab committed
26
  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
ghaddab's avatar
ghaddab committed
27 28

 *******************************************************************************/
29 30 31 32 33 34 35 36 37 38 39 40 41 42
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif

#include <stdint.h>

#ifndef MR_MAIN
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "defs.h"
#else
#include "time_meas.h"
43
#include <math.h>
44 45 46 47

#define debug_msg
#define ONE_OVER_SQRT2_Q15 23170

48

49 50
#endif

51
#define ONE_OVER_SQRT3_Q15 18919
52

53
#include "PHY/sse_intrin.h"
54

55 56
#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
#define print_ints(s,x) printf("%s %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3])
57

58 59 60
#ifdef AVX2
static int16_t conjugatedft2[16] __attribute__((aligned(32))) = {1,1,1,1,1,1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1};
#endif
61

62
static int16_t conjugatedft[8] __attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
63 64 65

static short reflip[8]  __attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};

66
#if defined(__x86_64__) || defined(__i386__)
67
static inline void cmac(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline));
68 69
static inline void cmac(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
{
70 71 72 73 74 75 76

  __m128i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32;

  cmac_tmp    = _mm_sign_epi16(b,*(__m128i*)reflip);
  cmac_tmp_re32  = _mm_madd_epi16(a,cmac_tmp);


Raymond Knopp's avatar
 
Raymond Knopp committed
77 78 79
  //  cmac_tmp    = _mm_shufflelo_epi16(b,_MM_SHUFFLE(2,3,0,1));
  //  cmac_tmp    = _mm_shufflehi_epi16(cmac_tmp,_MM_SHUFFLE(2,3,0,1));
  cmac_tmp = _mm_shuffle_epi8(b,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
80 81 82 83 84 85
  cmac_tmp_im32  = _mm_madd_epi16(cmac_tmp,a);

  *re32 = _mm_add_epi32(*re32,cmac_tmp_re32);
  *im32 = _mm_add_epi32(*im32,cmac_tmp_im32);
}

86 87 88 89 90 91 92 93 94 95 96 97 98
static inline void cmacc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline));
static inline void cmacc(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
{

  __m128i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32;


  cmac_tmp_re32  = _mm_madd_epi16(a,b);


  cmac_tmp    = _mm_sign_epi16(b,*(__m128i*)reflip);
  //  cmac_tmp    = _mm_shufflelo_epi16(b,_MM_SHUFFLE(2,3,0,1));
  //  cmac_tmp    = _mm_shufflehi_epi16(cmac_tmp,_MM_SHUFFLE(2,3,0,1));
99
  cmac_tmp = _mm_shuffle_epi8(cmac_tmp,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
100 101 102 103 104 105
  cmac_tmp_im32  = _mm_madd_epi16(cmac_tmp,a);

  *re32 = _mm_add_epi32(*re32,cmac_tmp_re32);
  *im32 = _mm_add_epi32(*im32,cmac_tmp_im32);
}

106 107 108 109 110



static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline));

111 112
static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
{
113 114 115 116 117

  register __m128i mmtmpb;

  mmtmpb    = _mm_sign_epi16(b,*(__m128i*)reflip);
  *re32     = _mm_madd_epi16(a,mmtmpb);
Raymond Knopp's avatar
 
Raymond Knopp committed
118 119 120
  //  mmtmpb    = _mm_shufflelo_epi16(b,_MM_SHUFFLE(2,3,0,1));
  //  mmtmpb    = _mm_shufflehi_epi16(mmtmpb,_MM_SHUFFLE(2,3,0,1));
  mmtmpb        = _mm_shuffle_epi8(b,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
121 122 123 124 125 126
  *im32  = _mm_madd_epi16(a,mmtmpb);

}

static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline));

127 128
static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
{
129 130 131 132 133

  register __m128i mmtmpb;

  *re32     = _mm_madd_epi16(a,b);
  mmtmpb    = _mm_sign_epi16(b,*(__m128i*)reflip);
Raymond Knopp's avatar
 
Raymond Knopp committed
134
  mmtmpb    = _mm_shuffle_epi8(mmtmpb,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
135 136 137 138 139 140 141
  *im32  = _mm_madd_epi16(a,mmtmpb);

}


static inline __m128i cpack(__m128i xre,__m128i xim) __attribute__((always_inline));

142 143
static inline __m128i cpack(__m128i xre,__m128i xim)
{
144 145 146 147 148 149 150 151 152 153 154 155

  register __m128i cpack_tmp1,cpack_tmp2;

  cpack_tmp1 = _mm_unpacklo_epi32(xre,xim);
  cpack_tmp2 = _mm_unpackhi_epi32(xre,xim);
  return(_mm_packs_epi32(_mm_srai_epi32(cpack_tmp1,15),_mm_srai_epi32(cpack_tmp2,15)));

}


static inline void packed_cmult(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline));

156 157
static inline void packed_cmult(__m128i a,__m128i b, __m128i *c)
{
158 159 160 161 162 163 164 165 166 167

  __m128i cre,cim;
  cmult(a,b,&cre,&cim);
  *c = cpack(cre,cim);

}


static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline));

168 169
static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c)
{
170 171 172 173 174 175 176 177 178 179

  __m128i cre,cim;

  cmultc(a,b,&cre,&cim);
  *c = cpack(cre,cim);

}

static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) __attribute__((always_inline));

180 181 182 183
static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2)
{


184 185 186 187 188 189 190 191 192
  register __m128i cre,cim;

  cre       = _mm_madd_epi16(a,b);
  cim       = _mm_madd_epi16(a,b2);

  return(cpack(cre,cim));

}

193 194 195 196
#elif defined (__arm__)
static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) __attribute__((always_inline));
static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32)
{
197

198 199 200 201 202 203 204 205 206 207 208 209 210 211
  
  int32x4_t ab_re0,ab_re1,ab_im0,ab_im1;
  int16x8_t bflip = vrev32q_s16(b);
  int16x8_t bconj = vmulq_s16(b,*(int16x8_t *)reflip);

  ab_re0 = vmull_s16(((int16x4_t*)&a)[0],((int16x4_t*)&bconj)[0]);
  ab_re1 = vmull_s16(((int16x4_t*)&a)[1],((int16x4_t*)&bconj)[1]);
  ab_im0 = vmull_s16(((int16x4_t*)&a)[0],((int16x4_t*)&bflip)[0]);
  ab_im1 = vmull_s16(((int16x4_t*)&a)[1],((int16x4_t*)&bflip)[1]);
  *re32 = vqaddq_s32(*re32,vcombine_s32(vpadd_s32(((int32x2_t*)&ab_re0)[0],((int32x2_t*)&ab_re0)[1]),
					vpadd_s32(((int32x2_t*)&ab_re1)[0],((int32x2_t*)&ab_re1)[1])));
  *im32 = vqaddq_s32(*im32,vcombine_s32(vpadd_s32(((int32x2_t*)&ab_im0)[0],((int32x2_t*)&ab_im0)[1]),
					vpadd_s32(((int32x2_t*)&ab_im1)[0],((int32x2_t*)&ab_im1)[1])));
}
212

213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
static inline void cmacc(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) __attribute__((always_inline));
static inline void cmacc(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32)
{
  int32x4_t ab_re0,ab_re1,ab_im0,ab_im1;
  int16x8_t bconj = vmulq_s16(b,*(int16x8_t *)reflip);
  int16x8_t bflip = vrev32q_s16(bconj);

  ab_re0 = vmull_s16(((int16x4_t*)&a)[0],((int16x4_t*)&b)[0]);
  ab_re1 = vmull_s16(((int16x4_t*)&a)[1],((int16x4_t*)&b)[1]);
  ab_im0 = vmull_s16(((int16x4_t*)&a)[0],((int16x4_t*)&bflip)[0]);
  ab_im1 = vmull_s16(((int16x4_t*)&a)[1],((int16x4_t*)&bflip)[1]);
  *re32 = vqaddq_s32(*re32,vcombine_s32(vpadd_s32(((int32x2_t*)&ab_re0)[0],((int32x2_t*)&ab_re0)[1]),
					vpadd_s32(((int32x2_t*)&ab_re1)[0],((int32x2_t*)&ab_re1)[1])));
  *im32 = vqaddq_s32(*im32,vcombine_s32(vpadd_s32(((int32x2_t*)&ab_im0)[0],((int32x2_t*)&ab_im0)[1]),
					vpadd_s32(((int32x2_t*)&ab_im1)[0],((int32x2_t*)&ab_im1)[1])));

}

static inline void cmult(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) __attribute__((always_inline));
static inline void cmult(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32)
{
  int32x4_t ab_re0,ab_re1,ab_im0,ab_im1;
  int16x8_t bflip = vrev32q_s16(b);
  int16x8_t bconj = vmulq_s16(b,*(int16x8_t *)reflip);
  int16x4_t al,ah,bcl,bch,bfl,bfh;
  int32x2_t abr0l,abr0h,abr1l,abr1h,abi0l,abi0h,abi1l,abi1h;

  al  = vget_low_s16(a);      ah = vget_high_s16(a);
  bcl = vget_low_s16(bconj);  bch = vget_high_s16(bconj);
  bfl = vget_low_s16(bflip);  bfh = vget_high_s16(bflip);

  ab_re0 = vmull_s16(al,bcl);
  ab_re1 = vmull_s16(ah,bch);
  ab_im0 = vmull_s16(al,bfl);
  ab_im1 = vmull_s16(ah,bfh);
  abr0l = vget_low_s32(ab_re0); abr0h = vget_high_s32(ab_re0);
  abr1l = vget_low_s32(ab_re1); abr1h = vget_high_s32(ab_re1);
  abi0l = vget_low_s32(ab_im0); abi0h = vget_high_s32(ab_im0);
  abi1l = vget_low_s32(ab_im1); abi1h = vget_high_s32(ab_im1);

  *re32 = vcombine_s32(vpadd_s32(abr0l,abr0h),
                       vpadd_s32(abr1l,abr1h));
  *im32 = vcombine_s32(vpadd_s32(abi0l,abi0h),
                       vpadd_s32(abi1l,abi1h));
}

static inline void cmultc(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) __attribute__((always_inline));

static inline void cmultc(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32)
{
  int32x4_t ab_re0,ab_re1,ab_im0,ab_im1;
  int16x8_t bconj = vmulq_s16(b,*(int16x8_t *)reflip);
  int16x8_t bflip = vrev32q_s16(bconj);
  int16x4_t al,ah,bl,bh,bfl,bfh; 
  int32x2_t abr0l,abr0h,abr1l,abr1h,abi0l,abi0h,abi1l,abi1h;
  al  = vget_low_s16(a);     ah = vget_high_s16(a);
  bl  = vget_low_s16(b);     bh = vget_high_s16(b);
  bfl = vget_low_s16(bflip); bfh = vget_high_s16(bflip);

  ab_re0 = vmull_s16(al,bl);
  ab_re1 = vmull_s16(ah,bh);
  ab_im0 = vmull_s16(al,bfl);
  ab_im1 = vmull_s16(ah,bfh);

  abr0l = vget_low_s32(ab_re0); abr0h = vget_high_s32(ab_re0);
  abr1l = vget_low_s32(ab_re1); abr1h = vget_high_s32(ab_re1);
  abi0l = vget_low_s32(ab_im0); abi0h = vget_high_s32(ab_im0);
  abi1l = vget_low_s32(ab_im1); abi1h = vget_high_s32(ab_im1);

  *re32 = vcombine_s32(vpadd_s32(abr0l,abr0h),
		       vpadd_s32(abr1l,abr1h));
  *im32 = vcombine_s32(vpadd_s32(abi0l,abi0h),
		       vpadd_s32(abi1l,abi1h));

}


static inline int16x8_t cpack(int32x4_t xre,int32x4_t xim) __attribute__((always_inline));

static inline int16x8_t cpack(int32x4_t xre,int32x4_t xim)
{
  int32x4x2_t xtmp;

  xtmp = vzipq_s32(xre,xim);
  return(vcombine_s16(vqshrn_n_s32(xtmp.val[0],15),vqshrn_n_s32(xtmp.val[1],15)));

}


static inline void packed_cmult(int16x8_t a,int16x8_t b, int16x8_t *c) __attribute__((always_inline));

static inline void packed_cmult(int16x8_t a,int16x8_t b, int16x8_t *c)
{

  int32x4_t cre,cim;
  cmult(a,b,&cre,&cim);
  *c = cpack(cre,cim);

}


static inline void packed_cmultc(int16x8_t a,int16x8_t b, int16x8_t *c) __attribute__((always_inline));

static inline void packed_cmultc(int16x8_t a,int16x8_t b, int16x8_t *c)
{

  int32x4_t cre,cim;
320

321
  cmultc(a,b,&cre,&cim);
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342
  *c = cpack(cre,cim);

}

static inline int16x8_t packed_cmult2(int16x8_t a,int16x8_t b,  int16x8_t b2) __attribute__((always_inline));

static inline int16x8_t packed_cmult2(int16x8_t a,int16x8_t b,  int16x8_t b2)
{

  

  int32x4_t ab_re0,ab_re1,ab_im0,ab_im1,cre,cim;
  
  ab_re0 = vmull_s16(((int16x4_t*)&a)[0],((int16x4_t*)&b)[0]);
  ab_re1 = vmull_s16(((int16x4_t*)&a)[1],((int16x4_t*)&b)[1]);
  ab_im0 = vmull_s16(((int16x4_t*)&a)[0],((int16x4_t*)&b2)[0]);
  ab_im1 = vmull_s16(((int16x4_t*)&a)[1],((int16x4_t*)&b2)[1]);
  cre = vcombine_s32(vpadd_s32(((int32x2_t*)&ab_re0)[0],((int32x2_t*)&ab_re0)[1]),
		     vpadd_s32(((int32x2_t*)&ab_re1)[0],((int32x2_t*)&ab_re1)[1]));
  cim = vcombine_s32(vpadd_s32(((int32x2_t*)&ab_im0)[0],((int32x2_t*)&ab_im0)[1]),
		     vpadd_s32(((int32x2_t*)&ab_im1)[0],((int32x2_t*)&ab_im1)[1]));
343 344 345
  return(cpack(cre,cim));

}
346 347

#endif
348 349 350 351 352 353 354 355 356 357 358

static int16_t W0s[8]__attribute__((aligned(16))) = {32767,0,32767,0,32767,0,32767,0};

static int16_t W13s[8]__attribute__((aligned(16))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378};
static int16_t W23s[8]__attribute__((aligned(16))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378};

static int16_t W15s[8]__attribute__((aligned(16))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163};
static int16_t W25s[8]__attribute__((aligned(16))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260};
static int16_t W35s[8]__attribute__((aligned(16))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260};
static int16_t W45s[8]__attribute__((aligned(16))) = {10126,31163,10126,31163,10126,31163,10126,31163};

359
#if defined(__x86_64__) || defined(__i386__)
360 361 362 363 364 365 366
__m128i *W0 = (__m128i *)W0s;
__m128i *W13 = (__m128i *)W13s;
__m128i *W23 = (__m128i *)W23s;
__m128i *W15 = (__m128i *)W15s;
__m128i *W25 = (__m128i *)W25s;
__m128i *W35 = (__m128i *)W35s;
__m128i *W45 = (__m128i *)W45s;
367 368 369 370 371 372 373 374 375
#elif defined(__arm__)
int16x8_t *W0  = (int16x8_t *)W0s;
int16x8_t *W13 = (int16x8_t *)W13s;
int16x8_t *W23 = (int16x8_t *)W23s;
int16x8_t *W15 = (int16x8_t *)W15s;
int16x8_t *W25 = (int16x8_t *)W25s;
int16x8_t *W35 = (int16x8_t *)W35s;
int16x8_t *W45 = (int16x8_t *)W45s;
#endif
376
static int16_t dft_norm_table[16] = {9459,  //12
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
                                     6689,//24
                                     5461,//36
                                     4729,//48
                                     4230,//60
                                     23170,//72
                                     3344,//96
                                     3153,//108
                                     2991,//120
                                     18918,//sqrt(3),//144
                                     18918,//sqrt(3),//180
                                     16384,//2, //192
                                     18918,//sqrt(3), // 216
                                     16384,//2, //240
                                     18918,//sqrt(3), // 288
                                     14654
                                    }; //sqrt(5) //300
393 394


395
#if defined(__x86_64__) || defined(__i386__)
396 397
static inline void bfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m128i *tw)__attribute__((always_inline));

398 399
static inline void bfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m128i *tw)
{
400 401 402 403 404 405 406 407 408 409 410 411

  __m128i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i;
  __m128i bfly2_tmp1,bfly2_tmp2;

  cmult(*(x0),*(W0),&x0r_2,&x0i_2);
  cmult(*(x1),*(tw),&x1r_2,&x1i_2);

  dy0r = _mm_srai_epi32(_mm_add_epi32(x0r_2,x1r_2),15);
  dy1r = _mm_srai_epi32(_mm_sub_epi32(x0r_2,x1r_2),15);
  dy0i = _mm_srai_epi32(_mm_add_epi32(x0i_2,x1i_2),15);
  //  printf("y0i %d\n",((int16_t *)y0i)[0]);
  dy1i = _mm_srai_epi32(_mm_sub_epi32(x0i_2,x1i_2),15);
412

413 414 415 416 417 418 419 420 421
  bfly2_tmp1 = _mm_unpacklo_epi32(dy0r,dy0i);
  bfly2_tmp2 = _mm_unpackhi_epi32(dy0r,dy0i);
  *y0 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2);

  bfly2_tmp1 = _mm_unpacklo_epi32(dy1r,dy1i);
  bfly2_tmp2 = _mm_unpackhi_epi32(dy1r,dy1i);
  *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2);
}

422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
#elif defined(__arm__)

static inline void bfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw)__attribute__((always_inline));

static inline void bfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw)
{

  int32x4_t x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i;

  cmult(*(x0),*(W0),&x0r_2,&x0i_2);
  cmult(*(x1),*(tw),&x1r_2,&x1i_2);

  dy0r = vqaddq_s32(x0r_2,x1r_2);
  dy1r = vqsubq_s32(x0r_2,x1r_2);
  dy0i = vqaddq_s32(x0i_2,x1i_2);
  dy1i = vqsubq_s32(x0i_2,x1i_2);

  *y0 = cpack(dy0r,dy0i);
  *y1 = cpack(dy1r,dy1i);
}


#endif

#if defined(__x86_64__) || defined(__i386__)
447 448
static inline void bfly2_tw1(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1)__attribute__((always_inline));

449 450
static inline void bfly2_tw1(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1)
{
451 452 453 454 455 456

  *y0  = _mm_adds_epi16(*x0,*x1);
  *y1  = _mm_subs_epi16(*x0,*x1);

}

457 458 459 460 461 462 463 464 465 466 467 468 469 470
#elif defined(__arm__)

static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1)__attribute__((always_inline));

static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1)
{

  *y0  = vqaddq_s16(*x0,*x1);
  *y1  = vqsubq_s16(*x0,*x1);

}
#endif

#if defined(__x86_64__) || defined(__i386__)
471 472
static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb)__attribute__((always_inline));

473 474
static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb)
{
475 476 477 478

  register __m128i x1t;

  x1t = packed_cmult2(*(x1),*(tw),*(twb));
479

480 481 482 483 484 485
  *y0  = _mm_adds_epi16(*x0,x1t);
  *y1  = _mm_subs_epi16(*x0,x1t);

}


486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504
#elif defined(__arm__)

static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb)__attribute__((always_inline));

static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb)
{

  register int16x8_t x1t;

  x1t = packed_cmult2(*(x1),*(tw),*(twb));

  *y0  = vqaddq_s16(*x0,x1t);
  *y1  = vqsubq_s16(*x0,x1t);

}

#endif

#if defined(__x86_64__) || defined(__i386__)
505 506
static inline void ibfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m128i *tw)__attribute__((always_inline));

507 508
static inline void ibfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m128i *tw)
{
509 510 511 512 513 514 515 516 517 518 519 520

  __m128i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i;
  __m128i bfly2_tmp1,bfly2_tmp2;

  cmultc(*(x0),*(W0),&x0r_2,&x0i_2);
  cmultc(*(x1),*(tw),&x1r_2,&x1i_2);

  dy0r = _mm_srai_epi32(_mm_add_epi32(x0r_2,x1r_2),15);
  dy1r = _mm_srai_epi32(_mm_sub_epi32(x0r_2,x1r_2),15);
  dy0i = _mm_srai_epi32(_mm_add_epi32(x0i_2,x1i_2),15);
  //  printf("y0i %d\n",((int16_t *)y0i)[0]);
  dy1i = _mm_srai_epi32(_mm_sub_epi32(x0i_2,x1i_2),15);
521

522 523 524 525 526 527 528 529
  bfly2_tmp1 = _mm_unpacklo_epi32(dy0r,dy0i);
  bfly2_tmp2 = _mm_unpackhi_epi32(dy0r,dy0i);
  *y0 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2);

  bfly2_tmp1 = _mm_unpacklo_epi32(dy1r,dy1i);
  bfly2_tmp2 = _mm_unpackhi_epi32(dy1r,dy1i);
  *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2);
}
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550
#elif defined(__arm__)
static inline void ibfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw)
{

  int32x4_t x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i;

  cmultc(*(x0),*(W0),&x0r_2,&x0i_2);
  cmultc(*(x1),*(tw),&x1r_2,&x1i_2);

  dy0r = vqaddq_s32(x0r_2,x1r_2);
  dy1r = vqsubq_s32(x0r_2,x1r_2);
  dy0i = vqaddq_s32(x0i_2,x1i_2);
  dy1i = vqsubq_s32(x0i_2,x1i_2);

  *y0 = cpack(dy0r,dy0i);
  *y1 = cpack(dy1r,dy1i);

}

#endif

551 552 553 554



// This is the radix-3 butterfly (fft)
555 556 557

#if defined(__x86_64__) || defined(__i386__)

558
static inline void bfly3(__m128i *x0,__m128i *x1,__m128i *x2,
559 560
                         __m128i *y0,__m128i *y1,__m128i *y2,
                         __m128i *tw1,__m128i *tw2) __attribute__((always_inline));
561 562

static inline void bfly3(__m128i *x0,__m128i *x1,__m128i *x2,
563 564 565
                         __m128i *y0,__m128i *y1,__m128i *y2,
                         __m128i *tw1,__m128i *tw2)
{
566 567 568

  __m128i tmpre,tmpim,x1_2,x2_2;

569 570 571 572 573 574
  packed_cmult(*(x1),*(tw1),&x1_2);
  packed_cmult(*(x2),*(tw2),&x2_2);
  *(y0)  = _mm_adds_epi16(*(x0),_mm_adds_epi16(x1_2,x2_2));
  cmult(x1_2,*(W13),&tmpre,&tmpim);
  cmac(x2_2,*(W23),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
575
  *(y1) = _mm_adds_epi16(*(x0),*(y1));
576 577 578
  cmult(x1_2,*(W23),&tmpre,&tmpim);
  cmac(x2_2,*(W13),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
579 580 581
  *(y2) = _mm_adds_epi16(*(x0),*(y2));
}

582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610
#elif defined(__arm__)
static inline void bfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,
                         int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,
                         int16x8_t *tw1,int16x8_t *tw2) __attribute__((always_inline));

static inline void bfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,
                         int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,
                         int16x8_t *tw1,int16x8_t *tw2)
{

  int32x4_t tmpre,tmpim;
  int16x8_t x1_2,x2_2;

  packed_cmult(*(x1),*(tw1),&x1_2);
  packed_cmult(*(x2),*(tw2),&x2_2);
  *(y0)  = vqaddq_s16(*(x0),vqaddq_s16(x1_2,x2_2));
  cmult(x1_2,*(W13),&tmpre,&tmpim);
  cmac(x2_2,*(W23),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
  *(y1) = vqaddq_s16(*(x0),*(y1));
  cmult(x1_2,*(W23),&tmpre,&tmpim);
  cmac(x2_2,*(W13),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
  *(y2) = vqaddq_s16(*(x0),*(y2));
}

#endif

#if defined(__x86_64__) || defined(__i386__)
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
static inline void ibfly3(__m128i *x0,__m128i *x1,__m128i *x2,
			  __m128i *y0,__m128i *y1,__m128i *y2,
			  __m128i *tw1,__m128i *tw2) __attribute__((always_inline));

static inline void ibfly3(__m128i *x0,__m128i *x1,__m128i *x2,
			  __m128i *y0,__m128i *y1,__m128i *y2,
			  __m128i *tw1,__m128i *tw2)
{

  __m128i tmpre,tmpim,x1_2,x2_2;

  packed_cmultc(*(x1),*(tw1),&x1_2);
  packed_cmultc(*(x2),*(tw2),&x2_2);
  *(y0)  = _mm_adds_epi16(*(x0),_mm_adds_epi16(x1_2,x2_2));
  cmultc(x1_2,*(W13),&tmpre,&tmpim);
  cmacc(x2_2,*(W23),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
  *(y1) = _mm_adds_epi16(*(x0),*(y1));
  cmultc(x1_2,*(W23),&tmpre,&tmpim);
  cmacc(x2_2,*(W13),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
  *(y2) = _mm_adds_epi16(*(x0),*(y2));
}

635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662
#elif defined(__arm__)
static inline void ibfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,
			  int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,
			  int16x8_t *tw1,int16x8_t *tw2) __attribute__((always_inline));

static inline void ibfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,
			  int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,
			  int16x8_t *tw1,int16x8_t *tw2)
{

  int32x4_t tmpre,tmpim;
  int16x8_t x1_2,x2_2;

  packed_cmultc(*(x1),*(tw1),&x1_2);
  packed_cmultc(*(x2),*(tw2),&x2_2);
  *(y0)  = vqaddq_s16(*(x0),vqaddq_s16(x1_2,x2_2));
  cmultc(x1_2,*(W13),&tmpre,&tmpim);
  cmacc(x2_2,*(W23),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
  *(y1) = vqaddq_s16(*(x0),*(y1));
  cmultc(x1_2,*(W23),&tmpre,&tmpim);
  cmacc(x2_2,*(W13),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
  *(y2) = vqaddq_s16(*(x0),*(y2));
}
#endif

#if defined(__x86_64__) || defined(__i386__)
663
static inline void bfly3_tw1(__m128i *x0,__m128i *x1,__m128i *x2,
664
                             __m128i *y0,__m128i *y1,__m128i *y2) __attribute__((always_inline));
665 666

static inline void bfly3_tw1(__m128i *x0,__m128i *x1,__m128i *x2,
667 668
                             __m128i *y0,__m128i *y1,__m128i *y2)
{
669 670 671

  __m128i tmpre,tmpim;

672 673 674 675
  *(y0) = _mm_adds_epi16(*(x0),_mm_adds_epi16(*(x1),*(x2)));
  cmult(*(x1),*(W13),&tmpre,&tmpim);
  cmac(*(x2),*(W23),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
676
  *(y1) = _mm_adds_epi16(*(x0),*(y1));
677 678 679
  cmult(*(x1),*(W23),&tmpre,&tmpim);
  cmac(*(x2),*(W13),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
680 681
  *(y2) = _mm_adds_epi16(*(x0),*(y2));
}
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702
#elif defined(__arm__)
static inline void bfly3_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,
                             int16x8_t *y0,int16x8_t *y1,int16x8_t *y2) __attribute__((always_inline));

static inline void bfly3_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,
                             int16x8_t *y0,int16x8_t *y1,int16x8_t *y2)
{

  int32x4_t tmpre,tmpim;

  *(y0) = vqaddq_s16(*(x0),vqaddq_s16(*(x1),*(x2)));
  cmult(*(x1),*(W13),&tmpre,&tmpim);
  cmac(*(x2),*(W23),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
  *(y1) = vqaddq_s16(*(x0),*(y1));
  cmult(*(x1),*(W23),&tmpre,&tmpim);
  cmac(*(x2),*(W13),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
  *(y2) = vqaddq_s16(*(x0),*(y2));

}
703

704
#endif
705

706
#if defined(__x86_64__) || defined(__i386__)
707
static inline void bfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
708 709
                         __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3,
                         __m128i *tw1,__m128i *tw2,__m128i *tw3)__attribute__((always_inline));
710 711

static inline void bfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
712 713 714
                         __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3,
                         __m128i *tw1,__m128i *tw2,__m128i *tw3)
{
715 716 717

  __m128i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i;

718
  //  cmult(*(x0),*(W0),&x0r_2,&x0i_2);
719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747
  cmult(*(x1),*(tw1),&x1r_2,&x1i_2);
  cmult(*(x2),*(tw2),&x2r_2,&x2i_2);
  cmult(*(x3),*(tw3),&x3r_2,&x3i_2);
  //  dy0r = _mm_add_epi32(x0r_2,_mm_add_epi32(x1r_2,_mm_add_epi32(x2r_2,x3r_2)));
  //  dy0i = _mm_add_epi32(x0i_2,_mm_add_epi32(x1i_2,_mm_add_epi32(x2i_2,x3i_2)));
  //  *(y0)  = cpack(dy0r,dy0i);
  dy0r = _mm_add_epi32(x1r_2,_mm_add_epi32(x2r_2,x3r_2));
  dy0i = _mm_add_epi32(x1i_2,_mm_add_epi32(x2i_2,x3i_2));
  *(y0)  = _mm_add_epi16(*(x0),cpack(dy0r,dy0i));
  //  dy1r = _mm_add_epi32(x0r_2,_mm_sub_epi32(x1i_2,_mm_add_epi32(x2r_2,x3i_2)));
  //  dy1i = _mm_sub_epi32(x0i_2,_mm_add_epi32(x1r_2,_mm_sub_epi32(x2i_2,x3r_2)));
  //  *(y1)  = cpack(dy1r,dy1i);
  dy1r = _mm_sub_epi32(x1i_2,_mm_add_epi32(x2r_2,x3i_2));
  dy1i = _mm_sub_epi32(_mm_sub_epi32(x3r_2,x2i_2),x1r_2);
  *(y1)  = _mm_add_epi16(*(x0),cpack(dy1r,dy1i));
  //  dy2r = _mm_sub_epi32(x0r_2,_mm_sub_epi32(x1r_2,_mm_sub_epi32(x2r_2,x3r_2)));
  //  dy2i = _mm_sub_epi32(x0i_2,_mm_sub_epi32(x1i_2,_mm_sub_epi32(x2i_2,x3i_2)));
  //  *(y2)  = cpack(dy2r,dy2i);
  dy2r = _mm_sub_epi32(_mm_sub_epi32(x2r_2,x3r_2),x1r_2);
  dy2i = _mm_sub_epi32(_mm_sub_epi32(x2i_2,x3i_2),x1i_2);
  *(y2)  = _mm_add_epi16(*(x0),cpack(dy2r,dy2i));
  //  dy3r = _mm_sub_epi32(x0r_2,_mm_add_epi32(x1i_2,_mm_sub_epi32(x2r_2,x3i_2)));
  //  dy3i = _mm_add_epi32(x0i_2,_mm_sub_epi32(x1r_2,_mm_add_epi32(x2i_2,x3r_2)));
  //  *(y3) = cpack(dy3r,dy3i);
  dy3r = _mm_sub_epi32(_mm_sub_epi32(x3i_2,x2r_2),x1i_2);
  dy3i = _mm_sub_epi32(x1r_2,_mm_add_epi32(x2i_2,x3r_2));
  *(y3) = _mm_add_epi16(*(x0),cpack(dy3r,dy3i));
}

748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792
#elif defined(__arm__)
static inline void bfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
                         int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
                         int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3)__attribute__((always_inline));

static inline void bfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
                         int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
                         int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3)
{

  int32x4_t x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i;

  //  cmult(*(x0),*(W0),&x0r_2,&x0i_2);
  cmult(*(x1),*(tw1),&x1r_2,&x1i_2);
  cmult(*(x2),*(tw2),&x2r_2,&x2i_2);
  cmult(*(x3),*(tw3),&x3r_2,&x3i_2);
  //  dy0r = _mm_add_epi32(x0r_2,_mm_add_epi32(x1r_2,_mm_add_epi32(x2r_2,x3r_2)));
  //  dy0i = _mm_add_epi32(x0i_2,_mm_add_epi32(x1i_2,_mm_add_epi32(x2i_2,x3i_2)));
  //  *(y0)  = cpack(dy0r,dy0i);
  dy0r = vqaddq_s32(x1r_2,vqaddq_s32(x2r_2,x3r_2));
  dy0i = vqaddq_s32(x1i_2,vqaddq_s32(x2i_2,x3i_2));
  *(y0)  = vqaddq_s16(*(x0),cpack(dy0r,dy0i));
  //  dy1r = _mm_add_epi32(x0r_2,_mm_sub_epi32(x1i_2,_mm_add_epi32(x2r_2,x3i_2)));
  //  dy1i = _mm_sub_epi32(x0i_2,_mm_add_epi32(x1r_2,_mm_sub_epi32(x2i_2,x3r_2)));
  //  *(y1)  = cpack(dy1r,dy1i);
  dy1r = vqsubq_s32(x1i_2,vqaddq_s32(x2r_2,x3i_2));
  dy1i = vqsubq_s32(vqsubq_s32(x3r_2,x2i_2),x1r_2);
  *(y1)  = vqaddq_s16(*(x0),cpack(dy1r,dy1i));
  //  dy2r = _mm_sub_epi32(x0r_2,_mm_sub_epi32(x1r_2,_mm_sub_epi32(x2r_2,x3r_2)));
  //  dy2i = _mm_sub_epi32(x0i_2,_mm_sub_epi32(x1i_2,_mm_sub_epi32(x2i_2,x3i_2)));
  //  *(y2)  = cpack(dy2r,dy2i);
  dy2r = vqsubq_s32(vqsubq_s32(x2r_2,x3r_2),x1r_2);
  dy2i = vqsubq_s32(vqsubq_s32(x2i_2,x3i_2),x1i_2);
  *(y2)  = vqaddq_s16(*(x0),cpack(dy2r,dy2i));
  //  dy3r = _mm_sub_epi32(x0r_2,_mm_add_epi32(x1i_2,_mm_sub_epi32(x2r_2,x3i_2)));
  //  dy3i = _mm_add_epi32(x0i_2,_mm_sub_epi32(x1r_2,_mm_add_epi32(x2i_2,x3r_2)));
  //  *(y3) = cpack(dy3r,dy3i);
  dy3r = vqsubq_s32(vqsubq_s32(x3i_2,x2r_2),x1i_2);
  dy3i = vqsubq_s32(x1r_2,vqaddq_s32(x2i_2,x3r_2));
  *(y3) = vqaddq_s16(*(x0),cpack(dy3r,dy3i));
}

#endif

#if defined(__x86_64__) || defined(__i386__)
793
static inline void ibfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
794 795 796
                          __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3,
                          __m128i *tw1,__m128i *tw2,__m128i *tw3)__attribute__((always_inline));

797
static inline void ibfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
798 799 800
                          __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3,
                          __m128i *tw1,__m128i *tw2,__m128i *tw3)
{
801 802 803

  __m128i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i;

804

805 806 807
  cmultc(*(x1),*(tw1),&x1r_2,&x1i_2);
  cmultc(*(x2),*(tw2),&x2r_2,&x2i_2);
  cmultc(*(x3),*(tw3),&x3r_2,&x3i_2);
808

809 810 811 812 813 814 815 816 817 818 819 820 821 822
  dy0r = _mm_add_epi32(x1r_2,_mm_add_epi32(x2r_2,x3r_2));
  dy0i = _mm_add_epi32(x1i_2,_mm_add_epi32(x2i_2,x3i_2));
  *(y0)  = _mm_add_epi16(*(x0),cpack(dy0r,dy0i));
  dy3r = _mm_sub_epi32(x1i_2,_mm_add_epi32(x2r_2,x3i_2));
  dy3i = _mm_sub_epi32(_mm_sub_epi32(x3r_2,x2i_2),x1r_2);
  *(y3)  = _mm_add_epi16(*(x0),cpack(dy3r,dy3i));
  dy2r = _mm_sub_epi32(_mm_sub_epi32(x2r_2,x3r_2),x1r_2);
  dy2i = _mm_sub_epi32(_mm_sub_epi32(x2i_2,x3i_2),x1i_2);
  *(y2)  = _mm_add_epi16(*(x0),cpack(dy2r,dy2i));
  dy1r = _mm_sub_epi32(_mm_sub_epi32(x3i_2,x2r_2),x1i_2);
  dy1i = _mm_sub_epi32(x1r_2,_mm_add_epi32(x2i_2,x3r_2));
  *(y1) = _mm_add_epi16(*(x0),cpack(dy1r,dy1i));
}

823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857
#elif defined(__arm__)

static inline void ibfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
                          int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
                          int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3)__attribute__((always_inline));

static inline void ibfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
                          int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
                          int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3)
{

  int32x4_t x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i;


  cmultc(*(x1),*(tw1),&x1r_2,&x1i_2);
  cmultc(*(x2),*(tw2),&x2r_2,&x2i_2);
  cmultc(*(x3),*(tw3),&x3r_2,&x3i_2);

  dy0r  = vqaddq_s32(x1r_2,vqaddq_s32(x2r_2,x3r_2));
  dy0i  = vqaddq_s32(x1i_2,vqaddq_s32(x2i_2,x3i_2));
  *(y0) = vqaddq_s16(*(x0),cpack(dy0r,dy0i));
  dy3r  = vqsubq_s32(x1i_2,vqaddq_s32(x2r_2,x3i_2));
  dy3i  = vqsubq_s32(vqsubq_s32(x3r_2,x2i_2),x1r_2);
  *(y3) = vqaddq_s16(*(x0),cpack(dy3r,dy3i));
  dy2r  = vqsubq_s32(vqsubq_s32(x2r_2,x3r_2),x1r_2);
  dy2i  = vqsubq_s32(vqsubq_s32(x2i_2,x3i_2),x1i_2);
  *(y2) = vqaddq_s16(*(x0),cpack(dy2r,dy2i));
  dy1r  = vqsubq_s32(vqsubq_s32(x3i_2,x2r_2),x1i_2);
  dy1i  = vqsubq_s32(x1r_2,vqaddq_s32(x2i_2,x3r_2));
  *(y1) = vqaddq_s16(*(x0),cpack(dy1r,dy1i));
}

#endif

#if defined(__x86_64__) || defined(__i386__)
858 859

static inline void bfly4_tw1(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
860
                             __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3)__attribute__((always_inline));
861 862

static inline void bfly4_tw1(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
863 864
                             __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3)
{
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879
  register __m128i x1_flip,x3_flip,x02t,x13t;
  register __m128i complex_shuffle = _mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);

  x02t    = _mm_adds_epi16(*(x0),*(x2));
  x13t    = _mm_adds_epi16(*(x1),*(x3));
  *(y0)   = _mm_adds_epi16(x02t,x13t);
  *(y2)   = _mm_subs_epi16(x02t,x13t);
  x1_flip = _mm_sign_epi16(*(x1),*(__m128i*)conjugatedft);
  x1_flip = _mm_shuffle_epi8(x1_flip,complex_shuffle);
  x3_flip = _mm_sign_epi16(*(x3),*(__m128i*)conjugatedft);
  x3_flip = _mm_shuffle_epi8(x3_flip,complex_shuffle);
  x02t    = _mm_subs_epi16(*(x0),*(x2));
  x13t    = _mm_subs_epi16(x1_flip,x3_flip);
  *(y1)   = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
  *(y3)   = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
880

881
  /*
882
  *(y0) = _mm_adds_epi16(*(x0),_mm_adds_epi16(*(x1),_mm_adds_epi16(*(x2),*(x3))));
883
  x1_flip = _mm_sign_epi16(*(x1),*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
884
  x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
885
  x3_flip = _mm_sign_epi16(*(x3),*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
886
  x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
887 888 889
  *(y1)   = _mm_adds_epi16(*(x0),_mm_subs_epi16(x1_flip,_mm_adds_epi16(*(x2),x3_flip)));
  *(y2)   = _mm_subs_epi16(*(x0),_mm_subs_epi16(*(x1),_mm_subs_epi16(*(x2),*(x3))));
  *(y3)   = _mm_subs_epi16(*(x0),_mm_adds_epi16(x1_flip,_mm_subs_epi16(*(x2),x3_flip)));
890
  */
891 892
}

893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915
#elif defined(__arm__)

static inline void bfly4_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
                             int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3)__attribute__((always_inline));

static inline void bfly4_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
                             int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3)
{

  register int16x8_t x1_flip,x3_flip;

  *(y0) = vqaddq_s16(*(x0),vqaddq_s16(*(x1),vqaddq_s16(*(x2),*(x3))));
  x1_flip = vrev32q_s16(vmulq_s16(*(x1),*(int16x8_t*)conjugatedft));
  x3_flip = vrev32q_s16(vmulq_s16(*(x3),*(int16x8_t*)conjugatedft));
  *(y1)   = vqaddq_s16(*(x0),vqsubq_s16(x1_flip,vqaddq_s16(*(x2),x3_flip)));
  *(y2)   = vqsubq_s16(*(x0),vqsubq_s16(*(x1),vqsubq_s16(*(x2),*(x3))));
  *(y3)   = vqsubq_s16(*(x0),vqaddq_s16(x1_flip,vqsubq_s16(*(x2),x3_flip)));
}

#endif

#if defined(__x86_64__) || defined(__i386__)

916
static inline void ibfly4_tw1(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
917
                              __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3)__attribute__((always_inline));
918 919

static inline void ibfly4_tw1(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
920 921 922
                              __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3)
{

923 924
  register __m128i x1_flip,x3_flip;

925
  *(y0) = _mm_adds_epi16(*(x0),_mm_adds_epi16(*(x1),_mm_adds_epi16(*(x2),*(x3))));
926 927

  x1_flip = _mm_sign_epi16(*(x1),*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
928 929 930
  //  x1_flip = _mm_shufflelo_epi16(x1_flip,_MM_SHUFFLE(2,3,0,1));
  //  x1_flip = _mm_shufflehi_epi16(x1_flip,_MM_SHUFFLE(2,3,0,1));
  x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
931
  x3_flip = _mm_sign_epi16(*(x3),*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
932 933 934
  //  x3_flip = _mm_shufflelo_epi16(x3_flip,_MM_SHUFFLE(2,3,0,1));
  //  x3_flip = _mm_shufflehi_epi16(x3_flip,_MM_SHUFFLE(2,3,0,1));
  x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
935 936 937 938 939
  *(y1)   = _mm_subs_epi16(*(x0),_mm_adds_epi16(x1_flip,_mm_subs_epi16(*(x2),x3_flip)));
  *(y2)   = _mm_subs_epi16(*(x0),_mm_subs_epi16(*(x1),_mm_subs_epi16(*(x2),*(x3))));
  *(y3)   = _mm_adds_epi16(*(x0),_mm_subs_epi16(x1_flip,_mm_adds_epi16(*(x2),x3_flip)));
}

940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961

#elif defined(__arm__)
static inline void ibfly4_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
			      int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3)__attribute__((always_inline));

static inline void ibfly4_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
			      int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3)
{

  register int16x8_t x1_flip,x3_flip;

  *(y0) = vqaddq_s16(*(x0),vqaddq_s16(*(x1),vqaddq_s16(*(x2),*(x3))));
  x1_flip = vrev32q_s16(vmulq_s16(*(x1),*(int16x8_t*)conjugatedft));
  x3_flip = vrev32q_s16(vmulq_s16(*(x3),*(int16x8_t*)conjugatedft));
  *(y1)   = vqsubq_s16(*(x0),vqaddq_s16(x1_flip,vqsubq_s16(*(x2),x3_flip)));
  *(y2)   = vqsubq_s16(*(x0),vqsubq_s16(*(x1),vqsubq_s16(*(x2),*(x3))));
  *(y3)   = vqaddq_s16(*(x0),vqsubq_s16(x1_flip,vqaddq_s16(*(x2),x3_flip)));
}

#endif

#if defined(__x86_64__) || defined(__i386__)
962
static inline void bfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
963 964 965
                            __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3,
                            __m128i *tw1,__m128i *tw2,__m128i *tw3,
                            __m128i *tw1b,__m128i *tw2b,__m128i *tw3b)__attribute__((always_inline));
966 967

static inline void bfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
968 969 970 971
                            __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3,
                            __m128i *tw1,__m128i *tw2,__m128i *tw3,
                            __m128i *tw1b,__m128i *tw2b,__m128i *tw3b)
{
972 973 974 975 976 977 978 979 980 981 982 983 984

  register __m128i x1t,x2t,x3t,x02t,x13t;
  register __m128i x1_flip,x3_flip;

  x1t = packed_cmult2(*(x1),*(tw1),*(tw1b));
  x2t = packed_cmult2(*(x2),*(tw2),*(tw2b));
  x3t = packed_cmult2(*(x3),*(tw3),*(tw3b));


  //  bfly4_tw1(x0,&x1t,&x2t,&x3t,y0,y1,y2,y3);
  x02t  = _mm_adds_epi16(*(x0),x2t);
  x13t  = _mm_adds_epi16(x1t,x3t);
  /*
985
  *(y0) = _mm_adds_epi16(*(x0),_mm_adds_epi16(x1t,_mm_adds_epi16(x2t,x3t)));
986 987 988 989 990 991
  *(y2)   = _mm_subs_epi16(*(x0),_mm_subs_epi16(x1t,_mm_subs_epi16(x2t,x3t)));
  */
  *(y0)   = _mm_adds_epi16(x02t,x13t);
  *(y2)   = _mm_subs_epi16(x02t,x13t);

  x1_flip = _mm_sign_epi16(x1t,*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
992 993 994
  //  x1_flip = _mm_shufflelo_epi16(x1_flip,_MM_SHUFFLE(2,3,0,1));
  //  x1_flip = _mm_shufflehi_epi16(x1_flip,_MM_SHUFFLE(2,3,0,1));
  x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
995
  x3_flip = _mm_sign_epi16(x3t,*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
996 997 998
  //  x3_flip = _mm_shufflelo_epi16(x3_flip,_MM_SHUFFLE(2,3,0,1));
  //  x3_flip = _mm_shufflehi_epi16(x3_flip,_MM_SHUFFLE(2,3,0,1));
  x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009
  x02t  = _mm_subs_epi16(*(x0),x2t);
  x13t  = _mm_subs_epi16(x1_flip,x3_flip);
  /*
  *(y1)   = _mm_adds_epi16(*(x0),_mm_subs_epi16(x1_flip,_mm_adds_epi16(x2t,x3_flip)));  // x0 + x1f - x2 - x3f
  *(y3)   = _mm_subs_epi16(*(x0),_mm_adds_epi16(x1_flip,_mm_subs_epi16(x2t,x3_flip)));  // x0 - x1f - x2 + x3f
  */
  *(y1)   = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
  *(y3)   = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f

}

1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045
#elif defined(__arm__)

static inline void bfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
                            int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
                            int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3,
                            int16x8_t *tw1b,int16x8_t *tw2b,int16x8_t *tw3b)__attribute__((always_inline));

static inline void bfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
                            int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
                            int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3,
                            int16x8_t *tw1b,int16x8_t *tw2b,int16x8_t *tw3b)
{

  register int16x8_t x1t,x2t,x3t,x02t,x13t;
  register int16x8_t x1_flip,x3_flip;

  x1t = packed_cmult2(*(x1),*(tw1),*(tw1b));
  x2t = packed_cmult2(*(x2),*(tw2),*(tw2b));
  x3t = packed_cmult2(*(x3),*(tw3),*(tw3b));



  x02t  = vqaddq_s16(*(x0),x2t);
  x13t  = vqaddq_s16(x1t,x3t);
  *(y0)   = vqaddq_s16(x02t,x13t);
  *(y2)   = vqsubq_s16(x02t,x13t);
  x1_flip = vrev32q_s16(vmulq_s16(x1t,*(int16x8_t*)conjugatedft));
  x3_flip = vrev32q_s16(vmulq_s16(x3t,*(int16x8_t*)conjugatedft));
  x02t  = vqsubq_s16(*(x0),x2t);
  x13t  = vqsubq_s16(x1_flip,x3_flip);
  *(y1)   = vqaddq_s16(x02t,x13t);  // x0 + x1f - x2 - x3f
  *(y3)   = vqsubq_s16(x02t,x13t);  // x0 - x1f - x2 + x3f
}
#endif

#if defined(__x86_64__) || defined(__i386__)
1046
static inline void ibfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
1047 1048 1049
                             __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3,
                             __m128i *tw1,__m128i *tw2,__m128i *tw3,
                             __m128i *tw1b,__m128i *tw2b,__m128i *tw3b)__attribute__((always_inline));
1050 1051

static inline void ibfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
1052 1053 1054 1055 1056
                             __m128i *y0,__m128i *y1,__m128i *y2,__m128i *y3,
                             __m128i *tw1,__m128i *tw2,__m128i *tw3,
                             __m128i *tw1b,__m128i *tw2b,__m128i *tw3b)
{

1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068
  register __m128i x1t,x2t,x3t,x02t,x13t;
  register __m128i x1_flip,x3_flip;

  x1t = packed_cmult2(*(x1),*(tw1),*(tw1b));
  x2t = packed_cmult2(*(x2),*(tw2),*(tw2b));
  x3t = packed_cmult2(*(x3),*(tw3),*(tw3b));


  //  bfly4_tw1(x0,&x1t,&x2t,&x3t,y0,y1,y2,y3);
  x02t  = _mm_adds_epi16(*(x0),x2t);
  x13t  = _mm_adds_epi16(x1t,x3t);
  /*
1069
  *(y0) = _mm_adds_epi16(*(x0),_mm_adds_epi16(x1t,_mm_adds_epi16(x2t,x3t)));
1070 1071 1072 1073 1074 1075
  *(y2)   = _mm_subs_epi16(*(x0),_mm_subs_epi16(x1t,_mm_subs_epi16(x2t,x3t)));
  */
  *(y0)   = _mm_adds_epi16(x02t,x13t);
  *(y2)   = _mm_subs_epi16(x02t,x13t);

  x1_flip = _mm_sign_epi16(x1t,*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
1076 1077 1078
  //  x1_flip = _mm_shufflelo_epi16(x1_flip,_MM_SHUFFLE(2,3,0,1));
  //  x1_flip = _mm_shufflehi_epi16(x1_flip,_MM_SHUFFLE(2,3,0,1));
  x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
1079
  x3_flip = _mm_sign_epi16(x3t,*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
1080 1081 1082
  //  x3_flip = _mm_shufflelo_epi16(x3_flip,_MM_SHUFFLE(2,3,0,1));
  //  x3_flip = _mm_shufflehi_epi16(x3_flip,_MM_SHUFFLE(2,3,0,1));
  x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
  x02t  = _mm_subs_epi16(*(x0),x2t);
  x13t  = _mm_subs_epi16(x1_flip,x3_flip);
  /*
  *(y1)   = _mm_adds_epi16(*(x0),_mm_subs_epi16(x1_flip,_mm_adds_epi16(x2t,x3_flip)));  // x0 + x1f - x2 - x3f
  *(y3)   = _mm_subs_epi16(*(x0),_mm_adds_epi16(x1_flip,_mm_subs_epi16(x2t,x3_flip)));  // x0 - x1f - x2 + x3f
  */
  *(y3)   = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
  *(y1)   = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f

}

1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127
#elif defined(__arm__)
static inline void ibfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
			     int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
			     int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3,
			     int16x8_t *tw1b,int16x8_t *tw2b,int16x8_t *tw3b)__attribute__((always_inline));

static inline void ibfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
			     int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
			     int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3,
			     int16x8_t *tw1b,int16x8_t *tw2b,int16x8_t *tw3b)
{

  register int16x8_t x1t,x2t,x3t,x02t,x13t;
  register int16x8_t x1_flip,x3_flip;

  x1t = packed_cmult2(*(x1),*(tw1),*(tw1b));
  x2t = packed_cmult2(*(x2),*(tw2),*(tw2b));
  x3t = packed_cmult2(*(x3),*(tw3),*(tw3b));

  x02t    = vqaddq_s16(*(x0),x2t);
  x13t    = vqaddq_s16(x1t,x3t);
  *(y0)   = vqaddq_s16(x02t,x13t);
  *(y2)   = vqsubq_s16(x02t,x13t);
  x1_flip = vrev32q_s16(vmulq_s16(x1t,*(int16x8_t*)conjugatedft));
  x3_flip = vrev32q_s16(vmulq_s16(x3t,*(int16x8_t*)conjugatedft));
  x02t    = vqsubq_s16(*(x0),x2t);
  x13t    = vqsubq_s16(x1_flip,x3_flip);
  *(y3)   = vqaddq_s16(x02t,x13t);  // x0 - x1f - x2 + x3f
  *(y1)   = vqsubq_s16(x02t,x13t);  // x0 + x1f - x2 - x3f
}

#endif

#if defined(__x86_64__) || defined(__i386__)
1128
static inline void bfly5(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3,__m128i *x4,
1129 1130
                         __m128i *y0, __m128i *y1, __m128i *y2, __m128i *y3,__m128i *y4,
                         __m128i *tw1,__m128i *tw2,__m128i *tw3,__m128i *tw4)__attribute__((always_inline));
1131 1132

static inline void bfly5(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3,__m128i *x4,
1133 1134 1135
                         __m128i *y0, __m128i *y1, __m128i *y2, __m128i *y3,__m128i *y4,
                         __m128i *tw1,__m128i *tw2,__m128i *tw3,__m128i *tw4)
{
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146



  __m128i x1_2,x2_2,x3_2,x4_2,tmpre,tmpim;

  packed_cmult(*(x1),*(tw1),&x1_2);
  packed_cmult(*(x2),*(tw2),&x2_2);
  packed_cmult(*(x3),*(tw3),&x3_2);
  packed_cmult(*(x4),*(tw4),&x4_2);

  *(y0)  = _mm_adds_epi16(*(x0),_mm_adds_epi16(x1_2,_mm_adds_epi16(x2_2,_mm_adds_epi16(x3_2,x4_2))));
1147 1148 1149 1150 1151
  cmult(x1_2,*(W15),&tmpre,&tmpim);
  cmac(x2_2,*(W25),&tmpre,&tmpim);
  cmac(x3_2,*(W35),&tmpre,&tmpim);
  cmac(x4_2,*(W45),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
1152 1153
  *(y1) = _mm_adds_epi16(*(x0),*(y1));

1154 1155 1156 1157 1158
  cmult(x1_2,*(W25),&tmpre,&tmpim);
  cmac(x2_2,*(W45),&tmpre,&tmpim);
  cmac(x3_2,*(W15),&tmpre,&tmpim);
  cmac(x4_2,*(W35),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
1159 1160
  *(y2) = _mm_adds_epi16(*(x0),*(y2));

1161 1162 1163 1164 1165
  cmult(x1_2,*(W35),&tmpre,&tmpim);
  cmac(x2_2,*(W15),&tmpre,&tmpim);
  cmac(x3_2,*(W45),&tmpre,&tmpim);
  cmac(x4_2,*(W25),&tmpre,&tmpim);
  *(y3) = cpack(tmpre,tmpim);
1166 1167
  *(y3) = _mm_adds_epi16(*(x0),*(y3));

1168 1169 1170 1171 1172
  cmult(x1_2,*(W45),&tmpre,&tmpim);
  cmac(x2_2,*(W35),&tmpre,&tmpim);
  cmac(x3_2,*(W25),&tmpre,&tmpim);
  cmac(x4_2,*(W15),&tmpre,&tmpim);
  *(y4) = cpack(tmpre,tmpim);
1173 1174 1175
  *(y4) = _mm_adds_epi16(*(x0),*(y4));


1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227
}

#elif defined(__arm__)
static inline void bfly5(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4,
                         int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4,
                         int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3,int16x8_t *tw4)__attribute__((always_inline));

static inline void bfly5(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4,
                         int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4,
                         int16x8_t *tw1,int16x8_t *tw2,int16x8_t *tw3,int16x8_t *tw4)
{



  int16x8_t x1_2,x2_2,x3_2,x4_2;
  int32x4_t tmpre,tmpim;

  packed_cmult(*(x1),*(tw1),&x1_2);
  packed_cmult(*(x2),*(tw2),&x2_2);
  packed_cmult(*(x3),*(tw3),&x3_2);
  packed_cmult(*(x4),*(tw4),&x4_2);

  *(y0)  = vqaddq_s16(*(x0),vqaddq_s16(x1_2,vqaddq_s16(x2_2,vqaddq_s16(x3_2,x4_2))));
  cmult(x1_2,*(W15),&tmpre,&tmpim);
  cmac(x2_2,*(W25),&tmpre,&tmpim);
  cmac(x3_2,*(W35),&tmpre,&tmpim);
  cmac(x4_2,*(W45),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
  *(y1) = vqaddq_s16(*(x0),*(y1));

  cmult(x1_2,*(W25),&tmpre,&tmpim);
  cmac(x2_2,*(W45),&tmpre,&tmpim);
  cmac(x3_2,*(W15),&tmpre,&tmpim);
  cmac(x4_2,*(W35),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
  *(y2) = vqaddq_s16(*(x0),*(y2));

  cmult(x1_2,*(W35),&tmpre,&tmpim);
  cmac(x2_2,*(W15),&tmpre,&tmpim);
  cmac(x3_2,*(W45),&tmpre,&tmpim);
  cmac(x4_2,*(W25),&tmpre,&tmpim);
  *(y3) = cpack(tmpre,tmpim);
  *(y3) = vqaddq_s16(*(x0),*(y3));

  cmult(x1_2,*(W45),&tmpre,&tmpim);
  cmac(x2_2,*(W35),&tmpre,&tmpim);
  cmac(x3_2,*(W25),&tmpre,&tmpim);
  cmac(x4_2,*(W15),&tmpre,&tmpim);
  *(y4) = cpack(tmpre,tmpim);
  *(y4) = vqaddq_s16(*(x0),*(y4));


1228
}
1229 1230


1231
#endif
1232

1233
#if defined(__x86_64__) || defined(__i386__)
1234
static inline void bfly5_tw1(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3,__m128i *x4,
1235
                             __m128i *y0, __m128i *y1, __m128i *y2, __m128i *y3,__m128i *y4) __attribute__((always_inline));
1236 1237

static inline void bfly5_tw1(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3,__m128i *x4,
1238 1239
                             __m128i *y0, __m128i *y1, __m128i *y2, __m128i *y3,__m128i *y4)
{
1240 1241 1242

  __m128i tmpre,tmpim;

1243 1244 1245 1246 1247 1248
  *(y0) = _mm_adds_epi16(*(x0),_mm_adds_epi16(*(x1),_mm_adds_epi16(*(x2),_mm_adds_epi16(*(x3),*(x4)))));
  cmult(*(x1),*(W15),&tmpre,&tmpim);
  cmac(*(x2),*(W25),&tmpre,&tmpim);
  cmac(*(x3),*(W35),&tmpre,&tmpim);
  cmac(*(x4),*(W45),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
1249
  *(y1) = _mm_adds_epi16(*(x0),*(y1));
1250 1251 1252 1253 1254
  cmult(*(x1),*(W25),&tmpre,&tmpim);
  cmac(*(x2),*(W45),&tmpre,&tmpim);
  cmac(*(x3),*(W15),&tmpre,&tmpim);
  cmac(*(x4),*(W35),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
1255
  *(y2) = _mm_adds_epi16(*(x0),*(y2));
1256 1257 1258 1259 1260
  cmult(*(x1),*(W35),&tmpre,&tmpim);
  cmac(*(x2),*(W15),&tmpre,&tmpim);
  cmac(*(x3),*(W45),&tmpre,&tmpim);
  cmac(*(x4),*(W25),&tmpre,&tmpim);
  *(y3) = cpack(tmpre,tmpim);
1261
  *(y3) = _mm_adds_epi16(*(x0),*(y3));
1262 1263 1264 1265 1266
  cmult(*(x1),*(W45),&tmpre,&tmpim);
  cmac(*(x2),*(W35),&tmpre,&tmpim);
  cmac(*(x3),*(W25),&tmpre,&tmpim);
  cmac(*(x4),*(W15),&tmpre,&tmpim);
  *(y4) = cpack(tmpre,tmpim);
1267 1268 1269
  *(y4) = _mm_adds_epi16(*(x0),*(y4));
}

1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307
#elif defined(__arm__)
static inline void bfly5_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4,
                             int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4) __attribute__((always_inline));

static inline void bfly5_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4,
                             int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4)
{

  int32x4_t tmpre,tmpim;

  *(y0) = vqaddq_s16(*(x0),vqaddq_s16(*(x1),vqaddq_s16(*(x2),vqaddq_s16(*(x3),*(x4)))));
  cmult(*(x1),*(W15),&tmpre,&tmpim);
  cmac(*(x2),*(W25),&tmpre,&tmpim);
  cmac(*(x3),*(W35),&tmpre,&tmpim);
  cmac(*(x4),*(W45),&tmpre,&tmpim);
  *(y1) = cpack(tmpre,tmpim);
  *(y1) = vqaddq_s16(*(x0),*(y1));
  cmult(*(x1),*(W25),&tmpre,&tmpim);
  cmac(*(x2),*(W45),&tmpre,&tmpim);
  cmac(*(x3),*(W15),&tmpre,&tmpim);
  cmac(*(x4),*(W35),&tmpre,&tmpim);
  *(y2) = cpack(tmpre,tmpim);
  *(y2) = vqaddq_s16(*(x0),*(y2));
  cmult(*(x1),*(W35),&tmpre,&tmpim);
  cmac(*(x2),*(W15),&tmpre,&tmpim);
  cmac(*(x3),*(W45),&tmpre,&tmpim);
  cmac(*(x4),*(W25),&tmpre,&tmpim);
  *(y3) = cpack(tmpre,tmpim);
  *(y3) = vqaddq_s16(*(x0),*(y3));
  cmult(*(x1),*(W45),&tmpre,&tmpim);
  cmac(*(x2),*(W35),&tmpre,&tmpim);
  cmac(*(x3),*(W25),&tmpre,&tmpim);
  cmac(*(x4),*(W15),&tmpre,&tmpim);
  *(y4) = cpack(tmpre,tmpim);
  *(y4) = vqaddq_s16(*(x0),*(y4));
}

#endif
1308 1309 1310
// performs 4x4 transpose of input x (complex interleaved) using 128bit SIMD intrinsics
// i.e. x = [x0r x0i x1r x1i ... x15r x15i], y = [x0r x0i x4r x4i x8r x8i x12r x12i x1r x1i x5r x5i x9r x9i x13r x13i x2r x2i ... x15r x15i]

1311
#if defined(__x86_64__) || defined(__i386__)
1312
static inline void transpose16(__m128i *x,__m128i *y) __attribute__((always_inline));
1313 1314
static inline void transpose16(__m128i *x,__m128i *y)
{
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326
  register __m128i ytmp0,ytmp1,ytmp2,ytmp3;

  ytmp0 = _mm_unpacklo_epi32(x[0],x[1]);
  ytmp1 = _mm_unpackhi_epi32(x[0],x[1]);
  ytmp2 = _mm_unpacklo_epi32(x[2],x[3]);
  ytmp3 = _mm_unpackhi_epi32(x[2],x[3]);
  y[0]    = _mm_unpacklo_epi64(ytmp0,ytmp2);
  y[1]    = _mm_unpackhi_epi64(ytmp0,ytmp2);
  y[2]    = _mm_unpacklo_epi64(ytmp1,ytmp3);
  y[3]    = _mm_unpackhi_epi64(ytmp1,ytmp3);
}

1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342
#elif defined(__arm__)
static inline void transpose16(int16x8_t *x,int16x8_t *y) __attribute__((always_inline));
static inline void transpose16(int16x8_t *x,int16x8_t *y)
{
  register uint32x4x2_t ytmp0,ytmp1;

  ytmp0 = vtrnq_u32((uint32x4_t)(x[0]),(uint32x4_t)(x[1]));
  ytmp1 = vtrnq_u32((uint32x4_t)(x[2]),(uint32x4_t)(x[3]));

  y[0]  = vcombine_s16(vget_low_s16((int16x8_t)ytmp0.val[0]),vget_low_s16((int16x8_t)ytmp1.val[0]));
  y[1]  = vcombine_s16(vget_high_s16((int16x8_t)ytmp0.val[0]),vget_high_s16((int16x8_t)ytmp1.val[0]));
  y[2]  = vcombine_s16(vget_low_s16((int16x8_t)ytmp0.val[1]),vget_low_s16((int16x8_t)ytmp1.val[1]));
  y[3]  = vcombine_s16(vget_high_s16((int16x8_t)ytmp0.val[1]),vget_high_s16((int16x8_t)ytmp1.val[1]));
}

# endif
1343
// same as above but output is offset by off
1344
#if defined(__x86_64__) || defined(__i386__)
1345 1346
static inline void transpose16_ooff(__m128i *x,__m128i *y,int off) __attribute__((always_inline));

1347 1348
static inline void transpose16_ooff(__m128i *x,__m128i *y,int off)
{
1349 1350 1351 1352 1353 1354 1355
  register __m128i ytmp0,ytmp1,ytmp2,ytmp3;
  __m128i *y2=y;

  ytmp0 = _mm_unpacklo_epi32(x[0],x[1]);
  ytmp1 = _mm_unpackhi_epi32(x[0],x[1]);
  ytmp2 = _mm_unpacklo_epi32(x[2],x[3]);
  ytmp3 = _mm_unpackhi_epi32(x[2],x[3]);
1356 1357 1358 1359 1360 1361
  *y2     = _mm_unpacklo_epi64(ytmp0,ytmp2);
  y2+=off;
  *y2     = _mm_unpackhi_epi64(ytmp0,ytmp2);
  y2+=off;
  *y2     = _mm_unpacklo_epi64(ytmp1,ytmp3);
  y2+=off;
1362 1363 1364
  *y2     = _mm_unpackhi_epi64(ytmp1,ytmp3);
}

1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387
#elif defined(__arm__)
static inline void transpose16_ooff(int16x8_t *x,int16x8_t *y,int off) __attribute__((always_inline));

static inline void transpose16_ooff(int16x8_t *x,int16x8_t *y,int off)
{
  int16x8_t *y2=y;
  register uint32x4x2_t ytmp0,ytmp1;

  ytmp0 = vtrnq_u32((uint32x4_t)(x[0]),(uint32x4_t)(x[1]));
  ytmp1 = vtrnq_u32((uint32x4_t)(x[2]),(uint32x4_t)(x[3]));

  *y2   = (int16x8_t)vcombine_s16(vget_low_s16((int16x8_t)ytmp0.val[0]),vget_low_s16((int16x8_t)ytmp1.val[0])); y2+=off;
  *y2   = (int16x8_t)vcombine_s16(vget_low_s16((int16x8_t)ytmp0.val[1]),vget_low_s16((int16x8_t)ytmp1.val[1])); y2+=off;
  *y2   = (int16x8_t)vcombine_s16(vget_high_s16((int16x8_t)ytmp0.val[0]),vget_high_s16((int16x8_t)ytmp1.val[0])); y2+=off;
  *y2   = (int16x8_t)vcombine_s16(vget_high_s16((int16x8_t)ytmp0.val[1]),vget_high_s16((int16x8_t)ytmp1.val[1]));


}

#endif

#if defined(__x86_64__) || defined(__i386__)

1388
static inline void transpose4_ooff(__m64 *x,__m64 *y,int off)__attribute__((always_inline));
1389 1390
static inline void transpose4_ooff(__m64 *x,__m64 *y,int off)
{
1391 1392 1393
  y[0]   = _mm_unpacklo_pi32(x[0],x[1]);
  y[off] = _mm_unpackhi_pi32(x[0],x[1]);
}
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405
#elif (__arm__)

static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off)__attribute__((always_inline));
static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off)
{
  uint32x2x2_t ytmp = vtrn_u32((uint32x2_t)x[0],(uint32x2_t)x[1]);

  y[0]   = (int16x4_t)ytmp.val[0];
  y[off] = (int16x4_t)ytmp.val[1];
}

#endif
1406 1407 1408 1409

// 16-point optimized DFT kernel

int16_t tw16[24] __attribute__((aligned(16))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,
1410 1411 1412
                                                  32767,0,23169,-23170,0     ,-32767,-23170,-23170,
                                                  32767,0,12539,-30273,-23170,-23170,-30273,12539
                                                };
1413 1414

int16_t tw16a[24] __attribute__((aligned(16))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,
1415 1416 1417
                                                  32767,0,23169,23170,0     ,32767,-23170,23170,
                                                  32767,0,12539,30273,-23170,23170,-30273,-12539
                                                 };
1418 1419

int16_t tw16b[24] __attribute__((aligned(16))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,
1420 1421 1422
                                                   0,32767,-23170,23169,-32767,0     ,-23170,-23170,
                                                   0,32767,-30273,12539,-23170,-23170,12539 ,-30273
                                                 };
1423 1424

int16_t tw16c[24] __attribute__((aligned(16))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,
1425 1426 1427
                                                   0,32767,23170,23169,32767,0     ,23170 ,-23170,
                                                   0,32767,30273,12539,23170,-23170,-12539,-30273
                                                 };
1428

1429 1430


1431 1432
static inline void dft16(int16_t *x,int16_t *y) __attribute__((always_inline));

1433 1434
static inline void dft16(int16_t *x,int16_t *y)
{
1435

1436 1437
#if defined(__x86_64__) || defined(__i386__)

Raymond Knopp's avatar
 
Raymond Knopp committed
1438
  __m128i *tw16a_128=(__m128i *)tw16a,*tw16b_128=(__m128i *)tw16b,*x128=(__m128i *)x,*y128=(__m128i *)y;
1439

1440 1441 1442


#ifndef AVX2
1443 1444
  /*  This is the original version before unrolling

1445
  bfly4_tw1(x128,x128+1,x128+2,x128+3,
1446
      y128,y128+1,y128+2,y128+3);
1447 1448 1449 1450

  transpose16(y128,ytmp);

  bfly4_16(ytmp,ytmp+1,ytmp+2,ytmp+3,
1451 1452
     y128,y128+1,y128+2,y128+3,
     tw16_128,tw16_128+1,tw16_128+2);
1453 1454 1455 1456
  */

  register __m128i x1_flip,x3_flip,x02t,x13t;
  register __m128i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3;
1457
  register __m128i complex_shuffle = _mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
1458 1459 1460 1461 1462 1463 1464 1465

  // First stage : 4 Radix-4 butterflies without input twiddles

  x02t    = _mm_adds_epi16(x128[0],x128[2]);
  x13t    = _mm_adds_epi16(x128[1],x128[3]);
  xtmp0   = _mm_adds_epi16(x02t,x13t);
  xtmp2   = _mm_subs_epi16(x02t,x13t);
  x1_flip = _mm_sign_epi16(x128[1],*(__m128i*)conjugatedft);
1466
  x1_flip = _mm_shuffle_epi8(x1_flip,complex_shuffle);
1467
  x3_flip = _mm_sign_epi16(x128[3],*(__m128i*)conjugatedft);
1468
  x3_flip = _mm_shuffle_epi8(x3_flip,complex_shuffle);
1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492
  x02t    = _mm_subs_epi16(x128[0],x128[2]);
  x13t    = _mm_subs_epi16(x1_flip,x3_flip);
  xtmp1   = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
  xtmp3   = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f

  ytmp0   = _mm_unpacklo_epi32(xtmp0,xtmp1);
  ytmp1   = _mm_unpackhi_epi32(xtmp0,xtmp1);
  ytmp2   = _mm_unpacklo_epi32(xtmp2,xtmp3);
  ytmp3   = _mm_unpackhi_epi32(xtmp2,xtmp3);
  xtmp0   = _mm_unpacklo_epi64(ytmp0,ytmp2);
  xtmp1   = _mm_unpackhi_epi64(ytmp0,ytmp2);
  xtmp2   = _mm_unpacklo_epi64(ytmp1,ytmp3);
  xtmp3   = _mm_unpackhi_epi64(ytmp1,ytmp3);

  // Second stage : 4 Radix-4 butterflies with input twiddles
  xtmp1 = packed_cmult2(xtmp1,tw16a_128[0],tw16b_128[0]);
  xtmp2 = packed_cmult2(xtmp2,tw16a_128[1],tw16b_128[1]);
  xtmp3 = packed_cmult2(xtmp3,tw16a_128[2],tw16b_128[2]);

  x02t    = _mm_adds_epi16(xtmp0,xtmp2);
  x13t    = _mm_adds_epi16(xtmp1,xtmp3);
  y128[0] = _mm_adds_epi16(x02t,x13t);
  y128[2] = _mm_subs_epi16(x02t,x13t);
  x1_flip = _mm_sign_epi16(xtmp1,*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
1493
  x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
1494
  x3_flip = _mm_sign_epi16(xtmp3,*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
1495
  x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
1496 1497 1498 1499
  x02t    = _mm_subs_epi16(xtmp0,xtmp2);
  x13t    = _mm_subs_epi16(x1_flip,x3_flip);
  y128[1] = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
  y128[3] = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
1500

1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525
#else

  //  x02t    = _mm_adds_epi16(x128[0],x128[2]);
  //  x13t    = _mm_adds_epi16(x128[1],x128[3]);

  xt      = _mm256_adds_epi16(x256[0],x256[1]);

  xtmp0   = _mm_adds_epi16(x02t,x13t);
  xtmp2   = _mm_subs_epi16(x02t,x13t);

  x13_flip
  x1_flip = _mm_sign_epi16(x128[1],*(__m128i*)conjugatedft);
  x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
  x3_flip = _mm_sign_epi16(x128[3],*(__m128i*)conjugatedft);
  x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));

  //  x02t    = _mm_subs_epi16(x128[0],x128[2]);
  //  x13t    = _mm_subs_epi16(x1_flip,x3_flip);
  xt      = _mm256_subs_epi16(x256flip0,x256flip1);

  xtmp1   = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
  xtmp3   = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f


#endif
1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540

#elif defined(__arm__)

  int16x8_t *tw16a_128=(int16x8_t *)tw16a,*tw16b_128=(int16x8_t *)tw16b,*x128=(int16x8_t *)x,*y128=(int16x8_t *)y;

  /*  This is the original version before unrolling

  bfly4_tw1(x128,x128+1,x128+2,x128+3,
      y128,y128+1,y128+2,y128+3);

  transpose16(y128,ytmp);

  bfly4_16(ytmp,ytmp+1,ytmp+2,ytmp+3,
     y128,y128+1,y128+2,y128+3,
     tw16_128,tw16_128+1,tw16_128+2);
1541
  */
1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594

  register int16x8_t x1_flip,x3_flip,x02t,x13t;
  register int16x8_t xtmp0,xtmp1,xtmp2,xtmp3;
  register uint32x4x2_t ytmp0,ytmp1;
  register int16x8_t ytmp0b,ytmp1b,ytmp2b,ytmp3b;

  // First stage : 4 Radix-4 butterflies without input twiddles
  
  x02t    = vqaddq_s16(x128[0],x128[2]);
  x13t    = vqaddq_s16(x128[1],x128[3]);
  xtmp0   = vqaddq_s16(x02t,x13t);
  xtmp2   = vqsubq_s16(x02t,x13t);
  x1_flip = vrev32q_s16(vmulq_s16(x128[1],*(int16x8_t*)conjugatedft));
  x3_flip = vrev32q_s16(vmulq_s16(x128[3],*(int16x8_t*)conjugatedft));
  x02t    = vqsubq_s16(x128[0],x128[2]);
  x13t    = vqsubq_s16(x1_flip,x3_flip);
  xtmp1   = vqaddq_s16(x02t,x13t);  // x0 + x1f - x2 - x3f
  xtmp3   = vqsubq_s16(x02t,x13t);  // x0 - x1f - x2 + x3f

  ytmp0  = vtrnq_u32((uint32x4_t)(xtmp0),(uint32x4_t)(xtmp1));
// y0[0] = [x00 x10 x02 x12], y0[1] = [x01 x11 x03 x13]
  ytmp1  = vtrnq_u32((uint32x4_t)(xtmp2),(uint32x4_t)(xtmp3));
// y1[0] = [x20 x30 x22 x32], y1[1] = [x21 x31 x23 x33]


  ytmp0b = vcombine_s16(vget_low_s16((int16x8_t)ytmp0.val[0]),vget_low_s16((int16x8_t)ytmp1.val[0]));
// y0 = [x00 x10 x20 x30] 
  ytmp1b = vcombine_s16(vget_low_s16((int16x8_t)ytmp0.val[1]),vget_low_s16((int16x8_t)ytmp1.val[1]));
// t1 = [x01 x11 x21 x31] 
  ytmp2b = vcombine_s16(vget_high_s16((int16x8_t)ytmp0.val[0]),vget_high_s16((int16x8_t)ytmp1.val[0]));
// t2 = [x02 x12 x22 x32]
  ytmp3b = vcombine_s16(vget_high_s16((int16x8_t)ytmp0.val[1]),vget_high_s16((int16x8_t)ytmp1.val[1]));
// t3 = [x03 x13 x23 x33]


  // Second stage : 4 Radix-4 butterflies with input twiddles
  xtmp1 = packed_cmult2(ytmp1b,tw16a_128[0],tw16b_128[0]);
  xtmp2 = packed_cmult2(ytmp2b,tw16a_128[1],tw16b_128[1]);
  xtmp3 = packed_cmult2(ytmp3b,tw16a_128[2],tw16b_128[2]);

  x02t    = vqaddq_s16(ytmp0b,xtmp2);
  x13t    = vqaddq_s16(xtmp1,xtmp3);
  y128[0] = vqaddq_s16(x02t,x13t);
  y128[2] = vqsubq_s16(x02t,x13t);
  x1_flip = vrev32q_s16(vmulq_s16(xtmp1,*(int16x8_t*)conjugatedft));
  x3_flip = vrev32q_s16(vmulq_s16(xtmp3,*(int16x8_t*)conjugatedft));
  x02t    = vqsubq_s16(ytmp0b,xtmp2);
  x13t    = vqsubq_s16(x1_flip,x3_flip);
  y128[1] = vqaddq_s16(x02t,x13t);  // x0 + x1f - x2 - x3f
  y128[3] = vqsubq_s16(x02t,x13t);  // x0 - x1f - x2 + x3f


#endif
1595 1596 1597 1598
}

static inline void idft16(int16_t *x,int16_t *y) __attribute__((always_inline));

1599 1600
static inline void idft16(int16_t *x,int16_t *y)
{
1601

1602
#if defined(__x86_64__) || defined(__i386__)
Raymond Knopp's avatar
 
Raymond Knopp committed
1603
  __m128i *tw16a_128=(__m128i *)tw16,*tw16b_128=(__m128i *)tw16c,*x128=(__m128i *)x,*y128=(__m128i *)y;
1604

1605 1606
  /*
  bfly4_tw1(x128,x128+1,x128+2,x128+3,
1607
      y128,y128+1,y128+2,y128+3);
1608 1609 1610 1611

  transpose16(y128,ytmp);

  bfly4_16(ytmp,ytmp+1,ytmp+2,ytmp+3,
1612 1613
     y128,y128+1,y128+2,y128+3,
     tw16_128,tw16_128+1,tw16_128+2);
1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625
  */

  register __m128i x1_flip,x3_flip,x02t,x13t;
  register __m128i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3;

  // First stage : 4 Radix-4 butterflies without input twiddles

  x02t    = _mm_adds_epi16(x128[0],x128[2]);
  x13t    = _mm_adds_epi16(x128[1],x128[3]);
  xtmp0   = _mm_adds_epi16(x02t,x13t);
  xtmp2   = _mm_subs_epi16(x02t,x13t);
  x1_flip = _mm_sign_epi16(x128[1],*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
1626
  x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
1627
  x3_flip = _mm_sign_epi16(x128[3],*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
1628
  x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652
  x02t    = _mm_subs_epi16(x128[0],x128[2]);
  x13t    = _mm_subs_epi16(x1_flip,x3_flip);
  xtmp3   = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
  xtmp1   = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f

  ytmp0   = _mm_unpacklo_epi32(xtmp0,xtmp1);
  ytmp1   = _mm_unpackhi_epi32(xtmp0,xtmp1);
  ytmp2   = _mm_unpacklo_epi32(xtmp2,xtmp3);
  ytmp3   = _mm_unpackhi_epi32(xtmp2,xtmp3);
  xtmp0   = _mm_unpacklo_epi64(ytmp0,ytmp2);
  xtmp1   = _mm_unpackhi_epi64(ytmp0,ytmp2);
  xtmp2   = _mm_unpacklo_epi64(ytmp1,ytmp3);
  xtmp3   = _mm_unpackhi_epi64(ytmp1,ytmp3);

  // Second stage : 4 Radix-4 butterflies with input twiddles
  xtmp1 = packed_cmult2(xtmp1,tw16a_128[0],tw16b_128[0]);
  xtmp2 = packed_cmult2(xtmp2,tw16a_128[1],tw16b_128[1]);
  xtmp3 = packed_cmult2(xtmp3,tw16a_128[2],tw16b_128[2]);

  x02t    = _mm_adds_epi16(xtmp0,xtmp2);
  x13t    = _mm_adds_epi16(xtmp1,xtmp3);
  y128[0] = _mm_adds_epi16(x02t,x13t);
  y128[2] = _mm_subs_epi16(x02t,x13t);
  x1_flip = _mm_sign_epi16(xtmp1,*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
1653
  x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
1654
  x3_flip = _mm_sign_epi16(xtmp3,*(__m128i*)conjugatedft);
Raymond Knopp's avatar
 
Raymond Knopp committed
1655
  x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
1656 1657 1658 1659 1660
  x02t    = _mm_subs_epi16(xtmp0,xtmp2);
  x13t    = _mm_subs_epi16(x1_flip,x3_flip);
  y128[3] = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
  y128[1] = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f

1661 1662
#elif defined(__arm__)
  int16x8_t *tw16a_128=(int16x8_t *)tw16,*tw16b_128=(int16x8_t *)tw16c,*x128=(int16x8_t *)x,*y128=(int16x8_t *)y;
1663

1664
  /*  This is the original version before unrolling
1665

1666
  bfly4_tw1(x128,x128+1,x128+2,x128+3,
1667
      y128,y128+1,y128+2,y128+3);
1668 1669 1670

  transpose16(y128,ytmp);

1671 1672 1673 1674
  bfly4_16(ytmp,ytmp+1,ytmp+2,ytmp+3,
     y128,y128+1,y128+2,y128+3,
     tw16_128,tw16_128+1,tw16_128+2);
  */
1675

1676 1677 1678 1679
  register int16x8_t x1_flip,x3_flip,x02t,x13t;
  register int16x8_t xtmp0,xtmp1,xtmp2,xtmp3;
  register uint32x4x2_t ytmp0,ytmp1;
  register int16x8_t ytmp0b,ytmp1b,ytmp2b,ytmp3b;
1680

1681
  // First stage : 4 Radix-4 butterflies without input twiddles
1682

1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707
  x02t    = vqaddq_s16(x128[0],x128[2]);
  x13t    = vqaddq_s16(x128[1],x128[3]);
  xtmp0   = vqaddq_s16(x02t,x13t);
  xtmp2   = vqsubq_s16(x02t,x13t);
  x1_flip = vrev32q_s16(vmulq_s16(x128[1],*(int16x8_t*)conjugatedft));
  x3_flip = vrev32q_s16(vmulq_s16(x128[3],*(int16x8_t*)conjugatedft));
  x02t    = vqsubq_s16(x128[0],x128[2]);
  x13t    = vqsubq_s16(x1_flip,x3_flip);
  xtmp3   = vqaddq_s16(x02t,x13t);  // x0 + x1f - x2 - x3f
  xtmp1   = vqsubq_s16(x02t,x13t);  // x0 - x1f - x2 + x3f

  ytmp0  = vtrnq_u32((uint32x4_t)(xtmp0),(uint32x4_t)(xtmp1));
// y0[0] = [x00 x10 x02 x12], y0[1] = [x01 x11 x03 x13]
  ytmp1  = vtrnq_u32((uint32x4_t)(xtmp2),(uint32x4_t)(xtmp3));
// y1[0] = [x20 x30 x22 x32], y1[1] = [x21 x31 x23 x33]


  ytmp0b = vcombine_s16(vget_low_s16((int16x8_t)ytmp0.val[0]),vget_low_s16((int16x8_t)ytmp1.val[0]));
// y0 = [x00 x10 x20 x30] 
  ytmp1b = vcombine_s16(vget_low_s16((int16x8_t)ytmp0.val[1]),vget_low_s16((int16x8_t)ytmp1.val[1]));
// t1 = [x01 x11 x21 x31] 
  ytmp2b = vcombine_s16(vget_high_s16((int16x8_t)ytmp0.val[0]),vget_high_s16((int16x8_t)ytmp1.val[0]));
// t2 = [x02 x12 x22 x32]
  ytmp3b = vcombine_s16(vget_high_s16((int16x8_t)ytmp0.val[1]),vget_high_s16((int16x8_t)ytmp1.val[1]));
// t3 = [x03 x13 x23 x33]
1708

1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729
  // Second stage : 4 Radix-4 butterflies with input twiddles
  xtmp1 = packed_cmult2(ytmp1b,tw16a_128[0],tw16b_128[0]);
  xtmp2 = packed_cmult2(ytmp2b,tw16a_128[1],tw16b_128[1]);
  xtmp3 = packed_cmult2(ytmp3b,tw16a_128[2],tw16b_128[2]);

  x02t    = vqaddq_s16(ytmp0b,xtmp2);
  x13t    = vqaddq_s16(xtmp1,xtmp3);
  y128[0] = vqaddq_s16(x02t,x13t);
  y128[2] = vqsubq_s16(x02t,x13t);
  x1_flip = vrev32q_s16(vmulq_s16(xtmp1,*(int16x8_t*)conjugatedft));
  x3_flip = vrev32q_s16(vmulq_s16(xtmp3,*(int16x8_t*)conjugatedft));
  x02t    = vqsubq_s16(ytmp0b,xtmp2);
  x13t    = vqsubq_s16(x1_flip,x3_flip);
  y128[3] = vqaddq_s16(x02t,x13t);  // x0 + x1f - x2 - x3f
  y128[1] = vqsubq_s16(x02t,x13t);  // x0 - x1f - x2 + x3f

#endif
}


// 64-point optimized DFT
1730 1731

int16_t tw64[96] __attribute__((aligned(16))) = { 32767,0,32609,-3212,32137,-6393,31356,-9512,30272,-12540,28897,-15447,27244,-18205,25329,-20788,23169,-23170,20787,-25330,18204,-27245,15446,-28898,12539,-30273,9511,-31357,6392,-32138,3211,-32610,
1732 1733 1734
                                                  32767,0,32137,-6393,30272,-12540,27244,-18205,23169,-23170,18204,-27245,12539,-30273,6392,-32138,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393,
                                                  32767,0,31356,-9512,27244,-18205,20787,-25330,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-30273,12539,-25330,20787,-18205,27244,-9512,31356
                                                };
1735 1736

int16_t tw64a[96] __attribute__((aligned(16))) = { 32767,0,32609,3212,32137,6393,31356,9512,30272,12540,28897,15447,27244,18205,25329,20788,23169,23170,20787,25330,18204,27245,15446,28898,12539,30273,9511,31357,6392,32138,3211,32610,
1737 1738 1739
                                                   32767,0,32137,6393,30272,12540,27244,18205,23169,23170,18204,27245,12539,30273,6392,32138,0,32767,-6393,32138,-12540,30273,-18205,27245,-23170,23170,-27245,18205,-30273,12540,-32138,6393,
                                                   32767,0,31356,9512,27244,18205,20787,25330,12539,30273,3211,32610,-6393,32138,-15447,28898,-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
                                                 };
1740 1741

int16_t tw64b[96] __attribute__((aligned(16))) = { 0,32767,-3212,32609,-6393,32137,-9512,31356,-12540,30272,-15447,28897,-18205,27244,-20788,25329,-23170,23169,-25330,20787,-27245,18204,-28898,15446,-30273,12539,-31357,9511,-32138,6392,-32610,3211,
1742 1743 1744
                                                   0,32767,-6393,32137,-12540,30272,-18205,27244,-23170,23169,-27245,18204,-30273,12539,-32138,6392,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138,
                                                   0,32767,-9512,31356,-18205,27244,-25330,20787,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,12539,-30273,20787,-25330,27244,-18205,31356,-9512
                                                 };
1745 1746

int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137,9512,31356,12540,30272,15447,28897,18205,27244,20788,25329,23170,23169,25330,20787,27245,18204,28898,15446,30273,12539,31357,9511,32138,6392,32610,3211,
1747 1748 1749
                                                   0,32767,6393,32137,12540,30272,18205,27244,23170,23169,27245,18204,30273,12539,32138,6392,32767,0,32138,-6393,30273,-12540,27245,-18205,23170,-23170,18205,-27245,12540,-30273,6393,-32138,
                                                   0,32767,9512,31356,18205,27244,25330,20787,30273,12539,32610,3211,32138,-6393,28898,-15447,23170,-23170,15447,-28898,6393,-32138,-3211,-32610,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
                                                 };
1750 1751


1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766
#if defined(__x86_64__) || defined(__i386__)
#define simd_q15_t __m128i
#define simdshort_q15_t __m64
#define shiftright_int16(a,shift) _mm_srai_epi16(a,shift)
#define set1_int16(a) _mm_set1_epi16(a);
#define mulhi_int16(a,b) _mm_slli_epi16(_mm_mulhi_epi16(a,b),1);
#elif defined(__arm__)
#define simd_q15_t int16x8_t
#define simdshort_q15_t int16x4_t
#define shiftright_int16(a,shift) vshrq_n_s16(a,shift)
#define set1_int16(a) vdupq_n_s16(a)
#define mulhi_int16(a,b) vqdmulhq_s16(a,b);
#define _mm_empty() 
#define _m_empty()
#endif
1767

1768 1769
void dft64(int16_t *x,int16_t *y,int scale)
{
1770

1771
  simd_q15_t xtmp[16],ytmp[16],*tw64a_128=(simd_q15_t *)tw64a,*tw64b_128=(simd_q15_t *)tw64b,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y;
1772

1773

1774 1775 1776 1777 1778 1779 1780 1781
#ifdef D64STATS
  time_stats_t ts_t,ts_d,ts_b;

  reset_meas(&ts_t);
  reset_meas(&ts_d);
  reset_meas(&ts_b);
  start_meas(&ts_t);
#endif
1782

1783 1784 1785 1786 1787 1788

  transpose16_ooff(x128,xtmp,4);
  transpose16_ooff(x128+4,xtmp+1,4);
  transpose16_ooff(x128+8,xtmp+2,4);
  transpose16_ooff(x128+12,xtmp+3,4);

1789

1790 1791 1792 1793
#ifdef D64STATS
  stop_meas(&ts_t);
  start_meas(&ts_d);
#endif
1794

1795 1796 1797 1798 1799 1800

  dft16((int16_t*)(xtmp),(int16_t*)ytmp);
  dft16((int16_t*)(xtmp+4),(int16_t*)(ytmp+4));
  dft16((int16_t*)(xtmp+8),(int16_t*)(ytmp+8));
  dft16((int16_t*)(xtmp+12),(int16_t*)(ytmp+12));

1801

1802 1803 1804 1805
#ifdef D64STATS
  stop_meas(&ts_d);
  start_meas(&ts_b);
#endif
1806

1807 1808

  bfly4_16(ytmp,ytmp+4,ytmp+8,ytmp+12,
1809 1810 1811
           y128,y128+4,y128+8,y128+12,
           tw64a_128,tw64a_128+4,tw64a_128+8,
           tw64b_128,tw64b_128+4,tw64b_128+8);
1812 1813

  bfly4_16(ytmp+1,ytmp+5,ytmp+9,ytmp+13,
1814 1815 1816
           y128+1,y128+5,y128+9,y128+13,
           tw64a_128+1,tw64a_128+5,tw64a_128+9,
           tw64b_128+1,tw64b_128+5,tw64b_128+9);
1817 1818

  bfly4_16(ytmp+2,ytmp+6,ytmp+10,ytmp+14,
1819 1820 1821
           y128+2,y128+6,y128+10,y128+14,
           tw64a_128+2,tw64a_128+6,tw64a_128+10,
           tw64b_128+2,tw64b_128+6,tw64b_128+10);
1822 1823

  bfly4_16(ytmp+3,ytmp+7,ytmp+11,ytmp+15,
1824 1825 1826 1827
           y128+3,y128+7,y128+11,y128+15,
           tw64a_128+3,tw64a_128+7,tw64a_128+11,
           tw64b_128+3,tw64b_128+7,tw64b_128+11);

1828 1829 1830 1831
#ifdef D64STATS
  stop_meas(&ts_b);
  printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff);
#endif
1832

1833 1834

  if (scale>0) {
1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850
    y128[0]  = shiftright_int16(y128[0],3);
    y128[1]  = shiftright_int16(y128[1],3);
    y128[2]  = shiftright_int16(y128[2],3);
    y128[3]  = shiftright_int16(y128[3],3);
    y128[4]  = shiftright_int16(y128[4],3);
    y128[5]  = shiftright_int16(y128[5],3);
    y128[6]  = shiftright_int16(y128[6],3);
    y128[7]  = shiftright_int16(y128[7],3);
    y128[8]  = shiftright_int16(y128[8],3);
    y128[9]  = shiftright_int16(y128[9],3);
    y128[10] = shiftright_int16(y128[10],3);
    y128[11] = shiftright_int16(y128[11],3);
    y128[12] = shiftright_int16(y128[12],3);
    y128[13] = shiftright_int16(y128[13],3);
    y128[14] = shiftright_int16(y128[14],3);
    y128[15] = shiftright_int16(y128[15],3);
1851
  }
1852

1853 1854 1855 1856 1857
  _mm_empty();
  _m_empty();

}

1858 1859
void idft64(int16_t *x,int16_t *y,int scale)
{
1860

1861
  simd_q15_t xtmp[16],ytmp[16],*tw64a_128=(simd_q15_t *)tw64,*tw64b_128=(simd_q15_t *)tw64c,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y;
1862

1863

1864 1865 1866 1867 1868 1869 1870 1871
#ifdef D64STATS
  time_stats_t ts_t,ts_d,ts_b;

  reset_meas(&ts_t);
  reset_meas(&ts_d);
  reset_meas(&ts_b);
  start_meas(&ts_t);
#endif
1872

1873 1874 1875 1876 1877 1878

  transpose16_ooff(x128,xtmp,4);
  transpose16_ooff(x128+4,xtmp+1,4);
  transpose16_ooff(x128+8,xtmp+2,4);
  transpose16_ooff(x128+12,xtmp+3,4);

1879

1880 1881 1882 1883
#ifdef D64STATS
  stop_meas(&ts_t);
  start_meas(&ts_d);
#endif
1884

1885 1886 1887 1888 1889 1890

  idft16((int16_t*)(xtmp),(int16_t*)ytmp);
  idft16((int16_t*)(xtmp+4),(int16_t*)(ytmp+4));
  idft16((int16_t*)(xtmp+8),(int16_t*)(ytmp+8));
  idft16((int16_t*)(xtmp+12),(int16_t*)(ytmp+12));

1891

1892 1893 1894 1895
#ifdef D64STATS
  stop_meas(&ts_d);
  start_meas(&ts_b);
#endif
1896

1897 1898

  ibfly4_16(ytmp,ytmp+4,ytmp+8,ytmp+12,
1899 1900 1901
            y128,y128+4,y128+8,y128+12,
            tw64a_128,tw64a_128+4,tw64a_128+8,
            tw64b_128,tw64b_128+4,tw64b_128+8);
1902 1903

  ibfly4_16(ytmp+1,ytmp+5,ytmp+9,ytmp+13,
1904 1905 1906 1907
            y128+1,y128+5,y128+9,y128+13,
            tw64a_128+1,tw64a_128+5,tw64a_128+9,
            tw64b_128+1,tw64b_128+5,tw64b_128+9);

1908
  ibfly4_16(ytmp+2,ytmp+6,ytmp+10,ytmp+14,
1909 1910 1911 1912
            y128+2,y128+6,y128+10,y128+14,
            tw64a_128+2,tw64a_128+6,tw64a_128+10,
            tw64b_128+2,tw64b_128+6,tw64b_128+10);

1913
  ibfly4_16(ytmp+3,ytmp+7,ytmp+11,ytmp+15,
1914 1915 1916 1917
            y128+3,y128+7,y128+11,y128+15,
            tw64a_128+3,tw64a_128+7,tw64a_128+11,
            tw64b_128+3,tw64b_128+7,tw64b_128+11);

1918 1919 1920 1921
#ifdef D64STATS
  stop_meas(&ts_b);
  printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff);
#endif
1922

1923 1924 1925

  if (scale>0) {

1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941
    y128[0]  = shiftright_int16(y128[0],3);
    y128[1]  = shiftright_int16(y128[1],3);
    y128[2]  = shiftright_int16(y128[2],3);
    y128[3]  = shiftright_int16(y128[3],3);
    y128[4]  = shiftright_int16(y128[4],3);
    y128[5]  = shiftright_int16(y128[5],3);
    y128[6]  = shiftright_int16(y128[6],3);
    y128[7]  = shiftright_int16(y128[7],3);
    y128[8]  = shiftright_int16(y128[8],3);
    y128[9]  = shiftright_int16(y128[9],3);
    y128[10] = shiftright_int16(y128[10],3);
    y128[11] = shiftright_int16(y128[11],3);
    y128[12] = shiftright_int16(y128[12],3);
    y128[13] = shiftright_int16(y128[13],3);
    y128[14] = shiftright_int16(y128[14],3);
    y128[15] = shiftright_int16(y128[15],3);
1942 1943

  }
1944

1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958
  _mm_empty();
  _m_empty();

}


int16_t tw128[128] __attribute__((aligned(16))) = {  32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608};

int16_t tw128a[128] __attribute__((aligned(16))) = { 32767,0,32727,1608,32609,3212,32412,4808,32137,6393,31785,7962,31356,9512,30851,11039,30272,12540,29621,14010,28897,15447,28105,16846,27244,18205,26318,19520,25329,20788,24278,22005,23169,23170,22004,24279,20787,25330,19519,26319,18204,27245,16845,28106,15446,28898,14009,29622,12539,30273,11038,30852,9511,31357,7961,31786,6392,32138,4807,32413,3211,32610,1607,32728,0,32767,-1608,32728,-3212,32610,-4808,32413,-6393,32138,-7962,31786,-9512,31357,-11039,30852,-12540,30273,-14010,29622,-15447,28898,-16846,28106,-18205,27245,-19520,26319,-20788,25330,-22005,24279,-23170,23170,-24279,22005,-25330,20788,-26319,19520,-27245,18205,-28106,16846,-28898,15447,-29622,14010,-30273,12540,-30852,11039,-31357,9512,-31786,7962,-32138,6393,-32413,4808,-32610,3212,-32728,1608};

int16_t tw128b[128] __attribute__((aligned(16))) = {0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728};

int16_t tw128c[128] __attribute__((aligned(16))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728};

1959 1960
void dft128(int16_t *x,int16_t *y,int scale)
{
1961

1962 1963 1964
  simdshort_q15_t xtmp[64],*x64 = (simdshort_q15_t *)x;
  simd_q15_t ytmp[32],*tw128a_128p=(simd_q15_t *)tw128a,*tw128b_128p=(simd_q15_t *)tw128b,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
1965
  int i;
1966 1967
  simd_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16(ONE_OVER_SQRT2_Q15);

1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005

  transpose4_ooff(x64  ,xtmp,32);
  transpose4_ooff(x64+2,xtmp+1,32);
  transpose4_ooff(x64+4,xtmp+2,32);
  transpose4_ooff(x64+6,xtmp+3,32);
  transpose4_ooff(x64+8,xtmp+4,32);
  transpose4_ooff(x64+10,xtmp+5,32);
  transpose4_ooff(x64+12,xtmp+6,32);
  transpose4_ooff(x64+14,xtmp+7,32);
  transpose4_ooff(x64+16,xtmp+8,32);
  transpose4_ooff(x64+18,xtmp+9,32);
  transpose4_ooff(x64+20,xtmp+10,32);
  transpose4_ooff(x64+22,xtmp+11,32);
  transpose4_ooff(x64+24,xtmp+12,32);
  transpose4_ooff(x64+26,xtmp+13,32);
  transpose4_ooff(x64+28,xtmp+14,32);
  transpose4_ooff(x64+30,xtmp+15,32);
  transpose4_ooff(x64+32,xtmp+16,32);
  transpose4_ooff(x64+34,xtmp+17,32);
  transpose4_ooff(x64+36,xtmp+18,32);
  transpose4_ooff(x64+38,xtmp+19,32);
  transpose4_ooff(x64+40,xtmp+20,32);
  transpose4_ooff(x64+42,xtmp+21,32);
  transpose4_ooff(x64+44,xtmp+22,32);
  transpose4_ooff(x64+46,xtmp+23,32);
  transpose4_ooff(x64+48,xtmp+24,32);
  transpose4_ooff(x64+50,xtmp+25,32);
  transpose4_ooff(x64+52,xtmp+26,32);
  transpose4_ooff(x64+54,xtmp+27,32);
  transpose4_ooff(x64+56,xtmp+28,32);
  transpose4_ooff(x64+58,xtmp+29,32);
  transpose4_ooff(x64+60,xtmp+30,32);
  transpose4_ooff(x64+62,xtmp+31,32);

  dft64((int16_t*)(xtmp),(int16_t*)ytmp,1);
  dft64((int16_t*)(xtmp+32),(int16_t*)(ytmp+16),1);


2006
  for (i=0; i<16; i++) {
2007
    bfly2_16(ytmpp,ytmpp+16,
2008 2009 2010
             y128p,y128p+16,
             tw128a_128p,
             tw128b_128p);
2011 2012 2013
    tw128a_128p++;
    tw128b_128p++;
    y128p++;
2014
    ytmpp++;
2015 2016 2017 2018
  }

  if (scale>0) {

2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051
    y128[0] = mulhi_int16(y128[0],ONE_OVER_SQRT2_Q15_128);
    y128[1] = mulhi_int16(y128[1],ONE_OVER_SQRT2_Q15_128);
    y128[2] = mulhi_int16(y128[2],ONE_OVER_SQRT2_Q15_128);
    y128[3] = mulhi_int16(y128[3],ONE_OVER_SQRT2_Q15_128);
    y128[4] = mulhi_int16(y128[4],ONE_OVER_SQRT2_Q15_128);
    y128[5] = mulhi_int16(y128[5],ONE_OVER_SQRT2_Q15_128);
    y128[6] = mulhi_int16(y128[6],ONE_OVER_SQRT2_Q15_128);
    y128[7] = mulhi_int16(y128[7],ONE_OVER_SQRT2_Q15_128);
    y128[8] = mulhi_int16(y128[8],ONE_OVER_SQRT2_Q15_128);
    y128[9] = mulhi_int16(y128[9],ONE_OVER_SQRT2_Q15_128);
    y128[10] = mulhi_int16(y128[10],ONE_OVER_SQRT2_Q15_128);
    y128[11] = mulhi_int16(y128[11],ONE_OVER_SQRT2_Q15_128);
    y128[12] = mulhi_int16(y128[12],ONE_OVER_SQRT2_Q15_128);
    y128[13] = mulhi_int16(y128[13],ONE_OVER_SQRT2_Q15_128);
    y128[14] = mulhi_int16(y128[14],ONE_OVER_SQRT2_Q15_128);
    y128[15] = mulhi_int16(y128[15],ONE_OVER_SQRT2_Q15_128);
    y128[16] = mulhi_int16(y128[16],ONE_OVER_SQRT2_Q15_128);
    y128[17] = mulhi_int16(y128[17],ONE_OVER_SQRT2_Q15_128);
    y128[18] = mulhi_int16(y128[18],ONE_OVER_SQRT2_Q15_128);
    y128[19] = mulhi_int16(y128[19],ONE_OVER_SQRT2_Q15_128);
    y128[20] = mulhi_int16(y128[20],ONE_OVER_SQRT2_Q15_128);
    y128[21] = mulhi_int16(y128[21],ONE_OVER_SQRT2_Q15_128);
    y128[22] = mulhi_int16(y128[22],ONE_OVER_SQRT2_Q15_128);
    y128[23] = mulhi_int16(y128[23],ONE_OVER_SQRT2_Q15_128);
    y128[24] = mulhi_int16(y128[24],ONE_OVER_SQRT2_Q15_128);
    y128[25] = mulhi_int16(y128[25],ONE_OVER_SQRT2_Q15_128);
    y128[26] = mulhi_int16(y128[26],ONE_OVER_SQRT2_Q15_128);
    y128[27] = mulhi_int16(y128[27],ONE_OVER_SQRT2_Q15_128);
    y128[28] = mulhi_int16(y128[28],ONE_OVER_SQRT2_Q15_128);
    y128[29] = mulhi_int16(y128[29],ONE_OVER_SQRT2_Q15_128);
    y128[30] = mulhi_int16(y128[30],ONE_OVER_SQRT2_Q15_128);
    y128[31] = mulhi_int16(y128[31],ONE_OVER_SQRT2_Q15_128);

2052 2053

  }
2054

2055 2056 2057 2058 2059
  _mm_empty();
  _m_empty();

}

2060 2061
void idft128(int16_t *x,int16_t *y,int scale)
{
2062

2063 2064 2065
  simdshort_q15_t xtmp[64],*x64 = (simdshort_q15_t *)x;
  simd_q15_t ytmp[32],*tw128_128p=(simd_q15_t *)tw128,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2066
  int i;
2067 2068
  simd_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16(ONE_OVER_SQRT2_Q15);

2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106

  transpose4_ooff(x64  ,xtmp,32);
  transpose4_ooff(x64+2,xtmp+1,32);
  transpose4_ooff(x64+4,xtmp+2,32);
  transpose4_ooff(x64+6,xtmp+3,32);
  transpose4_ooff(x64+8,xtmp+4,32);
  transpose4_ooff(x64+10,xtmp+5,32);
  transpose4_ooff(x64+12,xtmp+6,32);
  transpose4_ooff(x64+14,xtmp+7,32);
  transpose4_ooff(x64+16,xtmp+8,32);
  transpose4_ooff(x64+18,xtmp+9,32);
  transpose4_ooff(x64+20,xtmp+10,32);
  transpose4_ooff(x64+22,xtmp+11,32);
  transpose4_ooff(x64+24,xtmp+12,32);
  transpose4_ooff(x64+26,xtmp+13,32);
  transpose4_ooff(x64+28,xtmp+14,32);
  transpose4_ooff(x64+30,xtmp+15,32);
  transpose4_ooff(x64+32,xtmp+16,32);
  transpose4_ooff(x64+34,xtmp+17,32);
  transpose4_ooff(x64+36,xtmp+18,32);
  transpose4_ooff(x64+38,xtmp+19,32);
  transpose4_ooff(x64+40,xtmp+20,32);
  transpose4_ooff(x64+42,xtmp+21,32);
  transpose4_ooff(x64+44,xtmp+22,32);
  transpose4_ooff(x64+46,xtmp+23,32);
  transpose4_ooff(x64+48,xtmp+24,32);
  transpose4_ooff(x64+50,xtmp+25,32);
  transpose4_ooff(x64+52,xtmp+26,32);
  transpose4_ooff(x64+54,xtmp+27,32);
  transpose4_ooff(x64+56,xtmp+28,32);
  transpose4_ooff(x64+58,xtmp+29,32);
  transpose4_ooff(x64+60,xtmp+30,32);
  transpose4_ooff(x64+62,xtmp+31,32);

  idft64((int16_t*)(xtmp),(int16_t*)ytmp,1);
  idft64((int16_t*)(xtmp+32),(int16_t*)(ytmp+16),1);


2107
  for (i=0; i<16; i++) {
2108
    ibfly2(ytmpp,ytmpp+16,
2109 2110
           y128p,y128p+16,
           tw128_128p);
2111 2112
    tw128_128p++;
    y128p++;
2113
    ytmpp++;
2114 2115 2116 2117
  }

  if (scale>0) {

2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149
    y128[0]  = mulhi_int16(y128[0],ONE_OVER_SQRT2_Q15_128);
    y128[1]  = mulhi_int16(y128[1],ONE_OVER_SQRT2_Q15_128);
    y128[2]  = mulhi_int16(y128[2],ONE_OVER_SQRT2_Q15_128);
    y128[3]  = mulhi_int16(y128[3],ONE_OVER_SQRT2_Q15_128);
    y128[4]  = mulhi_int16(y128[4],ONE_OVER_SQRT2_Q15_128);
    y128[5]  = mulhi_int16(y128[5],ONE_OVER_SQRT2_Q15_128);
    y128[6]  = mulhi_int16(y128[6],ONE_OVER_SQRT2_Q15_128);
    y128[7]  = mulhi_int16(y128[7],ONE_OVER_SQRT2_Q15_128);
    y128[8]  = mulhi_int16(y128[8],ONE_OVER_SQRT2_Q15_128);
    y128[9]  = mulhi_int16(y128[9],ONE_OVER_SQRT2_Q15_128);
    y128[10] = mulhi_int16(y128[10],ONE_OVER_SQRT2_Q15_128);
    y128[11] = mulhi_int16(y128[11],ONE_OVER_SQRT2_Q15_128);
    y128[12] = mulhi_int16(y128[12],ONE_OVER_SQRT2_Q15_128);
    y128[13] = mulhi_int16(y128[13],ONE_OVER_SQRT2_Q15_128);
    y128[14] = mulhi_int16(y128[14],ONE_OVER_SQRT2_Q15_128);
    y128[15] = mulhi_int16(y128[15],ONE_OVER_SQRT2_Q15_128);
    y128[16] = mulhi_int16(y128[16],ONE_OVER_SQRT2_Q15_128);
    y128[17] = mulhi_int16(y128[17],ONE_OVER_SQRT2_Q15_128);
    y128[18] = mulhi_int16(y128[18],ONE_OVER_SQRT2_Q15_128);
    y128[19] = mulhi_int16(y128[19],ONE_OVER_SQRT2_Q15_128);
    y128[20] = mulhi_int16(y128[20],ONE_OVER_SQRT2_Q15_128);
    y128[21] = mulhi_int16(y128[21],ONE_OVER_SQRT2_Q15_128);
    y128[22] = mulhi_int16(y128[22],ONE_OVER_SQRT2_Q15_128);
    y128[23] = mulhi_int16(y128[23],ONE_OVER_SQRT2_Q15_128);
    y128[24] = mulhi_int16(y128[24],ONE_OVER_SQRT2_Q15_128);
    y128[25] = mulhi_int16(y128[25],ONE_OVER_SQRT2_Q15_128);
    y128[26] = mulhi_int16(y128[26],ONE_OVER_SQRT2_Q15_128);
    y128[27] = mulhi_int16(y128[27],ONE_OVER_SQRT2_Q15_128);
    y128[28] = mulhi_int16(y128[28],ONE_OVER_SQRT2_Q15_128);
    y128[29] = mulhi_int16(y128[29],ONE_OVER_SQRT2_Q15_128);
    y128[30] = mulhi_int16(y128[30],ONE_OVER_SQRT2_Q15_128);
    y128[31] = mulhi_int16(y128[31],ONE_OVER_SQRT2_Q15_128);
2150 2151

  }
2152

2153 2154 2155 2156
  _mm_empty();
  _m_empty();

}
2157

2158 2159

int16_t tw256[384] __attribute__((aligned(16))) = {  32767,0,32757,-805,32727,-1608,32678,-2411,32609,-3212,32520,-4012,32412,-4808,32284,-5602,32137,-6393,31970,-7180,31785,-7962,31580,-8740,31356,-9512,31113,-10279,30851,-11039,30571,-11793,30272,-12540,29955,-13279,29621,-14010,29268,-14733,28897,-15447,28510,-16151,28105,-16846,27683,-17531,27244,-18205,26789,-18868,26318,-19520,25831,-20160,25329,-20788,24811,-21403,24278,-22005,23731,-22595,23169,-23170,22594,-23732,22004,-24279,21402,-24812,20787,-25330,20159,-25832,19519,-26319,18867,-26790,18204,-27245,17530,-27684,16845,-28106,16150,-28511,15446,-28898,14732,-29269,14009,-29622,13278,-29956,12539,-30273,11792,-30572,11038,-30852,10278,-31114,9511,-31357,8739,-31581,7961,-31786,7179,-31971,6392,-32138,5601,-32285,4807,-32413,4011,-32521,3211,-32610,2410,-32679,1607,-32728,804,-32758,
2160 2161 2162
                                                     32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608,
                                                     32767,0,32678,-2411,32412,-4808,31970,-7180,31356,-9512,30571,-11793,29621,-14010,28510,-16151,27244,-18205,25831,-20160,24278,-22005,22594,-23732,20787,-25330,18867,-26790,16845,-28106,14732,-29269,12539,-30273,10278,-31114,7961,-31786,5601,-32285,3211,-32610,804,-32758,-1608,-32728,-4012,-32521,-6393,-32138,-8740,-31581,-11039,-30852,-13279,-29956,-15447,-28898,-17531,-27684,-19520,-26319,-21403,-24812,-23170,-23170,-24812,-21403,-26319,-19520,-27684,-17531,-28898,-15447,-29956,-13279,-30852,-11039,-31581,-8740,-32138,-6393,-32521,-4012,-32728,-1608,-32758,804,-32610,3211,-32285,5601,-31786,7961,-31114,10278,-30273,12539,-29269,14732,-28106,16845,-26790,18867,-25330,20787,-23732,22594,-22005,24278,-20160,25831,-18205,27244,-16151,28510,-14010,29621,-11793,30571,-9512,31356,-7180,31970,-4808,32412,-2411,32678
                                                  };
2163 2164

int16_t tw256a[384] __attribute__((aligned(16))) = { 32767,0,32757,804,32727,1607,32678,2410,32609,3211,32520,4011,32412,4807,32284,5601,32137,6392,31970,7179,31785,7961,31580,8739,31356,9511,31113,10278,30851,11038,30571,11792,30272,12539,29955,13278,29621,14009,29268,14732,28897,15446,28510,16150,28105,16845,27683,17530,27244,18204,26789,18867,26318,19519,25831,20159,25329,20787,24811,21402,24278,22004,23731,22594,23169,23169,22594,23731,22004,24278,21402,24811,20787,25329,20159,25831,19519,26318,18867,26789,18204,27244,17530,27683,16845,28105,16150,28510,15446,28897,14732,29268,14009,29621,13278,29955,12539,30272,11792,30571,11038,30851,10278,31113,9511,31356,8739,31580,7961,31785,7179,31970,6392,32137,5601,32284,4807,32412,4011,32520,3211,32609,2410,32678,1607,32727,804,32757,
2165 2166 2167
                                                     32767,0,32727,1607,32609,3211,32412,4807,32137,6392,31785,7961,31356,9511,30851,11038,30272,12539,29621,14009,28897,15446,28105,16845,27244,18204,26318,19519,25329,20787,24278,22004,23169,23169,22004,24278,20787,25329,19519,26318,18204,27244,16845,28105,15446,28897,14009,29621,12539,30272,11038,30851,9511,31356,7961,31785,6392,32137,4807,32412,3211,32609,1607,32727,0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,
                                                     32767,0,32678,2410,32412,4807,31970,7179,31356,9511,30571,11792,29621,14009,28510,16150,27244,18204,25831,20159,24278,22004,22594,23731,20787,25329,18867,26789,16845,28105,14732,29268,12539,30272,10278,31113,7961,31785,5601,32284,3211,32609,804,32757,-1608,32727,-4012,32520,-6393,32137,-8740,31580,-11039,30851,-13279,29955,-15447,28897,-17531,27683,-19520,26318,-21403,24811,-23170,23169,-24812,21402,-26319,19519,-27684,17530,-28898,15446,-29956,13278,-30852,11038,-31581,8739,-32138,6392,-32521,4011,-32728,1607,-32758,-805,-32610,-3212,-32285,-5602,-31786,-7962,-31114,-10279,-30273,-12540,-29269,-14733,-28106,-16846,-26790,-18868,-25330,-20788,-23732,-22595,-22005,-24279,-20160,-25832,-18205,-27245,-16151,-28511,-14010,-29622,-11793,-30572,-9512,-31357,-7180,-31971,-4808,-32413,-2411,-32679
                                                   };
2168 2169

int16_t tw256b[384] __attribute__((aligned(16))) = {0,32767,-805,32757,-1608,32727,-2411,32678,-3212,32609,-4012,32520,-4808,32412,-5602,32284,-6393,32137,-7180,31970,-7962,31785,-8740,31580,-9512,31356,-10279,31113,-11039,30851,-11793,30571,-12540,30272,-13279,29955,-14010,29621,-14733,29268,-15447,28897,-16151,28510,-16846,28105,-17531,27683,-18205,27244,-18868,26789,-19520,26318,-20160,25831,-20788,25329,-21403,24811,-22005,24278,-22595,23731,-23170,23169,-23732,22594,-24279,22004,-24812,21402,-25330,20787,-25832,20159,-26319,19519,-26790,18867,-27245,18204,-27684,17530,-28106,16845,-28511,16150,-28898,15446,-29269,14732,-29622,14009,-29956,13278,-30273,12539,-30572,11792,-30852,11038,-31114,10278,-31357,9511,-31581,8739,-31786,7961,-31971,7179,-32138,6392,-32285,5601,-32413,4807,-32521,4011,-32610,3211,-32679,2410,-32728,1607,-32758,804,
2170 2171 2172
                                                    0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728,
                                                    0,32767,-2411,32678,-4808,32412,-7180,31970,-9512,31356,-11793,30571,-14010,29621,-16151,28510,-18205,27244,-20160,25831,-22005,24278,-23732,22594,-25330,20787,-26790,18867,-28106,16845,-29269,14732,-30273,12539,-31114,10278,-31786,7961,-32285,5601,-32610,3211,-32758,804,-32728,-1608,-32521,-4012,-32138,-6393,-31581,-8740,-30852,-11039,-29956,-13279,-28898,-15447,-27684,-17531,-26319,-19520,-24812,-21403,-23170,-23170,-21403,-24812,-19520,-26319,-17531,-27684,-15447,-28898,-13279,-29956,-11039,-30852,-8740,-31581,-6393,-32138,-4012,-32521,-1608,-32728,804,-32758,3211,-32610,5601,-32285,7961,-31786,10278,-31114,12539,-30273,14732,-29269,16845,-28106,18867,-26790,20787,-25330,22594,-23732,24278,-22005,25831,-20160,27244,-18205,28510,-16151,29621,-14010,30571,-11793,31356,-9512,31970,-7180,32412,-4808,32678,-2411
                                                   };
2173

2174 2175
void dft256(int16_t *x,int16_t *y,int scale)
{
2176

2177 2178
  simd_q15_t xtmp[64],ytmp[64],*tw256a_128p=(simd_q15_t *)tw256a,*tw256b_128p=(simd_q15_t *)tw256b,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
2179
  int i;
2180 2181 2182 2183 2184 2185 2186 2187

#ifdef D256STATS
  time_stats_t ts_t,ts_d,ts_b;

  reset_meas(&ts_t);
  reset_meas(&ts_d);
  reset_meas(&ts_b);
  start_meas(&ts_t);
2188
#endif
2189 2190 2191 2192 2193
  /*
  for (i=0,j=0;i<64;i+=4,j++) {
    transpose16_ooff(x128+i,xtmp+j,16);
  }
  */
2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209
  transpose16_ooff(x128+0,xtmp+0,16);
  transpose16_ooff(x128+4,xtmp+1,16);
  transpose16_ooff(x128+8,xtmp+2,16);
  transpose16_ooff(x128+12,xtmp+3,16);
  transpose16_ooff(x128+16,xtmp+4,16);
  transpose16_ooff(x128+20,xtmp+5,16);
  transpose16_ooff(x128+24,xtmp+6,16);
  transpose16_ooff(x128+28,xtmp+7,16);
  transpose16_ooff(x128+32,xtmp+8,16);
  transpose16_ooff(x128+36,xtmp+9,16);
  transpose16_ooff(x128+40,xtmp+10,16);
  transpose16_ooff(x128+44,xtmp+11,16);
  transpose16_ooff(x128+48,xtmp+12,16);
  transpose16_ooff(x128+52,xtmp+13,16);
  transpose16_ooff(x128+56,xtmp+14,16);
  transpose16_ooff(x128+60,xtmp+15,16);
2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225

#ifdef D256STATS
  stop_meas(&ts_t);
  start_meas(&ts_d);
#endif

  dft64((int16_t*)(xtmp),(int16_t*)(ytmp),1);
  dft64((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1);
  dft64((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1);
  dft64((int16_t*)(xtmp+48),(int16_t*)(ytmp+48),1);

#ifdef D256STATS
  stop_meas(&ts_d);
  start_meas(&ts_b);
#endif

2226
  for (i=0; i<16; i+=4) {
2227
    bfly4_16(ytmpp,ytmpp+16,ytmpp+32,ytmpp+48,
2228 2229 2230
             y128p,y128p+16,y128p+32,y128p+48,
             tw256a_128p,tw256a_128p+16,tw256a_128p+32,
             tw256b_128p,tw256b_128p+16,tw256b_128p+32);
2231
    bfly4_16(ytmpp+1,ytmpp+17,ytmpp+33,ytmpp+49,
2232 2233 2234
             y128p+1,y128p+17,y128p+33,y128p+49,
             tw256a_128p+1,tw256a_128p+17,tw256a_128p+33,
             tw256b_128p+1,tw256b_128p+17,tw256b_128p+33);
2235
    bfly4_16(ytmpp+2,ytmpp+18,ytmpp+34,ytmpp+50,
2236 2237 2238
             y128p+2,y128p+18,y128p+34,y128p+50,
             tw256a_128p+2,tw256a_128p+18,tw256a_128p+34,
             tw256b_128p+2,tw256b_128p+18,tw256b_128p+34);
2239
    bfly4_16(ytmpp+3,ytmpp+19,ytmpp+35,ytmpp+51,
2240 2241 2242
             y128p+3,y128p+19,y128p+35,y128p+51,
             tw256a_128p+3,tw256a_128p+19,tw256a_128p+35,
             tw256b_128p+3,tw256b_128p+19,tw256b_128p+35);
2243 2244 2245 2246 2247 2248 2249 2250 2251 2252
    tw256a_128p+=4;
    tw256b_128p+=4;
    y128p+=4;
    ytmpp+=4;
  }

#ifdef D256STATS
  stop_meas(&ts_b);
  printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff);
#endif
2253

2254 2255
  if (scale>0) {

2256
    for (i=0; i<4; i++) {
2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272
      y128[0]  = shiftright_int16(y128[0],1);
      y128[1]  = shiftright_int16(y128[1],1);
      y128[2]  = shiftright_int16(y128[2],1);
      y128[3]  = shiftright_int16(y128[3],1);
      y128[4]  = shiftright_int16(y128[4],1);
      y128[5]  = shiftright_int16(y128[5],1);
      y128[6]  = shiftright_int16(y128[6],1);
      y128[7]  = shiftright_int16(y128[7],1);
      y128[8]  = shiftright_int16(y128[8],1);
      y128[9]  = shiftright_int16(y128[9],1);
      y128[10] = shiftright_int16(y128[10],1);
      y128[11] = shiftright_int16(y128[11],1);
      y128[12] = shiftright_int16(y128[12],1);
      y128[13] = shiftright_int16(y128[13],1);
      y128[14] = shiftright_int16(y128[14],1);
      y128[15] = shiftright_int16(y128[15],1);
2273 2274 2275 2276 2277

      y128+=16;
    }

  }
2278

2279 2280 2281 2282 2283 2284 2285
  _mm_empty();
  _m_empty();

}



2286 2287
void idft256(int16_t *x,int16_t *y,int scale)
{
2288

2289 2290
  simd_q15_t xtmp[64],ytmp[64],*tw256_128p=(simd_q15_t *)tw256,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2291
  int i,j;
2292 2293

  for (i=0,j=0; i<64; i+=4,j++) {
2294 2295
    transpose16_ooff(x128+i,xtmp+j,16);
  }
2296

2297 2298 2299 2300 2301 2302

  idft64((int16_t*)(xtmp),(int16_t*)(ytmp),1);
  idft64((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1);
  idft64((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1);
  idft64((int16_t*)(xtmp+48),(int16_t*)(ytmp+48),1);

2303
  for (i=0; i<16; i++) {
2304
    ibfly4(ytmpp,ytmpp+16,ytmpp+32,ytmpp+48,
2305 2306
           y128p,y128p+16,y128p+32,y128p+48,
           tw256_128p,tw256_128p+16,tw256_128p+32);
2307 2308 2309 2310
    tw256_128p++;
    y128p++;
    ytmpp++;
  }
2311

2312 2313
  if (scale>0) {

2314
    for (i=0; i<4; i++) {
2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330
      y128[0]  = shiftright_int16(y128[0],1);
      y128[1]  = shiftright_int16(y128[1],1);
      y128[2]  = shiftright_int16(y128[2],1);
      y128[3]  = shiftright_int16(y128[3],1);
      y128[4]  = shiftright_int16(y128[4],1);
      y128[5]  = shiftright_int16(y128[5],1);
      y128[6]  = shiftright_int16(y128[6],1);
      y128[7]  = shiftright_int16(y128[7],1);
      y128[8]  = shiftright_int16(y128[8],1);
      y128[9]  = shiftright_int16(y128[9],1);
      y128[10] = shiftright_int16(y128[10],1);
      y128[11] = shiftright_int16(y128[11],1);
      y128[12] = shiftright_int16(y128[12],1);
      y128[13] = shiftright_int16(y128[13],1);
      y128[14] = shiftright_int16(y128[14],1);
      y128[15] = shiftright_int16(y128[15],1);
2331 2332 2333 2334 2335

      y128+=16;
    }

  }
2336

2337 2338 2339
  _mm_empty();
  _m_empty();

2340
}
2341

2342 2343
int16_t tw512[512] __attribute__((aligned(16))) = {
  32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403
2344 2345
};

2346 2347 2348
int16_t tw512a[512] __attribute__((aligned(16))) = {
  32767,0,32764,403,32757,805,32744,1207,32727,1608,32705,2010,32678,2411,32646,2812,32609,3212,32567,3612,32520,4012,32468,4410,32412,4808,32350,5206,32284,5602,32213,5998,32137,6393,32056,6787,31970,7180,31880,7572,31785,7962,31684,8352,31580,8740,31470,9127,31356,9512,31236,9896,31113,10279,30984,10660,30851,11039,30713,11417,30571,11793,30424,12167,30272,12540,30116,12910,29955,13279,29790,13646,29621,14010,29446,14373,29268,14733,29085,15091,28897,15447,28706,15800,28510,16151,28309,16500,28105,16846,27896,17190,27683,17531,27466,17869,27244,18205,27019,18538,26789,18868,26556,19195,26318,19520,26077,19841,25831,20160,25582,20475,25329,20788,25072,21097,24811,21403,24546,21706,24278,22005,24006,22302,23731,22595,23452,22884,23169,23170,22883,23453,22594,23732,22301,24007,22004,24279,21705,24547,21402,24812,21096,25073,20787,25330,20474,25583,20159,25832,19840,26078,19519,26319,19194,26557,18867,26790,18537,27020,18204,27245,17868,27467,17530,27684,17189,27897,16845,28106,16499,28310,16150,28511,15799,28707,15446,28898,15090,29086,14732,29269,14372,29447,14009,29622,13645,29791,13278,29956,12909,30117,12539,30273,12166,30425,11792,30572,11416,30714,11038,30852,10659,30985,10278,31114,9895,31237,9511,31357,9126,31471,8739,31581,8351,31685,7961,31786,7571,31881,7179,31971,6786,32057,6392,32138,5997,32214,5601,32285,5205,32351,4807,32413,4409,32469,4011,32521,3611,32568,3211,32610,2811,32647,2410,32679,2009,32706,1607,32728,1206,32745,804,32758,402,32765,0,32767,-403,32765,-805,32758,-1207,32745,-1608,32728,-2010,32706,-2411,32679,-2812,32647,-3212,32610,-3612,32568,-4012,32521,-4410,32469,-4808,32413,-5206,32351,-5602,32285,-5998,32214,-6393,32138,-6787,32057,-7180,31971,-7572,31881,-7962,31786,-8352,31685,-8740,31581,-9127,31471,-9512,31357,-9896,31237,-10279,31114,-10660,30985,-11039,30852,-11417,30714,-11793,30572,-12167,30425,-12540,30273,-12910,30117,-13279,29956,-13646,29791,-14010,29622,-14373,29447,-14733,29269,-15091,29086,-15447,28898,-15800,28707,-16151,28511,-16500,28310,-16846,28106,-17190,27897,-17531,27684,-17869,27467,-18205,27245,-18538,27020,-18868,26790,-19195,26557,-19520,26319,-19841,26078,-20160,25832,-20475,25583,-20788,25330,-21097,25073,-21403,24812,-21706,24547,-22005,24279,-22302,24007,-22595,23732,-22884,23453,-23170,23170,-23453,22884,-23732,22595,-24007,22302,-24279,22005,-24547,21706,-24812,21403,-25073,21097,-25330,20788,-25583,20475,-25832,20160,-26078,19841,-26319,19520,-26557,19195,-26790,18868,-27020,18538,-27245,18205,-27467,17869,-27684,17531,-27897,17190,-28106,16846,-28310,16500,-28511,16151,-28707,15800,-28898,15447,-29086,15091,-29269,14733,-29447,14373,-29622,14010,-29791,13646,-29956,13279,-30117,12910,-30273,12540,-30425,12167,-30572,11793,-30714,11417,-30852,11039,-30985,10660,-31114,10279,-31237,9896,-31357,9512,-31471,9127,-31581,8740,-31685,8352,-31786,7962,-31881,7572,-31971,7180,-32057,6787,-32138,6393,-32214,5998,-32285,5602,-32351,5206,-32413,4808,-32469,4410,-32521,4012,-32568,3612,-32610,3212,-32647,2812,-32679,2411,-32706,2010,-32728,1608,-32745,1207,-32758,805,-32765,403
};
2349 2350 2351 2352



int16_t tw512b[512] __attribute__((aligned(16))) = {
2353 2354
  0,32767,-403,32764,-805,32757,-1207,32744,-1608,32727,-2010,32705,-2411,32678,-2812,32646,-3212,32609,-3612,32567,-4012,32520,-4410,32468,-4808,32412,-5206,32350,-5602,32284,-5998,32213,-6393,32137,-6787,32056,-7180,31970,-7572,31880,-7962,31785,-8352,31684,-8740,31580,-9127,31470,-9512,31356,-9896,31236,-10279,31113,-10660,30984,-11039,30851,-11417,30713,-11793,30571,-12167,30424,-12540,30272,-12910,30116,-13279,29955,-13646,29790,-14010,29621,-14373,29446,-14733,29268,-15091,29085,-15447,28897,-15800,28706,-16151,28510,-16500,28309,-16846,28105,-17190,27896,-17531,27683,-17869,27466,-18205,27244,-18538,27019,-18868,26789,-19195,26556,-19520,26318,-19841,26077,-20160,25831,-20475,25582,-20788,25329,-21097,25072,-21403,24811,-21706,24546,-22005,24278,-22302,24006,-22595,23731,-22884,23452,-23170,23169,-23453,22883,-23732,22594,-24007,22301,-24279,22004,-24547,21705,-24812,21402,-25073,21096,-25330,20787,-25583,20474,-25832,20159,-26078,19840,-26319,19519,-26557,19194,-26790,18867,-27020,18537,-27245,18204,-27467,17868,-27684,17530,-27897,17189,-28106,16845,-28310,16499,-28511,16150,-28707,15799,-28898,15446,-29086,15090,-29269,14732,-29447,14372,-29622,14009,-29791,13645,-29956,13278,-30117,12909,-30273,12539,-30425,12166,-30572,11792,-30714,11416,-30852,11038,-30985,10659,-31114,10278,-31237,9895,-31357,9511,-31471,9126,-31581,8739,-31685,8351,-31786,7961,-31881,7571,-31971,7179,-32057,6786,-32138,6392,-32214,5997,-32285,5601,-32351,5205,-32413,4807,-32469,4409,-32521,4011,-32568,3611,-32610,3211,-32647,2811,-32679,2410,-32706,2009,-32728,1607,-32745,1206,-32758,804,-32765,402,-32767,0,-32765,-403,-32758,-805,-32745,-1207,-32728,-1608,-32706,-2010,-32679,-2411,-32647,-2812,-32610,-3212,-32568,-3612,-32521,-4012,-32469,-4410,-32413,-4808,-32351,-5206,-32285,-5602,-32214,-5998,-32138,-6393,-32057,-6787,-31971,-7180,-31881,-7572,-31786,-7962,-31685,-8352,-31581,-8740,-31471,-9127,-31357,-9512,-31237,-9896,-31114,-10279,-30985,-10660,-30852,-11039,-30714,-11417,-30572,-11793,-30425,-12167,-30273,-12540,-30117,-12910,-29956,-13279,-29791,-13646,-29622,-14010,-29447,-14373,-29269,-14733,-29086,-15091,-28898,-15447,-28707,-15800,-28511,-16151,-28310,-16500,-28106,-16846,-27897,-17190,-27684,-17531,-27467,-17869,-27245,-18205,-27020,-18538,-26790,-18868,-26557,-19195,-26319,-19520,-26078,-19841,-25832,-20160,-25583,-20475,-25330,-20788,-25073,-21097,-24812,-21403,-24547,-21706,-24279,-22005,-24007,-22302,-23732,-22595,-23453,-22884,-23170,-23170,-22884,-23453,-22595,-23732,-22302,-24007,-22005,-24279,-21706,-24547,-21403,-24812,-21097,-25073,-20788,-25330,-20475,-25583,-20160,-25832,-19841,-26078,-19520,-26319,-19195,-26557,-18868,-26790,-18538,-27020,-18205,-27245,-17869,-27467,-17531,-27684,-17190,-27897,-16846,-28106,-16500,-28310,-16151,-28511,-15800,-28707,-15447,-28898,-15091,-29086,-14733,-29269,-14373,-29447,-14010,-29622,-13646,-29791,-13279,-29956,-12910,-30117,-12540,-30273,-12167,-30425,-11793,-30572,-11417,-30714,-11039,-30852,-10660,-30985,-10279,-31114,-9896,-31237,-9512,-31357,-9127,-31471,-8740,-31581,-8352,-31685,-7962,-31786,-7572,-31881,-7180,-31971,-6787,-32057,-6393,-32138,-5998,-32214,-5602,-32285,-5206,-32351,-4808,-32413,-4410,-32469,-4012,-32521,-3612,-32568,-3212,-32610,-2812,-32647,-2411,-32679,-2010,-32706,-1608,-32728,-1207,-32745,-805,-32758,-403,-32765
};
2355 2356

int16_t tw512c[512] __attribute__((aligned(16))) = {
2357 2358
  0,32767,403,32764,805,32757,1207,32744,1608,32727,2010,32705,2411,32678,2812,32646,3212,32609,3612,32567,4012,32520,4410,32468,4808,32412,5206,32350,5602,32284,5998,32213,6393,32137,6787,32056,7180,31970,7572,31880,7962,31785,8352,31684,8740,31580,9127,31470,9512,31356,9896,31236,10279,31113,10660,30984,11039,30851,11417,30713,11793,30571,12167,30424,12540,30272,12910,30116,13279,29955,13646,29790,14010,29621,14373,29446,14733,29268,15091,29085,15447,28897,15800,28706,16151,28510,16500,28309,16846,28105,17190,27896,17531,27683,17869,27466,18205,27244,18538,27019,18868,26789,19195,26556,19520,26318,19841,26077,20160,25831,20475,25582,20788,25329,21097,25072,21403,24811,21706,24546,22005,24278,22302,24006,22595,23731,22884,23452,23170,23169,23453,22883,23732,22594,24007,22301,24279,22004,24547,21705,24812,21402,25073,21096,25330,20787,25583,20474,25832,20159,26078,19840,26319,19519,26557,19194,26790,18867,27020,18537,27245,18204,27467,17868,27684,17530,27897,17189,28106,16845,28310,16499,28511,16150,28707,15799,28898,15446,29086,15090,29269,14732,29447,14372,29622,14009,29791,13645,29956,13278,30117,12909,30273,12539,30425,12166,30572,11792,30714,11416,30852,11038,30985,10659,31114,10278,31237,9895,31357,9511,31471,9126,31581,8739,31685,8351,31786,7961,31881,7571,31971,7179,32057,6786,32138,6392,32214,5997,32285,5601,32351,5205,32413,4807,32469,4409,32521,4011,32568,3611,32610,3211,32647,2811,32679,2410,32706,2009,32728,1607,32745,1206,32758,804,32765,402,32767,0,32765,-403,32758,-805,32745,-1207,32728,-1608,32706,-2010,32679,-2411,32647,-2812,32610,-3212,32568,-3612,32521,-4012,32469,-4410,32413,-4808,32351,-5206,32285,-5602,32214,-5998,32138,-6393,32057,-6787,31971,-7180,31881,-7572,31786,-7962,31685,-8352,31581,-8740,31471,-9127,31357,-9512,31237,-9896,31114,-10279,30985,-10660,30852,-11039,30714,-11417,30572,-11793,30425,-12167,30273,-12540,30117,-12910,29956,-13279,29791,-13646,29622,-14010,29447,-14373,29269,-14733,29086,-15091,28898,-15447,28707,-15800,28511,-16151,28310,-16500,28106,-16846,27897,-17190,27684,-17531,27467,-17869,27245,-18205,27020,-18538,26790,-18868,26557,-19195,26319,-19520,26078,-19841,25832,-20160,25583,-20475,25330,-20788,25073,-21097,24812,-21403,24547,-21706,24279,-22005,24007,-22302,23732,-22595,23453,-22884,23170,-23170,22884,-23453,22595,-23732,22302,-24007,22005,-24279,21706,-24547,21403,-24812,21097,-25073,20788,-25330,20475,-25583,20160,-25832,19841,-26078,19520,-26319,19195,-26557,18868,-26790,18538,-27020,18205,-27245,17869,-27467,17531,-27684,17190,-27897,16846,-28106,16500,-28310,16151,-28511,15800,-28707,15447,-28898,15091,-29086,14733,-29269,14373,-29447,14010,-29622,13646,-29791,13279,-29956,12910,-30117,12540,-30273,12167,-30425,11793,-30572,11417,-30714,11039,-30852,10660,-30985,10279,-31114,9896,-31237,9512,-31357,9127,-31471,8740,-31581,8352,-31685,7962,-31786,7572,-31881,7180,-31971,6787,-32057,6393,-32138,5998,-32214,5602,-32285,5206,-32351,4808,-32413,4410,-32469,4012,-32521,3612,-32568,3212,-32610,2812,-32647,2411,-32679,2010,-32706,1608,-32728,1207,-32745,805,-32758,403,-32765
};
2359 2360


2361 2362
void dft512(int16_t *x,int16_t *y,int scale)
{
2363

2364 2365 2366
  simdshort_q15_t xtmp[256],*xtmpp,*x64 = (simdshort_q15_t *)x;
  simd_q15_t ytmp[128],*tw512a_128p=(simd_q15_t *)tw512a,*tw512b_128p=(simd_q15_t *)tw512b,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2367
  int i;
2368
  simd_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16(ONE_OVER_SQRT2_Q15);
2369 2370 2371

  xtmpp = xtmp;

2372
  for (i=0; i<4; i++) {
2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412
    transpose4_ooff(x64  ,xtmpp,128);
    transpose4_ooff(x64+2,xtmpp+1,128);
    transpose4_ooff(x64+4,xtmpp+2,128);
    transpose4_ooff(x64+6,xtmpp+3,128);
    transpose4_ooff(x64+8,xtmpp+4,128);
    transpose4_ooff(x64+10,xtmpp+5,128);
    transpose4_ooff(x64+12,xtmpp+6,128);
    transpose4_ooff(x64+14,xtmpp+7,128);
    transpose4_ooff(x64+16,xtmpp+8,128);
    transpose4_ooff(x64+18,xtmpp+9,128);
    transpose4_ooff(x64+20,xtmpp+10,128);
    transpose4_ooff(x64+22,xtmpp+11,128);
    transpose4_ooff(x64+24,xtmpp+12,128);
    transpose4_ooff(x64+26,xtmpp+13,128);
    transpose4_ooff(x64+28,xtmpp+14,128);
    transpose4_ooff(x64+30,xtmpp+15,128);
    transpose4_ooff(x64+32,xtmpp+16,128);
    transpose4_ooff(x64+34,xtmpp+17,128);
    transpose4_ooff(x64+36,xtmpp+18,128);
    transpose4_ooff(x64+38,xtmpp+19,128);
    transpose4_ooff(x64+40,xtmpp+20,128);
    transpose4_ooff(x64+42,xtmpp+21,128);
    transpose4_ooff(x64+44,xtmpp+22,128);
    transpose4_ooff(x64+46,xtmpp+23,128);
    transpose4_ooff(x64+48,xtmpp+24,128);
    transpose4_ooff(x64+50,xtmpp+25,128);
    transpose4_ooff(x64+52,xtmpp+26,128);
    transpose4_ooff(x64+54,xtmpp+27,128);
    transpose4_ooff(x64+56,xtmpp+28,128);
    transpose4_ooff(x64+58,xtmpp+29,128);
    transpose4_ooff(x64+60,xtmpp+30,128);
    transpose4_ooff(x64+62,xtmpp+31,128);
    x64+=64;
    xtmpp+=32;
  }

  dft256((int16_t*)(xtmp),(int16_t*)ytmp,1);
  dft256((int16_t*)(xtmp+128),(int16_t*)(ytmp+64),1);


2413
  for (i=0; i<64; i+=8) {
2414
    bfly2_16(ytmpp,ytmpp+64,
2415 2416 2417
             y128p,y128p+64,
             tw512a_128p,
             tw512b_128p);
2418
    bfly2_16(ytmpp+1,ytmpp+65,
2419 2420 2421
             y128p+1,y128p+65,
             tw512a_128p+1,
             tw512b_128p+1);
2422
    bfly2_16(ytmpp+2,ytmpp+66,
2423 2424 2425
             y128p+2,y128p+66,
             tw512a_128p+2,
             tw512b_128p+2);
2426
    bfly2_16(ytmpp+3,ytmpp+67,
2427 2428 2429
             y128p+3,y128p+67,
             tw512a_128p+3,
             tw512b_128p+3);
2430
    bfly2_16(ytmpp+4,ytmpp+68,
2431 2432 2433
             y128p+4,y128p+68,
             tw512a_128p+4,
             tw512b_128p+4);
2434
    bfly2_16(ytmpp+5,ytmpp+69,
2435 2436 2437
             y128p+5,y128p+69,
             tw512a_128p+5,
             tw512b_128p+5);
2438
    bfly2_16(ytmpp+6,ytmpp+70,
2439 2440 2441
             y128p+6,y128p+70,
             tw512a_128p+6,
             tw512b_128p+6);
2442
    bfly2_16(ytmpp+7,ytmpp+71,
2443 2444 2445
             y128p+7,y128p+71,
             tw512a_128p+7,
             tw512b_128p+7);
2446 2447 2448
    tw512a_128p+=8;
    tw512b_128p+=8;
    y128p+=8;
2449
    ytmpp+=8;
2450 2451 2452 2453
  }

  if (scale>0) {
    y128p = y128;
2454 2455

    for (i=0; i<8; i++) {
2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471
      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128);
      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128);
      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128);
      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128);
      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128);
      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128);
      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128);
      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128);
      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128);
      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128);
      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128);
      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128);
      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128);
      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128);
      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128);
      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128);
2472 2473 2474
      y128p+=16;
    }
  }
2475

2476 2477 2478 2479 2480
  _mm_empty();
  _m_empty();

}

2481 2482
void idft512(int16_t *x,int16_t *y,int scale)
{
2483

2484 2485 2486
  simdshort_q15_t xtmp[256],*xtmpp,*x64 = (simdshort_q15_t *)x;
  simd_q15_t ytmp[128],*tw512_128p=(simd_q15_t *)tw512,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2487
  int i;
2488
  simd_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16(ONE_OVER_SQRT2_Q15);
2489 2490 2491

  xtmpp = xtmp;

2492
  for (i=0; i<4; i++) {
2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532
    transpose4_ooff(x64  ,xtmpp,128);
    transpose4_ooff(x64+2,xtmpp+1,128);
    transpose4_ooff(x64+4,xtmpp+2,128);
    transpose4_ooff(x64+6,xtmpp+3,128);
    transpose4_ooff(x64+8,xtmpp+4,128);
    transpose4_ooff(x64+10,xtmpp+5,128);
    transpose4_ooff(x64+12,xtmpp+6,128);
    transpose4_ooff(x64+14,xtmpp+7,128);
    transpose4_ooff(x64+16,xtmpp+8,128);
    transpose4_ooff(x64+18,xtmpp+9,128);
    transpose4_ooff(x64+20,xtmpp+10,128);
    transpose4_ooff(x64+22,xtmpp+11,128);
    transpose4_ooff(x64+24,xtmpp+12,128);
    transpose4_ooff(x64+26,xtmpp+13,128);
    transpose4_ooff(x64+28,xtmpp+14,128);
    transpose4_ooff(x64+30,xtmpp+15,128);
    transpose4_ooff(x64+32,xtmpp+16,128);
    transpose4_ooff(x64+34,xtmpp+17,128);
    transpose4_ooff(x64+36,xtmpp+18,128);
    transpose4_ooff(x64+38,xtmpp+19,128);
    transpose4_ooff(x64+40,xtmpp+20,128);
    transpose4_ooff(x64+42,xtmpp+21,128);
    transpose4_ooff(x64+44,xtmpp+22,128);
    transpose4_ooff(x64+46,xtmpp+23,128);
    transpose4_ooff(x64+48,xtmpp+24,128);
    transpose4_ooff(x64+50,xtmpp+25,128);
    transpose4_ooff(x64+52,xtmpp+26,128);
    transpose4_ooff(x64+54,xtmpp+27,128);
    transpose4_ooff(x64+56,xtmpp+28,128);
    transpose4_ooff(x64+58,xtmpp+29,128);
    transpose4_ooff(x64+60,xtmpp+30,128);
    transpose4_ooff(x64+62,xtmpp+31,128);
    x64+=64;
    xtmpp+=32;
  }

  idft256((int16_t*)(xtmp),(int16_t*)ytmp,1);
  idft256((int16_t*)(xtmp+128),(int16_t*)(ytmp+64),1);


2533
  for (i=0; i<64; i++) {
2534
    ibfly2(ytmpp,ytmpp+64,
2535 2536
           y128p,y128p+64,
           tw512_128p);
2537 2538
    tw512_128p++;
    y128p++;
2539
    ytmpp++;
2540 2541 2542 2543
  }

  if (scale>0) {
    y128p = y128;
2544 2545

    for (i=0; i<8; i++) {
2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561
      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128);
      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128);
      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128);
      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128);
      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128);
      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128);
      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128);
      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128);
      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128);
      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128);
      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128);
      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128);
      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128);
      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128);
      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128);
      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128);
2562 2563 2564
      y128p+=16;
    }
  }
2565

2566 2567 2568 2569 2570 2571
  _mm_empty();
  _m_empty();

}

int16_t tw1024[1536] __attribute__((aligned(16))) = {  32767,0,32766,-202,32764,-403,32761,-604,32757,-805,32751,-1006,32744,-1207,32736,-1407,32727,-1608,32717,-1809,32705,-2010,32692,-2210,32678,-2411,32662,-2611,32646,-2812,32628,-3012,32609,-3212,32588,-3412,32567,-3612,32544,-3812,32520,-4012,32495,-4211,32468,-4410,32441,-4609,32412,-4808,32382,-5007,32350,-5206,32318,-5404,32284,-5602,32249,-5800,32213,-5998,32176,-6196,32137,-6393,32097,-6590,32056,-6787,32014,-6983,31970,-7180,31926,-7376,31880,-7572,31833,-7767,31785,-7962,31735,-8157,31684,-8352,31633,-8546,31580,-8740,31525,-8933,31470,-9127,31413,-9320,31356,-9512,31297,-9704,31236,-9896,31175,-10088,31113,-10279,31049,-10470,30984,-10660,30918,-10850,30851,-11039,30783,-11228,30713,-11417,30643,-11605,30571,-11793,30498,-11981,30424,-12167,30349,-12354,30272,-12540,30195,-12725,30116,-12910,30036,-13095,29955,-13279,29873,-13463,29790,-13646,29706,-13828,29621,-14010,29534,-14192,29446,-14373,29358,-14553,29268,-14733,29177,-14912,29085,-15091,28992,-15269,28897,-15447,28802,-15624,28706,-15800,28608,-15976,28510,-16151,28410,-16326,28309,-16500,28208,-16673,28105,-16846,28001,-17018,27896,-17190,27790,-17361,27683,-17531,27575,-17700,27466,-17869,27355,-18037,27244,-18205,27132,-18372,27019,-18538,26905,-18703,26789,-18868,26673,-19032,26556,-19195,26437,-19358,26318,-19520,26198,-19681,26077,-19841,25954,-20001,25831,-20160,25707,-20318,25582,-20475,25456,-20632,25329,-20788,25201,-20943,25072,-21097,24942,-21250,24811,-21403,24679,-21555,24546,-21706,24413,-21856,24278,-22005,24143,-22154,24006,-22302,23869,-22449,23731,-22595,23592,-22740,23452,-22884,23311,-23028,23169,-23170,23027,-23312,22883,-23453,22739,-23593,22594,-23732,22448,-23870,22301,-24007,22153,-24144,22004,-24279,21855,-24414,21705,-24547,21554,-24680,21402,-24812,21249,-24943,21096,-25073,20942,-25202,20787,-25330,20631,-25457,20474,-25583,20317,-25708,20159,-25832,20000,-25955,19840,-26078,19680,-26199,19519,-26319,19357,-26438,19194,-26557,19031,-26674,18867,-26790,18702,-26906,18537,-27020,18371,-27133,18204,-27245,18036,-27356,17868,-27467,17699,-27576,17530,-27684,17360,-27791,17189,-27897,17017,-28002,16845,-28106,16672,-28209,16499,-28310,16325,-28411,16150,-28511,15975,-28609,15799,-28707,15623,-28803,15446,-28898,15268,-28993,15090,-29086,14911,-29178,14732,-29269,14552,-29359,14372,-29447,14191,-29535,14009,-29622,13827,-29707,13645,-29791,13462,-29874,13278,-29956,13094,-30037,12909,-30117,12724,-30196,12539,-30273,12353,-30350,12166,-30425,11980,-30499,11792,-30572,11604,-30644,11416,-30714,11227,-30784,11038,-30852,10849,-30919,10659,-30985,10469,-31050,10278,-31114,10087,-31176,9895,-31237,9703,-31298,9511,-31357,9319,-31414,9126,-31471,8932,-31526,8739,-31581,8545,-31634,8351,-31685,8156,-31736,7961,-31786,7766,-31834,7571,-31881,7375,-31927,7179,-31971,6982,-32015,6786,-32057,6589,-32098,6392,-32138,6195,-32177,5997,-32214,5799,-32250,5601,-32285,5403,-32319,5205,-32351,5006,-32383,4807,-32413,4608,-32442,4409,-32469,4210,-32496,4011,-32521,3811,-32545,3611,-32568,3411,-32589,3211,-32610,3011,-32629,2811,-32647,2610,-32663,2410,-32679,2209,-32693,2009,-32706,1808,-32718,1607,-32728,1406,-32737,1206,-32745,1005,-32752,804,-32758,603,-32762,402,-32765,201,-32767,
2572 2573 2574
                                                       32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403,
                                                       32767,0,32761,-604,32744,-1207,32717,-1809,32678,-2411,32628,-3012,32567,-3612,32495,-4211,32412,-4808,32318,-5404,32213,-5998,32097,-6590,31970,-7180,31833,-7767,31684,-8352,31525,-8933,31356,-9512,31175,-10088,30984,-10660,30783,-11228,30571,-11793,30349,-12354,30116,-12910,29873,-13463,29621,-14010,29358,-14553,29085,-15091,28802,-15624,28510,-16151,28208,-16673,27896,-17190,27575,-17700,27244,-18205,26905,-18703,26556,-19195,26198,-19681,25831,-20160,25456,-20632,25072,-21097,24679,-21555,24278,-22005,23869,-22449,23452,-22884,23027,-23312,22594,-23732,22153,-24144,21705,-24547,21249,-24943,20787,-25330,20317,-25708,19840,-26078,19357,-26438,18867,-26790,18371,-27133,17868,-27467,17360,-27791,16845,-28106,16325,-28411,15799,-28707,15268,-28993,14732,-29269,14191,-29535,13645,-29791,13094,-30037,12539,-30273,11980,-30499,11416,-30714,10849,-30919,10278,-31114,9703,-31298,9126,-31471,8545,-31634,7961,-31786,7375,-31927,6786,-32057,6195,-32177,5601,-32285,5006,-32383,4409,-32469,3811,-32545,3211,-32610,2610,-32663,2009,-32706,1406,-32737,804,-32758,201,-32767,-403,-32765,-1006,-32752,-1608,-32728,-2210,-32693,-2812,-32647,-3412,-32589,-4012,-32521,-4609,-32442,-5206,-32351,-5800,-32250,-6393,-32138,-6983,-32015,-7572,-31881,-8157,-31736,-8740,-31581,-9320,-31414,-9896,-31237,-10470,-31050,-11039,-30852,-11605,-30644,-12167,-30425,-12725,-30196,-13279,-29956,-13828,-29707,-14373,-29447,-14912,-29178,-15447,-28898,-15976,-28609,-16500,-28310,-17018,-28002,-17531,-27684,-18037,-27356,-18538,-27020,-19032,-26674,-19520,-26319,-20001,-25955,-20475,-25583,-20943,-25202,-21403,-24812,-21856,-24414,-22302,-24007,-22740,-23593,-23170,-23170,-23593,-22740,-24007,-22302,-24414,-21856,-24812,-21403,-25202,-20943,-25583,-20475,-25955,-20001,-26319,-19520,-26674,-19032,-27020,-18538,-27356,-18037,-27684,-17531,-28002,-17018,-28310,-16500,-28609,-15976,-28898,-15447,-29178,-14912,-29447,-14373,-29707,-13828,-29956,-13279,-30196,-12725,-30425,-12167,-30644,-11605,-30852,-11039,-31050,-10470,-31237,-9896,-31414,-9320,-31581,-8740,-31736,-8157,-31881,-7572,-32015,-6983,-32138,-6393,-32250,-5800,-32351,-5206,-32442,-4609,-32521,-4012,-32589,-3412,-32647,-2812,-32693,-2210,-32728,-1608,-32752,-1006,-32765,-403,-32767,201,-32758,804,-32737,1406,-32706,2009,-32663,2610,-32610,3211,-32545,3811,-32469,4409,-32383,5006,-32285,5601,-32177,6195,-32057,6786,-31927,7375,-31786,7961,-31634,8545,-31471,9126,-31298,9703,-31114,10278,-30919,10849,-30714,11416,-30499,11980,-30273,12539,-30037,13094,-29791,13645,-29535,14191,-29269,14732,-28993,15268,-28707,15799,-28411,16325,-28106,16845,-27791,17360,-27467,17868,-27133,18371,-26790,18867,-26438,19357,-26078,19840,-25708,20317,-25330,20787,-24943,21249,-24547,21705,-24144,22153,-23732,22594,-23312,23027,-22884,23452,-22449,23869,-22005,24278,-21555,24679,-21097,25072,-20632,25456,-20160,25831,-19681,26198,-19195,26556,-18703,26905,-18205,27244,-17700,27575,-17190,27896,-16673,28208,-16151,28510,-15624,28802,-15091,29085,-14553,29358,-14010,29621,-13463,29873,-12910,30116,-12354,30349,-11793,30571,-11228,30783,-10660,30984,-10088,31175,-9512,31356,-8933,31525,-8352,31684,-7767,31833,-7180,31970,-6590,32097,-5998,32213,-5404,32318,-4808,32412,-4211,32495,-3612,32567,-3012,32628,-2411,32678,-1809,32717,-1207,32744,-604,32761
                                                    };
2575

2576 2577
void dft1024(int16_t *x,int16_t *y,int scale)
{
2578

2579 2580
  simd_q15_t xtmp[256],ytmp[256],*tw1024_128p=(simd_q15_t *)tw1024,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2581
  int i,j;
2582 2583

  for (i=0,j=0; i<256; i+=4,j++) {
2584 2585
    transpose16_ooff(x128+i,xtmp+j,64);
  }
2586

2587 2588 2589 2590 2591 2592

  dft256((int16_t*)(xtmp),(int16_t*)(ytmp),1);
  dft256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1);
  dft256((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1);
  dft256((int16_t*)(xtmp+192),(int16_t*)(ytmp+192),1);

2593
  for (i=0; i<64; i++) {
2594
    bfly4(ytmpp,ytmpp+64,ytmpp+128,ytmpp+192,
2595 2596
          y128p,y128p+64,y128p+128,y128p+192,
          tw1024_128p,tw1024_128p+64,tw1024_128p+128);
2597 2598 2599 2600
    tw1024_128p++;
    y128p++;
    ytmpp++;
  }
2601

2602 2603
  if (scale>0) {

2604
    for (i=0; i<16; i++) {
2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620
      y128[0]  = shiftright_int16(y128[0],1);
      y128[1]  = shiftright_int16(y128[1],1);
      y128[2]  = shiftright_int16(y128[2],1);
      y128[3]  = shiftright_int16(y128[3],1);
      y128[4]  = shiftright_int16(y128[4],1);
      y128[5]  = shiftright_int16(y128[5],1);
      y128[6]  = shiftright_int16(y128[6],1);
      y128[7]  = shiftright_int16(y128[7],1);
      y128[8]  = shiftright_int16(y128[8],1);
      y128[9]  = shiftright_int16(y128[9],1);
      y128[10] = shiftright_int16(y128[10],1);
      y128[11] = shiftright_int16(y128[11],1);
      y128[12] = shiftright_int16(y128[12],1);
      y128[13] = shiftright_int16(y128[13],1);
      y128[14] = shiftright_int16(y128[14],1);
      y128[15] = shiftright_int16(y128[15],1);
2621 2622 2623 2624 2625

      y128+=16;
    }

  }
2626

2627 2628 2629 2630 2631
  _mm_empty();
  _m_empty();

}

2632 2633
void idft1024(int16_t *x,int16_t *y,int scale)
{
2634

2635 2636
  simd_q15_t xtmp[256],ytmp[256],*tw1024_128p=(simd_q15_t *)tw1024,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2637
  int i,j;
2638 2639

  for (i=0,j=0; i<256; i+=4,j++) {
2640 2641
    transpose16_ooff(x128+i,xtmp+j,64);
  }
2642

2643 2644 2645 2646 2647 2648

  idft256((int16_t*)(xtmp),(int16_t*)(ytmp),1);
  idft256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1);
  idft256((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1);
  idft256((int16_t*)(xtmp+192),(int16_t*)(ytmp+192),1);

2649
  for (i=0; i<64; i++) {
2650
    ibfly4(ytmpp,ytmpp+64,ytmpp+128,ytmpp+192,
2651 2652
           y128p,y128p+64,y128p+128,y128p+192,
           tw1024_128p,tw1024_128p+64,tw1024_128p+128);
2653 2654 2655 2656
    tw1024_128p++;
    y128p++;
    ytmpp++;
  }
2657

2658 2659
  if (scale>0) {

2660
    for (i=0; i<16; i++) {
2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676
      y128[0]  = shiftright_int16(y128[0],1);
      y128[1]  = shiftright_int16(y128[1],1);
      y128[2]  = shiftright_int16(y128[2],1);
      y128[3]  = shiftright_int16(y128[3],1);
      y128[4]  = shiftright_int16(y128[4],1);
      y128[5]  = shiftright_int16(y128[5],1);
      y128[6]  = shiftright_int16(y128[6],1);
      y128[7]  = shiftright_int16(y128[7],1);
      y128[8]  = shiftright_int16(y128[8],1);
      y128[9]  = shiftright_int16(y128[9],1);
      y128[10] = shiftright_int16(y128[10],1);
      y128[11] = shiftright_int16(y128[11],1);
      y128[12] = shiftright_int16(y128[12],1);
      y128[13] = shiftright_int16(y128[13],1);
      y128[14] = shiftright_int16(y128[14],1);
      y128[15] = shiftright_int16(y128[15],1);
2677 2678 2679 2680 2681

      y128+=16;
    }

  }
2682

2683 2684 2685 2686 2687 2688 2689 2690
  _mm_empty();
  _m_empty();

}

int16_t tw2048[2048] __attribute__((aligned(16))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101};


2691 2692
void dft2048(int16_t *x,int16_t *y,int scale)
{
2693

2694 2695 2696
  simdshort_q15_t xtmp[2048],*xtmpp,*x64 = (simdshort_q15_t *)x;
  simd_q15_t ytmp[512],*tw2048_128p=(simd_q15_t *)tw2048,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2697
  int i;
2698
  simd_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16(ONE_OVER_SQRT2_Q15);
2699 2700 2701

  xtmpp = xtmp;

2702
  for (i=0; i<16; i++) {
2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742
    transpose4_ooff(x64  ,xtmpp,512);
    transpose4_ooff(x64+2,xtmpp+1,512);
    transpose4_ooff(x64+4,xtmpp+2,512);
    transpose4_ooff(x64+6,xtmpp+3,512);
    transpose4_ooff(x64+8,xtmpp+4,512);
    transpose4_ooff(x64+10,xtmpp+5,512);
    transpose4_ooff(x64+12,xtmpp+6,512);
    transpose4_ooff(x64+14,xtmpp+7,512);
    transpose4_ooff(x64+16,xtmpp+8,512);
    transpose4_ooff(x64+18,xtmpp+9,512);
    transpose4_ooff(x64+20,xtmpp+10,512);
    transpose4_ooff(x64+22,xtmpp+11,512);
    transpose4_ooff(x64+24,xtmpp+12,512);
    transpose4_ooff(x64+26,xtmpp+13,512);
    transpose4_ooff(x64+28,xtmpp+14,512);
    transpose4_ooff(x64+30,xtmpp+15,512);
    transpose4_ooff(x64+32,xtmpp+16,512);
    transpose4_ooff(x64+34,xtmpp+17,512);
    transpose4_ooff(x64+36,xtmpp+18,512);
    transpose4_ooff(x64+38,xtmpp+19,512);
    transpose4_ooff(x64+40,xtmpp+20,512);
    transpose4_ooff(x64+42,xtmpp+21,512);
    transpose4_ooff(x64+44,xtmpp+22,512);
    transpose4_ooff(x64+46,xtmpp+23,512);
    transpose4_ooff(x64+48,xtmpp+24,512);
    transpose4_ooff(x64+50,xtmpp+25,512);
    transpose4_ooff(x64+52,xtmpp+26,512);
    transpose4_ooff(x64+54,xtmpp+27,512);
    transpose4_ooff(x64+56,xtmpp+28,512);
    transpose4_ooff(x64+58,xtmpp+29,512);
    transpose4_ooff(x64+60,xtmpp+30,512);
    transpose4_ooff(x64+62,xtmpp+31,512);
    x64+=64;
    xtmpp+=32;
  }

  dft1024((int16_t*)(xtmp),(int16_t*)ytmp,1);
  dft1024((int16_t*)(xtmp+512),(int16_t*)(ytmp+256),1);


2743
  for (i=0; i<256; i++) {
2744
    bfly2(ytmpp,ytmpp+256,
2745 2746
          y128p,y128p+256,
          tw2048_128p);
2747 2748
    tw2048_128p++;
    y128p++;
2749
    ytmpp++;
2750 2751 2752 2753
  }

  if (scale>0) {
    y128p = y128;
2754 2755

    for (i=0; i<32; i++) {
2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771
      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128);
      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128);
      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128);
      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128);
      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128);
      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128);
      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128);
      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128);
      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128);
      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128);
      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128);
      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128);
      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128);
      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128);
      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128);
      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128);
2772 2773 2774
      y128p+=16;
    }
  }
2775

2776 2777 2778 2779 2780
  _mm_empty();
  _m_empty();

}

2781 2782
void idft2048(int16_t *x,int16_t *y,int scale)
{
2783

2784 2785 2786
  simdshort_q15_t xtmp[2048],*xtmpp,*x64 = (simdshort_q15_t *)x;
  simd_q15_t ytmp[512],*tw2048_128p=(simd_q15_t *)tw2048,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2787
  int i;
2788
  simd_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16(ONE_OVER_SQRT2_Q15);
2789 2790 2791

  xtmpp = xtmp;

2792
  for (i=0; i<16; i++) {
2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832
    transpose4_ooff(x64  ,xtmpp,512);
    transpose4_ooff(x64+2,xtmpp+1,512);
    transpose4_ooff(x64+4,xtmpp+2,512);
    transpose4_ooff(x64+6,xtmpp+3,512);
    transpose4_ooff(x64+8,xtmpp+4,512);
    transpose4_ooff(x64+10,xtmpp+5,512);
    transpose4_ooff(x64+12,xtmpp+6,512);
    transpose4_ooff(x64+14,xtmpp+7,512);
    transpose4_ooff(x64+16,xtmpp+8,512);
    transpose4_ooff(x64+18,xtmpp+9,512);
    transpose4_ooff(x64+20,xtmpp+10,512);
    transpose4_ooff(x64+22,xtmpp+11,512);
    transpose4_ooff(x64+24,xtmpp+12,512);
    transpose4_ooff(x64+26,xtmpp+13,512);
    transpose4_ooff(x64+28,xtmpp+14,512);
    transpose4_ooff(x64+30,xtmpp+15,512);
    transpose4_ooff(x64+32,xtmpp+16,512);
    transpose4_ooff(x64+34,xtmpp+17,512);
    transpose4_ooff(x64+36,xtmpp+18,512);
    transpose4_ooff(x64+38,xtmpp+19,512);
    transpose4_ooff(x64+40,xtmpp+20,512);
    transpose4_ooff(x64+42,xtmpp+21,512);
    transpose4_ooff(x64+44,xtmpp+22,512);
    transpose4_ooff(x64+46,xtmpp+23,512);
    transpose4_ooff(x64+48,xtmpp+24,512);
    transpose4_ooff(x64+50,xtmpp+25,512);
    transpose4_ooff(x64+52,xtmpp+26,512);
    transpose4_ooff(x64+54,xtmpp+27,512);
    transpose4_ooff(x64+56,xtmpp+28,512);
    transpose4_ooff(x64+58,xtmpp+29,512);
    transpose4_ooff(x64+60,xtmpp+30,512);
    transpose4_ooff(x64+62,xtmpp+31,512);
    x64+=64;
    xtmpp+=32;
  }

  idft1024((int16_t*)(xtmp),(int16_t*)ytmp,1);
  idft1024((int16_t*)(xtmp+512),(int16_t*)(ytmp+256),1);


2833
  for (i=0; i<256; i++) {
2834
    ibfly2(ytmpp,ytmpp+256,
2835 2836
           y128p,y128p+256,
           tw2048_128p);
2837 2838
    tw2048_128p++;
    y128p++;
2839
    ytmpp++;
2840 2841 2842 2843
  }

  if (scale>0) {
    y128p = y128;
2844 2845

    for (i=0; i<32; i++) {
2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861
      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128);
      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128);
      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128);
      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128);
      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128);
      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128);
      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128);
      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128);
      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128);
      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128);
      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128);
      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128);
      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128);
      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128);
      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128);
      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128);
2862 2863 2864
      y128p+=16;
    }
  }
2865

2866 2867 2868 2869 2870
  _mm_empty();
  _m_empty();

}

2871 2872 2873 2874 2875
#include "twiddles4096.h"

void dft4096(int16_t *x,int16_t *y,int scale)
{

2876 2877
  simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901
  int i,j;

  for (i=0,j=0; i<1024; i+=4,j++) {
    transpose16_ooff(x128+i,xtmp+j,256);
  }


  dft1024((int16_t*)(xtmp),(int16_t*)(ytmp),1);
  dft1024((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1);
  dft1024((int16_t*)(xtmp+512),(int16_t*)(ytmp+512),1);
  dft1024((int16_t*)(xtmp+768),(int16_t*)(ytmp+768),1);

  for (i=0; i<256; i++) {
    bfly4(ytmpp,ytmpp+256,ytmpp+512,ytmpp+768,
          y128p,y128p+256,y128p+512,y128p+768,
          tw4096_128p,tw4096_128p+256,tw4096_128p+512);
    tw4096_128p++;
    y128p++;
    ytmpp++;
  }

  if (scale>0) {

    for (i=0; i<64; i++) {
2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917
      y128[0]  = shiftright_int16(y128[0],1);
      y128[1]  = shiftright_int16(y128[1],1);
      y128[2]  = shiftright_int16(y128[2],1);
      y128[3]  = shiftright_int16(y128[3],1);
      y128[4]  = shiftright_int16(y128[4],1);
      y128[5]  = shiftright_int16(y128[5],1);
      y128[6]  = shiftright_int16(y128[6],1);
      y128[7]  = shiftright_int16(y128[7],1);
      y128[8]  = shiftright_int16(y128[8],1);
      y128[9]  = shiftright_int16(y128[9],1);
      y128[10] = shiftright_int16(y128[10],1);
      y128[11] = shiftright_int16(y128[11],1);
      y128[12] = shiftright_int16(y128[12],1);
      y128[13] = shiftright_int16(y128[13],1);
      y128[14] = shiftright_int16(y128[14],1);
      y128[15] = shiftright_int16(y128[15],1);
2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931

      y128+=16;
    }

  }

  _mm_empty();
  _m_empty();

}

void idft4096(int16_t *x,int16_t *y,int scale)
{

2932 2933
  simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957
  int i,j;

  for (i=0,j=0; i<1024; i+=4,j++) {
    transpose16_ooff(x128+i,xtmp+j,256);
  }


  idft1024((int16_t*)(xtmp),(int16_t*)(ytmp),1);
  idft1024((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1);
  idft1024((int16_t*)(xtmp+512),(int16_t*)(ytmp+512),1);
  idft1024((int16_t*)(xtmp+768),(int16_t*)(ytmp+768),1);

  for (i=0; i<256; i++) {
    ibfly4(ytmpp,ytmpp+256,ytmpp+512,ytmpp+768,
           y128p,y128p+256,y128p+512,y128p+768,
           tw4096_128p,tw4096_128p+256,tw4096_128p+512);
    tw4096_128p++;
    y128p++;
    ytmpp++;
  }

  if (scale>0) {

    for (i=0; i<64; i++) {
2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973
      y128[0]  = shiftright_int16(y128[0],1);
      y128[1]  = shiftright_int16(y128[1],1);
      y128[2]  = shiftright_int16(y128[2],1);
      y128[3]  = shiftright_int16(y128[3],1);
      y128[4]  = shiftright_int16(y128[4],1);
      y128[5]  = shiftright_int16(y128[5],1);
      y128[6]  = shiftright_int16(y128[6],1);
      y128[7]  = shiftright_int16(y128[7],1);
      y128[8]  = shiftright_int16(y128[8],1);
      y128[9]  = shiftright_int16(y128[9],1);
      y128[10] = shiftright_int16(y128[10],1);
      y128[11] = shiftright_int16(y128[11],1);
      y128[12] = shiftright_int16(y128[12],1);
      y128[13] = shiftright_int16(y128[13],1);
      y128[14] = shiftright_int16(y128[14],1);
      y128[15] = shiftright_int16(y128[15],1);
2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000

      y128+=16;
    }

  }

  _mm_empty();
  _m_empty();

}

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(0:4095)/8192));
twa2 = zeros(1,2*4096);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t tw8192[4096*2] = {");
fprintf(fd,"%d,",twa2(1:(4096*2)-1));
fprintf(fd,"%d};\n",twa2(end));
fclose(fd);
*/
static int16_t tw8192[4096*2] = {32767,0,32766,-26,32766,-51,32766,-76,32766,-101,32766,-126,32766,-151,32766,-176,32766,-202,32766,-227,32766,-252,32765,-277,32765,-302,32765,-327,32765,-352,32764,-377,32764,-403,32764,-428,32763,-453,32763,-478,32763,-503,32762,-528,32762,-553,32761,-579,32761,-604,32760,-629,32760,-654,32759,-679,32759,-704,32758,-729,32758,-754,32757,-780,32757,-805,32756,-830,32755,-855,32755,-880,32754,-905,32753,-930,32753,-955,32752,-981,32751,-1006,32750,-1031,32750,-1056,32749,-1081,32748,-1106,32747,-1131,32746,-1156,32745,-1181,32744,-1207,32743,-1232,32742,-1257,32741,-1282,32740,-1307,32739,-1332,32738,-1357,32737,-1382,32736,-1407,32735,-1433,32734,-1458,32733,-1483,32732,-1508,32731,-1533,32729,-1558,32728,-1583,32727,-1608,32726,-1633,32725,-1659,32723,-1684,32722,-1709,32721,-1734,32719,-1759,32718,-1784,32717,-1809,32715,-1834,32714,-1859,32712,-1884,32711,-1909,32709,-1935,32708,-1960,32706,-1985,32705,-2010,32703,-2035,32702,-2060,32700,-2085,32699,-2110,32697,-2135,32695,-2160,32694,-2185,32692,-2210,32690,-2236,32688,-2261,32687,-2286,32685,-2311,32683,-2336,32681,-2361,32680,-2386,32678,-2411,32676,-2436,32674,-2461,32672,-2486,32670,-2511,32668,-2536,32666,-2561,32664,-2586,32662,-2611,32660,-2637,32658,-2662,32656,-2687,32654,-2712,32652,-2737,32650,-2762,32648,-2787,32646,-2812,32644,-2837,32641,-2862,32639,-2887,32637,-2912,32635,-2937,32632,-2962,32630,-2987,32628,-3012,32625,-3037,32623,-3062,32621,-3087,32618,-3112,32616,-3137,32614,-3162,32611,-3187,32609,-3212,32606,-3237,32604,-3262,32601,-3287,32599,-3312,32596,-3337,32594,-3362,32591,-3387,32588,-3412,32586,-3437,32583,-3462,32580,-3487,32578,-3512,32575,-3537,32572,-3562,32570,-3587,32567,-3612,32564,-3637,32561,-3662,32558,-3687,32556,-3712,32553,-3737,32550,-3762,32547,-3787,32544,-3812,32541,-3837,32538,-3862,32535,-3887,32532,-3912,32529,-3937,32526,-3962,32523,-3987,32520,-4012,32517,-4036,32514,-4061,32511,-4086,32508,-4111,32504,-4136,32501,-4161,32498,-4186,32495,-4211,32492,-4236,32488,-4261,32485,-4286,32482,-4311,32478,-4336,32475,-4360,32472,-4385,32468,-4410,32465,-4435,32462,-4460,32458,-4485,32455,-4510,32451,-4535,32448,-4560,32444,-4585,32441,-4609,32437,-4634,32434,-4659,32430,-4684,32426,-4709,32423,-4734,32419,-4759,32416,-4784,32412,-4808,32408,-4833,32404,-4858,32401,-4883,32397,-4908,32393,-4933,32389,-4958,32386,-4982,32382,-5007,32378,-5032,32374,-5057,32370,-5082,32366,-5107,32362,-5131,32358,-5156,32354,-5181,32350,-5206,32346,-5231,32342,-5255,32338,-5280,32334,-5305,32330,-5330,32326,-5355,32322,-5379,32318,-5404,32314,-5429,32310,-5454,32305,-5479,32301,-5503,32297,-5528,32293,-5553,32288,-5578,32284,-5602,32280,-5627,32275,-5652,32271,-5677,32267,-5701,32262,-5726,32258,-5751,32254,-5776,32249,-5800,32245,-5825,32240,-5850,32236,-5875,32231,-5899,32227,-5924,32222,-5949,32218,-5973,32213,-5998,32208,-6023,32204,-6048,32199,-6072,32194,-6097,32190,-6122,32185,-6146,32180,-6171,32176,-6196,32171,-6220,32166,-6245,32161,-6270,32156,-6294,32152,-6319,32147,-6344,32142,-6368,32137,-6393,32132,-6418,32127,-6442,32122,-6467,32117,-6492,32112,-6516,32107,-6541,32102,-6565,32097,-6590,32092,-6615,32087,-6639,32082,-6664,32077,-6689,32072,-6713,32066,-6738,32061,-6762,32056,-6787,32051,-6812,32046,-6836,32040,-6861,32035,-6885,32030,-6910,32024,-6934,32019,-6959,32014,-6983,32008,-7008,32003,-7033,31998,-7057,31992,-7082,31987,-7106,31981,-7131,31976,-7155,31970,-7180,31965,-7204,31959,-7229,31954,-7253,31948,-7278,31943,-7302,31937,-7327,31931,-7351,31926,-7376,31920,-7400,31914,-7425,31909,-7449,31903,-7474,31897,-7498,31891,-7523,31886,-7547,31880,-7572,31874,-7596,31868,-7620,31862,-7645,31856,-7669,31851,-7694,31845,-7718,31839,-7743,31833,-7767,31827,-7791,31821,-7816,31815,-7840,31809,-7865,31803,-7889,31797,-7913,31791,-7938,31785,-7962,31778,-7987,31772,-8011,31766,-8035,31760,-8060,31754,-8084,31748,-8108,31741,-8133,31735,-8157,31729,-8181,31723,-8206,31716,-8230,31710,-8254,31704,-8279,31697,-8303,31691,-8327,31684,-8352,31678,-8376,31672,-8400,31665,-8425,31659,-8449,31652,-8473,31646,-8497,31639,-8522,31633,-8546,31626,-8570,31619,-8594,31613,-8619,31606,-8643,31600,-8667,31593,-8691,31586,-8716,31580,-8740,31573,-8764,31566,-8788,31559,-8813,31553,-8837,31546,-8861,31539,-8885,31532,-8909,31525,-8933,31518,-8958,31512,-8982,31505,-9006,31498,-9030,31491,-9054,31484,-9078,31477,-9103,31470,-9127,31463,-9151,31456,-9175,31449,-9199,31442,-9223,31435,-9247,31428,-9271,31420,-9296,31413,-9320,31406,-9344,31399,-9368,31392,-9392,31385,-9416,31377,-9440,31370,-9464,31363,-9488,31356,-9512,31348,-9536,31341,-9560,31334,-9584,31326,-9608,31319,-9632,31311,-9656,31304,-9680,31297,-9704,31289,-9728,31282,-9752,31274,-9776,31267,-9800,31259,-9824,31252,-9848,31244,-9872,31236,-9896,31229,-9920,31221,-9944,31214,-9968,31206,-9992,31198,-10016,31191,-10040,31183,-10064,31175,-10088,31167,-10112,31160,-10136,31152,-10160,31144,-10183,31136,-10207,31128,-10231,31121,-10255,31113,-10279,31105,-10303,31097,-10327,31089,-10350,31081,-10374,31073,-10398,31065,-10422,31057,-10446,31049,-10470,31041,-10493,31033,-10517,31025,-10541,31017,-10565,31009,-10589,31001,-10612,30992,-10636,30984,-10660,30976,-10684,30968,-10707,30960,-10731,30951,-10755,30943,-10779,30935,-10802,30927,-10826,30918,-10850,30910,-10874,30902,-10897,30893,-10921,30885,-10945,30876,-10968,30868,-10992,30860,-11016,30851,-11039,30843,-11063,30834,-11087,30826,-11110,30817,-11134,30809,-11158,30800,-11181,30791,-11205,30783,-11228,30774,-11252,30766,-11276,30757,-11299,30748,-11323,30739,-11346,30731,-11370,30722,-11394,30713,-11417,30705,-11441,30696,-11464,30687,-11488,30678,-11511,30669,-11535,30660,-11558,30652,-11582,30643,-11605,30634,-11629,30625,-11652,30616,-11676,30607,-11699,30598,-11723,30589,-11746,30580,-11770,30571,-11793,30562,-11817,30553,-11840,30544,-11863,30535,-11887,30525,-11910,30516,-11934,30507,-11957,30498,-11981,30489,-12004,30480,-12027,30470,-12051,30461,-12074,30452,-12097,30442,-12121,30433,-12144,30424,-12167,30415,-12191,30405,-12214,30396,-12237,30386,-12261,30377,-12284,30368,-12307,30358,-12331,30349,-12354,30339,-12377,30330,-12400,30320,-12424,30311,-12447,30301,-12470,30291,-12493,30282,-12517,30272,-12540,30263,-12563,30253,-12586,30243,-12610,30234,-12633,30224,-12656,30214,-12679,30205,-12702,30195,-12725,30185,-12749,30175,-12772,30165,-12795,30156,-12818,30146,-12841,30136,-12864,30126,-12887,30116,-12910,30106,-12934,30096,-12957,30086,-12980,30076,-13003,30066,-13026,30056,-13049,30046,-13072,30036,-13095,30026,-13118,30016,-13141,30006,-13164,29996,-13187,29986,-13210,29976,-13233,29966,-13256,29955,-13279,29945,-13302,29935,-13325,29925,-13348,29915,-13371,29904,-13394,29894,-13417,29884,-13440,29873,-13463,29863,-13486,29853,-13508,29842,-13531,29832,-13554,29822,-13577,29811,-13600,29801,-13623,29790,-13646,29780,-13668,29769,-13691,29759,-13714,29748,-13737,29738,-13760,29727,-13783,29717,-13805,29706,-13828,29695,-13851,29685,-13874,29674,-13896,29663,-13919,29653,-13942,29642,-13965,29631,-13987,29621,-14010,29610,-14033,29599,-14056,29588,-14078,29577,-14101,29567,-14124,29556,-14146,29545,-14169,29534,-14192,29523,-14214,29512,-14237,29501,-14260,29490,-14282,29479,-14305,29468,-14327,29457,-14350,29446,-14373,29435,-14395,29424,-14418,29413,-14440,29402,-14463,29391,-14485,29380,-14508,29369,-14531,29358,-14553,29346,-14576,29335,-14598,29324,-14621,29313,-14643,29302,-14666,29290,-14688,29279,-14710,29268,-14733,29256,-14755,29245,-14778,29234,-14800,29222,-14823,29211,-14845,29200,-14867,29188,-14890,29177,-14912,29165,-14935,29154,-14957,29142,-14979,29131,-15002,29119,-15024,29108,-15046,29096,-15069,29085,-15091,29073,-15113,29062,-15136,29050,-15158,29038,-15180,29027,-15202,29015,-15225,29003,-15247,28992,-15269,28980,-15291,28968,-15314,28956,-15336,28945,-15358,28933,-15380,28921,-15402,28909,-15425,28897,-15447,28886,-15469,28874,-15491,28862,-15513,28850,-15535,28838,-15557,28826,-15580,28814,-15602,28802,-15624,28790,-15646,28778,-15668,28766,-15690,28754,-15712,28742,-15734,28730,-15756,28718,-15778,28706,-15800,28694,-15822,28681,-15844,28669,-15866,28657,-15888,28645,-15910,28633,-15932,28620,-15954,28608,-15976,28596,-15998,28584,-16020,28571,-16042,28559,-16064,28547,-16086,28534,-16108,28522,-16129,28510,-16151,28497,-16173,28485,-16195,28472,-16217,28460,-16239,28447,-16261,28435,-16282,28423,-16304,28410,-16326,28397,-16348,28385,-16369,28372,-16391,28360,-16413,28347,-16435,28335,-16456,28322,-16478,28309,-16500,28297,-16522,28284,-16543,28271,-16565,28259,-16587,28246,-16608,28233,-16630,28220,-16652,28208,-16673,28195,-16695,28182,-16717,28169,-16738,28156,-16760,28143,-16781,28131,-16803,28118,-16825,28105,-16846,28092,-16868,28079,-16889,28066,-16911,28053,-16932,28040,-16954,28027,-16975,28014,-16997,28001,-17018,27988,-17040,27975,-17061,27962,-17083,27948,-17104,27935,-17125,27922,-17147,27909,-17168,27896,-17190,27883,-17211,27869,-17233,27856,-17254,27843,-17275,27830,-17297,27816,-17318,27803,-17339,27790,-17361,27777,-17382,27763,-17403,27750,-17424,27736,-17446,27723,-17467,27710,-17488,27696,-17510,27683,-17531,27669,-17552,27656,-17573,27642,-17594,27629,-17616,27615,-17637,27602,-17658,27588,-17679,27575,-17700,27561,-17721,27548,-17743,27534,-17764,27520,-17785,27507,-17806,27493,-17827,27479,-17848,27466,-17869,27452,-17890,27438,-17911,27424,-17932,27411,-17953,27397,-17974,27383,-17995,27369,-18016,27355,-18037,27342,-18058,27328,-18079,27314,-18100,27300,-18121,27286,-18142,27272,-18163,27258,-18184,27244,-18205,27230,-18226,27216,-18247,27202,-18268,27188,-18288,27174,-18309,27160,-18330,27146,-18351,27132,-18372,27118,-18393,27104,-18413,27090,-18434,27076,-18455,27061,-18476,27047,-18496,27033,-18517,27019,-18538,27005,-18559,26990,-18579,26976,-18600,26962,-18621,26948,-18641,26933,-18662,26919,-18683,26905,-18703,26890,-18724,26876,-18745,26861,-18765,26847,-18786,26833,-18806,26818,-18827,26804,-18847,26789,-18868,26775,-18889,26760,-18909,26746,-18930,26731,-18950,26717,-18971,26702,-18991,26688,-19012,26673,-19032,26658,-19052,26644,-19073,26629,-19093,26615,-19114,26600,-19134,26585,-19155,26570,-19175,26556,-19195,26541,-19216,26526,-19236,26512,-19256,26497,-19277,26482,-19297,26467,-19317,26452,-19338,26437,-19358,26423,-19378,26408,-19398,26393,-19419,26378,-19439,26363,-19459,26348,-19479,26333,-19500,26318,-19520,26303,-19540,26288,-19560,26273,-19580,26258,-19600,26243,-19621,26228,-19641,26213,-19661,26198,-19681,26183,-19701,26168,-19721,26153,-19741,26137,-19761,26122,-19781,26107,-19801,26092,-19821,26077,-19841,26061,-19861,26046,-19881,26031,-19901,26016,-19921,26000,-19941,25985,-19961,25970,-19981,25954,-20001,25939,-20021,25924,-20041,25908,-20061,25893,-20080,25878,-20100,25862,-20120,25847,-20140,25831,-20160,25816,-20180,25800,-20199,25785,-20219,25769,-20239,25754,-20259,25738,-20278,25723,-20298,25707,-20318,25691,-20338,25676,-20357,25660,-20377,25645,-20397,25629,-20416,25613,-20436,25598,-20456,25582,-20475,25566,-20495,25550,-20514,25535,-20534,25519,-20554,25503,-20573,25487,-20593,25472,-20612,25456,-20632,25440,-20651,25424,-20671,25408,-20690,25392,-20710,25376,-20729,25361,-20749,25345,-20768,25329,-20788,25313,-20807,25297,-20826,25281,-20846,25265,-20865,25249,-20885,25233,-20904,25217,-20923,25201,-20943,25185,-20962,25169,-20981,25152,-21001,25136,-21020,25120,-21039,25104,-21058,25088,-21078,25072,-21097,25056,-21116,25039,-21135,25023,-21155,25007,-21174,24991,-21193,24974,-21212,24958,-21231,24942,-21250,24926,-21269,24909,-21289,24893,-21308,24877,-21327,24860,-21346,24844,-21365,24827,-21384,24811,-21403,24795,-21422,24778,-21441,24762,-21460,24745,-21479,24729,-21498,24712,-21517,24696,-21536,24679,-21555,24663,-21574,24646,-21593,24630,-21612,24613,-21630,24596,-21649,24580,-21668,24563,-21687,24546,-21706,24530,-21725,24513,-21744,24496,-21762,24480,-21781,24463,-21800,24446,-21819,24430,-21837,24413,-21856,24396,-21875,24379,-21894,24362,-21912,24346,-21931,24329,-21950,24312,-21968,24295,-21987,24278,-22005,24261,-22024,24244,-22043,24228,-22061,24211,-22080,24194,-22098,24177,-22117,24160,-22136,24143,-22154,24126,-22173,24109,-22191,24092,-22210,24075,-22228,24058,-22246,24041,-22265,24023,-22283,24006,-22302,23989,-22320,23972,-22339,23955,-22357,23938,-22375,23921,-22394,23903,-22412,23886,-22430,23869,-22449,23852,-22467,23835,-22485,23817,-22504,23800,-22522,23783,-22540,23766,-22558,23748,-22576,23731,-22595,23714,-22613,23696,-22631,23679,-22649,23661,-22667,23644,-22686,23627,-22704,23609,-22722,23592,-22740,23574,-22758,23557,-22776,23539,-22794,23522,-22812,23504,-22830,23487,-22848,23469,-22866,23452,-22884,23434,-22902,23417,-22920,23399,-22938,23382,-22956,23364,-22974,23346,-22992,23329,-23010,23311,-23028,23293,-23046,23276,-23063,23258,-23081,23240,-23099,23223,-23117,23205,-23135,23187,-23152,23169,-23170,23151,-23188,23134,-23206,23116,-23224,23098,-23241,23080,-23259,23062,-23277,23045,-23294,23027,-23312,23009,-23330,22991,-23347,22973,-23365,22955,-23383,22937,-23400,22919,-23418,22901,-23435,22883,-23453,22865,-23470,22847,-23488,22829,-23505,22811,-23523,22793,-23540,22775,-23558,22757,-23575,22739,-23593,22721,-23610,22703,-23628,22685,-23645,22666,-23662,22648,-23680,22630,-23697,22612,-23715,22594,-23732,22575,-23749,22557,-23767,22539,-23784,22521,-23801,22503,-23818,22484,-23836,22466,-23853,22448,-23870,22429,-23887,22411,-23904,22393,-23922,22374,-23939,22356,-23956,22338,-23973,22319,-23990,22301,-24007,22282,-24024,22264,-24042,22245,-24059,22227,-24076,22209,-24093,22190,-24110,22172,-24127,22153,-24144,22135,-24161,22116,-24178,22097,-24195,22079,-24212,22060,-24229,22042,-24245,22023,-24262,22004,-24279,21986,-24296,21967,-24313,21949,-24330,21930,-24347,21911,-24363,21893,-24380,21874,-24397,21855,-24414,21836,-24431,21818,-24447,21799,-24464,21780,-24481,21761,-24497,21743,-24514,21724,-24531,21705,-24547,21686,-24564,21667,-24581,21648,-24597,21629,-24614,21611,-24631,21592,-24647,21573,-24664,21554,-24680,21535,-24697,21516,-24713,21497,-24730,21478,-24746,21459,-24763,21440,-24779,21421,-24796,21402,-24812,21383,-24828,21364,-24845,21345,-24861,21326,-24878,21307,-24894,21288,-24910,21268,-24927,21249,-24943,21230,-24959,21211,-24975,21192,-24992,21173,-25008,21154,-25024,21134,-25040,21115,-25057,21096,-25073,21077,-25089,21057,-25105,21038,-25121,21019,-25137,21000,-25153,20980,-25170,20961,-25186,20942,-25202,20922,-25218,20903,-25234,20884,-25250,20864,-25266,20845,-25282,20825,-25298,20806,-25314,20787,-25330,20767,-25346,20748,-25362,20728,-25377,20709,-25393,20689,-25409,20670,-25425,20650,-25441,20631,-25457,20611,-25473,20592,-25488,20572,-25504,20553,-25520,20533,-25536,20513,-25551,20494,-25567,20474,-25583,20455,-25599,20435,-25614,20415,-25630,20396,-25646,20376,-25661,20356,-25677,20337,-25692,20317,-25708,20297,-25724,20277,-25739,20258,-25755,20238,-25770,20218,-25786,20198,-25801,20179,-25817,20159,-25832,20139,-25848,20119,-25863,20099,-25879,20079,-25894,20060,-25909,20040,-25925,20020,-25940,20000,-25955,19980,-25971,19960,-25986,19940,-26001,19920,-26017,19900,-26032,19880,-26047,19860,-26062,19840,-26078,19820,-26093,19800,-26108,19780,-26123,19760,-26138,19740,-26154,19720,-26169,19700,-26184,19680,-26199,19660,-26214,19640,-26229,19620,-26244,19599,-26259,19579,-26274,19559,-26289,19539,-26304,19519,-26319,19499,-26334,19478,-26349,19458,-26364,19438,-26379,19418,-26394,19397,-26409,19377,-26424,19357,-26438,19337,-26453,19316,-26468,19296,-26483,19276,-26498,19255,-26513,19235,-26527,19215,-26542,19194,-26557,19174,-26571,19154,-26586,19133,-26601,19113,-26616,19092,-26630,19072,-26645,19051,-26659,19031,-26674,19011,-26689,18990,-26703,18970,-26718,18949,-26732,18929,-26747,18908,-26761,18888,-26776,18867,-26790,18846,-26805,18826,-26819,18805,-26834,18785,-26848,18764,-26862,18744,-26877,18723,-26891,18702,-26906,18682,-26920,18661,-26934,18640,-26949,18620,-26963,18599,-26977,18578,-26991,18558,-27006,18537,-27020,18516,-27034,18495,-27048,18475,-27062,18454,-27077,18433,-27091,18412,-27105,18392,-27119,18371,-27133,18350,-27147,18329,-27161,18308,-27175,18287,-27189,18267,-27203,18246,-27217,18225,-27231,18204,-27245,18183,-27259,18162,-27273,18141,-27287,18120,-27301,18099,-27315,18078,-27329,18057,-27343,18036,-27356,18015,-27370,17994,-27384,17973,-27398,17952,-27412,17931,-27425,17910,-27439,17889,-27453,17868,-27467,17847,-27480,17826,-27494,17805,-27508,17784,-27521,17763,-27535,17742,-27549,17720,-27562,17699,-27576,17678,-27589,17657,-27603,17636,-27616,17615,-27630,17593,-27643,17572,-27657,17551,-27670,17530,-27684,17509,-27697,17487,-27711,17466,-27724,17445,-27737,17423,-27751,17402,-27764,17381,-27778,17360,-27791,17338,-27804,17317,-27817,17296,-27831,17274,-27844,17253,-27857,17232,-27870,17210,-27884,17189,-27897,17167,-27910,17146,-27923,17124,-27936,17103,-27949,17082,-27963,17060,-27976,17039,-27989,17017,-28002,16996,-28015,16974,-28028,16953,-28041,16931,-28054,16910,-28067,16888,-28080,16867,-28093,16845,-28106,16824,-28119,16802,-28132,16780,-28144,16759,-28157,16737,-28170,16716,-28183,16694,-28196,16672,-28209,16651,-28221,16629,-28234,16607,-28247,16586,-28260,16564,-28272,16542,-28285,16521,-28298,16499,-28310,16477,-28323,16455,-28336,16434,-28348,16412,-28361,16390,-28373,16368,-28386,16347,-28398,16325,-28411,16303,-28424,16281,-28436,16260,-28448,16238,-28461,16216,-28473,16194,-28486,16172,-28498,16150,-28511,16128,-28523,16107,-28535,16085,-28548,16063,-28560,16041,-28572,16019,-28585,15997,-28597,15975,-28609,15953,-28621,15931,-28634,15909,-28646,15887,-28658,15865,-28670,15843,-28682,15821,-28695,15799,-28707,15777,-28719,15755,-28731,15733,-28743,15711,-28755,15689,-28767,15667,-28779,15645,-28791,15623,-28803,15601,-28815,15579,-28827,15556,-28839,15534,-28851,15512,-28863,15490,-28875,15468,-28887,15446,-28898,15424,-28910,15401,-28922,15379,-28934,15357,-28946,15335,-28957,15313,-28969,15290,-28981,15268,-28993,15246,-29004,15224,-29016,15201,-29028,15179,-29039,15157,-29051,15135,-29063,15112,-29074,15090,-29086,15068,-29097,15045,-29109,15023,-29120,15001,-29132,14978,-29143,14956,-29155,14934,-29166,14911,-29178,14889,-29189,14866,-29201,14844,-29212,14822,-29223,14799,-29235,14777,-29246,14754,-29257,14732,-29269,14709,-29280,14687,-29291,14665,-29303,14642,-29314,14620,-29325,14597,-29336,14575,-29347,14552,-29359,14530,-29370,14507,-29381,14484,-29392,14462,-29403,14439,-29414,14417,-29425,14394,-29436,14372,-29447,14349,-29458,14326,-29469,14304,-29480,14281,-29491,14259,-29502,14236,-29513,14213,-29524,14191,-29535,14168,-29546,14145,-29557,14123,-29568,14100,-29578,14077,-29589,14055,-29600,14032,-29611,14009,-29622,13986,-29632,13964,-29643,13941,-29654,13918,-29664,13895,-29675,13873,-29686,13850,-29696,13827,-29707,13804,-29718,13782,-29728,13759,-29739,13736,-29749,13713,-29760,13690,-29770,13667,-29781,13645,-29791,13622,-29802,13599,-29812,13576,-29823,13553,-29833,13530,-29843,13507,-29854,13485,-29864,13462,-29874,13439,-29885,13416,-29895,13393,-29905,13370,-29916,13347,-29926,13324,-29936,13301,-29946,13278,-29956,13255,-29967,13232,-29977,13209,-29987,13186,-29997,13163,-30007,13140,-30017,13117,-30027,13094,-30037,13071,-30047,13048,-30057,13025,-30067,13002,-30077,12979,-30087,12956,-30097,12933,-30107,12909,-30117,12886,-30127,12863,-30137,12840,-30147,12817,-30157,12794,-30166,12771,-30176,12748,-30186,12724,-30196,12701,-30206,12678,-30215,12655,-30225,12632,-30235,12609,-30244,12585,-30254,12562,-30264,12539,-30273,12516,-30283,12492,-30292,12469,-30302,12446,-30312,12423,-30321,12399,-30331,12376,-30340,12353,-30350,12330,-30359,12306,-30369,12283,-30378,12260,-30387,12236,-30397,12213,-30406,12190,-30416,12166,-30425,12143,-30434,12120,-30443,12096,-30453,12073,-30462,12050,-30471,12026,-30481,12003,-30490,11980,-30499,11956,-30508,11933,-30517,11909,-30526,11886,-30536,11862,-30545,11839,-30554,11816,-30563,11792,-30572,11769,-30581,11745,-30590,11722,-30599,11698,-30608,11675,-30617,11651,-30626,11628,-30635,11604,-30644,11581,-30653,11557,-30661,11534,-30670,11510,-30679,11487,-30688,11463,-30697,11440,-30706,11416,-30714,11393,-30723,11369,-30732,11345,-30740,11322,-30749,11298,-30758,11275,-30767,11251,-30775,11227,-30784,11204,-30792,11180,-30801,11157,-30810,11133,-30818,11109,-30827,11086,-30835,11062,-30844,11038,-30852,11015,-30861,10991,-30869,10967,-30877,10944,-30886,10920,-30894,10896,-30903,10873,-30911,10849,-30919,10825,-30928,10801,-30936,10778,-30944,10754,-30952,10730,-30961,10706,-30969,10683,-30977,10659,-30985,10635,-30993,10611,-31002,10588,-31010,10564,-31018,10540,-31026,10516,-31034,10492,-31042,10469,-31050,10445,-31058,10421,-31066,10397,-31074,10373,-31082,10349,-31090,10326,-31098,10302,-31106,10278,-31114,10254,-31122,10230,-31129,10206,-31137,10182,-31145,10159,-31153,10135,-31161,10111,-31168,10087,-31176,10063,-31184,10039,-31192,10015,-31199,9991,-31207,9967,-31215,9943,-31222,9919,-31230,9895,-31237,9871,-31245,9847,-31253,9823,-31260,9799,-31268,9775,-31275,9751,-31283,9727,-31290,9703,-31298,9679,-31305,9655,-31312,9631,-31320,9607,-31327,9583,-31335,9559,-31342,9535,-31349,9511,-31357,9487,-31364,9463,-31371,9439,-31378,9415,-31386,9391,-31393,9367,-31400,9343,-31407,9319,-31414,9295,-31421,9270,-31429,9246,-31436,9222,-31443,9198,-31450,9174,-31457,9150,-31464,9126,-31471,9102,-31478,9077,-31485,9053,-31492,9029,-31499,9005,-31506,8981,-31513,8957,-31519,8932,-31526,8908,-31533,8884,-31540,8860,-31547,8836,-31554,8812,-31560,8787,-31567,8763,-31574,8739,-31581,8715,-31587,8690,-31594,8666,-31601,8642,-31607,8618,-31614,8593,-31620,8569,-31627,8545,-31634,8521,-31640,8496,-31647,8472,-31653,8448,-31660,8424,-31666,8399,-31673,8375,-31679,8351,-31685,8326,-31692,8302,-31698,8278,-31705,8253,-31711,8229,-31717,8205,-31724,8180,-31730,8156,-31736,8132,-31742,8107,-31749,8083,-31755,8059,-31761,8034,-31767,8010,-31773,7986,-31779,7961,-31786,7937,-31792,7912,-31798,7888,-31804,7864,-31810,7839,-31816,7815,-31822,7790,-31828,7766,-31834,7742,-31840,7717,-31846,7693,-31852,7668,-31857,7644,-31863,7619,-31869,7595,-31875,7571,-31881,7546,-31887,7522,-31892,7497,-31898,7473,-31904,7448,-31910,7424,-31915,7399,-31921,7375,-31927,7350,-31932,7326,-31938,7301,-31944,7277,-31949,7252,-31955,7228,-31960,7203,-31966,7179,-31971,7154,-31977,7130,-31982,7105,-31988,7081,-31993,7056,-31999,7032,-32004,7007,-32009,6982,-32015,6958,-32020,6933,-32025,6909,-32031,6884,-32036,6860,-32041,6835,-32047,6811,-32052,6786,-32057,6761,-32062,6737,-32067,6712,-32073,6688,-32078,6663,-32083,6638,-32088,6614,-32093,6589,-32098,6564,-32103,6540,-32108,6515,-32113,6491,-32118,6466,-32123,6441,-32128,6417,-32133,6392,-32138,6367,-32143,6343,-32148,6318,-32153,6293,-32157,6269,-32162,6244,-32167,6219,-32172,6195,-32177,6170,-32181,6145,-32186,6121,-32191,6096,-32195,6071,-32200,6047,-32205,6022,-32209,5997,-32214,5972,-32219,5948,-32223,5923,-32228,5898,-32232,5874,-32237,5849,-32241,5824,-32246,5799,-32250,5775,-32255,5750,-32259,5725,-32263,5700,-32268,5676,-32272,5651,-32276,5626,-32281,5601,-32285,5577,-32289,5552,-32294,5527,-32298,5502,-32302,5478,-32306,5453,-32311,5428,-32315,5403,-32319,5378,-32323,5354,-32327,5329,-32331,5304,-32335,5279,-32339,5254,-32343,5230,-32347,5205,-32351,5180,-32355,5155,-32359,5130,-32363,5106,-32367,5081,-32371,5056,-32375,5031,-32379,5006,-32383,4981,-32387,4957,-32390,4932,-32394,4907,-32398,4882,-32402,4857,-32405,4832,-32409,4807,-32413,4783,-32417,4758,-32420,4733,-32424,4708,-32427,4683,-32431,4658,-32435,4633,-32438,4608,-32442,4584,-32445,4559,-32449,4534,-32452,4509,-32456,4484,-32459,4459,-32463,4434,-32466,4409,-32469,4384,-32473,4359,-32476,4335,-32479,4310,-32483,4285,-32486,4260,-32489,4235,-32493,4210,-32496,4185,-32499,4160,-32502,4135,-32505,4110,-32509,4085,-32512,4060,-32515,4035,-32518,4011,-32521,3986,-32524,3961,-32527,3936,-32530,3911,-32533,3886,-32536,3861,-32539,3836,-32542,3811,-32545,3786,-32548,3761,-32551,3736,-32554,3711,-32557,3686,-32559,3661,-32562,3636,-32565,3611,-32568,3586,-32571,3561,-32573,3536,-32576,3511,-32579,3486,-32581,3461,-32584,3436,-32587,3411,-32589,3386,-32592,3361,-32595,3336,-32597,3311,-32600,3286,-32602,3261,-32605,3236,-32607,3211,-32610,3186,-32612,3161,-32615,3136,-32617,3111,-32619,3086,-32622,3061,-32624,3036,-32626,3011,-32629,2986,-32631,2961,-32633,2936,-32636,2911,-32638,2886,-32640,2861,-32642,2836,-32645,2811,-32647,2786,-32649,2761,-32651,2736,-32653,2711,-32655,2686,-32657,2661,-32659,2636,-32661,2610,-32663,2585,-32665,2560,-32667,2535,-32669,2510,-32671,2485,-32673,2460,-32675,2435,-32677,2410,-32679,2385,-32681,2360,-32682,2335,-32684,2310,-32686,2285,-32688,2260,-32689,2235,-32691,2209,-32693,2184,-32695,2159,-32696,2134,-32698,2109,-32700,2084,-32701,2059,-32703,2034,-32704,2009,-32706,1984,-32707,1959,-32709,1934,-32710,1908,-32712,1883,-32713,1858,-32715,1833,-32716,1808,-32718,1783,-32719,1758,-32720,1733,-32722,1708,-32723,1683,-32724,1658,-32726,1632,-32727,1607,-32728,1582,-32729,1557,-32730,1532,-32732,1507,-32733,1482,-32734,1457,-32735,1432,-32736,1406,-32737,1381,-32738,1356,-32739,1331,-32740,1306,-32741,1281,-32742,1256,-32743,1231,-32744,1206,-32745,1180,-32746,1155,-32747,1130,-32748,1105,-32749,1080,-32750,1055,-32751,1030,-32751,1005,-32752,980,-32753,954,-32754,929,-32754,904,-32755,879,-32756,854,-32756,829,-32757,804,-32758,779,-32758,753,-32759,728,-32759,703,-32760,678,-32760,653,-32761,628,-32761,603,-32762,578,-32762,552,-32763,527,-32763,502,-32764,477,-32764,452,-32764,427,-32765,402,-32765,376,-32765,351,-32766,326,-32766,301,-32766,276,-32766,251,-32767,226,-32767,201,-32767,175,-32767,150,-32767,125,-32767,100,-32767,75,-32767,50,-32767,25,-32767,0,-32767,-26,-32767,-51,-32767,-76,-32767,-101,-32767,-126,-32767,-151,-32767,-176,-32767,-202,-32767,-227,-32767,-252,-32767,-277,-32766,-302,-32766,-327,-32766,-352,-32766,-377,-32765,-403,-32765,-428,-32765,-453,-32764,-478,-32764,-503,-32764,-528,-32763,-553,-32763,-579,-32762,-604,-32762,-629,-32761,-654,-32761,-679,-32760,-704,-32760,-729,-32759,-754,-32759,-780,-32758,-805,-32758,-830,-32757,-855,-32756,-880,-32756,-905,-32755,-930,-32754,-955,-32754,-981,-32753,-1006,-32752,-1031,-32751,-1056,-32751,-1081,-32750,-1106,-32749,-1131,-32748,-1156,-32747,-1181,-32746,-1207,-32745,-1232,-32744,-1257,-32743,-1282,-32742,-1307,-32741,-1332,-32740,-1357,-32739,-1382,-32738,-1407,-32737,-1433,-32736,-1458,-32735,-1483,-32734,-1508,-32733,-1533,-32732,-1558,-32730,-1583,-32729,-1608,-32728,-1633,-32727,-1659,-32726,-1684,-32724,-1709,-32723,-1734,-32722,-1759,-32720,-1784,-32719,-1809,-32718,-1834,-32716,-1859,-32715,-1884,-32713,-1909,-32712,-1935,-32710,-1960,-32709,-1985,-32707,-2010,-32706,-2035,-32704,-2060,-32703,-2085,-32701,-2110,-32700,-2135,-32698,-2160,-32696,-2185,-32695,-2210,-32693,-2236,-32691,-2261,-32689,-2286,-32688,-2311,-32686,-2336,-32684,-2361,-32682,-2386,-32681,-2411,-32679,-2436,-32677,-2461,-32675,-2486,-32673,-2511,-32671,-2536,-32669,-2561,-32667,-2586,-32665,-2611,-32663,-2637,-32661,-2662,-32659,-2687,-32657,-2712,-32655,-2737,-32653,-2762,-32651,-2787,-32649,-2812,-32647,-2837,-32645,-2862,-32642,-2887,-32640,-2912,-32638,-2937,-32636,-2962,-32633,-2987,-32631,-3012,-32629,-3037,-32626,-3062,-32624,-3087,-32622,-3112,-32619,-3137,-32617,-3162,-32615,-3187,-32612,-3212,-32610,-3237,-32607,-3262,-32605,-3287,-32602,-3312,-32600,-3337,-32597,-3362,-32595,-3387,-32592,-3412,-32589,-3437,-32587,-3462,-32584,-3487,-32581,-3512,-32579,-3537,-32576,-3562,-32573,-3587,-32571,-3612,-32568,-3637,-32565,-3662,-32562,-3687,-32559,-3712,-32557,-3737,-32554,-3762,-32551,-3787,-32548,-3812,-32545,-3837,-32542,-3862,-32539,-3887,-32536,-3912,-32533,-3937,-32530,-3962,-32527,-3987,-32524,-4012,-32521,-4036,-32518,-4061,-32515,-4086,-32512,-4111,-32509,-4136,-32505,-4161,-32502,-4186,-32499,-4211,-32496,-4236,-32493,-4261,-32489,-4286,-32486,-4311,-32483,-4336,-32479,-4360,-32476,-4385,-32473,-4410,-32469,-4435,-32466,-4460,-32463,-4485,-32459,-4510,-32456,-4535,-32452,-4560,-32449,-4585,-32445,-4609,-32442,-4634,-32438,-4659,-32435,-4684,-32431,-4709,-32427,-4734,-32424,-4759,-32420,-4784,-32417,-4808,-32413,-4833,-32409,-4858,-32405,-4883,-32402,-4908,-32398,-4933,-32394,-4958,-32390,-4982,-32387,-5007,-32383,-5032,-32379,-5057,-32375,-5082,-32371,-5107,-32367,-5131,-32363,-5156,-32359,-5181,-32355,-5206,-32351,-5231,-32347,-5255,-32343,-5280,-32339,-5305,-32335,-5330,-32331,-5355,-32327,-5379,-32323,-5404,-32319,-5429,-32315,-5454,-32311,-5479,-32306,-5503,-32302,-5528,-32298,-5553,-32294,-5578,-32289,-5602,-32285,-5627,-32281,-5652,-32276,-5677,-32272,-5701,-32268,-5726,-32263,-5751,-32259,-5776,-32255,-5800,-32250,-5825,-32246,-5850,-32241,-5875,-32237,-5899,-32232,-5924,-32228,-5949,-32223,-5973,-32219,-5998,-32214,-6023,-32209,-6048,-32205,-6072,-32200,-6097,-32195,-6122,-32191,-6146,-32186,-6171,-32181,-6196,-32177,-6220,-32172,-6245,-32167,-6270,-32162,-6294,-32157,-6319,-32153,-6344,-32148,-6368,-32143,-6393,-32138,-6418,-32133,-6442,-32128,-6467,-32123,-6492,-32118,-6516,-32113,-6541,-32108,-6565,-32103,-6590,-32098,-6615,-32093,-6639,-32088,-6664,-32083,-6689,-32078,-6713,-32073,-6738,-32067,-6762,-32062,-6787,-32057,-6812,-32052,-6836,-32047,-6861,-32041,-6885,-32036,-6910,-32031,-6934,-32025,-6959,-32020,-6983,-32015,-7008,-32009,-7033,-32004,-7057,-31999,-7082,-31993,-7106,-31988,-7131,-31982,-7155,-31977,-7180,-31971,-7204,-31966,-7229,-31960,-7253,-31955,-7278,-31949,-7302,-31944,-7327,-31938,-7351,-31932,-7376,-31927,-7400,-31921,-7425,-31915,-7449,-31910,-7474,-31904,-7498,-31898,-7523,-31892,-7547,-31887,-7572,-31881,-7596,-31875,-7620,-31869,-7645,-31863,-7669,-31857,-7694,-31852,-7718,-31846,-7743,-31840,-7767,-31834,-7791,-31828,-7816,-31822,-7840,-31816,-7865,-31810,-7889,-31804,-7913,-31798,-7938,-31792,-7962,-31786,-7987,-31779,-8011,-31773,-8035,-31767,-8060,-31761,-8084,-31755,-8108,-31749,-8133,-31742,-8157,-31736,-8181,-31730,-8206,-31724,-8230,-31717,-8254,-31711,-8279,-31705,-8303,-31698,-8327,-31692,-8352,-31685,-8376,-31679,-8400,-31673,-8425,-31666,-8449,-31660,-8473,-31653,-8497,-31647,-8522,-31640,-8546,-31634,-8570,-31627,-8594,-31620,-8619,-31614,-8643,-31607,-8667,-31601,-8691,-31594,-8716,-31587,-8740,-31581,-8764,-31574,-8788,-31567,-8813,-31560,-8837,-31554,-8861,-31547,-8885,-31540,-8909,-31533,-8933,-31526,-8958,-31519,-8982,-31513,-9006,-31506,-9030,-31499,-9054,-31492,-9078,-31485,-9103,-31478,-9127,-31471,-9151,-31464,-9175,-31457,-9199,-31450,-9223,-31443,-9247,-31436,-9271,-31429,-9296,-31421,-9320,-31414,-9344,-31407,-9368,-31400,-9392,-31393,-9416,-31386,-9440,-31378,-9464,-31371,-9488,-31364,-9512,-31357,-9536,-31349,-9560,-31342,-9584,-31335,-9608,-31327,-9632,-31320,-9656,-31312,-9680,-31305,-9704,-31298,-9728,-31290,-9752,-31283,-9776,-31275,-9800,-31268,-9824,-31260,-9848,-31253,-9872,-31245,-9896,-31237,-9920,-31230,-9944,-31222,-9968,-31215,-9992,-31207,-10016,-31199,-10040,-31192,-10064,-31184,-10088,-31176,-10112,-31168,-10136,-31161,-10160,-31153,-10183,-31145,-10207,-31137,-10231,-31129,-10255,-31122,-10279,-31114,-10303,-31106,-10327,-31098,-10350,-31090,-10374,-31082,-10398,-31074,-10422,-31066,-10446,-31058,-10470,-31050,-10493,-31042,-10517,-31034,-10541,-31026,-10565,-31018,-10589,-31010,-10612,-31002,-10636,-30993,-10660,-30985,-10684,-30977,-10707,-30969,-10731,-30961,-10755,-30952,-10779,-30944,-10802,-30936,-10826,-30928,-10850,-30919,-10874,-30911,-10897,-30903,-10921,-30894,-10945,-30886,-10968,-30877,-10992,-30869,-11016,-30861,-11039,-30852,-11063,-30844,-11087,-30835,-11110,-30827,-11134,-30818,-11158,-30810,-11181,-30801,-11205,-30792,-11228,-30784,-11252,-30775,-11276,-30767,-11299,-30758,-11323,-30749,-11346,-30740,-11370,-30732,-11394,-30723,-11417,-30714,-11441,-30706,-11464,-30697,-11488,-30688,-11511,-30679,-11535,-30670,-11558,-30661,-11582,-30653,-11605,-30644,-11629,-30635,-11652,-30626,-11676,-30617,-11699,-30608,-11723,-30599,-11746,-30590,-11770,-30581,-11793,-30572,-11817,-30563,-11840,-30554,-11863,-30545,-11887,-30536,-11910,-30526,-11934,-30517,-11957,-30508,-11981,-30499,-12004,-30490,-12027,-30481,-12051,-30471,-12074,-30462,-12097,-30453,-12121,-30443,-12144,-30434,-12167,-30425,-12191,-30416,-12214,-30406,-12237,-30397,-12261,-30387,-12284,-30378,-12307,-30369,-12331,-30359,-12354,-30350,-12377,-30340,-12400,-30331,-12424,-30321,-12447,-30312,-12470,-30302,-12493,-30292,-12517,-30283,-12540,-30273,-12563,-30264,-12586,-30254,-12610,-30244,-12633,-30235,-12656,-30225,-12679,-30215,-12702,-30206,-12725,-30196,-12749,-30186,-12772,-30176,-12795,-30166,-12818,-30157,-12841,-30147,-12864,-30137,-12887,-30127,-12910,-30117,-12934,-30107,-12957,-30097,-12980,-30087,-13003,-30077,-13026,-30067,-13049,-30057,-13072,-30047,-13095,-30037,-13118,-30027,-13141,-30017,-13164,-30007,-13187,-29997,-13210,-29987,-13233,-29977,-13256,-29967,-13279,-29956,-13302,-29946,-13325,-29936,-13348,-29926,-13371,-29916,-13394,-29905,-13417,-29895,-13440,-29885,-13463,-29874,-13486,-29864,-13508,-29854,-13531,-29843,-13554,-29833,-13577,-29823,-13600,-29812,-13623,-29802,-13646,-29791,-13668,-29781,-13691,-29770,-13714,-29760,-13737,-29749,-13760,-29739,-13783,-29728,-13805,-29718,-13828,-29707,-13851,-29696,-13874,-29686,-13896,-29675,-13919,-29664,-13942,-29654,-13965,-29643,-13987,-29632,-14010,-29622,-14033,-29611,-14056,-29600,-14078,-29589,-14101,-29578,-14124,-29568,-14146,-29557,-14169,-29546,-14192,-29535,-14214,-29524,-14237,-29513,-14260,-29502,-14282,-29491,-14305,-29480,-14327,-29469,-14350,-29458,-14373,-29447,-14395,-29436,-14418,-29425,-14440,-29414,-14463,-29403,-14485,-29392,-14508,-29381,-14531,-29370,-14553,-29359,-14576,-29347,-14598,-29336,-14621,-29325,-14643,-29314,-14666,-29303,-14688,-29291,-14710,-29280,-14733,-29269,-14755,-29257,-14778,-29246,-14800,-29235,-14823,-29223,-14845,-29212,-14867,-29201,-14890,-29189,-14912,-29178,-14935,-29166,-14957,-29155,-14979,-29143,-15002,-29132,-15024,-29120,-15046,-29109,-15069,-29097,-15091,-29086,-15113,-29074,-15136,-29063,-15158,-29051,-15180,-29039,-15202,-29028,-15225,-29016,-15247,-29004,-15269,-28993,-15291,-28981,-15314,-28969,-15336,-28957,-15358,-28946,-15380,-28934,-15402,-28922,-15425,-28910,-15447,-28898,-15469,-28887,-15491,-28875,-15513,-28863,-15535,-28851,-15557,-28839,-15580,-28827,-15602,-28815,-15624,-28803,-15646,-28791,-15668,-28779,-15690,-28767,-15712,-28755,-15734,-28743,-15756,-28731,-15778,-28719,-15800,-28707,-15822,-28695,-15844,-28682,-15866,-28670,-15888,-28658,-15910,-28646,-15932,-28634,-15954,-28621,-15976,-28609,-15998,-28597,-16020,-28585,-16042,-28572,-16064,-28560,-16086,-28548,-16108,-28535,-16129,-28523,-16151,-28511,-16173,-28498,-16195,-28486,-16217,-28473,-16239,-28461,-16261,-28448,-16282,-28436,-16304,-28424,-16326,-28411,-16348,-28398,-16369,-28386,-16391,-28373,-16413,-28361,-16435,-28348,-16456,-28336,-16478,-28323,-16500,-28310,-16522,-28298,-16543,-28285,-16565,-28272,-16587,-28260,-16608,-28247,-16630,-28234,-16652,-28221,-16673,-28209,-16695,-28196,-16717,-28183,-16738,-28170,-16760,-28157,-16781,-28144,-16803,-28132,-16825,-28119,-16846,-28106,-16868,-28093,-16889,-28080,-16911,-28067,-16932,-28054,-16954,-28041,-16975,-28028,-16997,-28015,-17018,-28002,-17040,-27989,-17061,-27976,-17083,-27963,-17104,-27949,-17125,-27936,-17147,-27923,-17168,-27910,-17190,-27897,-17211,-27884,-17233,-27870,-17254,-27857,-17275,-27844,-17297,-27831,-17318,-27817,-17339,-27804,-17361,-27791,-17382,-27778,-17403,-27764,-17424,-27751,-17446,-27737,-17467,-27724,-17488,-27711,-17510,-27697,-17531,-27684,-17552,-27670,-17573,-27657,-17594,-27643,-17616,-27630,-17637,-27616,-17658,-27603,-17679,-27589,-17700,-27576,-17721,-27562,-17743,-27549,-17764,-27535,-17785,-27521,-17806,-27508,-17827,-27494,-17848,-27480,-17869,-27467,-17890,-27453,-17911,-27439,-17932,-27425,-17953,-27412,-17974,-27398,-17995,-27384,-18016,-27370,-18037,-27356,-18058,-27343,-18079,-27329,-18100,-27315,-18121,-27301,-18142,-27287,-18163,-27273,-18184,-27259,-18205,-27245,-18226,-27231,-18247,-27217,-18268,-27203,-18288,-27189,-18309,-27175,-18330,-27161,-18351,-27147,-18372,-27133,-18393,-27119,-18413,-27105,-18434,-27091,-18455,-27077,-18476,-27062,-18496,-27048,-18517,-27034,-18538,-27020,-18559,-27006,-18579,-26991,-18600,-26977,-18621,-26963,-18641,-26949,-18662,-26934,-18683,-26920,-18703,-26906,-18724,-26891,-18745,-26877,-18765,-26862,-18786,-26848,-18806,-26834,-18827,-26819,-18847,-26805,-18868,-26790,-18889,-26776,-18909,-26761,-18930,-26747,-18950,-26732,-18971,-26718,-18991,-26703,-19012,-26689,-19032,-26674,-19052,-26659,-19073,-26645,-19093,-26630,-19114,-26616,-19134,-26601,-19155,-26586,-19175,-26571,-19195,-26557,-19216,-26542,-19236,-26527,-19256,-26513,-19277,-26498,-19297,-26483,-19317,-26468,-19338,-26453,-19358,-26438,-19378,-26424,-19398,-26409,-19419,-26394,-19439,-26379,-19459,-26364,-19479,-26349,-19500,-26334,-19520,-26319,-19540,-26304,-19560,-26289,-19580,-26274,-19600,-26259,-19621,-26244,-19641,-26229,-19661,-26214,-19681,-26199,-19701,-26184,-19721,-26169,-19741,-26154,-19761,-26138,-19781,-26123,-19801,-26108,-19821,-26093,-19841,-26078,-19861,-26062,-19881,-26047,-19901,-26032,-19921,-26017,-19941,-26001,-19961,-25986,-19981,-25971,-20001,-25955,-20021,-25940,-20041,-25925,-20061,-25909,-20080,-25894,-20100,-25879,-20120,-25863,-20140,-25848,-20160,-25832,-20180,-25817,-20199,-25801,-20219,-25786,-20239,-25770,-20259,-25755,-20278,-25739,-20298,-25724,-20318,-25708,-20338,-25692,-20357,-25677,-20377,-25661,-20397,-25646,-20416,-25630,-20436,-25614,-20456,-25599,-20475,-25583,-20495,-25567,-20514,-25551,-20534,-25536,-20554,-25520,-20573,-25504,-20593,-25488,-20612,-25473,-20632,-25457,-20651,-25441,-20671,-25425,-20690,-25409,-20710,-25393,-20729,-25377,-20749,-25362,-20768,-25346,-20788,-25330,-20807,-25314,-20826,-25298,-20846,-25282,-20865,-25266,-20885,-25250,-20904,-25234,-20923,-25218,-20943,-25202,-20962,-25186,-20981,-25170,-21001,-25153,-21020,-25137,-21039,-25121,-21058,-25105,-21078,-25089,-21097,-25073,-21116,-25057,-21135,-25040,-21155,-25024,-21174,-25008,-21193,-24992,-21212,-24975,-21231,-24959,-21250,-24943,-21269,-24927,-21289,-24910,-21308,-24894,-21327,-24878,-21346,-24861,-21365,-24845,-21384,-24828,-21403,-24812,-21422,-24796,-21441,-24779,-21460,-24763,-21479,-24746,-21498,-24730,-21517,-24713,-21536,-24697,-21555,-24680,-21574,-24664,-21593,-24647,-21612,-24631,-21630,-24614,-21649,-24597,-21668,-24581,-21687,-24564,-21706,-24547,-21725,-24531,-21744,-24514,-21762,-24497,-21781,-24481,-21800,-24464,-21819,-24447,-21837,-24431,-21856,-24414,-21875,-24397,-21894,-24380,-21912,-24363,-21931,-24347,-21950,-24330,-21968,-24313,-21987,-24296,-22005,-24279,-22024,-24262,-22043,-24245,-22061,-24229,-22080,-24212,-22098,-24195,-22117,-24178,-22136,-24161,-22154,-24144,-22173,-24127,-22191,-24110,-22210,-24093,-22228,-24076,-22246,-24059,-22265,-24042,-22283,-24024,-22302,-24007,-22320,-23990,-22339,-23973,-22357,-23956,-22375,-23939,-22394,-23922,-22412,-23904,-22430,-23887,-22449,-23870,-22467,-23853,-22485,-23836,-22504,-23818,-22522,-23801,-22540,-23784,-22558,-23767,-22576,-23749,-22595,-23732,-22613,-23715,-22631,-23697,-22649,-23680,-22667,-23662,-22686,-23645,-22704,-23628,-22722,-23610,-22740,-23593,-22758,-23575,-22776,-23558,-22794,-23540,-22812,-23523,-22830,-23505,-22848,-23488,-22866,-23470,-22884,-23453,-22902,-23435,-22920,-23418,-22938,-23400,-22956,-23383,-22974,-23365,-22992,-23347,-23010,-23330,-23028,-23312,-23046,-23294,-23063,-23277,-23081,-23259,-23099,-23241,-23117,-23224,-23135,-23206,-23152,-23188,-23170,-23170,-23188,-23152,-23206,-23135,-23224,-23117,-23241,-23099,-23259,-23081,-23277,-23063,-23294,-23046,-23312,-23028,-23330,-23010,-23347,-22992,-23365,-22974,-23383,-22956,-23400,-22938,-23418,-22920,-23435,-22902,-23453,-22884,-23470,-22866,-23488,-22848,-23505,-22830,-23523,-22812,-23540,-22794,-23558,-22776,-23575,-22758,-23593,-22740,-23610,-22722,-23628,-22704,-23645,-22686,-23662,-22667,-23680,-22649,-23697,-22631,-23715,-22613,-23732,-22595,-23749,-22576,-23767,-22558,-23784,-22540,-23801,-22522,-23818,-22504,-23836,-22485,-23853,-22467,-23870,-22449,-23887,-22430,-23904,-22412,-23922,-22394,-23939,-22375,-23956,-22357,-23973,-22339,-23990,-22320,-24007,-22302,-24024,-22283,-24042,-22265,-24059,-22246,-24076,-22228,-24093,-22210,-24110,-22191,-24127,-22173,-24144,-22154,-24161,-22136,-24178,-22117,-24195,-22098,-24212,-22080,-24229,-22061,-24245,-22043,-24262,-22024,-24279,-22005,-24296,-21987,-24313,-21968,-24330,-21950,-24347,-21931,-24363,-21912,-24380,-21894,-24397,-21875,-24414,-21856,-24431,-21837,-24447,-21819,-24464,-21800,-24481,-21781,-24497,-21762,-24514,-21744,-24531,-21725,-24547,-21706,-24564,-21687,-24581,-21668,-24597,-21649,-24614,-21630,-24631,-21612,-24647,-21593,-24664,-21574,-24680,-21555,-24697,-21536,-24713,-21517,-24730,-21498,-24746,-21479,-24763,-21460,-24779,-21441,-24796,-21422,-24812,-21403,-24828,-21384,-24845,-21365,-24861,-21346,-24878,-21327,-24894,-21308,-24910,-21289,-24927,-21269,-24943,-21250,-24959,-21231,-24975,-21212,-24992,-21193,-25008,-21174,-25024,-21155,-25040,-21135,-25057,-21116,-25073,-21097,-25089,-21078,-25105,-21058,-25121,-21039,-25137,-21020,-25153,-21001,-25170,-20981,-25186,-20962,-25202,-20943,-25218,-20923,-25234,-20904,-25250,-20885,-25266,-20865,-25282,-20846,-25298,-20826,-25314,-20807,-25330,-20788,-25346,-20768,-25362,-20749,-25377,-20729,-25393,-20710,-25409,-20690,-25425,-20671,-25441,-20651,-25457,-20632,-25473,-20612,-25488,-20593,-25504,-20573,-25520,-20554,-25536,-20534,-25551,-20514,-25567,-20495,-25583,-20475,-25599,-20456,-25614,-20436,-25630,-20416,-25646,-20397,-25661,-20377,-25677,-20357,-25692,-20338,-25708,-20318,-25724,-20298,-25739,-20278,-25755,-20259,-25770,-20239,-25786,-20219,-25801,-20199,-25817,-20180,-25832,-20160,-25848,-20140,-25863,-20120,-25879,-20100,-25894,-20080,-25909,-20061,-25925,-20041,-25940,-20021,-25955,-20001,-25971,-19981,-25986,-19961,-26001,-19941,-26017,-19921,-26032,-19901,-26047,-19881,-26062,-19861,-26078,-19841,-26093,-19821,-26108,-19801,-26123,-19781,-26138,-19761,-26154,-19741,-26169,-19721,-26184,-19701,-26199,-19681,-26214,-19661,-26229,-19641,-26244,-19621,-26259,-19600,-26274,-19580,-26289,-19560,-26304,-19540,-26319,-19520,-26334,-19500,-26349,-19479,-26364,-19459,-26379,-19439,-26394,-19419,-26409,-19398,-26424,-19378,-26438,-19358,-26453,-19338,-26468,-19317,-26483,-19297,-26498,-19277,-26513,-19256,-26527,-19236,-26542,-19216,-26557,-19195,-26571,-19175,-26586,-19155,-26601,-19134,-26616,-19114,-26630,-19093,-26645,-19073,-26659,-19052,-26674,-19032,-26689,-19012,-26703,-18991,-26718,-18971,-26732,-18950,-26747,-18930,-26761,-18909,-26776,-18889,-26790,-18868,-26805,-18847,-26819,-18827,-26834,-18806,-26848,-18786,-26862,-18765,-26877,-18745,-26891,-18724,-26906,-18703,-26920,-18683,-26934,-18662,-26949,-18641,-26963,-18621,-26977,-18600,-26991,-18579,-27006,-18559,-27020,-18538,-27034,-18517,-27048,-18496,-27062,-18476,-27077,-18455,-27091,-18434,-27105,-18413,-27119,-18393,-27133,-18372,-27147,-18351,-27161,-18330,-27175,-18309,-27189,-18288,-27203,-18268,-27217,-18247,-27231,-18226,-27245,-18205,-27259,-18184,-27273,-18163,-27287,-18142,-27301,-18121,-27315,-18100,-27329,-18079,-27343,-18058,-27356,-18037,-27370,-18016,-27384,-17995,-27398,-17974,-27412,-17953,-27425,-17932,-27439,-17911,-27453,-17890,-27467,-17869,-27480,-17848,-27494,-17827,-27508,-17806,-27521,-17785,-27535,-17764,-27549,-17743,-27562,-17721,-27576,-17700,-27589,-17679,-27603,-17658,-27616,-17637,-27630,-17616,-27643,-17594,-27657,-17573,-27670,-17552,-27684,-17531,-27697,-17510,-27711,-17488,-27724,-17467,-27737,-17446,-27751,-17424,-27764,-17403,-27778,-17382,-27791,-17361,-27804,-17339,-27817,-17318,-27831,-17297,-27844,-17275,-27857,-17254,-27870,-17233,-27884,-17211,-27897,-17190,-27910,-17168,-27923,-17147,-27936,-17125,-27949,-17104,-27963,-17083,-27976,-17061,-27989,-17040,-28002,-17018,-28015,-16997,-28028,-16975,-28041,-16954,-28054,-16932,-28067,-16911,-28080,-16889,-28093,-16868,-28106,-16846,-28119,-16825,-28132,-16803,-28144,-16781,-28157,-16760,-28170,-16738,-28183,-16717,-28196,-16695,-28209,-16673,-28221,-16652,-28234,-16630,-28247,-16608,-28260,-16587,-28272,-16565,-28285,-16543,-28298,-16522,-28310,-16500,-28323,-16478,-28336,-16456,-28348,-16435,-28361,-16413,-28373,-16391,-28386,-16369,-28398,-16348,-28411,-16326,-28424,-16304,-28436,-16282,-28448,-16261,-28461,-16239,-28473,-16217,-28486,-16195,-28498,-16173,-28511,-16151,-28523,-16129,-28535,-16108,-28548,-16086,-28560,-16064,-28572,-16042,-28585,-16020,-28597,-15998,-28609,-15976,-28621,-15954,-28634,-15932,-28646,-15910,-28658,-15888,-28670,-15866,-28682,-15844,-28695,-15822,-28707,-15800,-28719,-15778,-28731,-15756,-28743,-15734,-28755,-15712,-28767,-15690,-28779,-15668,-28791,-15646,-28803,-15624,-28815,-15602,-28827,-15580,-28839,-15557,-28851,-15535,-28863,-15513,-28875,-15491,-28887,-15469,-28898,-15447,-28910,-15425,-28922,-15402,-28934,-15380,-28946,-15358,-28957,-15336,-28969,-15314,-28981,-15291,-28993,-15269,-29004,-15247,-29016,-15225,-29028,-15202,-29039,-15180,-29051,-15158,-29063,-15136,-29074,-15113,-29086,-15091,-29097,-15069,-29109,-15046,-29120,-15024,-29132,-15002,-29143,-14979,-29155,-14957,-29166,-14935,-29178,-14912,-29189,-14890,-29201,-14867,-29212,-14845,-29223,-14823,-29235,-14800,-29246,-14778,-29257,-14755,-29269,-14733,-29280,-14710,-29291,-14688,-29303,-14666,-29314,-14643,-29325,-14621,-29336,-14598,-29347,-14576,-29359,-14553,-29370,-14531,-29381,-14508,-29392,-14485,-29403,-14463,-29414,-14440,-29425,-14418,-29436,-14395,-29447,-14373,-29458,-14350,-29469,-14327,-29480,-14305,-29491,-14282,-29502,-14260,-29513,-14237,-29524,-14214,-29535,-14192,-29546,-14169,-29557,-14146,-29568,-14124,-29578,-14101,-29589,-14078,-29600,-14056,-29611,-14033,-29622,-14010,-29632,-13987,-29643,-13965,-29654,-13942,-29664,-13919,-29675,-13896,-29686,-13874,-29696,-13851,-29707,-13828,-29718,-13805,-29728,-13783,-29739,-13760,-29749,-13737,-29760,-13714,-29770,-13691,-29781,-13668,-29791,-13646,-29802,-13623,-29812,-13600,-29823,-13577,-29833,-13554,-29843,-13531,-29854,-13508,-29864,-13486,-29874,-13463,-29885,-13440,-29895,-13417,-29905,-13394,-29916,-13371,-29926,-13348,-29936,-13325,-29946,-13302,-29956,-13279,-29967,-13256,-29977,-13233,-29987,-13210,-29997,-13187,-30007,-13164,-30017,-13141,-30027,-13118,-30037,-13095,-30047,-13072,-30057,-13049,-30067,-13026,-30077,-13003,-30087,-12980,-30097,-12957,-30107,-12934,-30117,-12910,-30127,-12887,-30137,-12864,-30147,-12841,-30157,-12818,-30166,-12795,-30176,-12772,-30186,-12749,-30196,-12725,-30206,-12702,-30215,-12679,-30225,-12656,-30235,-12633,-30244,-12610,-30254,-12586,-30264,-12563,-30273,-12540,-30283,-12517,-30292,-12493,-30302,-12470,-30312,-12447,-30321,-12424,-30331,-12400,-30340,-12377,-30350,-12354,-30359,-12331,-30369,-12307,-30378,-12284,-30387,-12261,-30397,-12237,-30406,-12214,-30416,-12191,-30425,-12167,-30434,-12144,-30443,-12121,-30453,-12097,-30462,-12074,-30471,-12051,-30481,-12027,-30490,-12004,-30499,-11981,-30508,-11957,-30517,-11934,-30526,-11910,-30536,-11887,-30545,-11863,-30554,-11840,-30563,-11817,-30572,-11793,-30581,-11770,-30590,-11746,-30599,-11723,-30608,-11699,-30617,-11676,-30626,-11652,-30635,-11629,-30644,-11605,-30653,-11582,-30661,-11558,-30670,-11535,-30679,-11511,-30688,-11488,-30697,-11464,-30706,-11441,-30714,-11417,-30723,-11394,-30732,-11370,-30740,-11346,-30749,-11323,-30758,-11299,-30767,-11276,-30775,-11252,-30784,-11228,-30792,-11205,-30801,-11181,-30810,-11158,-30818,-11134,-30827,-11110,-30835,-11087,-30844,-11063,-30852,-11039,-30861,-11016,-30869,-10992,-30877,-10968,-30886,-10945,-30894,-10921,-30903,-10897,-30911,-10874,-30919,-10850,-30928,-10826,-30936,-10802,-30944,-10779,-30952,-10755,-30961,-10731,-30969,-10707,-30977,-10684,-30985,-10660,-30993,-10636,-31002,-10612,-31010,-10589,-31018,-10565,-31026,-10541,-31034,-10517,-31042,-10493,-31050,-10470,-31058,-10446,-31066,-10422,-31074,-10398,-31082,-10374,-31090,-10350,-31098,-10327,-31106,-10303,-31114,-10279,-31122,-10255,-31129,-10231,-31137,-10207,-31145,-10183,-31153,-10160,-31161,-10136,-31168,-10112,-31176,-10088,-31184,-10064,-31192,-10040,-31199,-10016,-31207,-9992,-31215,-9968,-31222,-9944,-31230,-9920,-31237,-9896,-31245,-9872,-31253,-9848,-31260,-9824,-31268,-9800,-31275,-9776,-31283,-9752,-31290,-9728,-31298,-9704,-31305,-9680,-31312,-9656,-31320,-9632,-31327,-9608,-31335,-9584,-31342,-9560,-31349,-9536,-31357,-9512,-31364,-9488,-31371,-9464,-31378,-9440,-31386,-9416,-31393,-9392,-31400,-9368,-31407,-9344,-31414,-9320,-31421,-9296,-31429,-9271,-31436,-9247,-31443,-9223,-31450,-9199,-31457,-9175,-31464,-9151,-31471,-9127,-31478,-9103,-31485,-9078,-31492,-9054,-31499,-9030,-31506,-9006,-31513,-8982,-31519,-8958,-31526,-8933,-31533,-8909,-31540,-8885,-31547,-8861,-31554,-8837,-31560,-8813,-31567,-8788,-31574,-8764,-31581,-8740,-31587,-8716,-31594,-8691,-31601,-8667,-31607,-8643,-31614,-8619,-31620,-8594,-31627,-8570,-31634,-8546,-31640,-8522,-31647,-8497,-31653,-8473,-31660,-8449,-31666,-8425,-31673,-8400,-31679,-8376,-31685,-8352,-31692,-8327,-31698,-8303,-31705,-8279,-31711,-8254,-31717,-8230,-31724,-8206,-31730,-8181,-31736,-8157,-31742,-8133,-31749,-8108,-31755,-8084,-31761,-8060,-31767,-8035,-31773,-8011,-31779,-7987,-31786,-7962,-31792,-7938,-31798,-7913,-31804,-7889,-31810,-7865,-31816,-7840,-31822,-7816,-31828,-7791,-31834,-7767,-31840,-7743,-31846,-7718,-31852,-7694,-31857,-7669,-31863,-7645,-31869,-7620,-31875,-7596,-31881,-7572,-31887,-7547,-31892,-7523,-31898,-7498,-31904,-7474,-31910,-7449,-31915,-7425,-31921,-7400,-31927,-7376,-31932,-7351,-31938,-7327,-31944,-7302,-31949,-7278,-31955,-7253,-31960,-7229,-31966,-7204,-31971,-7180,-31977,-7155,-31982,-7131,-31988,-7106,-31993,-7082,-31999,-7057,-32004,-7033,-32009,-7008,-32015,-6983,-32020,-6959,-32025,-6934,-32031,-6910,-32036,-6885,-32041,-6861,-32047,-6836,-32052,-6812,-32057,-6787,-32062,-6762,-32067,-6738,-32073,-6713,-32078,-6689,-32083,-6664,-32088,-6639,-32093,-6615,-32098,-6590,-32103,-6565,-32108,-6541,-32113,-6516,-32118,-6492,-32123,-6467,-32128,-6442,-32133,-6418,-32138,-6393,-32143,-6368,-32148,-6344,-32153,-6319,-32157,-6294,-32162,-6270,-32167,-6245,-32172,-6220,-32177,-6196,-32181,-6171,-32186,-6146,-32191,-6122,-32195,-6097,-32200,-6072,-32205,-6048,-32209,-6023,-32214,-5998,-32219,-5973,-32223,-5949,-32228,-5924,-32232,-5899,-32237,-5875,-32241,-5850,-32246,-5825,-32250,-5800,-32255,-5776,-32259,-5751,-32263,-5726,-32268,-5701,-32272,-5677,-32276,-5652,-32281,-5627,-32285,-5602,-32289,-5578,-32294,-5553,-32298,-5528,-32302,-5503,-32306,-5479,-32311,-5454,-32315,-5429,-32319,-5404,-32323,-5379,-32327,-5355,-32331,-5330,-32335,-5305,-32339,-5280,-32343,-5255,-32347,-5231,-32351,-5206,-32355,-5181,-32359,-5156,-32363,-5131,-32367,-5107,-32371,-5082,-32375,-5057,-32379,-5032,-32383,-5007,-32387,-4982,-32390,-4958,-32394,-4933,-32398,-4908,-32402,-4883,-32405,-4858,-32409,-4833,-32413,-4808,-32417,-4784,-32420,-4759,-32424,-4734,-32427,-4709,-32431,-4684,-32435,-4659,-32438,-4634,-32442,-4609,-32445,-4585,-32449,-4560,-32452,-4535,-32456,-4510,-32459,-4485,-32463,-4460,-32466,-4435,-32469,-4410,-32473,-4385,-32476,-4360,-32479,-4336,-32483,-4311,-32486,-4286,-32489,-4261,-32493,-4236,-32496,-4211,-32499,-4186,-32502,-4161,-32505,-4136,-32509,-4111,-32512,-4086,-32515,-4061,-32518,-4036,-32521,-4012,-32524,-3987,-32527,-3962,-32530,-3937,-32533,-3912,-32536,-3887,-32539,-3862,-32542,-3837,-32545,-3812,-32548,-3787,-32551,-3762,-32554,-3737,-32557,-3712,-32559,-3687,-32562,-3662,-32565,-3637,-32568,-3612,-32571,-3587,-32573,-3562,-32576,-3537,-32579,-3512,-32581,-3487,-32584,-3462,-32587,-3437,-32589,-3412,-32592,-3387,-32595,-3362,-32597,-3337,-32600,-3312,-32602,-3287,-32605,-3262,-32607,-3237,-32610,-3212,-32612,-3187,-32615,-3162,-32617,-3137,-32619,-3112,-32622,-3087,-32624,-3062,-32626,-3037,-32629,-3012,-32631,-2987,-32633,-2962,-32636,-2937,-32638,-2912,-32640,-2887,-32642,-2862,-32645,-2837,-32647,-2812,-32649,-2787,-32651,-2762,-32653,-2737,-32655,-2712,-32657,-2687,-32659,-2662,-32661,-2637,-32663,-2611,-32665,-2586,-32667,-2561,-32669,-2536,-32671,-2511,-32673,-2486,-32675,-2461,-32677,-2436,-32679,-2411,-32681,-2386,-32682,-2361,-32684,-2336,-32686,-2311,-32688,-2286,-32689,-2261,-32691,-2236,-32693,-2210,-32695,-2185,-32696,-2160,-32698,-2135,-32700,-2110,-32701,-2085,-32703,-2060,-32704,-2035,-32706,-2010,-32707,-1985,-32709,-1960,-32710,-1935,-32712,-1909,-32713,-1884,-32715,-1859,-32716,-1834,-32718,-1809,-32719,-1784,-32720,-1759,-32722,-1734,-32723,-1709,-32724,-1684,-32726,-1659,-32727,-1633,-32728,-1608,-32729,-1583,-32730,-1558,-32732,-1533,-32733,-1508,-32734,-1483,-32735,-1458,-32736,-1433,-32737,-1407,-32738,-1382,-32739,-1357,-32740,-1332,-32741,-1307,-32742,-1282,-32743,-1257,-32744,-1232,-32745,-1207,-32746,-1181,-32747,-1156,-32748,-1131,-32749,-1106,-32750,-1081,-32751,-1056,-32751,-1031,-32752,-1006,-32753,-981,-32754,-955,-32754,-930,-32755,-905,-32756,-880,-32756,-855,-32757,-830,-32758,-805,-32758,-780,-32759,-754,-32759,-729,-32760,-704,-32760,-679,-32761,-654,-32761,-629,-32762,-604,-32762,-579,-32763,-553,-32763,-528,-32764,-503,-32764,-478,-32764,-453,-32765,-428,-32765,-403,-32765,-377,-32766,-352,-32766,-327,-32766,-302,-32766,-277,-32767,-252,-32767,-227,-32767,-202,-32767,-176,-32767,-151,-32767,-126,-32767,-101,-32767,-76,-32767,-51,-32767,-26};

void dft8192(int16_t *x,int16_t *y,int scale)
{

3001 3002 3003
  simdshort_q15_t xtmp[4096],*xtmpp,*x64 = (simdshort_q15_t *)x;
  simd_q15_t ytmp[1024],*tw8192_128p=(simd_q15_t *)tw8192,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
3004
  int i;
3005
  simd_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16(ONE_OVER_SQRT2_Q15);
3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062
  
  xtmpp = xtmp;

  for (i=0; i<64; i++) {
    transpose4_ooff(x64  ,xtmpp,2048);
    transpose4_ooff(x64+2,xtmpp+1,2048);
    transpose4_ooff(x64+4,xtmpp+2,2048);
    transpose4_ooff(x64+6,xtmpp+3,2048);
    transpose4_ooff(x64+8,xtmpp+4,2048);
    transpose4_ooff(x64+10,xtmpp+5,2048);
    transpose4_ooff(x64+12,xtmpp+6,2048);
    transpose4_ooff(x64+14,xtmpp+7,2048);
    transpose4_ooff(x64+16,xtmpp+8,2048);
    transpose4_ooff(x64+18,xtmpp+9,2048);
    transpose4_ooff(x64+20,xtmpp+10,2048);
    transpose4_ooff(x64+22,xtmpp+11,2048);
    transpose4_ooff(x64+24,xtmpp+12,2048);
    transpose4_ooff(x64+26,xtmpp+13,2048);
    transpose4_ooff(x64+28,xtmpp+14,2048);
    transpose4_ooff(x64+30,xtmpp+15,2048);
    transpose4_ooff(x64+32,xtmpp+16,2048);
    transpose4_ooff(x64+34,xtmpp+17,2048);
    transpose4_ooff(x64+36,xtmpp+18,2048);
    transpose4_ooff(x64+38,xtmpp+19,2048);
    transpose4_ooff(x64+40,xtmpp+20,2048);
    transpose4_ooff(x64+42,xtmpp+21,2048);
    transpose4_ooff(x64+44,xtmpp+22,2048);
    transpose4_ooff(x64+46,xtmpp+23,2048);
    transpose4_ooff(x64+48,xtmpp+24,2048);
    transpose4_ooff(x64+50,xtmpp+25,2048);
    transpose4_ooff(x64+52,xtmpp+26,2048);
    transpose4_ooff(x64+54,xtmpp+27,2048);
    transpose4_ooff(x64+56,xtmpp+28,2048);
    transpose4_ooff(x64+58,xtmpp+29,2048);
    transpose4_ooff(x64+60,xtmpp+30,2048);
    transpose4_ooff(x64+62,xtmpp+31,2048);
    x64+=64;
    xtmpp+=32;
  }

  dft4096((int16_t*)(xtmp),(int16_t*)ytmp,1);
  dft4096((int16_t*)(xtmp+2048),(int16_t*)(ytmp+1024),1);


  for (i=0; i<1024; i++) {
    bfly2(ytmpp,ytmpp+1024,
          y128p,y128p+1024,
          tw8192_128p);
    tw8192_128p++;
    y128p++;
    ytmpp++;
  }

  if (scale>0) {
    y128p = y128;

    for (i=0; i<128; i++) {
3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078
      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128);
      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128);
      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128);
      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128);
      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128);
      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128);
      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128);
      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128);
      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128);
      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128);
      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128);
      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128);
      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128);
      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128);
      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128);
      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128);
3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090
      y128p+=16;
    }
  }

  _mm_empty();
  _m_empty();

}

void idft8192(int16_t *x,int16_t *y,int scale)
{

3091 3092 3093
  simdshort_q15_t xtmp[4096],*xtmpp,*x64 = (simdshort_q15_t *)x;
  simd_q15_t ytmp[2048],*tw8192_128p=(simd_q15_t *)tw8192,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
  simd_q15_t *ytmpp = &ytmp[0];
3094
  int i;
3095
  simd_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16(ONE_OVER_SQRT2_Q15);
3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152
  
  xtmpp = xtmp;

  for (i=0; i<64; i++) {
    transpose4_ooff(x64  ,xtmpp,2048);
    transpose4_ooff(x64+2,xtmpp+1,2048);
    transpose4_ooff(x64+4,xtmpp+2,2048);
    transpose4_ooff(x64+6,xtmpp+3,2048);
    transpose4_ooff(x64+8,xtmpp+4,2048);
    transpose4_ooff(x64+10,xtmpp+5,2048);
    transpose4_ooff(x64+12,xtmpp+6,2048);
    transpose4_ooff(x64+14,xtmpp+7,2048);
    transpose4_ooff(x64+16,xtmpp+8,2048);
    transpose4_ooff(x64+18,xtmpp+9,2048);
    transpose4_ooff(x64+20,xtmpp+10,2048);
    transpose4_ooff(x64+22,xtmpp+11,2048);
    transpose4_ooff(x64+24,xtmpp+12,2048);
    transpose4_ooff(x64+26,xtmpp+13,2048);
    transpose4_ooff(x64+28,xtmpp+14,2048);
    transpose4_ooff(x64+30,xtmpp+15,2048);
    transpose4_ooff(x64+32,xtmpp+16,2048);
    transpose4_ooff(x64+34,xtmpp+17,2048);
    transpose4_ooff(x64+36,xtmpp+18,2048);
    transpose4_ooff(x64+38,xtmpp+19,2048);
    transpose4_ooff(x64+40,xtmpp+20,2048);
    transpose4_ooff(x64+42,xtmpp+21,2048);
    transpose4_ooff(x64+44,xtmpp+22,2048);
    transpose4_ooff(x64+46,xtmpp+23,2048);
    transpose4_ooff(x64+48,xtmpp+24,2048);
    transpose4_ooff(x64+50,xtmpp+25,2048);
    transpose4_ooff(x64+52,xtmpp+26,2048);
    transpose4_ooff(x64+54,xtmpp+27,2048);
    transpose4_ooff(x64+56,xtmpp+28,2048);
    transpose4_ooff(x64+58,xtmpp+29,2048);
    transpose4_ooff(x64+60,xtmpp+30,2048);
    transpose4_ooff(x64+62,xtmpp+31,2048);
    x64+=64;
    xtmpp+=32;
  }

  idft4096((int16_t*)(xtmp),(int16_t*)ytmp,1);
  idft4096((int16_t*)(xtmp+2048),(int16_t*)(ytmp+1024),1);


  for (i=0; i<1024; i++) {
    ibfly2(ytmpp,ytmpp+1024,
           y128p,y128p+1024,
           tw8192_128p);
    tw8192_128p++;
    y128p++;
    ytmpp++;
  }

  if (scale>0) {
    y128p = y128;

    for (i=0; i<128; i++) {
3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168
      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128);
      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128);
      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128);
      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128);
      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128);
      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128);
      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128);
      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128);
      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128);
      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128);
      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128);
      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128);
      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128);
      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128);
      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128);
      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128);
3169 3170 3171 3172 3173 3174 3175 3176 3177
      y128p+=16;
    }
  }

  _mm_empty();
  _m_empty();

}

3178 3179
#include "twiddle1536.h"
// 512 x 3
3180
void idft1536(int16_t *input, int16_t *output)
3181
{
3182
  int i,i2,j;
3183 3184
  uint32_t tmp[3][512 ]__attribute__((aligned(16)));
  uint32_t tmpo[3][512] __attribute__((aligned(16)));
3185 3186
  simd_q15_t *y128p=(simd_q15_t*)output;
  simd_q15_t ONE_OVER_SQRT3_Q15_128 = set1_int16(ONE_OVER_SQRT3_Q15);
3187

3188 3189 3190 3191 3192
  for (i=0,j=0; i<512; i++) {
    tmp[0][i] = ((uint32_t *)input)[j++];
    tmp[1][i] = ((uint32_t *)input)[j++];
    tmp[2][i] = ((uint32_t *)input)[j++];
  }
3193

3194 3195 3196
  idft512((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
  idft512((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
  idft512((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
3197 3198

  for (i=0,i2=0; i<1024; i+=8,i2+=4)  {
3199 3200 3201
    ibfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),((simd_q15_t*)&tmpo[2][i2]),
          (simd_q15_t*)(output+i),(simd_q15_t*)(output+1024+i),(simd_q15_t*)(output+2048+i),
          (simd_q15_t*)(twa1536+i),(simd_q15_t*)(twb1536+i));
3202
  }
3203

3204

3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224
  for (i=0; i<24; i++) {
    y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128);
    y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128);
    y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128);
    y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128);
    y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128);
    y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128);
    y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128);
    y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128);
    y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128);
    y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128);
    y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128);
    y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128);
    y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128);
    y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128);
    y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128);
    y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128);
    y128p+=16;
  }

3225 3226 3227 3228 3229
  _mm_empty();
  _m_empty();

}

3230
void dft1536(int16_t *input, int16_t *output)
3231
{
3232
  int i,i2,j;
3233 3234
  uint32_t tmp[3][512] __attribute__((aligned(16)));
  uint32_t tmpo[3][512] __attribute__((aligned(16)));
3235

3236
  for (i=0,j=0; i<512; i++) {
3237 3238 3239 3240
    tmp[0][i] = ((uint32_t *)input)[j++];
    tmp[1][i] = ((uint32_t *)input)[j++];
    tmp[2][i] = ((uint32_t *)input)[j++];
  }
3241

3242 3243 3244
  dft512((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
  dft512((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
  dft512((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
3245

3246
  /*
3247
  for (i=1; i<512; i++) {
3248 3249 3250
    tmpo[0][i] = tmpo[0][i<<1];
    tmpo[1][i] = tmpo[1][i<<1];
    tmpo[2][i] = tmpo[2][i<<1];
3251
    }*/
3252

3253 3254 3255
  //  write_output("out0.m","o0",tmpo[0],2048,1,1);
  //  write_output("out1.m","o1",tmpo[1],2048,1,1);
  //  write_output("out2.m","o2",tmpo[2],2048,1,1);
3256
  for (i=0,i2=0; i<1024; i+=8,i2+=4)  {
3257 3258 3259
    bfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),(simd_q15_t*)(&tmpo[2][i2]),
          (simd_q15_t*)(output+i),(simd_q15_t*)(output+1024+i),(simd_q15_t*)(output+2048+i),
          (simd_q15_t*)(twa1536+i),(simd_q15_t*)(twb1536+i));
3260
  }
3261

3262 3263 3264 3265 3266 3267
  _mm_empty();
  _m_empty();

}

// 1024 x 3
3268
void dft3072(int16_t *input, int16_t *output)
3269
{
3270 3271 3272

}

3273
void idft3072(int16_t *input, int16_t *output)
3274
{
3275 3276 3277 3278 3279

}

#include "twiddle6144.h"

3280
void idft6144(int16_t *input, int16_t *output)
3281
{
3282
  int i,i2,j;
3283 3284
  uint32_t tmp[3][2048] __attribute__((aligned(16)));
  uint32_t tmpo[3][2048] __attribute__((aligned(16)));
3285

3286 3287 3288 3289
  for (i=0,j=0; i<2048; i++) {
    tmp[0][i] = ((uint32_t *)input)[j++];
    tmp[1][i] = ((uint32_t *)input)[j++];
    tmp[2][i] = ((uint32_t *)input)[j++];
3290
  }
3291

3292 3293 3294
  idft2048((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
  idft2048((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
  idft2048((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
3295

3296
  /*
3297
  for (i=1; i<2048; i++) {
3298 3299 3300
    tmpo[0][i] = tmpo[0][i<<1];
    tmpo[1][i] = tmpo[1][i<<1];
    tmpo[2][i] = tmpo[2][i<<1];
3301
    }*/
3302 3303 3304 3305 3306

  //  write_output("in.m","in",input,6144,1,1);
  //  write_output("out0.m","o0",tmpo[0],2048,1,1);
  //  write_output("out1.m","o1",tmpo[1],2048,1,1);
  //  write_output("out2.m","o2",tmpo[2],2048,1,1);
3307 3308

  for (i=0,i2=0; i<4096; i+=8,i2+=4)  {
3309 3310 3311
    ibfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),((simd_q15_t*)&tmpo[2][i2]),
	   (simd_q15_t*)(output+i),(simd_q15_t*)(output+4096+i),(simd_q15_t*)(output+8192+i),
	   (simd_q15_t*)(twa6144+i),(simd_q15_t*)(twb6144+i));
3312
  }
3313 3314

  //  write_output("out.m","out",output,6144,1,1);
3315 3316 3317 3318 3319 3320
  _mm_empty();
  _m_empty();

}


3321
void dft6144(int16_t *input, int16_t *output)
3322
{
3323
  int i,i2,j;
3324 3325
  uint32_t tmp[3][2048] __attribute__((aligned(16)));
  uint32_t tmpo[3][2048] __attribute__((aligned(16)));
3326

3327
  for (i=0,j=0; i<2048; i++) {
3328 3329 3330 3331
    tmp[0][i] = ((uint32_t *)input)[j++];
    tmp[1][i] = ((uint32_t *)input)[j++];
    tmp[2][i] = ((uint32_t *)input)[j++];
  }
3332

3333 3334 3335
  dft2048((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
  dft2048((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
  dft2048((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
3336

3337
  /*
3338
  for (i=1; i<2048; i++) {
3339 3340 3341
    tmpo[0][i] = tmpo[0][i<<1];
    tmpo[1][i] = tmpo[1][i<<1];
    tmpo[2][i] = tmpo[2][i<<1];
3342
    }*/
3343

3344 3345 3346
  //  write_output("out0.m","o0",tmpo[0],2048,1,1);
  //  write_output("out1.m","o1",tmpo[1],2048,1,1);
  //  write_output("out2.m","o2",tmpo[2],2048,1,1);
3347
  for (i=0,i2=0; i<4096; i+=8,i2+=4)  {
3348 3349 3350
    bfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),(simd_q15_t*)(&tmpo[2][i2]),
          (simd_q15_t*)(output+i),(simd_q15_t*)(output+4096+i),(simd_q15_t*)(output+8192+i),
          (simd_q15_t*)(twa6144+i),(simd_q15_t*)(twb6144+i));
3351
  }
3352

3353 3354 3355 3356 3357 3358 3359 3360
  _mm_empty();
  _m_empty();

}

#include "twiddle12288.h"

// 4096 x 3
3361
void dft12288(int16_t *input, int16_t *output)
3362
{
3363
  int i,i2,j;
3364 3365
  uint32_t tmp[3][4096] __attribute__((aligned(16)));
  uint32_t tmpo[3][4096] __attribute__((aligned(16)));
3366

3367
  for (i=0,j=0; i<4096; i++) {
3368 3369 3370 3371
    tmp[0][i] = ((uint32_t *)input)[j++];
    tmp[1][i] = ((uint32_t *)input)[j++];
    tmp[2][i] = ((uint32_t *)input)[j++];
  }
3372

3373 3374 3375 3376
  dft4096((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
  dft4096((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
  dft4096((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
  /*
3377
  for (i=1; i<4096; i++) {
3378 3379 3380
    tmpo[0][i] = tmpo[0][i<<1];
    tmpo[1][i] = tmpo[1][i<<1];
    tmpo[2][i] = tmpo[2][i<<1];
3381
    }*/
3382

3383 3384 3385
  //  write_output("out0.m","o0",tmpo[0],4096,1,1);
  //  write_output("out1.m","o1",tmpo[1],4096,1,1);
  //  write_output("out2.m","o2",tmpo[2],4096,1,1);
3386
  for (i=0,i2=0; i<8192; i+=8,i2+=4)  {
3387 3388 3389
    bfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),(simd_q15_t*)(&tmpo[2][i2]),
          (simd_q15_t*)(output+i),(simd_q15_t*)(output+8192+i),(simd_q15_t*)(output+16384+i),
          (simd_q15_t*)(twa12288+i),(simd_q15_t*)(twb12288+i));
3390
  }
3391

3392 3393 3394 3395 3396
  _mm_empty();
  _m_empty();

}

3397
void idft12288(int16_t *input, int16_t *output)
3398
{
3399
  int i,i2,j;
3400 3401
  uint32_t tmp[3][4096] __attribute__((aligned(16)));
  uint32_t tmpo[3][4096] __attribute__((aligned(16)));
3402

3403 3404 3405 3406
  for (i=0,j=0; i<4096; i++) {
    tmp[0][i] = ((uint32_t *)input)[j++];
    tmp[1][i] = ((uint32_t *)input)[j++];
    tmp[2][i] = ((uint32_t *)input)[j++];
3407 3408
  }

3409

3410 3411 3412 3413 3414 3415 3416 3417 3418
  idft4096((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
  idft4096((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
  idft4096((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
  /*
    write_output("in.m","in",input,12288,1,1);
    write_output("out0.m","o0",tmpo[0],4096,1,1);
    write_output("out1.m","o1",tmpo[1],4096,1,1);
    write_output("out2.m","o2",tmpo[2],4096,1,1);
  */
3419
  for (i=0,i2=0; i<8192; i+=8,i2+=4)  {
3420 3421 3422
    ibfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),((simd_q15_t*)&tmpo[2][i2]),
          (simd_q15_t*)(output+i),(simd_q15_t*)(output+8192+i),(simd_q15_t*)(output+16384+i),
          (simd_q15_t*)(twa12288+i),(simd_q15_t*)(twb12288+i));
3423
  }
3424

3425 3426 3427
  _mm_empty();
  _m_empty();

3428
  //  write_output("out.m","out",output,6144,1,1);
3429 3430 3431
}

// 6144 x 3
3432
void dft18432(int16_t *input, int16_t *output)
3433
{
3434 3435 3436

}

3437
void idft18432(int16_t *input, int16_t *output)
3438
{
3439 3440 3441 3442 3443

}

#include "twiddle24576.h"
// 8192 x 3
3444
void dft24576(int16_t *input, int16_t *output)
3445
{
3446
  int i,i2,j;
3447 3448
  uint32_t tmp[3][8192] __attribute__((aligned(16)));
  uint32_t tmpo[3][8192] __attribute__((aligned(16)));
3449

3450
  for (i=0,j=0; i<8192; i++) {
3451 3452 3453 3454
    tmp[0][i] = ((uint32_t *)input)[j++];
    tmp[1][i] = ((uint32_t *)input)[j++];
    tmp[2][i] = ((uint32_t *)input)[j++];
  }
3455

3456 3457 3458 3459
  dft8192((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
  dft8192((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
  dft8192((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
  /*
3460
  for (i=1; i<8192; i++) {
3461 3462 3463
    tmpo[0][i] = tmpo[0][i<<1];
    tmpo[1][i] = tmpo[1][i<<1];
    tmpo[2][i] = tmpo[2][i<<1];
3464
    }*/
3465

3466 3467 3468
  //   write_output("out0.m","o0",tmpo[0],8192,1,1);
  //    write_output("out1.m","o1",tmpo[1],8192,1,1);
  //    write_output("out2.m","o2",tmpo[2],8192,1,1);
3469
  for (i=0,i2=0; i<16384; i+=8,i2+=4)  {
3470 3471 3472
    bfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),(simd_q15_t*)(&tmpo[2][i2]),
          (simd_q15_t*)(output+i),(simd_q15_t*)(output+16384+i),(simd_q15_t*)(output+32768+i),
          (simd_q15_t*)(twa24576+i),(simd_q15_t*)(twb24576+i));
3473
  }
3474

3475 3476 3477
  _mm_empty();
  _m_empty();

3478
  //  write_output("out.m","out",output,24576,1,1);
3479 3480
}

3481
void idft24576(int16_t *input, int16_t *output)
3482
{
3483 3484 3485 3486
  int i,i2,j;
  uint32_t tmp[3][16384] __attribute__((aligned(16)));
  uint32_t tmpo[3][16384] __attribute__((aligned(16)));

3487 3488 3489 3490
  for (i=0,j=0; i<8192; i++) {
    tmp[0][i] = ((uint32_t *)input)[j++];
    tmp[1][i] = ((uint32_t *)input)[j++];
    tmp[2][i] = ((uint32_t *)input)[j++];
3491
  }
3492

3493 3494 3495 3496 3497
  idft8192((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
  idft8192((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
  idft8192((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
  
  /*
3498
  for (i=1; i<8192; i++) {
3499 3500 3501
    tmpo[0][i] = tmpo[0][i<<1];
    tmpo[1][i] = tmpo[1][i<<1];
    tmpo[2][i] = tmpo[2][i<<1];
3502
    }*/
3503 3504

  /*
3505 3506 3507 3508 3509 3510
    write_output("in.m","in",input,24576,1,1);
    write_output("out0.m","o0",tmpo[0],8192,1,1);
    write_output("out1.m","o1",tmpo[1],8192,1,1);
    write_output("out2.m","o2",tmpo[2],8192,1,1);
  */

3511
  for (i=0,i2=0; i<16384; i+=8,i2+=4)  {
3512 3513 3514
    ibfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),((simd_q15_t*)&tmpo[2][i2]),
          (simd_q15_t*)(output+i),(simd_q15_t*)(output+16384+i),(simd_q15_t*)(output+32768+i),
          (simd_q15_t*)(twa24576+i),(simd_q15_t*)(twb24576+i));
3515
  }
3516

3517 3518 3519
  _mm_empty();
  _m_empty();

3520
  //  write_output("out.m","out",output,24576,1,1);
3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531
}

///  THIS SECTION IS FOR ALL PUSCH DFTS (i.e. radix 2^a * 3^b * 4^c * 5^d)
///  They use twiddles for 4-way parallel DFTS (i.e. 4 DFTS with interleaved input/output)

static int16_t W1_12s[8]__attribute__((aligned(16))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383};
static int16_t W2_12s[8]__attribute__((aligned(16))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377};
static int16_t W3_12s[8]__attribute__((aligned(16))) = {0,-32767,0,-32767,0,-32767,0,-32767};
static int16_t W4_12s[8]__attribute__((aligned(16))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377};
static int16_t W6_12s[8]__attribute__((aligned(16))) = {-32767,0,-32767,0,-32767,0,-32767,0};

3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589
simd_q15_t *W1_12=(simd_q15_t *)W1_12s;
simd_q15_t *W2_12=(simd_q15_t *)W2_12s;
simd_q15_t *W3_12=(simd_q15_t *)W3_12s;
simd_q15_t *W4_12=(simd_q15_t *)W4_12s;
simd_q15_t *W6_12=(simd_q15_t *)W6_12s;


static simd_q15_t norm128;

static inline void dft12f(simd_q15_t *x0,
                          simd_q15_t *x1,
                          simd_q15_t *x2,
                          simd_q15_t *x3,
                          simd_q15_t *x4,
                          simd_q15_t *x5,
                          simd_q15_t *x6,
                          simd_q15_t *x7,
                          simd_q15_t *x8,
                          simd_q15_t *x9,
                          simd_q15_t *x10,
                          simd_q15_t *x11,
                          simd_q15_t *y0,
                          simd_q15_t *y1,
                          simd_q15_t *y2,
                          simd_q15_t *y3,
                          simd_q15_t *y4,
                          simd_q15_t *y5,
                          simd_q15_t *y6,
                          simd_q15_t *y7,
                          simd_q15_t *y8,
                          simd_q15_t *y9,
                          simd_q15_t *y10,
                          simd_q15_t *y11) __attribute__((always_inline));

static inline void dft12f(simd_q15_t *x0,
                          simd_q15_t *x1,
                          simd_q15_t *x2,
                          simd_q15_t *x3,
                          simd_q15_t *x4,
                          simd_q15_t *x5,
                          simd_q15_t *x6,
                          simd_q15_t *x7,
                          simd_q15_t *x8,
                          simd_q15_t *x9,
                          simd_q15_t *x10,
                          simd_q15_t *x11,
                          simd_q15_t *y0,
                          simd_q15_t *y1,
                          simd_q15_t *y2,
                          simd_q15_t *y3,
                          simd_q15_t *y4,
                          simd_q15_t *y5,
                          simd_q15_t *y6,
                          simd_q15_t *y7,
                          simd_q15_t *y8,
                          simd_q15_t *y9,
                          simd_q15_t *y10,
                          simd_q15_t *y11)
3590 3591 3592
{


3593
  simd_q15_t tmp_dft12[12];
3594

3595
  simd_q15_t *tmp_dft12_ptr = &tmp_dft12[0];
3596

3597
  // msg("dft12\n");
3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627

  bfly4_tw1(x0,
            x3,
            x6,
            x9,
            tmp_dft12_ptr,
            tmp_dft12_ptr+3,
            tmp_dft12_ptr+6,
            tmp_dft12_ptr+9);


  bfly4_tw1(x1,
            x4,
            x7,
            x10,
            tmp_dft12_ptr+1,
            tmp_dft12_ptr+4,
            tmp_dft12_ptr+7,
            tmp_dft12_ptr+10);


  bfly4_tw1(x2,
            x5,
            x8,
            x11,
            tmp_dft12_ptr+2,
            tmp_dft12_ptr+5,
            tmp_dft12_ptr+8,
            tmp_dft12_ptr+11);

3628 3629
  //  k2=0;
  bfly3_tw1(tmp_dft12_ptr,
3630 3631 3632 3633 3634 3635 3636 3637
            tmp_dft12_ptr+1,
            tmp_dft12_ptr+2,
            y0,
            y4,
            y8);



3638 3639
  //  k2=1;
  bfly3(tmp_dft12_ptr+3,
3640 3641 3642 3643 3644 3645
        tmp_dft12_ptr+4,
        tmp_dft12_ptr+5,
        y1,
        y5,
        y9,
        W1_12,
3646
        W2_12);
3647 3648 3649



3650 3651
  //  k2=2;
  bfly3(tmp_dft12_ptr+6,
3652 3653 3654 3655 3656 3657 3658 3659
        tmp_dft12_ptr+7,
        tmp_dft12_ptr+8,
        y2,
        y6,
        y10,
        W2_12,
        W4_12);

3660 3661
  //  k2=3;
  bfly3(tmp_dft12_ptr+9,
3662 3663 3664 3665 3666 3667
        tmp_dft12_ptr+10,
        tmp_dft12_ptr+11,
        y3,
        y7,
        y11,
        W3_12,
3668 3669
        W6_12);

3670
}
3671 3672 3673 3674




3675 3676
void dft12(int16_t *x,int16_t *y)
{
3677

3678
  simd_q15_t *x128 = (simd_q15_t *)x,*y128 = (simd_q15_t *)y;
3679
  dft12f(&x128[0],
3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702
         &x128[1],
         &x128[2],
         &x128[3],
         &x128[4],
         &x128[5],
         &x128[6],
         &x128[7],
         &x128[8],
         &x128[9],
         &x128[10],
         &x128[11],
         &y128[0],
         &y128[1],
         &y128[2],
         &y128[3],
         &y128[4],
         &y128[5],
         &y128[6],
         &y128[7],
         &y128[8],
         &y128[9],
         &y128[10],
         &y128[11]);
3703 3704 3705 3706 3707 3708 3709

  _mm_empty();
  _m_empty();

}

static int16_t tw24[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480,
3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720
                                                       28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                       23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                       16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                       8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                       0,-32767,0,-32767,0,-32767,0,-32767,
                                                       -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                       -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                       -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                       -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                       -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480
                                                      };
3721

3722 3723 3724 3725
//static simd_q15_t ytmp128array[300];
//static simd_q15_t ytmp128array2[300];
//static simd_q15_t ytmp128array3[300];
//static simd_q15_t x2128array[300];
3726

3727 3728 3729
void dft24(int16_t *x,int16_t *y,unsigned char scale_flag)
{

3730 3731 3732 3733
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *tw128=(simd_q15_t *)&tw24[0];
  simd_q15_t ytmp128[24];//=&ytmp128array[0];
3734 3735 3736 3737
  int i,j,k;

  //  msg("dft24\n");
  dft12f(x128,
3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760
         x128+2,
         x128+4,
         x128+6,
         x128+8,
         x128+10,
         x128+12,
         x128+14,
         x128+16,
         x128+18,
         x128+20,
         x128+22,
         ytmp128,
         ytmp128+2,
         ytmp128+4,
         ytmp128+6,
         ytmp128+8,
         ytmp128+10,
         ytmp128+12,
         ytmp128+14,
         ytmp128+16,
         ytmp128+18,
         ytmp128+20,
         ytmp128+22);
3761 3762 3763
  //  msg("dft24b\n");

  dft12f(x128+1,
3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786
         x128+3,
         x128+5,
         x128+7,
         x128+9,
         x128+11,
         x128+13,
         x128+15,
         x128+17,
         x128+19,
         x128+21,
         x128+23,
         ytmp128+1,
         ytmp128+3,
         ytmp128+5,
         ytmp128+7,
         ytmp128+9,
         ytmp128+11,
         ytmp128+13,
         ytmp128+15,
         ytmp128+17,
         ytmp128+19,
         ytmp128+21,
         ytmp128+23);
3787 3788 3789

  //  msg("dft24c\n");

3790 3791 3792 3793
  bfly2_tw1(ytmp128,
            ytmp128+1,
            y128,
            y128+12);
3794 3795

  //  msg("dft24d\n");
3796 3797 3798 3799 3800 3801 3802 3803

  for (i=2,j=1,k=0; i<24; i+=2,j++,k++) {

    bfly2(ytmp128+i,
          ytmp128+i+1,
          y128+j,
          y128+j+12,
          tw128+k);
3804 3805 3806 3807
    //    msg("dft24e\n");
  }

  if (scale_flag==1) {
3808
    norm128 = set1_int16(dft_norm_table[1]);
3809 3810

    for (i=0; i<24; i++) {
3811
      y128[i] = mulhi_int16(y128[i],norm128);
3812 3813 3814 3815 3816 3817 3818 3819 3820
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa36[88]__attribute__((aligned(16))) = {32269,-5689,32269,-5689,32269,-5689,32269,-5689,
3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831
                                                        30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                        28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                        25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                        21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                        16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                        11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                        5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                        0,-32767,0,-32767,0,-32767,0,-32767,
                                                        -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                        -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790
                                                       };
3832 3833

static int16_t twb36[88]__attribute__((aligned(16))) = {30790,-11206,30790,-11206,30790,-11206,30790,-11206,
3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848
                                                        25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                        16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                        5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                        -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                        -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                        -25100,-21062,-25100,-21062,-25100,-21062,-25100,-21062,
                                                        -30790,-11206,-30790,-11206,-30790,-11206,-30790,-11206,
                                                        -32767,0,-32767,0,-32767,0,-32767,0,
                                                        -30790,11206,-30790,11206,-30790,11206,-30790,11206,
                                                        -25100,21062,-25100,21062,-25100,21062,-25100,21062
                                                       };

void dft36(int16_t *x,int16_t *y,unsigned char scale_flag)
{

3849 3850 3851 3852 3853
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa36[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb36[0];
  simd_q15_t ytmp128[36];//&ytmp128array[0];
3854 3855 3856 3857 3858


  int i,j,k;

  dft12f(x128,
3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881
         x128+3,
         x128+6,
         x128+9,
         x128+12,
         x128+15,
         x128+18,
         x128+21,
         x128+24,
         x128+27,
         x128+30,
         x128+33,
         ytmp128,
         ytmp128+3,
         ytmp128+6,
         ytmp128+9,
         ytmp128+12,
         ytmp128+15,
         ytmp128+18,
         ytmp128+21,
         ytmp128+24,
         ytmp128+27,
         ytmp128+30,
         ytmp128+33);
3882 3883

  dft12f(x128+1,
3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906
         x128+4,
         x128+7,
         x128+10,
         x128+13,
         x128+16,
         x128+19,
         x128+22,
         x128+25,
         x128+28,
         x128+31,
         x128+34,
         ytmp128+1,
         ytmp128+4,
         ytmp128+7,
         ytmp128+10,
         ytmp128+13,
         ytmp128+16,
         ytmp128+19,
         ytmp128+22,
         ytmp128+25,
         ytmp128+28,
         ytmp128+31,
         ytmp128+34);
3907 3908

  dft12f(x128+2,
3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950
         x128+5,
         x128+8,
         x128+11,
         x128+14,
         x128+17,
         x128+20,
         x128+23,
         x128+26,
         x128+29,
         x128+32,
         x128+35,
         ytmp128+2,
         ytmp128+5,
         ytmp128+8,
         ytmp128+11,
         ytmp128+14,
         ytmp128+17,
         ytmp128+20,
         ytmp128+23,
         ytmp128+26,
         ytmp128+29,
         ytmp128+32,
         ytmp128+35);


  bfly3_tw1(ytmp128,
            ytmp128+1,
            ytmp128+2,
            y128,
            y128+12,
            y128+24);

  for (i=3,j=1,k=0; i<36; i+=3,j++,k++) {

    bfly3(ytmp128+i,
          ytmp128+i+1,
          ytmp128+i+2,
          y128+j,
          y128+j+12,
          y128+j+24,
          twa128+k,
          twb128+k);
3951 3952 3953
  }

  if (scale_flag==1) {
3954
    norm128 = set1_int16(dft_norm_table[2]);
3955 3956

    for (i=0; i<36; i++) {
3957
      y128[i] = mulhi_int16(y128[i],norm128);
3958 3959 3960 3961 3962 3963 3964 3965 3966
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa48[88]__attribute__((aligned(16))) = {32486,-4276,32486,-4276,32486,-4276,32486,-4276,
3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977
                                                        31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                        30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                        28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                        25995,-19947,25995,-19947,25995,-19947,25995,-19947,
                                                        23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                        19947,-25995,19947,-25995,19947,-25995,19947,-25995,
                                                        16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                        12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                        8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                        4276,-32486,4276,-32486,4276,-32486,4276,-32486
                                                       };
3978 3979

static int16_t twb48[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480,
3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990
                                                        28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                        23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                        16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                        8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                        0,-32767,0,-32767,0,-32767,0,-32767,
                                                        -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                        -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                        -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                        -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                        -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480
                                                       };
3991 3992

static int16_t twc48[88]__attribute__((aligned(16))) = {30272,-12539,30272,-12539,30272,-12539,30272,-12539,
3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007
                                                        23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                        12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                        0,-32767,0,-32767,0,-32767,0,-32767,
                                                        -12539,-30272,-12539,-30272,-12539,-30272,-12539,-30272,
                                                        -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                        -30272,-12539,-30272,-12539,-30272,-12539,-30272,-12539,
                                                        -32767,0,-32767,0,-32767,0,-32767,0,
                                                        -30272,12539,-30272,12539,-30272,12539,-30272,12539,
                                                        -23169,23169,-23169,23169,-23169,23169,-23169,23169,
                                                        -12539,30272,-12539,30272,-12539,30272,-12539,30272
                                                       };

void dft48(int16_t *x, int16_t *y,unsigned char scale_flag)
{

4008 4009 4010 4011 4012 4013
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa48[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb48[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc48[0];
  simd_q15_t ytmp128[48];//=&ytmp128array[0];
4014 4015 4016 4017
  int i,j,k;


  dft12f(x128,
4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040
         x128+4,
         x128+8,
         x128+12,
         x128+16,
         x128+20,
         x128+24,
         x128+28,
         x128+32,
         x128+36,
         x128+40,
         x128+44,
         ytmp128,
         ytmp128+4,
         ytmp128+8,
         ytmp128+12,
         ytmp128+16,
         ytmp128+20,
         ytmp128+24,
         ytmp128+28,
         ytmp128+32,
         ytmp128+36,
         ytmp128+40,
         ytmp128+44);
4041 4042 4043


  dft12f(x128+1,
4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066
         x128+5,
         x128+9,
         x128+13,
         x128+17,
         x128+21,
         x128+25,
         x128+29,
         x128+33,
         x128+37,
         x128+41,
         x128+45,
         ytmp128+1,
         ytmp128+5,
         ytmp128+9,
         ytmp128+13,
         ytmp128+17,
         ytmp128+21,
         ytmp128+25,
         ytmp128+29,
         ytmp128+33,
         ytmp128+37,
         ytmp128+41,
         ytmp128+45);
4067 4068 4069


  dft12f(x128+2,
4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092
         x128+6,
         x128+10,
         x128+14,
         x128+18,
         x128+22,
         x128+26,
         x128+30,
         x128+34,
         x128+38,
         x128+42,
         x128+46,
         ytmp128+2,
         ytmp128+6,
         ytmp128+10,
         ytmp128+14,
         ytmp128+18,
         ytmp128+22,
         ytmp128+26,
         ytmp128+30,
         ytmp128+34,
         ytmp128+38,
         ytmp128+42,
         ytmp128+46);
4093 4094 4095


  dft12f(x128+3,
4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145
         x128+7,
         x128+11,
         x128+15,
         x128+19,
         x128+23,
         x128+27,
         x128+31,
         x128+35,
         x128+39,
         x128+43,
         x128+47,
         ytmp128+3,
         ytmp128+7,
         ytmp128+11,
         ytmp128+15,
         ytmp128+19,
         ytmp128+23,
         ytmp128+27,
         ytmp128+31,
         ytmp128+35,
         ytmp128+39,
         ytmp128+43,
         ytmp128+47);



  bfly4_tw1(ytmp128,
            ytmp128+1,
            ytmp128+2,
            ytmp128+3,
            y128,
            y128+12,
            y128+24,
            y128+36);



  for (i=4,j=1,k=0; i<48; i+=4,j++,k++) {

    bfly4(ytmp128+i,
          ytmp128+i+1,
          ytmp128+i+2,
          ytmp128+i+3,
          y128+j,
          y128+j+12,
          y128+j+24,
          y128+j+36,
          twa128+k,
          twb128+k,
          twc128+k);
4146 4147 4148 4149

  }

  if (scale_flag == 1) {
4150
    norm128 = set1_int16(dft_norm_table[3]);
4151 4152

    for (i=0; i<48; i++) {
4153
      y128[i] = mulhi_int16(y128[i],norm128);
4154 4155 4156 4157 4158 4159 4160 4161 4162
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa60[88]__attribute__((aligned(16))) = {32587,-3425,32587,-3425,32587,-3425,32587,-3425,
4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173
                                                        32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                        31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                        29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                        28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                        26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                        24350,-21925,24350,-21925,24350,-21925,24350,-21925,
                                                        21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                        19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                        16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                        13327,-29934,13327,-29934,13327,-29934,13327,-29934
                                                       };
4174
static int16_t twb60[88]__attribute__((aligned(16))) = {32050,-6812,32050,-6812,32050,-6812,32050,-6812,
4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185
                                                        29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                        26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                        21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                        16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                        10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                        3425,-32587,3425,-32587,3425,-32587,3425,-32587,
                                                        -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587,
                                                        -10125,-31163,-10125,-31163,-10125,-31163,-10125,-31163,
                                                        -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                        -21925,-24350,-21925,-24350,-21925,-24350,-21925,-24350
                                                       };
4186
static int16_t twc60[88]__attribute__((aligned(16))) = {31163,-10125,31163,-10125,31163,-10125,31163,-10125,
4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197
                                                        26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                        19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                        10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                        0,-32767,0,-32767,0,-32767,0,-32767,
                                                        -10125,-31163,-10125,-31163,-10125,-31163,-10125,-31163,
                                                        -19259,-26509,-19259,-26509,-19259,-26509,-19259,-26509,
                                                        -26509,-19259,-26509,-19259,-26509,-19259,-26509,-19259,
                                                        -31163,-10125,-31163,-10125,-31163,-10125,-31163,-10125,
                                                        -32767,0,-32767,0,-32767,0,-32767,0,
                                                        -31163,10125,-31163,10125,-31163,10125,-31163,10125
                                                       };
4198
static int16_t twd60[88]__attribute__((aligned(16))) = {29934,-13327,29934,-13327,29934,-13327,29934,-13327,
4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213
                                                        21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                        10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                        -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587,
                                                        -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                        -26509,-19259,-26509,-19259,-26509,-19259,-26509,-19259,
                                                        -32050,-6812,-32050,-6812,-32050,-6812,-32050,-6812,
                                                        -32050,6812,-32050,6812,-32050,6812,-32050,6812,
                                                        -26509,19259,-26509,19259,-26509,19259,-26509,19259,
                                                        -16383,28377,-16383,28377,-16383,28377,-16383,28377,
                                                        -3425,32587,-3425,32587,-3425,32587,-3425,32587
                                                       };

void dft60(int16_t *x,int16_t *y,unsigned char scale)
{

4214 4215 4216 4217 4218 4219 4220
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa60[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb60[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc60[0];
  simd_q15_t *twd128=(simd_q15_t *)&twd60[0];
  simd_q15_t ytmp128[60];//=&ytmp128array[0];
4221 4222 4223
  int i,j,k;

  dft12f(x128,
4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246
         x128+5,
         x128+10,
         x128+15,
         x128+20,
         x128+25,
         x128+30,
         x128+35,
         x128+40,
         x128+45,
         x128+50,
         x128+55,
         ytmp128,
         ytmp128+5,
         ytmp128+10,
         ytmp128+15,
         ytmp128+20,
         ytmp128+25,
         ytmp128+30,
         ytmp128+35,
         ytmp128+40,
         ytmp128+45,
         ytmp128+50,
         ytmp128+55);
4247 4248

  dft12f(x128+1,
4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271
         x128+6,
         x128+11,
         x128+16,
         x128+21,
         x128+26,
         x128+31,
         x128+36,
         x128+41,
         x128+46,
         x128+51,
         x128+56,
         ytmp128+1,
         ytmp128+6,
         ytmp128+11,
         ytmp128+16,
         ytmp128+21,
         ytmp128+26,
         ytmp128+31,
         ytmp128+36,
         ytmp128+41,
         ytmp128+46,
         ytmp128+51,
         ytmp128+56);
4272 4273

  dft12f(x128+2,
4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296
         x128+7,
         x128+12,
         x128+17,
         x128+22,
         x128+27,
         x128+32,
         x128+37,
         x128+42,
         x128+47,
         x128+52,
         x128+57,
         ytmp128+2,
         ytmp128+7,
         ytmp128+12,
         ytmp128+17,
         ytmp128+22,
         ytmp128+27,
         ytmp128+32,
         ytmp128+37,
         ytmp128+42,
         ytmp128+47,
         ytmp128+52,
         ytmp128+57);
4297 4298

  dft12f(x128+3,
4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321
         x128+8,
         x128+13,
         x128+18,
         x128+23,
         x128+28,
         x128+33,
         x128+38,
         x128+43,
         x128+48,
         x128+53,
         x128+58,
         ytmp128+3,
         ytmp128+8,
         ytmp128+13,
         ytmp128+18,
         ytmp128+23,
         ytmp128+28,
         ytmp128+33,
         ytmp128+38,
         ytmp128+43,
         ytmp128+48,
         ytmp128+53,
         ytmp128+58);
4322 4323

  dft12f(x128+4,
4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374
         x128+9,
         x128+14,
         x128+19,
         x128+24,
         x128+29,
         x128+34,
         x128+39,
         x128+44,
         x128+49,
         x128+54,
         x128+59,
         ytmp128+4,
         ytmp128+9,
         ytmp128+14,
         ytmp128+19,
         ytmp128+24,
         ytmp128+29,
         ytmp128+34,
         ytmp128+39,
         ytmp128+44,
         ytmp128+49,
         ytmp128+54,
         ytmp128+59);

  bfly5_tw1(ytmp128,
            ytmp128+1,
            ytmp128+2,
            ytmp128+3,
            ytmp128+4,
            y128,
            y128+12,
            y128+24,
            y128+36,
            y128+48);

  for (i=5,j=1,k=0; i<60; i+=5,j++,k++) {

    bfly5(ytmp128+i,
          ytmp128+i+1,
          ytmp128+i+2,
          ytmp128+i+3,
          ytmp128+i+4,
          y128+j,
          y128+j+12,
          y128+j+24,
          y128+j+36,
          y128+j+48,
          twa128+k,
          twb128+k,
          twc128+k,
          twd128+k);
4375 4376 4377
  }

  if (scale == 1) {
4378
    norm128 = set1_int16(dft_norm_table[4]);
4379 4380

    for (i=0; i<60; i++) {
4381
      y128[i] = mulhi_int16(y128[i],norm128);
4382 4383 4384 4385 4386 4387 4388 4389 4390
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t tw72[280]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855,
4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428
                                                        32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                        31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                        30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                        29696,-13847,29696,-13847,29696,-13847,29696,-13847,
                                                        28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                        26841,-18794,26841,-18794,26841,-18794,26841,-18794,
                                                        25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                        23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                        21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                        18794,-26841,18794,-26841,18794,-26841,18794,-26841,
                                                        16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                        13847,-29696,13847,-29696,13847,-29696,13847,-29696,
                                                        11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                        8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                        5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                        2855,-32642,2855,-32642,2855,-32642,2855,-32642,
                                                        0,-32767,0,-32767,0,-32767,0,-32767,
                                                        -2855,-32642,-2855,-32642,-2855,-32642,-2855,-32642,
                                                        -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                        -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                        -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790,
                                                        -13847,-29696,-13847,-29696,-13847,-29696,-13847,-29696,
                                                        -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                        -18794,-26841,-18794,-26841,-18794,-26841,-18794,-26841,
                                                        -21062,-25100,-21062,-25100,-21062,-25100,-21062,-25100,
                                                        -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                        -25100,-21062,-25100,-21062,-25100,-21062,-25100,-21062,
                                                        -26841,-18794,-26841,-18794,-26841,-18794,-26841,-18794,
                                                        -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                        -29696,-13847,-29696,-13847,-29696,-13847,-29696,-13847,
                                                        -30790,-11206,-30790,-11206,-30790,-11206,-30790,-11206,
                                                        -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480,
                                                        -32269,-5689,-32269,-5689,-32269,-5689,-32269,-5689,
                                                        -32642,-2855,-32642,-2855,-32642,-2855,-32642,-2855,
                                                       };

void dft72(int16_t *x,int16_t *y,unsigned char scale_flag)
{
4429 4430

  int i,j;
4431 4432 4433 4434
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *tw128=(simd_q15_t *)&tw72[0];
  simd_q15_t x2128[72];// = (simd_q15_t *)&x2128array[0];
4435

4436
  simd_q15_t ytmp128[72];//=&ytmp128array2[0];
4437

4438
  for (i=0,j=0; i<36; i++,j+=2) {
4439 4440 4441 4442 4443 4444 4445 4446
    x2128[i]    = x128[j];    // even inputs
    x2128[i+36] = x128[j+1];  // odd inputs
  }

  dft36((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft36((int16_t *)(x2128+36),(int16_t *)(ytmp128+36),1);

  bfly2_tw1(ytmp128,ytmp128+36,y128,y128+36);
4447 4448

  for (i=1,j=0; i<36; i++,j++) {
4449
    bfly2(ytmp128+i,
4450 4451 4452 4453
          ytmp128+36+i,
          y128+i,
          y128+36+i,
          tw128+j);
4454 4455 4456
  }

  if (scale_flag==1) {
4457
    norm128 = set1_int16(dft_norm_table[5]);
4458 4459

    for (i=0; i<72; i++) {
4460
      y128[i] = mulhi_int16(y128[i],norm128);
4461 4462 4463 4464 4465 4466 4467 4468 4469
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t tw96[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143,
4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519
                                                        32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                        32137,-6392,32137,-6392,32137,-6392,32137,-6392,
                                                        31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                        31028,-10532,31028,-10532,31028,-10532,31028,-10532,
                                                        30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                        29387,-14492,29387,-14492,29387,-14492,29387,-14492,
                                                        28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                        27244,-18204,27244,-18204,27244,-18204,27244,-18204,
                                                        25995,-19947,25995,-19947,25995,-19947,25995,-19947,
                                                        24635,-21604,24635,-21604,24635,-21604,24635,-21604,
                                                        23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                        21604,-24635,21604,-24635,21604,-24635,21604,-24635,
                                                        19947,-25995,19947,-25995,19947,-25995,19947,-25995,
                                                        18204,-27244,18204,-27244,18204,-27244,18204,-27244,
                                                        16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                        14492,-29387,14492,-29387,14492,-29387,14492,-29387,
                                                        12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                        10532,-31028,10532,-31028,10532,-31028,10532,-31028,
                                                        8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                        6392,-32137,6392,-32137,6392,-32137,6392,-32137,
                                                        4276,-32486,4276,-32486,4276,-32486,4276,-32486,
                                                        2143,-32696,2143,-32696,2143,-32696,2143,-32696,
                                                        0,-32767,0,-32767,0,-32767,0,-32767,
                                                        -2143,-32696,-2143,-32696,-2143,-32696,-2143,-32696,
                                                        -4276,-32486,-4276,-32486,-4276,-32486,-4276,-32486,
                                                        -6392,-32137,-6392,-32137,-6392,-32137,-6392,-32137,
                                                        -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                        -10532,-31028,-10532,-31028,-10532,-31028,-10532,-31028,
                                                        -12539,-30272,-12539,-30272,-12539,-30272,-12539,-30272,
                                                        -14492,-29387,-14492,-29387,-14492,-29387,-14492,-29387,
                                                        -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                        -18204,-27244,-18204,-27244,-18204,-27244,-18204,-27244,
                                                        -19947,-25995,-19947,-25995,-19947,-25995,-19947,-25995,
                                                        -21604,-24635,-21604,-24635,-21604,-24635,-21604,-24635,
                                                        -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                        -24635,-21604,-24635,-21604,-24635,-21604,-24635,-21604,
                                                        -25995,-19947,-25995,-19947,-25995,-19947,-25995,-19947,
                                                        -27244,-18204,-27244,-18204,-27244,-18204,-27244,-18204,
                                                        -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                        -29387,-14492,-29387,-14492,-29387,-14492,-29387,-14492,
                                                        -30272,-12539,-30272,-12539,-30272,-12539,-30272,-12539,
                                                        -31028,-10532,-31028,-10532,-31028,-10532,-31028,-10532,
                                                        -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480,
                                                        -32137,-6392,-32137,-6392,-32137,-6392,-32137,-6392,
                                                        -32486,-4276,-32486,-4276,-32486,-4276,-32486,-4276,
                                                        -32696,-2143,-32696,-2143,-32696,-2143,-32696,-2143
                                                       };

void dft96(int16_t *x,int16_t *y,unsigned char scale_flag)
{
4520 4521 4522


  int i,j;
4523 4524 4525 4526 4527
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *tw128=(simd_q15_t *)&tw96[0];
  simd_q15_t x2128[96];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[96];//=&ytmp128array2[0];
4528 4529


4530
  for (i=0,j=0; i<48; i++,j+=2) {
4531 4532 4533 4534 4535 4536 4537 4538 4539
    x2128[i]    = x128[j];
    x2128[i+48] = x128[j+1];
  }

  dft48((int16_t *)x2128,(int16_t *)ytmp128,0);
  dft48((int16_t *)(x2128+48),(int16_t *)(ytmp128+48),0);


  bfly2_tw1(ytmp128,ytmp128+48,y128,y128+48);
4540 4541

  for (i=1,j=0; i<48; i++,j++) {
4542
    bfly2(ytmp128+i,
4543 4544 4545 4546
          ytmp128+48+i,
          y128+i,
          y128+48+i,
          tw128+j);
4547
  }
4548

4549
  if (scale_flag==1) {
4550
    norm128 = set1_int16(dft_norm_table[6]);
4551 4552

    for (i=0; i<96; i++) {
4553
      y128[i] = mulhi_int16(y128[i],norm128);
4554 4555 4556 4557 4558 4559 4560 4561 4562
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa108[280]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905,
4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597
                                                          32545,-3804,32545,-3804,32545,-3804,32545,-3804,
                                                          32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                          31883,-7556,31883,-7556,31883,-7556,31883,-7556,
                                                          31390,-9397,31390,-9397,31390,-9397,31390,-9397,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          30087,-12978,30087,-12978,30087,-12978,30087,-12978,
                                                          29281,-14705,29281,-14705,29281,-14705,29281,-14705,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27376,-18005,27376,-18005,27376,-18005,27376,-18005,
                                                          26283,-19567,26283,-19567,26283,-19567,26283,-19567,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          23833,-22486,23833,-22486,23833,-22486,23833,-22486,
                                                          22486,-23833,22486,-23833,22486,-23833,22486,-23833,
                                                          21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                          19567,-26283,19567,-26283,19567,-26283,19567,-26283,
                                                          18005,-27376,18005,-27376,18005,-27376,18005,-27376,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          14705,-29281,14705,-29281,14705,-29281,14705,-29281,
                                                          12978,-30087,12978,-30087,12978,-30087,12978,-30087,
                                                          11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                          9397,-31390,9397,-31390,9397,-31390,9397,-31390,
                                                          7556,-31883,7556,-31883,7556,-31883,7556,-31883,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          3804,-32545,3804,-32545,3804,-32545,3804,-32545,
                                                          1905,-32711,1905,-32711,1905,-32711,1905,-32711,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -1905,-32711,-1905,-32711,-1905,-32711,-1905,-32711,
                                                          -3804,-32545,-3804,-32545,-3804,-32545,-3804,-32545,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -7556,-31883,-7556,-31883,-7556,-31883,-7556,-31883,
                                                          -9397,-31390,-9397,-31390,-9397,-31390,-9397,-31390,
                                                          -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790,
                                                          -12978,-30087,-12978,-30087,-12978,-30087,-12978,-30087,
                                                          -14705,-29281,-14705,-29281,-14705,-29281,-14705,-29281
                                                         };
4598 4599

static int16_t twb108[280]__attribute__((aligned(16))) = {32545,-3804,32545,-3804,32545,-3804,32545,-3804,
4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637
                                                          31883,-7556,31883,-7556,31883,-7556,31883,-7556,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          29281,-14705,29281,-14705,29281,-14705,29281,-14705,
                                                          27376,-18005,27376,-18005,27376,-18005,27376,-18005,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          22486,-23833,22486,-23833,22486,-23833,22486,-23833,
                                                          19567,-26283,19567,-26283,19567,-26283,19567,-26283,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          12978,-30087,12978,-30087,12978,-30087,12978,-30087,
                                                          9397,-31390,9397,-31390,9397,-31390,9397,-31390,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          1905,-32711,1905,-32711,1905,-32711,1905,-32711,
                                                          -1905,-32711,-1905,-32711,-1905,-32711,-1905,-32711,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -9397,-31390,-9397,-31390,-9397,-31390,-9397,-31390,
                                                          -12978,-30087,-12978,-30087,-12978,-30087,-12978,-30087,
                                                          -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                          -19567,-26283,-19567,-26283,-19567,-26283,-19567,-26283,
                                                          -22486,-23833,-22486,-23833,-22486,-23833,-22486,-23833,
                                                          -25100,-21062,-25100,-21062,-25100,-21062,-25100,-21062,
                                                          -27376,-18005,-27376,-18005,-27376,-18005,-27376,-18005,
                                                          -29281,-14705,-29281,-14705,-29281,-14705,-29281,-14705,
                                                          -30790,-11206,-30790,-11206,-30790,-11206,-30790,-11206,
                                                          -31883,-7556,-31883,-7556,-31883,-7556,-31883,-7556,
                                                          -32545,-3804,-32545,-3804,-32545,-3804,-32545,-3804,
                                                          -32767,0,-32767,0,-32767,0,-32767,0,
                                                          -32545,3804,-32545,3804,-32545,3804,-32545,3804,
                                                          -31883,7556,-31883,7556,-31883,7556,-31883,7556,
                                                          -30790,11206,-30790,11206,-30790,11206,-30790,11206,
                                                          -29281,14705,-29281,14705,-29281,14705,-29281,14705,
                                                          -27376,18005,-27376,18005,-27376,18005,-27376,18005,
                                                          -25100,21062,-25100,21062,-25100,21062,-25100,21062,
                                                          -22486,23833,-22486,23833,-22486,23833,-22486,23833,
                                                          -19567,26283,-19567,26283,-19567,26283,-19567,26283
                                                         };

void dft108(int16_t *x,int16_t *y,unsigned char scale_flag)
{
4638 4639 4640


  int i,j;
4641 4642 4643 4644 4645 4646
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa108[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb108[0];
  simd_q15_t x2128[108];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[108];//=&ytmp128array2[0];
4647 4648


4649
  for (i=0,j=0; i<36; i++,j+=3) {
4650 4651 4652 4653 4654 4655 4656 4657 4658 4659
    x2128[i]    = x128[j];
    x2128[i+36] = x128[j+1];
    x2128[i+72] = x128[j+2];
  }

  dft36((int16_t *)x2128,(int16_t *)ytmp128,0);
  dft36((int16_t *)(x2128+36),(int16_t *)(ytmp128+36),0);
  dft36((int16_t *)(x2128+72),(int16_t *)(ytmp128+72),0);

  bfly3_tw1(ytmp128,ytmp128+36,ytmp128+72,y128,y128+36,y128+72);
4660 4661

  for (i=1,j=0; i<36; i++,j++) {
4662
    bfly3(ytmp128+i,
4663 4664 4665 4666 4667 4668 4669
          ytmp128+36+i,
          ytmp128+72+i,
          y128+i,
          y128+36+i,
          y128+72+i,
          twa128+j,
          twb128+j);
4670 4671

  }
4672

4673
  if (scale_flag==1) {
4674
    norm128 = set1_int16(dft_norm_table[7]);
4675 4676

    for (i=0; i<108; i++) {
4677
      y128[i] = mulhi_int16(y128[i],norm128);
4678 4679 4680 4681 4682 4683 4684 4685 4686
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t tw120[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714,
4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748
                                                         32587,-3425,32587,-3425,32587,-3425,32587,-3425,
                                                         32363,-5125,32363,-5125,32363,-5125,32363,-5125,
                                                         32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                         31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                         31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                         30590,-11742,30590,-11742,30590,-11742,30590,-11742,
                                                         29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                         29195,-14875,29195,-14875,29195,-14875,29195,-14875,
                                                         28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                         27480,-17846,27480,-17846,27480,-17846,27480,-17846,
                                                         26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                         25464,-20620,25464,-20620,25464,-20620,25464,-20620,
                                                         24350,-21925,24350,-21925,24350,-21925,24350,-21925,
                                                         23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                         21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                         20620,-25464,20620,-25464,20620,-25464,20620,-25464,
                                                         19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                         17846,-27480,17846,-27480,17846,-27480,17846,-27480,
                                                         16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                         14875,-29195,14875,-29195,14875,-29195,14875,-29195,
                                                         13327,-29934,13327,-29934,13327,-29934,13327,-29934,
                                                         11742,-30590,11742,-30590,11742,-30590,11742,-30590,
                                                         10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                         8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                         6812,-32050,6812,-32050,6812,-32050,6812,-32050,
                                                         5125,-32363,5125,-32363,5125,-32363,5125,-32363,
                                                         3425,-32587,3425,-32587,3425,-32587,3425,-32587,
                                                         1714,-32722,1714,-32722,1714,-32722,1714,-32722,
                                                         0,-32767,0,-32767,0,-32767,0,-32767,
                                                         -1714,-32722,-1714,-32722,-1714,-32722,-1714,-32722,
                                                         -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587,
                                                         -5125,-32363,-5125,-32363,-5125,-32363,-5125,-32363,
                                                         -6812,-32050,-6812,-32050,-6812,-32050,-6812,-32050,
                                                         -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                         -10125,-31163,-10125,-31163,-10125,-31163,-10125,-31163,
                                                         -11742,-30590,-11742,-30590,-11742,-30590,-11742,-30590,
                                                         -13327,-29934,-13327,-29934,-13327,-29934,-13327,-29934,
                                                         -14875,-29195,-14875,-29195,-14875,-29195,-14875,-29195,
                                                         -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                         -17846,-27480,-17846,-27480,-17846,-27480,-17846,-27480,
                                                         -19259,-26509,-19259,-26509,-19259,-26509,-19259,-26509,
                                                         -20620,-25464,-20620,-25464,-20620,-25464,-20620,-25464,
                                                         -21925,-24350,-21925,-24350,-21925,-24350,-21925,-24350,
                                                         -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                         -24350,-21925,-24350,-21925,-24350,-21925,-24350,-21925,
                                                         -25464,-20620,-25464,-20620,-25464,-20620,-25464,-20620,
                                                         -26509,-19259,-26509,-19259,-26509,-19259,-26509,-19259,
                                                         -27480,-17846,-27480,-17846,-27480,-17846,-27480,-17846,
                                                         -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                         -29195,-14875,-29195,-14875,-29195,-14875,-29195,-14875,
                                                         -29934,-13327,-29934,-13327,-29934,-13327,-29934,-13327,
                                                         -30590,-11742,-30590,-11742,-30590,-11742,-30590,-11742,
                                                         -31163,-10125,-31163,-10125,-31163,-10125,-31163,-10125,
                                                         -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480,
                                                         -32050,-6812,-32050,-6812,-32050,-6812,-32050,-6812,
                                                         -32363,-5125,-32363,-5125,-32363,-5125,-32363,-5125,
                                                         -32587,-3425,-32587,-3425,-32587,-3425,-32587,-3425,
                                                         -32722,-1714,-32722,-1714,-32722,-1714,-32722,-1714
                                                        };

void dft120(int16_t *x,int16_t *y, unsigned char scale_flag)
{
4749 4750 4751


  int i,j;
4752 4753 4754 4755 4756
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *tw128=(simd_q15_t *)&tw120[0];
  simd_q15_t x2128[120];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[120];//=&ytmp128array2[0];
4757 4758


4759
  for (i=0,j=0; i<60; i++,j+=2) {
4760 4761 4762 4763 4764 4765 4766 4767 4768
    x2128[i]    = x128[j];
    x2128[i+60] = x128[j+1];
  }

  dft60((int16_t *)x2128,(int16_t *)ytmp128,0);
  dft60((int16_t *)(x2128+60),(int16_t *)(ytmp128+60),0);


  bfly2_tw1(ytmp128,ytmp128+60,y128,y128+60);
4769 4770

  for (i=1,j=0; i<60; i++,j++) {
4771
    bfly2(ytmp128+i,
4772 4773 4774 4775
          ytmp128+60+i,
          y128+i,
          y128+60+i,
          tw128+j);
4776 4777 4778
  }

  if (scale_flag==1) {
4779
    norm128 = set1_int16(dft_norm_table[8]);
4780 4781

    for (i=0; i<120; i++) {
4782
      y128[i] = mulhi_int16(y128[i],norm128);
4783 4784 4785 4786 4787 4788 4789 4790 4791
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa144[376]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429,
4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838
                                                          32642,-2855,32642,-2855,32642,-2855,32642,-2855,
                                                          32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                          32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                          31990,-7092,31990,-7092,31990,-7092,31990,-7092,
                                                          31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                          31250,-9853,31250,-9853,31250,-9853,31250,-9853,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                          29696,-13847,29696,-13847,29696,-13847,29696,-13847,
                                                          29064,-15130,29064,-15130,29064,-15130,29064,-15130,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27635,-17605,27635,-17605,27635,-17605,27635,-17605,
                                                          26841,-18794,26841,-18794,26841,-18794,26841,-18794,
                                                          25995,-19947,25995,-19947,25995,-19947,25995,-19947,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          24158,-22137,24158,-22137,24158,-22137,24158,-22137,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          22137,-24158,22137,-24158,22137,-24158,22137,-24158,
                                                          21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                          19947,-25995,19947,-25995,19947,-25995,19947,-25995,
                                                          18794,-26841,18794,-26841,18794,-26841,18794,-26841,
                                                          17605,-27635,17605,-27635,17605,-27635,17605,-27635,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          15130,-29064,15130,-29064,15130,-29064,15130,-29064,
                                                          13847,-29696,13847,-29696,13847,-29696,13847,-29696,
                                                          12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                          11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                          9853,-31250,9853,-31250,9853,-31250,9853,-31250,
                                                          8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                          7092,-31990,7092,-31990,7092,-31990,7092,-31990,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          4276,-32486,4276,-32486,4276,-32486,4276,-32486,
                                                          2855,-32642,2855,-32642,2855,-32642,2855,-32642,
                                                          1429,-32735,1429,-32735,1429,-32735,1429,-32735,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -1429,-32735,-1429,-32735,-1429,-32735,-1429,-32735,
                                                          -2855,-32642,-2855,-32642,-2855,-32642,-2855,-32642,
                                                          -4276,-32486,-4276,-32486,-4276,-32486,-4276,-32486,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -7092,-31990,-7092,-31990,-7092,-31990,-7092,-31990,
                                                          -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                          -9853,-31250,-9853,-31250,-9853,-31250,-9853,-31250,
                                                          -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790,
                                                          -12539,-30272,-12539,-30272,-12539,-30272,-12539,-30272,
                                                          -13847,-29696,-13847,-29696,-13847,-29696,-13847,-29696,
                                                          -15130,-29064,-15130,-29064,-15130,-29064,-15130,-29064
                                                         };
4839 4840

static int16_t twb144[376]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855,
4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890
                                                          32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                          31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          29696,-13847,29696,-13847,29696,-13847,29696,-13847,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          26841,-18794,26841,-18794,26841,-18794,26841,-18794,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                          18794,-26841,18794,-26841,18794,-26841,18794,-26841,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          13847,-29696,13847,-29696,13847,-29696,13847,-29696,
                                                          11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                          8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          2855,-32642,2855,-32642,2855,-32642,2855,-32642,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -2855,-32642,-2855,-32642,-2855,-32642,-2855,-32642,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                          -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790,
                                                          -13847,-29696,-13847,-29696,-13847,-29696,-13847,-29696,
                                                          -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                          -18794,-26841,-18794,-26841,-18794,-26841,-18794,-26841,
                                                          -21062,-25100,-21062,-25100,-21062,-25100,-21062,-25100,
                                                          -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                          -25100,-21062,-25100,-21062,-25100,-21062,-25100,-21062,
                                                          -26841,-18794,-26841,-18794,-26841,-18794,-26841,-18794,
                                                          -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                          -29696,-13847,-29696,-13847,-29696,-13847,-29696,-13847,
                                                          -30790,-11206,-30790,-11206,-30790,-11206,-30790,-11206,
                                                          -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480,
                                                          -32269,-5689,-32269,-5689,-32269,-5689,-32269,-5689,
                                                          -32642,-2855,-32642,-2855,-32642,-2855,-32642,-2855,
                                                          -32767,0,-32767,0,-32767,0,-32767,0,
                                                          -32642,2855,-32642,2855,-32642,2855,-32642,2855,
                                                          -32269,5689,-32269,5689,-32269,5689,-32269,5689,
                                                          -31650,8480,-31650,8480,-31650,8480,-31650,8480,
                                                          -30790,11206,-30790,11206,-30790,11206,-30790,11206,
                                                          -29696,13847,-29696,13847,-29696,13847,-29696,13847,
                                                          -28377,16383,-28377,16383,-28377,16383,-28377,16383,
                                                          -26841,18794,-26841,18794,-26841,18794,-26841,18794,
                                                          -25100,21062,-25100,21062,-25100,21062,-25100,21062,
                                                          -23169,23169,-23169,23169,-23169,23169,-23169,23169,
                                                          -21062,25100,-21062,25100,-21062,25100,-21062,25100,
                                                          -18794,26841,-18794,26841,-18794,26841,-18794,26841
                                                         };

void dft144(int16_t *x,int16_t *y,unsigned char scale_flag)
{
4891 4892

  int i,j;
4893 4894 4895 4896 4897 4898
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa144[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb144[0];
  simd_q15_t x2128[144];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[144];//=&ytmp128array2[0];
4899 4900 4901



4902
  for (i=0,j=0; i<48; i++,j+=3) {
4903 4904 4905 4906 4907 4908 4909 4910 4911 4912
    x2128[i]    = x128[j];
    x2128[i+48] = x128[j+1];
    x2128[i+96] = x128[j+2];
  }

  dft48((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft48((int16_t *)(x2128+48),(int16_t *)(ytmp128+48),1);
  dft48((int16_t *)(x2128+96),(int16_t *)(ytmp128+96),1);

  bfly3_tw1(ytmp128,ytmp128+48,ytmp128+96,y128,y128+48,y128+96);
4913 4914

  for (i=1,j=0; i<48; i++,j++) {
4915
    bfly3(ytmp128+i,
4916 4917 4918 4919 4920 4921 4922
          ytmp128+48+i,
          ytmp128+96+i,
          y128+i,
          y128+48+i,
          y128+96+i,
          twa128+j,
          twb128+j);
4923 4924 4925
  }

  if (scale_flag==1) {
4926
    norm128 = set1_int16(dft_norm_table[9]);
4927 4928

    for (i=0; i<144; i++) {
4929
      y128[i] = mulhi_int16(y128[i],norm128);
4930 4931 4932 4933 4934 4935 4936 4937 4938
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa180[472]__attribute__((aligned(16))) = {32747,-1143,32747,-1143,32747,-1143,32747,-1143,
4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997
                                                          32687,-2285,32687,-2285,32687,-2285,32687,-2285,
                                                          32587,-3425,32587,-3425,32587,-3425,32587,-3425,
                                                          32448,-4560,32448,-4560,32448,-4560,32448,-4560,
                                                          32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                          32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                          31793,-7927,31793,-7927,31793,-7927,31793,-7927,
                                                          31497,-9031,31497,-9031,31497,-9031,31497,-9031,
                                                          31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          30381,-12274,30381,-12274,30381,-12274,30381,-12274,
                                                          29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                          29450,-14364,29450,-14364,29450,-14364,29450,-14364,
                                                          28931,-15383,28931,-15383,28931,-15383,28931,-15383,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27787,-17363,27787,-17363,27787,-17363,27787,-17363,
                                                          27165,-18323,27165,-18323,27165,-18323,27165,-18323,
                                                          26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                          25820,-20173,25820,-20173,25820,-20173,25820,-20173,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          24350,-21925,24350,-21925,24350,-21925,24350,-21925,
                                                          23570,-22761,23570,-22761,23570,-22761,23570,-22761,
                                                          22761,-23570,22761,-23570,22761,-23570,22761,-23570,
                                                          21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                          21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                          20173,-25820,20173,-25820,20173,-25820,20173,-25820,
                                                          19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                          18323,-27165,18323,-27165,18323,-27165,18323,-27165,
                                                          17363,-27787,17363,-27787,17363,-27787,17363,-27787,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          15383,-28931,15383,-28931,15383,-28931,15383,-28931,
                                                          14364,-29450,14364,-29450,14364,-29450,14364,-29450,
                                                          13327,-29934,13327,-29934,13327,-29934,13327,-29934,
                                                          12274,-30381,12274,-30381,12274,-30381,12274,-30381,
                                                          11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                          10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                          9031,-31497,9031,-31497,9031,-31497,9031,-31497,
                                                          7927,-31793,7927,-31793,7927,-31793,7927,-31793,
                                                          6812,-32050,6812,-32050,6812,-32050,6812,-32050,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          4560,-32448,4560,-32448,4560,-32448,4560,-32448,
                                                          3425,-32587,3425,-32587,3425,-32587,3425,-32587,
                                                          2285,-32687,2285,-32687,2285,-32687,2285,-32687,
                                                          1143,-32747,1143,-32747,1143,-32747,1143,-32747,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -1143,-32747,-1143,-32747,-1143,-32747,-1143,-32747,
                                                          -2285,-32687,-2285,-32687,-2285,-32687,-2285,-32687,
                                                          -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587,
                                                          -4560,-32448,-4560,-32448,-4560,-32448,-4560,-32448,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -6812,-32050,-6812,-32050,-6812,-32050,-6812,-32050,
                                                          -7927,-31793,-7927,-31793,-7927,-31793,-7927,-31793,
                                                          -9031,-31497,-9031,-31497,-9031,-31497,-9031,-31497,
                                                          -10125,-31163,-10125,-31163,-10125,-31163,-10125,-31163,
                                                          -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790,
                                                          -12274,-30381,-12274,-30381,-12274,-30381,-12274,-30381,
                                                          -13327,-29934,-13327,-29934,-13327,-29934,-13327,-29934,
                                                          -14364,-29450,-14364,-29450,-14364,-29450,-14364,-29450,
                                                          -15383,-28931,-15383,-28931,-15383,-28931,-15383,-28931
                                                         };
4998 4999

static int16_t twb180[472]__attribute__((aligned(16))) = {32687,-2285,32687,-2285,32687,-2285,32687,-2285,
5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061
                                                          32448,-4560,32448,-4560,32448,-4560,32448,-4560,
                                                          32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                          31497,-9031,31497,-9031,31497,-9031,31497,-9031,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                          28931,-15383,28931,-15383,28931,-15383,28931,-15383,
                                                          27787,-17363,27787,-17363,27787,-17363,27787,-17363,
                                                          26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          23570,-22761,23570,-22761,23570,-22761,23570,-22761,
                                                          21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                          20173,-25820,20173,-25820,20173,-25820,20173,-25820,
                                                          18323,-27165,18323,-27165,18323,-27165,18323,-27165,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          14364,-29450,14364,-29450,14364,-29450,14364,-29450,
                                                          12274,-30381,12274,-30381,12274,-30381,12274,-30381,
                                                          10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                          7927,-31793,7927,-31793,7927,-31793,7927,-31793,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          3425,-32587,3425,-32587,3425,-32587,3425,-32587,
                                                          1143,-32747,1143,-32747,1143,-32747,1143,-32747,
                                                          -1143,-32747,-1143,-32747,-1143,-32747,-1143,-32747,
                                                          -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -7927,-31793,-7927,-31793,-7927,-31793,-7927,-31793,
                                                          -10125,-31163,-10125,-31163,-10125,-31163,-10125,-31163,
                                                          -12274,-30381,-12274,-30381,-12274,-30381,-12274,-30381,
                                                          -14364,-29450,-14364,-29450,-14364,-29450,-14364,-29450,
                                                          -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                          -18323,-27165,-18323,-27165,-18323,-27165,-18323,-27165,
                                                          -20173,-25820,-20173,-25820,-20173,-25820,-20173,-25820,
                                                          -21925,-24350,-21925,-24350,-21925,-24350,-21925,-24350,
                                                          -23570,-22761,-23570,-22761,-23570,-22761,-23570,-22761,
                                                          -25100,-21062,-25100,-21062,-25100,-21062,-25100,-21062,
                                                          -26509,-19259,-26509,-19259,-26509,-19259,-26509,-19259,
                                                          -27787,-17363,-27787,-17363,-27787,-17363,-27787,-17363,
                                                          -28931,-15383,-28931,-15383,-28931,-15383,-28931,-15383,
                                                          -29934,-13327,-29934,-13327,-29934,-13327,-29934,-13327,
                                                          -30790,-11206,-30790,-11206,-30790,-11206,-30790,-11206,
                                                          -31497,-9031,-31497,-9031,-31497,-9031,-31497,-9031,
                                                          -32050,-6812,-32050,-6812,-32050,-6812,-32050,-6812,
                                                          -32448,-4560,-32448,-4560,-32448,-4560,-32448,-4560,
                                                          -32687,-2285,-32687,-2285,-32687,-2285,-32687,-2285,
                                                          -32767,0,-32767,0,-32767,0,-32767,0,
                                                          -32687,2285,-32687,2285,-32687,2285,-32687,2285,
                                                          -32448,4560,-32448,4560,-32448,4560,-32448,4560,
                                                          -32050,6812,-32050,6812,-32050,6812,-32050,6812,
                                                          -31497,9031,-31497,9031,-31497,9031,-31497,9031,
                                                          -30790,11206,-30790,11206,-30790,11206,-30790,11206,
                                                          -29934,13327,-29934,13327,-29934,13327,-29934,13327,
                                                          -28931,15383,-28931,15383,-28931,15383,-28931,15383,
                                                          -27787,17363,-27787,17363,-27787,17363,-27787,17363,
                                                          -26509,19259,-26509,19259,-26509,19259,-26509,19259,
                                                          -25100,21062,-25100,21062,-25100,21062,-25100,21062,
                                                          -23570,22761,-23570,22761,-23570,22761,-23570,22761,
                                                          -21925,24350,-21925,24350,-21925,24350,-21925,24350,
                                                          -20173,25820,-20173,25820,-20173,25820,-20173,25820,
                                                          -18323,27165,-18323,27165,-18323,27165,-18323,27165
                                                         };

void dft180(int16_t *x,int16_t *y,unsigned char scale_flag)
{
5062 5063

  int i,j;
5064 5065 5066 5067 5068 5069
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa180[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb180[0];
  simd_q15_t x2128[180];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[180];//=&ytmp128array2[0];
5070 5071 5072



5073
  for (i=0,j=0; i<60; i++,j+=3) {
5074 5075 5076 5077 5078 5079 5080 5081 5082 5083
    x2128[i]    = x128[j];
    x2128[i+60] = x128[j+1];
    x2128[i+120] = x128[j+2];
  }

  dft60((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft60((int16_t *)(x2128+60),(int16_t *)(ytmp128+60),1);
  dft60((int16_t *)(x2128+120),(int16_t *)(ytmp128+120),1);

  bfly3_tw1(ytmp128,ytmp128+60,ytmp128+120,y128,y128+60,y128+120);
5084 5085

  for (i=1,j=0; i<60; i++,j++) {
5086
    bfly3(ytmp128+i,
5087 5088 5089 5090 5091 5092 5093
          ytmp128+60+i,
          ytmp128+120+i,
          y128+i,
          y128+60+i,
          y128+120+i,
          twa128+j,
          twb128+j);
5094 5095 5096
  }

  if (scale_flag==1) {
5097
    norm128 = set1_int16(dft_norm_table[10]);
5098 5099

    for (i=0; i<180; i++) {
5100
      y128[i] = mulhi_int16(y128[i],norm128);
5101 5102 5103 5104 5105 5106 5107 5108 5109
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa192[376]__attribute__((aligned(16))) = {32749,-1072,32749,-1072,32749,-1072,32749,-1072,
5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156
                                                          32696,-2143,32696,-2143,32696,-2143,32696,-2143,
                                                          32609,-3211,32609,-3211,32609,-3211,32609,-3211,
                                                          32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                          32329,-5337,32329,-5337,32329,-5337,32329,-5337,
                                                          32137,-6392,32137,-6392,32137,-6392,32137,-6392,
                                                          31911,-7440,31911,-7440,31911,-7440,31911,-7440,
                                                          31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                          31356,-9511,31356,-9511,31356,-9511,31356,-9511,
                                                          31028,-10532,31028,-10532,31028,-10532,31028,-10532,
                                                          30666,-11542,30666,-11542,30666,-11542,30666,-11542,
                                                          30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                          29846,-13523,29846,-13523,29846,-13523,29846,-13523,
                                                          29387,-14492,29387,-14492,29387,-14492,29387,-14492,
                                                          28897,-15446,28897,-15446,28897,-15446,28897,-15446,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27825,-17303,27825,-17303,27825,-17303,27825,-17303,
                                                          27244,-18204,27244,-18204,27244,-18204,27244,-18204,
                                                          26634,-19086,26634,-19086,26634,-19086,26634,-19086,
                                                          25995,-19947,25995,-19947,25995,-19947,25995,-19947,
                                                          25329,-20787,25329,-20787,25329,-20787,25329,-20787,
                                                          24635,-21604,24635,-21604,24635,-21604,24635,-21604,
                                                          23915,-22399,23915,-22399,23915,-22399,23915,-22399,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          22399,-23915,22399,-23915,22399,-23915,22399,-23915,
                                                          21604,-24635,21604,-24635,21604,-24635,21604,-24635,
                                                          20787,-25329,20787,-25329,20787,-25329,20787,-25329,
                                                          19947,-25995,19947,-25995,19947,-25995,19947,-25995,
                                                          19086,-26634,19086,-26634,19086,-26634,19086,-26634,
                                                          18204,-27244,18204,-27244,18204,-27244,18204,-27244,
                                                          17303,-27825,17303,-27825,17303,-27825,17303,-27825,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          15446,-28897,15446,-28897,15446,-28897,15446,-28897,
                                                          14492,-29387,14492,-29387,14492,-29387,14492,-29387,
                                                          13523,-29846,13523,-29846,13523,-29846,13523,-29846,
                                                          12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                          11542,-30666,11542,-30666,11542,-30666,11542,-30666,
                                                          10532,-31028,10532,-31028,10532,-31028,10532,-31028,
                                                          9511,-31356,9511,-31356,9511,-31356,9511,-31356,
                                                          8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                          7440,-31911,7440,-31911,7440,-31911,7440,-31911,
                                                          6392,-32137,6392,-32137,6392,-32137,6392,-32137,
                                                          5337,-32329,5337,-32329,5337,-32329,5337,-32329,
                                                          4276,-32486,4276,-32486,4276,-32486,4276,-32486,
                                                          3211,-32609,3211,-32609,3211,-32609,3211,-32609,
                                                          2143,-32696,2143,-32696,2143,-32696,2143,-32696,
                                                          1072,-32749,1072,-32749,1072,-32749,1072,-32749
                                                         };
5157 5158

static int16_t twb192[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143,
5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205
                                                          32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                          32137,-6392,32137,-6392,32137,-6392,32137,-6392,
                                                          31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                          31028,-10532,31028,-10532,31028,-10532,31028,-10532,
                                                          30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                          29387,-14492,29387,-14492,29387,-14492,29387,-14492,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27244,-18204,27244,-18204,27244,-18204,27244,-18204,
                                                          25995,-19947,25995,-19947,25995,-19947,25995,-19947,
                                                          24635,-21604,24635,-21604,24635,-21604,24635,-21604,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          21604,-24635,21604,-24635,21604,-24635,21604,-24635,
                                                          19947,-25995,19947,-25995,19947,-25995,19947,-25995,
                                                          18204,-27244,18204,-27244,18204,-27244,18204,-27244,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          14492,-29387,14492,-29387,14492,-29387,14492,-29387,
                                                          12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                          10532,-31028,10532,-31028,10532,-31028,10532,-31028,
                                                          8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                          6392,-32137,6392,-32137,6392,-32137,6392,-32137,
                                                          4276,-32486,4276,-32486,4276,-32486,4276,-32486,
                                                          2143,-32696,2143,-32696,2143,-32696,2143,-32696,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -2143,-32696,-2143,-32696,-2143,-32696,-2143,-32696,
                                                          -4276,-32486,-4276,-32486,-4276,-32486,-4276,-32486,
                                                          -6392,-32137,-6392,-32137,-6392,-32137,-6392,-32137,
                                                          -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                          -10532,-31028,-10532,-31028,-10532,-31028,-10532,-31028,
                                                          -12539,-30272,-12539,-30272,-12539,-30272,-12539,-30272,
                                                          -14492,-29387,-14492,-29387,-14492,-29387,-14492,-29387,
                                                          -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                          -18204,-27244,-18204,-27244,-18204,-27244,-18204,-27244,
                                                          -19947,-25995,-19947,-25995,-19947,-25995,-19947,-25995,
                                                          -21604,-24635,-21604,-24635,-21604,-24635,-21604,-24635,
                                                          -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                          -24635,-21604,-24635,-21604,-24635,-21604,-24635,-21604,
                                                          -25995,-19947,-25995,-19947,-25995,-19947,-25995,-19947,
                                                          -27244,-18204,-27244,-18204,-27244,-18204,-27244,-18204,
                                                          -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                          -29387,-14492,-29387,-14492,-29387,-14492,-29387,-14492,
                                                          -30272,-12539,-30272,-12539,-30272,-12539,-30272,-12539,
                                                          -31028,-10532,-31028,-10532,-31028,-10532,-31028,-10532,
                                                          -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480,
                                                          -32137,-6392,-32137,-6392,-32137,-6392,-32137,-6392,
                                                          -32486,-4276,-32486,-4276,-32486,-4276,-32486,-4276,
                                                          -32696,-2143,-32696,-2143,-32696,-2143,-32696,-2143
                                                         };
5206 5207

static int16_t twc192[376]__attribute__((aligned(16))) = {32609,-3211,32609,-3211,32609,-3211,32609,-3211,
5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257
                                                          32137,-6392,32137,-6392,32137,-6392,32137,-6392,
                                                          31356,-9511,31356,-9511,31356,-9511,31356,-9511,
                                                          30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                          28897,-15446,28897,-15446,28897,-15446,28897,-15446,
                                                          27244,-18204,27244,-18204,27244,-18204,27244,-18204,
                                                          25329,-20787,25329,-20787,25329,-20787,25329,-20787,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          20787,-25329,20787,-25329,20787,-25329,20787,-25329,
                                                          18204,-27244,18204,-27244,18204,-27244,18204,-27244,
                                                          15446,-28897,15446,-28897,15446,-28897,15446,-28897,
                                                          12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                          9511,-31356,9511,-31356,9511,-31356,9511,-31356,
                                                          6392,-32137,6392,-32137,6392,-32137,6392,-32137,
                                                          3211,-32609,3211,-32609,3211,-32609,3211,-32609,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -3211,-32609,-3211,-32609,-3211,-32609,-3211,-32609,
                                                          -6392,-32137,-6392,-32137,-6392,-32137,-6392,-32137,
                                                          -9511,-31356,-9511,-31356,-9511,-31356,-9511,-31356,
                                                          -12539,-30272,-12539,-30272,-12539,-30272,-12539,-30272,
                                                          -15446,-28897,-15446,-28897,-15446,-28897,-15446,-28897,
                                                          -18204,-27244,-18204,-27244,-18204,-27244,-18204,-27244,
                                                          -20787,-25329,-20787,-25329,-20787,-25329,-20787,-25329,
                                                          -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                          -25329,-20787,-25329,-20787,-25329,-20787,-25329,-20787,
                                                          -27244,-18204,-27244,-18204,-27244,-18204,-27244,-18204,
                                                          -28897,-15446,-28897,-15446,-28897,-15446,-28897,-15446,
                                                          -30272,-12539,-30272,-12539,-30272,-12539,-30272,-12539,
                                                          -31356,-9511,-31356,-9511,-31356,-9511,-31356,-9511,
                                                          -32137,-6392,-32137,-6392,-32137,-6392,-32137,-6392,
                                                          -32609,-3211,-32609,-3211,-32609,-3211,-32609,-3211,
                                                          -32767,0,-32767,0,-32767,0,-32767,0,
                                                          -32609,3211,-32609,3211,-32609,3211,-32609,3211,
                                                          -32137,6392,-32137,6392,-32137,6392,-32137,6392,
                                                          -31356,9511,-31356,9511,-31356,9511,-31356,9511,
                                                          -30272,12539,-30272,12539,-30272,12539,-30272,12539,
                                                          -28897,15446,-28897,15446,-28897,15446,-28897,15446,
                                                          -27244,18204,-27244,18204,-27244,18204,-27244,18204,
                                                          -25329,20787,-25329,20787,-25329,20787,-25329,20787,
                                                          -23169,23169,-23169,23169,-23169,23169,-23169,23169,
                                                          -20787,25329,-20787,25329,-20787,25329,-20787,25329,
                                                          -18204,27244,-18204,27244,-18204,27244,-18204,27244,
                                                          -15446,28897,-15446,28897,-15446,28897,-15446,28897,
                                                          -12539,30272,-12539,30272,-12539,30272,-12539,30272,
                                                          -9511,31356,-9511,31356,-9511,31356,-9511,31356,
                                                          -6392,32137,-6392,32137,-6392,32137,-6392,32137,
                                                          -3211,32609,-3211,32609,-3211,32609,-3211,32609
                                                         };

void dft192(int16_t *x,int16_t *y,unsigned char scale_flag)
{
5258 5259

  int i,j;
5260 5261 5262 5263 5264 5265 5266
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa192[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb192[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc192[0];
  simd_q15_t x2128[192];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[192];//=&ytmp128array2[0];
5267 5268 5269



5270
  for (i=0,j=0; i<48; i++,j+=4) {
5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282
    x2128[i]    = x128[j];
    x2128[i+48] = x128[j+1];
    x2128[i+96] = x128[j+2];
    x2128[i+144] = x128[j+3];
  }

  dft48((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft48((int16_t *)(x2128+48),(int16_t *)(ytmp128+48),1);
  dft48((int16_t *)(x2128+96),(int16_t *)(ytmp128+96),1);
  dft48((int16_t *)(x2128+144),(int16_t *)(ytmp128+144),1);

  bfly4_tw1(ytmp128,ytmp128+48,ytmp128+96,ytmp128+144,y128,y128+48,y128+96,y128+144);
5283 5284

  for (i=1,j=0; i<48; i++,j++) {
5285
    bfly4(ytmp128+i,
5286 5287 5288 5289 5290 5291 5292 5293 5294 5295
          ytmp128+48+i,
          ytmp128+96+i,
          ytmp128+144+i,
          y128+i,
          y128+48+i,
          y128+96+i,
          y128+144+i,
          twa128+j,
          twb128+j,
          twc128+j);
5296 5297 5298
  }

  if (scale_flag==1) {
5299
    norm128 = set1_int16(dft_norm_table[11]);
5300 5301

    for (i=0; i<192; i++) {
5302
      y128[i] = mulhi_int16(y128[i],norm128);
5303 5304 5305 5306 5307 5308 5309 5310 5311
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa216[568]__attribute__((aligned(16))) = {32753,-953,32753,-953,32753,-953,32753,-953,
5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382
                                                          32711,-1905,32711,-1905,32711,-1905,32711,-1905,
                                                          32642,-2855,32642,-2855,32642,-2855,32642,-2855,
                                                          32545,-3804,32545,-3804,32545,-3804,32545,-3804,
                                                          32421,-4748,32421,-4748,32421,-4748,32421,-4748,
                                                          32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                          32090,-6626,32090,-6626,32090,-6626,32090,-6626,
                                                          31883,-7556,31883,-7556,31883,-7556,31883,-7556,
                                                          31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                          31390,-9397,31390,-9397,31390,-9397,31390,-9397,
                                                          31103,-10306,31103,-10306,31103,-10306,31103,-10306,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          30451,-12097,30451,-12097,30451,-12097,30451,-12097,
                                                          30087,-12978,30087,-12978,30087,-12978,30087,-12978,
                                                          29696,-13847,29696,-13847,29696,-13847,29696,-13847,
                                                          29281,-14705,29281,-14705,29281,-14705,29281,-14705,
                                                          28841,-15551,28841,-15551,28841,-15551,28841,-15551,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27888,-17201,27888,-17201,27888,-17201,27888,-17201,
                                                          27376,-18005,27376,-18005,27376,-18005,27376,-18005,
                                                          26841,-18794,26841,-18794,26841,-18794,26841,-18794,
                                                          26283,-19567,26283,-19567,26283,-19567,26283,-19567,
                                                          25702,-20323,25702,-20323,25702,-20323,25702,-20323,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          24477,-21783,24477,-21783,24477,-21783,24477,-21783,
                                                          23833,-22486,23833,-22486,23833,-22486,23833,-22486,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          22486,-23833,22486,-23833,22486,-23833,22486,-23833,
                                                          21783,-24477,21783,-24477,21783,-24477,21783,-24477,
                                                          21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                          20323,-25702,20323,-25702,20323,-25702,20323,-25702,
                                                          19567,-26283,19567,-26283,19567,-26283,19567,-26283,
                                                          18794,-26841,18794,-26841,18794,-26841,18794,-26841,
                                                          18005,-27376,18005,-27376,18005,-27376,18005,-27376,
                                                          17201,-27888,17201,-27888,17201,-27888,17201,-27888,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          15551,-28841,15551,-28841,15551,-28841,15551,-28841,
                                                          14705,-29281,14705,-29281,14705,-29281,14705,-29281,
                                                          13847,-29696,13847,-29696,13847,-29696,13847,-29696,
                                                          12978,-30087,12978,-30087,12978,-30087,12978,-30087,
                                                          12097,-30451,12097,-30451,12097,-30451,12097,-30451,
                                                          11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                          10306,-31103,10306,-31103,10306,-31103,10306,-31103,
                                                          9397,-31390,9397,-31390,9397,-31390,9397,-31390,
                                                          8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                          7556,-31883,7556,-31883,7556,-31883,7556,-31883,
                                                          6626,-32090,6626,-32090,6626,-32090,6626,-32090,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          4748,-32421,4748,-32421,4748,-32421,4748,-32421,
                                                          3804,-32545,3804,-32545,3804,-32545,3804,-32545,
                                                          2855,-32642,2855,-32642,2855,-32642,2855,-32642,
                                                          1905,-32711,1905,-32711,1905,-32711,1905,-32711,
                                                          953,-32753,953,-32753,953,-32753,953,-32753,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -953,-32753,-953,-32753,-953,-32753,-953,-32753,
                                                          -1905,-32711,-1905,-32711,-1905,-32711,-1905,-32711,
                                                          -2855,-32642,-2855,-32642,-2855,-32642,-2855,-32642,
                                                          -3804,-32545,-3804,-32545,-3804,-32545,-3804,-32545,
                                                          -4748,-32421,-4748,-32421,-4748,-32421,-4748,-32421,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -6626,-32090,-6626,-32090,-6626,-32090,-6626,-32090,
                                                          -7556,-31883,-7556,-31883,-7556,-31883,-7556,-31883,
                                                          -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                          -9397,-31390,-9397,-31390,-9397,-31390,-9397,-31390,
                                                          -10306,-31103,-10306,-31103,-10306,-31103,-10306,-31103,
                                                          -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790,
                                                          -12097,-30451,-12097,-30451,-12097,-30451,-12097,-30451,
                                                          -12978,-30087,-12978,-30087,-12978,-30087,-12978,-30087,
                                                          -13847,-29696,-13847,-29696,-13847,-29696,-13847,-29696,
                                                          -14705,-29281,-14705,-29281,-14705,-29281,-14705,-29281,
                                                          -15551,-28841,-15551,-28841,-15551,-28841,-15551,-28841
                                                         };
5383 5384

static int16_t twb216[568]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905,
5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458
                                                          32545,-3804,32545,-3804,32545,-3804,32545,-3804,
                                                          32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                          31883,-7556,31883,-7556,31883,-7556,31883,-7556,
                                                          31390,-9397,31390,-9397,31390,-9397,31390,-9397,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          30087,-12978,30087,-12978,30087,-12978,30087,-12978,
                                                          29281,-14705,29281,-14705,29281,-14705,29281,-14705,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27376,-18005,27376,-18005,27376,-18005,27376,-18005,
                                                          26283,-19567,26283,-19567,26283,-19567,26283,-19567,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          23833,-22486,23833,-22486,23833,-22486,23833,-22486,
                                                          22486,-23833,22486,-23833,22486,-23833,22486,-23833,
                                                          21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                          19567,-26283,19567,-26283,19567,-26283,19567,-26283,
                                                          18005,-27376,18005,-27376,18005,-27376,18005,-27376,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          14705,-29281,14705,-29281,14705,-29281,14705,-29281,
                                                          12978,-30087,12978,-30087,12978,-30087,12978,-30087,
                                                          11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                          9397,-31390,9397,-31390,9397,-31390,9397,-31390,
                                                          7556,-31883,7556,-31883,7556,-31883,7556,-31883,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          3804,-32545,3804,-32545,3804,-32545,3804,-32545,
                                                          1905,-32711,1905,-32711,1905,-32711,1905,-32711,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -1905,-32711,-1905,-32711,-1905,-32711,-1905,-32711,
                                                          -3804,-32545,-3804,-32545,-3804,-32545,-3804,-32545,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -7556,-31883,-7556,-31883,-7556,-31883,-7556,-31883,
                                                          -9397,-31390,-9397,-31390,-9397,-31390,-9397,-31390,
                                                          -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790,
                                                          -12978,-30087,-12978,-30087,-12978,-30087,-12978,-30087,
                                                          -14705,-29281,-14705,-29281,-14705,-29281,-14705,-29281,
                                                          -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                          -18005,-27376,-18005,-27376,-18005,-27376,-18005,-27376,
                                                          -19567,-26283,-19567,-26283,-19567,-26283,-19567,-26283,
                                                          -21062,-25100,-21062,-25100,-21062,-25100,-21062,-25100,
                                                          -22486,-23833,-22486,-23833,-22486,-23833,-22486,-23833,
                                                          -23833,-22486,-23833,-22486,-23833,-22486,-23833,-22486,
                                                          -25100,-21062,-25100,-21062,-25100,-21062,-25100,-21062,
                                                          -26283,-19567,-26283,-19567,-26283,-19567,-26283,-19567,
                                                          -27376,-18005,-27376,-18005,-27376,-18005,-27376,-18005,
                                                          -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                          -29281,-14705,-29281,-14705,-29281,-14705,-29281,-14705,
                                                          -30087,-12978,-30087,-12978,-30087,-12978,-30087,-12978,
                                                          -30790,-11206,-30790,-11206,-30790,-11206,-30790,-11206,
                                                          -31390,-9397,-31390,-9397,-31390,-9397,-31390,-9397,
                                                          -31883,-7556,-31883,-7556,-31883,-7556,-31883,-7556,
                                                          -32269,-5689,-32269,-5689,-32269,-5689,-32269,-5689,
                                                          -32545,-3804,-32545,-3804,-32545,-3804,-32545,-3804,
                                                          -32711,-1905,-32711,-1905,-32711,-1905,-32711,-1905,
                                                          -32767,0,-32767,0,-32767,0,-32767,0,
                                                          -32711,1905,-32711,1905,-32711,1905,-32711,1905,
                                                          -32545,3804,-32545,3804,-32545,3804,-32545,3804,
                                                          -32269,5689,-32269,5689,-32269,5689,-32269,5689,
                                                          -31883,7556,-31883,7556,-31883,7556,-31883,7556,
                                                          -31390,9397,-31390,9397,-31390,9397,-31390,9397,
                                                          -30790,11206,-30790,11206,-30790,11206,-30790,11206,
                                                          -30087,12978,-30087,12978,-30087,12978,-30087,12978,
                                                          -29281,14705,-29281,14705,-29281,14705,-29281,14705,
                                                          -28377,16383,-28377,16383,-28377,16383,-28377,16383,
                                                          -27376,18005,-27376,18005,-27376,18005,-27376,18005,
                                                          -26283,19567,-26283,19567,-26283,19567,-26283,19567,
                                                          -25100,21062,-25100,21062,-25100,21062,-25100,21062,
                                                          -23833,22486,-23833,22486,-23833,22486,-23833,22486,
                                                          -22486,23833,-22486,23833,-22486,23833,-22486,23833,
                                                          -21062,25100,-21062,25100,-21062,25100,-21062,25100,
                                                          -19567,26283,-19567,26283,-19567,26283,-19567,26283,
                                                          -18005,27376,-18005,27376,-18005,27376,-18005,27376
                                                         };

void dft216(int16_t *x,int16_t *y,unsigned char scale_flag)
{
5459 5460

  int i,j;
5461 5462 5463 5464 5465 5466
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa216[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb216[0];
  simd_q15_t x2128[216];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[216];//=&ytmp128array3[0];
5467 5468 5469



5470
  for (i=0,j=0; i<72; i++,j+=3) {
5471 5472 5473 5474 5475 5476 5477 5478 5479 5480
    x2128[i]    = x128[j];
    x2128[i+72] = x128[j+1];
    x2128[i+144] = x128[j+2];
  }

  dft72((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft72((int16_t *)(x2128+72),(int16_t *)(ytmp128+72),1);
  dft72((int16_t *)(x2128+144),(int16_t *)(ytmp128+144),1);

  bfly3_tw1(ytmp128,ytmp128+72,ytmp128+144,y128,y128+72,y128+144);
5481 5482

  for (i=1,j=0; i<72; i++,j++) {
5483
    bfly3(ytmp128+i,
5484 5485 5486 5487 5488 5489 5490
          ytmp128+72+i,
          ytmp128+144+i,
          y128+i,
          y128+72+i,
          y128+144+i,
          twa128+j,
          twb128+j);
5491 5492 5493
  }

  if (scale_flag==1) {
5494
    norm128 = set1_int16(dft_norm_table[12]);
5495 5496

    for (i=0; i<216; i++) {
5497
      y128[i] = mulhi_int16(y128[i],norm128);
5498 5499 5500 5501 5502 5503 5504 5505 5506
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa240[472]__attribute__((aligned(16))) = {32755,-857,32755,-857,32755,-857,32755,-857,
5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565
                                                          32722,-1714,32722,-1714,32722,-1714,32722,-1714,
                                                          32665,-2570,32665,-2570,32665,-2570,32665,-2570,
                                                          32587,-3425,32587,-3425,32587,-3425,32587,-3425,
                                                          32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                          32363,-5125,32363,-5125,32363,-5125,32363,-5125,
                                                          32218,-5971,32218,-5971,32218,-5971,32218,-5971,
                                                          32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                          31861,-7649,31861,-7649,31861,-7649,31861,-7649,
                                                          31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                          31417,-9306,31417,-9306,31417,-9306,31417,-9306,
                                                          31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                          30887,-10937,30887,-10937,30887,-10937,30887,-10937,
                                                          30590,-11742,30590,-11742,30590,-11742,30590,-11742,
                                                          30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                          29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                          29575,-14106,29575,-14106,29575,-14106,29575,-14106,
                                                          29195,-14875,29195,-14875,29195,-14875,29195,-14875,
                                                          28796,-15635,28796,-15635,28796,-15635,28796,-15635,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27938,-17120,27938,-17120,27938,-17120,27938,-17120,
                                                          27480,-17846,27480,-17846,27480,-17846,27480,-17846,
                                                          27004,-18559,27004,-18559,27004,-18559,27004,-18559,
                                                          26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                          25995,-19947,25995,-19947,25995,-19947,25995,-19947,
                                                          25464,-20620,25464,-20620,25464,-20620,25464,-20620,
                                                          24916,-21280,24916,-21280,24916,-21280,24916,-21280,
                                                          24350,-21925,24350,-21925,24350,-21925,24350,-21925,
                                                          23768,-22555,23768,-22555,23768,-22555,23768,-22555,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          22555,-23768,22555,-23768,22555,-23768,22555,-23768,
                                                          21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                          21280,-24916,21280,-24916,21280,-24916,21280,-24916,
                                                          20620,-25464,20620,-25464,20620,-25464,20620,-25464,
                                                          19947,-25995,19947,-25995,19947,-25995,19947,-25995,
                                                          19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                          18559,-27004,18559,-27004,18559,-27004,18559,-27004,
                                                          17846,-27480,17846,-27480,17846,-27480,17846,-27480,
                                                          17120,-27938,17120,-27938,17120,-27938,17120,-27938,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          15635,-28796,15635,-28796,15635,-28796,15635,-28796,
                                                          14875,-29195,14875,-29195,14875,-29195,14875,-29195,
                                                          14106,-29575,14106,-29575,14106,-29575,14106,-29575,
                                                          13327,-29934,13327,-29934,13327,-29934,13327,-29934,
                                                          12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                          11742,-30590,11742,-30590,11742,-30590,11742,-30590,
                                                          10937,-30887,10937,-30887,10937,-30887,10937,-30887,
                                                          10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                          9306,-31417,9306,-31417,9306,-31417,9306,-31417,
                                                          8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                          7649,-31861,7649,-31861,7649,-31861,7649,-31861,
                                                          6812,-32050,6812,-32050,6812,-32050,6812,-32050,
                                                          5971,-32218,5971,-32218,5971,-32218,5971,-32218,
                                                          5125,-32363,5125,-32363,5125,-32363,5125,-32363,
                                                          4276,-32486,4276,-32486,4276,-32486,4276,-32486,
                                                          3425,-32587,3425,-32587,3425,-32587,3425,-32587,
                                                          2570,-32665,2570,-32665,2570,-32665,2570,-32665,
                                                          1714,-32722,1714,-32722,1714,-32722,1714,-32722,
                                                          857,-32755,857,-32755,857,-32755,857,-32755
                                                         };
5566 5567

static int16_t twb240[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714,
5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626
                                                          32587,-3425,32587,-3425,32587,-3425,32587,-3425,
                                                          32363,-5125,32363,-5125,32363,-5125,32363,-5125,
                                                          32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                          31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                          31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                          30590,-11742,30590,-11742,30590,-11742,30590,-11742,
                                                          29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                          29195,-14875,29195,-14875,29195,-14875,29195,-14875,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27480,-17846,27480,-17846,27480,-17846,27480,-17846,
                                                          26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                          25464,-20620,25464,-20620,25464,-20620,25464,-20620,
                                                          24350,-21925,24350,-21925,24350,-21925,24350,-21925,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                          20620,-25464,20620,-25464,20620,-25464,20620,-25464,
                                                          19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                          17846,-27480,17846,-27480,17846,-27480,17846,-27480,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          14875,-29195,14875,-29195,14875,-29195,14875,-29195,
                                                          13327,-29934,13327,-29934,13327,-29934,13327,-29934,
                                                          11742,-30590,11742,-30590,11742,-30590,11742,-30590,
                                                          10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                          8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                          6812,-32050,6812,-32050,6812,-32050,6812,-32050,
                                                          5125,-32363,5125,-32363,5125,-32363,5125,-32363,
                                                          3425,-32587,3425,-32587,3425,-32587,3425,-32587,
                                                          1714,-32722,1714,-32722,1714,-32722,1714,-32722,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -1714,-32722,-1714,-32722,-1714,-32722,-1714,-32722,
                                                          -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587,
                                                          -5125,-32363,-5125,-32363,-5125,-32363,-5125,-32363,
                                                          -6812,-32050,-6812,-32050,-6812,-32050,-6812,-32050,
                                                          -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                          -10125,-31163,-10125,-31163,-10125,-31163,-10125,-31163,
                                                          -11742,-30590,-11742,-30590,-11742,-30590,-11742,-30590,
                                                          -13327,-29934,-13327,-29934,-13327,-29934,-13327,-29934,
                                                          -14875,-29195,-14875,-29195,-14875,-29195,-14875,-29195,
                                                          -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                          -17846,-27480,-17846,-27480,-17846,-27480,-17846,-27480,
                                                          -19259,-26509,-19259,-26509,-19259,-26509,-19259,-26509,
                                                          -20620,-25464,-20620,-25464,-20620,-25464,-20620,-25464,
                                                          -21925,-24350,-21925,-24350,-21925,-24350,-21925,-24350,
                                                          -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                          -24350,-21925,-24350,-21925,-24350,-21925,-24350,-21925,
                                                          -25464,-20620,-25464,-20620,-25464,-20620,-25464,-20620,
                                                          -26509,-19259,-26509,-19259,-26509,-19259,-26509,-19259,
                                                          -27480,-17846,-27480,-17846,-27480,-17846,-27480,-17846,
                                                          -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                          -29195,-14875,-29195,-14875,-29195,-14875,-29195,-14875,
                                                          -29934,-13327,-29934,-13327,-29934,-13327,-29934,-13327,
                                                          -30590,-11742,-30590,-11742,-30590,-11742,-30590,-11742,
                                                          -31163,-10125,-31163,-10125,-31163,-10125,-31163,-10125,
                                                          -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480,
                                                          -32050,-6812,-32050,-6812,-32050,-6812,-32050,-6812,
                                                          -32363,-5125,-32363,-5125,-32363,-5125,-32363,-5125,
                                                          -32587,-3425,-32587,-3425,-32587,-3425,-32587,-3425,
                                                          -32722,-1714,-32722,-1714,-32722,-1714,-32722,-1714
                                                         };
5627 5628

static int16_t twc240[472]__attribute__((aligned(16))) = {32665,-2570,32665,-2570,32665,-2570,32665,-2570,
5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690
                                                          32363,-5125,32363,-5125,32363,-5125,32363,-5125,
                                                          31861,-7649,31861,-7649,31861,-7649,31861,-7649,
                                                          31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                          30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                          29195,-14875,29195,-14875,29195,-14875,29195,-14875,
                                                          27938,-17120,27938,-17120,27938,-17120,27938,-17120,
                                                          26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                          24916,-21280,24916,-21280,24916,-21280,24916,-21280,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          21280,-24916,21280,-24916,21280,-24916,21280,-24916,
                                                          19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                          17120,-27938,17120,-27938,17120,-27938,17120,-27938,
                                                          14875,-29195,14875,-29195,14875,-29195,14875,-29195,
                                                          12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                          10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                          7649,-31861,7649,-31861,7649,-31861,7649,-31861,
                                                          5125,-32363,5125,-32363,5125,-32363,5125,-32363,
                                                          2570,-32665,2570,-32665,2570,-32665,2570,-32665,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -2570,-32665,-2570,-32665,-2570,-32665,-2570,-32665,
                                                          -5125,-32363,-5125,-32363,-5125,-32363,-5125,-32363,
                                                          -7649,-31861,-7649,-31861,-7649,-31861,-7649,-31861,
                                                          -10125,-31163,-10125,-31163,-10125,-31163,-10125,-31163,
                                                          -12539,-30272,-12539,-30272,-12539,-30272,-12539,-30272,
                                                          -14875,-29195,-14875,-29195,-14875,-29195,-14875,-29195,
                                                          -17120,-27938,-17120,-27938,-17120,-27938,-17120,-27938,
                                                          -19259,-26509,-19259,-26509,-19259,-26509,-19259,-26509,
                                                          -21280,-24916,-21280,-24916,-21280,-24916,-21280,-24916,
                                                          -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                          -24916,-21280,-24916,-21280,-24916,-21280,-24916,-21280,
                                                          -26509,-19259,-26509,-19259,-26509,-19259,-26509,-19259,
                                                          -27938,-17120,-27938,-17120,-27938,-17120,-27938,-17120,
                                                          -29195,-14875,-29195,-14875,-29195,-14875,-29195,-14875,
                                                          -30272,-12539,-30272,-12539,-30272,-12539,-30272,-12539,
                                                          -31163,-10125,-31163,-10125,-31163,-10125,-31163,-10125,
                                                          -31861,-7649,-31861,-7649,-31861,-7649,-31861,-7649,
                                                          -32363,-5125,-32363,-5125,-32363,-5125,-32363,-5125,
                                                          -32665,-2570,-32665,-2570,-32665,-2570,-32665,-2570,
                                                          -32767,0,-32767,0,-32767,0,-32767,0,
                                                          -32665,2570,-32665,2570,-32665,2570,-32665,2570,
                                                          -32363,5125,-32363,5125,-32363,5125,-32363,5125,
                                                          -31861,7649,-31861,7649,-31861,7649,-31861,7649,
                                                          -31163,10125,-31163,10125,-31163,10125,-31163,10125,
                                                          -30272,12539,-30272,12539,-30272,12539,-30272,12539,
                                                          -29195,14875,-29195,14875,-29195,14875,-29195,14875,
                                                          -27938,17120,-27938,17120,-27938,17120,-27938,17120,
                                                          -26509,19259,-26509,19259,-26509,19259,-26509,19259,
                                                          -24916,21280,-24916,21280,-24916,21280,-24916,21280,
                                                          -23169,23169,-23169,23169,-23169,23169,-23169,23169,
                                                          -21280,24916,-21280,24916,-21280,24916,-21280,24916,
                                                          -19259,26509,-19259,26509,-19259,26509,-19259,26509,
                                                          -17120,27938,-17120,27938,-17120,27938,-17120,27938,
                                                          -14875,29195,-14875,29195,-14875,29195,-14875,29195,
                                                          -12539,30272,-12539,30272,-12539,30272,-12539,30272,
                                                          -10125,31163,-10125,31163,-10125,31163,-10125,31163,
                                                          -7649,31861,-7649,31861,-7649,31861,-7649,31861,
                                                          -5125,32363,-5125,32363,-5125,32363,-5125,32363,
                                                          -2570,32665,-2570,32665,-2570,32665,-2570,32665
                                                         };

void dft240(int16_t *x,int16_t *y,unsigned char scale_flag)
{
5691 5692

  int i,j;
5693 5694 5695 5696 5697 5698 5699
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa240[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb240[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc240[0];
  simd_q15_t x2128[240];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[240];//=&ytmp128array2[0];
5700 5701 5702



5703
  for (i=0,j=0; i<60; i++,j+=4) {
5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715
    x2128[i]    = x128[j];
    x2128[i+60] = x128[j+1];
    x2128[i+120] = x128[j+2];
    x2128[i+180] = x128[j+3];
  }

  dft60((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft60((int16_t *)(x2128+60),(int16_t *)(ytmp128+60),1);
  dft60((int16_t *)(x2128+120),(int16_t *)(ytmp128+120),1);
  dft60((int16_t *)(x2128+180),(int16_t *)(ytmp128+180),1);

  bfly4_tw1(ytmp128,ytmp128+60,ytmp128+120,ytmp128+180,y128,y128+60,y128+120,y128+180);
5716 5717

  for (i=1,j=0; i<60; i++,j++) {
5718
    bfly4(ytmp128+i,
5719 5720 5721 5722 5723 5724 5725 5726 5727 5728
          ytmp128+60+i,
          ytmp128+120+i,
          ytmp128+180+i,
          y128+i,
          y128+60+i,
          y128+120+i,
          y128+180+i,
          twa128+j,
          twb128+j,
          twc128+j);
5729 5730 5731
  }

  if (scale_flag==1) {
5732
    norm128 = set1_int16(dft_norm_table[13]);
5733 5734

    for (i=0; i<240; i++) {
5735
      y128[i] = mulhi_int16(y128[i],norm128);
5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756
    }
  }

  _mm_empty();
  _m_empty();

}

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:95)/288));
twb = floor(32767*exp(-sqrt(-1)*2*pi*(2:2:190)/288));
twa2 = zeros(1,191);
twb2 = zeros(1,191);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);


 */
static int16_t twa288[760]__attribute__((aligned(16))) = {32759,-714,32759,-714,32759,-714,32759,-714,
5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851
                                                          32735,-1429,32735,-1429,32735,-1429,32735,-1429,
                                                          32696,-2143,32696,-2143,32696,-2143,32696,-2143,
                                                          32642,-2855,32642,-2855,32642,-2855,32642,-2855,
                                                          32572,-3567,32572,-3567,32572,-3567,32572,-3567,
                                                          32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                          32385,-4984,32385,-4984,32385,-4984,32385,-4984,
                                                          32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                          32137,-6392,32137,-6392,32137,-6392,32137,-6392,
                                                          31990,-7092,31990,-7092,31990,-7092,31990,-7092,
                                                          31827,-7788,31827,-7788,31827,-7788,31827,-7788,
                                                          31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                          31457,-9169,31457,-9169,31457,-9169,31457,-9169,
                                                          31250,-9853,31250,-9853,31250,-9853,31250,-9853,
                                                          31028,-10532,31028,-10532,31028,-10532,31028,-10532,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          30539,-11876,30539,-11876,30539,-11876,30539,-11876,
                                                          30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                          29992,-13196,29992,-13196,29992,-13196,29992,-13196,
                                                          29696,-13847,29696,-13847,29696,-13847,29696,-13847,
                                                          29387,-14492,29387,-14492,29387,-14492,29387,-14492,
                                                          29064,-15130,29064,-15130,29064,-15130,29064,-15130,
                                                          28727,-15760,28727,-15760,28727,-15760,28727,-15760,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          28012,-16998,28012,-16998,28012,-16998,28012,-16998,
                                                          27635,-17605,27635,-17605,27635,-17605,27635,-17605,
                                                          27244,-18204,27244,-18204,27244,-18204,27244,-18204,
                                                          26841,-18794,26841,-18794,26841,-18794,26841,-18794,
                                                          26424,-19375,26424,-19375,26424,-19375,26424,-19375,
                                                          25995,-19947,25995,-19947,25995,-19947,25995,-19947,
                                                          25554,-20509,25554,-20509,25554,-20509,25554,-20509,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          24635,-21604,24635,-21604,24635,-21604,24635,-21604,
                                                          24158,-22137,24158,-22137,24158,-22137,24158,-22137,
                                                          23669,-22658,23669,-22658,23669,-22658,23669,-22658,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          22658,-23669,22658,-23669,22658,-23669,22658,-23669,
                                                          22137,-24158,22137,-24158,22137,-24158,22137,-24158,
                                                          21604,-24635,21604,-24635,21604,-24635,21604,-24635,
                                                          21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                          20509,-25554,20509,-25554,20509,-25554,20509,-25554,
                                                          19947,-25995,19947,-25995,19947,-25995,19947,-25995,
                                                          19375,-26424,19375,-26424,19375,-26424,19375,-26424,
                                                          18794,-26841,18794,-26841,18794,-26841,18794,-26841,
                                                          18204,-27244,18204,-27244,18204,-27244,18204,-27244,
                                                          17605,-27635,17605,-27635,17605,-27635,17605,-27635,
                                                          16998,-28012,16998,-28012,16998,-28012,16998,-28012,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          15760,-28727,15760,-28727,15760,-28727,15760,-28727,
                                                          15130,-29064,15130,-29064,15130,-29064,15130,-29064,
                                                          14492,-29387,14492,-29387,14492,-29387,14492,-29387,
                                                          13847,-29696,13847,-29696,13847,-29696,13847,-29696,
                                                          13196,-29992,13196,-29992,13196,-29992,13196,-29992,
                                                          12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                          11876,-30539,11876,-30539,11876,-30539,11876,-30539,
                                                          11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                          10532,-31028,10532,-31028,10532,-31028,10532,-31028,
                                                          9853,-31250,9853,-31250,9853,-31250,9853,-31250,
                                                          9169,-31457,9169,-31457,9169,-31457,9169,-31457,
                                                          8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                          7788,-31827,7788,-31827,7788,-31827,7788,-31827,
                                                          7092,-31990,7092,-31990,7092,-31990,7092,-31990,
                                                          6392,-32137,6392,-32137,6392,-32137,6392,-32137,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          4984,-32385,4984,-32385,4984,-32385,4984,-32385,
                                                          4276,-32486,4276,-32486,4276,-32486,4276,-32486,
                                                          3567,-32572,3567,-32572,3567,-32572,3567,-32572,
                                                          2855,-32642,2855,-32642,2855,-32642,2855,-32642,
                                                          2143,-32696,2143,-32696,2143,-32696,2143,-32696,
                                                          1429,-32735,1429,-32735,1429,-32735,1429,-32735,
                                                          714,-32759,714,-32759,714,-32759,714,-32759,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -714,-32759,-714,-32759,-714,-32759,-714,-32759,
                                                          -1429,-32735,-1429,-32735,-1429,-32735,-1429,-32735,
                                                          -2143,-32696,-2143,-32696,-2143,-32696,-2143,-32696,
                                                          -2855,-32642,-2855,-32642,-2855,-32642,-2855,-32642,
                                                          -3567,-32572,-3567,-32572,-3567,-32572,-3567,-32572,
                                                          -4276,-32486,-4276,-32486,-4276,-32486,-4276,-32486,
                                                          -4984,-32385,-4984,-32385,-4984,-32385,-4984,-32385,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -6392,-32137,-6392,-32137,-6392,-32137,-6392,-32137,
                                                          -7092,-31990,-7092,-31990,-7092,-31990,-7092,-31990,
                                                          -7788,-31827,-7788,-31827,-7788,-31827,-7788,-31827,
                                                          -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                          -9169,-31457,-9169,-31457,-9169,-31457,-9169,-31457,
                                                          -9853,-31250,-9853,-31250,-9853,-31250,-9853,-31250,
                                                          -10532,-31028,-10532,-31028,-10532,-31028,-10532,-31028,
                                                          -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790,
                                                          -11876,-30539,-11876,-30539,-11876,-30539,-11876,-30539,
                                                          -12539,-30272,-12539,-30272,-12539,-30272,-12539,-30272,
                                                          -13196,-29992,-13196,-29992,-13196,-29992,-13196,-29992,
                                                          -13847,-29696,-13847,-29696,-13847,-29696,-13847,-29696,
                                                          -14492,-29387,-14492,-29387,-14492,-29387,-14492,-29387,
                                                          -15130,-29064,-15130,-29064,-15130,-29064,-15130,-29064,
                                                          -15760,-28727,-15760,-28727,-15760,-28727,-15760,-28727
                                                         };
5852 5853

static int16_t twb288[760]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429,
5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951
                                                          32642,-2855,32642,-2855,32642,-2855,32642,-2855,
                                                          32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                          32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                          31990,-7092,31990,-7092,31990,-7092,31990,-7092,
                                                          31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                          31250,-9853,31250,-9853,31250,-9853,31250,-9853,
                                                          30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                          30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                          29696,-13847,29696,-13847,29696,-13847,29696,-13847,
                                                          29064,-15130,29064,-15130,29064,-15130,29064,-15130,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          27635,-17605,27635,-17605,27635,-17605,27635,-17605,
                                                          26841,-18794,26841,-18794,26841,-18794,26841,-18794,
                                                          25995,-19947,25995,-19947,25995,-19947,25995,-19947,
                                                          25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                          24158,-22137,24158,-22137,24158,-22137,24158,-22137,
                                                          23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                          22137,-24158,22137,-24158,22137,-24158,22137,-24158,
                                                          21062,-25100,21062,-25100,21062,-25100,21062,-25100,
                                                          19947,-25995,19947,-25995,19947,-25995,19947,-25995,
                                                          18794,-26841,18794,-26841,18794,-26841,18794,-26841,
                                                          17605,-27635,17605,-27635,17605,-27635,17605,-27635,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          15130,-29064,15130,-29064,15130,-29064,15130,-29064,
                                                          13847,-29696,13847,-29696,13847,-29696,13847,-29696,
                                                          12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                          11206,-30790,11206,-30790,11206,-30790,11206,-30790,
                                                          9853,-31250,9853,-31250,9853,-31250,9853,-31250,
                                                          8480,-31650,8480,-31650,8480,-31650,8480,-31650,
                                                          7092,-31990,7092,-31990,7092,-31990,7092,-31990,
                                                          5689,-32269,5689,-32269,5689,-32269,5689,-32269,
                                                          4276,-32486,4276,-32486,4276,-32486,4276,-32486,
                                                          2855,-32642,2855,-32642,2855,-32642,2855,-32642,
                                                          1429,-32735,1429,-32735,1429,-32735,1429,-32735,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -1429,-32735,-1429,-32735,-1429,-32735,-1429,-32735,
                                                          -2855,-32642,-2855,-32642,-2855,-32642,-2855,-32642,
                                                          -4276,-32486,-4276,-32486,-4276,-32486,-4276,-32486,
                                                          -5689,-32269,-5689,-32269,-5689,-32269,-5689,-32269,
                                                          -7092,-31990,-7092,-31990,-7092,-31990,-7092,-31990,
                                                          -8480,-31650,-8480,-31650,-8480,-31650,-8480,-31650,
                                                          -9853,-31250,-9853,-31250,-9853,-31250,-9853,-31250,
                                                          -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790,
                                                          -12539,-30272,-12539,-30272,-12539,-30272,-12539,-30272,
                                                          -13847,-29696,-13847,-29696,-13847,-29696,-13847,-29696,
                                                          -15130,-29064,-15130,-29064,-15130,-29064,-15130,-29064,
                                                          -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                          -17605,-27635,-17605,-27635,-17605,-27635,-17605,-27635,
                                                          -18794,-26841,-18794,-26841,-18794,-26841,-18794,-26841,
                                                          -19947,-25995,-19947,-25995,-19947,-25995,-19947,-25995,
                                                          -21062,-25100,-21062,-25100,-21062,-25100,-21062,-25100,
                                                          -22137,-24158,-22137,-24158,-22137,-24158,-22137,-24158,
                                                          -23169,-23169,-23169,-23169,-23169,-23169,-23169,-23169,
                                                          -24158,-22137,-24158,-22137,-24158,-22137,-24158,-22137,
                                                          -25100,-21062,-25100,-21062,-25100,-21062,-25100,-21062,
                                                          -25995,-19947,-25995,-19947,-25995,-19947,-25995,-19947,
                                                          -26841,-18794,-26841,-18794,-26841,-18794,-26841,-18794,
                                                          -27635,-17605,-27635,-17605,-27635,-17605,-27635,-17605,
                                                          -28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,
                                                          -29064,-15130,-29064,-15130,-29064,-15130,-29064,-15130,
                                                          -29696,-13847,-29696,-13847,-29696,-13847,-29696,-13847,
                                                          -30272,-12539,-30272,-12539,-30272,-12539,-30272,-12539,
                                                          -30790,-11206,-30790,-11206,-30790,-11206,-30790,-11206,
                                                          -31250,-9853,-31250,-9853,-31250,-9853,-31250,-9853,
                                                          -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480,
                                                          -31990,-7092,-31990,-7092,-31990,-7092,-31990,-7092,
                                                          -32269,-5689,-32269,-5689,-32269,-5689,-32269,-5689,
                                                          -32486,-4276,-32486,-4276,-32486,-4276,-32486,-4276,
                                                          -32642,-2855,-32642,-2855,-32642,-2855,-32642,-2855,
                                                          -32735,-1429,-32735,-1429,-32735,-1429,-32735,-1429,
                                                          -32767,0,-32767,0,-32767,0,-32767,0,
                                                          -32735,1429,-32735,1429,-32735,1429,-32735,1429,
                                                          -32642,2855,-32642,2855,-32642,2855,-32642,2855,
                                                          -32486,4276,-32486,4276,-32486,4276,-32486,4276,
                                                          -32269,5689,-32269,5689,-32269,5689,-32269,5689,
                                                          -31990,7092,-31990,7092,-31990,7092,-31990,7092,
                                                          -31650,8480,-31650,8480,-31650,8480,-31650,8480,
                                                          -31250,9853,-31250,9853,-31250,9853,-31250,9853,
                                                          -30790,11206,-30790,11206,-30790,11206,-30790,11206,
                                                          -30272,12539,-30272,12539,-30272,12539,-30272,12539,
                                                          -29696,13847,-29696,13847,-29696,13847,-29696,13847,
                                                          -29064,15130,-29064,15130,-29064,15130,-29064,15130,
                                                          -28377,16383,-28377,16383,-28377,16383,-28377,16383,
                                                          -27635,17605,-27635,17605,-27635,17605,-27635,17605,
                                                          -26841,18794,-26841,18794,-26841,18794,-26841,18794,
                                                          -25995,19947,-25995,19947,-25995,19947,-25995,19947,
                                                          -25100,21062,-25100,21062,-25100,21062,-25100,21062,
                                                          -24158,22137,-24158,22137,-24158,22137,-24158,22137,
                                                          -23169,23169,-23169,23169,-23169,23169,-23169,23169,
                                                          -22137,24158,-22137,24158,-22137,24158,-22137,24158,
                                                          -21062,25100,-21062,25100,-21062,25100,-21062,25100,
                                                          -19947,25995,-19947,25995,-19947,25995,-19947,25995,
                                                          -18794,26841,-18794,26841,-18794,26841,-18794,26841,
                                                          -17605,27635,-17605,27635,-17605,27635,-17605,27635
                                                         };

void dft288(int16_t *x,int16_t *y,unsigned char scale_flag)
{
5952 5953

  int i,j;
5954 5955 5956 5957 5958 5959
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa288[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb288[0];
  simd_q15_t x2128[288];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[288];//=&ytmp128array3[0];
5960 5961 5962



5963
  for (i=0,j=0; i<96; i++,j+=3) {
5964 5965 5966 5967 5968 5969 5970 5971 5972 5973
    x2128[i]    = x128[j];
    x2128[i+96] = x128[j+1];
    x2128[i+192] = x128[j+2];
  }

  dft96((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft96((int16_t *)(x2128+96),(int16_t *)(ytmp128+96),1);
  dft96((int16_t *)(x2128+192),(int16_t *)(ytmp128+192),1);

  bfly3_tw1(ytmp128,ytmp128+96,ytmp128+192,y128,y128+96,y128+192);
5974 5975

  for (i=1,j=0; i<96; i++,j++) {
5976
    bfly3(ytmp128+i,
5977 5978 5979 5980 5981 5982 5983
          ytmp128+96+i,
          ytmp128+192+i,
          y128+i,
          y128+96+i,
          y128+192+i,
          twa128+j,
          twb128+j);
5984 5985 5986
  }

  if (scale_flag==1) {
5987
    norm128 = set1_int16(dft_norm_table[14]);
5988 5989

    for (i=0; i<288; i++) {
5990
      y128[i] = mulhi_int16(y128[i],norm128);
5991 5992 5993 5994 5995 5996 5997 5998 5999
    }
  }

  _mm_empty();
  _m_empty();

}

static int16_t twa300[472]__attribute__((aligned(16))) = {32759,-686,32759,-686,32759,-686,32759,-686,
6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058
                                                          32738,-1372,32738,-1372,32738,-1372,32738,-1372,
                                                          32702,-2057,32702,-2057,32702,-2057,32702,-2057,
                                                          32652,-2741,32652,-2741,32652,-2741,32652,-2741,
                                                          32587,-3425,32587,-3425,32587,-3425,32587,-3425,
                                                          32508,-4106,32508,-4106,32508,-4106,32508,-4106,
                                                          32415,-4786,32415,-4786,32415,-4786,32415,-4786,
                                                          32308,-5464,32308,-5464,32308,-5464,32308,-5464,
                                                          32186,-6139,32186,-6139,32186,-6139,32186,-6139,
                                                          32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                          31901,-7482,31901,-7482,31901,-7482,31901,-7482,
                                                          31737,-8148,31737,-8148,31737,-8148,31737,-8148,
                                                          31559,-8811,31559,-8811,31559,-8811,31559,-8811,
                                                          31368,-9470,31368,-9470,31368,-9470,31368,-9470,
                                                          31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                          30944,-10775,30944,-10775,30944,-10775,30944,-10775,
                                                          30711,-11421,30711,-11421,30711,-11421,30711,-11421,
                                                          30465,-12062,30465,-12062,30465,-12062,30465,-12062,
                                                          30206,-12697,30206,-12697,30206,-12697,30206,-12697,
                                                          29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                          29648,-13951,29648,-13951,29648,-13951,29648,-13951,
                                                          29349,-14569,29349,-14569,29349,-14569,29349,-14569,
                                                          29038,-15180,29038,-15180,29038,-15180,29038,-15180,
                                                          28713,-15785,28713,-15785,28713,-15785,28713,-15785,
                                                          28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                          28027,-16974,28027,-16974,28027,-16974,28027,-16974,
                                                          27666,-17557,27666,-17557,27666,-17557,27666,-17557,
                                                          27292,-18132,27292,-18132,27292,-18132,27292,-18132,
                                                          26906,-18700,26906,-18700,26906,-18700,26906,-18700,
                                                          26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                          26099,-19810,26099,-19810,26099,-19810,26099,-19810,
                                                          25679,-20353,25679,-20353,25679,-20353,25679,-20353,
                                                          25247,-20886,25247,-20886,25247,-20886,25247,-20886,
                                                          24804,-21410,24804,-21410,24804,-21410,24804,-21410,
                                                          24350,-21925,24350,-21925,24350,-21925,24350,-21925,
                                                          23886,-22430,23886,-22430,23886,-22430,23886,-22430,
                                                          23411,-22925,23411,-22925,23411,-22925,23411,-22925,
                                                          22925,-23411,22925,-23411,22925,-23411,22925,-23411,
                                                          22430,-23886,22430,-23886,22430,-23886,22430,-23886,
                                                          21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                          21410,-24804,21410,-24804,21410,-24804,21410,-24804,
                                                          20886,-25247,20886,-25247,20886,-25247,20886,-25247,
                                                          20353,-25679,20353,-25679,20353,-25679,20353,-25679,
                                                          19810,-26099,19810,-26099,19810,-26099,19810,-26099,
                                                          19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                          18700,-26906,18700,-26906,18700,-26906,18700,-26906,
                                                          18132,-27292,18132,-27292,18132,-27292,18132,-27292,
                                                          17557,-27666,17557,-27666,17557,-27666,17557,-27666,
                                                          16974,-28027,16974,-28027,16974,-28027,16974,-28027,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          15785,-28713,15785,-28713,15785,-28713,15785,-28713,
                                                          15180,-29038,15180,-29038,15180,-29038,15180,-29038,
                                                          14569,-29349,14569,-29349,14569,-29349,14569,-29349,
                                                          13951,-29648,13951,-29648,13951,-29648,13951,-29648,
                                                          13327,-29934,13327,-29934,13327,-29934,13327,-29934,
                                                          12697,-30206,12697,-30206,12697,-30206,12697,-30206,
                                                          12062,-30465,12062,-30465,12062,-30465,12062,-30465,
                                                          11421,-30711,11421,-30711,11421,-30711,11421,-30711,
                                                          10775,-30944,10775,-30944,10775,-30944,10775,-30944
                                                         };
6059 6060

static int16_t twb300[472]__attribute__((aligned(16))) = {32738,-1372,32738,-1372,32738,-1372,32738,-1372,
6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119
                                                          32652,-2741,32652,-2741,32652,-2741,32652,-2741,
                                                          32508,-4106,32508,-4106,32508,-4106,32508,-4106,
                                                          32308,-5464,32308,-5464,32308,-5464,32308,-5464,
                                                          32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                          31737,-8148,31737,-8148,31737,-8148,31737,-8148,
                                                          31368,-9470,31368,-9470,31368,-9470,31368,-9470,
                                                          30944,-10775,30944,-10775,30944,-10775,30944,-10775,
                                                          30465,-12062,30465,-12062,30465,-12062,30465,-12062,
                                                          29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                          29349,-14569,29349,-14569,29349,-14569,29349,-14569,
                                                          28713,-15785,28713,-15785,28713,-15785,28713,-15785,
                                                          28027,-16974,28027,-16974,28027,-16974,28027,-16974,
                                                          27292,-18132,27292,-18132,27292,-18132,27292,-18132,
                                                          26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                          25679,-20353,25679,-20353,25679,-20353,25679,-20353,
                                                          24804,-21410,24804,-21410,24804,-21410,24804,-21410,
                                                          23886,-22430,23886,-22430,23886,-22430,23886,-22430,
                                                          22925,-23411,22925,-23411,22925,-23411,22925,-23411,
                                                          21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                          20886,-25247,20886,-25247,20886,-25247,20886,-25247,
                                                          19810,-26099,19810,-26099,19810,-26099,19810,-26099,
                                                          18700,-26906,18700,-26906,18700,-26906,18700,-26906,
                                                          17557,-27666,17557,-27666,17557,-27666,17557,-27666,
                                                          16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                          15180,-29038,15180,-29038,15180,-29038,15180,-29038,
                                                          13951,-29648,13951,-29648,13951,-29648,13951,-29648,
                                                          12697,-30206,12697,-30206,12697,-30206,12697,-30206,
                                                          11421,-30711,11421,-30711,11421,-30711,11421,-30711,
                                                          10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                          8811,-31559,8811,-31559,8811,-31559,8811,-31559,
                                                          7482,-31901,7482,-31901,7482,-31901,7482,-31901,
                                                          6139,-32186,6139,-32186,6139,-32186,6139,-32186,
                                                          4786,-32415,4786,-32415,4786,-32415,4786,-32415,
                                                          3425,-32587,3425,-32587,3425,-32587,3425,-32587,
                                                          2057,-32702,2057,-32702,2057,-32702,2057,-32702,
                                                          686,-32759,686,-32759,686,-32759,686,-32759,
                                                          -686,-32759,-686,-32759,-686,-32759,-686,-32759,
                                                          -2057,-32702,-2057,-32702,-2057,-32702,-2057,-32702,
                                                          -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587,
                                                          -4786,-32415,-4786,-32415,-4786,-32415,-4786,-32415,
                                                          -6139,-32186,-6139,-32186,-6139,-32186,-6139,-32186,
                                                          -7482,-31901,-7482,-31901,-7482,-31901,-7482,-31901,
                                                          -8811,-31559,-8811,-31559,-8811,-31559,-8811,-31559,
                                                          -10125,-31163,-10125,-31163,-10125,-31163,-10125,-31163,
                                                          -11421,-30711,-11421,-30711,-11421,-30711,-11421,-30711,
                                                          -12697,-30206,-12697,-30206,-12697,-30206,-12697,-30206,
                                                          -13951,-29648,-13951,-29648,-13951,-29648,-13951,-29648,
                                                          -15180,-29038,-15180,-29038,-15180,-29038,-15180,-29038,
                                                          -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                          -17557,-27666,-17557,-27666,-17557,-27666,-17557,-27666,
                                                          -18700,-26906,-18700,-26906,-18700,-26906,-18700,-26906,
                                                          -19810,-26099,-19810,-26099,-19810,-26099,-19810,-26099,
                                                          -20886,-25247,-20886,-25247,-20886,-25247,-20886,-25247,
                                                          -21925,-24350,-21925,-24350,-21925,-24350,-21925,-24350,
                                                          -22925,-23411,-22925,-23411,-22925,-23411,-22925,-23411,
                                                          -23886,-22430,-23886,-22430,-23886,-22430,-23886,-22430,
                                                          -24804,-21410,-24804,-21410,-24804,-21410,-24804,-21410,
                                                          -25679,-20353,-25679,-20353,-25679,-20353,-25679,-20353
                                                         };
6120 6121

static int16_t twc300[472]__attribute__((aligned(16))) = {32702,-2057,32702,-2057,32702,-2057,32702,-2057,
6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180
                                                          32508,-4106,32508,-4106,32508,-4106,32508,-4106,
                                                          32186,-6139,32186,-6139,32186,-6139,32186,-6139,
                                                          31737,-8148,31737,-8148,31737,-8148,31737,-8148,
                                                          31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                          30465,-12062,30465,-12062,30465,-12062,30465,-12062,
                                                          29648,-13951,29648,-13951,29648,-13951,29648,-13951,
                                                          28713,-15785,28713,-15785,28713,-15785,28713,-15785,
                                                          27666,-17557,27666,-17557,27666,-17557,27666,-17557,
                                                          26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                          25247,-20886,25247,-20886,25247,-20886,25247,-20886,
                                                          23886,-22430,23886,-22430,23886,-22430,23886,-22430,
                                                          22430,-23886,22430,-23886,22430,-23886,22430,-23886,
                                                          20886,-25247,20886,-25247,20886,-25247,20886,-25247,
                                                          19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                          17557,-27666,17557,-27666,17557,-27666,17557,-27666,
                                                          15785,-28713,15785,-28713,15785,-28713,15785,-28713,
                                                          13951,-29648,13951,-29648,13951,-29648,13951,-29648,
                                                          12062,-30465,12062,-30465,12062,-30465,12062,-30465,
                                                          10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                          8148,-31737,8148,-31737,8148,-31737,8148,-31737,
                                                          6139,-32186,6139,-32186,6139,-32186,6139,-32186,
                                                          4106,-32508,4106,-32508,4106,-32508,4106,-32508,
                                                          2057,-32702,2057,-32702,2057,-32702,2057,-32702,
                                                          0,-32767,0,-32767,0,-32767,0,-32767,
                                                          -2057,-32702,-2057,-32702,-2057,-32702,-2057,-32702,
                                                          -4106,-32508,-4106,-32508,-4106,-32508,-4106,-32508,
                                                          -6139,-32186,-6139,-32186,-6139,-32186,-6139,-32186,
                                                          -8148,-31737,-8148,-31737,-8148,-31737,-8148,-31737,
                                                          -10125,-31163,-10125,-31163,-10125,-31163,-10125,-31163,
                                                          -12062,-30465,-12062,-30465,-12062,-30465,-12062,-30465,
                                                          -13951,-29648,-13951,-29648,-13951,-29648,-13951,-29648,
                                                          -15785,-28713,-15785,-28713,-15785,-28713,-15785,-28713,
                                                          -17557,-27666,-17557,-27666,-17557,-27666,-17557,-27666,
                                                          -19259,-26509,-19259,-26509,-19259,-26509,-19259,-26509,
                                                          -20886,-25247,-20886,-25247,-20886,-25247,-20886,-25247,
                                                          -22430,-23886,-22430,-23886,-22430,-23886,-22430,-23886,
                                                          -23886,-22430,-23886,-22430,-23886,-22430,-23886,-22430,
                                                          -25247,-20886,-25247,-20886,-25247,-20886,-25247,-20886,
                                                          -26509,-19259,-26509,-19259,-26509,-19259,-26509,-19259,
                                                          -27666,-17557,-27666,-17557,-27666,-17557,-27666,-17557,
                                                          -28713,-15785,-28713,-15785,-28713,-15785,-28713,-15785,
                                                          -29648,-13951,-29648,-13951,-29648,-13951,-29648,-13951,
                                                          -30465,-12062,-30465,-12062,-30465,-12062,-30465,-12062,
                                                          -31163,-10125,-31163,-10125,-31163,-10125,-31163,-10125,
                                                          -31737,-8148,-31737,-8148,-31737,-8148,-31737,-8148,
                                                          -32186,-6139,-32186,-6139,-32186,-6139,-32186,-6139,
                                                          -32508,-4106,-32508,-4106,-32508,-4106,-32508,-4106,
                                                          -32702,-2057,-32702,-2057,-32702,-2057,-32702,-2057,
                                                          -32767,0,-32767,0,-32767,0,-32767,0,
                                                          -32702,2057,-32702,2057,-32702,2057,-32702,2057,
                                                          -32508,4106,-32508,4106,-32508,4106,-32508,4106,
                                                          -32186,6139,-32186,6139,-32186,6139,-32186,6139,
                                                          -31737,8148,-31737,8148,-31737,8148,-31737,8148,
                                                          -31163,10125,-31163,10125,-31163,10125,-31163,10125,
                                                          -30465,12062,-30465,12062,-30465,12062,-30465,12062,
                                                          -29648,13951,-29648,13951,-29648,13951,-29648,13951,
                                                          -28713,15785,-28713,15785,-28713,15785,-28713,15785,
                                                          -27666,17557,-27666,17557,-27666,17557,-27666,17557
                                                         };
6181 6182

static int16_t twd300[472]__attribute__((aligned(16))) = {32652,-2741,32652,-2741,32652,-2741,32652,-2741,
6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244
                                                          32308,-5464,32308,-5464,32308,-5464,32308,-5464,
                                                          31737,-8148,31737,-8148,31737,-8148,31737,-8148,
                                                          30944,-10775,30944,-10775,30944,-10775,30944,-10775,
                                                          29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                          28713,-15785,28713,-15785,28713,-15785,28713,-15785,
                                                          27292,-18132,27292,-18132,27292,-18132,27292,-18132,
                                                          25679,-20353,25679,-20353,25679,-20353,25679,-20353,
                                                          23886,-22430,23886,-22430,23886,-22430,23886,-22430,
                                                          21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                          19810,-26099,19810,-26099,19810,-26099,19810,-26099,
                                                          17557,-27666,17557,-27666,17557,-27666,17557,-27666,
                                                          15180,-29038,15180,-29038,15180,-29038,15180,-29038,
                                                          12697,-30206,12697,-30206,12697,-30206,12697,-30206,
                                                          10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                          7482,-31901,7482,-31901,7482,-31901,7482,-31901,
                                                          4786,-32415,4786,-32415,4786,-32415,4786,-32415,
                                                          2057,-32702,2057,-32702,2057,-32702,2057,-32702,
                                                          -686,-32759,-686,-32759,-686,-32759,-686,-32759,
                                                          -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587,
                                                          -6139,-32186,-6139,-32186,-6139,-32186,-6139,-32186,
                                                          -8811,-31559,-8811,-31559,-8811,-31559,-8811,-31559,
                                                          -11421,-30711,-11421,-30711,-11421,-30711,-11421,-30711,
                                                          -13951,-29648,-13951,-29648,-13951,-29648,-13951,-29648,
                                                          -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                          -18700,-26906,-18700,-26906,-18700,-26906,-18700,-26906,
                                                          -20886,-25247,-20886,-25247,-20886,-25247,-20886,-25247,
                                                          -22925,-23411,-22925,-23411,-22925,-23411,-22925,-23411,
                                                          -24804,-21410,-24804,-21410,-24804,-21410,-24804,-21410,
                                                          -26509,-19259,-26509,-19259,-26509,-19259,-26509,-19259,
                                                          -28027,-16974,-28027,-16974,-28027,-16974,-28027,-16974,
                                                          -29349,-14569,-29349,-14569,-29349,-14569,-29349,-14569,
                                                          -30465,-12062,-30465,-12062,-30465,-12062,-30465,-12062,
                                                          -31368,-9470,-31368,-9470,-31368,-9470,-31368,-9470,
                                                          -32050,-6812,-32050,-6812,-32050,-6812,-32050,-6812,
                                                          -32508,-4106,-32508,-4106,-32508,-4106,-32508,-4106,
                                                          -32738,-1372,-32738,-1372,-32738,-1372,-32738,-1372,
                                                          -32738,1372,-32738,1372,-32738,1372,-32738,1372,
                                                          -32508,4106,-32508,4106,-32508,4106,-32508,4106,
                                                          -32050,6812,-32050,6812,-32050,6812,-32050,6812,
                                                          -31368,9470,-31368,9470,-31368,9470,-31368,9470,
                                                          -30465,12062,-30465,12062,-30465,12062,-30465,12062,
                                                          -29349,14569,-29349,14569,-29349,14569,-29349,14569,
                                                          -28027,16974,-28027,16974,-28027,16974,-28027,16974,
                                                          -26509,19259,-26509,19259,-26509,19259,-26509,19259,
                                                          -24804,21410,-24804,21410,-24804,21410,-24804,21410,
                                                          -22925,23411,-22925,23411,-22925,23411,-22925,23411,
                                                          -20886,25247,-20886,25247,-20886,25247,-20886,25247,
                                                          -18700,26906,-18700,26906,-18700,26906,-18700,26906,
                                                          -16383,28377,-16383,28377,-16383,28377,-16383,28377,
                                                          -13951,29648,-13951,29648,-13951,29648,-13951,29648,
                                                          -11421,30711,-11421,30711,-11421,30711,-11421,30711,
                                                          -8811,31559,-8811,31559,-8811,31559,-8811,31559,
                                                          -6139,32186,-6139,32186,-6139,32186,-6139,32186,
                                                          -3425,32587,-3425,32587,-3425,32587,-3425,32587,
                                                          -686,32759,-686,32759,-686,32759,-686,32759,
                                                          2057,32702,2057,32702,2057,32702,2057,32702,
                                                          4786,32415,4786,32415,4786,32415,4786,32415,
                                                          7482,31901,7482,31901,7482,31901,7482,31901
                                                         };

void dft300(int16_t *x,int16_t *y,unsigned char scale_flag)
{
6245 6246

  int i,j;
6247 6248 6249 6250 6251 6252 6253 6254
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa300[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb300[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc300[0];
  simd_q15_t *twd128=(simd_q15_t *)&twd300[0];
  simd_q15_t x2128[300];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[300];//=&ytmp128array2[0];
6255 6256 6257



6258
  for (i=0,j=0; i<60; i++,j+=5) {
6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272
    x2128[i]    = x128[j];
    x2128[i+60] = x128[j+1];
    x2128[i+120] = x128[j+2];
    x2128[i+180] = x128[j+3];
    x2128[i+240] = x128[j+4];
  }

  dft60((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft60((int16_t *)(x2128+60),(int16_t *)(ytmp128+60),1);
  dft60((int16_t *)(x2128+120),(int16_t *)(ytmp128+120),1);
  dft60((int16_t *)(x2128+180),(int16_t *)(ytmp128+180),1);
  dft60((int16_t *)(x2128+240),(int16_t *)(ytmp128+240),1);

  bfly5_tw1(ytmp128,ytmp128+60,ytmp128+120,ytmp128+180,ytmp128+240,y128,y128+60,y128+120,y128+180,y128+240);
6273 6274

  for (i=1,j=0; i<60; i++,j++) {
6275
    bfly5(ytmp128+i,
6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288
          ytmp128+60+i,
          ytmp128+120+i,
          ytmp128+180+i,
          ytmp128+240+i,
          y128+i,
          y128+60+i,
          y128+120+i,
          y128+180+i,
          y128+240+i,
          twa128+j,
          twb128+j,
          twc128+j,
          twd128+j);
6289 6290 6291
  }

  if (scale_flag==1) {
6292
    norm128 = set1_int16(dft_norm_table[15]);
6293 6294

    for (i=0; i<300; i++) {
6295
      y128[i] = mulhi_int16(y128[i],norm128);
6296 6297 6298 6299 6300 6301 6302 6303
    }
  }

  _mm_empty();
  _m_empty();

}

Raymond Knopp's avatar
 
Raymond Knopp committed
6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328
/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:107)/324));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:107)/324));
twa2 = zeros(1,2*107);
twb2 = zeros(1,2*107);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa324[107*2*4] = {");
for i=1:2:(2*106)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb324[107*2*4] = {");
for i=1:2:(2*106)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fclose(fd);
 */
static int16_t twa324[107*2*4] = {32760,-636,32760,-636,32760,-636,32760,-636,
6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435
                                  32742,-1271,32742,-1271,32742,-1271,32742,-1271,
                                  32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                  32668,-2540,32668,-2540,32668,-2540,32668,-2540,
                                  32613,-3173,32613,-3173,32613,-3173,32613,-3173,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32465,-4435,32465,-4435,32465,-4435,32465,-4435,
                                  32373,-5064,32373,-5064,32373,-5064,32373,-5064,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32152,-6315,32152,-6315,32152,-6315,32152,-6315,
                                  32024,-6937,32024,-6937,32024,-6937,32024,-6937,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31731,-8174,31731,-8174,31731,-8174,31731,-8174,
                                  31566,-8788,31566,-8788,31566,-8788,31566,-8788,
                                  31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                  31202,-10005,31202,-10005,31202,-10005,31202,-10005,
                                  31002,-10608,31002,-10608,31002,-10608,31002,-10608,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30567,-11802,30567,-11802,30567,-11802,30567,-11802,
                                  30333,-12393,30333,-12393,30333,-12393,30333,-12393,
                                  30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                  29829,-13560,29829,-13560,29829,-13560,29829,-13560,
                                  29561,-14136,29561,-14136,29561,-14136,29561,-14136,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  28990,-15271,28990,-15271,28990,-15271,28990,-15271,
                                  28689,-15831,28689,-15831,28689,-15831,28689,-15831,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28054,-16931,28054,-16931,28054,-16931,28054,-16931,
                                  27720,-17472,27720,-17472,27720,-17472,27720,-17472,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  27022,-18534,27022,-18534,27022,-18534,27022,-18534,
                                  26657,-19054,26657,-19054,26657,-19054,26657,-19054,
                                  26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                  25898,-20074,25898,-20074,25898,-20074,25898,-20074,
                                  25504,-20572,25504,-20572,25504,-20572,25504,-20572,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24687,-21546,24687,-21546,24687,-21546,24687,-21546,
                                  24265,-22020,24265,-22020,24265,-22020,24265,-22020,
                                  23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                  23393,-22945,23393,-22945,23393,-22945,23393,-22945,
                                  22944,-23394,22944,-23394,22944,-23394,22944,-23394,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  22019,-24266,22019,-24266,22019,-24266,22019,-24266,
                                  21545,-24688,21545,-24688,21545,-24688,21545,-24688,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20571,-25505,20571,-25505,20571,-25505,20571,-25505,
                                  20073,-25899,20073,-25899,20073,-25899,20073,-25899,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  19053,-26658,19053,-26658,19053,-26658,19053,-26658,
                                  18533,-27023,18533,-27023,18533,-27023,18533,-27023,
                                  18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                  17471,-27721,17471,-27721,17471,-27721,17471,-27721,
                                  16930,-28055,16930,-28055,16930,-28055,16930,-28055,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15830,-28690,15830,-28690,15830,-28690,15830,-28690,
                                  15270,-28991,15270,-28991,15270,-28991,15270,-28991,
                                  14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                  14135,-29562,14135,-29562,14135,-29562,14135,-29562,
                                  13559,-29830,13559,-29830,13559,-29830,13559,-29830,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12392,-30334,12392,-30334,12392,-30334,12392,-30334,
                                  11801,-30568,11801,-30568,11801,-30568,11801,-30568,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10607,-31003,10607,-31003,10607,-31003,10607,-31003,
                                  10004,-31203,10004,-31203,10004,-31203,10004,-31203,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  8787,-31567,8787,-31567,8787,-31567,8787,-31567,
                                  8173,-31732,8173,-31732,8173,-31732,8173,-31732,
                                  7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                  6936,-32025,6936,-32025,6936,-32025,6936,-32025,
                                  6314,-32153,6314,-32153,6314,-32153,6314,-32153,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5063,-32374,5063,-32374,5063,-32374,5063,-32374,
                                  4434,-32466,4434,-32466,4434,-32466,4434,-32466,
                                  3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                  3172,-32614,3172,-32614,3172,-32614,3172,-32614,
                                  2539,-32669,2539,-32669,2539,-32669,2539,-32669,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1270,-32743,1270,-32743,1270,-32743,1270,-32743,
                                  635,-32761,635,-32761,635,-32761,635,-32761,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -636,-32761,-636,-32761,-636,-32761,-636,-32761,
                                  -1271,-32743,-1271,-32743,-1271,-32743,-1271,-32743,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2540,-32669,-2540,-32669,-2540,-32669,-2540,-32669,
                                  -3173,-32614,-3173,-32614,-3173,-32614,-3173,-32614,
                                  -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                  -4435,-32466,-4435,-32466,-4435,-32466,-4435,-32466,
                                  -5064,-32374,-5064,-32374,-5064,-32374,-5064,-32374,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6315,-32153,-6315,-32153,-6315,-32153,-6315,-32153,
                                  -6937,-32025,-6937,-32025,-6937,-32025,-6937,-32025,
                                  -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                  -8174,-31732,-8174,-31732,-8174,-31732,-8174,-31732,
                                  -8788,-31567,-8788,-31567,-8788,-31567,-8788,-31567,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -10005,-31203,-10005,-31203,-10005,-31203,-10005,-31203,
                                  -10608,-31003,-10608,-31003,-10608,-31003,-10608,-31003,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11802,-30568,-11802,-30568,-11802,-30568,-11802,-30568,
                                  -12393,-30334,-12393,-30334,-12393,-30334,-12393,-30334,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13560,-29830,-13560,-29830,-13560,-29830,-13560,-29830,
                                  -14136,-29562,-14136,-29562,-14136,-29562,-14136,-29562,
                                  -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                  -15271,-28991,-15271,-28991,-15271,-28991,-15271,-28991,
                                  -15831,-28690,-15831,-28690,-15831,-28690,-15831,-28690
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
6436
static int16_t twb324[107*2*4] = {32742,-1271,32742,-1271,32742,-1271,32742,-1271,
6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546
                                  32668,-2540,32668,-2540,32668,-2540,32668,-2540,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32373,-5064,32373,-5064,32373,-5064,32373,-5064,
                                  32152,-6315,32152,-6315,32152,-6315,32152,-6315,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31566,-8788,31566,-8788,31566,-8788,31566,-8788,
                                  31202,-10005,31202,-10005,31202,-10005,31202,-10005,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30333,-12393,30333,-12393,30333,-12393,30333,-12393,
                                  29829,-13560,29829,-13560,29829,-13560,29829,-13560,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  28689,-15831,28689,-15831,28689,-15831,28689,-15831,
                                  28054,-16931,28054,-16931,28054,-16931,28054,-16931,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  26657,-19054,26657,-19054,26657,-19054,26657,-19054,
                                  25898,-20074,25898,-20074,25898,-20074,25898,-20074,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24265,-22020,24265,-22020,24265,-22020,24265,-22020,
                                  23393,-22945,23393,-22945,23393,-22945,23393,-22945,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  21545,-24688,21545,-24688,21545,-24688,21545,-24688,
                                  20571,-25505,20571,-25505,20571,-25505,20571,-25505,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  18533,-27023,18533,-27023,18533,-27023,18533,-27023,
                                  17471,-27721,17471,-27721,17471,-27721,17471,-27721,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15270,-28991,15270,-28991,15270,-28991,15270,-28991,
                                  14135,-29562,14135,-29562,14135,-29562,14135,-29562,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  11801,-30568,11801,-30568,11801,-30568,11801,-30568,
                                  10607,-31003,10607,-31003,10607,-31003,10607,-31003,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  8173,-31732,8173,-31732,8173,-31732,8173,-31732,
                                  6936,-32025,6936,-32025,6936,-32025,6936,-32025,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  4434,-32466,4434,-32466,4434,-32466,4434,-32466,
                                  3172,-32614,3172,-32614,3172,-32614,3172,-32614,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  635,-32761,635,-32761,635,-32761,635,-32761,
                                  -636,-32761,-636,-32761,-636,-32761,-636,-32761,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -3173,-32614,-3173,-32614,-3173,-32614,-3173,-32614,
                                  -4435,-32466,-4435,-32466,-4435,-32466,-4435,-32466,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6937,-32025,-6937,-32025,-6937,-32025,-6937,-32025,
                                  -8174,-31732,-8174,-31732,-8174,-31732,-8174,-31732,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -10608,-31003,-10608,-31003,-10608,-31003,-10608,-31003,
                                  -11802,-30568,-11802,-30568,-11802,-30568,-11802,-30568,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -14136,-29562,-14136,-29562,-14136,-29562,-14136,-29562,
                                  -15271,-28991,-15271,-28991,-15271,-28991,-15271,-28991,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -17472,-27721,-17472,-27721,-17472,-27721,-17472,-27721,
                                  -18534,-27023,-18534,-27023,-18534,-27023,-18534,-27023,
                                  -19568,-26284,-19568,-26284,-19568,-26284,-19568,-26284,
                                  -20572,-25505,-20572,-25505,-20572,-25505,-20572,-25505,
                                  -21546,-24688,-21546,-24688,-21546,-24688,-21546,-24688,
                                  -22487,-23834,-22487,-23834,-22487,-23834,-22487,-23834,
                                  -23394,-22945,-23394,-22945,-23394,-22945,-23394,-22945,
                                  -24266,-22020,-24266,-22020,-24266,-22020,-24266,-22020,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25899,-20074,-25899,-20074,-25899,-20074,-25899,-20074,
                                  -26658,-19054,-26658,-19054,-26658,-19054,-26658,-19054,
                                  -27377,-18006,-27377,-18006,-27377,-18006,-27377,-18006,
                                  -28055,-16931,-28055,-16931,-28055,-16931,-28055,-16931,
                                  -28690,-15831,-28690,-15831,-28690,-15831,-28690,-15831,
                                  -29282,-14706,-29282,-14706,-29282,-14706,-29282,-14706,
                                  -29830,-13560,-29830,-13560,-29830,-13560,-29830,-13560,
                                  -30334,-12393,-30334,-12393,-30334,-12393,-30334,-12393,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -31203,-10005,-31203,-10005,-31203,-10005,-31203,-10005,
                                  -31567,-8788,-31567,-8788,-31567,-8788,-31567,-8788,
                                  -31884,-7557,-31884,-7557,-31884,-7557,-31884,-7557,
                                  -32153,-6315,-32153,-6315,-32153,-6315,-32153,-6315,
                                  -32374,-5064,-32374,-5064,-32374,-5064,-32374,-5064,
                                  -32546,-3805,-32546,-3805,-32546,-3805,-32546,-3805,
                                  -32669,-2540,-32669,-2540,-32669,-2540,-32669,-2540,
                                  -32743,-1271,-32743,-1271,-32743,-1271,-32743,-1271,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32743,1270,-32743,1270,-32743,1270,-32743,1270,
                                  -32669,2539,-32669,2539,-32669,2539,-32669,2539,
                                  -32546,3804,-32546,3804,-32546,3804,-32546,3804,
                                  -32374,5063,-32374,5063,-32374,5063,-32374,5063,
                                  -32153,6314,-32153,6314,-32153,6314,-32153,6314,
                                  -31884,7556,-31884,7556,-31884,7556,-31884,7556,
                                  -31567,8787,-31567,8787,-31567,8787,-31567,8787,
                                  -31203,10004,-31203,10004,-31203,10004,-31203,10004,
                                  -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                  -30334,12392,-30334,12392,-30334,12392,-30334,12392,
                                  -29830,13559,-29830,13559,-29830,13559,-29830,13559,
                                  -29282,14705,-29282,14705,-29282,14705,-29282,14705,
                                  -28690,15830,-28690,15830,-28690,15830,-28690,15830,
                                  -28055,16930,-28055,16930,-28055,16930,-28055,16930,
                                  -27377,18005,-27377,18005,-27377,18005,-27377,18005,
                                  -26658,19053,-26658,19053,-26658,19053,-26658,19053,
                                  -25899,20073,-25899,20073,-25899,20073,-25899,20073,
                                  -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                  -24266,22019,-24266,22019,-24266,22019,-24266,22019,
                                  -23394,22944,-23394,22944,-23394,22944,-23394,22944,
                                  -22487,23833,-22487,23833,-22487,23833,-22487,23833,
                                  -21546,24687,-21546,24687,-21546,24687,-21546,24687,
                                  -20572,25504,-20572,25504,-20572,25504,-20572,25504,
                                  -19568,26283,-19568,26283,-19568,26283,-19568,26283,
                                  -18534,27022,-18534,27022,-18534,27022,-18534,27022,
                                  -17472,27720,-17472,27720,-17472,27720,-17472,27720
                                 };

void dft324(int16_t *x,int16_t *y,unsigned char scale_flag)  // 108 x 3
{
Raymond Knopp's avatar
 
Raymond Knopp committed
6547
  int i,j;
6548 6549 6550 6551 6552 6553
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa324[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb324[0];
  simd_q15_t x2128[324];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[324];//=&ytmp128array3[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
6554 6555 6556



6557
  for (i=0,j=0; i<108; i++,j+=3) {
Raymond Knopp's avatar
 
Raymond Knopp committed
6558 6559 6560 6561 6562
    x2128[i]    = x128[j];
    x2128[i+108] = x128[j+1];
    x2128[i+216] = x128[j+2];
  }

6563 6564 6565
  dft108((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft108((int16_t *)(x2128+108),(int16_t *)(ytmp128+108),1);
  dft108((int16_t *)(x2128+216),(int16_t *)(ytmp128+216),1);
Raymond Knopp's avatar
 
Raymond Knopp committed
6566 6567

  bfly3_tw1(ytmp128,ytmp128+108,ytmp128+216,y128,y128+108,y128+216);
6568 6569

  for (i=1,j=0; i<108; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
6570
    bfly3(ytmp128+i,
6571 6572 6573 6574 6575 6576 6577
          ytmp128+108+i,
          ytmp128+216+i,
          y128+i,
          y128+108+i,
          y128+216+i,
          twa128+j,
          twb128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
6578 6579 6580
  }

  if (scale_flag==1) {
6581
    norm128 = set1_int16(dft_norm_table[14]);
6582 6583

    for (i=0; i<324; i++) {
6584
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617
    }
  }

  _mm_empty();
  _m_empty();

};

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:119)/360));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:119)/360));
twa2 = zeros(1,2*119);
twb2 = zeros(1,2*119);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa360[119*2*4] = {");
for i=1:2:(2*118)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb360[119*2*4] = {");
for i=1:2:(2*118)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fclose(fd);
 */
static int16_t twa360[119*2*4] = {32762,-572,32762,-572,32762,-572,32762,-572,
6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736
                                  32747,-1144,32747,-1144,32747,-1144,32747,-1144,
                                  32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                  32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32522,-3994,32522,-3994,32522,-3994,32522,-3994,
                                  32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32164,-6253,32164,-6253,32164,-6253,32164,-6253,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31927,-7371,31927,-7371,31927,-7371,31927,-7371,
                                  31793,-7928,31793,-7928,31793,-7928,31793,-7928,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                  31335,-9581,31335,-9581,31335,-9581,31335,-9581,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  30981,-10668,30981,-10668,30981,-10668,30981,-10668,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                  30381,-12275,30381,-12275,30381,-12275,30381,-12275,
                                  30162,-12804,30162,-12804,30162,-12804,30162,-12804,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29450,-14365,29450,-14365,29450,-14365,29450,-14365,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                  28658,-15886,28658,-15886,28658,-15886,28658,-15886,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28086,-16877,28086,-16877,28086,-16877,28086,-16877,
                                  27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                  27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                  27165,-18324,27165,-18324,27165,-18324,27165,-18324,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26168,-19720,26168,-19720,26168,-19720,26168,-19720,
                                  25820,-20174,25820,-20174,25820,-20174,25820,-20174,
                                  25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24729,-21498,24729,-21498,24729,-21498,24729,-21498,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  23964,-22348,23964,-22348,23964,-22348,23964,-22348,
                                  23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22761,-23571,22761,-23571,22761,-23571,22761,-23571,
                                  22347,-23965,22347,-23965,22347,-23965,22347,-23965,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21497,-24730,21497,-24730,21497,-24730,21497,-24730,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                  20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                  19719,-26169,19719,-26169,19719,-26169,19719,-26169,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                  17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                  17363,-27788,17363,-27788,17363,-27788,17363,-27788,
                                  16876,-28087,16876,-28087,16876,-28087,16876,-28087,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15885,-28659,15885,-28659,15885,-28659,15885,-28659,
                                  15383,-28932,15383,-28932,15383,-28932,15383,-28932,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  12803,-30163,12803,-30163,12803,-30163,12803,-30163,
                                  12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                  11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10667,-30982,10667,-30982,10667,-30982,10667,-30982,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9580,-31336,9580,-31336,9580,-31336,9580,-31336,
                                  9031,-31498,9031,-31498,9031,-31498,9031,-31498,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                  7370,-31928,7370,-31928,7370,-31928,7370,-31928,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  6252,-32165,6252,-32165,6252,-32165,6252,-32165,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4560,-32449,4560,-32449,4560,-32449,4560,-32449,
                                  3993,-32523,3993,-32523,3993,-32523,3993,-32523,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  2285,-32688,2285,-32688,2285,-32688,2285,-32688,
                                  1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                  1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                  571,-32763,571,-32763,571,-32763,571,-32763,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -572,-32763,-572,-32763,-572,-32763,-572,-32763,
                                  -1144,-32748,-1144,-32748,-1144,-32748,-1144,-32748,
                                  -1715,-32723,-1715,-32723,-1715,-32723,-1715,-32723,
                                  -2286,-32688,-2286,-32688,-2286,-32688,-2286,-32688,
                                  -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -3994,-32523,-3994,-32523,-3994,-32523,-3994,-32523,
                                  -4561,-32449,-4561,-32449,-4561,-32449,-4561,-32449,
                                  -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6253,-32165,-6253,-32165,-6253,-32165,-6253,-32165,
                                  -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                  -7371,-31928,-7371,-31928,-7371,-31928,-7371,-31928,
                                  -7928,-31794,-7928,-31794,-7928,-31794,-7928,-31794,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -9032,-31498,-9032,-31498,-9032,-31498,-9032,-31498,
                                  -9581,-31336,-9581,-31336,-9581,-31336,-9581,-31336,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10668,-30982,-10668,-30982,-10668,-30982,-10668,-30982,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11743,-30591,-11743,-30591,-11743,-30591,-11743,-30591,
                                  -12275,-30382,-12275,-30382,-12275,-30382,-12275,-30382,
                                  -12804,-30163,-12804,-30163,-12804,-30163,-12804,-30163,
                                  -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                  -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                  -14365,-29451,-14365,-29451,-14365,-29451,-14365,-29451,
                                  -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                                  -15384,-28932,-15384,-28932,-15384,-28932,-15384,-28932,
                                  -15886,-28659,-15886,-28659,-15886,-28659,-15886,-28659
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
6737
static int16_t twb360[119*2*4] = {32747,-1144,32747,-1144,32747,-1144,32747,-1144,
6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860
                                  32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31793,-7928,31793,-7928,31793,-7928,31793,-7928,
                                  31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30381,-12275,30381,-12275,30381,-12275,30381,-12275,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29450,-14365,29450,-14365,29450,-14365,29450,-14365,
                                  28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                  27165,-18324,27165,-18324,27165,-18324,27165,-18324,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  25820,-20174,25820,-20174,25820,-20174,25820,-20174,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                  22761,-23571,22761,-23571,22761,-23571,22761,-23571,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                  17363,-27788,17363,-27788,17363,-27788,17363,-27788,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15383,-28932,15383,-28932,15383,-28932,15383,-28932,
                                  14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9031,-31498,9031,-31498,9031,-31498,9031,-31498,
                                  7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  4560,-32449,4560,-32449,4560,-32449,4560,-32449,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  2285,-32688,2285,-32688,2285,-32688,2285,-32688,
                                  1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -1144,-32748,-1144,-32748,-1144,-32748,-1144,-32748,
                                  -2286,-32688,-2286,-32688,-2286,-32688,-2286,-32688,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -4561,-32449,-4561,-32449,-4561,-32449,-4561,-32449,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                  -7928,-31794,-7928,-31794,-7928,-31794,-7928,-31794,
                                  -9032,-31498,-9032,-31498,-9032,-31498,-9032,-31498,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -12275,-30382,-12275,-30382,-12275,-30382,-12275,-30382,
                                  -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                  -14365,-29451,-14365,-29451,-14365,-29451,-14365,-29451,
                                  -15384,-28932,-15384,-28932,-15384,-28932,-15384,-28932,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -17364,-27788,-17364,-27788,-17364,-27788,-17364,-27788,
                                  -18324,-27166,-18324,-27166,-18324,-27166,-18324,-27166,
                                  -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                                  -20174,-25821,-20174,-25821,-20174,-25821,-20174,-25821,
                                  -21063,-25101,-21063,-25101,-21063,-25101,-21063,-25101,
                                  -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                                  -22762,-23571,-22762,-23571,-22762,-23571,-22762,-23571,
                                  -23571,-22762,-23571,-22762,-23571,-22762,-23571,-22762,
                                  -24351,-21926,-24351,-21926,-24351,-21926,-24351,-21926,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25821,-20174,-25821,-20174,-25821,-20174,-25821,-20174,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -27166,-18324,-27166,-18324,-27166,-18324,-27166,-18324,
                                  -27788,-17364,-27788,-17364,-27788,-17364,-27788,-17364,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28932,-15384,-28932,-15384,-28932,-15384,-28932,-15384,
                                  -29451,-14365,-29451,-14365,-29451,-14365,-29451,-14365,
                                  -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                                  -30382,-12275,-30382,-12275,-30382,-12275,-30382,-12275,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                                  -31498,-9032,-31498,-9032,-31498,-9032,-31498,-9032,
                                  -31794,-7928,-31794,-7928,-31794,-7928,-31794,-7928,
                                  -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                                  -32270,-5690,-32270,-5690,-32270,-5690,-32270,-5690,
                                  -32449,-4561,-32449,-4561,-32449,-4561,-32449,-4561,
                                  -32588,-3426,-32588,-3426,-32588,-3426,-32588,-3426,
                                  -32688,-2286,-32688,-2286,-32688,-2286,-32688,-2286,
                                  -32748,-1144,-32748,-1144,-32748,-1144,-32748,-1144,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32748,1143,-32748,1143,-32748,1143,-32748,1143,
                                  -32688,2285,-32688,2285,-32688,2285,-32688,2285,
                                  -32588,3425,-32588,3425,-32588,3425,-32588,3425,
                                  -32449,4560,-32449,4560,-32449,4560,-32449,4560,
                                  -32270,5689,-32270,5689,-32270,5689,-32270,5689,
                                  -32051,6812,-32051,6812,-32051,6812,-32051,6812,
                                  -31794,7927,-31794,7927,-31794,7927,-31794,7927,
                                  -31498,9031,-31498,9031,-31498,9031,-31498,9031,
                                  -31164,10125,-31164,10125,-31164,10125,-31164,10125,
                                  -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                  -30382,12274,-30382,12274,-30382,12274,-30382,12274,
                                  -29935,13327,-29935,13327,-29935,13327,-29935,13327,
                                  -29451,14364,-29451,14364,-29451,14364,-29451,14364,
                                  -28932,15383,-28932,15383,-28932,15383,-28932,15383,
                                  -28378,16383,-28378,16383,-28378,16383,-28378,16383,
                                  -27788,17363,-27788,17363,-27788,17363,-27788,17363,
                                  -27166,18323,-27166,18323,-27166,18323,-27166,18323,
                                  -26510,19259,-26510,19259,-26510,19259,-26510,19259,
                                  -25821,20173,-25821,20173,-25821,20173,-25821,20173,
                                  -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                  -24351,21925,-24351,21925,-24351,21925,-24351,21925,
                                  -23571,22761,-23571,22761,-23571,22761,-23571,22761,
                                  -22762,23570,-22762,23570,-22762,23570,-22762,23570,
                                  -21926,24350,-21926,24350,-21926,24350,-21926,24350,
                                  -21063,25100,-21063,25100,-21063,25100,-21063,25100,
                                  -20174,25820,-20174,25820,-20174,25820,-20174,25820,
                                  -19260,26509,-19260,26509,-19260,26509,-19260,26509,
                                  -18324,27165,-18324,27165,-18324,27165,-18324,27165,
                                  -17364,27787,-17364,27787,-17364,27787,-17364,27787
                                 };


void dft360(int16_t *x,int16_t *y,unsigned char scale_flag)  // 120 x 3
{
Raymond Knopp's avatar
 
Raymond Knopp committed
6861
  int i,j;
6862 6863 6864 6865 6866 6867
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa360[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb360[0];
  simd_q15_t x2128[360];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[360];//=&ytmp128array3[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
6868 6869 6870



6871
  for (i=0,j=0; i<120; i++,j+=3) {
Raymond Knopp's avatar
 
Raymond Knopp committed
6872 6873 6874 6875 6876 6877 6878 6879 6880 6881
    x2128[i]    = x128[j];
    x2128[i+120] = x128[j+1];
    x2128[i+240] = x128[j+2];
  }

  dft120((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft120((int16_t *)(x2128+120),(int16_t *)(ytmp128+120),1);
  dft120((int16_t *)(x2128+240),(int16_t *)(ytmp128+240),1);

  bfly3_tw1(ytmp128,ytmp128+120,ytmp128+240,y128,y128+120,y128+240);
6882 6883

  for (i=1,j=0; i<120; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
6884
    bfly3(ytmp128+i,
6885 6886 6887 6888 6889 6890 6891
          ytmp128+120+i,
          ytmp128+240+i,
          y128+i,
          y128+120+i,
          y128+240+i,
          twa128+j,
          twb128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
6892 6893 6894
  }

  if (scale_flag==1) {
6895
    norm128 = set1_int16(dft_norm_table[14]);
6896 6897

    for (i=0; i<360; i++) {
6898
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942
    }
  }

  _mm_empty();
  _m_empty();

};

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:95)/384));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:95)/384));
twc = floor(32767*exp(-sqrt(-1)*2*pi*3*(1:95)/384));
twa2 = zeros(1,2*95);
twb2 = zeros(1,2*95);
twc2 = zeros(1,2*95);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
twc2(1:2:end) = real(twc);
twc2(2:2:end) = imag(twc);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa384[95*2*4] = {");
for i=1:2:(2*94)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb384[95*2*4] = {");
for i=1:2:(2*94)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fprintf(fd,"static int16_t twc384[95*2*4] = {");
for i=1:2:(2*94)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
fclose(fd);
 */

static int16_t twa384[95*2*4] = {32762,-537,32762,-537,32762,-537,32762,-537,
6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037
                                 32749,-1073,32749,-1073,32749,-1073,32749,-1073,
                                 32727,-1608,32727,-1608,32727,-1608,32727,-1608,
                                 32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                 32657,-2678,32657,-2678,32657,-2678,32657,-2678,
                                 32609,-3212,32609,-3212,32609,-3212,32609,-3212,
                                 32552,-3745,32552,-3745,32552,-3745,32552,-3745,
                                 32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                 32412,-4808,32412,-4808,32412,-4808,32412,-4808,
                                 32329,-5338,32329,-5338,32329,-5338,32329,-5338,
                                 32237,-5866,32237,-5866,32237,-5866,32237,-5866,
                                 32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                 32028,-6918,32028,-6918,32028,-6918,32028,-6918,
                                 31911,-7441,31911,-7441,31911,-7441,31911,-7441,
                                 31785,-7962,31785,-7962,31785,-7962,31785,-7962,
                                 31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                 31507,-8998,31507,-8998,31507,-8998,31507,-8998,
                                 31356,-9512,31356,-9512,31356,-9512,31356,-9512,
                                 31196,-10024,31196,-10024,31196,-10024,31196,-10024,
                                 31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                 30851,-11039,30851,-11039,30851,-11039,30851,-11039,
                                 30666,-11543,30666,-11543,30666,-11543,30666,-11543,
                                 30473,-12043,30473,-12043,30473,-12043,30473,-12043,
                                 30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                 30063,-13034,30063,-13034,30063,-13034,30063,-13034,
                                 29846,-13524,29846,-13524,29846,-13524,29846,-13524,
                                 29621,-14010,29621,-14010,29621,-14010,29621,-14010,
                                 29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                 29146,-14972,29146,-14972,29146,-14972,29146,-14972,
                                 28897,-15447,28897,-15447,28897,-15447,28897,-15447,
                                 28641,-15918,28641,-15918,28641,-15918,28641,-15918,
                                 28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                 28105,-16846,28105,-16846,28105,-16846,28105,-16846,
                                 27825,-17304,27825,-17304,27825,-17304,27825,-17304,
                                 27538,-17757,27538,-17757,27538,-17757,27538,-17757,
                                 27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                 26943,-18648,26943,-18648,26943,-18648,26943,-18648,
                                 26634,-19087,26634,-19087,26634,-19087,26634,-19087,
                                 26318,-19520,26318,-19520,26318,-19520,26318,-19520,
                                 25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                 25665,-20370,25665,-20370,25665,-20370,25665,-20370,
                                 25329,-20788,25329,-20788,25329,-20788,25329,-20788,
                                 24985,-21199,24985,-21199,24985,-21199,24985,-21199,
                                 24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                 24278,-22005,24278,-22005,24278,-22005,24278,-22005,
                                 23915,-22400,23915,-22400,23915,-22400,23915,-22400,
                                 23545,-22788,23545,-22788,23545,-22788,23545,-22788,
                                 23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                 22787,-23546,22787,-23546,22787,-23546,22787,-23546,
                                 22399,-23916,22399,-23916,22399,-23916,22399,-23916,
                                 22004,-24279,22004,-24279,22004,-24279,22004,-24279,
                                 21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                 21198,-24986,21198,-24986,21198,-24986,21198,-24986,
                                 20787,-25330,20787,-25330,20787,-25330,20787,-25330,
                                 20369,-25666,20369,-25666,20369,-25666,20369,-25666,
                                 19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                 19519,-26319,19519,-26319,19519,-26319,19519,-26319,
                                 19086,-26635,19086,-26635,19086,-26635,19086,-26635,
                                 18647,-26944,18647,-26944,18647,-26944,18647,-26944,
                                 18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                 17756,-27539,17756,-27539,17756,-27539,17756,-27539,
                                 17303,-27826,17303,-27826,17303,-27826,17303,-27826,
                                 16845,-28106,16845,-28106,16845,-28106,16845,-28106,
                                 16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                 15917,-28642,15917,-28642,15917,-28642,15917,-28642,
                                 15446,-28898,15446,-28898,15446,-28898,15446,-28898,
                                 14971,-29147,14971,-29147,14971,-29147,14971,-29147,
                                 14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                 14009,-29622,14009,-29622,14009,-29622,14009,-29622,
                                 13523,-29847,13523,-29847,13523,-29847,13523,-29847,
                                 13033,-30064,13033,-30064,13033,-30064,13033,-30064,
                                 12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                 12042,-30474,12042,-30474,12042,-30474,12042,-30474,
                                 11542,-30667,11542,-30667,11542,-30667,11542,-30667,
                                 11038,-30852,11038,-30852,11038,-30852,11038,-30852,
                                 10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                 10023,-31197,10023,-31197,10023,-31197,10023,-31197,
                                 9511,-31357,9511,-31357,9511,-31357,9511,-31357,
                                 8997,-31508,8997,-31508,8997,-31508,8997,-31508,
                                 8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                 7961,-31786,7961,-31786,7961,-31786,7961,-31786,
                                 7440,-31912,7440,-31912,7440,-31912,7440,-31912,
                                 6917,-32029,6917,-32029,6917,-32029,6917,-32029,
                                 6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                 5865,-32238,5865,-32238,5865,-32238,5865,-32238,
                                 5337,-32330,5337,-32330,5337,-32330,5337,-32330,
                                 4807,-32413,4807,-32413,4807,-32413,4807,-32413,
                                 4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                 3744,-32553,3744,-32553,3744,-32553,3744,-32553,
                                 3211,-32610,3211,-32610,3211,-32610,3211,-32610,
                                 2677,-32658,2677,-32658,2677,-32658,2677,-32658,
                                 2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                 1607,-32728,1607,-32728,1607,-32728,1607,-32728,
                                 1072,-32750,1072,-32750,1072,-32750,1072,-32750,
                                 536,-32763,536,-32763,536,-32763,536,-32763
                                };
Raymond Knopp's avatar
 
Raymond Knopp committed
7038
static int16_t twb384[95*2*4] = {32749,-1073,32749,-1073,32749,-1073,32749,-1073,
7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133
                                 32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                 32609,-3212,32609,-3212,32609,-3212,32609,-3212,
                                 32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                 32329,-5338,32329,-5338,32329,-5338,32329,-5338,
                                 32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                 31911,-7441,31911,-7441,31911,-7441,31911,-7441,
                                 31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                 31356,-9512,31356,-9512,31356,-9512,31356,-9512,
                                 31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                 30666,-11543,30666,-11543,30666,-11543,30666,-11543,
                                 30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                 29846,-13524,29846,-13524,29846,-13524,29846,-13524,
                                 29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                 28897,-15447,28897,-15447,28897,-15447,28897,-15447,
                                 28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                 27825,-17304,27825,-17304,27825,-17304,27825,-17304,
                                 27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                 26634,-19087,26634,-19087,26634,-19087,26634,-19087,
                                 25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                 25329,-20788,25329,-20788,25329,-20788,25329,-20788,
                                 24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                 23915,-22400,23915,-22400,23915,-22400,23915,-22400,
                                 23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                 22399,-23916,22399,-23916,22399,-23916,22399,-23916,
                                 21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                 20787,-25330,20787,-25330,20787,-25330,20787,-25330,
                                 19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                 19086,-26635,19086,-26635,19086,-26635,19086,-26635,
                                 18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                 17303,-27826,17303,-27826,17303,-27826,17303,-27826,
                                 16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                 15446,-28898,15446,-28898,15446,-28898,15446,-28898,
                                 14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                 13523,-29847,13523,-29847,13523,-29847,13523,-29847,
                                 12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                 11542,-30667,11542,-30667,11542,-30667,11542,-30667,
                                 10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                 9511,-31357,9511,-31357,9511,-31357,9511,-31357,
                                 8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                 7440,-31912,7440,-31912,7440,-31912,7440,-31912,
                                 6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                 5337,-32330,5337,-32330,5337,-32330,5337,-32330,
                                 4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                 3211,-32610,3211,-32610,3211,-32610,3211,-32610,
                                 2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                 1072,-32750,1072,-32750,1072,-32750,1072,-32750,
                                 0,-32767,0,-32767,0,-32767,0,-32767,
                                 -1073,-32750,-1073,-32750,-1073,-32750,-1073,-32750,
                                 -2144,-32697,-2144,-32697,-2144,-32697,-2144,-32697,
                                 -3212,-32610,-3212,-32610,-3212,-32610,-3212,-32610,
                                 -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                 -5338,-32330,-5338,-32330,-5338,-32330,-5338,-32330,
                                 -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                 -7441,-31912,-7441,-31912,-7441,-31912,-7441,-31912,
                                 -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                 -9512,-31357,-9512,-31357,-9512,-31357,-9512,-31357,
                                 -10533,-31029,-10533,-31029,-10533,-31029,-10533,-31029,
                                 -11543,-30667,-11543,-30667,-11543,-30667,-11543,-30667,
                                 -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                 -13524,-29847,-13524,-29847,-13524,-29847,-13524,-29847,
                                 -14493,-29388,-14493,-29388,-14493,-29388,-14493,-29388,
                                 -15447,-28898,-15447,-28898,-15447,-28898,-15447,-28898,
                                 -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                 -17304,-27826,-17304,-27826,-17304,-27826,-17304,-27826,
                                 -18205,-27245,-18205,-27245,-18205,-27245,-18205,-27245,
                                 -19087,-26635,-19087,-26635,-19087,-26635,-19087,-26635,
                                 -19948,-25996,-19948,-25996,-19948,-25996,-19948,-25996,
                                 -20788,-25330,-20788,-25330,-20788,-25330,-20788,-25330,
                                 -21605,-24636,-21605,-24636,-21605,-24636,-21605,-24636,
                                 -22400,-23916,-22400,-23916,-22400,-23916,-22400,-23916,
                                 -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                 -23916,-22400,-23916,-22400,-23916,-22400,-23916,-22400,
                                 -24636,-21605,-24636,-21605,-24636,-21605,-24636,-21605,
                                 -25330,-20788,-25330,-20788,-25330,-20788,-25330,-20788,
                                 -25996,-19948,-25996,-19948,-25996,-19948,-25996,-19948,
                                 -26635,-19087,-26635,-19087,-26635,-19087,-26635,-19087,
                                 -27245,-18205,-27245,-18205,-27245,-18205,-27245,-18205,
                                 -27826,-17304,-27826,-17304,-27826,-17304,-27826,-17304,
                                 -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                 -28898,-15447,-28898,-15447,-28898,-15447,-28898,-15447,
                                 -29388,-14493,-29388,-14493,-29388,-14493,-29388,-14493,
                                 -29847,-13524,-29847,-13524,-29847,-13524,-29847,-13524,
                                 -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                 -30667,-11543,-30667,-11543,-30667,-11543,-30667,-11543,
                                 -31029,-10533,-31029,-10533,-31029,-10533,-31029,-10533,
                                 -31357,-9512,-31357,-9512,-31357,-9512,-31357,-9512,
                                 -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                 -31912,-7441,-31912,-7441,-31912,-7441,-31912,-7441,
                                 -32138,-6393,-32138,-6393,-32138,-6393,-32138,-6393,
                                 -32330,-5338,-32330,-5338,-32330,-5338,-32330,-5338,
                                 -32487,-4277,-32487,-4277,-32487,-4277,-32487,-4277,
                                 -32610,-3212,-32610,-3212,-32610,-3212,-32610,-3212,
                                 -32697,-2144,-32697,-2144,-32697,-2144,-32697,-2144,
                                 -32750,-1073,-32750,-1073,-32750,-1073,-32750,-1073
                                };
Raymond Knopp's avatar
 
Raymond Knopp committed
7134
static int16_t twc384[95*2*4] = {32727,-1608,32727,-1608,32727,-1608,32727,-1608,
7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232
                                 32609,-3212,32609,-3212,32609,-3212,32609,-3212,
                                 32412,-4808,32412,-4808,32412,-4808,32412,-4808,
                                 32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                 31785,-7962,31785,-7962,31785,-7962,31785,-7962,
                                 31356,-9512,31356,-9512,31356,-9512,31356,-9512,
                                 30851,-11039,30851,-11039,30851,-11039,30851,-11039,
                                 30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                 29621,-14010,29621,-14010,29621,-14010,29621,-14010,
                                 28897,-15447,28897,-15447,28897,-15447,28897,-15447,
                                 28105,-16846,28105,-16846,28105,-16846,28105,-16846,
                                 27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                 26318,-19520,26318,-19520,26318,-19520,26318,-19520,
                                 25329,-20788,25329,-20788,25329,-20788,25329,-20788,
                                 24278,-22005,24278,-22005,24278,-22005,24278,-22005,
                                 23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                 22004,-24279,22004,-24279,22004,-24279,22004,-24279,
                                 20787,-25330,20787,-25330,20787,-25330,20787,-25330,
                                 19519,-26319,19519,-26319,19519,-26319,19519,-26319,
                                 18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                 16845,-28106,16845,-28106,16845,-28106,16845,-28106,
                                 15446,-28898,15446,-28898,15446,-28898,15446,-28898,
                                 14009,-29622,14009,-29622,14009,-29622,14009,-29622,
                                 12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                 11038,-30852,11038,-30852,11038,-30852,11038,-30852,
                                 9511,-31357,9511,-31357,9511,-31357,9511,-31357,
                                 7961,-31786,7961,-31786,7961,-31786,7961,-31786,
                                 6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                 4807,-32413,4807,-32413,4807,-32413,4807,-32413,
                                 3211,-32610,3211,-32610,3211,-32610,3211,-32610,
                                 1607,-32728,1607,-32728,1607,-32728,1607,-32728,
                                 0,-32767,0,-32767,0,-32767,0,-32767,
                                 -1608,-32728,-1608,-32728,-1608,-32728,-1608,-32728,
                                 -3212,-32610,-3212,-32610,-3212,-32610,-3212,-32610,
                                 -4808,-32413,-4808,-32413,-4808,-32413,-4808,-32413,
                                 -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                 -7962,-31786,-7962,-31786,-7962,-31786,-7962,-31786,
                                 -9512,-31357,-9512,-31357,-9512,-31357,-9512,-31357,
                                 -11039,-30852,-11039,-30852,-11039,-30852,-11039,-30852,
                                 -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                 -14010,-29622,-14010,-29622,-14010,-29622,-14010,-29622,
                                 -15447,-28898,-15447,-28898,-15447,-28898,-15447,-28898,
                                 -16846,-28106,-16846,-28106,-16846,-28106,-16846,-28106,
                                 -18205,-27245,-18205,-27245,-18205,-27245,-18205,-27245,
                                 -19520,-26319,-19520,-26319,-19520,-26319,-19520,-26319,
                                 -20788,-25330,-20788,-25330,-20788,-25330,-20788,-25330,
                                 -22005,-24279,-22005,-24279,-22005,-24279,-22005,-24279,
                                 -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                 -24279,-22005,-24279,-22005,-24279,-22005,-24279,-22005,
                                 -25330,-20788,-25330,-20788,-25330,-20788,-25330,-20788,
                                 -26319,-19520,-26319,-19520,-26319,-19520,-26319,-19520,
                                 -27245,-18205,-27245,-18205,-27245,-18205,-27245,-18205,
                                 -28106,-16846,-28106,-16846,-28106,-16846,-28106,-16846,
                                 -28898,-15447,-28898,-15447,-28898,-15447,-28898,-15447,
                                 -29622,-14010,-29622,-14010,-29622,-14010,-29622,-14010,
                                 -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                 -30852,-11039,-30852,-11039,-30852,-11039,-30852,-11039,
                                 -31357,-9512,-31357,-9512,-31357,-9512,-31357,-9512,
                                 -31786,-7962,-31786,-7962,-31786,-7962,-31786,-7962,
                                 -32138,-6393,-32138,-6393,-32138,-6393,-32138,-6393,
                                 -32413,-4808,-32413,-4808,-32413,-4808,-32413,-4808,
                                 -32610,-3212,-32610,-3212,-32610,-3212,-32610,-3212,
                                 -32728,-1608,-32728,-1608,-32728,-1608,-32728,-1608,
                                 -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                 -32728,1607,-32728,1607,-32728,1607,-32728,1607,
                                 -32610,3211,-32610,3211,-32610,3211,-32610,3211,
                                 -32413,4807,-32413,4807,-32413,4807,-32413,4807,
                                 -32138,6392,-32138,6392,-32138,6392,-32138,6392,
                                 -31786,7961,-31786,7961,-31786,7961,-31786,7961,
                                 -31357,9511,-31357,9511,-31357,9511,-31357,9511,
                                 -30852,11038,-30852,11038,-30852,11038,-30852,11038,
                                 -30273,12539,-30273,12539,-30273,12539,-30273,12539,
                                 -29622,14009,-29622,14009,-29622,14009,-29622,14009,
                                 -28898,15446,-28898,15446,-28898,15446,-28898,15446,
                                 -28106,16845,-28106,16845,-28106,16845,-28106,16845,
                                 -27245,18204,-27245,18204,-27245,18204,-27245,18204,
                                 -26319,19519,-26319,19519,-26319,19519,-26319,19519,
                                 -25330,20787,-25330,20787,-25330,20787,-25330,20787,
                                 -24279,22004,-24279,22004,-24279,22004,-24279,22004,
                                 -23170,23169,-23170,23169,-23170,23169,-23170,23169,
                                 -22005,24278,-22005,24278,-22005,24278,-22005,24278,
                                 -20788,25329,-20788,25329,-20788,25329,-20788,25329,
                                 -19520,26318,-19520,26318,-19520,26318,-19520,26318,
                                 -18205,27244,-18205,27244,-18205,27244,-18205,27244,
                                 -16846,28105,-16846,28105,-16846,28105,-16846,28105,
                                 -15447,28897,-15447,28897,-15447,28897,-15447,28897,
                                 -14010,29621,-14010,29621,-14010,29621,-14010,29621,
                                 -12540,30272,-12540,30272,-12540,30272,-12540,30272,
                                 -11039,30851,-11039,30851,-11039,30851,-11039,30851,
                                 -9512,31356,-9512,31356,-9512,31356,-9512,31356,
                                 -7962,31785,-7962,31785,-7962,31785,-7962,31785,
                                 -6393,32137,-6393,32137,-6393,32137,-6393,32137,
                                 -4808,32412,-4808,32412,-4808,32412,-4808,32412,
                                 -3212,32609,-3212,32609,-3212,32609,-3212,32609,
                                 -1608,32727,-1608,32727,-1608,32727,-1608,32727
                                };

void dft384(int16_t *x,int16_t *y,unsigned char scale_flag)  // 96 x 4
{
Raymond Knopp's avatar
 
Raymond Knopp committed
7233
  int i,j;
7234 7235 7236 7237 7238 7239 7240
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa384[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb384[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc384[0];
  simd_q15_t x2128[384];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[384];//=&ytmp128array2[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
7241 7242 7243



7244
  for (i=0,j=0; i<96; i++,j+=4) {
Raymond Knopp's avatar
 
Raymond Knopp committed
7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256
    x2128[i]    = x128[j];
    x2128[i+96] = x128[j+1];
    x2128[i+192] = x128[j+2];
    x2128[i+288] = x128[j+3];
  }

  dft96((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft96((int16_t *)(x2128+96),(int16_t *)(ytmp128+96),1);
  dft96((int16_t *)(x2128+192),(int16_t *)(ytmp128+192),1);
  dft96((int16_t *)(x2128+288),(int16_t *)(ytmp128+288),1);

  bfly4_tw1(ytmp128,ytmp128+96,ytmp128+192,ytmp128+288,y128,y128+96,y128+192,y128+288);
7257 7258

  for (i=1,j=0; i<96; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
7259
    bfly4(ytmp128+i,
7260 7261 7262 7263 7264 7265 7266 7267 7268 7269
          ytmp128+96+i,
          ytmp128+192+i,
          ytmp128+288+i,
          y128+i,
          y128+96+i,
          y128+192+i,
          y128+288+i,
          twa128+j,
          twb128+j,
          twc128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
7270 7271 7272
  }

  if (scale_flag==1) {
7273
    norm128 = set1_int16(16384);//dft_norm_table[13]);
7274 7275

    for (i=0; i<384; i++) {
7276
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320
    }
  }

  _mm_empty();
  _m_empty();

};

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:107)/432));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:107)/432));
twc = floor(32767*exp(-sqrt(-1)*2*pi*3*(1:107)/432));
twa2 = zeros(1,2*107);
twb2 = zeros(1,2*107);
twc2 = zeros(1,2*107);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
twc2(1:2:end) = real(twc);
twc2(2:2:end) = imag(twc);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa432[107*2*4] = {");
for i=1:2:(2*106)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb432[107*2*4] = {");
for i=1:2:(2*106)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fprintf(fd,"static int16_t twc432[107*2*4] = {");
for i=1:2:(2*106)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
fclose(fd);
 */

static int16_t twa432[107*2*4] = {32763,-477,32763,-477,32763,-477,32763,-477,
7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427
                                  32753,-954,32753,-954,32753,-954,32753,-954,
                                  32735,-1430,32735,-1430,32735,-1430,32735,-1430,
                                  32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                  32680,-2381,32680,-2381,32680,-2381,32680,-2381,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32597,-3331,32597,-3331,32597,-3331,32597,-3331,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32421,-4749,32421,-4749,32421,-4749,32421,-4749,
                                  32348,-5221,32348,-5221,32348,-5221,32348,-5221,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32183,-6159,32183,-6159,32183,-6159,32183,-6159,
                                  32090,-6627,32090,-6627,32090,-6627,32090,-6627,
                                  31990,-7093,31990,-7093,31990,-7093,31990,-7093,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31770,-8020,31770,-8020,31770,-8020,31770,-8020,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31523,-8941,31523,-8941,31523,-8941,31523,-8941,
                                  31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                  31250,-9854,31250,-9854,31250,-9854,31250,-9854,
                                  31103,-10307,31103,-10307,31103,-10307,31103,-10307,
                                  30950,-10758,30950,-10758,30950,-10758,30950,-10758,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30624,-11654,30624,-11654,30624,-11654,30624,-11654,
                                  30451,-12098,30451,-12098,30451,-12098,30451,-12098,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                  29895,-13415,29895,-13415,29895,-13415,29895,-13415,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29492,-14279,29492,-14279,29492,-14279,29492,-14279,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  29064,-15131,29064,-15131,29064,-15131,29064,-15131,
                                  28841,-15552,28841,-15552,28841,-15552,28841,-15552,
                                  28612,-15970,28612,-15970,28612,-15970,28612,-15970,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28135,-16795,28135,-16795,28135,-16795,28135,-16795,
                                  27888,-17202,27888,-17202,27888,-17202,27888,-17202,
                                  27635,-17606,27635,-17606,27635,-17606,27635,-17606,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  27111,-18403,27111,-18403,27111,-18403,27111,-18403,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26564,-19183,26564,-19183,26564,-19183,26564,-19183,
                                  26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25702,-20324,25702,-20324,25702,-20324,25702,-20324,
                                  25404,-20695,25404,-20695,25404,-20695,25404,-20695,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24791,-21426,24791,-21426,24791,-21426,24791,-21426,
                                  24477,-21784,24477,-21784,24477,-21784,24477,-21784,
                                  24158,-22138,24158,-22138,24158,-22138,24158,-22138,
                                  23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                  23504,-22831,23504,-22831,23504,-22831,23504,-22831,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22830,-23505,22830,-23505,22830,-23505,22830,-23505,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  22137,-24159,22137,-24159,22137,-24159,22137,-24159,
                                  21783,-24478,21783,-24478,21783,-24478,21783,-24478,
                                  21425,-24792,21425,-24792,21425,-24792,21425,-24792,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20694,-25405,20694,-25405,20694,-25405,20694,-25405,
                                  20323,-25703,20323,-25703,20323,-25703,20323,-25703,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  19182,-26565,19182,-26565,19182,-26565,19182,-26565,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18402,-27112,18402,-27112,18402,-27112,18402,-27112,
                                  18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                  17605,-27636,17605,-27636,17605,-27636,17605,-27636,
                                  17201,-27889,17201,-27889,17201,-27889,17201,-27889,
                                  16794,-28136,16794,-28136,16794,-28136,16794,-28136,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15969,-28613,15969,-28613,15969,-28613,15969,-28613,
                                  15551,-28842,15551,-28842,15551,-28842,15551,-28842,
                                  15130,-29065,15130,-29065,15130,-29065,15130,-29065,
                                  14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                  14278,-29493,14278,-29493,14278,-29493,14278,-29493,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  13414,-29896,13414,-29896,13414,-29896,13414,-29896,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  12097,-30452,12097,-30452,12097,-30452,12097,-30452,
                                  11653,-30625,11653,-30625,11653,-30625,11653,-30625,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10757,-30951,10757,-30951,10757,-30951,10757,-30951,
                                  10306,-31104,10306,-31104,10306,-31104,10306,-31104,
                                  9853,-31251,9853,-31251,9853,-31251,9853,-31251,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  8940,-31524,8940,-31524,8940,-31524,8940,-31524,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8019,-31771,8019,-31771,8019,-31771,8019,-31771,
                                  7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                  7092,-31991,7092,-31991,7092,-31991,7092,-31991,
                                  6626,-32091,6626,-32091,6626,-32091,6626,-32091,
                                  6158,-32184,6158,-32184,6158,-32184,6158,-32184,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5220,-32349,5220,-32349,5220,-32349,5220,-32349,
                                  4748,-32422,4748,-32422,4748,-32422,4748,-32422,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                  3330,-32598,3330,-32598,3330,-32598,3330,-32598,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  2380,-32681,2380,-32681,2380,-32681,2380,-32681,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1429,-32736,1429,-32736,1429,-32736,1429,-32736,
                                  953,-32754,953,-32754,953,-32754,953,-32754,
                                  476,-32764,476,-32764,476,-32764,476,-32764
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
7428
static int16_t twb432[107*2*4] = {32753,-954,32753,-954,32753,-954,32753,-954,
7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535
                                  32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32421,-4749,32421,-4749,32421,-4749,32421,-4749,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32090,-6627,32090,-6627,32090,-6627,32090,-6627,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                  31103,-10307,31103,-10307,31103,-10307,31103,-10307,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30451,-12098,30451,-12098,30451,-12098,30451,-12098,
                                  30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  28841,-15552,28841,-15552,28841,-15552,28841,-15552,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  27888,-17202,27888,-17202,27888,-17202,27888,-17202,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                  25702,-20324,25702,-20324,25702,-20324,25702,-20324,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24477,-21784,24477,-21784,24477,-21784,24477,-21784,
                                  23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  21783,-24478,21783,-24478,21783,-24478,21783,-24478,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20323,-25703,20323,-25703,20323,-25703,20323,-25703,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                  17201,-27889,17201,-27889,17201,-27889,17201,-27889,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15551,-28842,15551,-28842,15551,-28842,15551,-28842,
                                  14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12097,-30452,12097,-30452,12097,-30452,12097,-30452,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10306,-31104,10306,-31104,10306,-31104,10306,-31104,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                  6626,-32091,6626,-32091,6626,-32091,6626,-32091,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  4748,-32422,4748,-32422,4748,-32422,4748,-32422,
                                  3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  953,-32754,953,-32754,953,-32754,953,-32754,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -954,-32754,-954,-32754,-954,-32754,-954,-32754,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                  -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                  -4749,-32422,-4749,-32422,-4749,-32422,-4749,-32422,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6627,-32091,-6627,-32091,-6627,-32091,-6627,-32091,
                                  -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -10307,-31104,-10307,-31104,-10307,-31104,-10307,-31104,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -12098,-30452,-12098,-30452,-12098,-30452,-12098,-30452,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                  -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                  -15552,-28842,-15552,-28842,-15552,-28842,-15552,-28842,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -17202,-27889,-17202,-27889,-17202,-27889,-17202,-27889,
                                  -18006,-27377,-18006,-27377,-18006,-27377,-18006,-27377,
                                  -18795,-26842,-18795,-26842,-18795,-26842,-18795,-26842,
                                  -19568,-26284,-19568,-26284,-19568,-26284,-19568,-26284,
                                  -20324,-25703,-20324,-25703,-20324,-25703,-20324,-25703,
                                  -21063,-25101,-21063,-25101,-21063,-25101,-21063,-25101,
                                  -21784,-24478,-21784,-24478,-21784,-24478,-21784,-24478,
                                  -22487,-23834,-22487,-23834,-22487,-23834,-22487,-23834,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -23834,-22487,-23834,-22487,-23834,-22487,-23834,-22487,
                                  -24478,-21784,-24478,-21784,-24478,-21784,-24478,-21784,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25703,-20324,-25703,-20324,-25703,-20324,-25703,-20324,
                                  -26284,-19568,-26284,-19568,-26284,-19568,-26284,-19568,
                                  -26842,-18795,-26842,-18795,-26842,-18795,-26842,-18795,
                                  -27377,-18006,-27377,-18006,-27377,-18006,-27377,-18006,
                                  -27889,-17202,-27889,-17202,-27889,-17202,-27889,-17202,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28842,-15552,-28842,-15552,-28842,-15552,-28842,-15552,
                                  -29282,-14706,-29282,-14706,-29282,-14706,-29282,-14706,
                                  -29697,-13848,-29697,-13848,-29697,-13848,-29697,-13848,
                                  -30088,-12979,-30088,-12979,-30088,-12979,-30088,-12979,
                                  -30452,-12098,-30452,-12098,-30452,-12098,-30452,-12098,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -31104,-10307,-31104,-10307,-31104,-10307,-31104,-10307,
                                  -31391,-9398,-31391,-9398,-31391,-9398,-31391,-9398,
                                  -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                  -31884,-7557,-31884,-7557,-31884,-7557,-31884,-7557,
                                  -32091,-6627,-32091,-6627,-32091,-6627,-32091,-6627,
                                  -32270,-5690,-32270,-5690,-32270,-5690,-32270,-5690,
                                  -32422,-4749,-32422,-4749,-32422,-4749,-32422,-4749,
                                  -32546,-3805,-32546,-3805,-32546,-3805,-32546,-3805,
                                  -32643,-2856,-32643,-2856,-32643,-2856,-32643,-2856,
                                  -32712,-1906,-32712,-1906,-32712,-1906,-32712,-1906,
                                  -32754,-954,-32754,-954,-32754,-954,-32754,-954
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
7536
static int16_t twc432[107*2*4] = {32735,-1430,32735,-1430,32735,-1430,32735,-1430,
7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  31990,-7093,31990,-7093,31990,-7093,31990,-7093,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31250,-9854,31250,-9854,31250,-9854,31250,-9854,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29064,-15131,29064,-15131,29064,-15131,29064,-15131,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  27635,-17606,27635,-17606,27635,-17606,27635,-17606,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24158,-22138,24158,-22138,24158,-22138,24158,-22138,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22137,-24159,22137,-24159,22137,-24159,22137,-24159,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  17605,-27636,17605,-27636,17605,-27636,17605,-27636,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15130,-29065,15130,-29065,15130,-29065,15130,-29065,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  9853,-31251,9853,-31251,9853,-31251,9853,-31251,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  7092,-31991,7092,-31991,7092,-31991,7092,-31991,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  1429,-32736,1429,-32736,1429,-32736,1429,-32736,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -1430,-32736,-1430,-32736,-1430,-32736,-1430,-32736,
                                  -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                  -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -7093,-31991,-7093,-31991,-7093,-31991,-7093,-31991,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -9854,-31251,-9854,-31251,-9854,-31251,-9854,-31251,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                  -15131,-29065,-15131,-29065,-15131,-29065,-15131,-29065,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -17606,-27636,-17606,-27636,-17606,-27636,-17606,-27636,
                                  -18795,-26842,-18795,-26842,-18795,-26842,-18795,-26842,
                                  -19948,-25996,-19948,-25996,-19948,-25996,-19948,-25996,
                                  -21063,-25101,-21063,-25101,-21063,-25101,-21063,-25101,
                                  -22138,-24159,-22138,-24159,-22138,-24159,-22138,-24159,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -24159,-22138,-24159,-22138,-24159,-22138,-24159,-22138,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25996,-19948,-25996,-19948,-25996,-19948,-25996,-19948,
                                  -26842,-18795,-26842,-18795,-26842,-18795,-26842,-18795,
                                  -27636,-17606,-27636,-17606,-27636,-17606,-27636,-17606,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -29065,-15131,-29065,-15131,-29065,-15131,-29065,-15131,
                                  -29697,-13848,-29697,-13848,-29697,-13848,-29697,-13848,
                                  -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -31251,-9854,-31251,-9854,-31251,-9854,-31251,-9854,
                                  -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                  -31991,-7093,-31991,-7093,-31991,-7093,-31991,-7093,
                                  -32270,-5690,-32270,-5690,-32270,-5690,-32270,-5690,
                                  -32487,-4277,-32487,-4277,-32487,-4277,-32487,-4277,
                                  -32643,-2856,-32643,-2856,-32643,-2856,-32643,-2856,
                                  -32736,-1430,-32736,-1430,-32736,-1430,-32736,-1430,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32736,1429,-32736,1429,-32736,1429,-32736,1429,
                                  -32643,2855,-32643,2855,-32643,2855,-32643,2855,
                                  -32487,4276,-32487,4276,-32487,4276,-32487,4276,
                                  -32270,5689,-32270,5689,-32270,5689,-32270,5689,
                                  -31991,7092,-31991,7092,-31991,7092,-31991,7092,
                                  -31651,8480,-31651,8480,-31651,8480,-31651,8480,
                                  -31251,9853,-31251,9853,-31251,9853,-31251,9853,
                                  -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                  -30273,12539,-30273,12539,-30273,12539,-30273,12539,
                                  -29697,13847,-29697,13847,-29697,13847,-29697,13847,
                                  -29065,15130,-29065,15130,-29065,15130,-29065,15130,
                                  -28378,16383,-28378,16383,-28378,16383,-28378,16383,
                                  -27636,17605,-27636,17605,-27636,17605,-27636,17605,
                                  -26842,18794,-26842,18794,-26842,18794,-26842,18794,
                                  -25996,19947,-25996,19947,-25996,19947,-25996,19947,
                                  -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                  -24159,22137,-24159,22137,-24159,22137,-24159,22137,
                                  -23170,23169,-23170,23169,-23170,23169,-23170,23169,
                                  -22138,24158,-22138,24158,-22138,24158,-22138,24158,
                                  -21063,25100,-21063,25100,-21063,25100,-21063,25100,
                                  -19948,25995,-19948,25995,-19948,25995,-19948,25995,
                                  -18795,26841,-18795,26841,-18795,26841,-18795,26841,
                                  -17606,27635,-17606,27635,-17606,27635,-17606,27635,
                                  -16384,28377,-16384,28377,-16384,28377,-16384,28377,
                                  -15131,29064,-15131,29064,-15131,29064,-15131,29064,
                                  -13848,29696,-13848,29696,-13848,29696,-13848,29696,
                                  -12540,30272,-12540,30272,-12540,30272,-12540,30272,
                                  -11207,30790,-11207,30790,-11207,30790,-11207,30790,
                                  -9854,31250,-9854,31250,-9854,31250,-9854,31250,
                                  -8481,31650,-8481,31650,-8481,31650,-8481,31650,
                                  -7093,31990,-7093,31990,-7093,31990,-7093,31990,
                                  -5690,32269,-5690,32269,-5690,32269,-5690,32269,
                                  -4277,32486,-4277,32486,-4277,32486,-4277,32486,
                                  -2856,32642,-2856,32642,-2856,32642,-2856,32642,
                                  -1430,32735,-1430,32735,-1430,32735,-1430,32735
                                 };


void dft432(int16_t *x,int16_t *y,unsigned char scale_flag)  // 108 x 4
{
Raymond Knopp's avatar
 
Raymond Knopp committed
7648
  int i,j;
7649 7650 7651 7652 7653 7654 7655
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa432[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb432[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc432[0];
  simd_q15_t x2128[432];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[432];//=&ytmp128array2[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
7656 7657


7658
  for (i=0,j=0; i<108; i++,j+=4) {
Raymond Knopp's avatar
 
Raymond Knopp committed
7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670
    x2128[i]    = x128[j];
    x2128[i+108] = x128[j+1];
    x2128[i+216] = x128[j+2];
    x2128[i+324] = x128[j+3];
  }

  dft108((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft108((int16_t *)(x2128+108),(int16_t *)(ytmp128+108),1);
  dft108((int16_t *)(x2128+216),(int16_t *)(ytmp128+216),1);
  dft108((int16_t *)(x2128+324),(int16_t *)(ytmp128+324),1);

  bfly4_tw1(ytmp128,ytmp128+108,ytmp128+216,ytmp128+324,y128,y128+108,y128+216,y128+324);
7671 7672

  for (i=1,j=0; i<108; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
7673
    bfly4(ytmp128+i,
7674 7675 7676 7677 7678 7679 7680 7681 7682 7683
          ytmp128+108+i,
          ytmp128+216+i,
          ytmp128+324+i,
          y128+i,
          y128+108+i,
          y128+216+i,
          y128+324+i,
          twa128+j,
          twb128+j,
          twc128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
7684 7685 7686
  }

  if (scale_flag==1) {
7687
    norm128 = set1_int16(16384);//dft_norm_table[13]);
7688 7689

    for (i=0; i<432; i++) {
7690
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
7691 7692 7693 7694 7695 7696 7697 7698
    }
  }

  _mm_empty();
  _m_empty();

};
/*
7699
Twiddles generated with
Raymond Knopp's avatar
 
Raymond Knopp committed
7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734

twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:119)/480));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:119)/480));
twc = floor(32767*exp(-sqrt(-1)*2*pi*3*(1:119)/480));
twa2 = zeros(1,2*119);
twb2 = zeros(1,2*119);
twc2 = zeros(1,2*119);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
twc2(1:2:end) = real(twc);
twc2(2:2:end) = imag(twc);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa480[119*2*4] = {");
for i=1:2:(2*118)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb480[119*2*4] = {");
for i=1:2:(2*118)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fprintf(fd,"static int16_t twc480[119*2*4] = {");
for i=1:2:(2*118)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
fclose(fd);
*/
static int16_t twa480[119*2*4] = {32764,-429,32764,-429,32764,-429,32764,-429,
7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853
                                  32755,-858,32755,-858,32755,-858,32755,-858,
                                  32741,-1287,32741,-1287,32741,-1287,32741,-1287,
                                  32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                  32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                  32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                                  32629,-2999,32629,-2999,32629,-2999,32629,-2999,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32539,-3852,32539,-3852,32539,-3852,32539,-3852,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32427,-4702,32427,-4702,32427,-4702,32427,-4702,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32293,-5550,32293,-5550,32293,-5550,32293,-5550,
                                  32218,-5972,32218,-5972,32218,-5972,32218,-5972,
                                  32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31959,-7232,31959,-7232,31959,-7232,31959,-7232,
                                  31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                                  31758,-8066,31758,-8066,31758,-8066,31758,-8066,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31536,-8895,31536,-8895,31536,-8895,31536,-8895,
                                  31417,-9307,31417,-9307,31417,-9307,31417,-9307,
                                  31293,-9717,31293,-9717,31293,-9717,31293,-9717,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                  30887,-10938,30887,-10938,30887,-10938,30887,-10938,
                                  30741,-11342,30741,-11342,30741,-11342,30741,-11342,
                                  30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                  30434,-12143,30434,-12143,30434,-12143,30434,-12143,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  30106,-12935,30106,-12935,30106,-12935,30106,-12935,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29757,-13719,29757,-13719,29757,-13719,29757,-13719,
                                  29575,-14107,29575,-14107,29575,-14107,29575,-14107,
                                  29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  28998,-15257,28998,-15257,28998,-15257,28998,-15257,
                                  28796,-15636,28796,-15636,28796,-15636,28796,-15636,
                                  28589,-16011,28589,-16011,28589,-16011,28589,-16011,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28160,-16754,28160,-16754,28160,-16754,28160,-16754,
                                  27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                                  27711,-17485,27711,-17485,27711,-17485,27711,-17485,
                                  27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                  27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                  27004,-18560,27004,-18560,27004,-18560,27004,-18560,
                                  26758,-18912,26758,-18912,26758,-18912,26758,-18912,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26254,-19606,26254,-19606,26254,-19606,26254,-19606,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25732,-20286,25732,-20286,25732,-20286,25732,-20286,
                                  25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                  25192,-20953,25192,-20953,25192,-20953,25192,-20953,
                                  24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                                  24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  24061,-22243,24061,-22243,24061,-22243,24061,-22243,
                                  23768,-22556,23768,-22556,23768,-22556,23768,-22556,
                                  23471,-22865,23471,-22865,23471,-22865,23471,-22865,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22864,-23472,22864,-23472,22864,-23472,22864,-23472,
                                  22555,-23769,22555,-23769,22555,-23769,22555,-23769,
                                  22242,-24062,22242,-24062,22242,-24062,22242,-24062,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                  21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                                  20952,-25193,20952,-25193,20952,-25193,20952,-25193,
                                  20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                  20285,-25733,20285,-25733,20285,-25733,20285,-25733,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19605,-26255,19605,-26255,19605,-26255,19605,-26255,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18911,-26759,18911,-26759,18911,-26759,18911,-26759,
                                  18559,-27005,18559,-27005,18559,-27005,18559,-27005,
                                  18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                  17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                  17484,-27712,17484,-27712,17484,-27712,17484,-27712,
                                  17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                                  16753,-28161,16753,-28161,16753,-28161,16753,-28161,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16010,-28590,16010,-28590,16010,-28590,16010,-28590,
                                  15635,-28797,15635,-28797,15635,-28797,15635,-28797,
                                  15256,-28999,15256,-28999,15256,-28999,15256,-28999,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                  14106,-29576,14106,-29576,14106,-29576,14106,-29576,
                                  13718,-29758,13718,-29758,13718,-29758,13718,-29758,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  12934,-30107,12934,-30107,12934,-30107,12934,-30107,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  12142,-30435,12142,-30435,12142,-30435,12142,-30435,
                                  11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                  11341,-30742,11341,-30742,11341,-30742,11341,-30742,
                                  10937,-30888,10937,-30888,10937,-30888,10937,-30888,
                                  10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9716,-31294,9716,-31294,9716,-31294,9716,-31294,
                                  9306,-31418,9306,-31418,9306,-31418,9306,-31418,
                                  8894,-31537,8894,-31537,8894,-31537,8894,-31537,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8065,-31759,8065,-31759,8065,-31759,8065,-31759,
                                  7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                                  7231,-31960,7231,-31960,7231,-31960,7231,-31960,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                  5971,-32219,5971,-32219,5971,-32219,5971,-32219,
                                  5549,-32294,5549,-32294,5549,-32294,5549,-32294,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4701,-32428,4701,-32428,4701,-32428,4701,-32428,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  3851,-32540,3851,-32540,3851,-32540,3851,-32540,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  2998,-32630,2998,-32630,2998,-32630,2998,-32630,
                                  2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                                  2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                  1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                  1286,-32742,1286,-32742,1286,-32742,1286,-32742,
                                  857,-32756,857,-32756,857,-32756,857,-32756,
                                  428,-32765,428,-32765,428,-32765,428,-32765
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
7854
static int16_t twb480[119*2*4] = {32755,-858,32755,-858,32755,-858,32755,-858,
7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973
                                  32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                  32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32218,-5972,32218,-5972,32218,-5972,32218,-5972,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31417,-9307,31417,-9307,31417,-9307,31417,-9307,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  30887,-10938,30887,-10938,30887,-10938,30887,-10938,
                                  30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29575,-14107,29575,-14107,29575,-14107,29575,-14107,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  28796,-15636,28796,-15636,28796,-15636,28796,-15636,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                                  27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                  27004,-18560,27004,-18560,27004,-18560,27004,-18560,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                  24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  23768,-22556,23768,-22556,23768,-22556,23768,-22556,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22555,-23769,22555,-23769,22555,-23769,22555,-23769,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                                  20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18559,-27005,18559,-27005,18559,-27005,18559,-27005,
                                  17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                  17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15635,-28797,15635,-28797,15635,-28797,15635,-28797,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14106,-29576,14106,-29576,14106,-29576,14106,-29576,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                  10937,-30888,10937,-30888,10937,-30888,10937,-30888,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9306,-31418,9306,-31418,9306,-31418,9306,-31418,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  5971,-32219,5971,-32219,5971,-32219,5971,-32219,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                                  1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                  857,-32756,857,-32756,857,-32756,857,-32756,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -858,-32756,-858,-32756,-858,-32756,-858,-32756,
                                  -1715,-32723,-1715,-32723,-1715,-32723,-1715,-32723,
                                  -2571,-32666,-2571,-32666,-2571,-32666,-2571,-32666,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                  -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                                  -5972,-32219,-5972,-32219,-5972,-32219,-5972,-32219,
                                  -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                  -7650,-31862,-7650,-31862,-7650,-31862,-7650,-31862,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -9307,-31418,-9307,-31418,-9307,-31418,-9307,-31418,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10938,-30888,-10938,-30888,-10938,-30888,-10938,-30888,
                                  -11743,-30591,-11743,-30591,-11743,-30591,-11743,-30591,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                  -14107,-29576,-14107,-29576,-14107,-29576,-14107,-29576,
                                  -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                                  -15636,-28797,-15636,-28797,-15636,-28797,-15636,-28797,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -17121,-27939,-17121,-27939,-17121,-27939,-17121,-27939,
                                  -17847,-27481,-17847,-27481,-17847,-27481,-17847,-27481,
                                  -18560,-27005,-18560,-27005,-18560,-27005,-18560,-27005,
                                  -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                                  -19948,-25996,-19948,-25996,-19948,-25996,-19948,-25996,
                                  -20621,-25465,-20621,-25465,-20621,-25465,-20621,-25465,
                                  -21281,-24917,-21281,-24917,-21281,-24917,-21281,-24917,
                                  -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                                  -22556,-23769,-22556,-23769,-22556,-23769,-22556,-23769,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -23769,-22556,-23769,-22556,-23769,-22556,-23769,-22556,
                                  -24351,-21926,-24351,-21926,-24351,-21926,-24351,-21926,
                                  -24917,-21281,-24917,-21281,-24917,-21281,-24917,-21281,
                                  -25465,-20621,-25465,-20621,-25465,-20621,-25465,-20621,
                                  -25996,-19948,-25996,-19948,-25996,-19948,-25996,-19948,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -27005,-18560,-27005,-18560,-27005,-18560,-27005,-18560,
                                  -27481,-17847,-27481,-17847,-27481,-17847,-27481,-17847,
                                  -27939,-17121,-27939,-17121,-27939,-17121,-27939,-17121,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28797,-15636,-28797,-15636,-28797,-15636,-28797,-15636,
                                  -29196,-14876,-29196,-14876,-29196,-14876,-29196,-14876,
                                  -29576,-14107,-29576,-14107,-29576,-14107,-29576,-14107,
                                  -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                                  -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                  -30591,-11743,-30591,-11743,-30591,-11743,-30591,-11743,
                                  -30888,-10938,-30888,-10938,-30888,-10938,-30888,-10938,
                                  -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                                  -31418,-9307,-31418,-9307,-31418,-9307,-31418,-9307,
                                  -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                  -31862,-7650,-31862,-7650,-31862,-7650,-31862,-7650,
                                  -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                                  -32219,-5972,-32219,-5972,-32219,-5972,-32219,-5972,
                                  -32364,-5126,-32364,-5126,-32364,-5126,-32364,-5126,
                                  -32487,-4277,-32487,-4277,-32487,-4277,-32487,-4277,
                                  -32588,-3426,-32588,-3426,-32588,-3426,-32588,-3426,
                                  -32666,-2571,-32666,-2571,-32666,-2571,-32666,-2571,
                                  -32723,-1715,-32723,-1715,-32723,-1715,-32723,-1715,
                                  -32756,-858,-32756,-858,-32756,-858,-32756,-858
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
7974
static int16_t twc480[119*2*4] = {32741,-1287,32741,-1287,32741,-1287,32741,-1287,
7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096
                                  32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                                  32539,-3852,32539,-3852,32539,-3852,32539,-3852,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                  31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                                  31536,-8895,31536,-8895,31536,-8895,31536,-8895,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  30741,-11342,30741,-11342,30741,-11342,30741,-11342,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  29757,-13719,29757,-13719,29757,-13719,29757,-13719,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  28589,-16011,28589,-16011,28589,-16011,28589,-16011,
                                  27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                                  27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  25732,-20286,25732,-20286,25732,-20286,25732,-20286,
                                  24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                                  24061,-22243,24061,-22243,24061,-22243,24061,-22243,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22242,-24062,22242,-24062,22242,-24062,22242,-24062,
                                  21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                                  20285,-25733,20285,-25733,20285,-25733,20285,-25733,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                  17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                                  16010,-28590,16010,-28590,16010,-28590,16010,-28590,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  13718,-29758,13718,-29758,13718,-29758,13718,-29758,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  11341,-30742,11341,-30742,11341,-30742,11341,-30742,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  8894,-31537,8894,-31537,8894,-31537,8894,-31537,
                                  7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                                  6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  3851,-32540,3851,-32540,3851,-32540,3851,-32540,
                                  2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                                  1286,-32742,1286,-32742,1286,-32742,1286,-32742,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -1287,-32742,-1287,-32742,-1287,-32742,-1287,-32742,
                                  -2571,-32666,-2571,-32666,-2571,-32666,-2571,-32666,
                                  -3852,-32540,-3852,-32540,-3852,-32540,-3852,-32540,
                                  -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                                  -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                  -7650,-31862,-7650,-31862,-7650,-31862,-7650,-31862,
                                  -8895,-31537,-8895,-31537,-8895,-31537,-8895,-31537,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -11342,-30742,-11342,-30742,-11342,-30742,-11342,-30742,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -13719,-29758,-13719,-29758,-13719,-29758,-13719,-29758,
                                  -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                                  -16011,-28590,-16011,-28590,-16011,-28590,-16011,-28590,
                                  -17121,-27939,-17121,-27939,-17121,-27939,-17121,-27939,
                                  -18205,-27245,-18205,-27245,-18205,-27245,-18205,-27245,
                                  -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                                  -20286,-25733,-20286,-25733,-20286,-25733,-20286,-25733,
                                  -21281,-24917,-21281,-24917,-21281,-24917,-21281,-24917,
                                  -22243,-24062,-22243,-24062,-22243,-24062,-22243,-24062,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -24062,-22243,-24062,-22243,-24062,-22243,-24062,-22243,
                                  -24917,-21281,-24917,-21281,-24917,-21281,-24917,-21281,
                                  -25733,-20286,-25733,-20286,-25733,-20286,-25733,-20286,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -27245,-18205,-27245,-18205,-27245,-18205,-27245,-18205,
                                  -27939,-17121,-27939,-17121,-27939,-17121,-27939,-17121,
                                  -28590,-16011,-28590,-16011,-28590,-16011,-28590,-16011,
                                  -29196,-14876,-29196,-14876,-29196,-14876,-29196,-14876,
                                  -29758,-13719,-29758,-13719,-29758,-13719,-29758,-13719,
                                  -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                  -30742,-11342,-30742,-11342,-30742,-11342,-30742,-11342,
                                  -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                                  -31537,-8895,-31537,-8895,-31537,-8895,-31537,-8895,
                                  -31862,-7650,-31862,-7650,-31862,-7650,-31862,-7650,
                                  -32138,-6393,-32138,-6393,-32138,-6393,-32138,-6393,
                                  -32364,-5126,-32364,-5126,-32364,-5126,-32364,-5126,
                                  -32540,-3852,-32540,-3852,-32540,-3852,-32540,-3852,
                                  -32666,-2571,-32666,-2571,-32666,-2571,-32666,-2571,
                                  -32742,-1287,-32742,-1287,-32742,-1287,-32742,-1287,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32742,1286,-32742,1286,-32742,1286,-32742,1286,
                                  -32666,2570,-32666,2570,-32666,2570,-32666,2570,
                                  -32540,3851,-32540,3851,-32540,3851,-32540,3851,
                                  -32364,5125,-32364,5125,-32364,5125,-32364,5125,
                                  -32138,6392,-32138,6392,-32138,6392,-32138,6392,
                                  -31862,7649,-31862,7649,-31862,7649,-31862,7649,
                                  -31537,8894,-31537,8894,-31537,8894,-31537,8894,
                                  -31164,10125,-31164,10125,-31164,10125,-31164,10125,
                                  -30742,11341,-30742,11341,-30742,11341,-30742,11341,
                                  -30273,12539,-30273,12539,-30273,12539,-30273,12539,
                                  -29758,13718,-29758,13718,-29758,13718,-29758,13718,
                                  -29196,14875,-29196,14875,-29196,14875,-29196,14875,
                                  -28590,16010,-28590,16010,-28590,16010,-28590,16010,
                                  -27939,17120,-27939,17120,-27939,17120,-27939,17120,
                                  -27245,18204,-27245,18204,-27245,18204,-27245,18204,
                                  -26510,19259,-26510,19259,-26510,19259,-26510,19259,
                                  -25733,20285,-25733,20285,-25733,20285,-25733,20285,
                                  -24917,21280,-24917,21280,-24917,21280,-24917,21280,
                                  -24062,22242,-24062,22242,-24062,22242,-24062,22242,
                                  -23170,23169,-23170,23169,-23170,23169,-23170,23169,
                                  -22243,24061,-22243,24061,-22243,24061,-22243,24061,
                                  -21281,24916,-21281,24916,-21281,24916,-21281,24916,
                                  -20286,25732,-20286,25732,-20286,25732,-20286,25732,
                                  -19260,26509,-19260,26509,-19260,26509,-19260,26509,
                                  -18205,27244,-18205,27244,-18205,27244,-18205,27244,
                                  -17121,27938,-17121,27938,-17121,27938,-17121,27938,
                                  -16011,28589,-16011,28589,-16011,28589,-16011,28589,
                                  -14876,29195,-14876,29195,-14876,29195,-14876,29195,
                                  -13719,29757,-13719,29757,-13719,29757,-13719,29757,
                                  -12540,30272,-12540,30272,-12540,30272,-12540,30272,
                                  -11342,30741,-11342,30741,-11342,30741,-11342,30741,
                                  -10126,31163,-10126,31163,-10126,31163,-10126,31163,
                                  -8895,31536,-8895,31536,-8895,31536,-8895,31536,
                                  -7650,31861,-7650,31861,-7650,31861,-7650,31861,
                                  -6393,32137,-6393,32137,-6393,32137,-6393,32137,
                                  -5126,32363,-5126,32363,-5126,32363,-5126,32363,
                                  -3852,32539,-3852,32539,-3852,32539,-3852,32539,
                                  -2571,32665,-2571,32665,-2571,32665,-2571,32665,
                                  -1287,32741,-1287,32741,-1287,32741,-1287,32741
                                 };

void dft480(int16_t *x,int16_t *y,unsigned char scale_flag)  // 120 x 4
{
Raymond Knopp's avatar
 
Raymond Knopp committed
8097
  int i,j;
8098 8099 8100 8101 8102 8103 8104
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa480[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb480[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc480[0];
  simd_q15_t x2128[480];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[480];//=&ytmp128array2[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
8105 8106 8107



8108
  for (i=0,j=0; i<120; i++,j+=4) {
Raymond Knopp's avatar
 
Raymond Knopp committed
8109
    x2128[i]    = x128[j];
8110 8111 8112
    x2128[i+120] = x128[j+1];
    x2128[i+240] = x128[j+2];
    x2128[i+360] = x128[j+3];
Raymond Knopp's avatar
 
Raymond Knopp committed
8113 8114 8115 8116 8117 8118 8119 8120
  }

  dft120((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft120((int16_t *)(x2128+120),(int16_t *)(ytmp128+120),1);
  dft120((int16_t *)(x2128+240),(int16_t *)(ytmp128+240),1);
  dft120((int16_t *)(x2128+360),(int16_t *)(ytmp128+360),1);

  bfly4_tw1(ytmp128,ytmp128+120,ytmp128+240,ytmp128+360,y128,y128+120,y128+240,y128+360);
8121 8122

  for (i=1,j=0; i<120; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
8123
    bfly4(ytmp128+i,
8124 8125 8126 8127 8128 8129 8130 8131 8132 8133
          ytmp128+120+i,
          ytmp128+240+i,
          ytmp128+360+i,
          y128+i,
          y128+120+i,
          y128+240+i,
          y128+360+i,
          twa128+j,
          twb128+j,
          twc128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
8134 8135 8136
  }

  if (scale_flag==1) {
8137
    norm128 = set1_int16(16384);//dft_norm_table[13]);
8138 8139

    for (i=0; i<480; i++) {
8140
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175
    }
  }

  _mm_empty();
  _m_empty();

};

/*
Twiddles generated with

twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:179)/540));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:179)/540));
twa2 = zeros(1,2*179);
twb2 = zeros(1,2*179);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa540[179*2*4] = {");
for i=1:2:(2*178)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb540[179*2*4] = {");
for i=1:2:(2*178)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fclose(fd);
*/
static int16_t twa540[179*2*4] = {32764,-382,32764,-382,32764,-382,32764,-382,
8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354
                                  32758,-763,32758,-763,32758,-763,32758,-763,
                                  32747,-1144,32747,-1144,32747,-1144,32747,-1144,
                                  32731,-1525,32731,-1525,32731,-1525,32731,-1525,
                                  32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                  32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                  32658,-2666,32658,-2666,32658,-2666,32658,-2666,
                                  32625,-3046,32625,-3046,32625,-3046,32625,-3046,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32498,-4183,32498,-4183,32498,-4183,32498,-4183,
                                  32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                  32392,-4938,32392,-4938,32392,-4938,32392,-4938,
                                  32333,-5315,32333,-5315,32333,-5315,32333,-5315,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32200,-6066,32200,-6066,32200,-6066,32200,-6066,
                                  32128,-6440,32128,-6440,32128,-6440,32128,-6440,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31969,-7186,31969,-7186,31969,-7186,31969,-7186,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31793,-7928,31793,-7928,31793,-7928,31793,-7928,
                                  31699,-8297,31699,-8297,31699,-8297,31699,-8297,
                                  31600,-8665,31600,-8665,31600,-8665,31600,-8665,
                                  31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                  31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                  31278,-9763,31278,-9763,31278,-9763,31278,-9763,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  31043,-10488,31043,-10488,31043,-10488,31043,-10488,
                                  30919,-10848,30919,-10848,30919,-10848,30919,-10848,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30658,-11565,30658,-11565,30658,-11565,30658,-11565,
                                  30521,-11921,30521,-11921,30521,-11921,30521,-11921,
                                  30381,-12275,30381,-12275,30381,-12275,30381,-12275,
                                  30236,-12628,30236,-12628,30236,-12628,30236,-12628,
                                  30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29777,-13675,29777,-13675,29777,-13675,29777,-13675,
                                  29615,-14021,29615,-14021,29615,-14021,29615,-14021,
                                  29450,-14365,29450,-14365,29450,-14365,29450,-14365,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  29108,-15046,29108,-15046,29108,-15046,29108,-15046,
                                  28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                  28750,-15719,28750,-15719,28750,-15719,28750,-15719,
                                  28565,-16053,28565,-16053,28565,-16053,28565,-16053,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28184,-16713,28184,-16713,28184,-16713,28184,-16713,
                                  27988,-17040,27988,-17040,27988,-17040,27988,-17040,
                                  27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                  27584,-17687,27584,-17687,27584,-17687,27584,-17687,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  27165,-18324,27165,-18324,27165,-18324,27165,-18324,
                                  26950,-18638,26950,-18638,26950,-18638,26950,-18638,
                                  26731,-18951,26731,-18951,26731,-18951,26731,-18951,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                  26053,-19872,26053,-19872,26053,-19872,26053,-19872,
                                  25820,-20174,25820,-20174,25820,-20174,25820,-20174,
                                  25584,-20473,25584,-20473,25584,-20473,25584,-20473,
                                  25344,-20769,25344,-20769,25344,-20769,25344,-20769,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24854,-21353,24854,-21353,24854,-21353,24854,-21353,
                                  24604,-21641,24604,-21641,24604,-21641,24604,-21641,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  24093,-22208,24093,-22208,24093,-22208,24093,-22208,
                                  23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                  23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                  23304,-23035,23304,-23035,23304,-23035,23304,-23035,
                                  23034,-23305,23034,-23305,23034,-23305,23034,-23305,
                                  22761,-23571,22761,-23571,22761,-23571,22761,-23571,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  22207,-24094,22207,-24094,22207,-24094,22207,-24094,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21640,-24605,21640,-24605,21640,-24605,21640,-24605,
                                  21352,-24855,21352,-24855,21352,-24855,21352,-24855,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20768,-25345,20768,-25345,20768,-25345,20768,-25345,
                                  20472,-25585,20472,-25585,20472,-25585,20472,-25585,
                                  20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                  19871,-26054,19871,-26054,19871,-26054,19871,-26054,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18950,-26732,18950,-26732,18950,-26732,18950,-26732,
                                  18637,-26951,18637,-26951,18637,-26951,18637,-26951,
                                  18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                  18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                  17686,-27585,17686,-27585,17686,-27585,17686,-27585,
                                  17363,-27788,17363,-27788,17363,-27788,17363,-27788,
                                  17039,-27989,17039,-27989,17039,-27989,17039,-27989,
                                  16712,-28185,16712,-28185,16712,-28185,16712,-28185,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16052,-28566,16052,-28566,16052,-28566,16052,-28566,
                                  15718,-28751,15718,-28751,15718,-28751,15718,-28751,
                                  15383,-28932,15383,-28932,15383,-28932,15383,-28932,
                                  15045,-29109,15045,-29109,15045,-29109,15045,-29109,
                                  14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                  14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                  14020,-29616,14020,-29616,14020,-29616,14020,-29616,
                                  13674,-29778,13674,-29778,13674,-29778,13674,-29778,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12627,-30237,12627,-30237,12627,-30237,12627,-30237,
                                  12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                  11920,-30522,11920,-30522,11920,-30522,11920,-30522,
                                  11564,-30659,11564,-30659,11564,-30659,11564,-30659,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10847,-30920,10847,-30920,10847,-30920,10847,-30920,
                                  10487,-31044,10487,-31044,10487,-31044,10487,-31044,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9762,-31279,9762,-31279,9762,-31279,9762,-31279,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  9031,-31498,9031,-31498,9031,-31498,9031,-31498,
                                  8664,-31601,8664,-31601,8664,-31601,8664,-31601,
                                  8296,-31700,8296,-31700,8296,-31700,8296,-31700,
                                  7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                  7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                  7185,-31970,7185,-31970,7185,-31970,7185,-31970,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  6439,-32129,6439,-32129,6439,-32129,6439,-32129,
                                  6065,-32201,6065,-32201,6065,-32201,6065,-32201,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5314,-32334,5314,-32334,5314,-32334,5314,-32334,
                                  4937,-32393,4937,-32393,4937,-32393,4937,-32393,
                                  4560,-32449,4560,-32449,4560,-32449,4560,-32449,
                                  4182,-32499,4182,-32499,4182,-32499,4182,-32499,
                                  3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  3045,-32626,3045,-32626,3045,-32626,3045,-32626,
                                  2665,-32659,2665,-32659,2665,-32659,2665,-32659,
                                  2285,-32688,2285,-32688,2285,-32688,2285,-32688,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1524,-32732,1524,-32732,1524,-32732,1524,-32732,
                                  1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                  762,-32759,762,-32759,762,-32759,762,-32759,
                                  381,-32765,381,-32765,381,-32765,381,-32765,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -382,-32765,-382,-32765,-382,-32765,-382,-32765,
                                  -763,-32759,-763,-32759,-763,-32759,-763,-32759,
                                  -1144,-32748,-1144,-32748,-1144,-32748,-1144,-32748,
                                  -1525,-32732,-1525,-32732,-1525,-32732,-1525,-32732,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2286,-32688,-2286,-32688,-2286,-32688,-2286,-32688,
                                  -2666,-32659,-2666,-32659,-2666,-32659,-2666,-32659,
                                  -3046,-32626,-3046,-32626,-3046,-32626,-3046,-32626,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                  -4183,-32499,-4183,-32499,-4183,-32499,-4183,-32499,
                                  -4561,-32449,-4561,-32449,-4561,-32449,-4561,-32449,
                                  -4938,-32393,-4938,-32393,-4938,-32393,-4938,-32393,
                                  -5315,-32334,-5315,-32334,-5315,-32334,-5315,-32334,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6066,-32201,-6066,-32201,-6066,-32201,-6066,-32201,
                                  -6440,-32129,-6440,-32129,-6440,-32129,-6440,-32129,
                                  -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                  -7186,-31970,-7186,-31970,-7186,-31970,-7186,-31970,
                                  -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                  -7928,-31794,-7928,-31794,-7928,-31794,-7928,-31794,
                                  -8297,-31700,-8297,-31700,-8297,-31700,-8297,-31700,
                                  -8665,-31601,-8665,-31601,-8665,-31601,-8665,-31601,
                                  -9032,-31498,-9032,-31498,-9032,-31498,-9032,-31498,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -9763,-31279,-9763,-31279,-9763,-31279,-9763,-31279,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10488,-31044,-10488,-31044,-10488,-31044,-10488,-31044,
                                  -10848,-30920,-10848,-30920,-10848,-30920,-10848,-30920,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11565,-30659,-11565,-30659,-11565,-30659,-11565,-30659,
                                  -11921,-30522,-11921,-30522,-11921,-30522,-11921,-30522,
                                  -12275,-30382,-12275,-30382,-12275,-30382,-12275,-30382,
                                  -12628,-30237,-12628,-30237,-12628,-30237,-12628,-30237,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                  -13675,-29778,-13675,-29778,-13675,-29778,-13675,-29778,
                                  -14021,-29616,-14021,-29616,-14021,-29616,-14021,-29616,
                                  -14365,-29451,-14365,-29451,-14365,-29451,-14365,-29451,
                                  -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                  -15046,-29109,-15046,-29109,-15046,-29109,-15046,-29109,
                                  -15384,-28932,-15384,-28932,-15384,-28932,-15384,-28932,
                                  -15719,-28751,-15719,-28751,-15719,-28751,-15719,-28751,
                                  -16053,-28566,-16053,-28566,-16053,-28566,-16053,-28566
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
8355
static int16_t twb540[179*2*4] = {32758,-763,32758,-763,32758,-763,32758,-763,
8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537
                                  32731,-1525,32731,-1525,32731,-1525,32731,-1525,
                                  32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                  32625,-3046,32625,-3046,32625,-3046,32625,-3046,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                  32333,-5315,32333,-5315,32333,-5315,32333,-5315,
                                  32200,-6066,32200,-6066,32200,-6066,32200,-6066,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31699,-8297,31699,-8297,31699,-8297,31699,-8297,
                                  31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                  31278,-9763,31278,-9763,31278,-9763,31278,-9763,
                                  31043,-10488,31043,-10488,31043,-10488,31043,-10488,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30521,-11921,30521,-11921,30521,-11921,30521,-11921,
                                  30236,-12628,30236,-12628,30236,-12628,30236,-12628,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29615,-14021,29615,-14021,29615,-14021,29615,-14021,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                  28565,-16053,28565,-16053,28565,-16053,28565,-16053,
                                  28184,-16713,28184,-16713,28184,-16713,28184,-16713,
                                  27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  26950,-18638,26950,-18638,26950,-18638,26950,-18638,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26053,-19872,26053,-19872,26053,-19872,26053,-19872,
                                  25584,-20473,25584,-20473,25584,-20473,25584,-20473,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24604,-21641,24604,-21641,24604,-21641,24604,-21641,
                                  24093,-22208,24093,-22208,24093,-22208,24093,-22208,
                                  23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                  23034,-23305,23034,-23305,23034,-23305,23034,-23305,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21352,-24855,21352,-24855,21352,-24855,21352,-24855,
                                  20768,-25345,20768,-25345,20768,-25345,20768,-25345,
                                  20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  18950,-26732,18950,-26732,18950,-26732,18950,-26732,
                                  18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                  17686,-27585,17686,-27585,17686,-27585,17686,-27585,
                                  17039,-27989,17039,-27989,17039,-27989,17039,-27989,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15718,-28751,15718,-28751,15718,-28751,15718,-28751,
                                  15045,-29109,15045,-29109,15045,-29109,15045,-29109,
                                  14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                  13674,-29778,13674,-29778,13674,-29778,13674,-29778,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                  11564,-30659,11564,-30659,11564,-30659,11564,-30659,
                                  10847,-30920,10847,-30920,10847,-30920,10847,-30920,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  8664,-31601,8664,-31601,8664,-31601,8664,-31601,
                                  7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                  7185,-31970,7185,-31970,7185,-31970,7185,-31970,
                                  6439,-32129,6439,-32129,6439,-32129,6439,-32129,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  4937,-32393,4937,-32393,4937,-32393,4937,-32393,
                                  4182,-32499,4182,-32499,4182,-32499,4182,-32499,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  2665,-32659,2665,-32659,2665,-32659,2665,-32659,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                  381,-32765,381,-32765,381,-32765,381,-32765,
                                  -382,-32765,-382,-32765,-382,-32765,-382,-32765,
                                  -1144,-32748,-1144,-32748,-1144,-32748,-1144,-32748,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2666,-32659,-2666,-32659,-2666,-32659,-2666,-32659,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -4183,-32499,-4183,-32499,-4183,-32499,-4183,-32499,
                                  -4938,-32393,-4938,-32393,-4938,-32393,-4938,-32393,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6440,-32129,-6440,-32129,-6440,-32129,-6440,-32129,
                                  -7186,-31970,-7186,-31970,-7186,-31970,-7186,-31970,
                                  -7928,-31794,-7928,-31794,-7928,-31794,-7928,-31794,
                                  -8665,-31601,-8665,-31601,-8665,-31601,-8665,-31601,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10848,-30920,-10848,-30920,-10848,-30920,-10848,-30920,
                                  -11565,-30659,-11565,-30659,-11565,-30659,-11565,-30659,
                                  -12275,-30382,-12275,-30382,-12275,-30382,-12275,-30382,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13675,-29778,-13675,-29778,-13675,-29778,-13675,-29778,
                                  -14365,-29451,-14365,-29451,-14365,-29451,-14365,-29451,
                                  -15046,-29109,-15046,-29109,-15046,-29109,-15046,-29109,
                                  -15719,-28751,-15719,-28751,-15719,-28751,-15719,-28751,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -17040,-27989,-17040,-27989,-17040,-27989,-17040,-27989,
                                  -17687,-27585,-17687,-27585,-17687,-27585,-17687,-27585,
                                  -18324,-27166,-18324,-27166,-18324,-27166,-18324,-27166,
                                  -18951,-26732,-18951,-26732,-18951,-26732,-18951,-26732,
                                  -19568,-26284,-19568,-26284,-19568,-26284,-19568,-26284,
                                  -20174,-25821,-20174,-25821,-20174,-25821,-20174,-25821,
                                  -20769,-25345,-20769,-25345,-20769,-25345,-20769,-25345,
                                  -21353,-24855,-21353,-24855,-21353,-24855,-21353,-24855,
                                  -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                                  -22487,-23834,-22487,-23834,-22487,-23834,-22487,-23834,
                                  -23035,-23305,-23035,-23305,-23035,-23305,-23035,-23305,
                                  -23571,-22762,-23571,-22762,-23571,-22762,-23571,-22762,
                                  -24094,-22208,-24094,-22208,-24094,-22208,-24094,-22208,
                                  -24605,-21641,-24605,-21641,-24605,-21641,-24605,-21641,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25585,-20473,-25585,-20473,-25585,-20473,-25585,-20473,
                                  -26054,-19872,-26054,-19872,-26054,-19872,-26054,-19872,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -26951,-18638,-26951,-18638,-26951,-18638,-26951,-18638,
                                  -27377,-18006,-27377,-18006,-27377,-18006,-27377,-18006,
                                  -27788,-17364,-27788,-17364,-27788,-17364,-27788,-17364,
                                  -28185,-16713,-28185,-16713,-28185,-16713,-28185,-16713,
                                  -28566,-16053,-28566,-16053,-28566,-16053,-28566,-16053,
                                  -28932,-15384,-28932,-15384,-28932,-15384,-28932,-15384,
                                  -29282,-14706,-29282,-14706,-29282,-14706,-29282,-14706,
                                  -29616,-14021,-29616,-14021,-29616,-14021,-29616,-14021,
                                  -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                                  -30237,-12628,-30237,-12628,-30237,-12628,-30237,-12628,
                                  -30522,-11921,-30522,-11921,-30522,-11921,-30522,-11921,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -31044,-10488,-31044,-10488,-31044,-10488,-31044,-10488,
                                  -31279,-9763,-31279,-9763,-31279,-9763,-31279,-9763,
                                  -31498,-9032,-31498,-9032,-31498,-9032,-31498,-9032,
                                  -31700,-8297,-31700,-8297,-31700,-8297,-31700,-8297,
                                  -31884,-7557,-31884,-7557,-31884,-7557,-31884,-7557,
                                  -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                                  -32201,-6066,-32201,-6066,-32201,-6066,-32201,-6066,
                                  -32334,-5315,-32334,-5315,-32334,-5315,-32334,-5315,
                                  -32449,-4561,-32449,-4561,-32449,-4561,-32449,-4561,
                                  -32546,-3805,-32546,-3805,-32546,-3805,-32546,-3805,
                                  -32626,-3046,-32626,-3046,-32626,-3046,-32626,-3046,
                                  -32688,-2286,-32688,-2286,-32688,-2286,-32688,-2286,
                                  -32732,-1525,-32732,-1525,-32732,-1525,-32732,-1525,
                                  -32759,-763,-32759,-763,-32759,-763,-32759,-763,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32759,762,-32759,762,-32759,762,-32759,762,
                                  -32732,1524,-32732,1524,-32732,1524,-32732,1524,
                                  -32688,2285,-32688,2285,-32688,2285,-32688,2285,
                                  -32626,3045,-32626,3045,-32626,3045,-32626,3045,
                                  -32546,3804,-32546,3804,-32546,3804,-32546,3804,
                                  -32449,4560,-32449,4560,-32449,4560,-32449,4560,
                                  -32334,5314,-32334,5314,-32334,5314,-32334,5314,
                                  -32201,6065,-32201,6065,-32201,6065,-32201,6065,
                                  -32051,6812,-32051,6812,-32051,6812,-32051,6812,
                                  -31884,7556,-31884,7556,-31884,7556,-31884,7556,
                                  -31700,8296,-31700,8296,-31700,8296,-31700,8296,
                                  -31498,9031,-31498,9031,-31498,9031,-31498,9031,
                                  -31279,9762,-31279,9762,-31279,9762,-31279,9762,
                                  -31044,10487,-31044,10487,-31044,10487,-31044,10487,
                                  -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                  -30522,11920,-30522,11920,-30522,11920,-30522,11920,
                                  -30237,12627,-30237,12627,-30237,12627,-30237,12627,
                                  -29935,13327,-29935,13327,-29935,13327,-29935,13327,
                                  -29616,14020,-29616,14020,-29616,14020,-29616,14020,
                                  -29282,14705,-29282,14705,-29282,14705,-29282,14705,
                                  -28932,15383,-28932,15383,-28932,15383,-28932,15383,
                                  -28566,16052,-28566,16052,-28566,16052,-28566,16052,
                                  -28185,16712,-28185,16712,-28185,16712,-28185,16712,
                                  -27788,17363,-27788,17363,-27788,17363,-27788,17363,
                                  -27377,18005,-27377,18005,-27377,18005,-27377,18005,
                                  -26951,18637,-26951,18637,-26951,18637,-26951,18637,
                                  -26510,19259,-26510,19259,-26510,19259,-26510,19259,
                                  -26054,19871,-26054,19871,-26054,19871,-26054,19871,
                                  -25585,20472,-25585,20472,-25585,20472,-25585,20472,
                                  -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                  -24605,21640,-24605,21640,-24605,21640,-24605,21640,
                                  -24094,22207,-24094,22207,-24094,22207,-24094,22207,
                                  -23571,22761,-23571,22761,-23571,22761,-23571,22761,
                                  -23035,23304,-23035,23304,-23035,23304,-23035,23304,
                                  -22487,23833,-22487,23833,-22487,23833,-22487,23833,
                                  -21926,24350,-21926,24350,-21926,24350,-21926,24350,
                                  -21353,24854,-21353,24854,-21353,24854,-21353,24854,
                                  -20769,25344,-20769,25344,-20769,25344,-20769,25344,
                                  -20174,25820,-20174,25820,-20174,25820,-20174,25820,
                                  -19568,26283,-19568,26283,-19568,26283,-19568,26283,
                                  -18951,26731,-18951,26731,-18951,26731,-18951,26731,
                                  -18324,27165,-18324,27165,-18324,27165,-18324,27165,
                                  -17687,27584,-17687,27584,-17687,27584,-17687,27584,
                                  -17040,27988,-17040,27988,-17040,27988,-17040,27988
                                 };

void dft540(int16_t *x,int16_t *y,unsigned char scale_flag)  // 180 x 3
{
Raymond Knopp's avatar
 
Raymond Knopp committed
8538
  int i,j;
8539 8540 8541 8542 8543 8544
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa540[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb540[0];
  simd_q15_t x2128[540];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[540];//=&ytmp128array3[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
8545 8546 8547



8548
  for (i=0,j=0; i<180; i++,j+=3) {
Raymond Knopp's avatar
 
Raymond Knopp committed
8549 8550 8551 8552 8553 8554 8555 8556 8557 8558
    x2128[i]    = x128[j];
    x2128[i+180] = x128[j+1];
    x2128[i+360] = x128[j+2];
  }

  dft180((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft180((int16_t *)(x2128+180),(int16_t *)(ytmp128+180),1);
  dft180((int16_t *)(x2128+360),(int16_t *)(ytmp128+360),1);

  bfly3_tw1(ytmp128,ytmp128+180,ytmp128+360,y128,y128+180,y128+360);
8559 8560

  for (i=1,j=0; i<180; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
8561
    bfly3(ytmp128+i,
8562 8563 8564 8565 8566 8567 8568
          ytmp128+180+i,
          ytmp128+360+i,
          y128+i,
          y128+180+i,
          y128+360+i,
          twa128+j,
          twb128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
8569 8570 8571
  }

  if (scale_flag==1) {
8572
    norm128 = set1_int16(dft_norm_table[14]);
8573 8574

    for (i=0; i<540; i++) {
8575
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608
    }
  }

  _mm_empty();
  _m_empty();

};

/*
Twiddles generated with

twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:191)/576));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:191)/576));
twa2 = zeros(1,2*191);
twb2 = zeros(1,2*191);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa576[191*2*4] = {");
for i=1:2:(2*190)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb576[191*2*4] = {");
for i=1:2:(2*190)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fclose(fd);
8609
*/
Raymond Knopp's avatar
 
Raymond Knopp committed
8610
static int16_t twa576[191*2*4] = {32765,-358,32765,-358,32765,-358,32765,-358,
8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801
                                  32759,-715,32759,-715,32759,-715,32759,-715,
                                  32749,-1073,32749,-1073,32749,-1073,32749,-1073,
                                  32735,-1430,32735,-1430,32735,-1430,32735,-1430,
                                  32718,-1787,32718,-1787,32718,-1787,32718,-1787,
                                  32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                  32671,-2500,32671,-2500,32671,-2500,32671,-2500,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32609,-3212,32609,-3212,32609,-3212,32609,-3212,
                                  32572,-3568,32572,-3568,32572,-3568,32572,-3568,
                                  32531,-3923,32531,-3923,32531,-3923,32531,-3923,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32438,-4632,32438,-4632,32438,-4632,32438,-4632,
                                  32385,-4985,32385,-4985,32385,-4985,32385,-4985,
                                  32329,-5338,32329,-5338,32329,-5338,32329,-5338,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32205,-6042,32205,-6042,32205,-6042,32205,-6042,
                                  32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                  32065,-6743,32065,-6743,32065,-6743,32065,-6743,
                                  31990,-7093,31990,-7093,31990,-7093,31990,-7093,
                                  31911,-7441,31911,-7441,31911,-7441,31911,-7441,
                                  31827,-7789,31827,-7789,31827,-7789,31827,-7789,
                                  31741,-8135,31741,-8135,31741,-8135,31741,-8135,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31556,-8826,31556,-8826,31556,-8826,31556,-8826,
                                  31457,-9170,31457,-9170,31457,-9170,31457,-9170,
                                  31356,-9512,31356,-9512,31356,-9512,31356,-9512,
                                  31250,-9854,31250,-9854,31250,-9854,31250,-9854,
                                  31141,-10194,31141,-10194,31141,-10194,31141,-10194,
                                  31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                  30911,-10871,30911,-10871,30911,-10871,30911,-10871,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30666,-11543,30666,-11543,30666,-11543,30666,-11543,
                                  30539,-11877,30539,-11877,30539,-11877,30539,-11877,
                                  30407,-12209,30407,-12209,30407,-12209,30407,-12209,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  30134,-12869,30134,-12869,30134,-12869,30134,-12869,
                                  29992,-13197,29992,-13197,29992,-13197,29992,-13197,
                                  29846,-13524,29846,-13524,29846,-13524,29846,-13524,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29544,-14172,29544,-14172,29544,-14172,29544,-14172,
                                  29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                  29227,-14813,29227,-14813,29227,-14813,29227,-14813,
                                  29064,-15131,29064,-15131,29064,-15131,29064,-15131,
                                  28897,-15447,28897,-15447,28897,-15447,28897,-15447,
                                  28727,-15761,28727,-15761,28727,-15761,28727,-15761,
                                  28554,-16073,28554,-16073,28554,-16073,28554,-16073,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28196,-16693,28196,-16693,28196,-16693,28196,-16693,
                                  28012,-16999,28012,-16999,28012,-16999,28012,-16999,
                                  27825,-17304,27825,-17304,27825,-17304,27825,-17304,
                                  27635,-17606,27635,-17606,27635,-17606,27635,-17606,
                                  27441,-17907,27441,-17907,27441,-17907,27441,-17907,
                                  27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                  27044,-18501,27044,-18501,27044,-18501,27044,-18501,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26634,-19087,26634,-19087,26634,-19087,26634,-19087,
                                  26424,-19376,26424,-19376,26424,-19376,26424,-19376,
                                  26211,-19663,26211,-19663,26211,-19663,26211,-19663,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25776,-20230,25776,-20230,25776,-20230,25776,-20230,
                                  25554,-20510,25554,-20510,25554,-20510,25554,-20510,
                                  25329,-20788,25329,-20788,25329,-20788,25329,-20788,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24869,-21335,24869,-21335,24869,-21335,24869,-21335,
                                  24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                  24398,-21873,24398,-21873,24398,-21873,24398,-21873,
                                  24158,-22138,24158,-22138,24158,-22138,24158,-22138,
                                  23915,-22400,23915,-22400,23915,-22400,23915,-22400,
                                  23669,-22659,23669,-22659,23669,-22659,23669,-22659,
                                  23421,-22916,23421,-22916,23421,-22916,23421,-22916,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22915,-23422,22915,-23422,22915,-23422,22915,-23422,
                                  22658,-23670,22658,-23670,22658,-23670,22658,-23670,
                                  22399,-23916,22399,-23916,22399,-23916,22399,-23916,
                                  22137,-24159,22137,-24159,22137,-24159,22137,-24159,
                                  21872,-24399,21872,-24399,21872,-24399,21872,-24399,
                                  21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                  21334,-24870,21334,-24870,21334,-24870,21334,-24870,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20787,-25330,20787,-25330,20787,-25330,20787,-25330,
                                  20509,-25555,20509,-25555,20509,-25555,20509,-25555,
                                  20229,-25777,20229,-25777,20229,-25777,20229,-25777,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19662,-26212,19662,-26212,19662,-26212,19662,-26212,
                                  19375,-26425,19375,-26425,19375,-26425,19375,-26425,
                                  19086,-26635,19086,-26635,19086,-26635,19086,-26635,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18500,-27045,18500,-27045,18500,-27045,18500,-27045,
                                  18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                  17906,-27442,17906,-27442,17906,-27442,17906,-27442,
                                  17605,-27636,17605,-27636,17605,-27636,17605,-27636,
                                  17303,-27826,17303,-27826,17303,-27826,17303,-27826,
                                  16998,-28013,16998,-28013,16998,-28013,16998,-28013,
                                  16692,-28197,16692,-28197,16692,-28197,16692,-28197,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16072,-28555,16072,-28555,16072,-28555,16072,-28555,
                                  15760,-28728,15760,-28728,15760,-28728,15760,-28728,
                                  15446,-28898,15446,-28898,15446,-28898,15446,-28898,
                                  15130,-29065,15130,-29065,15130,-29065,15130,-29065,
                                  14812,-29228,14812,-29228,14812,-29228,14812,-29228,
                                  14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                  14171,-29545,14171,-29545,14171,-29545,14171,-29545,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  13523,-29847,13523,-29847,13523,-29847,13523,-29847,
                                  13196,-29993,13196,-29993,13196,-29993,13196,-29993,
                                  12868,-30135,12868,-30135,12868,-30135,12868,-30135,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  12208,-30408,12208,-30408,12208,-30408,12208,-30408,
                                  11876,-30540,11876,-30540,11876,-30540,11876,-30540,
                                  11542,-30667,11542,-30667,11542,-30667,11542,-30667,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10870,-30912,10870,-30912,10870,-30912,10870,-30912,
                                  10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                  10193,-31142,10193,-31142,10193,-31142,10193,-31142,
                                  9853,-31251,9853,-31251,9853,-31251,9853,-31251,
                                  9511,-31357,9511,-31357,9511,-31357,9511,-31357,
                                  9169,-31458,9169,-31458,9169,-31458,9169,-31458,
                                  8825,-31557,8825,-31557,8825,-31557,8825,-31557,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8134,-31742,8134,-31742,8134,-31742,8134,-31742,
                                  7788,-31828,7788,-31828,7788,-31828,7788,-31828,
                                  7440,-31912,7440,-31912,7440,-31912,7440,-31912,
                                  7092,-31991,7092,-31991,7092,-31991,7092,-31991,
                                  6742,-32066,6742,-32066,6742,-32066,6742,-32066,
                                  6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                  6041,-32206,6041,-32206,6041,-32206,6041,-32206,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5337,-32330,5337,-32330,5337,-32330,5337,-32330,
                                  4984,-32386,4984,-32386,4984,-32386,4984,-32386,
                                  4631,-32439,4631,-32439,4631,-32439,4631,-32439,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  3922,-32532,3922,-32532,3922,-32532,3922,-32532,
                                  3567,-32573,3567,-32573,3567,-32573,3567,-32573,
                                  3211,-32610,3211,-32610,3211,-32610,3211,-32610,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  2499,-32672,2499,-32672,2499,-32672,2499,-32672,
                                  2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                  1786,-32719,1786,-32719,1786,-32719,1786,-32719,
                                  1429,-32736,1429,-32736,1429,-32736,1429,-32736,
                                  1072,-32750,1072,-32750,1072,-32750,1072,-32750,
                                  714,-32760,714,-32760,714,-32760,714,-32760,
                                  357,-32766,357,-32766,357,-32766,357,-32766,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -358,-32766,-358,-32766,-358,-32766,-358,-32766,
                                  -715,-32760,-715,-32760,-715,-32760,-715,-32760,
                                  -1073,-32750,-1073,-32750,-1073,-32750,-1073,-32750,
                                  -1430,-32736,-1430,-32736,-1430,-32736,-1430,-32736,
                                  -1787,-32719,-1787,-32719,-1787,-32719,-1787,-32719,
                                  -2144,-32697,-2144,-32697,-2144,-32697,-2144,-32697,
                                  -2500,-32672,-2500,-32672,-2500,-32672,-2500,-32672,
                                  -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                  -3212,-32610,-3212,-32610,-3212,-32610,-3212,-32610,
                                  -3568,-32573,-3568,-32573,-3568,-32573,-3568,-32573,
                                  -3923,-32532,-3923,-32532,-3923,-32532,-3923,-32532,
                                  -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                  -4632,-32439,-4632,-32439,-4632,-32439,-4632,-32439,
                                  -4985,-32386,-4985,-32386,-4985,-32386,-4985,-32386,
                                  -5338,-32330,-5338,-32330,-5338,-32330,-5338,-32330,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6042,-32206,-6042,-32206,-6042,-32206,-6042,-32206,
                                  -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                  -6743,-32066,-6743,-32066,-6743,-32066,-6743,-32066,
                                  -7093,-31991,-7093,-31991,-7093,-31991,-7093,-31991,
                                  -7441,-31912,-7441,-31912,-7441,-31912,-7441,-31912,
                                  -7789,-31828,-7789,-31828,-7789,-31828,-7789,-31828,
                                  -8135,-31742,-8135,-31742,-8135,-31742,-8135,-31742,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -8826,-31557,-8826,-31557,-8826,-31557,-8826,-31557,
                                  -9170,-31458,-9170,-31458,-9170,-31458,-9170,-31458,
                                  -9512,-31357,-9512,-31357,-9512,-31357,-9512,-31357,
                                  -9854,-31251,-9854,-31251,-9854,-31251,-9854,-31251,
                                  -10194,-31142,-10194,-31142,-10194,-31142,-10194,-31142,
                                  -10533,-31029,-10533,-31029,-10533,-31029,-10533,-31029,
                                  -10871,-30912,-10871,-30912,-10871,-30912,-10871,-30912,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11543,-30667,-11543,-30667,-11543,-30667,-11543,-30667,
                                  -11877,-30540,-11877,-30540,-11877,-30540,-11877,-30540,
                                  -12209,-30408,-12209,-30408,-12209,-30408,-12209,-30408,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -12869,-30135,-12869,-30135,-12869,-30135,-12869,-30135,
                                  -13197,-29993,-13197,-29993,-13197,-29993,-13197,-29993,
                                  -13524,-29847,-13524,-29847,-13524,-29847,-13524,-29847,
                                  -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                  -14172,-29545,-14172,-29545,-14172,-29545,-14172,-29545,
                                  -14493,-29388,-14493,-29388,-14493,-29388,-14493,-29388,
                                  -14813,-29228,-14813,-29228,-14813,-29228,-14813,-29228,
                                  -15131,-29065,-15131,-29065,-15131,-29065,-15131,-29065,
                                  -15447,-28898,-15447,-28898,-15447,-28898,-15447,-28898,
                                  -15761,-28728,-15761,-28728,-15761,-28728,-15761,-28728,
                                  -16073,-28555,-16073,-28555,-16073,-28555,-16073,-28555
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
8802
static int16_t twb576[191*2*4] = {32759,-715,32759,-715,32759,-715,32759,-715,
8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996
                                  32735,-1430,32735,-1430,32735,-1430,32735,-1430,
                                  32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32572,-3568,32572,-3568,32572,-3568,32572,-3568,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32385,-4985,32385,-4985,32385,-4985,32385,-4985,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                  31990,-7093,31990,-7093,31990,-7093,31990,-7093,
                                  31827,-7789,31827,-7789,31827,-7789,31827,-7789,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31457,-9170,31457,-9170,31457,-9170,31457,-9170,
                                  31250,-9854,31250,-9854,31250,-9854,31250,-9854,
                                  31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30539,-11877,30539,-11877,30539,-11877,30539,-11877,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  29992,-13197,29992,-13197,29992,-13197,29992,-13197,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                  29064,-15131,29064,-15131,29064,-15131,29064,-15131,
                                  28727,-15761,28727,-15761,28727,-15761,28727,-15761,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28012,-16999,28012,-16999,28012,-16999,28012,-16999,
                                  27635,-17606,27635,-17606,27635,-17606,27635,-17606,
                                  27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26424,-19376,26424,-19376,26424,-19376,26424,-19376,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25554,-20510,25554,-20510,25554,-20510,25554,-20510,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                  24158,-22138,24158,-22138,24158,-22138,24158,-22138,
                                  23669,-22659,23669,-22659,23669,-22659,23669,-22659,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22658,-23670,22658,-23670,22658,-23670,22658,-23670,
                                  22137,-24159,22137,-24159,22137,-24159,22137,-24159,
                                  21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20509,-25555,20509,-25555,20509,-25555,20509,-25555,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19375,-26425,19375,-26425,19375,-26425,19375,-26425,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                  17605,-27636,17605,-27636,17605,-27636,17605,-27636,
                                  16998,-28013,16998,-28013,16998,-28013,16998,-28013,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15760,-28728,15760,-28728,15760,-28728,15760,-28728,
                                  15130,-29065,15130,-29065,15130,-29065,15130,-29065,
                                  14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  13196,-29993,13196,-29993,13196,-29993,13196,-29993,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  11876,-30540,11876,-30540,11876,-30540,11876,-30540,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                  9853,-31251,9853,-31251,9853,-31251,9853,-31251,
                                  9169,-31458,9169,-31458,9169,-31458,9169,-31458,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  7788,-31828,7788,-31828,7788,-31828,7788,-31828,
                                  7092,-31991,7092,-31991,7092,-31991,7092,-31991,
                                  6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  4984,-32386,4984,-32386,4984,-32386,4984,-32386,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  3567,-32573,3567,-32573,3567,-32573,3567,-32573,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                  1429,-32736,1429,-32736,1429,-32736,1429,-32736,
                                  714,-32760,714,-32760,714,-32760,714,-32760,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -715,-32760,-715,-32760,-715,-32760,-715,-32760,
                                  -1430,-32736,-1430,-32736,-1430,-32736,-1430,-32736,
                                  -2144,-32697,-2144,-32697,-2144,-32697,-2144,-32697,
                                  -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                  -3568,-32573,-3568,-32573,-3568,-32573,-3568,-32573,
                                  -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                  -4985,-32386,-4985,-32386,-4985,-32386,-4985,-32386,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                  -7093,-31991,-7093,-31991,-7093,-31991,-7093,-31991,
                                  -7789,-31828,-7789,-31828,-7789,-31828,-7789,-31828,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -9170,-31458,-9170,-31458,-9170,-31458,-9170,-31458,
                                  -9854,-31251,-9854,-31251,-9854,-31251,-9854,-31251,
                                  -10533,-31029,-10533,-31029,-10533,-31029,-10533,-31029,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11877,-30540,-11877,-30540,-11877,-30540,-11877,-30540,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -13197,-29993,-13197,-29993,-13197,-29993,-13197,-29993,
                                  -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                  -14493,-29388,-14493,-29388,-14493,-29388,-14493,-29388,
                                  -15131,-29065,-15131,-29065,-15131,-29065,-15131,-29065,
                                  -15761,-28728,-15761,-28728,-15761,-28728,-15761,-28728,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -16999,-28013,-16999,-28013,-16999,-28013,-16999,-28013,
                                  -17606,-27636,-17606,-27636,-17606,-27636,-17606,-27636,
                                  -18205,-27245,-18205,-27245,-18205,-27245,-18205,-27245,
                                  -18795,-26842,-18795,-26842,-18795,-26842,-18795,-26842,
                                  -19376,-26425,-19376,-26425,-19376,-26425,-19376,-26425,
                                  -19948,-25996,-19948,-25996,-19948,-25996,-19948,-25996,
                                  -20510,-25555,-20510,-25555,-20510,-25555,-20510,-25555,
                                  -21063,-25101,-21063,-25101,-21063,-25101,-21063,-25101,
                                  -21605,-24636,-21605,-24636,-21605,-24636,-21605,-24636,
                                  -22138,-24159,-22138,-24159,-22138,-24159,-22138,-24159,
                                  -22659,-23670,-22659,-23670,-22659,-23670,-22659,-23670,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -23670,-22659,-23670,-22659,-23670,-22659,-23670,-22659,
                                  -24159,-22138,-24159,-22138,-24159,-22138,-24159,-22138,
                                  -24636,-21605,-24636,-21605,-24636,-21605,-24636,-21605,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25555,-20510,-25555,-20510,-25555,-20510,-25555,-20510,
                                  -25996,-19948,-25996,-19948,-25996,-19948,-25996,-19948,
                                  -26425,-19376,-26425,-19376,-26425,-19376,-26425,-19376,
                                  -26842,-18795,-26842,-18795,-26842,-18795,-26842,-18795,
                                  -27245,-18205,-27245,-18205,-27245,-18205,-27245,-18205,
                                  -27636,-17606,-27636,-17606,-27636,-17606,-27636,-17606,
                                  -28013,-16999,-28013,-16999,-28013,-16999,-28013,-16999,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28728,-15761,-28728,-15761,-28728,-15761,-28728,-15761,
                                  -29065,-15131,-29065,-15131,-29065,-15131,-29065,-15131,
                                  -29388,-14493,-29388,-14493,-29388,-14493,-29388,-14493,
                                  -29697,-13848,-29697,-13848,-29697,-13848,-29697,-13848,
                                  -29993,-13197,-29993,-13197,-29993,-13197,-29993,-13197,
                                  -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                  -30540,-11877,-30540,-11877,-30540,-11877,-30540,-11877,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -31029,-10533,-31029,-10533,-31029,-10533,-31029,-10533,
                                  -31251,-9854,-31251,-9854,-31251,-9854,-31251,-9854,
                                  -31458,-9170,-31458,-9170,-31458,-9170,-31458,-9170,
                                  -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                  -31828,-7789,-31828,-7789,-31828,-7789,-31828,-7789,
                                  -31991,-7093,-31991,-7093,-31991,-7093,-31991,-7093,
                                  -32138,-6393,-32138,-6393,-32138,-6393,-32138,-6393,
                                  -32270,-5690,-32270,-5690,-32270,-5690,-32270,-5690,
                                  -32386,-4985,-32386,-4985,-32386,-4985,-32386,-4985,
                                  -32487,-4277,-32487,-4277,-32487,-4277,-32487,-4277,
                                  -32573,-3568,-32573,-3568,-32573,-3568,-32573,-3568,
                                  -32643,-2856,-32643,-2856,-32643,-2856,-32643,-2856,
                                  -32697,-2144,-32697,-2144,-32697,-2144,-32697,-2144,
                                  -32736,-1430,-32736,-1430,-32736,-1430,-32736,-1430,
                                  -32760,-715,-32760,-715,-32760,-715,-32760,-715,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32760,714,-32760,714,-32760,714,-32760,714,
                                  -32736,1429,-32736,1429,-32736,1429,-32736,1429,
                                  -32697,2143,-32697,2143,-32697,2143,-32697,2143,
                                  -32643,2855,-32643,2855,-32643,2855,-32643,2855,
                                  -32573,3567,-32573,3567,-32573,3567,-32573,3567,
                                  -32487,4276,-32487,4276,-32487,4276,-32487,4276,
                                  -32386,4984,-32386,4984,-32386,4984,-32386,4984,
                                  -32270,5689,-32270,5689,-32270,5689,-32270,5689,
                                  -32138,6392,-32138,6392,-32138,6392,-32138,6392,
                                  -31991,7092,-31991,7092,-31991,7092,-31991,7092,
                                  -31828,7788,-31828,7788,-31828,7788,-31828,7788,
                                  -31651,8480,-31651,8480,-31651,8480,-31651,8480,
                                  -31458,9169,-31458,9169,-31458,9169,-31458,9169,
                                  -31251,9853,-31251,9853,-31251,9853,-31251,9853,
                                  -31029,10532,-31029,10532,-31029,10532,-31029,10532,
                                  -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                  -30540,11876,-30540,11876,-30540,11876,-30540,11876,
                                  -30273,12539,-30273,12539,-30273,12539,-30273,12539,
                                  -29993,13196,-29993,13196,-29993,13196,-29993,13196,
                                  -29697,13847,-29697,13847,-29697,13847,-29697,13847,
                                  -29388,14492,-29388,14492,-29388,14492,-29388,14492,
                                  -29065,15130,-29065,15130,-29065,15130,-29065,15130,
                                  -28728,15760,-28728,15760,-28728,15760,-28728,15760,
                                  -28378,16383,-28378,16383,-28378,16383,-28378,16383,
                                  -28013,16998,-28013,16998,-28013,16998,-28013,16998,
                                  -27636,17605,-27636,17605,-27636,17605,-27636,17605,
                                  -27245,18204,-27245,18204,-27245,18204,-27245,18204,
                                  -26842,18794,-26842,18794,-26842,18794,-26842,18794,
                                  -26425,19375,-26425,19375,-26425,19375,-26425,19375,
                                  -25996,19947,-25996,19947,-25996,19947,-25996,19947,
                                  -25555,20509,-25555,20509,-25555,20509,-25555,20509,
                                  -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                  -24636,21604,-24636,21604,-24636,21604,-24636,21604,
                                  -24159,22137,-24159,22137,-24159,22137,-24159,22137,
                                  -23670,22658,-23670,22658,-23670,22658,-23670,22658,
                                  -23170,23169,-23170,23169,-23170,23169,-23170,23169,
                                  -22659,23669,-22659,23669,-22659,23669,-22659,23669,
                                  -22138,24158,-22138,24158,-22138,24158,-22138,24158,
                                  -21605,24635,-21605,24635,-21605,24635,-21605,24635,
                                  -21063,25100,-21063,25100,-21063,25100,-21063,25100,
                                  -20510,25554,-20510,25554,-20510,25554,-20510,25554,
                                  -19948,25995,-19948,25995,-19948,25995,-19948,25995,
                                  -19376,26424,-19376,26424,-19376,26424,-19376,26424,
                                  -18795,26841,-18795,26841,-18795,26841,-18795,26841,
                                  -18205,27244,-18205,27244,-18205,27244,-18205,27244,
                                  -17606,27635,-17606,27635,-17606,27635,-17606,27635,
                                  -16999,28012,-16999,28012,-16999,28012,-16999,28012
                                 };

void dft576(int16_t *x,int16_t *y,unsigned char scale_flag)  // 192 x 3
{
Raymond Knopp's avatar
 
Raymond Knopp committed
8997
  int i,j;
8998 8999 9000 9001 9002 9003
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa576[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb576[0];
  simd_q15_t x2128[576];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[576];//=&ytmp128array3[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
9004 9005 9006



9007
  for (i=0,j=0; i<192; i++,j+=3) {
Raymond Knopp's avatar
 
Raymond Knopp committed
9008 9009 9010 9011
    x2128[i]    = x128[j];
    x2128[i+192] = x128[j+1];
    x2128[i+384] = x128[j+2];
  }
9012

Raymond Knopp's avatar
 
Raymond Knopp committed
9013 9014 9015 9016

  dft192((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft192((int16_t *)(x2128+192),(int16_t *)(ytmp128+192),1);
  dft192((int16_t *)(x2128+384),(int16_t *)(ytmp128+384),1);
9017

Raymond Knopp's avatar
 
Raymond Knopp committed
9018
  bfly3_tw1(ytmp128,ytmp128+192,ytmp128+384,y128,y128+192,y128+384);
9019 9020

  for (i=1,j=0; i<192; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
9021
    bfly3(ytmp128+i,
9022 9023 9024 9025 9026 9027 9028 9029 9030
          ytmp128+192+i,
          ytmp128+384+i,
          y128+i,
          y128+192+i,
          y128+384+i,
          twa128+j,
          twb128+j);
  }

Raymond Knopp's avatar
 
Raymond Knopp committed
9031
  if (scale_flag==1) {
9032
    norm128 = set1_int16(dft_norm_table[14]);
9033 9034

    for (i=0; i<576; i++) {
9035
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057
    }
  }

  _mm_empty();
  _m_empty();
};

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:299)/600));
twa2 = zeros(1,2*299);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa600[299*2*4] = {");
for i=1:2:(2*298)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fclose(fd);
 */
static int16_t twa600[299*2*4] = {32765,-344,32765,-344,32765,-344,32765,-344,
9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359
                                  32759,-687,32759,-687,32759,-687,32759,-687,
                                  32750,-1030,32750,-1030,32750,-1030,32750,-1030,
                                  32738,-1373,32738,-1373,32738,-1373,32738,-1373,
                                  32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                  32702,-2058,32702,-2058,32702,-2058,32702,-2058,
                                  32679,-2400,32679,-2400,32679,-2400,32679,-2400,
                                  32652,-2742,32652,-2742,32652,-2742,32652,-2742,
                                  32621,-3084,32621,-3084,32621,-3084,32621,-3084,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32549,-3767,32549,-3767,32549,-3767,32549,-3767,
                                  32508,-4107,32508,-4107,32508,-4107,32508,-4107,
                                  32463,-4447,32463,-4447,32463,-4447,32463,-4447,
                                  32415,-4787,32415,-4787,32415,-4787,32415,-4787,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32308,-5465,32308,-5465,32308,-5465,32308,-5465,
                                  32249,-5803,32249,-5803,32249,-5803,32249,-5803,
                                  32186,-6140,32186,-6140,32186,-6140,32186,-6140,
                                  32120,-6477,32120,-6477,32120,-6477,32120,-6477,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31977,-7148,31977,-7148,31977,-7148,31977,-7148,
                                  31901,-7483,31901,-7483,31901,-7483,31901,-7483,
                                  31821,-7817,31821,-7817,31821,-7817,31821,-7817,
                                  31737,-8149,31737,-8149,31737,-8149,31737,-8149,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31559,-8812,31559,-8812,31559,-8812,31559,-8812,
                                  31465,-9142,31465,-9142,31465,-9142,31465,-9142,
                                  31368,-9471,31368,-9471,31368,-9471,31368,-9471,
                                  31267,-9799,31267,-9799,31267,-9799,31267,-9799,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  31055,-10452,31055,-10452,31055,-10452,31055,-10452,
                                  30944,-10776,30944,-10776,30944,-10776,30944,-10776,
                                  30829,-11100,30829,-11100,30829,-11100,30829,-11100,
                                  30711,-11422,30711,-11422,30711,-11422,30711,-11422,
                                  30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                  30465,-12063,30465,-12063,30465,-12063,30465,-12063,
                                  30338,-12381,30338,-12381,30338,-12381,30338,-12381,
                                  30206,-12698,30206,-12698,30206,-12698,30206,-12698,
                                  30072,-13014,30072,-13014,30072,-13014,30072,-13014,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29792,-13641,29792,-13641,29792,-13641,29792,-13641,
                                  29648,-13952,29648,-13952,29648,-13952,29648,-13952,
                                  29500,-14262,29500,-14262,29500,-14262,29500,-14262,
                                  29349,-14570,29349,-14570,29349,-14570,29349,-14570,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  29038,-15181,29038,-15181,29038,-15181,29038,-15181,
                                  28877,-15485,28877,-15485,28877,-15485,28877,-15485,
                                  28713,-15786,28713,-15786,28713,-15786,28713,-15786,
                                  28547,-16086,28547,-16086,28547,-16086,28547,-16086,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28203,-16680,28203,-16680,28203,-16680,28203,-16680,
                                  28027,-16975,28027,-16975,28027,-16975,28027,-16975,
                                  27848,-17267,27848,-17267,27848,-17267,27848,-17267,
                                  27666,-17558,27666,-17558,27666,-17558,27666,-17558,
                                  27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                  27292,-18133,27292,-18133,27292,-18133,27292,-18133,
                                  27100,-18418,27100,-18418,27100,-18418,27100,-18418,
                                  26906,-18701,26906,-18701,26906,-18701,26906,-18701,
                                  26709,-18982,26709,-18982,26709,-18982,26709,-18982,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26305,-19537,26305,-19537,26305,-19537,26305,-19537,
                                  26099,-19811,26099,-19811,26099,-19811,26099,-19811,
                                  25891,-20084,25891,-20084,25891,-20084,25891,-20084,
                                  25679,-20354,25679,-20354,25679,-20354,25679,-20354,
                                  25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                  25247,-20887,25247,-20887,25247,-20887,25247,-20887,
                                  25027,-21150,25027,-21150,25027,-21150,25027,-21150,
                                  24804,-21411,24804,-21411,24804,-21411,24804,-21411,
                                  24578,-21670,24578,-21670,24578,-21670,24578,-21670,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  24119,-22180,24119,-22180,24119,-22180,24119,-22180,
                                  23886,-22431,23886,-22431,23886,-22431,23886,-22431,
                                  23649,-22680,23649,-22680,23649,-22680,23649,-22680,
                                  23411,-22926,23411,-22926,23411,-22926,23411,-22926,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22925,-23412,22925,-23412,22925,-23412,22925,-23412,
                                  22679,-23650,22679,-23650,22679,-23650,22679,-23650,
                                  22430,-23887,22430,-23887,22430,-23887,22430,-23887,
                                  22179,-24120,22179,-24120,22179,-24120,22179,-24120,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21669,-24579,21669,-24579,21669,-24579,21669,-24579,
                                  21410,-24805,21410,-24805,21410,-24805,21410,-24805,
                                  21149,-25028,21149,-25028,21149,-25028,21149,-25028,
                                  20886,-25248,20886,-25248,20886,-25248,20886,-25248,
                                  20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                  20353,-25680,20353,-25680,20353,-25680,20353,-25680,
                                  20083,-25892,20083,-25892,20083,-25892,20083,-25892,
                                  19810,-26100,19810,-26100,19810,-26100,19810,-26100,
                                  19536,-26306,19536,-26306,19536,-26306,19536,-26306,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18981,-26710,18981,-26710,18981,-26710,18981,-26710,
                                  18700,-26907,18700,-26907,18700,-26907,18700,-26907,
                                  18417,-27101,18417,-27101,18417,-27101,18417,-27101,
                                  18132,-27293,18132,-27293,18132,-27293,18132,-27293,
                                  17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                  17557,-27667,17557,-27667,17557,-27667,17557,-27667,
                                  17266,-27849,17266,-27849,17266,-27849,17266,-27849,
                                  16974,-28028,16974,-28028,16974,-28028,16974,-28028,
                                  16679,-28204,16679,-28204,16679,-28204,16679,-28204,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16085,-28548,16085,-28548,16085,-28548,16085,-28548,
                                  15785,-28714,15785,-28714,15785,-28714,15785,-28714,
                                  15484,-28878,15484,-28878,15484,-28878,15484,-28878,
                                  15180,-29039,15180,-29039,15180,-29039,15180,-29039,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14569,-29350,14569,-29350,14569,-29350,14569,-29350,
                                  14261,-29501,14261,-29501,14261,-29501,14261,-29501,
                                  13951,-29649,13951,-29649,13951,-29649,13951,-29649,
                                  13640,-29793,13640,-29793,13640,-29793,13640,-29793,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  13013,-30073,13013,-30073,13013,-30073,13013,-30073,
                                  12697,-30207,12697,-30207,12697,-30207,12697,-30207,
                                  12380,-30339,12380,-30339,12380,-30339,12380,-30339,
                                  12062,-30466,12062,-30466,12062,-30466,12062,-30466,
                                  11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                  11421,-30712,11421,-30712,11421,-30712,11421,-30712,
                                  11099,-30830,11099,-30830,11099,-30830,11099,-30830,
                                  10775,-30945,10775,-30945,10775,-30945,10775,-30945,
                                  10451,-31056,10451,-31056,10451,-31056,10451,-31056,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9798,-31268,9798,-31268,9798,-31268,9798,-31268,
                                  9470,-31369,9470,-31369,9470,-31369,9470,-31369,
                                  9141,-31466,9141,-31466,9141,-31466,9141,-31466,
                                  8811,-31560,8811,-31560,8811,-31560,8811,-31560,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8148,-31738,8148,-31738,8148,-31738,8148,-31738,
                                  7816,-31822,7816,-31822,7816,-31822,7816,-31822,
                                  7482,-31902,7482,-31902,7482,-31902,7482,-31902,
                                  7147,-31978,7147,-31978,7147,-31978,7147,-31978,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  6476,-32121,6476,-32121,6476,-32121,6476,-32121,
                                  6139,-32187,6139,-32187,6139,-32187,6139,-32187,
                                  5802,-32250,5802,-32250,5802,-32250,5802,-32250,
                                  5464,-32309,5464,-32309,5464,-32309,5464,-32309,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4786,-32416,4786,-32416,4786,-32416,4786,-32416,
                                  4446,-32464,4446,-32464,4446,-32464,4446,-32464,
                                  4106,-32509,4106,-32509,4106,-32509,4106,-32509,
                                  3766,-32550,3766,-32550,3766,-32550,3766,-32550,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  3083,-32622,3083,-32622,3083,-32622,3083,-32622,
                                  2741,-32653,2741,-32653,2741,-32653,2741,-32653,
                                  2399,-32680,2399,-32680,2399,-32680,2399,-32680,
                                  2057,-32703,2057,-32703,2057,-32703,2057,-32703,
                                  1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                  1372,-32739,1372,-32739,1372,-32739,1372,-32739,
                                  1029,-32751,1029,-32751,1029,-32751,1029,-32751,
                                  686,-32760,686,-32760,686,-32760,686,-32760,
                                  343,-32766,343,-32766,343,-32766,343,-32766,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -344,-32766,-344,-32766,-344,-32766,-344,-32766,
                                  -687,-32760,-687,-32760,-687,-32760,-687,-32760,
                                  -1030,-32751,-1030,-32751,-1030,-32751,-1030,-32751,
                                  -1373,-32739,-1373,-32739,-1373,-32739,-1373,-32739,
                                  -1715,-32723,-1715,-32723,-1715,-32723,-1715,-32723,
                                  -2058,-32703,-2058,-32703,-2058,-32703,-2058,-32703,
                                  -2400,-32680,-2400,-32680,-2400,-32680,-2400,-32680,
                                  -2742,-32653,-2742,-32653,-2742,-32653,-2742,-32653,
                                  -3084,-32622,-3084,-32622,-3084,-32622,-3084,-32622,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -3767,-32550,-3767,-32550,-3767,-32550,-3767,-32550,
                                  -4107,-32509,-4107,-32509,-4107,-32509,-4107,-32509,
                                  -4447,-32464,-4447,-32464,-4447,-32464,-4447,-32464,
                                  -4787,-32416,-4787,-32416,-4787,-32416,-4787,-32416,
                                  -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                                  -5465,-32309,-5465,-32309,-5465,-32309,-5465,-32309,
                                  -5803,-32250,-5803,-32250,-5803,-32250,-5803,-32250,
                                  -6140,-32187,-6140,-32187,-6140,-32187,-6140,-32187,
                                  -6477,-32121,-6477,-32121,-6477,-32121,-6477,-32121,
                                  -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                  -7148,-31978,-7148,-31978,-7148,-31978,-7148,-31978,
                                  -7483,-31902,-7483,-31902,-7483,-31902,-7483,-31902,
                                  -7817,-31822,-7817,-31822,-7817,-31822,-7817,-31822,
                                  -8149,-31738,-8149,-31738,-8149,-31738,-8149,-31738,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -8812,-31560,-8812,-31560,-8812,-31560,-8812,-31560,
                                  -9142,-31466,-9142,-31466,-9142,-31466,-9142,-31466,
                                  -9471,-31369,-9471,-31369,-9471,-31369,-9471,-31369,
                                  -9799,-31268,-9799,-31268,-9799,-31268,-9799,-31268,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10452,-31056,-10452,-31056,-10452,-31056,-10452,-31056,
                                  -10776,-30945,-10776,-30945,-10776,-30945,-10776,-30945,
                                  -11100,-30830,-11100,-30830,-11100,-30830,-11100,-30830,
                                  -11422,-30712,-11422,-30712,-11422,-30712,-11422,-30712,
                                  -11743,-30591,-11743,-30591,-11743,-30591,-11743,-30591,
                                  -12063,-30466,-12063,-30466,-12063,-30466,-12063,-30466,
                                  -12381,-30339,-12381,-30339,-12381,-30339,-12381,-30339,
                                  -12698,-30207,-12698,-30207,-12698,-30207,-12698,-30207,
                                  -13014,-30073,-13014,-30073,-13014,-30073,-13014,-30073,
                                  -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                  -13641,-29793,-13641,-29793,-13641,-29793,-13641,-29793,
                                  -13952,-29649,-13952,-29649,-13952,-29649,-13952,-29649,
                                  -14262,-29501,-14262,-29501,-14262,-29501,-14262,-29501,
                                  -14570,-29350,-14570,-29350,-14570,-29350,-14570,-29350,
                                  -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                                  -15181,-29039,-15181,-29039,-15181,-29039,-15181,-29039,
                                  -15485,-28878,-15485,-28878,-15485,-28878,-15485,-28878,
                                  -15786,-28714,-15786,-28714,-15786,-28714,-15786,-28714,
                                  -16086,-28548,-16086,-28548,-16086,-28548,-16086,-28548,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -16680,-28204,-16680,-28204,-16680,-28204,-16680,-28204,
                                  -16975,-28028,-16975,-28028,-16975,-28028,-16975,-28028,
                                  -17267,-27849,-17267,-27849,-17267,-27849,-17267,-27849,
                                  -17558,-27667,-17558,-27667,-17558,-27667,-17558,-27667,
                                  -17847,-27481,-17847,-27481,-17847,-27481,-17847,-27481,
                                  -18133,-27293,-18133,-27293,-18133,-27293,-18133,-27293,
                                  -18418,-27101,-18418,-27101,-18418,-27101,-18418,-27101,
                                  -18701,-26907,-18701,-26907,-18701,-26907,-18701,-26907,
                                  -18982,-26710,-18982,-26710,-18982,-26710,-18982,-26710,
                                  -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                                  -19537,-26306,-19537,-26306,-19537,-26306,-19537,-26306,
                                  -19811,-26100,-19811,-26100,-19811,-26100,-19811,-26100,
                                  -20084,-25892,-20084,-25892,-20084,-25892,-20084,-25892,
                                  -20354,-25680,-20354,-25680,-20354,-25680,-20354,-25680,
                                  -20621,-25465,-20621,-25465,-20621,-25465,-20621,-25465,
                                  -20887,-25248,-20887,-25248,-20887,-25248,-20887,-25248,
                                  -21150,-25028,-21150,-25028,-21150,-25028,-21150,-25028,
                                  -21411,-24805,-21411,-24805,-21411,-24805,-21411,-24805,
                                  -21670,-24579,-21670,-24579,-21670,-24579,-21670,-24579,
                                  -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                                  -22180,-24120,-22180,-24120,-22180,-24120,-22180,-24120,
                                  -22431,-23887,-22431,-23887,-22431,-23887,-22431,-23887,
                                  -22680,-23650,-22680,-23650,-22680,-23650,-22680,-23650,
                                  -22926,-23412,-22926,-23412,-22926,-23412,-22926,-23412,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -23412,-22926,-23412,-22926,-23412,-22926,-23412,-22926,
                                  -23650,-22680,-23650,-22680,-23650,-22680,-23650,-22680,
                                  -23887,-22431,-23887,-22431,-23887,-22431,-23887,-22431,
                                  -24120,-22180,-24120,-22180,-24120,-22180,-24120,-22180,
                                  -24351,-21926,-24351,-21926,-24351,-21926,-24351,-21926,
                                  -24579,-21670,-24579,-21670,-24579,-21670,-24579,-21670,
                                  -24805,-21411,-24805,-21411,-24805,-21411,-24805,-21411,
                                  -25028,-21150,-25028,-21150,-25028,-21150,-25028,-21150,
                                  -25248,-20887,-25248,-20887,-25248,-20887,-25248,-20887,
                                  -25465,-20621,-25465,-20621,-25465,-20621,-25465,-20621,
                                  -25680,-20354,-25680,-20354,-25680,-20354,-25680,-20354,
                                  -25892,-20084,-25892,-20084,-25892,-20084,-25892,-20084,
                                  -26100,-19811,-26100,-19811,-26100,-19811,-26100,-19811,
                                  -26306,-19537,-26306,-19537,-26306,-19537,-26306,-19537,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -26710,-18982,-26710,-18982,-26710,-18982,-26710,-18982,
                                  -26907,-18701,-26907,-18701,-26907,-18701,-26907,-18701,
                                  -27101,-18418,-27101,-18418,-27101,-18418,-27101,-18418,
                                  -27293,-18133,-27293,-18133,-27293,-18133,-27293,-18133,
                                  -27481,-17847,-27481,-17847,-27481,-17847,-27481,-17847,
                                  -27667,-17558,-27667,-17558,-27667,-17558,-27667,-17558,
                                  -27849,-17267,-27849,-17267,-27849,-17267,-27849,-17267,
                                  -28028,-16975,-28028,-16975,-28028,-16975,-28028,-16975,
                                  -28204,-16680,-28204,-16680,-28204,-16680,-28204,-16680,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28548,-16086,-28548,-16086,-28548,-16086,-28548,-16086,
                                  -28714,-15786,-28714,-15786,-28714,-15786,-28714,-15786,
                                  -28878,-15485,-28878,-15485,-28878,-15485,-28878,-15485,
                                  -29039,-15181,-29039,-15181,-29039,-15181,-29039,-15181,
                                  -29196,-14876,-29196,-14876,-29196,-14876,-29196,-14876,
                                  -29350,-14570,-29350,-14570,-29350,-14570,-29350,-14570,
                                  -29501,-14262,-29501,-14262,-29501,-14262,-29501,-14262,
                                  -29649,-13952,-29649,-13952,-29649,-13952,-29649,-13952,
                                  -29793,-13641,-29793,-13641,-29793,-13641,-29793,-13641,
                                  -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                                  -30073,-13014,-30073,-13014,-30073,-13014,-30073,-13014,
                                  -30207,-12698,-30207,-12698,-30207,-12698,-30207,-12698,
                                  -30339,-12381,-30339,-12381,-30339,-12381,-30339,-12381,
                                  -30466,-12063,-30466,-12063,-30466,-12063,-30466,-12063,
                                  -30591,-11743,-30591,-11743,-30591,-11743,-30591,-11743,
                                  -30712,-11422,-30712,-11422,-30712,-11422,-30712,-11422,
                                  -30830,-11100,-30830,-11100,-30830,-11100,-30830,-11100,
                                  -30945,-10776,-30945,-10776,-30945,-10776,-30945,-10776,
                                  -31056,-10452,-31056,-10452,-31056,-10452,-31056,-10452,
                                  -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                                  -31268,-9799,-31268,-9799,-31268,-9799,-31268,-9799,
                                  -31369,-9471,-31369,-9471,-31369,-9471,-31369,-9471,
                                  -31466,-9142,-31466,-9142,-31466,-9142,-31466,-9142,
                                  -31560,-8812,-31560,-8812,-31560,-8812,-31560,-8812,
                                  -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                  -31738,-8149,-31738,-8149,-31738,-8149,-31738,-8149,
                                  -31822,-7817,-31822,-7817,-31822,-7817,-31822,-7817,
                                  -31902,-7483,-31902,-7483,-31902,-7483,-31902,-7483,
                                  -31978,-7148,-31978,-7148,-31978,-7148,-31978,-7148,
                                  -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                                  -32121,-6477,-32121,-6477,-32121,-6477,-32121,-6477,
                                  -32187,-6140,-32187,-6140,-32187,-6140,-32187,-6140,
                                  -32250,-5803,-32250,-5803,-32250,-5803,-32250,-5803,
                                  -32309,-5465,-32309,-5465,-32309,-5465,-32309,-5465,
                                  -32364,-5126,-32364,-5126,-32364,-5126,-32364,-5126,
                                  -32416,-4787,-32416,-4787,-32416,-4787,-32416,-4787,
                                  -32464,-4447,-32464,-4447,-32464,-4447,-32464,-4447,
                                  -32509,-4107,-32509,-4107,-32509,-4107,-32509,-4107,
                                  -32550,-3767,-32550,-3767,-32550,-3767,-32550,-3767,
                                  -32588,-3426,-32588,-3426,-32588,-3426,-32588,-3426,
                                  -32622,-3084,-32622,-3084,-32622,-3084,-32622,-3084,
                                  -32653,-2742,-32653,-2742,-32653,-2742,-32653,-2742,
                                  -32680,-2400,-32680,-2400,-32680,-2400,-32680,-2400,
                                  -32703,-2058,-32703,-2058,-32703,-2058,-32703,-2058,
                                  -32723,-1715,-32723,-1715,-32723,-1715,-32723,-1715,
                                  -32739,-1373,-32739,-1373,-32739,-1373,-32739,-1373,
                                  -32751,-1030,-32751,-1030,-32751,-1030,-32751,-1030,
                                  -32760,-687,-32760,-687,-32760,-687,-32760,-687,
                                  -32766,-344,-32766,-344,-32766,-344,-32766,-344
                                 };

void dft600(int16_t *x,int16_t *y,unsigned char scale_flag)  // 300 x 2
{
Raymond Knopp's avatar
 
Raymond Knopp committed
9360
  int i,j;
9361 9362 9363 9364 9365
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *tw128=(simd_q15_t *)&twa600[0];
  simd_q15_t x2128[600];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[600];//=&ytmp128array2[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
9366 9367


9368
  for (i=0,j=0; i<300; i++,j+=2) {
Raymond Knopp's avatar
 
Raymond Knopp committed
9369 9370 9371 9372
    x2128[i]    = x128[j];
    x2128[i+300] = x128[j+1];
  }

9373 9374
  dft300((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft300((int16_t *)(x2128+300),(int16_t *)(ytmp128+300),1);
Raymond Knopp's avatar
 
Raymond Knopp committed
9375 9376 9377


  bfly2_tw1(ytmp128,ytmp128+300,y128,y128+300);
9378 9379

  for (i=1,j=0; i<300; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
9380
    bfly2(ytmp128+i,
9381 9382 9383 9384
          ytmp128+300+i,
          y128+i,
          y128+300+i,
          tw128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
9385 9386 9387
  }

  if (scale_flag==1) {
9388
    norm128 = set1_int16(ONE_OVER_SQRT2_Q15);
9389 9390

    for (i=0; i<600; i++) {
9391
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426
    }
  }

  _mm_empty();
  _m_empty();
};


/*
Twiddles generated with

twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:215)/648));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:215)/648));
twa2 = zeros(1,2*215);
twb2 = zeros(1,2*215);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa648[215*2*4] = {");
for i=1:2:(2*214)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb648[215*2*4] = {");
for i=1:2:(2*214)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fclose(fd);
*/
static int16_t twa648[215*2*4] = {32765,-318,32765,-318,32765,-318,32765,-318,
9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641
                                  32760,-636,32760,-636,32760,-636,32760,-636,
                                  32753,-954,32753,-954,32753,-954,32753,-954,
                                  32742,-1271,32742,-1271,32742,-1271,32742,-1271,
                                  32728,-1588,32728,-1588,32728,-1588,32728,-1588,
                                  32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                  32691,-2223,32691,-2223,32691,-2223,32691,-2223,
                                  32668,-2540,32668,-2540,32668,-2540,32668,-2540,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32613,-3173,32613,-3173,32613,-3173,32613,-3173,
                                  32580,-3489,32580,-3489,32580,-3489,32580,-3489,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32507,-4120,32507,-4120,32507,-4120,32507,-4120,
                                  32465,-4435,32465,-4435,32465,-4435,32465,-4435,
                                  32421,-4749,32421,-4749,32421,-4749,32421,-4749,
                                  32373,-5064,32373,-5064,32373,-5064,32373,-5064,
                                  32322,-5377,32322,-5377,32322,-5377,32322,-5377,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32212,-6003,32212,-6003,32212,-6003,32212,-6003,
                                  32152,-6315,32152,-6315,32152,-6315,32152,-6315,
                                  32090,-6627,32090,-6627,32090,-6627,32090,-6627,
                                  32024,-6937,32024,-6937,32024,-6937,32024,-6937,
                                  31955,-7248,31955,-7248,31955,-7248,31955,-7248,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31808,-7866,31808,-7866,31808,-7866,31808,-7866,
                                  31731,-8174,31731,-8174,31731,-8174,31731,-8174,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31566,-8788,31566,-8788,31566,-8788,31566,-8788,
                                  31480,-9093,31480,-9093,31480,-9093,31480,-9093,
                                  31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                  31297,-9702,31297,-9702,31297,-9702,31297,-9702,
                                  31202,-10005,31202,-10005,31202,-10005,31202,-10005,
                                  31103,-10307,31103,-10307,31103,-10307,31103,-10307,
                                  31002,-10608,31002,-10608,31002,-10608,31002,-10608,
                                  30898,-10908,30898,-10908,30898,-10908,30898,-10908,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30680,-11505,30680,-11505,30680,-11505,30680,-11505,
                                  30567,-11802,30567,-11802,30567,-11802,30567,-11802,
                                  30451,-12098,30451,-12098,30451,-12098,30451,-12098,
                                  30333,-12393,30333,-12393,30333,-12393,30333,-12393,
                                  30211,-12687,30211,-12687,30211,-12687,30211,-12687,
                                  30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                  29959,-13270,29959,-13270,29959,-13270,29959,-13270,
                                  29829,-13560,29829,-13560,29829,-13560,29829,-13560,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29561,-14136,29561,-14136,29561,-14136,29561,-14136,
                                  29422,-14422,29422,-14422,29422,-14422,29422,-14422,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  29137,-14990,29137,-14990,29137,-14990,29137,-14990,
                                  28990,-15271,28990,-15271,28990,-15271,28990,-15271,
                                  28841,-15552,28841,-15552,28841,-15552,28841,-15552,
                                  28689,-15831,28689,-15831,28689,-15831,28689,-15831,
                                  28534,-16108,28534,-16108,28534,-16108,28534,-16108,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28216,-16658,28216,-16658,28216,-16658,28216,-16658,
                                  28054,-16931,28054,-16931,28054,-16931,28054,-16931,
                                  27888,-17202,27888,-17202,27888,-17202,27888,-17202,
                                  27720,-17472,27720,-17472,27720,-17472,27720,-17472,
                                  27549,-17740,27549,-17740,27549,-17740,27549,-17740,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  27200,-18271,27200,-18271,27200,-18271,27200,-18271,
                                  27022,-18534,27022,-18534,27022,-18534,27022,-18534,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26657,-19054,26657,-19054,26657,-19054,26657,-19054,
                                  26471,-19312,26471,-19312,26471,-19312,26471,-19312,
                                  26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                  26092,-19822,26092,-19822,26092,-19822,26092,-19822,
                                  25898,-20074,25898,-20074,25898,-20074,25898,-20074,
                                  25702,-20324,25702,-20324,25702,-20324,25702,-20324,
                                  25504,-20572,25504,-20572,25504,-20572,25504,-20572,
                                  25304,-20818,25304,-20818,25304,-20818,25304,-20818,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24895,-21305,24895,-21305,24895,-21305,24895,-21305,
                                  24687,-21546,24687,-21546,24687,-21546,24687,-21546,
                                  24477,-21784,24477,-21784,24477,-21784,24477,-21784,
                                  24265,-22020,24265,-22020,24265,-22020,24265,-22020,
                                  24050,-22254,24050,-22254,24050,-22254,24050,-22254,
                                  23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                  23614,-22717,23614,-22717,23614,-22717,23614,-22717,
                                  23393,-22945,23393,-22945,23393,-22945,23393,-22945,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22944,-23394,22944,-23394,22944,-23394,22944,-23394,
                                  22716,-23615,22716,-23615,22716,-23615,22716,-23615,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  22253,-24051,22253,-24051,22253,-24051,22253,-24051,
                                  22019,-24266,22019,-24266,22019,-24266,22019,-24266,
                                  21783,-24478,21783,-24478,21783,-24478,21783,-24478,
                                  21545,-24688,21545,-24688,21545,-24688,21545,-24688,
                                  21304,-24896,21304,-24896,21304,-24896,21304,-24896,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20817,-25305,20817,-25305,20817,-25305,20817,-25305,
                                  20571,-25505,20571,-25505,20571,-25505,20571,-25505,
                                  20323,-25703,20323,-25703,20323,-25703,20323,-25703,
                                  20073,-25899,20073,-25899,20073,-25899,20073,-25899,
                                  19821,-26093,19821,-26093,19821,-26093,19821,-26093,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  19311,-26472,19311,-26472,19311,-26472,19311,-26472,
                                  19053,-26658,19053,-26658,19053,-26658,19053,-26658,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18533,-27023,18533,-27023,18533,-27023,18533,-27023,
                                  18270,-27201,18270,-27201,18270,-27201,18270,-27201,
                                  18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                  17739,-27550,17739,-27550,17739,-27550,17739,-27550,
                                  17471,-27721,17471,-27721,17471,-27721,17471,-27721,
                                  17201,-27889,17201,-27889,17201,-27889,17201,-27889,
                                  16930,-28055,16930,-28055,16930,-28055,16930,-28055,
                                  16657,-28217,16657,-28217,16657,-28217,16657,-28217,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16107,-28535,16107,-28535,16107,-28535,16107,-28535,
                                  15830,-28690,15830,-28690,15830,-28690,15830,-28690,
                                  15551,-28842,15551,-28842,15551,-28842,15551,-28842,
                                  15270,-28991,15270,-28991,15270,-28991,15270,-28991,
                                  14989,-29138,14989,-29138,14989,-29138,14989,-29138,
                                  14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                  14421,-29423,14421,-29423,14421,-29423,14421,-29423,
                                  14135,-29562,14135,-29562,14135,-29562,14135,-29562,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  13559,-29830,13559,-29830,13559,-29830,13559,-29830,
                                  13269,-29960,13269,-29960,13269,-29960,13269,-29960,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12686,-30212,12686,-30212,12686,-30212,12686,-30212,
                                  12392,-30334,12392,-30334,12392,-30334,12392,-30334,
                                  12097,-30452,12097,-30452,12097,-30452,12097,-30452,
                                  11801,-30568,11801,-30568,11801,-30568,11801,-30568,
                                  11504,-30681,11504,-30681,11504,-30681,11504,-30681,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10907,-30899,10907,-30899,10907,-30899,10907,-30899,
                                  10607,-31003,10607,-31003,10607,-31003,10607,-31003,
                                  10306,-31104,10306,-31104,10306,-31104,10306,-31104,
                                  10004,-31203,10004,-31203,10004,-31203,10004,-31203,
                                  9701,-31298,9701,-31298,9701,-31298,9701,-31298,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  9092,-31481,9092,-31481,9092,-31481,9092,-31481,
                                  8787,-31567,8787,-31567,8787,-31567,8787,-31567,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8173,-31732,8173,-31732,8173,-31732,8173,-31732,
                                  7865,-31809,7865,-31809,7865,-31809,7865,-31809,
                                  7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                  7247,-31956,7247,-31956,7247,-31956,7247,-31956,
                                  6936,-32025,6936,-32025,6936,-32025,6936,-32025,
                                  6626,-32091,6626,-32091,6626,-32091,6626,-32091,
                                  6314,-32153,6314,-32153,6314,-32153,6314,-32153,
                                  6002,-32213,6002,-32213,6002,-32213,6002,-32213,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5376,-32323,5376,-32323,5376,-32323,5376,-32323,
                                  5063,-32374,5063,-32374,5063,-32374,5063,-32374,
                                  4748,-32422,4748,-32422,4748,-32422,4748,-32422,
                                  4434,-32466,4434,-32466,4434,-32466,4434,-32466,
                                  4119,-32508,4119,-32508,4119,-32508,4119,-32508,
                                  3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                  3488,-32581,3488,-32581,3488,-32581,3488,-32581,
                                  3172,-32614,3172,-32614,3172,-32614,3172,-32614,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  2539,-32669,2539,-32669,2539,-32669,2539,-32669,
                                  2222,-32692,2222,-32692,2222,-32692,2222,-32692,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1587,-32729,1587,-32729,1587,-32729,1587,-32729,
                                  1270,-32743,1270,-32743,1270,-32743,1270,-32743,
                                  953,-32754,953,-32754,953,-32754,953,-32754,
                                  635,-32761,635,-32761,635,-32761,635,-32761,
                                  317,-32766,317,-32766,317,-32766,317,-32766,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -318,-32766,-318,-32766,-318,-32766,-318,-32766,
                                  -636,-32761,-636,-32761,-636,-32761,-636,-32761,
                                  -954,-32754,-954,-32754,-954,-32754,-954,-32754,
                                  -1271,-32743,-1271,-32743,-1271,-32743,-1271,-32743,
                                  -1588,-32729,-1588,-32729,-1588,-32729,-1588,-32729,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2223,-32692,-2223,-32692,-2223,-32692,-2223,-32692,
                                  -2540,-32669,-2540,-32669,-2540,-32669,-2540,-32669,
                                  -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                  -3173,-32614,-3173,-32614,-3173,-32614,-3173,-32614,
                                  -3489,-32581,-3489,-32581,-3489,-32581,-3489,-32581,
                                  -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                  -4120,-32508,-4120,-32508,-4120,-32508,-4120,-32508,
                                  -4435,-32466,-4435,-32466,-4435,-32466,-4435,-32466,
                                  -4749,-32422,-4749,-32422,-4749,-32422,-4749,-32422,
                                  -5064,-32374,-5064,-32374,-5064,-32374,-5064,-32374,
                                  -5377,-32323,-5377,-32323,-5377,-32323,-5377,-32323,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6003,-32213,-6003,-32213,-6003,-32213,-6003,-32213,
                                  -6315,-32153,-6315,-32153,-6315,-32153,-6315,-32153,
                                  -6627,-32091,-6627,-32091,-6627,-32091,-6627,-32091,
                                  -6937,-32025,-6937,-32025,-6937,-32025,-6937,-32025,
                                  -7248,-31956,-7248,-31956,-7248,-31956,-7248,-31956,
                                  -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                  -7866,-31809,-7866,-31809,-7866,-31809,-7866,-31809,
                                  -8174,-31732,-8174,-31732,-8174,-31732,-8174,-31732,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -8788,-31567,-8788,-31567,-8788,-31567,-8788,-31567,
                                  -9093,-31481,-9093,-31481,-9093,-31481,-9093,-31481,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -9702,-31298,-9702,-31298,-9702,-31298,-9702,-31298,
                                  -10005,-31203,-10005,-31203,-10005,-31203,-10005,-31203,
                                  -10307,-31104,-10307,-31104,-10307,-31104,-10307,-31104,
                                  -10608,-31003,-10608,-31003,-10608,-31003,-10608,-31003,
                                  -10908,-30899,-10908,-30899,-10908,-30899,-10908,-30899,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11505,-30681,-11505,-30681,-11505,-30681,-11505,-30681,
                                  -11802,-30568,-11802,-30568,-11802,-30568,-11802,-30568,
                                  -12098,-30452,-12098,-30452,-12098,-30452,-12098,-30452,
                                  -12393,-30334,-12393,-30334,-12393,-30334,-12393,-30334,
                                  -12687,-30212,-12687,-30212,-12687,-30212,-12687,-30212,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13270,-29960,-13270,-29960,-13270,-29960,-13270,-29960,
                                  -13560,-29830,-13560,-29830,-13560,-29830,-13560,-29830,
                                  -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                  -14136,-29562,-14136,-29562,-14136,-29562,-14136,-29562,
                                  -14422,-29423,-14422,-29423,-14422,-29423,-14422,-29423,
                                  -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                  -14990,-29138,-14990,-29138,-14990,-29138,-14990,-29138,
                                  -15271,-28991,-15271,-28991,-15271,-28991,-15271,-28991,
                                  -15552,-28842,-15552,-28842,-15552,-28842,-15552,-28842,
                                  -15831,-28690,-15831,-28690,-15831,-28690,-15831,-28690,
                                  -16108,-28535,-16108,-28535,-16108,-28535,-16108,-28535
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
9642
static int16_t twb648[215*2*4] = {32760,-636,32760,-636,32760,-636,32760,-636,
9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860
                                  32742,-1271,32742,-1271,32742,-1271,32742,-1271,
                                  32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                  32668,-2540,32668,-2540,32668,-2540,32668,-2540,
                                  32613,-3173,32613,-3173,32613,-3173,32613,-3173,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32465,-4435,32465,-4435,32465,-4435,32465,-4435,
                                  32373,-5064,32373,-5064,32373,-5064,32373,-5064,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32152,-6315,32152,-6315,32152,-6315,32152,-6315,
                                  32024,-6937,32024,-6937,32024,-6937,32024,-6937,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31731,-8174,31731,-8174,31731,-8174,31731,-8174,
                                  31566,-8788,31566,-8788,31566,-8788,31566,-8788,
                                  31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                  31202,-10005,31202,-10005,31202,-10005,31202,-10005,
                                  31002,-10608,31002,-10608,31002,-10608,31002,-10608,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30567,-11802,30567,-11802,30567,-11802,30567,-11802,
                                  30333,-12393,30333,-12393,30333,-12393,30333,-12393,
                                  30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                  29829,-13560,29829,-13560,29829,-13560,29829,-13560,
                                  29561,-14136,29561,-14136,29561,-14136,29561,-14136,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  28990,-15271,28990,-15271,28990,-15271,28990,-15271,
                                  28689,-15831,28689,-15831,28689,-15831,28689,-15831,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28054,-16931,28054,-16931,28054,-16931,28054,-16931,
                                  27720,-17472,27720,-17472,27720,-17472,27720,-17472,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  27022,-18534,27022,-18534,27022,-18534,27022,-18534,
                                  26657,-19054,26657,-19054,26657,-19054,26657,-19054,
                                  26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                  25898,-20074,25898,-20074,25898,-20074,25898,-20074,
                                  25504,-20572,25504,-20572,25504,-20572,25504,-20572,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24687,-21546,24687,-21546,24687,-21546,24687,-21546,
                                  24265,-22020,24265,-22020,24265,-22020,24265,-22020,
                                  23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                  23393,-22945,23393,-22945,23393,-22945,23393,-22945,
                                  22944,-23394,22944,-23394,22944,-23394,22944,-23394,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  22019,-24266,22019,-24266,22019,-24266,22019,-24266,
                                  21545,-24688,21545,-24688,21545,-24688,21545,-24688,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20571,-25505,20571,-25505,20571,-25505,20571,-25505,
                                  20073,-25899,20073,-25899,20073,-25899,20073,-25899,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  19053,-26658,19053,-26658,19053,-26658,19053,-26658,
                                  18533,-27023,18533,-27023,18533,-27023,18533,-27023,
                                  18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                  17471,-27721,17471,-27721,17471,-27721,17471,-27721,
                                  16930,-28055,16930,-28055,16930,-28055,16930,-28055,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15830,-28690,15830,-28690,15830,-28690,15830,-28690,
                                  15270,-28991,15270,-28991,15270,-28991,15270,-28991,
                                  14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                  14135,-29562,14135,-29562,14135,-29562,14135,-29562,
                                  13559,-29830,13559,-29830,13559,-29830,13559,-29830,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12392,-30334,12392,-30334,12392,-30334,12392,-30334,
                                  11801,-30568,11801,-30568,11801,-30568,11801,-30568,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10607,-31003,10607,-31003,10607,-31003,10607,-31003,
                                  10004,-31203,10004,-31203,10004,-31203,10004,-31203,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  8787,-31567,8787,-31567,8787,-31567,8787,-31567,
                                  8173,-31732,8173,-31732,8173,-31732,8173,-31732,
                                  7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                  6936,-32025,6936,-32025,6936,-32025,6936,-32025,
                                  6314,-32153,6314,-32153,6314,-32153,6314,-32153,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5063,-32374,5063,-32374,5063,-32374,5063,-32374,
                                  4434,-32466,4434,-32466,4434,-32466,4434,-32466,
                                  3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                  3172,-32614,3172,-32614,3172,-32614,3172,-32614,
                                  2539,-32669,2539,-32669,2539,-32669,2539,-32669,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1270,-32743,1270,-32743,1270,-32743,1270,-32743,
                                  635,-32761,635,-32761,635,-32761,635,-32761,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -636,-32761,-636,-32761,-636,-32761,-636,-32761,
                                  -1271,-32743,-1271,-32743,-1271,-32743,-1271,-32743,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2540,-32669,-2540,-32669,-2540,-32669,-2540,-32669,
                                  -3173,-32614,-3173,-32614,-3173,-32614,-3173,-32614,
                                  -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                  -4435,-32466,-4435,-32466,-4435,-32466,-4435,-32466,
                                  -5064,-32374,-5064,-32374,-5064,-32374,-5064,-32374,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6315,-32153,-6315,-32153,-6315,-32153,-6315,-32153,
                                  -6937,-32025,-6937,-32025,-6937,-32025,-6937,-32025,
                                  -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                  -8174,-31732,-8174,-31732,-8174,-31732,-8174,-31732,
                                  -8788,-31567,-8788,-31567,-8788,-31567,-8788,-31567,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -10005,-31203,-10005,-31203,-10005,-31203,-10005,-31203,
                                  -10608,-31003,-10608,-31003,-10608,-31003,-10608,-31003,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11802,-30568,-11802,-30568,-11802,-30568,-11802,-30568,
                                  -12393,-30334,-12393,-30334,-12393,-30334,-12393,-30334,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13560,-29830,-13560,-29830,-13560,-29830,-13560,-29830,
                                  -14136,-29562,-14136,-29562,-14136,-29562,-14136,-29562,
                                  -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                  -15271,-28991,-15271,-28991,-15271,-28991,-15271,-28991,
                                  -15831,-28690,-15831,-28690,-15831,-28690,-15831,-28690,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -16931,-28055,-16931,-28055,-16931,-28055,-16931,-28055,
                                  -17472,-27721,-17472,-27721,-17472,-27721,-17472,-27721,
                                  -18006,-27377,-18006,-27377,-18006,-27377,-18006,-27377,
                                  -18534,-27023,-18534,-27023,-18534,-27023,-18534,-27023,
                                  -19054,-26658,-19054,-26658,-19054,-26658,-19054,-26658,
                                  -19568,-26284,-19568,-26284,-19568,-26284,-19568,-26284,
                                  -20074,-25899,-20074,-25899,-20074,-25899,-20074,-25899,
                                  -20572,-25505,-20572,-25505,-20572,-25505,-20572,-25505,
                                  -21063,-25101,-21063,-25101,-21063,-25101,-21063,-25101,
                                  -21546,-24688,-21546,-24688,-21546,-24688,-21546,-24688,
                                  -22020,-24266,-22020,-24266,-22020,-24266,-22020,-24266,
                                  -22487,-23834,-22487,-23834,-22487,-23834,-22487,-23834,
                                  -22945,-23394,-22945,-23394,-22945,-23394,-22945,-23394,
                                  -23394,-22945,-23394,-22945,-23394,-22945,-23394,-22945,
                                  -23834,-22487,-23834,-22487,-23834,-22487,-23834,-22487,
                                  -24266,-22020,-24266,-22020,-24266,-22020,-24266,-22020,
                                  -24688,-21546,-24688,-21546,-24688,-21546,-24688,-21546,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25505,-20572,-25505,-20572,-25505,-20572,-25505,-20572,
                                  -25899,-20074,-25899,-20074,-25899,-20074,-25899,-20074,
                                  -26284,-19568,-26284,-19568,-26284,-19568,-26284,-19568,
                                  -26658,-19054,-26658,-19054,-26658,-19054,-26658,-19054,
                                  -27023,-18534,-27023,-18534,-27023,-18534,-27023,-18534,
                                  -27377,-18006,-27377,-18006,-27377,-18006,-27377,-18006,
                                  -27721,-17472,-27721,-17472,-27721,-17472,-27721,-17472,
                                  -28055,-16931,-28055,-16931,-28055,-16931,-28055,-16931,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28690,-15831,-28690,-15831,-28690,-15831,-28690,-15831,
                                  -28991,-15271,-28991,-15271,-28991,-15271,-28991,-15271,
                                  -29282,-14706,-29282,-14706,-29282,-14706,-29282,-14706,
                                  -29562,-14136,-29562,-14136,-29562,-14136,-29562,-14136,
                                  -29830,-13560,-29830,-13560,-29830,-13560,-29830,-13560,
                                  -30088,-12979,-30088,-12979,-30088,-12979,-30088,-12979,
                                  -30334,-12393,-30334,-12393,-30334,-12393,-30334,-12393,
                                  -30568,-11802,-30568,-11802,-30568,-11802,-30568,-11802,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -31003,-10608,-31003,-10608,-31003,-10608,-31003,-10608,
                                  -31203,-10005,-31203,-10005,-31203,-10005,-31203,-10005,
                                  -31391,-9398,-31391,-9398,-31391,-9398,-31391,-9398,
                                  -31567,-8788,-31567,-8788,-31567,-8788,-31567,-8788,
                                  -31732,-8174,-31732,-8174,-31732,-8174,-31732,-8174,
                                  -31884,-7557,-31884,-7557,-31884,-7557,-31884,-7557,
                                  -32025,-6937,-32025,-6937,-32025,-6937,-32025,-6937,
                                  -32153,-6315,-32153,-6315,-32153,-6315,-32153,-6315,
                                  -32270,-5690,-32270,-5690,-32270,-5690,-32270,-5690,
                                  -32374,-5064,-32374,-5064,-32374,-5064,-32374,-5064,
                                  -32466,-4435,-32466,-4435,-32466,-4435,-32466,-4435,
                                  -32546,-3805,-32546,-3805,-32546,-3805,-32546,-3805,
                                  -32614,-3173,-32614,-3173,-32614,-3173,-32614,-3173,
                                  -32669,-2540,-32669,-2540,-32669,-2540,-32669,-2540,
                                  -32712,-1906,-32712,-1906,-32712,-1906,-32712,-1906,
                                  -32743,-1271,-32743,-1271,-32743,-1271,-32743,-1271,
                                  -32761,-636,-32761,-636,-32761,-636,-32761,-636,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32761,635,-32761,635,-32761,635,-32761,635,
                                  -32743,1270,-32743,1270,-32743,1270,-32743,1270,
                                  -32712,1905,-32712,1905,-32712,1905,-32712,1905,
                                  -32669,2539,-32669,2539,-32669,2539,-32669,2539,
                                  -32614,3172,-32614,3172,-32614,3172,-32614,3172,
                                  -32546,3804,-32546,3804,-32546,3804,-32546,3804,
                                  -32466,4434,-32466,4434,-32466,4434,-32466,4434,
                                  -32374,5063,-32374,5063,-32374,5063,-32374,5063,
                                  -32270,5689,-32270,5689,-32270,5689,-32270,5689,
                                  -32153,6314,-32153,6314,-32153,6314,-32153,6314,
                                  -32025,6936,-32025,6936,-32025,6936,-32025,6936,
                                  -31884,7556,-31884,7556,-31884,7556,-31884,7556,
                                  -31732,8173,-31732,8173,-31732,8173,-31732,8173,
                                  -31567,8787,-31567,8787,-31567,8787,-31567,8787,
                                  -31391,9397,-31391,9397,-31391,9397,-31391,9397,
                                  -31203,10004,-31203,10004,-31203,10004,-31203,10004,
                                  -31003,10607,-31003,10607,-31003,10607,-31003,10607,
                                  -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                  -30568,11801,-30568,11801,-30568,11801,-30568,11801,
                                  -30334,12392,-30334,12392,-30334,12392,-30334,12392,
                                  -30088,12978,-30088,12978,-30088,12978,-30088,12978,
                                  -29830,13559,-29830,13559,-29830,13559,-29830,13559,
                                  -29562,14135,-29562,14135,-29562,14135,-29562,14135,
                                  -29282,14705,-29282,14705,-29282,14705,-29282,14705,
                                  -28991,15270,-28991,15270,-28991,15270,-28991,15270,
                                  -28690,15830,-28690,15830,-28690,15830,-28690,15830,
                                  -28378,16383,-28378,16383,-28378,16383,-28378,16383,
                                  -28055,16930,-28055,16930,-28055,16930,-28055,16930,
                                  -27721,17471,-27721,17471,-27721,17471,-27721,17471,
                                  -27377,18005,-27377,18005,-27377,18005,-27377,18005,
                                  -27023,18533,-27023,18533,-27023,18533,-27023,18533,
                                  -26658,19053,-26658,19053,-26658,19053,-26658,19053,
                                  -26284,19567,-26284,19567,-26284,19567,-26284,19567,
                                  -25899,20073,-25899,20073,-25899,20073,-25899,20073,
                                  -25505,20571,-25505,20571,-25505,20571,-25505,20571,
                                  -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                  -24688,21545,-24688,21545,-24688,21545,-24688,21545,
                                  -24266,22019,-24266,22019,-24266,22019,-24266,22019,
                                  -23834,22486,-23834,22486,-23834,22486,-23834,22486,
                                  -23394,22944,-23394,22944,-23394,22944,-23394,22944,
                                  -22945,23393,-22945,23393,-22945,23393,-22945,23393,
                                  -22487,23833,-22487,23833,-22487,23833,-22487,23833,
                                  -22020,24265,-22020,24265,-22020,24265,-22020,24265,
                                  -21546,24687,-21546,24687,-21546,24687,-21546,24687,
                                  -21063,25100,-21063,25100,-21063,25100,-21063,25100,
                                  -20572,25504,-20572,25504,-20572,25504,-20572,25504,
                                  -20074,25898,-20074,25898,-20074,25898,-20074,25898,
                                  -19568,26283,-19568,26283,-19568,26283,-19568,26283,
                                  -19054,26657,-19054,26657,-19054,26657,-19054,26657,
                                  -18534,27022,-18534,27022,-18534,27022,-18534,27022,
                                  -18006,27376,-18006,27376,-18006,27376,-18006,27376,
                                  -17472,27720,-17472,27720,-17472,27720,-17472,27720,
                                  -16931,28054,-16931,28054,-16931,28054,-16931,28054
                                 };

void dft648(int16_t *x,int16_t *y,unsigned char scale_flag)  // 216 x 3
{
Raymond Knopp's avatar
 
Raymond Knopp committed
9861
  int i,j;
9862 9863 9864 9865 9866 9867
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa648[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb648[0];
  simd_q15_t x2128[648];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[648];//=&ytmp128array3[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
9868 9869 9870



9871
  for (i=0,j=0; i<216; i++,j+=3) {
Raymond Knopp's avatar
 
Raymond Knopp committed
9872 9873 9874 9875 9876
    x2128[i]    = x128[j];
    x2128[i+216] = x128[j+1];
    x2128[i+432] = x128[j+2];
  }

9877 9878 9879
  dft216((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft216((int16_t *)(x2128+216),(int16_t *)(ytmp128+216),1);
  dft216((int16_t *)(x2128+432),(int16_t *)(ytmp128+432),1);
Raymond Knopp's avatar
 
Raymond Knopp committed
9880 9881

  bfly3_tw1(ytmp128,ytmp128+216,ytmp128+432,y128,y128+216,y128+432);
9882 9883

  for (i=1,j=0; i<216; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
9884
    bfly3(ytmp128+i,
9885 9886 9887 9888 9889 9890 9891
          ytmp128+216+i,
          ytmp128+432+i,
          y128+i,
          y128+216+i,
          y128+432+i,
          twa128+j,
          twb128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
9892 9893 9894
  }

  if (scale_flag==1) {
9895
    norm128 = set1_int16(dft_norm_table[14]);
9896 9897

    for (i=0; i<648; i++) {
9898
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943
    }
  }

  _mm_empty();
  _m_empty();

};


/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:179)/720));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:179)/720));
twc = floor(32767*exp(-sqrt(-1)*2*pi*3*(1:179)/720));
twa2 = zeros(1,2*179);
twb2 = zeros(1,2*179);
twc2 = zeros(1,2*179);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
twc2(1:2:end) = real(twc);
twc2(2:2:end) = imag(twc);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa720[179*2*4] = {");
for i=1:2:(2*178)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"\nstatic int16_t twb720[179*2*4] = {");
for i=1:2:(2*178)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fprintf(fd,"\nstatic int16_t twc720[179*2*4] = {");
for i=1:2:(2*178)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
fclose(fd);
 */

static int16_t twa720[179*2*4] = {32765,-286,32765,-286,32765,-286,32765,-286,
9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122
                                  32762,-572,32762,-572,32762,-572,32762,-572,
                                  32755,-858,32755,-858,32755,-858,32755,-858,
                                  32747,-1144,32747,-1144,32747,-1144,32747,-1144,
                                  32735,-1430,32735,-1430,32735,-1430,32735,-1430,
                                  32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                  32705,-2001,32705,-2001,32705,-2001,32705,-2001,
                                  32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                  32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32616,-3141,32616,-3141,32616,-3141,32616,-3141,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32556,-3710,32556,-3710,32556,-3710,32556,-3710,
                                  32522,-3994,32522,-3994,32522,-3994,32522,-3994,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                  32407,-4844,32407,-4844,32407,-4844,32407,-4844,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32317,-5409,32317,-5409,32317,-5409,32317,-5409,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32218,-5972,32218,-5972,32218,-5972,32218,-5972,
                                  32164,-6253,32164,-6253,32164,-6253,32164,-6253,
                                  32109,-6533,32109,-6533,32109,-6533,32109,-6533,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31990,-7093,31990,-7093,31990,-7093,31990,-7093,
                                  31927,-7371,31927,-7371,31927,-7371,31927,-7371,
                                  31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                                  31793,-7928,31793,-7928,31793,-7928,31793,-7928,
                                  31723,-8205,31723,-8205,31723,-8205,31723,-8205,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31575,-8757,31575,-8757,31575,-8757,31575,-8757,
                                  31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                  31417,-9307,31417,-9307,31417,-9307,31417,-9307,
                                  31335,-9581,31335,-9581,31335,-9581,31335,-9581,
                                  31250,-9854,31250,-9854,31250,-9854,31250,-9854,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  31073,-10398,31073,-10398,31073,-10398,31073,-10398,
                                  30981,-10668,30981,-10668,30981,-10668,30981,-10668,
                                  30887,-10938,30887,-10938,30887,-10938,30887,-10938,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30691,-11476,30691,-11476,30691,-11476,30691,-11476,
                                  30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                  30486,-12010,30486,-12010,30486,-12010,30486,-12010,
                                  30381,-12275,30381,-12275,30381,-12275,30381,-12275,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  30162,-12804,30162,-12804,30162,-12804,30162,-12804,
                                  30049,-13066,30049,-13066,30049,-13066,30049,-13066,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29816,-13589,29816,-13589,29816,-13589,29816,-13589,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29575,-14107,29575,-14107,29575,-14107,29575,-14107,
                                  29450,-14365,29450,-14365,29450,-14365,29450,-14365,
                                  29324,-14621,29324,-14621,29324,-14621,29324,-14621,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  29064,-15131,29064,-15131,29064,-15131,29064,-15131,
                                  28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                  28796,-15636,28796,-15636,28796,-15636,28796,-15636,
                                  28658,-15886,28658,-15886,28658,-15886,28658,-15886,
                                  28518,-16136,28518,-16136,28518,-16136,28518,-16136,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28233,-16631,28233,-16631,28233,-16631,28233,-16631,
                                  28086,-16877,28086,-16877,28086,-16877,28086,-16877,
                                  27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                                  27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                  27635,-17606,27635,-17606,27635,-17606,27635,-17606,
                                  27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                  27323,-18086,27323,-18086,27323,-18086,27323,-18086,
                                  27165,-18324,27165,-18324,27165,-18324,27165,-18324,
                                  27004,-18560,27004,-18560,27004,-18560,27004,-18560,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26676,-19028,26676,-19028,26676,-19028,26676,-19028,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26339,-19491,26339,-19491,26339,-19491,26339,-19491,
                                  26168,-19720,26168,-19720,26168,-19720,26168,-19720,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25820,-20174,25820,-20174,25820,-20174,25820,-20174,
                                  25643,-20398,25643,-20398,25643,-20398,25643,-20398,
                                  25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                  25283,-20843,25283,-20843,25283,-20843,25283,-20843,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                                  24729,-21498,24729,-21498,24729,-21498,24729,-21498,
                                  24541,-21713,24541,-21713,24541,-21713,24541,-21713,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  24158,-22138,24158,-22138,24158,-22138,24158,-22138,
                                  23964,-22348,23964,-22348,23964,-22348,23964,-22348,
                                  23768,-22556,23768,-22556,23768,-22556,23768,-22556,
                                  23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                  23371,-22967,23371,-22967,23371,-22967,23371,-22967,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22966,-23372,22966,-23372,22966,-23372,22966,-23372,
                                  22761,-23571,22761,-23571,22761,-23571,22761,-23571,
                                  22555,-23769,22555,-23769,22555,-23769,22555,-23769,
                                  22347,-23965,22347,-23965,22347,-23965,22347,-23965,
                                  22137,-24159,22137,-24159,22137,-24159,22137,-24159,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21712,-24542,21712,-24542,21712,-24542,21712,-24542,
                                  21497,-24730,21497,-24730,21497,-24730,21497,-24730,
                                  21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20842,-25284,20842,-25284,20842,-25284,20842,-25284,
                                  20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                  20397,-25644,20397,-25644,20397,-25644,20397,-25644,
                                  20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19719,-26169,19719,-26169,19719,-26169,19719,-26169,
                                  19490,-26340,19490,-26340,19490,-26340,19490,-26340,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  19027,-26677,19027,-26677,19027,-26677,19027,-26677,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18559,-27005,18559,-27005,18559,-27005,18559,-27005,
                                  18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                  18085,-27324,18085,-27324,18085,-27324,18085,-27324,
                                  17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                  17605,-27636,17605,-27636,17605,-27636,17605,-27636,
                                  17363,-27788,17363,-27788,17363,-27788,17363,-27788,
                                  17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                                  16876,-28087,16876,-28087,16876,-28087,16876,-28087,
                                  16630,-28234,16630,-28234,16630,-28234,16630,-28234,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16135,-28519,16135,-28519,16135,-28519,16135,-28519,
                                  15885,-28659,15885,-28659,15885,-28659,15885,-28659,
                                  15635,-28797,15635,-28797,15635,-28797,15635,-28797,
                                  15383,-28932,15383,-28932,15383,-28932,15383,-28932,
                                  15130,-29065,15130,-29065,15130,-29065,15130,-29065,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14620,-29325,14620,-29325,14620,-29325,14620,-29325,
                                  14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                  14106,-29576,14106,-29576,14106,-29576,14106,-29576,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  13588,-29817,13588,-29817,13588,-29817,13588,-29817,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  13065,-30050,13065,-30050,13065,-30050,13065,-30050,
                                  12803,-30163,12803,-30163,12803,-30163,12803,-30163,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                  12009,-30487,12009,-30487,12009,-30487,12009,-30487,
                                  11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                  11475,-30692,11475,-30692,11475,-30692,11475,-30692,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10937,-30888,10937,-30888,10937,-30888,10937,-30888,
                                  10667,-30982,10667,-30982,10667,-30982,10667,-30982,
                                  10397,-31074,10397,-31074,10397,-31074,10397,-31074,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9853,-31251,9853,-31251,9853,-31251,9853,-31251,
                                  9580,-31336,9580,-31336,9580,-31336,9580,-31336,
                                  9306,-31418,9306,-31418,9306,-31418,9306,-31418,
                                  9031,-31498,9031,-31498,9031,-31498,9031,-31498,
                                  8756,-31576,8756,-31576,8756,-31576,8756,-31576,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8204,-31724,8204,-31724,8204,-31724,8204,-31724,
                                  7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                  7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                                  7370,-31928,7370,-31928,7370,-31928,7370,-31928,
                                  7092,-31991,7092,-31991,7092,-31991,7092,-31991,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  6532,-32110,6532,-32110,6532,-32110,6532,-32110,
                                  6252,-32165,6252,-32165,6252,-32165,6252,-32165,
                                  5971,-32219,5971,-32219,5971,-32219,5971,-32219,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5408,-32318,5408,-32318,5408,-32318,5408,-32318,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4843,-32408,4843,-32408,4843,-32408,4843,-32408,
                                  4560,-32449,4560,-32449,4560,-32449,4560,-32449,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  3993,-32523,3993,-32523,3993,-32523,3993,-32523,
                                  3709,-32557,3709,-32557,3709,-32557,3709,-32557,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  3140,-32617,3140,-32617,3140,-32617,3140,-32617,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                                  2285,-32688,2285,-32688,2285,-32688,2285,-32688,
                                  2000,-32706,2000,-32706,2000,-32706,2000,-32706,
                                  1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                  1429,-32736,1429,-32736,1429,-32736,1429,-32736,
                                  1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                  857,-32756,857,-32756,857,-32756,857,-32756,
                                  571,-32763,571,-32763,571,-32763,571,-32763,
                                  285,-32766,285,-32766,285,-32766,285,-32766
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
10123 10124

static int16_t twb720[179*2*4] = {32762,-572,32762,-572,32762,-572,32762,-572,
10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303
                                  32747,-1144,32747,-1144,32747,-1144,32747,-1144,
                                  32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                  32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32522,-3994,32522,-3994,32522,-3994,32522,-3994,
                                  32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32164,-6253,32164,-6253,32164,-6253,32164,-6253,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31927,-7371,31927,-7371,31927,-7371,31927,-7371,
                                  31793,-7928,31793,-7928,31793,-7928,31793,-7928,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                  31335,-9581,31335,-9581,31335,-9581,31335,-9581,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  30981,-10668,30981,-10668,30981,-10668,30981,-10668,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                  30381,-12275,30381,-12275,30381,-12275,30381,-12275,
                                  30162,-12804,30162,-12804,30162,-12804,30162,-12804,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29450,-14365,29450,-14365,29450,-14365,29450,-14365,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                  28658,-15886,28658,-15886,28658,-15886,28658,-15886,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28086,-16877,28086,-16877,28086,-16877,28086,-16877,
                                  27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                  27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                  27165,-18324,27165,-18324,27165,-18324,27165,-18324,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26168,-19720,26168,-19720,26168,-19720,26168,-19720,
                                  25820,-20174,25820,-20174,25820,-20174,25820,-20174,
                                  25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24729,-21498,24729,-21498,24729,-21498,24729,-21498,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  23964,-22348,23964,-22348,23964,-22348,23964,-22348,
                                  23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22761,-23571,22761,-23571,22761,-23571,22761,-23571,
                                  22347,-23965,22347,-23965,22347,-23965,22347,-23965,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21497,-24730,21497,-24730,21497,-24730,21497,-24730,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                  20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                  19719,-26169,19719,-26169,19719,-26169,19719,-26169,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                  17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                  17363,-27788,17363,-27788,17363,-27788,17363,-27788,
                                  16876,-28087,16876,-28087,16876,-28087,16876,-28087,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15885,-28659,15885,-28659,15885,-28659,15885,-28659,
                                  15383,-28932,15383,-28932,15383,-28932,15383,-28932,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  12803,-30163,12803,-30163,12803,-30163,12803,-30163,
                                  12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                  11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10667,-30982,10667,-30982,10667,-30982,10667,-30982,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9580,-31336,9580,-31336,9580,-31336,9580,-31336,
                                  9031,-31498,9031,-31498,9031,-31498,9031,-31498,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                  7370,-31928,7370,-31928,7370,-31928,7370,-31928,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  6252,-32165,6252,-32165,6252,-32165,6252,-32165,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4560,-32449,4560,-32449,4560,-32449,4560,-32449,
                                  3993,-32523,3993,-32523,3993,-32523,3993,-32523,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  2285,-32688,2285,-32688,2285,-32688,2285,-32688,
                                  1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                  1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                  571,-32763,571,-32763,571,-32763,571,-32763,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -572,-32763,-572,-32763,-572,-32763,-572,-32763,
                                  -1144,-32748,-1144,-32748,-1144,-32748,-1144,-32748,
                                  -1715,-32723,-1715,-32723,-1715,-32723,-1715,-32723,
                                  -2286,-32688,-2286,-32688,-2286,-32688,-2286,-32688,
                                  -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -3994,-32523,-3994,-32523,-3994,-32523,-3994,-32523,
                                  -4561,-32449,-4561,-32449,-4561,-32449,-4561,-32449,
                                  -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6253,-32165,-6253,-32165,-6253,-32165,-6253,-32165,
                                  -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                  -7371,-31928,-7371,-31928,-7371,-31928,-7371,-31928,
                                  -7928,-31794,-7928,-31794,-7928,-31794,-7928,-31794,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -9032,-31498,-9032,-31498,-9032,-31498,-9032,-31498,
                                  -9581,-31336,-9581,-31336,-9581,-31336,-9581,-31336,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10668,-30982,-10668,-30982,-10668,-30982,-10668,-30982,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11743,-30591,-11743,-30591,-11743,-30591,-11743,-30591,
                                  -12275,-30382,-12275,-30382,-12275,-30382,-12275,-30382,
                                  -12804,-30163,-12804,-30163,-12804,-30163,-12804,-30163,
                                  -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                  -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                  -14365,-29451,-14365,-29451,-14365,-29451,-14365,-29451,
                                  -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                                  -15384,-28932,-15384,-28932,-15384,-28932,-15384,-28932,
                                  -15886,-28659,-15886,-28659,-15886,-28659,-15886,-28659,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -16877,-28087,-16877,-28087,-16877,-28087,-16877,-28087,
                                  -17364,-27788,-17364,-27788,-17364,-27788,-17364,-27788,
                                  -17847,-27481,-17847,-27481,-17847,-27481,-17847,-27481,
                                  -18324,-27166,-18324,-27166,-18324,-27166,-18324,-27166,
                                  -18795,-26842,-18795,-26842,-18795,-26842,-18795,-26842,
                                  -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                                  -19720,-26169,-19720,-26169,-19720,-26169,-19720,-26169,
                                  -20174,-25821,-20174,-25821,-20174,-25821,-20174,-25821,
                                  -20621,-25465,-20621,-25465,-20621,-25465,-20621,-25465,
                                  -21063,-25101,-21063,-25101,-21063,-25101,-21063,-25101,
                                  -21498,-24730,-21498,-24730,-21498,-24730,-21498,-24730,
                                  -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                                  -22348,-23965,-22348,-23965,-22348,-23965,-22348,-23965,
                                  -22762,-23571,-22762,-23571,-22762,-23571,-22762,-23571,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -23571,-22762,-23571,-22762,-23571,-22762,-23571,-22762,
                                  -23965,-22348,-23965,-22348,-23965,-22348,-23965,-22348,
                                  -24351,-21926,-24351,-21926,-24351,-21926,-24351,-21926,
                                  -24730,-21498,-24730,-21498,-24730,-21498,-24730,-21498,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25465,-20621,-25465,-20621,-25465,-20621,-25465,-20621,
                                  -25821,-20174,-25821,-20174,-25821,-20174,-25821,-20174,
                                  -26169,-19720,-26169,-19720,-26169,-19720,-26169,-19720,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -26842,-18795,-26842,-18795,-26842,-18795,-26842,-18795,
                                  -27166,-18324,-27166,-18324,-27166,-18324,-27166,-18324,
                                  -27481,-17847,-27481,-17847,-27481,-17847,-27481,-17847,
                                  -27788,-17364,-27788,-17364,-27788,-17364,-27788,-17364,
                                  -28087,-16877,-28087,-16877,-28087,-16877,-28087,-16877,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28659,-15886,-28659,-15886,-28659,-15886,-28659,-15886,
                                  -28932,-15384,-28932,-15384,-28932,-15384,-28932,-15384,
                                  -29196,-14876,-29196,-14876,-29196,-14876,-29196,-14876,
                                  -29451,-14365,-29451,-14365,-29451,-14365,-29451,-14365,
                                  -29697,-13848,-29697,-13848,-29697,-13848,-29697,-13848,
                                  -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                                  -30163,-12804,-30163,-12804,-30163,-12804,-30163,-12804,
                                  -30382,-12275,-30382,-12275,-30382,-12275,-30382,-12275,
                                  -30591,-11743,-30591,-11743,-30591,-11743,-30591,-11743,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -30982,-10668,-30982,-10668,-30982,-10668,-30982,-10668,
                                  -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                                  -31336,-9581,-31336,-9581,-31336,-9581,-31336,-9581,
                                  -31498,-9032,-31498,-9032,-31498,-9032,-31498,-9032,
                                  -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                  -31794,-7928,-31794,-7928,-31794,-7928,-31794,-7928,
                                  -31928,-7371,-31928,-7371,-31928,-7371,-31928,-7371,
                                  -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                                  -32165,-6253,-32165,-6253,-32165,-6253,-32165,-6253,
                                  -32270,-5690,-32270,-5690,-32270,-5690,-32270,-5690,
                                  -32364,-5126,-32364,-5126,-32364,-5126,-32364,-5126,
                                  -32449,-4561,-32449,-4561,-32449,-4561,-32449,-4561,
                                  -32523,-3994,-32523,-3994,-32523,-3994,-32523,-3994,
                                  -32588,-3426,-32588,-3426,-32588,-3426,-32588,-3426,
                                  -32643,-2856,-32643,-2856,-32643,-2856,-32643,-2856,
                                  -32688,-2286,-32688,-2286,-32688,-2286,-32688,-2286,
                                  -32723,-1715,-32723,-1715,-32723,-1715,-32723,-1715,
                                  -32748,-1144,-32748,-1144,-32748,-1144,-32748,-1144,
                                  -32763,-572,-32763,-572,-32763,-572,-32763,-572
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
10304 10305

static int16_t twc720[179*2*4] = {32755,-858,32755,-858,32755,-858,32755,-858,
10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487
                                  32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                  32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32218,-5972,32218,-5972,32218,-5972,32218,-5972,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31417,-9307,31417,-9307,31417,-9307,31417,-9307,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  30887,-10938,30887,-10938,30887,-10938,30887,-10938,
                                  30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29575,-14107,29575,-14107,29575,-14107,29575,-14107,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  28796,-15636,28796,-15636,28796,-15636,28796,-15636,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                                  27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                  27004,-18560,27004,-18560,27004,-18560,27004,-18560,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                  24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  23768,-22556,23768,-22556,23768,-22556,23768,-22556,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22555,-23769,22555,-23769,22555,-23769,22555,-23769,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                                  20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18559,-27005,18559,-27005,18559,-27005,18559,-27005,
                                  17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                  17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15635,-28797,15635,-28797,15635,-28797,15635,-28797,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14106,-29576,14106,-29576,14106,-29576,14106,-29576,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                  10937,-30888,10937,-30888,10937,-30888,10937,-30888,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9306,-31418,9306,-31418,9306,-31418,9306,-31418,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  5971,-32219,5971,-32219,5971,-32219,5971,-32219,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                                  1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                  857,-32756,857,-32756,857,-32756,857,-32756,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -858,-32756,-858,-32756,-858,-32756,-858,-32756,
                                  -1715,-32723,-1715,-32723,-1715,-32723,-1715,-32723,
                                  -2571,-32666,-2571,-32666,-2571,-32666,-2571,-32666,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                  -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                                  -5972,-32219,-5972,-32219,-5972,-32219,-5972,-32219,
                                  -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                  -7650,-31862,-7650,-31862,-7650,-31862,-7650,-31862,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -9307,-31418,-9307,-31418,-9307,-31418,-9307,-31418,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10938,-30888,-10938,-30888,-10938,-30888,-10938,-30888,
                                  -11743,-30591,-11743,-30591,-11743,-30591,-11743,-30591,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                  -14107,-29576,-14107,-29576,-14107,-29576,-14107,-29576,
                                  -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                                  -15636,-28797,-15636,-28797,-15636,-28797,-15636,-28797,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -17121,-27939,-17121,-27939,-17121,-27939,-17121,-27939,
                                  -17847,-27481,-17847,-27481,-17847,-27481,-17847,-27481,
                                  -18560,-27005,-18560,-27005,-18560,-27005,-18560,-27005,
                                  -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                                  -19948,-25996,-19948,-25996,-19948,-25996,-19948,-25996,
                                  -20621,-25465,-20621,-25465,-20621,-25465,-20621,-25465,
                                  -21281,-24917,-21281,-24917,-21281,-24917,-21281,-24917,
                                  -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                                  -22556,-23769,-22556,-23769,-22556,-23769,-22556,-23769,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -23769,-22556,-23769,-22556,-23769,-22556,-23769,-22556,
                                  -24351,-21926,-24351,-21926,-24351,-21926,-24351,-21926,
                                  -24917,-21281,-24917,-21281,-24917,-21281,-24917,-21281,
                                  -25465,-20621,-25465,-20621,-25465,-20621,-25465,-20621,
                                  -25996,-19948,-25996,-19948,-25996,-19948,-25996,-19948,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -27005,-18560,-27005,-18560,-27005,-18560,-27005,-18560,
                                  -27481,-17847,-27481,-17847,-27481,-17847,-27481,-17847,
                                  -27939,-17121,-27939,-17121,-27939,-17121,-27939,-17121,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28797,-15636,-28797,-15636,-28797,-15636,-28797,-15636,
                                  -29196,-14876,-29196,-14876,-29196,-14876,-29196,-14876,
                                  -29576,-14107,-29576,-14107,-29576,-14107,-29576,-14107,
                                  -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                                  -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                  -30591,-11743,-30591,-11743,-30591,-11743,-30591,-11743,
                                  -30888,-10938,-30888,-10938,-30888,-10938,-30888,-10938,
                                  -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                                  -31418,-9307,-31418,-9307,-31418,-9307,-31418,-9307,
                                  -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                  -31862,-7650,-31862,-7650,-31862,-7650,-31862,-7650,
                                  -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                                  -32219,-5972,-32219,-5972,-32219,-5972,-32219,-5972,
                                  -32364,-5126,-32364,-5126,-32364,-5126,-32364,-5126,
                                  -32487,-4277,-32487,-4277,-32487,-4277,-32487,-4277,
                                  -32588,-3426,-32588,-3426,-32588,-3426,-32588,-3426,
                                  -32666,-2571,-32666,-2571,-32666,-2571,-32666,-2571,
                                  -32723,-1715,-32723,-1715,-32723,-1715,-32723,-1715,
                                  -32756,-858,-32756,-858,-32756,-858,-32756,-858,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32756,857,-32756,857,-32756,857,-32756,857,
                                  -32723,1714,-32723,1714,-32723,1714,-32723,1714,
                                  -32666,2570,-32666,2570,-32666,2570,-32666,2570,
                                  -32588,3425,-32588,3425,-32588,3425,-32588,3425,
                                  -32487,4276,-32487,4276,-32487,4276,-32487,4276,
                                  -32364,5125,-32364,5125,-32364,5125,-32364,5125,
                                  -32219,5971,-32219,5971,-32219,5971,-32219,5971,
                                  -32051,6812,-32051,6812,-32051,6812,-32051,6812,
                                  -31862,7649,-31862,7649,-31862,7649,-31862,7649,
                                  -31651,8480,-31651,8480,-31651,8480,-31651,8480,
                                  -31418,9306,-31418,9306,-31418,9306,-31418,9306,
                                  -31164,10125,-31164,10125,-31164,10125,-31164,10125,
                                  -30888,10937,-30888,10937,-30888,10937,-30888,10937,
                                  -30591,11742,-30591,11742,-30591,11742,-30591,11742,
                                  -30273,12539,-30273,12539,-30273,12539,-30273,12539,
                                  -29935,13327,-29935,13327,-29935,13327,-29935,13327,
                                  -29576,14106,-29576,14106,-29576,14106,-29576,14106,
                                  -29196,14875,-29196,14875,-29196,14875,-29196,14875,
                                  -28797,15635,-28797,15635,-28797,15635,-28797,15635,
                                  -28378,16383,-28378,16383,-28378,16383,-28378,16383,
                                  -27939,17120,-27939,17120,-27939,17120,-27939,17120,
                                  -27481,17846,-27481,17846,-27481,17846,-27481,17846,
                                  -27005,18559,-27005,18559,-27005,18559,-27005,18559,
                                  -26510,19259,-26510,19259,-26510,19259,-26510,19259,
                                  -25996,19947,-25996,19947,-25996,19947,-25996,19947,
                                  -25465,20620,-25465,20620,-25465,20620,-25465,20620,
                                  -24917,21280,-24917,21280,-24917,21280,-24917,21280,
                                  -24351,21925,-24351,21925,-24351,21925,-24351,21925,
                                  -23769,22555,-23769,22555,-23769,22555,-23769,22555,
                                  -23170,23169,-23170,23169,-23170,23169,-23170,23169,
                                  -22556,23768,-22556,23768,-22556,23768,-22556,23768,
                                  -21926,24350,-21926,24350,-21926,24350,-21926,24350,
                                  -21281,24916,-21281,24916,-21281,24916,-21281,24916,
                                  -20621,25464,-20621,25464,-20621,25464,-20621,25464,
                                  -19948,25995,-19948,25995,-19948,25995,-19948,25995,
                                  -19260,26509,-19260,26509,-19260,26509,-19260,26509,
                                  -18560,27004,-18560,27004,-18560,27004,-18560,27004,
                                  -17847,27480,-17847,27480,-17847,27480,-17847,27480,
                                  -17121,27938,-17121,27938,-17121,27938,-17121,27938,
                                  -16384,28377,-16384,28377,-16384,28377,-16384,28377,
                                  -15636,28796,-15636,28796,-15636,28796,-15636,28796,
                                  -14876,29195,-14876,29195,-14876,29195,-14876,29195,
                                  -14107,29575,-14107,29575,-14107,29575,-14107,29575,
                                  -13328,29934,-13328,29934,-13328,29934,-13328,29934,
                                  -12540,30272,-12540,30272,-12540,30272,-12540,30272,
                                  -11743,30590,-11743,30590,-11743,30590,-11743,30590,
                                  -10938,30887,-10938,30887,-10938,30887,-10938,30887,
                                  -10126,31163,-10126,31163,-10126,31163,-10126,31163,
                                  -9307,31417,-9307,31417,-9307,31417,-9307,31417,
                                  -8481,31650,-8481,31650,-8481,31650,-8481,31650,
                                  -7650,31861,-7650,31861,-7650,31861,-7650,31861,
                                  -6813,32050,-6813,32050,-6813,32050,-6813,32050,
                                  -5972,32218,-5972,32218,-5972,32218,-5972,32218,
                                  -5126,32363,-5126,32363,-5126,32363,-5126,32363,
                                  -4277,32486,-4277,32486,-4277,32486,-4277,32486,
                                  -3426,32587,-3426,32587,-3426,32587,-3426,32587,
                                  -2571,32665,-2571,32665,-2571,32665,-2571,32665,
                                  -1715,32722,-1715,32722,-1715,32722,-1715,32722,
                                  -858,32755,-858,32755,-858,32755,-858,32755
                                 };

void dft720(int16_t *x,int16_t *y,unsigned char scale_flag)  // 180 x 4
{
Raymond Knopp's avatar
 
Raymond Knopp committed
10488
  int i,j;
10489 10490 10491 10492 10493 10494 10495
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa720[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb720[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc720[0];
  simd_q15_t x2128[720];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[720];//=&ytmp128array2[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
10496 10497 10498



10499
  for (i=0,j=0; i<180; i++,j+=4) {
Raymond Knopp's avatar
 
Raymond Knopp committed
10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511
    x2128[i]    = x128[j];
    x2128[i+180] = x128[j+1];
    x2128[i+360] = x128[j+2];
    x2128[i+540] = x128[j+3];
  }

  dft180((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft180((int16_t *)(x2128+180),(int16_t *)(ytmp128+180),1);
  dft180((int16_t *)(x2128+360),(int16_t *)(ytmp128+360),1);
  dft180((int16_t *)(x2128+540),(int16_t *)(ytmp128+540),1);

  bfly4_tw1(ytmp128,ytmp128+180,ytmp128+360,ytmp128+540,y128,y128+180,y128+360,y128+540);
10512 10513

  for (i=1,j=0; i<180; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
10514
    bfly4(ytmp128+i,
10515 10516 10517 10518 10519 10520 10521 10522 10523 10524
          ytmp128+180+i,
          ytmp128+360+i,
          ytmp128+540+i,
          y128+i,
          y128+180+i,
          y128+360+i,
          y128+540+i,
          twa128+j,
          twb128+j,
          twc128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
10525 10526 10527
  }

  if (scale_flag==1) {
10528
    norm128 = set1_int16(16384);//dft_norm_table[13]);
10529 10530

    for (i=0; i<720; i++) {
10531
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564
    }
  }

  _mm_empty();
  _m_empty();

};

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:287)/864));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:287)/864));
twa2 = zeros(1,2*287);
twb2 = zeros(1,2*287);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa864[287*2*4] = {");
for i=1:2:(2*286)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb864[287*2*4] = {");
for i=1:2:(2*286)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fclose(fd);
*/
static int16_t twa864[287*2*4] = {32766,-239,32766,-239,32766,-239,32766,-239,
10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851
                                  32763,-477,32763,-477,32763,-477,32763,-477,
                                  32759,-715,32759,-715,32759,-715,32759,-715,
                                  32753,-954,32753,-954,32753,-954,32753,-954,
                                  32745,-1192,32745,-1192,32745,-1192,32745,-1192,
                                  32735,-1430,32735,-1430,32735,-1430,32735,-1430,
                                  32724,-1668,32724,-1668,32724,-1668,32724,-1668,
                                  32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                  32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                  32680,-2381,32680,-2381,32680,-2381,32680,-2381,
                                  32662,-2619,32662,-2619,32662,-2619,32662,-2619,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32620,-3094,32620,-3094,32620,-3094,32620,-3094,
                                  32597,-3331,32597,-3331,32597,-3331,32597,-3331,
                                  32572,-3568,32572,-3568,32572,-3568,32572,-3568,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32516,-4041,32516,-4041,32516,-4041,32516,-4041,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32454,-4514,32454,-4514,32454,-4514,32454,-4514,
                                  32421,-4749,32421,-4749,32421,-4749,32421,-4749,
                                  32385,-4985,32385,-4985,32385,-4985,32385,-4985,
                                  32348,-5221,32348,-5221,32348,-5221,32348,-5221,
                                  32309,-5456,32309,-5456,32309,-5456,32309,-5456,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32226,-5925,32226,-5925,32226,-5925,32226,-5925,
                                  32183,-6159,32183,-6159,32183,-6159,32183,-6159,
                                  32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                  32090,-6627,32090,-6627,32090,-6627,32090,-6627,
                                  32041,-6860,32041,-6860,32041,-6860,32041,-6860,
                                  31990,-7093,31990,-7093,31990,-7093,31990,-7093,
                                  31937,-7325,31937,-7325,31937,-7325,31937,-7325,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31827,-7789,31827,-7789,31827,-7789,31827,-7789,
                                  31770,-8020,31770,-8020,31770,-8020,31770,-8020,
                                  31711,-8251,31711,-8251,31711,-8251,31711,-8251,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31587,-8711,31587,-8711,31587,-8711,31587,-8711,
                                  31523,-8941,31523,-8941,31523,-8941,31523,-8941,
                                  31457,-9170,31457,-9170,31457,-9170,31457,-9170,
                                  31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                  31321,-9626,31321,-9626,31321,-9626,31321,-9626,
                                  31250,-9854,31250,-9854,31250,-9854,31250,-9854,
                                  31177,-10081,31177,-10081,31177,-10081,31177,-10081,
                                  31103,-10307,31103,-10307,31103,-10307,31103,-10307,
                                  31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                  30950,-10758,30950,-10758,30950,-10758,30950,-10758,
                                  30871,-10983,30871,-10983,30871,-10983,30871,-10983,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30708,-11431,30708,-11431,30708,-11431,30708,-11431,
                                  30624,-11654,30624,-11654,30624,-11654,30624,-11654,
                                  30539,-11877,30539,-11877,30539,-11877,30539,-11877,
                                  30451,-12098,30451,-12098,30451,-12098,30451,-12098,
                                  30363,-12319,30363,-12319,30363,-12319,30363,-12319,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  30180,-12760,30180,-12760,30180,-12760,30180,-12760,
                                  30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                  29992,-13197,29992,-13197,29992,-13197,29992,-13197,
                                  29895,-13415,29895,-13415,29895,-13415,29895,-13415,
                                  29796,-13632,29796,-13632,29796,-13632,29796,-13632,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29595,-14064,29595,-14064,29595,-14064,29595,-14064,
                                  29492,-14279,29492,-14279,29492,-14279,29492,-14279,
                                  29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  29173,-14919,29173,-14919,29173,-14919,29173,-14919,
                                  29064,-15131,29064,-15131,29064,-15131,29064,-15131,
                                  28953,-15342,28953,-15342,28953,-15342,28953,-15342,
                                  28841,-15552,28841,-15552,28841,-15552,28841,-15552,
                                  28727,-15761,28727,-15761,28727,-15761,28727,-15761,
                                  28612,-15970,28612,-15970,28612,-15970,28612,-15970,
                                  28495,-16177,28495,-16177,28495,-16177,28495,-16177,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28257,-16590,28257,-16590,28257,-16590,28257,-16590,
                                  28135,-16795,28135,-16795,28135,-16795,28135,-16795,
                                  28012,-16999,28012,-16999,28012,-16999,28012,-16999,
                                  27888,-17202,27888,-17202,27888,-17202,27888,-17202,
                                  27762,-17405,27762,-17405,27762,-17405,27762,-17405,
                                  27635,-17606,27635,-17606,27635,-17606,27635,-17606,
                                  27506,-17807,27506,-17807,27506,-17807,27506,-17807,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                  27111,-18403,27111,-18403,27111,-18403,27111,-18403,
                                  26977,-18599,26977,-18599,26977,-18599,26977,-18599,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26703,-18990,26703,-18990,26703,-18990,26703,-18990,
                                  26564,-19183,26564,-19183,26564,-19183,26564,-19183,
                                  26424,-19376,26424,-19376,26424,-19376,26424,-19376,
                                  26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                  26140,-19758,26140,-19758,26140,-19758,26140,-19758,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25850,-20136,25850,-20136,25850,-20136,25850,-20136,
                                  25702,-20324,25702,-20324,25702,-20324,25702,-20324,
                                  25554,-20510,25554,-20510,25554,-20510,25554,-20510,
                                  25404,-20695,25404,-20695,25404,-20695,25404,-20695,
                                  25253,-20880,25253,-20880,25253,-20880,25253,-20880,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24947,-21245,24947,-21245,24947,-21245,24947,-21245,
                                  24791,-21426,24791,-21426,24791,-21426,24791,-21426,
                                  24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                  24477,-21784,24477,-21784,24477,-21784,24477,-21784,
                                  24318,-21961,24318,-21961,24318,-21961,24318,-21961,
                                  24158,-22138,24158,-22138,24158,-22138,24158,-22138,
                                  23996,-22313,23996,-22313,23996,-22313,23996,-22313,
                                  23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                  23669,-22659,23669,-22659,23669,-22659,23669,-22659,
                                  23504,-22831,23504,-22831,23504,-22831,23504,-22831,
                                  23337,-23001,23337,-23001,23337,-23001,23337,-23001,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  23000,-23338,23000,-23338,23000,-23338,23000,-23338,
                                  22830,-23505,22830,-23505,22830,-23505,22830,-23505,
                                  22658,-23670,22658,-23670,22658,-23670,22658,-23670,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  22312,-23997,22312,-23997,22312,-23997,22312,-23997,
                                  22137,-24159,22137,-24159,22137,-24159,22137,-24159,
                                  21960,-24319,21960,-24319,21960,-24319,21960,-24319,
                                  21783,-24478,21783,-24478,21783,-24478,21783,-24478,
                                  21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                  21425,-24792,21425,-24792,21425,-24792,21425,-24792,
                                  21244,-24948,21244,-24948,21244,-24948,21244,-24948,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20879,-25254,20879,-25254,20879,-25254,20879,-25254,
                                  20694,-25405,20694,-25405,20694,-25405,20694,-25405,
                                  20509,-25555,20509,-25555,20509,-25555,20509,-25555,
                                  20323,-25703,20323,-25703,20323,-25703,20323,-25703,
                                  20135,-25851,20135,-25851,20135,-25851,20135,-25851,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19757,-26141,19757,-26141,19757,-26141,19757,-26141,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  19375,-26425,19375,-26425,19375,-26425,19375,-26425,
                                  19182,-26565,19182,-26565,19182,-26565,19182,-26565,
                                  18989,-26704,18989,-26704,18989,-26704,18989,-26704,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18598,-26978,18598,-26978,18598,-26978,18598,-26978,
                                  18402,-27112,18402,-27112,18402,-27112,18402,-27112,
                                  18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                  18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                  17806,-27507,17806,-27507,17806,-27507,17806,-27507,
                                  17605,-27636,17605,-27636,17605,-27636,17605,-27636,
                                  17404,-27763,17404,-27763,17404,-27763,17404,-27763,
                                  17201,-27889,17201,-27889,17201,-27889,17201,-27889,
                                  16998,-28013,16998,-28013,16998,-28013,16998,-28013,
                                  16794,-28136,16794,-28136,16794,-28136,16794,-28136,
                                  16589,-28258,16589,-28258,16589,-28258,16589,-28258,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16176,-28496,16176,-28496,16176,-28496,16176,-28496,
                                  15969,-28613,15969,-28613,15969,-28613,15969,-28613,
                                  15760,-28728,15760,-28728,15760,-28728,15760,-28728,
                                  15551,-28842,15551,-28842,15551,-28842,15551,-28842,
                                  15341,-28954,15341,-28954,15341,-28954,15341,-28954,
                                  15130,-29065,15130,-29065,15130,-29065,15130,-29065,
                                  14918,-29174,14918,-29174,14918,-29174,14918,-29174,
                                  14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                  14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                  14278,-29493,14278,-29493,14278,-29493,14278,-29493,
                                  14063,-29596,14063,-29596,14063,-29596,14063,-29596,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  13631,-29797,13631,-29797,13631,-29797,13631,-29797,
                                  13414,-29896,13414,-29896,13414,-29896,13414,-29896,
                                  13196,-29993,13196,-29993,13196,-29993,13196,-29993,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12759,-30181,12759,-30181,12759,-30181,12759,-30181,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  12318,-30364,12318,-30364,12318,-30364,12318,-30364,
                                  12097,-30452,12097,-30452,12097,-30452,12097,-30452,
                                  11876,-30540,11876,-30540,11876,-30540,11876,-30540,
                                  11653,-30625,11653,-30625,11653,-30625,11653,-30625,
                                  11430,-30709,11430,-30709,11430,-30709,11430,-30709,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10982,-30872,10982,-30872,10982,-30872,10982,-30872,
                                  10757,-30951,10757,-30951,10757,-30951,10757,-30951,
                                  10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                  10306,-31104,10306,-31104,10306,-31104,10306,-31104,
                                  10080,-31178,10080,-31178,10080,-31178,10080,-31178,
                                  9853,-31251,9853,-31251,9853,-31251,9853,-31251,
                                  9625,-31322,9625,-31322,9625,-31322,9625,-31322,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  9169,-31458,9169,-31458,9169,-31458,9169,-31458,
                                  8940,-31524,8940,-31524,8940,-31524,8940,-31524,
                                  8710,-31588,8710,-31588,8710,-31588,8710,-31588,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8250,-31712,8250,-31712,8250,-31712,8250,-31712,
                                  8019,-31771,8019,-31771,8019,-31771,8019,-31771,
                                  7788,-31828,7788,-31828,7788,-31828,7788,-31828,
                                  7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                  7324,-31938,7324,-31938,7324,-31938,7324,-31938,
                                  7092,-31991,7092,-31991,7092,-31991,7092,-31991,
                                  6859,-32042,6859,-32042,6859,-32042,6859,-32042,
                                  6626,-32091,6626,-32091,6626,-32091,6626,-32091,
                                  6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                  6158,-32184,6158,-32184,6158,-32184,6158,-32184,
                                  5924,-32227,5924,-32227,5924,-32227,5924,-32227,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5455,-32310,5455,-32310,5455,-32310,5455,-32310,
                                  5220,-32349,5220,-32349,5220,-32349,5220,-32349,
                                  4984,-32386,4984,-32386,4984,-32386,4984,-32386,
                                  4748,-32422,4748,-32422,4748,-32422,4748,-32422,
                                  4513,-32455,4513,-32455,4513,-32455,4513,-32455,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  4040,-32517,4040,-32517,4040,-32517,4040,-32517,
                                  3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                  3567,-32573,3567,-32573,3567,-32573,3567,-32573,
                                  3330,-32598,3330,-32598,3330,-32598,3330,-32598,
                                  3093,-32621,3093,-32621,3093,-32621,3093,-32621,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  2618,-32663,2618,-32663,2618,-32663,2618,-32663,
                                  2380,-32681,2380,-32681,2380,-32681,2380,-32681,
                                  2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1667,-32725,1667,-32725,1667,-32725,1667,-32725,
                                  1429,-32736,1429,-32736,1429,-32736,1429,-32736,
                                  1191,-32746,1191,-32746,1191,-32746,1191,-32746,
                                  953,-32754,953,-32754,953,-32754,953,-32754,
                                  714,-32760,714,-32760,714,-32760,714,-32760,
                                  476,-32764,476,-32764,476,-32764,476,-32764,
                                  238,-32767,238,-32767,238,-32767,238,-32767,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -239,-32767,-239,-32767,-239,-32767,-239,-32767,
                                  -477,-32764,-477,-32764,-477,-32764,-477,-32764,
                                  -715,-32760,-715,-32760,-715,-32760,-715,-32760,
                                  -954,-32754,-954,-32754,-954,-32754,-954,-32754,
                                  -1192,-32746,-1192,-32746,-1192,-32746,-1192,-32746,
                                  -1430,-32736,-1430,-32736,-1430,-32736,-1430,-32736,
                                  -1668,-32725,-1668,-32725,-1668,-32725,-1668,-32725,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2144,-32697,-2144,-32697,-2144,-32697,-2144,-32697,
                                  -2381,-32681,-2381,-32681,-2381,-32681,-2381,-32681,
                                  -2619,-32663,-2619,-32663,-2619,-32663,-2619,-32663,
                                  -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                  -3094,-32621,-3094,-32621,-3094,-32621,-3094,-32621,
                                  -3331,-32598,-3331,-32598,-3331,-32598,-3331,-32598,
                                  -3568,-32573,-3568,-32573,-3568,-32573,-3568,-32573,
                                  -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                  -4041,-32517,-4041,-32517,-4041,-32517,-4041,-32517,
                                  -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                  -4514,-32455,-4514,-32455,-4514,-32455,-4514,-32455,
                                  -4749,-32422,-4749,-32422,-4749,-32422,-4749,-32422,
                                  -4985,-32386,-4985,-32386,-4985,-32386,-4985,-32386,
                                  -5221,-32349,-5221,-32349,-5221,-32349,-5221,-32349,
                                  -5456,-32310,-5456,-32310,-5456,-32310,-5456,-32310,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -5925,-32227,-5925,-32227,-5925,-32227,-5925,-32227,
                                  -6159,-32184,-6159,-32184,-6159,-32184,-6159,-32184,
                                  -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                  -6627,-32091,-6627,-32091,-6627,-32091,-6627,-32091,
                                  -6860,-32042,-6860,-32042,-6860,-32042,-6860,-32042,
                                  -7093,-31991,-7093,-31991,-7093,-31991,-7093,-31991,
                                  -7325,-31938,-7325,-31938,-7325,-31938,-7325,-31938,
                                  -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                  -7789,-31828,-7789,-31828,-7789,-31828,-7789,-31828,
                                  -8020,-31771,-8020,-31771,-8020,-31771,-8020,-31771,
                                  -8251,-31712,-8251,-31712,-8251,-31712,-8251,-31712,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -8711,-31588,-8711,-31588,-8711,-31588,-8711,-31588,
                                  -8941,-31524,-8941,-31524,-8941,-31524,-8941,-31524,
                                  -9170,-31458,-9170,-31458,-9170,-31458,-9170,-31458,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -9626,-31322,-9626,-31322,-9626,-31322,-9626,-31322,
                                  -9854,-31251,-9854,-31251,-9854,-31251,-9854,-31251,
                                  -10081,-31178,-10081,-31178,-10081,-31178,-10081,-31178,
                                  -10307,-31104,-10307,-31104,-10307,-31104,-10307,-31104,
                                  -10533,-31029,-10533,-31029,-10533,-31029,-10533,-31029,
                                  -10758,-30951,-10758,-30951,-10758,-30951,-10758,-30951,
                                  -10983,-30872,-10983,-30872,-10983,-30872,-10983,-30872,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11431,-30709,-11431,-30709,-11431,-30709,-11431,-30709,
                                  -11654,-30625,-11654,-30625,-11654,-30625,-11654,-30625,
                                  -11877,-30540,-11877,-30540,-11877,-30540,-11877,-30540,
                                  -12098,-30452,-12098,-30452,-12098,-30452,-12098,-30452,
                                  -12319,-30364,-12319,-30364,-12319,-30364,-12319,-30364,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -12760,-30181,-12760,-30181,-12760,-30181,-12760,-30181,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13197,-29993,-13197,-29993,-13197,-29993,-13197,-29993,
                                  -13415,-29896,-13415,-29896,-13415,-29896,-13415,-29896,
                                  -13632,-29797,-13632,-29797,-13632,-29797,-13632,-29797,
                                  -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                  -14064,-29596,-14064,-29596,-14064,-29596,-14064,-29596,
                                  -14279,-29493,-14279,-29493,-14279,-29493,-14279,-29493,
                                  -14493,-29388,-14493,-29388,-14493,-29388,-14493,-29388,
                                  -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                  -14919,-29174,-14919,-29174,-14919,-29174,-14919,-29174,
                                  -15131,-29065,-15131,-29065,-15131,-29065,-15131,-29065,
                                  -15342,-28954,-15342,-28954,-15342,-28954,-15342,-28954,
                                  -15552,-28842,-15552,-28842,-15552,-28842,-15552,-28842,
                                  -15761,-28728,-15761,-28728,-15761,-28728,-15761,-28728,
                                  -15970,-28613,-15970,-28613,-15970,-28613,-15970,-28613,
                                  -16177,-28496,-16177,-28496,-16177,-28496,-16177,-28496
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
10852
static int16_t twb864[287*2*4] = {32763,-477,32763,-477,32763,-477,32763,-477,
10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142
                                  32753,-954,32753,-954,32753,-954,32753,-954,
                                  32735,-1430,32735,-1430,32735,-1430,32735,-1430,
                                  32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                  32680,-2381,32680,-2381,32680,-2381,32680,-2381,
                                  32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                  32597,-3331,32597,-3331,32597,-3331,32597,-3331,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32421,-4749,32421,-4749,32421,-4749,32421,-4749,
                                  32348,-5221,32348,-5221,32348,-5221,32348,-5221,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32183,-6159,32183,-6159,32183,-6159,32183,-6159,
                                  32090,-6627,32090,-6627,32090,-6627,32090,-6627,
                                  31990,-7093,31990,-7093,31990,-7093,31990,-7093,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31770,-8020,31770,-8020,31770,-8020,31770,-8020,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31523,-8941,31523,-8941,31523,-8941,31523,-8941,
                                  31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                  31250,-9854,31250,-9854,31250,-9854,31250,-9854,
                                  31103,-10307,31103,-10307,31103,-10307,31103,-10307,
                                  30950,-10758,30950,-10758,30950,-10758,30950,-10758,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30624,-11654,30624,-11654,30624,-11654,30624,-11654,
                                  30451,-12098,30451,-12098,30451,-12098,30451,-12098,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                  29895,-13415,29895,-13415,29895,-13415,29895,-13415,
                                  29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                  29492,-14279,29492,-14279,29492,-14279,29492,-14279,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  29064,-15131,29064,-15131,29064,-15131,29064,-15131,
                                  28841,-15552,28841,-15552,28841,-15552,28841,-15552,
                                  28612,-15970,28612,-15970,28612,-15970,28612,-15970,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28135,-16795,28135,-16795,28135,-16795,28135,-16795,
                                  27888,-17202,27888,-17202,27888,-17202,27888,-17202,
                                  27635,-17606,27635,-17606,27635,-17606,27635,-17606,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  27111,-18403,27111,-18403,27111,-18403,27111,-18403,
                                  26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                  26564,-19183,26564,-19183,26564,-19183,26564,-19183,
                                  26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25702,-20324,25702,-20324,25702,-20324,25702,-20324,
                                  25404,-20695,25404,-20695,25404,-20695,25404,-20695,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24791,-21426,24791,-21426,24791,-21426,24791,-21426,
                                  24477,-21784,24477,-21784,24477,-21784,24477,-21784,
                                  24158,-22138,24158,-22138,24158,-22138,24158,-22138,
                                  23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                  23504,-22831,23504,-22831,23504,-22831,23504,-22831,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22830,-23505,22830,-23505,22830,-23505,22830,-23505,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  22137,-24159,22137,-24159,22137,-24159,22137,-24159,
                                  21783,-24478,21783,-24478,21783,-24478,21783,-24478,
                                  21425,-24792,21425,-24792,21425,-24792,21425,-24792,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20694,-25405,20694,-25405,20694,-25405,20694,-25405,
                                  20323,-25703,20323,-25703,20323,-25703,20323,-25703,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  19182,-26565,19182,-26565,19182,-26565,19182,-26565,
                                  18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                  18402,-27112,18402,-27112,18402,-27112,18402,-27112,
                                  18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                  17605,-27636,17605,-27636,17605,-27636,17605,-27636,
                                  17201,-27889,17201,-27889,17201,-27889,17201,-27889,
                                  16794,-28136,16794,-28136,16794,-28136,16794,-28136,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15969,-28613,15969,-28613,15969,-28613,15969,-28613,
                                  15551,-28842,15551,-28842,15551,-28842,15551,-28842,
                                  15130,-29065,15130,-29065,15130,-29065,15130,-29065,
                                  14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                  14278,-29493,14278,-29493,14278,-29493,14278,-29493,
                                  13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                  13414,-29896,13414,-29896,13414,-29896,13414,-29896,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  12097,-30452,12097,-30452,12097,-30452,12097,-30452,
                                  11653,-30625,11653,-30625,11653,-30625,11653,-30625,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10757,-30951,10757,-30951,10757,-30951,10757,-30951,
                                  10306,-31104,10306,-31104,10306,-31104,10306,-31104,
                                  9853,-31251,9853,-31251,9853,-31251,9853,-31251,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  8940,-31524,8940,-31524,8940,-31524,8940,-31524,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8019,-31771,8019,-31771,8019,-31771,8019,-31771,
                                  7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                  7092,-31991,7092,-31991,7092,-31991,7092,-31991,
                                  6626,-32091,6626,-32091,6626,-32091,6626,-32091,
                                  6158,-32184,6158,-32184,6158,-32184,6158,-32184,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5220,-32349,5220,-32349,5220,-32349,5220,-32349,
                                  4748,-32422,4748,-32422,4748,-32422,4748,-32422,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                  3330,-32598,3330,-32598,3330,-32598,3330,-32598,
                                  2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                  2380,-32681,2380,-32681,2380,-32681,2380,-32681,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1429,-32736,1429,-32736,1429,-32736,1429,-32736,
                                  953,-32754,953,-32754,953,-32754,953,-32754,
                                  476,-32764,476,-32764,476,-32764,476,-32764,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -477,-32764,-477,-32764,-477,-32764,-477,-32764,
                                  -954,-32754,-954,-32754,-954,-32754,-954,-32754,
                                  -1430,-32736,-1430,-32736,-1430,-32736,-1430,-32736,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2381,-32681,-2381,-32681,-2381,-32681,-2381,-32681,
                                  -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                  -3331,-32598,-3331,-32598,-3331,-32598,-3331,-32598,
                                  -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                  -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                  -4749,-32422,-4749,-32422,-4749,-32422,-4749,-32422,
                                  -5221,-32349,-5221,-32349,-5221,-32349,-5221,-32349,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6159,-32184,-6159,-32184,-6159,-32184,-6159,-32184,
                                  -6627,-32091,-6627,-32091,-6627,-32091,-6627,-32091,
                                  -7093,-31991,-7093,-31991,-7093,-31991,-7093,-31991,
                                  -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                  -8020,-31771,-8020,-31771,-8020,-31771,-8020,-31771,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -8941,-31524,-8941,-31524,-8941,-31524,-8941,-31524,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -9854,-31251,-9854,-31251,-9854,-31251,-9854,-31251,
                                  -10307,-31104,-10307,-31104,-10307,-31104,-10307,-31104,
                                  -10758,-30951,-10758,-30951,-10758,-30951,-10758,-30951,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11654,-30625,-11654,-30625,-11654,-30625,-11654,-30625,
                                  -12098,-30452,-12098,-30452,-12098,-30452,-12098,-30452,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13415,-29896,-13415,-29896,-13415,-29896,-13415,-29896,
                                  -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                  -14279,-29493,-14279,-29493,-14279,-29493,-14279,-29493,
                                  -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                  -15131,-29065,-15131,-29065,-15131,-29065,-15131,-29065,
                                  -15552,-28842,-15552,-28842,-15552,-28842,-15552,-28842,
                                  -15970,-28613,-15970,-28613,-15970,-28613,-15970,-28613,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -16795,-28136,-16795,-28136,-16795,-28136,-16795,-28136,
                                  -17202,-27889,-17202,-27889,-17202,-27889,-17202,-27889,
                                  -17606,-27636,-17606,-27636,-17606,-27636,-17606,-27636,
                                  -18006,-27377,-18006,-27377,-18006,-27377,-18006,-27377,
                                  -18403,-27112,-18403,-27112,-18403,-27112,-18403,-27112,
                                  -18795,-26842,-18795,-26842,-18795,-26842,-18795,-26842,
                                  -19183,-26565,-19183,-26565,-19183,-26565,-19183,-26565,
                                  -19568,-26284,-19568,-26284,-19568,-26284,-19568,-26284,
                                  -19948,-25996,-19948,-25996,-19948,-25996,-19948,-25996,
                                  -20324,-25703,-20324,-25703,-20324,-25703,-20324,-25703,
                                  -20695,-25405,-20695,-25405,-20695,-25405,-20695,-25405,
                                  -21063,-25101,-21063,-25101,-21063,-25101,-21063,-25101,
                                  -21426,-24792,-21426,-24792,-21426,-24792,-21426,-24792,
                                  -21784,-24478,-21784,-24478,-21784,-24478,-21784,-24478,
                                  -22138,-24159,-22138,-24159,-22138,-24159,-22138,-24159,
                                  -22487,-23834,-22487,-23834,-22487,-23834,-22487,-23834,
                                  -22831,-23505,-22831,-23505,-22831,-23505,-22831,-23505,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -23505,-22831,-23505,-22831,-23505,-22831,-23505,-22831,
                                  -23834,-22487,-23834,-22487,-23834,-22487,-23834,-22487,
                                  -24159,-22138,-24159,-22138,-24159,-22138,-24159,-22138,
                                  -24478,-21784,-24478,-21784,-24478,-21784,-24478,-21784,
                                  -24792,-21426,-24792,-21426,-24792,-21426,-24792,-21426,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25405,-20695,-25405,-20695,-25405,-20695,-25405,-20695,
                                  -25703,-20324,-25703,-20324,-25703,-20324,-25703,-20324,
                                  -25996,-19948,-25996,-19948,-25996,-19948,-25996,-19948,
                                  -26284,-19568,-26284,-19568,-26284,-19568,-26284,-19568,
                                  -26565,-19183,-26565,-19183,-26565,-19183,-26565,-19183,
                                  -26842,-18795,-26842,-18795,-26842,-18795,-26842,-18795,
                                  -27112,-18403,-27112,-18403,-27112,-18403,-27112,-18403,
                                  -27377,-18006,-27377,-18006,-27377,-18006,-27377,-18006,
                                  -27636,-17606,-27636,-17606,-27636,-17606,-27636,-17606,
                                  -27889,-17202,-27889,-17202,-27889,-17202,-27889,-17202,
                                  -28136,-16795,-28136,-16795,-28136,-16795,-28136,-16795,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28613,-15970,-28613,-15970,-28613,-15970,-28613,-15970,
                                  -28842,-15552,-28842,-15552,-28842,-15552,-28842,-15552,
                                  -29065,-15131,-29065,-15131,-29065,-15131,-29065,-15131,
                                  -29282,-14706,-29282,-14706,-29282,-14706,-29282,-14706,
                                  -29493,-14279,-29493,-14279,-29493,-14279,-29493,-14279,
                                  -29697,-13848,-29697,-13848,-29697,-13848,-29697,-13848,
                                  -29896,-13415,-29896,-13415,-29896,-13415,-29896,-13415,
                                  -30088,-12979,-30088,-12979,-30088,-12979,-30088,-12979,
                                  -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                  -30452,-12098,-30452,-12098,-30452,-12098,-30452,-12098,
                                  -30625,-11654,-30625,-11654,-30625,-11654,-30625,-11654,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -30951,-10758,-30951,-10758,-30951,-10758,-30951,-10758,
                                  -31104,-10307,-31104,-10307,-31104,-10307,-31104,-10307,
                                  -31251,-9854,-31251,-9854,-31251,-9854,-31251,-9854,
                                  -31391,-9398,-31391,-9398,-31391,-9398,-31391,-9398,
                                  -31524,-8941,-31524,-8941,-31524,-8941,-31524,-8941,
                                  -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                  -31771,-8020,-31771,-8020,-31771,-8020,-31771,-8020,
                                  -31884,-7557,-31884,-7557,-31884,-7557,-31884,-7557,
                                  -31991,-7093,-31991,-7093,-31991,-7093,-31991,-7093,
                                  -32091,-6627,-32091,-6627,-32091,-6627,-32091,-6627,
                                  -32184,-6159,-32184,-6159,-32184,-6159,-32184,-6159,
                                  -32270,-5690,-32270,-5690,-32270,-5690,-32270,-5690,
                                  -32349,-5221,-32349,-5221,-32349,-5221,-32349,-5221,
                                  -32422,-4749,-32422,-4749,-32422,-4749,-32422,-4749,
                                  -32487,-4277,-32487,-4277,-32487,-4277,-32487,-4277,
                                  -32546,-3805,-32546,-3805,-32546,-3805,-32546,-3805,
                                  -32598,-3331,-32598,-3331,-32598,-3331,-32598,-3331,
                                  -32643,-2856,-32643,-2856,-32643,-2856,-32643,-2856,
                                  -32681,-2381,-32681,-2381,-32681,-2381,-32681,-2381,
                                  -32712,-1906,-32712,-1906,-32712,-1906,-32712,-1906,
                                  -32736,-1430,-32736,-1430,-32736,-1430,-32736,-1430,
                                  -32754,-954,-32754,-954,-32754,-954,-32754,-954,
                                  -32764,-477,-32764,-477,-32764,-477,-32764,-477,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32764,476,-32764,476,-32764,476,-32764,476,
                                  -32754,953,-32754,953,-32754,953,-32754,953,
                                  -32736,1429,-32736,1429,-32736,1429,-32736,1429,
                                  -32712,1905,-32712,1905,-32712,1905,-32712,1905,
                                  -32681,2380,-32681,2380,-32681,2380,-32681,2380,
                                  -32643,2855,-32643,2855,-32643,2855,-32643,2855,
                                  -32598,3330,-32598,3330,-32598,3330,-32598,3330,
                                  -32546,3804,-32546,3804,-32546,3804,-32546,3804,
                                  -32487,4276,-32487,4276,-32487,4276,-32487,4276,
                                  -32422,4748,-32422,4748,-32422,4748,-32422,4748,
                                  -32349,5220,-32349,5220,-32349,5220,-32349,5220,
                                  -32270,5689,-32270,5689,-32270,5689,-32270,5689,
                                  -32184,6158,-32184,6158,-32184,6158,-32184,6158,
                                  -32091,6626,-32091,6626,-32091,6626,-32091,6626,
                                  -31991,7092,-31991,7092,-31991,7092,-31991,7092,
                                  -31884,7556,-31884,7556,-31884,7556,-31884,7556,
                                  -31771,8019,-31771,8019,-31771,8019,-31771,8019,
                                  -31651,8480,-31651,8480,-31651,8480,-31651,8480,
                                  -31524,8940,-31524,8940,-31524,8940,-31524,8940,
                                  -31391,9397,-31391,9397,-31391,9397,-31391,9397,
                                  -31251,9853,-31251,9853,-31251,9853,-31251,9853,
                                  -31104,10306,-31104,10306,-31104,10306,-31104,10306,
                                  -30951,10757,-30951,10757,-30951,10757,-30951,10757,
                                  -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                  -30625,11653,-30625,11653,-30625,11653,-30625,11653,
                                  -30452,12097,-30452,12097,-30452,12097,-30452,12097,
                                  -30273,12539,-30273,12539,-30273,12539,-30273,12539,
                                  -30088,12978,-30088,12978,-30088,12978,-30088,12978,
                                  -29896,13414,-29896,13414,-29896,13414,-29896,13414,
                                  -29697,13847,-29697,13847,-29697,13847,-29697,13847,
                                  -29493,14278,-29493,14278,-29493,14278,-29493,14278,
                                  -29282,14705,-29282,14705,-29282,14705,-29282,14705,
                                  -29065,15130,-29065,15130,-29065,15130,-29065,15130,
                                  -28842,15551,-28842,15551,-28842,15551,-28842,15551,
                                  -28613,15969,-28613,15969,-28613,15969,-28613,15969,
                                  -28378,16383,-28378,16383,-28378,16383,-28378,16383,
                                  -28136,16794,-28136,16794,-28136,16794,-28136,16794,
                                  -27889,17201,-27889,17201,-27889,17201,-27889,17201,
                                  -27636,17605,-27636,17605,-27636,17605,-27636,17605,
                                  -27377,18005,-27377,18005,-27377,18005,-27377,18005,
                                  -27112,18402,-27112,18402,-27112,18402,-27112,18402,
                                  -26842,18794,-26842,18794,-26842,18794,-26842,18794,
                                  -26565,19182,-26565,19182,-26565,19182,-26565,19182,
                                  -26284,19567,-26284,19567,-26284,19567,-26284,19567,
                                  -25996,19947,-25996,19947,-25996,19947,-25996,19947,
                                  -25703,20323,-25703,20323,-25703,20323,-25703,20323,
                                  -25405,20694,-25405,20694,-25405,20694,-25405,20694,
                                  -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                  -24792,21425,-24792,21425,-24792,21425,-24792,21425,
                                  -24478,21783,-24478,21783,-24478,21783,-24478,21783,
                                  -24159,22137,-24159,22137,-24159,22137,-24159,22137,
                                  -23834,22486,-23834,22486,-23834,22486,-23834,22486,
                                  -23505,22830,-23505,22830,-23505,22830,-23505,22830,
                                  -23170,23169,-23170,23169,-23170,23169,-23170,23169,
                                  -22831,23504,-22831,23504,-22831,23504,-22831,23504,
                                  -22487,23833,-22487,23833,-22487,23833,-22487,23833,
                                  -22138,24158,-22138,24158,-22138,24158,-22138,24158,
                                  -21784,24477,-21784,24477,-21784,24477,-21784,24477,
                                  -21426,24791,-21426,24791,-21426,24791,-21426,24791,
                                  -21063,25100,-21063,25100,-21063,25100,-21063,25100,
                                  -20695,25404,-20695,25404,-20695,25404,-20695,25404,
                                  -20324,25702,-20324,25702,-20324,25702,-20324,25702,
                                  -19948,25995,-19948,25995,-19948,25995,-19948,25995,
                                  -19568,26283,-19568,26283,-19568,26283,-19568,26283,
                                  -19183,26564,-19183,26564,-19183,26564,-19183,26564,
                                  -18795,26841,-18795,26841,-18795,26841,-18795,26841,
                                  -18403,27111,-18403,27111,-18403,27111,-18403,27111,
                                  -18006,27376,-18006,27376,-18006,27376,-18006,27376,
                                  -17606,27635,-17606,27635,-17606,27635,-17606,27635,
                                  -17202,27888,-17202,27888,-17202,27888,-17202,27888,
                                  -16795,28135,-16795,28135,-16795,28135,-16795,28135
                                 };

void dft864(int16_t *x,int16_t *y,unsigned char scale_flag)  // 288 x 3
{
Raymond Knopp's avatar
 
Raymond Knopp committed
11143
  int i,j;
11144 11145 11146 11147 11148 11149
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa864[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb864[0];
  simd_q15_t x2128[864];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[864];//=&ytmp128array3[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
11150 11151 11152



11153
  for (i=0,j=0; i<288; i++,j+=3) {
Raymond Knopp's avatar
 
Raymond Knopp committed
11154 11155
    x2128[i]    = x128[j];
    x2128[i+288] = x128[j+1];
11156
    x2128[i+576] = x128[j+2];
Raymond Knopp's avatar
 
Raymond Knopp committed
11157 11158 11159 11160 11161 11162 11163
  }

  dft288((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft288((int16_t *)(x2128+288),(int16_t *)(ytmp128+288),1);
  dft288((int16_t *)(x2128+576),(int16_t *)(ytmp128+576),1);

  bfly3_tw1(ytmp128,ytmp128+288,ytmp128+576,y128,y128+288,y128+576);
11164 11165

  for (i=1,j=0; i<288; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
11166
    bfly3(ytmp128+i,
11167 11168 11169 11170 11171 11172 11173
          ytmp128+288+i,
          ytmp128+576+i,
          y128+i,
          y128+288+i,
          y128+576+i,
          twa128+j,
          twb128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
11174 11175 11176
  }

  if (scale_flag==1) {
11177
    norm128 = set1_int16(dft_norm_table[14]);
11178 11179

    for (i=0; i<864; i++) {
11180
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213
    }
  }

  _mm_empty();
  _m_empty();

};

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:299)/900));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:299)/900));
twa2 = zeros(1,2*299);
twb2 = zeros(1,2*299);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa900[299*2*4] = {");
for i=1:2:(2*298)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb900[299*2*4] = {");
for i=1:2:(2*298)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fclose(fd);
*/
static int16_t twa900[299*2*4] = {32766,-229,32766,-229,32766,-229,32766,-229,
11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512
                                  32763,-458,32763,-458,32763,-458,32763,-458,
                                  32759,-687,32759,-687,32759,-687,32759,-687,
                                  32754,-915,32754,-915,32754,-915,32754,-915,
                                  32747,-1144,32747,-1144,32747,-1144,32747,-1144,
                                  32738,-1373,32738,-1373,32738,-1373,32738,-1373,
                                  32727,-1601,32727,-1601,32727,-1601,32727,-1601,
                                  32715,-1830,32715,-1830,32715,-1830,32715,-1830,
                                  32702,-2058,32702,-2058,32702,-2058,32702,-2058,
                                  32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                  32670,-2514,32670,-2514,32670,-2514,32670,-2514,
                                  32652,-2742,32652,-2742,32652,-2742,32652,-2742,
                                  32632,-2970,32632,-2970,32632,-2970,32632,-2970,
                                  32610,-3198,32610,-3198,32610,-3198,32610,-3198,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32562,-3653,32562,-3653,32562,-3653,32562,-3653,
                                  32536,-3880,32536,-3880,32536,-3880,32536,-3880,
                                  32508,-4107,32508,-4107,32508,-4107,32508,-4107,
                                  32479,-4334,32479,-4334,32479,-4334,32479,-4334,
                                  32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                  32415,-4787,32415,-4787,32415,-4787,32415,-4787,
                                  32381,-5013,32381,-5013,32381,-5013,32381,-5013,
                                  32345,-5239,32345,-5239,32345,-5239,32345,-5239,
                                  32308,-5465,32308,-5465,32308,-5465,32308,-5465,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32228,-5916,32228,-5916,32228,-5916,32228,-5916,
                                  32186,-6140,32186,-6140,32186,-6140,32186,-6140,
                                  32142,-6365,32142,-6365,32142,-6365,32142,-6365,
                                  32097,-6589,32097,-6589,32097,-6589,32097,-6589,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  32002,-7037,32002,-7037,32002,-7037,32002,-7037,
                                  31952,-7260,31952,-7260,31952,-7260,31952,-7260,
                                  31901,-7483,31901,-7483,31901,-7483,31901,-7483,
                                  31848,-7705,31848,-7705,31848,-7705,31848,-7705,
                                  31793,-7928,31793,-7928,31793,-7928,31793,-7928,
                                  31737,-8149,31737,-8149,31737,-8149,31737,-8149,
                                  31679,-8371,31679,-8371,31679,-8371,31679,-8371,
                                  31620,-8592,31620,-8592,31620,-8592,31620,-8592,
                                  31559,-8812,31559,-8812,31559,-8812,31559,-8812,
                                  31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                  31433,-9252,31433,-9252,31433,-9252,31433,-9252,
                                  31368,-9471,31368,-9471,31368,-9471,31368,-9471,
                                  31301,-9690,31301,-9690,31301,-9690,31301,-9690,
                                  31233,-9908,31233,-9908,31233,-9908,31233,-9908,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  31091,-10343,31091,-10343,31091,-10343,31091,-10343,
                                  31018,-10560,31018,-10560,31018,-10560,31018,-10560,
                                  30944,-10776,30944,-10776,30944,-10776,30944,-10776,
                                  30868,-10992,30868,-10992,30868,-10992,30868,-10992,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30711,-11422,30711,-11422,30711,-11422,30711,-11422,
                                  30631,-11636,30631,-11636,30631,-11636,30631,-11636,
                                  30549,-11850,30549,-11850,30549,-11850,30549,-11850,
                                  30465,-12063,30465,-12063,30465,-12063,30465,-12063,
                                  30381,-12275,30381,-12275,30381,-12275,30381,-12275,
                                  30294,-12487,30294,-12487,30294,-12487,30294,-12487,
                                  30206,-12698,30206,-12698,30206,-12698,30206,-12698,
                                  30117,-12909,30117,-12909,30117,-12909,30117,-12909,
                                  30026,-13119,30026,-13119,30026,-13119,30026,-13119,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29840,-13537,29840,-13537,29840,-13537,29840,-13537,
                                  29745,-13745,29745,-13745,29745,-13745,29745,-13745,
                                  29648,-13952,29648,-13952,29648,-13952,29648,-13952,
                                  29550,-14159,29550,-14159,29550,-14159,29550,-14159,
                                  29450,-14365,29450,-14365,29450,-14365,29450,-14365,
                                  29349,-14570,29349,-14570,29349,-14570,29349,-14570,
                                  29247,-14774,29247,-14774,29247,-14774,29247,-14774,
                                  29143,-14978,29143,-14978,29143,-14978,29143,-14978,
                                  29038,-15181,29038,-15181,29038,-15181,29038,-15181,
                                  28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                  28823,-15585,28823,-15585,28823,-15585,28823,-15585,
                                  28713,-15786,28713,-15786,28713,-15786,28713,-15786,
                                  28603,-15986,28603,-15986,28603,-15986,28603,-15986,
                                  28490,-16185,28490,-16185,28490,-16185,28490,-16185,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28261,-16582,28261,-16582,28261,-16582,28261,-16582,
                                  28145,-16779,28145,-16779,28145,-16779,28145,-16779,
                                  28027,-16975,28027,-16975,28027,-16975,28027,-16975,
                                  27908,-17170,27908,-17170,27908,-17170,27908,-17170,
                                  27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                  27666,-17558,27666,-17558,27666,-17558,27666,-17558,
                                  27542,-17751,27542,-17751,27542,-17751,27542,-17751,
                                  27418,-17943,27418,-17943,27418,-17943,27418,-17943,
                                  27292,-18133,27292,-18133,27292,-18133,27292,-18133,
                                  27165,-18324,27165,-18324,27165,-18324,27165,-18324,
                                  27036,-18513,27036,-18513,27036,-18513,27036,-18513,
                                  26906,-18701,26906,-18701,26906,-18701,26906,-18701,
                                  26775,-18888,26775,-18888,26775,-18888,26775,-18888,
                                  26642,-19075,26642,-19075,26642,-19075,26642,-19075,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26373,-19445,26373,-19445,26373,-19445,26373,-19445,
                                  26237,-19629,26237,-19629,26237,-19629,26237,-19629,
                                  26099,-19811,26099,-19811,26099,-19811,26099,-19811,
                                  25960,-19993,25960,-19993,25960,-19993,25960,-19993,
                                  25820,-20174,25820,-20174,25820,-20174,25820,-20174,
                                  25679,-20354,25679,-20354,25679,-20354,25679,-20354,
                                  25536,-20532,25536,-20532,25536,-20532,25536,-20532,
                                  25392,-20710,25392,-20710,25392,-20710,25392,-20710,
                                  25247,-20887,25247,-20887,25247,-20887,25247,-20887,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24953,-21237,24953,-21237,24953,-21237,24953,-21237,
                                  24804,-21411,24804,-21411,24804,-21411,24804,-21411,
                                  24654,-21584,24654,-21584,24654,-21584,24654,-21584,
                                  24503,-21755,24503,-21755,24503,-21755,24503,-21755,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  24196,-22095,24196,-22095,24196,-22095,24196,-22095,
                                  24042,-22264,24042,-22264,24042,-22264,24042,-22264,
                                  23886,-22431,23886,-22431,23886,-22431,23886,-22431,
                                  23728,-22597,23728,-22597,23728,-22597,23728,-22597,
                                  23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                  23411,-22926,23411,-22926,23411,-22926,23411,-22926,
                                  23250,-23089,23250,-23089,23250,-23089,23250,-23089,
                                  23088,-23251,23088,-23251,23088,-23251,23088,-23251,
                                  22925,-23412,22925,-23412,22925,-23412,22925,-23412,
                                  22761,-23571,22761,-23571,22761,-23571,22761,-23571,
                                  22596,-23729,22596,-23729,22596,-23729,22596,-23729,
                                  22430,-23887,22430,-23887,22430,-23887,22430,-23887,
                                  22263,-24043,22263,-24043,22263,-24043,22263,-24043,
                                  22094,-24197,22094,-24197,22094,-24197,22094,-24197,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21754,-24504,21754,-24504,21754,-24504,21754,-24504,
                                  21583,-24655,21583,-24655,21583,-24655,21583,-24655,
                                  21410,-24805,21410,-24805,21410,-24805,21410,-24805,
                                  21236,-24954,21236,-24954,21236,-24954,21236,-24954,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20886,-25248,20886,-25248,20886,-25248,20886,-25248,
                                  20709,-25393,20709,-25393,20709,-25393,20709,-25393,
                                  20531,-25537,20531,-25537,20531,-25537,20531,-25537,
                                  20353,-25680,20353,-25680,20353,-25680,20353,-25680,
                                  20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                  19992,-25961,19992,-25961,19992,-25961,19992,-25961,
                                  19810,-26100,19810,-26100,19810,-26100,19810,-26100,
                                  19628,-26238,19628,-26238,19628,-26238,19628,-26238,
                                  19444,-26374,19444,-26374,19444,-26374,19444,-26374,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  19074,-26643,19074,-26643,19074,-26643,19074,-26643,
                                  18887,-26776,18887,-26776,18887,-26776,18887,-26776,
                                  18700,-26907,18700,-26907,18700,-26907,18700,-26907,
                                  18512,-27037,18512,-27037,18512,-27037,18512,-27037,
                                  18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                  18132,-27293,18132,-27293,18132,-27293,18132,-27293,
                                  17942,-27419,17942,-27419,17942,-27419,17942,-27419,
                                  17750,-27543,17750,-27543,17750,-27543,17750,-27543,
                                  17557,-27667,17557,-27667,17557,-27667,17557,-27667,
                                  17363,-27788,17363,-27788,17363,-27788,17363,-27788,
                                  17169,-27909,17169,-27909,17169,-27909,17169,-27909,
                                  16974,-28028,16974,-28028,16974,-28028,16974,-28028,
                                  16778,-28146,16778,-28146,16778,-28146,16778,-28146,
                                  16581,-28262,16581,-28262,16581,-28262,16581,-28262,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16184,-28491,16184,-28491,16184,-28491,16184,-28491,
                                  15985,-28604,15985,-28604,15985,-28604,15985,-28604,
                                  15785,-28714,15785,-28714,15785,-28714,15785,-28714,
                                  15584,-28824,15584,-28824,15584,-28824,15584,-28824,
                                  15383,-28932,15383,-28932,15383,-28932,15383,-28932,
                                  15180,-29039,15180,-29039,15180,-29039,15180,-29039,
                                  14977,-29144,14977,-29144,14977,-29144,14977,-29144,
                                  14773,-29248,14773,-29248,14773,-29248,14773,-29248,
                                  14569,-29350,14569,-29350,14569,-29350,14569,-29350,
                                  14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                  14158,-29551,14158,-29551,14158,-29551,14158,-29551,
                                  13951,-29649,13951,-29649,13951,-29649,13951,-29649,
                                  13744,-29746,13744,-29746,13744,-29746,13744,-29746,
                                  13536,-29841,13536,-29841,13536,-29841,13536,-29841,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  13118,-30027,13118,-30027,13118,-30027,13118,-30027,
                                  12908,-30118,12908,-30118,12908,-30118,12908,-30118,
                                  12697,-30207,12697,-30207,12697,-30207,12697,-30207,
                                  12486,-30295,12486,-30295,12486,-30295,12486,-30295,
                                  12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                  12062,-30466,12062,-30466,12062,-30466,12062,-30466,
                                  11849,-30550,11849,-30550,11849,-30550,11849,-30550,
                                  11635,-30632,11635,-30632,11635,-30632,11635,-30632,
                                  11421,-30712,11421,-30712,11421,-30712,11421,-30712,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  10991,-30869,10991,-30869,10991,-30869,10991,-30869,
                                  10775,-30945,10775,-30945,10775,-30945,10775,-30945,
                                  10559,-31019,10559,-31019,10559,-31019,10559,-31019,
                                  10342,-31092,10342,-31092,10342,-31092,10342,-31092,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9907,-31234,9907,-31234,9907,-31234,9907,-31234,
                                  9689,-31302,9689,-31302,9689,-31302,9689,-31302,
                                  9470,-31369,9470,-31369,9470,-31369,9470,-31369,
                                  9251,-31434,9251,-31434,9251,-31434,9251,-31434,
                                  9031,-31498,9031,-31498,9031,-31498,9031,-31498,
                                  8811,-31560,8811,-31560,8811,-31560,8811,-31560,
                                  8591,-31621,8591,-31621,8591,-31621,8591,-31621,
                                  8370,-31680,8370,-31680,8370,-31680,8370,-31680,
                                  8148,-31738,8148,-31738,8148,-31738,8148,-31738,
                                  7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                  7704,-31849,7704,-31849,7704,-31849,7704,-31849,
                                  7482,-31902,7482,-31902,7482,-31902,7482,-31902,
                                  7259,-31953,7259,-31953,7259,-31953,7259,-31953,
                                  7036,-32003,7036,-32003,7036,-32003,7036,-32003,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  6588,-32098,6588,-32098,6588,-32098,6588,-32098,
                                  6364,-32143,6364,-32143,6364,-32143,6364,-32143,
                                  6139,-32187,6139,-32187,6139,-32187,6139,-32187,
                                  5915,-32229,5915,-32229,5915,-32229,5915,-32229,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5464,-32309,5464,-32309,5464,-32309,5464,-32309,
                                  5238,-32346,5238,-32346,5238,-32346,5238,-32346,
                                  5012,-32382,5012,-32382,5012,-32382,5012,-32382,
                                  4786,-32416,4786,-32416,4786,-32416,4786,-32416,
                                  4560,-32449,4560,-32449,4560,-32449,4560,-32449,
                                  4333,-32480,4333,-32480,4333,-32480,4333,-32480,
                                  4106,-32509,4106,-32509,4106,-32509,4106,-32509,
                                  3879,-32537,3879,-32537,3879,-32537,3879,-32537,
                                  3652,-32563,3652,-32563,3652,-32563,3652,-32563,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  3197,-32611,3197,-32611,3197,-32611,3197,-32611,
                                  2969,-32633,2969,-32633,2969,-32633,2969,-32633,
                                  2741,-32653,2741,-32653,2741,-32653,2741,-32653,
                                  2513,-32671,2513,-32671,2513,-32671,2513,-32671,
                                  2285,-32688,2285,-32688,2285,-32688,2285,-32688,
                                  2057,-32703,2057,-32703,2057,-32703,2057,-32703,
                                  1829,-32716,1829,-32716,1829,-32716,1829,-32716,
                                  1600,-32728,1600,-32728,1600,-32728,1600,-32728,
                                  1372,-32739,1372,-32739,1372,-32739,1372,-32739,
                                  1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                  914,-32755,914,-32755,914,-32755,914,-32755,
                                  686,-32760,686,-32760,686,-32760,686,-32760,
                                  457,-32764,457,-32764,457,-32764,457,-32764,
                                  228,-32767,228,-32767,228,-32767,228,-32767,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -229,-32767,-229,-32767,-229,-32767,-229,-32767,
                                  -458,-32764,-458,-32764,-458,-32764,-458,-32764,
                                  -687,-32760,-687,-32760,-687,-32760,-687,-32760,
                                  -915,-32755,-915,-32755,-915,-32755,-915,-32755,
                                  -1144,-32748,-1144,-32748,-1144,-32748,-1144,-32748,
                                  -1373,-32739,-1373,-32739,-1373,-32739,-1373,-32739,
                                  -1601,-32728,-1601,-32728,-1601,-32728,-1601,-32728,
                                  -1830,-32716,-1830,-32716,-1830,-32716,-1830,-32716,
                                  -2058,-32703,-2058,-32703,-2058,-32703,-2058,-32703,
                                  -2286,-32688,-2286,-32688,-2286,-32688,-2286,-32688,
                                  -2514,-32671,-2514,-32671,-2514,-32671,-2514,-32671,
                                  -2742,-32653,-2742,-32653,-2742,-32653,-2742,-32653,
                                  -2970,-32633,-2970,-32633,-2970,-32633,-2970,-32633,
                                  -3198,-32611,-3198,-32611,-3198,-32611,-3198,-32611,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -3653,-32563,-3653,-32563,-3653,-32563,-3653,-32563,
                                  -3880,-32537,-3880,-32537,-3880,-32537,-3880,-32537,
                                  -4107,-32509,-4107,-32509,-4107,-32509,-4107,-32509,
                                  -4334,-32480,-4334,-32480,-4334,-32480,-4334,-32480,
                                  -4561,-32449,-4561,-32449,-4561,-32449,-4561,-32449,
                                  -4787,-32416,-4787,-32416,-4787,-32416,-4787,-32416,
                                  -5013,-32382,-5013,-32382,-5013,-32382,-5013,-32382,
                                  -5239,-32346,-5239,-32346,-5239,-32346,-5239,-32346,
                                  -5465,-32309,-5465,-32309,-5465,-32309,-5465,-32309,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -5916,-32229,-5916,-32229,-5916,-32229,-5916,-32229,
                                  -6140,-32187,-6140,-32187,-6140,-32187,-6140,-32187,
                                  -6365,-32143,-6365,-32143,-6365,-32143,-6365,-32143,
                                  -6589,-32098,-6589,-32098,-6589,-32098,-6589,-32098,
                                  -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                  -7037,-32003,-7037,-32003,-7037,-32003,-7037,-32003,
                                  -7260,-31953,-7260,-31953,-7260,-31953,-7260,-31953,
                                  -7483,-31902,-7483,-31902,-7483,-31902,-7483,-31902,
                                  -7705,-31849,-7705,-31849,-7705,-31849,-7705,-31849,
                                  -7928,-31794,-7928,-31794,-7928,-31794,-7928,-31794,
                                  -8149,-31738,-8149,-31738,-8149,-31738,-8149,-31738,
                                  -8371,-31680,-8371,-31680,-8371,-31680,-8371,-31680,
                                  -8592,-31621,-8592,-31621,-8592,-31621,-8592,-31621,
                                  -8812,-31560,-8812,-31560,-8812,-31560,-8812,-31560,
                                  -9032,-31498,-9032,-31498,-9032,-31498,-9032,-31498,
                                  -9252,-31434,-9252,-31434,-9252,-31434,-9252,-31434,
                                  -9471,-31369,-9471,-31369,-9471,-31369,-9471,-31369,
                                  -9690,-31302,-9690,-31302,-9690,-31302,-9690,-31302,
                                  -9908,-31234,-9908,-31234,-9908,-31234,-9908,-31234,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10343,-31092,-10343,-31092,-10343,-31092,-10343,-31092,
                                  -10560,-31019,-10560,-31019,-10560,-31019,-10560,-31019,
                                  -10776,-30945,-10776,-30945,-10776,-30945,-10776,-30945,
                                  -10992,-30869,-10992,-30869,-10992,-30869,-10992,-30869,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11422,-30712,-11422,-30712,-11422,-30712,-11422,-30712,
                                  -11636,-30632,-11636,-30632,-11636,-30632,-11636,-30632,
                                  -11850,-30550,-11850,-30550,-11850,-30550,-11850,-30550,
                                  -12063,-30466,-12063,-30466,-12063,-30466,-12063,-30466,
                                  -12275,-30382,-12275,-30382,-12275,-30382,-12275,-30382,
                                  -12487,-30295,-12487,-30295,-12487,-30295,-12487,-30295,
                                  -12698,-30207,-12698,-30207,-12698,-30207,-12698,-30207,
                                  -12909,-30118,-12909,-30118,-12909,-30118,-12909,-30118,
                                  -13119,-30027,-13119,-30027,-13119,-30027,-13119,-30027,
                                  -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                  -13537,-29841,-13537,-29841,-13537,-29841,-13537,-29841,
                                  -13745,-29746,-13745,-29746,-13745,-29746,-13745,-29746,
                                  -13952,-29649,-13952,-29649,-13952,-29649,-13952,-29649,
                                  -14159,-29551,-14159,-29551,-14159,-29551,-14159,-29551,
                                  -14365,-29451,-14365,-29451,-14365,-29451,-14365,-29451,
                                  -14570,-29350,-14570,-29350,-14570,-29350,-14570,-29350,
                                  -14774,-29248,-14774,-29248,-14774,-29248,-14774,-29248,
                                  -14978,-29144,-14978,-29144,-14978,-29144,-14978,-29144,
                                  -15181,-29039,-15181,-29039,-15181,-29039,-15181,-29039,
                                  -15384,-28932,-15384,-28932,-15384,-28932,-15384,-28932,
                                  -15585,-28824,-15585,-28824,-15585,-28824,-15585,-28824,
                                  -15786,-28714,-15786,-28714,-15786,-28714,-15786,-28714,
                                  -15986,-28604,-15986,-28604,-15986,-28604,-15986,-28604,
                                  -16185,-28491,-16185,-28491,-16185,-28491,-16185,-28491
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
11513
static int16_t twb900[299*2*4] = {32763,-458,32763,-458,32763,-458,32763,-458,
11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815
                                  32754,-915,32754,-915,32754,-915,32754,-915,
                                  32738,-1373,32738,-1373,32738,-1373,32738,-1373,
                                  32715,-1830,32715,-1830,32715,-1830,32715,-1830,
                                  32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                  32652,-2742,32652,-2742,32652,-2742,32652,-2742,
                                  32610,-3198,32610,-3198,32610,-3198,32610,-3198,
                                  32562,-3653,32562,-3653,32562,-3653,32562,-3653,
                                  32508,-4107,32508,-4107,32508,-4107,32508,-4107,
                                  32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                  32381,-5013,32381,-5013,32381,-5013,32381,-5013,
                                  32308,-5465,32308,-5465,32308,-5465,32308,-5465,
                                  32228,-5916,32228,-5916,32228,-5916,32228,-5916,
                                  32142,-6365,32142,-6365,32142,-6365,32142,-6365,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31952,-7260,31952,-7260,31952,-7260,31952,-7260,
                                  31848,-7705,31848,-7705,31848,-7705,31848,-7705,
                                  31737,-8149,31737,-8149,31737,-8149,31737,-8149,
                                  31620,-8592,31620,-8592,31620,-8592,31620,-8592,
                                  31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                  31368,-9471,31368,-9471,31368,-9471,31368,-9471,
                                  31233,-9908,31233,-9908,31233,-9908,31233,-9908,
                                  31091,-10343,31091,-10343,31091,-10343,31091,-10343,
                                  30944,-10776,30944,-10776,30944,-10776,30944,-10776,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30631,-11636,30631,-11636,30631,-11636,30631,-11636,
                                  30465,-12063,30465,-12063,30465,-12063,30465,-12063,
                                  30294,-12487,30294,-12487,30294,-12487,30294,-12487,
                                  30117,-12909,30117,-12909,30117,-12909,30117,-12909,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29745,-13745,29745,-13745,29745,-13745,29745,-13745,
                                  29550,-14159,29550,-14159,29550,-14159,29550,-14159,
                                  29349,-14570,29349,-14570,29349,-14570,29349,-14570,
                                  29143,-14978,29143,-14978,29143,-14978,29143,-14978,
                                  28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                  28713,-15786,28713,-15786,28713,-15786,28713,-15786,
                                  28490,-16185,28490,-16185,28490,-16185,28490,-16185,
                                  28261,-16582,28261,-16582,28261,-16582,28261,-16582,
                                  28027,-16975,28027,-16975,28027,-16975,28027,-16975,
                                  27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                  27542,-17751,27542,-17751,27542,-17751,27542,-17751,
                                  27292,-18133,27292,-18133,27292,-18133,27292,-18133,
                                  27036,-18513,27036,-18513,27036,-18513,27036,-18513,
                                  26775,-18888,26775,-18888,26775,-18888,26775,-18888,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26237,-19629,26237,-19629,26237,-19629,26237,-19629,
                                  25960,-19993,25960,-19993,25960,-19993,25960,-19993,
                                  25679,-20354,25679,-20354,25679,-20354,25679,-20354,
                                  25392,-20710,25392,-20710,25392,-20710,25392,-20710,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24804,-21411,24804,-21411,24804,-21411,24804,-21411,
                                  24503,-21755,24503,-21755,24503,-21755,24503,-21755,
                                  24196,-22095,24196,-22095,24196,-22095,24196,-22095,
                                  23886,-22431,23886,-22431,23886,-22431,23886,-22431,
                                  23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                  23250,-23089,23250,-23089,23250,-23089,23250,-23089,
                                  22925,-23412,22925,-23412,22925,-23412,22925,-23412,
                                  22596,-23729,22596,-23729,22596,-23729,22596,-23729,
                                  22263,-24043,22263,-24043,22263,-24043,22263,-24043,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21583,-24655,21583,-24655,21583,-24655,21583,-24655,
                                  21236,-24954,21236,-24954,21236,-24954,21236,-24954,
                                  20886,-25248,20886,-25248,20886,-25248,20886,-25248,
                                  20531,-25537,20531,-25537,20531,-25537,20531,-25537,
                                  20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                  19810,-26100,19810,-26100,19810,-26100,19810,-26100,
                                  19444,-26374,19444,-26374,19444,-26374,19444,-26374,
                                  19074,-26643,19074,-26643,19074,-26643,19074,-26643,
                                  18700,-26907,18700,-26907,18700,-26907,18700,-26907,
                                  18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                  17942,-27419,17942,-27419,17942,-27419,17942,-27419,
                                  17557,-27667,17557,-27667,17557,-27667,17557,-27667,
                                  17169,-27909,17169,-27909,17169,-27909,17169,-27909,
                                  16778,-28146,16778,-28146,16778,-28146,16778,-28146,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  15985,-28604,15985,-28604,15985,-28604,15985,-28604,
                                  15584,-28824,15584,-28824,15584,-28824,15584,-28824,
                                  15180,-29039,15180,-29039,15180,-29039,15180,-29039,
                                  14773,-29248,14773,-29248,14773,-29248,14773,-29248,
                                  14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                  13951,-29649,13951,-29649,13951,-29649,13951,-29649,
                                  13536,-29841,13536,-29841,13536,-29841,13536,-29841,
                                  13118,-30027,13118,-30027,13118,-30027,13118,-30027,
                                  12697,-30207,12697,-30207,12697,-30207,12697,-30207,
                                  12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                  11849,-30550,11849,-30550,11849,-30550,11849,-30550,
                                  11421,-30712,11421,-30712,11421,-30712,11421,-30712,
                                  10991,-30869,10991,-30869,10991,-30869,10991,-30869,
                                  10559,-31019,10559,-31019,10559,-31019,10559,-31019,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9689,-31302,9689,-31302,9689,-31302,9689,-31302,
                                  9251,-31434,9251,-31434,9251,-31434,9251,-31434,
                                  8811,-31560,8811,-31560,8811,-31560,8811,-31560,
                                  8370,-31680,8370,-31680,8370,-31680,8370,-31680,
                                  7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                  7482,-31902,7482,-31902,7482,-31902,7482,-31902,
                                  7036,-32003,7036,-32003,7036,-32003,7036,-32003,
                                  6588,-32098,6588,-32098,6588,-32098,6588,-32098,
                                  6139,-32187,6139,-32187,6139,-32187,6139,-32187,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5238,-32346,5238,-32346,5238,-32346,5238,-32346,
                                  4786,-32416,4786,-32416,4786,-32416,4786,-32416,
                                  4333,-32480,4333,-32480,4333,-32480,4333,-32480,
                                  3879,-32537,3879,-32537,3879,-32537,3879,-32537,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  2969,-32633,2969,-32633,2969,-32633,2969,-32633,
                                  2513,-32671,2513,-32671,2513,-32671,2513,-32671,
                                  2057,-32703,2057,-32703,2057,-32703,2057,-32703,
                                  1600,-32728,1600,-32728,1600,-32728,1600,-32728,
                                  1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                  686,-32760,686,-32760,686,-32760,686,-32760,
                                  228,-32767,228,-32767,228,-32767,228,-32767,
                                  -229,-32767,-229,-32767,-229,-32767,-229,-32767,
                                  -687,-32760,-687,-32760,-687,-32760,-687,-32760,
                                  -1144,-32748,-1144,-32748,-1144,-32748,-1144,-32748,
                                  -1601,-32728,-1601,-32728,-1601,-32728,-1601,-32728,
                                  -2058,-32703,-2058,-32703,-2058,-32703,-2058,-32703,
                                  -2514,-32671,-2514,-32671,-2514,-32671,-2514,-32671,
                                  -2970,-32633,-2970,-32633,-2970,-32633,-2970,-32633,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -3880,-32537,-3880,-32537,-3880,-32537,-3880,-32537,
                                  -4334,-32480,-4334,-32480,-4334,-32480,-4334,-32480,
                                  -4787,-32416,-4787,-32416,-4787,-32416,-4787,-32416,
                                  -5239,-32346,-5239,-32346,-5239,-32346,-5239,-32346,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6140,-32187,-6140,-32187,-6140,-32187,-6140,-32187,
                                  -6589,-32098,-6589,-32098,-6589,-32098,-6589,-32098,
                                  -7037,-32003,-7037,-32003,-7037,-32003,-7037,-32003,
                                  -7483,-31902,-7483,-31902,-7483,-31902,-7483,-31902,
                                  -7928,-31794,-7928,-31794,-7928,-31794,-7928,-31794,
                                  -8371,-31680,-8371,-31680,-8371,-31680,-8371,-31680,
                                  -8812,-31560,-8812,-31560,-8812,-31560,-8812,-31560,
                                  -9252,-31434,-9252,-31434,-9252,-31434,-9252,-31434,
                                  -9690,-31302,-9690,-31302,-9690,-31302,-9690,-31302,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10560,-31019,-10560,-31019,-10560,-31019,-10560,-31019,
                                  -10992,-30869,-10992,-30869,-10992,-30869,-10992,-30869,
                                  -11422,-30712,-11422,-30712,-11422,-30712,-11422,-30712,
                                  -11850,-30550,-11850,-30550,-11850,-30550,-11850,-30550,
                                  -12275,-30382,-12275,-30382,-12275,-30382,-12275,-30382,
                                  -12698,-30207,-12698,-30207,-12698,-30207,-12698,-30207,
                                  -13119,-30027,-13119,-30027,-13119,-30027,-13119,-30027,
                                  -13537,-29841,-13537,-29841,-13537,-29841,-13537,-29841,
                                  -13952,-29649,-13952,-29649,-13952,-29649,-13952,-29649,
                                  -14365,-29451,-14365,-29451,-14365,-29451,-14365,-29451,
                                  -14774,-29248,-14774,-29248,-14774,-29248,-14774,-29248,
                                  -15181,-29039,-15181,-29039,-15181,-29039,-15181,-29039,
                                  -15585,-28824,-15585,-28824,-15585,-28824,-15585,-28824,
                                  -15986,-28604,-15986,-28604,-15986,-28604,-15986,-28604,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -16779,-28146,-16779,-28146,-16779,-28146,-16779,-28146,
                                  -17170,-27909,-17170,-27909,-17170,-27909,-17170,-27909,
                                  -17558,-27667,-17558,-27667,-17558,-27667,-17558,-27667,
                                  -17943,-27419,-17943,-27419,-17943,-27419,-17943,-27419,
                                  -18324,-27166,-18324,-27166,-18324,-27166,-18324,-27166,
                                  -18701,-26907,-18701,-26907,-18701,-26907,-18701,-26907,
                                  -19075,-26643,-19075,-26643,-19075,-26643,-19075,-26643,
                                  -19445,-26374,-19445,-26374,-19445,-26374,-19445,-26374,
                                  -19811,-26100,-19811,-26100,-19811,-26100,-19811,-26100,
                                  -20174,-25821,-20174,-25821,-20174,-25821,-20174,-25821,
                                  -20532,-25537,-20532,-25537,-20532,-25537,-20532,-25537,
                                  -20887,-25248,-20887,-25248,-20887,-25248,-20887,-25248,
                                  -21237,-24954,-21237,-24954,-21237,-24954,-21237,-24954,
                                  -21584,-24655,-21584,-24655,-21584,-24655,-21584,-24655,
                                  -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                                  -22264,-24043,-22264,-24043,-22264,-24043,-22264,-24043,
                                  -22597,-23729,-22597,-23729,-22597,-23729,-22597,-23729,
                                  -22926,-23412,-22926,-23412,-22926,-23412,-22926,-23412,
                                  -23251,-23089,-23251,-23089,-23251,-23089,-23251,-23089,
                                  -23571,-22762,-23571,-22762,-23571,-22762,-23571,-22762,
                                  -23887,-22431,-23887,-22431,-23887,-22431,-23887,-22431,
                                  -24197,-22095,-24197,-22095,-24197,-22095,-24197,-22095,
                                  -24504,-21755,-24504,-21755,-24504,-21755,-24504,-21755,
                                  -24805,-21411,-24805,-21411,-24805,-21411,-24805,-21411,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25393,-20710,-25393,-20710,-25393,-20710,-25393,-20710,
                                  -25680,-20354,-25680,-20354,-25680,-20354,-25680,-20354,
                                  -25961,-19993,-25961,-19993,-25961,-19993,-25961,-19993,
                                  -26238,-19629,-26238,-19629,-26238,-19629,-26238,-19629,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -26776,-18888,-26776,-18888,-26776,-18888,-26776,-18888,
                                  -27037,-18513,-27037,-18513,-27037,-18513,-27037,-18513,
                                  -27293,-18133,-27293,-18133,-27293,-18133,-27293,-18133,
                                  -27543,-17751,-27543,-17751,-27543,-17751,-27543,-17751,
                                  -27788,-17364,-27788,-17364,-27788,-17364,-27788,-17364,
                                  -28028,-16975,-28028,-16975,-28028,-16975,-28028,-16975,
                                  -28262,-16582,-28262,-16582,-28262,-16582,-28262,-16582,
                                  -28491,-16185,-28491,-16185,-28491,-16185,-28491,-16185,
                                  -28714,-15786,-28714,-15786,-28714,-15786,-28714,-15786,
                                  -28932,-15384,-28932,-15384,-28932,-15384,-28932,-15384,
                                  -29144,-14978,-29144,-14978,-29144,-14978,-29144,-14978,
                                  -29350,-14570,-29350,-14570,-29350,-14570,-29350,-14570,
                                  -29551,-14159,-29551,-14159,-29551,-14159,-29551,-14159,
                                  -29746,-13745,-29746,-13745,-29746,-13745,-29746,-13745,
                                  -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                                  -30118,-12909,-30118,-12909,-30118,-12909,-30118,-12909,
                                  -30295,-12487,-30295,-12487,-30295,-12487,-30295,-12487,
                                  -30466,-12063,-30466,-12063,-30466,-12063,-30466,-12063,
                                  -30632,-11636,-30632,-11636,-30632,-11636,-30632,-11636,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -30945,-10776,-30945,-10776,-30945,-10776,-30945,-10776,
                                  -31092,-10343,-31092,-10343,-31092,-10343,-31092,-10343,
                                  -31234,-9908,-31234,-9908,-31234,-9908,-31234,-9908,
                                  -31369,-9471,-31369,-9471,-31369,-9471,-31369,-9471,
                                  -31498,-9032,-31498,-9032,-31498,-9032,-31498,-9032,
                                  -31621,-8592,-31621,-8592,-31621,-8592,-31621,-8592,
                                  -31738,-8149,-31738,-8149,-31738,-8149,-31738,-8149,
                                  -31849,-7705,-31849,-7705,-31849,-7705,-31849,-7705,
                                  -31953,-7260,-31953,-7260,-31953,-7260,-31953,-7260,
                                  -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                                  -32143,-6365,-32143,-6365,-32143,-6365,-32143,-6365,
                                  -32229,-5916,-32229,-5916,-32229,-5916,-32229,-5916,
                                  -32309,-5465,-32309,-5465,-32309,-5465,-32309,-5465,
                                  -32382,-5013,-32382,-5013,-32382,-5013,-32382,-5013,
                                  -32449,-4561,-32449,-4561,-32449,-4561,-32449,-4561,
                                  -32509,-4107,-32509,-4107,-32509,-4107,-32509,-4107,
                                  -32563,-3653,-32563,-3653,-32563,-3653,-32563,-3653,
                                  -32611,-3198,-32611,-3198,-32611,-3198,-32611,-3198,
                                  -32653,-2742,-32653,-2742,-32653,-2742,-32653,-2742,
                                  -32688,-2286,-32688,-2286,-32688,-2286,-32688,-2286,
                                  -32716,-1830,-32716,-1830,-32716,-1830,-32716,-1830,
                                  -32739,-1373,-32739,-1373,-32739,-1373,-32739,-1373,
                                  -32755,-915,-32755,-915,-32755,-915,-32755,-915,
                                  -32764,-458,-32764,-458,-32764,-458,-32764,-458,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32764,457,-32764,457,-32764,457,-32764,457,
                                  -32755,914,-32755,914,-32755,914,-32755,914,
                                  -32739,1372,-32739,1372,-32739,1372,-32739,1372,
                                  -32716,1829,-32716,1829,-32716,1829,-32716,1829,
                                  -32688,2285,-32688,2285,-32688,2285,-32688,2285,
                                  -32653,2741,-32653,2741,-32653,2741,-32653,2741,
                                  -32611,3197,-32611,3197,-32611,3197,-32611,3197,
                                  -32563,3652,-32563,3652,-32563,3652,-32563,3652,
                                  -32509,4106,-32509,4106,-32509,4106,-32509,4106,
                                  -32449,4560,-32449,4560,-32449,4560,-32449,4560,
                                  -32382,5012,-32382,5012,-32382,5012,-32382,5012,
                                  -32309,5464,-32309,5464,-32309,5464,-32309,5464,
                                  -32229,5915,-32229,5915,-32229,5915,-32229,5915,
                                  -32143,6364,-32143,6364,-32143,6364,-32143,6364,
                                  -32051,6812,-32051,6812,-32051,6812,-32051,6812,
                                  -31953,7259,-31953,7259,-31953,7259,-31953,7259,
                                  -31849,7704,-31849,7704,-31849,7704,-31849,7704,
                                  -31738,8148,-31738,8148,-31738,8148,-31738,8148,
                                  -31621,8591,-31621,8591,-31621,8591,-31621,8591,
                                  -31498,9031,-31498,9031,-31498,9031,-31498,9031,
                                  -31369,9470,-31369,9470,-31369,9470,-31369,9470,
                                  -31234,9907,-31234,9907,-31234,9907,-31234,9907,
                                  -31092,10342,-31092,10342,-31092,10342,-31092,10342,
                                  -30945,10775,-30945,10775,-30945,10775,-30945,10775,
                                  -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                  -30632,11635,-30632,11635,-30632,11635,-30632,11635,
                                  -30466,12062,-30466,12062,-30466,12062,-30466,12062,
                                  -30295,12486,-30295,12486,-30295,12486,-30295,12486,
                                  -30118,12908,-30118,12908,-30118,12908,-30118,12908,
                                  -29935,13327,-29935,13327,-29935,13327,-29935,13327,
                                  -29746,13744,-29746,13744,-29746,13744,-29746,13744,
                                  -29551,14158,-29551,14158,-29551,14158,-29551,14158,
                                  -29350,14569,-29350,14569,-29350,14569,-29350,14569,
                                  -29144,14977,-29144,14977,-29144,14977,-29144,14977,
                                  -28932,15383,-28932,15383,-28932,15383,-28932,15383,
                                  -28714,15785,-28714,15785,-28714,15785,-28714,15785,
                                  -28491,16184,-28491,16184,-28491,16184,-28491,16184,
                                  -28262,16581,-28262,16581,-28262,16581,-28262,16581,
                                  -28028,16974,-28028,16974,-28028,16974,-28028,16974,
                                  -27788,17363,-27788,17363,-27788,17363,-27788,17363,
                                  -27543,17750,-27543,17750,-27543,17750,-27543,17750,
                                  -27293,18132,-27293,18132,-27293,18132,-27293,18132,
                                  -27037,18512,-27037,18512,-27037,18512,-27037,18512,
                                  -26776,18887,-26776,18887,-26776,18887,-26776,18887,
                                  -26510,19259,-26510,19259,-26510,19259,-26510,19259,
                                  -26238,19628,-26238,19628,-26238,19628,-26238,19628,
                                  -25961,19992,-25961,19992,-25961,19992,-25961,19992,
                                  -25680,20353,-25680,20353,-25680,20353,-25680,20353,
                                  -25393,20709,-25393,20709,-25393,20709,-25393,20709,
                                  -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                  -24805,21410,-24805,21410,-24805,21410,-24805,21410,
                                  -24504,21754,-24504,21754,-24504,21754,-24504,21754,
                                  -24197,22094,-24197,22094,-24197,22094,-24197,22094,
                                  -23887,22430,-23887,22430,-23887,22430,-23887,22430,
                                  -23571,22761,-23571,22761,-23571,22761,-23571,22761,
                                  -23251,23088,-23251,23088,-23251,23088,-23251,23088,
                                  -22926,23411,-22926,23411,-22926,23411,-22926,23411,
                                  -22597,23728,-22597,23728,-22597,23728,-22597,23728,
                                  -22264,24042,-22264,24042,-22264,24042,-22264,24042,
                                  -21926,24350,-21926,24350,-21926,24350,-21926,24350,
                                  -21584,24654,-21584,24654,-21584,24654,-21584,24654,
                                  -21237,24953,-21237,24953,-21237,24953,-21237,24953,
                                  -20887,25247,-20887,25247,-20887,25247,-20887,25247,
                                  -20532,25536,-20532,25536,-20532,25536,-20532,25536,
                                  -20174,25820,-20174,25820,-20174,25820,-20174,25820,
                                  -19811,26099,-19811,26099,-19811,26099,-19811,26099,
                                  -19445,26373,-19445,26373,-19445,26373,-19445,26373,
                                  -19075,26642,-19075,26642,-19075,26642,-19075,26642,
                                  -18701,26906,-18701,26906,-18701,26906,-18701,26906,
                                  -18324,27165,-18324,27165,-18324,27165,-18324,27165,
                                  -17943,27418,-17943,27418,-17943,27418,-17943,27418,
                                  -17558,27666,-17558,27666,-17558,27666,-17558,27666,
                                  -17170,27908,-17170,27908,-17170,27908,-17170,27908,
                                  -16779,28145,-16779,28145,-16779,28145,-16779,28145
                                 };

void dft900(int16_t *x,int16_t *y,unsigned char scale_flag)  // 300 x 3
{
Raymond Knopp's avatar
 
Raymond Knopp committed
11816
  int i,j;
11817 11818 11819 11820 11821 11822
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa900[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb900[0];
  simd_q15_t x2128[900];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[900];//=&ytmp128array3[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
11823 11824 11825



11826
  for (i=0,j=0; i<300; i++,j+=3) {
Raymond Knopp's avatar
 
Raymond Knopp committed
11827 11828 11829 11830 11831 11832 11833 11834 11835 11836
    x2128[i]    = x128[j];
    x2128[i+300] = x128[j+1];
    x2128[i+600] = x128[j+2];
  }

  dft300((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft300((int16_t *)(x2128+300),(int16_t *)(ytmp128+300),1);
  dft300((int16_t *)(x2128+600),(int16_t *)(ytmp128+600),1);

  bfly3_tw1(ytmp128,ytmp128+300,ytmp128+600,y128,y128+300,y128+600);
11837 11838

  for (i=1,j=0; i<300; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
11839
    bfly3(ytmp128+i,
11840 11841 11842 11843 11844 11845 11846
          ytmp128+300+i,
          ytmp128+600+i,
          y128+i,
          y128+300+i,
          y128+600+i,
          twa128+j,
          twb128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
11847 11848 11849
  }

  if (scale_flag==1) {
11850
    norm128 = set1_int16(dft_norm_table[14]);
11851 11852

    for (i=0; i<900; i++) {
11853
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897
    }
  }

  _mm_empty();
  _m_empty();

};


/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:239)/960));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:239)/960));
twc = floor(32767*exp(-sqrt(-1)*2*pi*3*(1:239)/960));
twa2 = zeros(1,2*239);
twb2 = zeros(1,2*239);
twc2 = zeros(1,2*239);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
twc2(1:2:end) = real(twc);
twc2(2:2:end) = imag(twc);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa960[239*2*4] = {");
for i=1:2:(2*238)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"\nstatic int16_t twb960[239*2*4] = {");
for i=1:2:(2*238)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fprintf(fd,"\nstatic int16_t twc960[239*2*4] = {");
for i=1:2:(2*238)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
fclose(fd);
*/
static int16_t twa960[239*2*4] = {32766,-215,32766,-215,32766,-215,32766,-215,
11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136
                                  32764,-429,32764,-429,32764,-429,32764,-429,
                                  32760,-644,32760,-644,32760,-644,32760,-644,
                                  32755,-858,32755,-858,32755,-858,32755,-858,
                                  32749,-1073,32749,-1073,32749,-1073,32749,-1073,
                                  32741,-1287,32741,-1287,32741,-1287,32741,-1287,
                                  32732,-1501,32732,-1501,32732,-1501,32732,-1501,
                                  32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                  32710,-1930,32710,-1930,32710,-1930,32710,-1930,
                                  32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                  32682,-2358,32682,-2358,32682,-2358,32682,-2358,
                                  32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                                  32648,-2785,32648,-2785,32648,-2785,32648,-2785,
                                  32629,-2999,32629,-2999,32629,-2999,32629,-2999,
                                  32609,-3212,32609,-3212,32609,-3212,32609,-3212,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32564,-3639,32564,-3639,32564,-3639,32564,-3639,
                                  32539,-3852,32539,-3852,32539,-3852,32539,-3852,
                                  32513,-4065,32513,-4065,32513,-4065,32513,-4065,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32457,-4490,32457,-4490,32457,-4490,32457,-4490,
                                  32427,-4702,32427,-4702,32427,-4702,32427,-4702,
                                  32396,-4914,32396,-4914,32396,-4914,32396,-4914,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32329,-5338,32329,-5338,32329,-5338,32329,-5338,
                                  32293,-5550,32293,-5550,32293,-5550,32293,-5550,
                                  32256,-5761,32256,-5761,32256,-5761,32256,-5761,
                                  32218,-5972,32218,-5972,32218,-5972,32218,-5972,
                                  32178,-6183,32178,-6183,32178,-6183,32178,-6183,
                                  32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                  32094,-6603,32094,-6603,32094,-6603,32094,-6603,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  32005,-7023,32005,-7023,32005,-7023,32005,-7023,
                                  31959,-7232,31959,-7232,31959,-7232,31959,-7232,
                                  31911,-7441,31911,-7441,31911,-7441,31911,-7441,
                                  31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                                  31810,-7858,31810,-7858,31810,-7858,31810,-7858,
                                  31758,-8066,31758,-8066,31758,-8066,31758,-8066,
                                  31705,-8274,31705,-8274,31705,-8274,31705,-8274,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31594,-8688,31594,-8688,31594,-8688,31594,-8688,
                                  31536,-8895,31536,-8895,31536,-8895,31536,-8895,
                                  31477,-9101,31477,-9101,31477,-9101,31477,-9101,
                                  31417,-9307,31417,-9307,31417,-9307,31417,-9307,
                                  31356,-9512,31356,-9512,31356,-9512,31356,-9512,
                                  31293,-9717,31293,-9717,31293,-9717,31293,-9717,
                                  31228,-9922,31228,-9922,31228,-9922,31228,-9922,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  31096,-10330,31096,-10330,31096,-10330,31096,-10330,
                                  31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                  30958,-10736,30958,-10736,30958,-10736,30958,-10736,
                                  30887,-10938,30887,-10938,30887,-10938,30887,-10938,
                                  30815,-11140,30815,-11140,30815,-11140,30815,-11140,
                                  30741,-11342,30741,-11342,30741,-11342,30741,-11342,
                                  30666,-11543,30666,-11543,30666,-11543,30666,-11543,
                                  30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                  30513,-11943,30513,-11943,30513,-11943,30513,-11943,
                                  30434,-12143,30434,-12143,30434,-12143,30434,-12143,
                                  30354,-12341,30354,-12341,30354,-12341,30354,-12341,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  30190,-12738,30190,-12738,30190,-12738,30190,-12738,
                                  30106,-12935,30106,-12935,30106,-12935,30106,-12935,
                                  30020,-13132,30020,-13132,30020,-13132,30020,-13132,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29846,-13524,29846,-13524,29846,-13524,29846,-13524,
                                  29757,-13719,29757,-13719,29757,-13719,29757,-13719,
                                  29666,-13913,29666,-13913,29666,-13913,29666,-13913,
                                  29575,-14107,29575,-14107,29575,-14107,29575,-14107,
                                  29482,-14300,29482,-14300,29482,-14300,29482,-14300,
                                  29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                  29292,-14685,29292,-14685,29292,-14685,29292,-14685,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  29097,-15067,29097,-15067,29097,-15067,29097,-15067,
                                  28998,-15257,28998,-15257,28998,-15257,28998,-15257,
                                  28897,-15447,28897,-15447,28897,-15447,28897,-15447,
                                  28796,-15636,28796,-15636,28796,-15636,28796,-15636,
                                  28693,-15824,28693,-15824,28693,-15824,28693,-15824,
                                  28589,-16011,28589,-16011,28589,-16011,28589,-16011,
                                  28483,-16198,28483,-16198,28483,-16198,28483,-16198,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28269,-16569,28269,-16569,28269,-16569,28269,-16569,
                                  28160,-16754,28160,-16754,28160,-16754,28160,-16754,
                                  28049,-16938,28049,-16938,28049,-16938,28049,-16938,
                                  27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                                  27825,-17304,27825,-17304,27825,-17304,27825,-17304,
                                  27711,-17485,27711,-17485,27711,-17485,27711,-17485,
                                  27596,-17666,27596,-17666,27596,-17666,27596,-17666,
                                  27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                  27363,-18026,27363,-18026,27363,-18026,27363,-18026,
                                  27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                  27125,-18383,27125,-18383,27125,-18383,27125,-18383,
                                  27004,-18560,27004,-18560,27004,-18560,27004,-18560,
                                  26882,-18736,26882,-18736,26882,-18736,26882,-18736,
                                  26758,-18912,26758,-18912,26758,-18912,26758,-18912,
                                  26634,-19087,26634,-19087,26634,-19087,26634,-19087,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26382,-19434,26382,-19434,26382,-19434,26382,-19434,
                                  26254,-19606,26254,-19606,26254,-19606,26254,-19606,
                                  26125,-19777,26125,-19777,26125,-19777,26125,-19777,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25864,-20117,25864,-20117,25864,-20117,25864,-20117,
                                  25732,-20286,25732,-20286,25732,-20286,25732,-20286,
                                  25599,-20454,25599,-20454,25599,-20454,25599,-20454,
                                  25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                  25329,-20788,25329,-20788,25329,-20788,25329,-20788,
                                  25192,-20953,25192,-20953,25192,-20953,25192,-20953,
                                  25054,-21117,25054,-21117,25054,-21117,25054,-21117,
                                  24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                                  24776,-21444,24776,-21444,24776,-21444,24776,-21444,
                                  24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                  24493,-21766,24493,-21766,24493,-21766,24493,-21766,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  24206,-22085,24206,-22085,24206,-22085,24206,-22085,
                                  24061,-22243,24061,-22243,24061,-22243,24061,-22243,
                                  23915,-22400,23915,-22400,23915,-22400,23915,-22400,
                                  23768,-22556,23768,-22556,23768,-22556,23768,-22556,
                                  23620,-22711,23620,-22711,23620,-22711,23620,-22711,
                                  23471,-22865,23471,-22865,23471,-22865,23471,-22865,
                                  23320,-23018,23320,-23018,23320,-23018,23320,-23018,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  23017,-23321,23017,-23321,23017,-23321,23017,-23321,
                                  22864,-23472,22864,-23472,22864,-23472,22864,-23472,
                                  22710,-23621,22710,-23621,22710,-23621,22710,-23621,
                                  22555,-23769,22555,-23769,22555,-23769,22555,-23769,
                                  22399,-23916,22399,-23916,22399,-23916,22399,-23916,
                                  22242,-24062,22242,-24062,22242,-24062,22242,-24062,
                                  22084,-24207,22084,-24207,22084,-24207,22084,-24207,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21765,-24494,21765,-24494,21765,-24494,21765,-24494,
                                  21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                  21443,-24777,21443,-24777,21443,-24777,21443,-24777,
                                  21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                                  21116,-25055,21116,-25055,21116,-25055,21116,-25055,
                                  20952,-25193,20952,-25193,20952,-25193,20952,-25193,
                                  20787,-25330,20787,-25330,20787,-25330,20787,-25330,
                                  20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                  20453,-25600,20453,-25600,20453,-25600,20453,-25600,
                                  20285,-25733,20285,-25733,20285,-25733,20285,-25733,
                                  20116,-25865,20116,-25865,20116,-25865,20116,-25865,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19776,-26126,19776,-26126,19776,-26126,19776,-26126,
                                  19605,-26255,19605,-26255,19605,-26255,19605,-26255,
                                  19433,-26383,19433,-26383,19433,-26383,19433,-26383,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  19086,-26635,19086,-26635,19086,-26635,19086,-26635,
                                  18911,-26759,18911,-26759,18911,-26759,18911,-26759,
                                  18735,-26883,18735,-26883,18735,-26883,18735,-26883,
                                  18559,-27005,18559,-27005,18559,-27005,18559,-27005,
                                  18382,-27126,18382,-27126,18382,-27126,18382,-27126,
                                  18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                  18025,-27364,18025,-27364,18025,-27364,18025,-27364,
                                  17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                  17665,-27597,17665,-27597,17665,-27597,17665,-27597,
                                  17484,-27712,17484,-27712,17484,-27712,17484,-27712,
                                  17303,-27826,17303,-27826,17303,-27826,17303,-27826,
                                  17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                                  16937,-28050,16937,-28050,16937,-28050,16937,-28050,
                                  16753,-28161,16753,-28161,16753,-28161,16753,-28161,
                                  16568,-28270,16568,-28270,16568,-28270,16568,-28270,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16197,-28484,16197,-28484,16197,-28484,16197,-28484,
                                  16010,-28590,16010,-28590,16010,-28590,16010,-28590,
                                  15823,-28694,15823,-28694,15823,-28694,15823,-28694,
                                  15635,-28797,15635,-28797,15635,-28797,15635,-28797,
                                  15446,-28898,15446,-28898,15446,-28898,15446,-28898,
                                  15256,-28999,15256,-28999,15256,-28999,15256,-28999,
                                  15066,-29098,15066,-29098,15066,-29098,15066,-29098,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14684,-29293,14684,-29293,14684,-29293,14684,-29293,
                                  14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                  14299,-29483,14299,-29483,14299,-29483,14299,-29483,
                                  14106,-29576,14106,-29576,14106,-29576,14106,-29576,
                                  13912,-29667,13912,-29667,13912,-29667,13912,-29667,
                                  13718,-29758,13718,-29758,13718,-29758,13718,-29758,
                                  13523,-29847,13523,-29847,13523,-29847,13523,-29847,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  13131,-30021,13131,-30021,13131,-30021,13131,-30021,
                                  12934,-30107,12934,-30107,12934,-30107,12934,-30107,
                                  12737,-30191,12737,-30191,12737,-30191,12737,-30191,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  12340,-30355,12340,-30355,12340,-30355,12340,-30355,
                                  12142,-30435,12142,-30435,12142,-30435,12142,-30435,
                                  11942,-30514,11942,-30514,11942,-30514,11942,-30514,
                                  11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                  11542,-30667,11542,-30667,11542,-30667,11542,-30667,
                                  11341,-30742,11341,-30742,11341,-30742,11341,-30742,
                                  11139,-30816,11139,-30816,11139,-30816,11139,-30816,
                                  10937,-30888,10937,-30888,10937,-30888,10937,-30888,
                                  10735,-30959,10735,-30959,10735,-30959,10735,-30959,
                                  10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                  10329,-31097,10329,-31097,10329,-31097,10329,-31097,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9921,-31229,9921,-31229,9921,-31229,9921,-31229,
                                  9716,-31294,9716,-31294,9716,-31294,9716,-31294,
                                  9511,-31357,9511,-31357,9511,-31357,9511,-31357,
                                  9306,-31418,9306,-31418,9306,-31418,9306,-31418,
                                  9100,-31478,9100,-31478,9100,-31478,9100,-31478,
                                  8894,-31537,8894,-31537,8894,-31537,8894,-31537,
                                  8687,-31595,8687,-31595,8687,-31595,8687,-31595,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8273,-31706,8273,-31706,8273,-31706,8273,-31706,
                                  8065,-31759,8065,-31759,8065,-31759,8065,-31759,
                                  7857,-31811,7857,-31811,7857,-31811,7857,-31811,
                                  7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                                  7440,-31912,7440,-31912,7440,-31912,7440,-31912,
                                  7231,-31960,7231,-31960,7231,-31960,7231,-31960,
                                  7022,-32006,7022,-32006,7022,-32006,7022,-32006,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  6602,-32095,6602,-32095,6602,-32095,6602,-32095,
                                  6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                  6182,-32179,6182,-32179,6182,-32179,6182,-32179,
                                  5971,-32219,5971,-32219,5971,-32219,5971,-32219,
                                  5760,-32257,5760,-32257,5760,-32257,5760,-32257,
                                  5549,-32294,5549,-32294,5549,-32294,5549,-32294,
                                  5337,-32330,5337,-32330,5337,-32330,5337,-32330,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4913,-32397,4913,-32397,4913,-32397,4913,-32397,
                                  4701,-32428,4701,-32428,4701,-32428,4701,-32428,
                                  4489,-32458,4489,-32458,4489,-32458,4489,-32458,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  4064,-32514,4064,-32514,4064,-32514,4064,-32514,
                                  3851,-32540,3851,-32540,3851,-32540,3851,-32540,
                                  3638,-32565,3638,-32565,3638,-32565,3638,-32565,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  3211,-32610,3211,-32610,3211,-32610,3211,-32610,
                                  2998,-32630,2998,-32630,2998,-32630,2998,-32630,
                                  2784,-32649,2784,-32649,2784,-32649,2784,-32649,
                                  2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                                  2357,-32683,2357,-32683,2357,-32683,2357,-32683,
                                  2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                  1929,-32711,1929,-32711,1929,-32711,1929,-32711,
                                  1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                  1500,-32733,1500,-32733,1500,-32733,1500,-32733,
                                  1286,-32742,1286,-32742,1286,-32742,1286,-32742,
                                  1072,-32750,1072,-32750,1072,-32750,1072,-32750,
                                  857,-32756,857,-32756,857,-32756,857,-32756,
                                  643,-32761,643,-32761,643,-32761,643,-32761,
                                  428,-32765,428,-32765,428,-32765,428,-32765,
                                  214,-32767,214,-32767,214,-32767,214,-32767
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
12137 12138

static int16_t twb960[239*2*4] = {32764,-429,32764,-429,32764,-429,32764,-429,
12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377
                                  32755,-858,32755,-858,32755,-858,32755,-858,
                                  32741,-1287,32741,-1287,32741,-1287,32741,-1287,
                                  32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                  32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                  32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                                  32629,-2999,32629,-2999,32629,-2999,32629,-2999,
                                  32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                  32539,-3852,32539,-3852,32539,-3852,32539,-3852,
                                  32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                  32427,-4702,32427,-4702,32427,-4702,32427,-4702,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32293,-5550,32293,-5550,32293,-5550,32293,-5550,
                                  32218,-5972,32218,-5972,32218,-5972,32218,-5972,
                                  32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                  32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                  31959,-7232,31959,-7232,31959,-7232,31959,-7232,
                                  31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                                  31758,-8066,31758,-8066,31758,-8066,31758,-8066,
                                  31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                  31536,-8895,31536,-8895,31536,-8895,31536,-8895,
                                  31417,-9307,31417,-9307,31417,-9307,31417,-9307,
                                  31293,-9717,31293,-9717,31293,-9717,31293,-9717,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                  30887,-10938,30887,-10938,30887,-10938,30887,-10938,
                                  30741,-11342,30741,-11342,30741,-11342,30741,-11342,
                                  30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                  30434,-12143,30434,-12143,30434,-12143,30434,-12143,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  30106,-12935,30106,-12935,30106,-12935,30106,-12935,
                                  29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                  29757,-13719,29757,-13719,29757,-13719,29757,-13719,
                                  29575,-14107,29575,-14107,29575,-14107,29575,-14107,
                                  29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  28998,-15257,28998,-15257,28998,-15257,28998,-15257,
                                  28796,-15636,28796,-15636,28796,-15636,28796,-15636,
                                  28589,-16011,28589,-16011,28589,-16011,28589,-16011,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28160,-16754,28160,-16754,28160,-16754,28160,-16754,
                                  27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                                  27711,-17485,27711,-17485,27711,-17485,27711,-17485,
                                  27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                  27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                  27004,-18560,27004,-18560,27004,-18560,27004,-18560,
                                  26758,-18912,26758,-18912,26758,-18912,26758,-18912,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26254,-19606,26254,-19606,26254,-19606,26254,-19606,
                                  25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                  25732,-20286,25732,-20286,25732,-20286,25732,-20286,
                                  25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                  25192,-20953,25192,-20953,25192,-20953,25192,-20953,
                                  24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                                  24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                  24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                  24061,-22243,24061,-22243,24061,-22243,24061,-22243,
                                  23768,-22556,23768,-22556,23768,-22556,23768,-22556,
                                  23471,-22865,23471,-22865,23471,-22865,23471,-22865,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22864,-23472,22864,-23472,22864,-23472,22864,-23472,
                                  22555,-23769,22555,-23769,22555,-23769,22555,-23769,
                                  22242,-24062,22242,-24062,22242,-24062,22242,-24062,
                                  21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                  21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                  21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                                  20952,-25193,20952,-25193,20952,-25193,20952,-25193,
                                  20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                  20285,-25733,20285,-25733,20285,-25733,20285,-25733,
                                  19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                  19605,-26255,19605,-26255,19605,-26255,19605,-26255,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18911,-26759,18911,-26759,18911,-26759,18911,-26759,
                                  18559,-27005,18559,-27005,18559,-27005,18559,-27005,
                                  18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                  17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                  17484,-27712,17484,-27712,17484,-27712,17484,-27712,
                                  17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                                  16753,-28161,16753,-28161,16753,-28161,16753,-28161,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16010,-28590,16010,-28590,16010,-28590,16010,-28590,
                                  15635,-28797,15635,-28797,15635,-28797,15635,-28797,
                                  15256,-28999,15256,-28999,15256,-28999,15256,-28999,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                  14106,-29576,14106,-29576,14106,-29576,14106,-29576,
                                  13718,-29758,13718,-29758,13718,-29758,13718,-29758,
                                  13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                  12934,-30107,12934,-30107,12934,-30107,12934,-30107,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  12142,-30435,12142,-30435,12142,-30435,12142,-30435,
                                  11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                  11341,-30742,11341,-30742,11341,-30742,11341,-30742,
                                  10937,-30888,10937,-30888,10937,-30888,10937,-30888,
                                  10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9716,-31294,9716,-31294,9716,-31294,9716,-31294,
                                  9306,-31418,9306,-31418,9306,-31418,9306,-31418,
                                  8894,-31537,8894,-31537,8894,-31537,8894,-31537,
                                  8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                  8065,-31759,8065,-31759,8065,-31759,8065,-31759,
                                  7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                                  7231,-31960,7231,-31960,7231,-31960,7231,-31960,
                                  6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                  6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                  5971,-32219,5971,-32219,5971,-32219,5971,-32219,
                                  5549,-32294,5549,-32294,5549,-32294,5549,-32294,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4701,-32428,4701,-32428,4701,-32428,4701,-32428,
                                  4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                  3851,-32540,3851,-32540,3851,-32540,3851,-32540,
                                  3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                  2998,-32630,2998,-32630,2998,-32630,2998,-32630,
                                  2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                                  2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                  1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                  1286,-32742,1286,-32742,1286,-32742,1286,-32742,
                                  857,-32756,857,-32756,857,-32756,857,-32756,
                                  428,-32765,428,-32765,428,-32765,428,-32765,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -429,-32765,-429,-32765,-429,-32765,-429,-32765,
                                  -858,-32756,-858,-32756,-858,-32756,-858,-32756,
                                  -1287,-32742,-1287,-32742,-1287,-32742,-1287,-32742,
                                  -1715,-32723,-1715,-32723,-1715,-32723,-1715,-32723,
                                  -2144,-32697,-2144,-32697,-2144,-32697,-2144,-32697,
                                  -2571,-32666,-2571,-32666,-2571,-32666,-2571,-32666,
                                  -2999,-32630,-2999,-32630,-2999,-32630,-2999,-32630,
                                  -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                  -3852,-32540,-3852,-32540,-3852,-32540,-3852,-32540,
                                  -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                  -4702,-32428,-4702,-32428,-4702,-32428,-4702,-32428,
                                  -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                                  -5550,-32294,-5550,-32294,-5550,-32294,-5550,-32294,
                                  -5972,-32219,-5972,-32219,-5972,-32219,-5972,-32219,
                                  -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                  -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                  -7232,-31960,-7232,-31960,-7232,-31960,-7232,-31960,
                                  -7650,-31862,-7650,-31862,-7650,-31862,-7650,-31862,
                                  -8066,-31759,-8066,-31759,-8066,-31759,-8066,-31759,
                                  -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                  -8895,-31537,-8895,-31537,-8895,-31537,-8895,-31537,
                                  -9307,-31418,-9307,-31418,-9307,-31418,-9307,-31418,
                                  -9717,-31294,-9717,-31294,-9717,-31294,-9717,-31294,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10533,-31029,-10533,-31029,-10533,-31029,-10533,-31029,
                                  -10938,-30888,-10938,-30888,-10938,-30888,-10938,-30888,
                                  -11342,-30742,-11342,-30742,-11342,-30742,-11342,-30742,
                                  -11743,-30591,-11743,-30591,-11743,-30591,-11743,-30591,
                                  -12143,-30435,-12143,-30435,-12143,-30435,-12143,-30435,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -12935,-30107,-12935,-30107,-12935,-30107,-12935,-30107,
                                  -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                  -13719,-29758,-13719,-29758,-13719,-29758,-13719,-29758,
                                  -14107,-29576,-14107,-29576,-14107,-29576,-14107,-29576,
                                  -14493,-29388,-14493,-29388,-14493,-29388,-14493,-29388,
                                  -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                                  -15257,-28999,-15257,-28999,-15257,-28999,-15257,-28999,
                                  -15636,-28797,-15636,-28797,-15636,-28797,-15636,-28797,
                                  -16011,-28590,-16011,-28590,-16011,-28590,-16011,-28590,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -16754,-28161,-16754,-28161,-16754,-28161,-16754,-28161,
                                  -17121,-27939,-17121,-27939,-17121,-27939,-17121,-27939,
                                  -17485,-27712,-17485,-27712,-17485,-27712,-17485,-27712,
                                  -17847,-27481,-17847,-27481,-17847,-27481,-17847,-27481,
                                  -18205,-27245,-18205,-27245,-18205,-27245,-18205,-27245,
                                  -18560,-27005,-18560,-27005,-18560,-27005,-18560,-27005,
                                  -18912,-26759,-18912,-26759,-18912,-26759,-18912,-26759,
                                  -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                                  -19606,-26255,-19606,-26255,-19606,-26255,-19606,-26255,
                                  -19948,-25996,-19948,-25996,-19948,-25996,-19948,-25996,
                                  -20286,-25733,-20286,-25733,-20286,-25733,-20286,-25733,
                                  -20621,-25465,-20621,-25465,-20621,-25465,-20621,-25465,
                                  -20953,-25193,-20953,-25193,-20953,-25193,-20953,-25193,
                                  -21281,-24917,-21281,-24917,-21281,-24917,-21281,-24917,
                                  -21605,-24636,-21605,-24636,-21605,-24636,-21605,-24636,
                                  -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                                  -22243,-24062,-22243,-24062,-22243,-24062,-22243,-24062,
                                  -22556,-23769,-22556,-23769,-22556,-23769,-22556,-23769,
                                  -22865,-23472,-22865,-23472,-22865,-23472,-22865,-23472,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -23472,-22865,-23472,-22865,-23472,-22865,-23472,-22865,
                                  -23769,-22556,-23769,-22556,-23769,-22556,-23769,-22556,
                                  -24062,-22243,-24062,-22243,-24062,-22243,-24062,-22243,
                                  -24351,-21926,-24351,-21926,-24351,-21926,-24351,-21926,
                                  -24636,-21605,-24636,-21605,-24636,-21605,-24636,-21605,
                                  -24917,-21281,-24917,-21281,-24917,-21281,-24917,-21281,
                                  -25193,-20953,-25193,-20953,-25193,-20953,-25193,-20953,
                                  -25465,-20621,-25465,-20621,-25465,-20621,-25465,-20621,
                                  -25733,-20286,-25733,-20286,-25733,-20286,-25733,-20286,
                                  -25996,-19948,-25996,-19948,-25996,-19948,-25996,-19948,
                                  -26255,-19606,-26255,-19606,-26255,-19606,-26255,-19606,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -26759,-18912,-26759,-18912,-26759,-18912,-26759,-18912,
                                  -27005,-18560,-27005,-18560,-27005,-18560,-27005,-18560,
                                  -27245,-18205,-27245,-18205,-27245,-18205,-27245,-18205,
                                  -27481,-17847,-27481,-17847,-27481,-17847,-27481,-17847,
                                  -27712,-17485,-27712,-17485,-27712,-17485,-27712,-17485,
                                  -27939,-17121,-27939,-17121,-27939,-17121,-27939,-17121,
                                  -28161,-16754,-28161,-16754,-28161,-16754,-28161,-16754,
                                  -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                  -28590,-16011,-28590,-16011,-28590,-16011,-28590,-16011,
                                  -28797,-15636,-28797,-15636,-28797,-15636,-28797,-15636,
                                  -28999,-15257,-28999,-15257,-28999,-15257,-28999,-15257,
                                  -29196,-14876,-29196,-14876,-29196,-14876,-29196,-14876,
                                  -29388,-14493,-29388,-14493,-29388,-14493,-29388,-14493,
                                  -29576,-14107,-29576,-14107,-29576,-14107,-29576,-14107,
                                  -29758,-13719,-29758,-13719,-29758,-13719,-29758,-13719,
                                  -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                                  -30107,-12935,-30107,-12935,-30107,-12935,-30107,-12935,
                                  -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                  -30435,-12143,-30435,-12143,-30435,-12143,-30435,-12143,
                                  -30591,-11743,-30591,-11743,-30591,-11743,-30591,-11743,
                                  -30742,-11342,-30742,-11342,-30742,-11342,-30742,-11342,
                                  -30888,-10938,-30888,-10938,-30888,-10938,-30888,-10938,
                                  -31029,-10533,-31029,-10533,-31029,-10533,-31029,-10533,
                                  -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                                  -31294,-9717,-31294,-9717,-31294,-9717,-31294,-9717,
                                  -31418,-9307,-31418,-9307,-31418,-9307,-31418,-9307,
                                  -31537,-8895,-31537,-8895,-31537,-8895,-31537,-8895,
                                  -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                  -31759,-8066,-31759,-8066,-31759,-8066,-31759,-8066,
                                  -31862,-7650,-31862,-7650,-31862,-7650,-31862,-7650,
                                  -31960,-7232,-31960,-7232,-31960,-7232,-31960,-7232,
                                  -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                                  -32138,-6393,-32138,-6393,-32138,-6393,-32138,-6393,
                                  -32219,-5972,-32219,-5972,-32219,-5972,-32219,-5972,
                                  -32294,-5550,-32294,-5550,-32294,-5550,-32294,-5550,
                                  -32364,-5126,-32364,-5126,-32364,-5126,-32364,-5126,
                                  -32428,-4702,-32428,-4702,-32428,-4702,-32428,-4702,
                                  -32487,-4277,-32487,-4277,-32487,-4277,-32487,-4277,
                                  -32540,-3852,-32540,-3852,-32540,-3852,-32540,-3852,
                                  -32588,-3426,-32588,-3426,-32588,-3426,-32588,-3426,
                                  -32630,-2999,-32630,-2999,-32630,-2999,-32630,-2999,
                                  -32666,-2571,-32666,-2571,-32666,-2571,-32666,-2571,
                                  -32697,-2144,-32697,-2144,-32697,-2144,-32697,-2144,
                                  -32723,-1715,-32723,-1715,-32723,-1715,-32723,-1715,
                                  -32742,-1287,-32742,-1287,-32742,-1287,-32742,-1287,
                                  -32756,-858,-32756,-858,-32756,-858,-32756,-858,
                                  -32765,-429,-32765,-429,-32765,-429,-32765,-429
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
12378 12379

static int16_t twc960[239*2*4] = {32760,-644,32760,-644,32760,-644,32760,-644,
12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621
                                  32741,-1287,32741,-1287,32741,-1287,32741,-1287,
                                  32710,-1930,32710,-1930,32710,-1930,32710,-1930,
                                  32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                                  32609,-3212,32609,-3212,32609,-3212,32609,-3212,
                                  32539,-3852,32539,-3852,32539,-3852,32539,-3852,
                                  32457,-4490,32457,-4490,32457,-4490,32457,-4490,
                                  32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                  32256,-5761,32256,-5761,32256,-5761,32256,-5761,
                                  32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                  32005,-7023,32005,-7023,32005,-7023,32005,-7023,
                                  31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                                  31705,-8274,31705,-8274,31705,-8274,31705,-8274,
                                  31536,-8895,31536,-8895,31536,-8895,31536,-8895,
                                  31356,-9512,31356,-9512,31356,-9512,31356,-9512,
                                  31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                  30958,-10736,30958,-10736,30958,-10736,30958,-10736,
                                  30741,-11342,30741,-11342,30741,-11342,30741,-11342,
                                  30513,-11943,30513,-11943,30513,-11943,30513,-11943,
                                  30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                  30020,-13132,30020,-13132,30020,-13132,30020,-13132,
                                  29757,-13719,29757,-13719,29757,-13719,29757,-13719,
                                  29482,-14300,29482,-14300,29482,-14300,29482,-14300,
                                  29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                  28897,-15447,28897,-15447,28897,-15447,28897,-15447,
                                  28589,-16011,28589,-16011,28589,-16011,28589,-16011,
                                  28269,-16569,28269,-16569,28269,-16569,28269,-16569,
                                  27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                                  27596,-17666,27596,-17666,27596,-17666,27596,-17666,
                                  27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                  26882,-18736,26882,-18736,26882,-18736,26882,-18736,
                                  26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                  26125,-19777,26125,-19777,26125,-19777,26125,-19777,
                                  25732,-20286,25732,-20286,25732,-20286,25732,-20286,
                                  25329,-20788,25329,-20788,25329,-20788,25329,-20788,
                                  24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                                  24493,-21766,24493,-21766,24493,-21766,24493,-21766,
                                  24061,-22243,24061,-22243,24061,-22243,24061,-22243,
                                  23620,-22711,23620,-22711,23620,-22711,23620,-22711,
                                  23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                  22710,-23621,22710,-23621,22710,-23621,22710,-23621,
                                  22242,-24062,22242,-24062,22242,-24062,22242,-24062,
                                  21765,-24494,21765,-24494,21765,-24494,21765,-24494,
                                  21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                                  20787,-25330,20787,-25330,20787,-25330,20787,-25330,
                                  20285,-25733,20285,-25733,20285,-25733,20285,-25733,
                                  19776,-26126,19776,-26126,19776,-26126,19776,-26126,
                                  19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                  18735,-26883,18735,-26883,18735,-26883,18735,-26883,
                                  18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                  17665,-27597,17665,-27597,17665,-27597,17665,-27597,
                                  17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                                  16568,-28270,16568,-28270,16568,-28270,16568,-28270,
                                  16010,-28590,16010,-28590,16010,-28590,16010,-28590,
                                  15446,-28898,15446,-28898,15446,-28898,15446,-28898,
                                  14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                  14299,-29483,14299,-29483,14299,-29483,14299,-29483,
                                  13718,-29758,13718,-29758,13718,-29758,13718,-29758,
                                  13131,-30021,13131,-30021,13131,-30021,13131,-30021,
                                  12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                  11942,-30514,11942,-30514,11942,-30514,11942,-30514,
                                  11341,-30742,11341,-30742,11341,-30742,11341,-30742,
                                  10735,-30959,10735,-30959,10735,-30959,10735,-30959,
                                  10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                  9511,-31357,9511,-31357,9511,-31357,9511,-31357,
                                  8894,-31537,8894,-31537,8894,-31537,8894,-31537,
                                  8273,-31706,8273,-31706,8273,-31706,8273,-31706,
                                  7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                                  7022,-32006,7022,-32006,7022,-32006,7022,-32006,
                                  6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                  5760,-32257,5760,-32257,5760,-32257,5760,-32257,
                                  5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                  4489,-32458,4489,-32458,4489,-32458,4489,-32458,
                                  3851,-32540,3851,-32540,3851,-32540,3851,-32540,
                                  3211,-32610,3211,-32610,3211,-32610,3211,-32610,
                                  2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                                  1929,-32711,1929,-32711,1929,-32711,1929,-32711,
                                  1286,-32742,1286,-32742,1286,-32742,1286,-32742,
                                  643,-32761,643,-32761,643,-32761,643,-32761,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -644,-32761,-644,-32761,-644,-32761,-644,-32761,
                                  -1287,-32742,-1287,-32742,-1287,-32742,-1287,-32742,
                                  -1930,-32711,-1930,-32711,-1930,-32711,-1930,-32711,
                                  -2571,-32666,-2571,-32666,-2571,-32666,-2571,-32666,
                                  -3212,-32610,-3212,-32610,-3212,-32610,-3212,-32610,
                                  -3852,-32540,-3852,-32540,-3852,-32540,-3852,-32540,
                                  -4490,-32458,-4490,-32458,-4490,-32458,-4490,-32458,
                                  -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                                  -5761,-32257,-5761,-32257,-5761,-32257,-5761,-32257,
                                  -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                  -7023,-32006,-7023,-32006,-7023,-32006,-7023,-32006,
                                  -7650,-31862,-7650,-31862,-7650,-31862,-7650,-31862,
                                  -8274,-31706,-8274,-31706,-8274,-31706,-8274,-31706,
                                  -8895,-31537,-8895,-31537,-8895,-31537,-8895,-31537,
                                  -9512,-31357,-9512,-31357,-9512,-31357,-9512,-31357,
                                  -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                  -10736,-30959,-10736,-30959,-10736,-30959,-10736,-30959,
                                  -11342,-30742,-11342,-30742,-11342,-30742,-11342,-30742,
                                  -11943,-30514,-11943,-30514,-11943,-30514,-11943,-30514,
                                  -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                  -13132,-30021,-13132,-30021,-13132,-30021,-13132,-30021,
                                  -13719,-29758,-13719,-29758,-13719,-29758,-13719,-29758,
                                  -14300,-29483,-14300,-29483,-14300,-29483,-14300,-29483,
                                  -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                                  -15447,-28898,-15447,-28898,-15447,-28898,-15447,-28898,
                                  -16011,-28590,-16011,-28590,-16011,-28590,-16011,-28590,
                                  -16569,-28270,-16569,-28270,-16569,-28270,-16569,-28270,
                                  -17121,-27939,-17121,-27939,-17121,-27939,-17121,-27939,
                                  -17666,-27597,-17666,-27597,-17666,-27597,-17666,-27597,
                                  -18205,-27245,-18205,-27245,-18205,-27245,-18205,-27245,
                                  -18736,-26883,-18736,-26883,-18736,-26883,-18736,-26883,
                                  -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                                  -19777,-26126,-19777,-26126,-19777,-26126,-19777,-26126,
                                  -20286,-25733,-20286,-25733,-20286,-25733,-20286,-25733,
                                  -20788,-25330,-20788,-25330,-20788,-25330,-20788,-25330,
                                  -21281,-24917,-21281,-24917,-21281,-24917,-21281,-24917,
                                  -21766,-24494,-21766,-24494,-21766,-24494,-21766,-24494,
                                  -22243,-24062,-22243,-24062,-22243,-24062,-22243,-24062,
                                  -22711,-23621,-22711,-23621,-22711,-23621,-22711,-23621,
                                  -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                  -23621,-22711,-23621,-22711,-23621,-22711,-23621,-22711,
                                  -24062,-22243,-24062,-22243,-24062,-22243,-24062,-22243,
                                  -24494,-21766,-24494,-21766,-24494,-21766,-24494,-21766,
                                  -24917,-21281,-24917,-21281,-24917,-21281,-24917,-21281,
                                  -25330,-20788,-25330,-20788,-25330,-20788,-25330,-20788,
                                  -25733,-20286,-25733,-20286,-25733,-20286,-25733,-20286,
                                  -26126,-19777,-26126,-19777,-26126,-19777,-26126,-19777,
                                  -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                  -26883,-18736,-26883,-18736,-26883,-18736,-26883,-18736,
                                  -27245,-18205,-27245,-18205,-27245,-18205,-27245,-18205,
                                  -27597,-17666,-27597,-17666,-27597,-17666,-27597,-17666,
                                  -27939,-17121,-27939,-17121,-27939,-17121,-27939,-17121,
                                  -28270,-16569,-28270,-16569,-28270,-16569,-28270,-16569,
                                  -28590,-16011,-28590,-16011,-28590,-16011,-28590,-16011,
                                  -28898,-15447,-28898,-15447,-28898,-15447,-28898,-15447,
                                  -29196,-14876,-29196,-14876,-29196,-14876,-29196,-14876,
                                  -29483,-14300,-29483,-14300,-29483,-14300,-29483,-14300,
                                  -29758,-13719,-29758,-13719,-29758,-13719,-29758,-13719,
                                  -30021,-13132,-30021,-13132,-30021,-13132,-30021,-13132,
                                  -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                  -30514,-11943,-30514,-11943,-30514,-11943,-30514,-11943,
                                  -30742,-11342,-30742,-11342,-30742,-11342,-30742,-11342,
                                  -30959,-10736,-30959,-10736,-30959,-10736,-30959,-10736,
                                  -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                                  -31357,-9512,-31357,-9512,-31357,-9512,-31357,-9512,
                                  -31537,-8895,-31537,-8895,-31537,-8895,-31537,-8895,
                                  -31706,-8274,-31706,-8274,-31706,-8274,-31706,-8274,
                                  -31862,-7650,-31862,-7650,-31862,-7650,-31862,-7650,
                                  -32006,-7023,-32006,-7023,-32006,-7023,-32006,-7023,
                                  -32138,-6393,-32138,-6393,-32138,-6393,-32138,-6393,
                                  -32257,-5761,-32257,-5761,-32257,-5761,-32257,-5761,
                                  -32364,-5126,-32364,-5126,-32364,-5126,-32364,-5126,
                                  -32458,-4490,-32458,-4490,-32458,-4490,-32458,-4490,
                                  -32540,-3852,-32540,-3852,-32540,-3852,-32540,-3852,
                                  -32610,-3212,-32610,-3212,-32610,-3212,-32610,-3212,
                                  -32666,-2571,-32666,-2571,-32666,-2571,-32666,-2571,
                                  -32711,-1930,-32711,-1930,-32711,-1930,-32711,-1930,
                                  -32742,-1287,-32742,-1287,-32742,-1287,-32742,-1287,
                                  -32761,-644,-32761,-644,-32761,-644,-32761,-644,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32761,643,-32761,643,-32761,643,-32761,643,
                                  -32742,1286,-32742,1286,-32742,1286,-32742,1286,
                                  -32711,1929,-32711,1929,-32711,1929,-32711,1929,
                                  -32666,2570,-32666,2570,-32666,2570,-32666,2570,
                                  -32610,3211,-32610,3211,-32610,3211,-32610,3211,
                                  -32540,3851,-32540,3851,-32540,3851,-32540,3851,
                                  -32458,4489,-32458,4489,-32458,4489,-32458,4489,
                                  -32364,5125,-32364,5125,-32364,5125,-32364,5125,
                                  -32257,5760,-32257,5760,-32257,5760,-32257,5760,
                                  -32138,6392,-32138,6392,-32138,6392,-32138,6392,
                                  -32006,7022,-32006,7022,-32006,7022,-32006,7022,
                                  -31862,7649,-31862,7649,-31862,7649,-31862,7649,
                                  -31706,8273,-31706,8273,-31706,8273,-31706,8273,
                                  -31537,8894,-31537,8894,-31537,8894,-31537,8894,
                                  -31357,9511,-31357,9511,-31357,9511,-31357,9511,
                                  -31164,10125,-31164,10125,-31164,10125,-31164,10125,
                                  -30959,10735,-30959,10735,-30959,10735,-30959,10735,
                                  -30742,11341,-30742,11341,-30742,11341,-30742,11341,
                                  -30514,11942,-30514,11942,-30514,11942,-30514,11942,
                                  -30273,12539,-30273,12539,-30273,12539,-30273,12539,
                                  -30021,13131,-30021,13131,-30021,13131,-30021,13131,
                                  -29758,13718,-29758,13718,-29758,13718,-29758,13718,
                                  -29483,14299,-29483,14299,-29483,14299,-29483,14299,
                                  -29196,14875,-29196,14875,-29196,14875,-29196,14875,
                                  -28898,15446,-28898,15446,-28898,15446,-28898,15446,
                                  -28590,16010,-28590,16010,-28590,16010,-28590,16010,
                                  -28270,16568,-28270,16568,-28270,16568,-28270,16568,
                                  -27939,17120,-27939,17120,-27939,17120,-27939,17120,
                                  -27597,17665,-27597,17665,-27597,17665,-27597,17665,
                                  -27245,18204,-27245,18204,-27245,18204,-27245,18204,
                                  -26883,18735,-26883,18735,-26883,18735,-26883,18735,
                                  -26510,19259,-26510,19259,-26510,19259,-26510,19259,
                                  -26126,19776,-26126,19776,-26126,19776,-26126,19776,
                                  -25733,20285,-25733,20285,-25733,20285,-25733,20285,
                                  -25330,20787,-25330,20787,-25330,20787,-25330,20787,
                                  -24917,21280,-24917,21280,-24917,21280,-24917,21280,
                                  -24494,21765,-24494,21765,-24494,21765,-24494,21765,
                                  -24062,22242,-24062,22242,-24062,22242,-24062,22242,
                                  -23621,22710,-23621,22710,-23621,22710,-23621,22710,
                                  -23170,23169,-23170,23169,-23170,23169,-23170,23169,
                                  -22711,23620,-22711,23620,-22711,23620,-22711,23620,
                                  -22243,24061,-22243,24061,-22243,24061,-22243,24061,
                                  -21766,24493,-21766,24493,-21766,24493,-21766,24493,
                                  -21281,24916,-21281,24916,-21281,24916,-21281,24916,
                                  -20788,25329,-20788,25329,-20788,25329,-20788,25329,
                                  -20286,25732,-20286,25732,-20286,25732,-20286,25732,
                                  -19777,26125,-19777,26125,-19777,26125,-19777,26125,
                                  -19260,26509,-19260,26509,-19260,26509,-19260,26509,
                                  -18736,26882,-18736,26882,-18736,26882,-18736,26882,
                                  -18205,27244,-18205,27244,-18205,27244,-18205,27244,
                                  -17666,27596,-17666,27596,-17666,27596,-17666,27596,
                                  -17121,27938,-17121,27938,-17121,27938,-17121,27938,
                                  -16569,28269,-16569,28269,-16569,28269,-16569,28269,
                                  -16011,28589,-16011,28589,-16011,28589,-16011,28589,
                                  -15447,28897,-15447,28897,-15447,28897,-15447,28897,
                                  -14876,29195,-14876,29195,-14876,29195,-14876,29195,
                                  -14300,29482,-14300,29482,-14300,29482,-14300,29482,
                                  -13719,29757,-13719,29757,-13719,29757,-13719,29757,
                                  -13132,30020,-13132,30020,-13132,30020,-13132,30020,
                                  -12540,30272,-12540,30272,-12540,30272,-12540,30272,
                                  -11943,30513,-11943,30513,-11943,30513,-11943,30513,
                                  -11342,30741,-11342,30741,-11342,30741,-11342,30741,
                                  -10736,30958,-10736,30958,-10736,30958,-10736,30958,
                                  -10126,31163,-10126,31163,-10126,31163,-10126,31163,
                                  -9512,31356,-9512,31356,-9512,31356,-9512,31356,
                                  -8895,31536,-8895,31536,-8895,31536,-8895,31536,
                                  -8274,31705,-8274,31705,-8274,31705,-8274,31705,
                                  -7650,31861,-7650,31861,-7650,31861,-7650,31861,
                                  -7023,32005,-7023,32005,-7023,32005,-7023,32005,
                                  -6393,32137,-6393,32137,-6393,32137,-6393,32137,
                                  -5761,32256,-5761,32256,-5761,32256,-5761,32256,
                                  -5126,32363,-5126,32363,-5126,32363,-5126,32363,
                                  -4490,32457,-4490,32457,-4490,32457,-4490,32457,
                                  -3852,32539,-3852,32539,-3852,32539,-3852,32539,
                                  -3212,32609,-3212,32609,-3212,32609,-3212,32609,
                                  -2571,32665,-2571,32665,-2571,32665,-2571,32665,
                                  -1930,32710,-1930,32710,-1930,32710,-1930,32710,
                                  -1287,32741,-1287,32741,-1287,32741,-1287,32741,
                                  -644,32760,-644,32760,-644,32760,-644,32760
                                 };

void dft960(int16_t *x,int16_t *y,unsigned char scale_flag)  // 240 x 4
{
Raymond Knopp's avatar
 
Raymond Knopp committed
12622
  int i,j;
12623 12624 12625 12626 12627 12628 12629
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa960[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb960[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc960[0];
  simd_q15_t x2128[960];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[960];//=&ytmp128array2[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
12630 12631 12632



12633
  for (i=0,j=0; i<240; i++,j+=4) {
Raymond Knopp's avatar
 
Raymond Knopp committed
12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645
    x2128[i]    = x128[j];
    x2128[i+240] = x128[j+1];
    x2128[i+480] = x128[j+2];
    x2128[i+720] = x128[j+3];
  }

  dft240((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft240((int16_t *)(x2128+240),(int16_t *)(ytmp128+240),1);
  dft240((int16_t *)(x2128+480),(int16_t *)(ytmp128+480),1);
  dft240((int16_t *)(x2128+720),(int16_t *)(ytmp128+720),1);

  bfly4_tw1(ytmp128,ytmp128+240,ytmp128+480,ytmp128+720,y128,y128+240,y128+480,y128+720);
12646 12647

  for (i=1,j=0; i<240; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
12648
    bfly4(ytmp128+i,
12649 12650 12651 12652 12653 12654 12655 12656 12657 12658
          ytmp128+240+i,
          ytmp128+480+i,
          ytmp128+720+i,
          y128+i,
          y128+240+i,
          y128+480+i,
          y128+720+i,
          twa128+j,
          twb128+j,
          twc128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
12659 12660 12661
  }

  if (scale_flag==1) {
12662
    norm128 = set1_int16(16384);//dft_norm_table[13]);
12663 12664

    for (i=0; i<960; i++) {
12665
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698
    }
  }

  _mm_empty();
  _m_empty();

};

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:323)/972));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:323)/972));
twa2 = zeros(1,2*323);
twb2 = zeros(1,2*323);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa972[323*2*4] = {");
for i=1:2:(2*322)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb972[323*2*4] = {");
for i=1:2:(2*322)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fclose(fd);
*/
static int16_t twa972[323*2*4] = {32766,-212,32766,-212,32766,-212,32766,-212,
12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021
                                  32764,-424,32764,-424,32764,-424,32764,-424,
                                  32760,-636,32760,-636,32760,-636,32760,-636,
                                  32756,-848,32756,-848,32756,-848,32756,-848,
                                  32749,-1059,32749,-1059,32749,-1059,32749,-1059,
                                  32742,-1271,32742,-1271,32742,-1271,32742,-1271,
                                  32733,-1483,32733,-1483,32733,-1483,32733,-1483,
                                  32723,-1694,32723,-1694,32723,-1694,32723,-1694,
                                  32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                  32698,-2117,32698,-2117,32698,-2117,32698,-2117,
                                  32684,-2328,32684,-2328,32684,-2328,32684,-2328,
                                  32668,-2540,32668,-2540,32668,-2540,32668,-2540,
                                  32651,-2751,32651,-2751,32651,-2751,32651,-2751,
                                  32632,-2962,32632,-2962,32632,-2962,32632,-2962,
                                  32613,-3173,32613,-3173,32613,-3173,32613,-3173,
                                  32591,-3383,32591,-3383,32591,-3383,32591,-3383,
                                  32569,-3594,32569,-3594,32569,-3594,32569,-3594,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32520,-4015,32520,-4015,32520,-4015,32520,-4015,
                                  32493,-4225,32493,-4225,32493,-4225,32493,-4225,
                                  32465,-4435,32465,-4435,32465,-4435,32465,-4435,
                                  32436,-4645,32436,-4645,32436,-4645,32436,-4645,
                                  32405,-4854,32405,-4854,32405,-4854,32405,-4854,
                                  32373,-5064,32373,-5064,32373,-5064,32373,-5064,
                                  32340,-5273,32340,-5273,32340,-5273,32340,-5273,
                                  32305,-5482,32305,-5482,32305,-5482,32305,-5482,
                                  32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                  32231,-5899,32231,-5899,32231,-5899,32231,-5899,
                                  32192,-6107,32192,-6107,32192,-6107,32192,-6107,
                                  32152,-6315,32152,-6315,32152,-6315,32152,-6315,
                                  32111,-6523,32111,-6523,32111,-6523,32111,-6523,
                                  32068,-6730,32068,-6730,32068,-6730,32068,-6730,
                                  32024,-6937,32024,-6937,32024,-6937,32024,-6937,
                                  31978,-7144,31978,-7144,31978,-7144,31978,-7144,
                                  31931,-7351,31931,-7351,31931,-7351,31931,-7351,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31834,-7763,31834,-7763,31834,-7763,31834,-7763,
                                  31783,-7969,31783,-7969,31783,-7969,31783,-7969,
                                  31731,-8174,31731,-8174,31731,-8174,31731,-8174,
                                  31677,-8379,31677,-8379,31677,-8379,31677,-8379,
                                  31622,-8583,31622,-8583,31622,-8583,31622,-8583,
                                  31566,-8788,31566,-8788,31566,-8788,31566,-8788,
                                  31509,-8992,31509,-8992,31509,-8992,31509,-8992,
                                  31450,-9195,31450,-9195,31450,-9195,31450,-9195,
                                  31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                  31329,-9601,31329,-9601,31329,-9601,31329,-9601,
                                  31266,-9803,31266,-9803,31266,-9803,31266,-9803,
                                  31202,-10005,31202,-10005,31202,-10005,31202,-10005,
                                  31136,-10207,31136,-10207,31136,-10207,31136,-10207,
                                  31070,-10408,31070,-10408,31070,-10408,31070,-10408,
                                  31002,-10608,31002,-10608,31002,-10608,31002,-10608,
                                  30933,-10808,30933,-10808,30933,-10808,30933,-10808,
                                  30862,-11008,30862,-11008,30862,-11008,30862,-11008,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30717,-11406,30717,-11406,30717,-11406,30717,-11406,
                                  30643,-11605,30643,-11605,30643,-11605,30643,-11605,
                                  30567,-11802,30567,-11802,30567,-11802,30567,-11802,
                                  30490,-12000,30490,-12000,30490,-12000,30490,-12000,
                                  30412,-12197,30412,-12197,30412,-12197,30412,-12197,
                                  30333,-12393,30333,-12393,30333,-12393,30333,-12393,
                                  30252,-12589,30252,-12589,30252,-12589,30252,-12589,
                                  30170,-12784,30170,-12784,30170,-12784,30170,-12784,
                                  30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                  30002,-13173,30002,-13173,30002,-13173,30002,-13173,
                                  29916,-13367,29916,-13367,29916,-13367,29916,-13367,
                                  29829,-13560,29829,-13560,29829,-13560,29829,-13560,
                                  29741,-13752,29741,-13752,29741,-13752,29741,-13752,
                                  29652,-13944,29652,-13944,29652,-13944,29652,-13944,
                                  29561,-14136,29561,-14136,29561,-14136,29561,-14136,
                                  29469,-14327,29469,-14327,29469,-14327,29469,-14327,
                                  29376,-14517,29376,-14517,29376,-14517,29376,-14517,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  29185,-14895,29185,-14895,29185,-14895,29185,-14895,
                                  29089,-15084,29089,-15084,29089,-15084,29089,-15084,
                                  28990,-15271,28990,-15271,28990,-15271,28990,-15271,
                                  28891,-15458,28891,-15458,28891,-15458,28891,-15458,
                                  28791,-15645,28791,-15645,28791,-15645,28791,-15645,
                                  28689,-15831,28689,-15831,28689,-15831,28689,-15831,
                                  28586,-16016,28586,-16016,28586,-16016,28586,-16016,
                                  28482,-16200,28482,-16200,28482,-16200,28482,-16200,
                                  28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                  28270,-16567,28270,-16567,28270,-16567,28270,-16567,
                                  28162,-16749,28162,-16749,28162,-16749,28162,-16749,
                                  28054,-16931,28054,-16931,28054,-16931,28054,-16931,
                                  27943,-17112,27943,-17112,27943,-17112,27943,-17112,
                                  27832,-17292,27832,-17292,27832,-17292,27832,-17292,
                                  27720,-17472,27720,-17472,27720,-17472,27720,-17472,
                                  27606,-17651,27606,-17651,27606,-17651,27606,-17651,
                                  27492,-17829,27492,-17829,27492,-17829,27492,-17829,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  27259,-18183,27259,-18183,27259,-18183,27259,-18183,
                                  27141,-18359,27141,-18359,27141,-18359,27141,-18359,
                                  27022,-18534,27022,-18534,27022,-18534,27022,-18534,
                                  26901,-18708,26901,-18708,26901,-18708,26901,-18708,
                                  26780,-18882,26780,-18882,26780,-18882,26780,-18882,
                                  26657,-19054,26657,-19054,26657,-19054,26657,-19054,
                                  26533,-19226,26533,-19226,26533,-19226,26533,-19226,
                                  26409,-19397,26409,-19397,26409,-19397,26409,-19397,
                                  26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                  26156,-19737,26156,-19737,26156,-19737,26156,-19737,
                                  26028,-19906,26028,-19906,26028,-19906,26028,-19906,
                                  25898,-20074,25898,-20074,25898,-20074,25898,-20074,
                                  25768,-20241,25768,-20241,25768,-20241,25768,-20241,
                                  25637,-20407,25637,-20407,25637,-20407,25637,-20407,
                                  25504,-20572,25504,-20572,25504,-20572,25504,-20572,
                                  25371,-20736,25371,-20736,25371,-20736,25371,-20736,
                                  25236,-20900,25236,-20900,25236,-20900,25236,-20900,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24964,-21225,24964,-21225,24964,-21225,24964,-21225,
                                  24826,-21385,24826,-21385,24826,-21385,24826,-21385,
                                  24687,-21546,24687,-21546,24687,-21546,24687,-21546,
                                  24548,-21705,24548,-21705,24548,-21705,24548,-21705,
                                  24407,-21863,24407,-21863,24407,-21863,24407,-21863,
                                  24265,-22020,24265,-22020,24265,-22020,24265,-22020,
                                  24122,-22177,24122,-22177,24122,-22177,24122,-22177,
                                  23978,-22332,23978,-22332,23978,-22332,23978,-22332,
                                  23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                  23688,-22640,23688,-22640,23688,-22640,23688,-22640,
                                  23541,-22793,23541,-22793,23541,-22793,23541,-22793,
                                  23393,-22945,23393,-22945,23393,-22945,23393,-22945,
                                  23244,-23095,23244,-23095,23244,-23095,23244,-23095,
                                  23094,-23245,23094,-23245,23094,-23245,23094,-23245,
                                  22944,-23394,22944,-23394,22944,-23394,22944,-23394,
                                  22792,-23542,22792,-23542,22792,-23542,22792,-23542,
                                  22639,-23689,22639,-23689,22639,-23689,22639,-23689,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  22331,-23979,22331,-23979,22331,-23979,22331,-23979,
                                  22176,-24123,22176,-24123,22176,-24123,22176,-24123,
                                  22019,-24266,22019,-24266,22019,-24266,22019,-24266,
                                  21862,-24408,21862,-24408,21862,-24408,21862,-24408,
                                  21704,-24549,21704,-24549,21704,-24549,21704,-24549,
                                  21545,-24688,21545,-24688,21545,-24688,21545,-24688,
                                  21384,-24827,21384,-24827,21384,-24827,21384,-24827,
                                  21224,-24965,21224,-24965,21224,-24965,21224,-24965,
                                  21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                  20899,-25237,20899,-25237,20899,-25237,20899,-25237,
                                  20735,-25372,20735,-25372,20735,-25372,20735,-25372,
                                  20571,-25505,20571,-25505,20571,-25505,20571,-25505,
                                  20406,-25638,20406,-25638,20406,-25638,20406,-25638,
                                  20240,-25769,20240,-25769,20240,-25769,20240,-25769,
                                  20073,-25899,20073,-25899,20073,-25899,20073,-25899,
                                  19905,-26029,19905,-26029,19905,-26029,19905,-26029,
                                  19736,-26157,19736,-26157,19736,-26157,19736,-26157,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  19396,-26410,19396,-26410,19396,-26410,19396,-26410,
                                  19225,-26534,19225,-26534,19225,-26534,19225,-26534,
                                  19053,-26658,19053,-26658,19053,-26658,19053,-26658,
                                  18881,-26781,18881,-26781,18881,-26781,18881,-26781,
                                  18707,-26902,18707,-26902,18707,-26902,18707,-26902,
                                  18533,-27023,18533,-27023,18533,-27023,18533,-27023,
                                  18358,-27142,18358,-27142,18358,-27142,18358,-27142,
                                  18182,-27260,18182,-27260,18182,-27260,18182,-27260,
                                  18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                  17828,-27493,17828,-27493,17828,-27493,17828,-27493,
                                  17650,-27607,17650,-27607,17650,-27607,17650,-27607,
                                  17471,-27721,17471,-27721,17471,-27721,17471,-27721,
                                  17291,-27833,17291,-27833,17291,-27833,17291,-27833,
                                  17111,-27944,17111,-27944,17111,-27944,17111,-27944,
                                  16930,-28055,16930,-28055,16930,-28055,16930,-28055,
                                  16748,-28163,16748,-28163,16748,-28163,16748,-28163,
                                  16566,-28271,16566,-28271,16566,-28271,16566,-28271,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16199,-28483,16199,-28483,16199,-28483,16199,-28483,
                                  16015,-28587,16015,-28587,16015,-28587,16015,-28587,
                                  15830,-28690,15830,-28690,15830,-28690,15830,-28690,
                                  15644,-28792,15644,-28792,15644,-28792,15644,-28792,
                                  15457,-28892,15457,-28892,15457,-28892,15457,-28892,
                                  15270,-28991,15270,-28991,15270,-28991,15270,-28991,
                                  15083,-29090,15083,-29090,15083,-29090,15083,-29090,
                                  14894,-29186,14894,-29186,14894,-29186,14894,-29186,
                                  14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                  14516,-29377,14516,-29377,14516,-29377,14516,-29377,
                                  14326,-29470,14326,-29470,14326,-29470,14326,-29470,
                                  14135,-29562,14135,-29562,14135,-29562,14135,-29562,
                                  13943,-29653,13943,-29653,13943,-29653,13943,-29653,
                                  13751,-29742,13751,-29742,13751,-29742,13751,-29742,
                                  13559,-29830,13559,-29830,13559,-29830,13559,-29830,
                                  13366,-29917,13366,-29917,13366,-29917,13366,-29917,
                                  13172,-30003,13172,-30003,13172,-30003,13172,-30003,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12783,-30171,12783,-30171,12783,-30171,12783,-30171,
                                  12588,-30253,12588,-30253,12588,-30253,12588,-30253,
                                  12392,-30334,12392,-30334,12392,-30334,12392,-30334,
                                  12196,-30413,12196,-30413,12196,-30413,12196,-30413,
                                  11999,-30491,11999,-30491,11999,-30491,11999,-30491,
                                  11801,-30568,11801,-30568,11801,-30568,11801,-30568,
                                  11604,-30644,11604,-30644,11604,-30644,11604,-30644,
                                  11405,-30718,11405,-30718,11405,-30718,11405,-30718,
                                  11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                  11007,-30863,11007,-30863,11007,-30863,11007,-30863,
                                  10807,-30934,10807,-30934,10807,-30934,10807,-30934,
                                  10607,-31003,10607,-31003,10607,-31003,10607,-31003,
                                  10407,-31071,10407,-31071,10407,-31071,10407,-31071,
                                  10206,-31137,10206,-31137,10206,-31137,10206,-31137,
                                  10004,-31203,10004,-31203,10004,-31203,10004,-31203,
                                  9802,-31267,9802,-31267,9802,-31267,9802,-31267,
                                  9600,-31330,9600,-31330,9600,-31330,9600,-31330,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  9194,-31451,9194,-31451,9194,-31451,9194,-31451,
                                  8991,-31510,8991,-31510,8991,-31510,8991,-31510,
                                  8787,-31567,8787,-31567,8787,-31567,8787,-31567,
                                  8582,-31623,8582,-31623,8582,-31623,8582,-31623,
                                  8378,-31678,8378,-31678,8378,-31678,8378,-31678,
                                  8173,-31732,8173,-31732,8173,-31732,8173,-31732,
                                  7968,-31784,7968,-31784,7968,-31784,7968,-31784,
                                  7762,-31835,7762,-31835,7762,-31835,7762,-31835,
                                  7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                  7350,-31932,7350,-31932,7350,-31932,7350,-31932,
                                  7143,-31979,7143,-31979,7143,-31979,7143,-31979,
                                  6936,-32025,6936,-32025,6936,-32025,6936,-32025,
                                  6729,-32069,6729,-32069,6729,-32069,6729,-32069,
                                  6522,-32112,6522,-32112,6522,-32112,6522,-32112,
                                  6314,-32153,6314,-32153,6314,-32153,6314,-32153,
                                  6106,-32193,6106,-32193,6106,-32193,6106,-32193,
                                  5898,-32232,5898,-32232,5898,-32232,5898,-32232,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5481,-32306,5481,-32306,5481,-32306,5481,-32306,
                                  5272,-32341,5272,-32341,5272,-32341,5272,-32341,
                                  5063,-32374,5063,-32374,5063,-32374,5063,-32374,
                                  4853,-32406,4853,-32406,4853,-32406,4853,-32406,
                                  4644,-32437,4644,-32437,4644,-32437,4644,-32437,
                                  4434,-32466,4434,-32466,4434,-32466,4434,-32466,
                                  4224,-32494,4224,-32494,4224,-32494,4224,-32494,
                                  4014,-32521,4014,-32521,4014,-32521,4014,-32521,
                                  3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                  3593,-32570,3593,-32570,3593,-32570,3593,-32570,
                                  3382,-32592,3382,-32592,3382,-32592,3382,-32592,
                                  3172,-32614,3172,-32614,3172,-32614,3172,-32614,
                                  2961,-32633,2961,-32633,2961,-32633,2961,-32633,
                                  2750,-32652,2750,-32652,2750,-32652,2750,-32652,
                                  2539,-32669,2539,-32669,2539,-32669,2539,-32669,
                                  2327,-32685,2327,-32685,2327,-32685,2327,-32685,
                                  2116,-32699,2116,-32699,2116,-32699,2116,-32699,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1693,-32724,1693,-32724,1693,-32724,1693,-32724,
                                  1482,-32734,1482,-32734,1482,-32734,1482,-32734,
                                  1270,-32743,1270,-32743,1270,-32743,1270,-32743,
                                  1058,-32750,1058,-32750,1058,-32750,1058,-32750,
                                  847,-32757,847,-32757,847,-32757,847,-32757,
                                  635,-32761,635,-32761,635,-32761,635,-32761,
                                  423,-32765,423,-32765,423,-32765,423,-32765,
                                  211,-32767,211,-32767,211,-32767,211,-32767,
                                  0,-32767,0,-32767,0,-32767,0,-32767,
                                  -212,-32767,-212,-32767,-212,-32767,-212,-32767,
                                  -424,-32765,-424,-32765,-424,-32765,-424,-32765,
                                  -636,-32761,-636,-32761,-636,-32761,-636,-32761,
                                  -848,-32757,-848,-32757,-848,-32757,-848,-32757,
                                  -1059,-32750,-1059,-32750,-1059,-32750,-1059,-32750,
                                  -1271,-32743,-1271,-32743,-1271,-32743,-1271,-32743,
                                  -1483,-32734,-1483,-32734,-1483,-32734,-1483,-32734,
                                  -1694,-32724,-1694,-32724,-1694,-32724,-1694,-32724,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2117,-32699,-2117,-32699,-2117,-32699,-2117,-32699,
                                  -2328,-32685,-2328,-32685,-2328,-32685,-2328,-32685,
                                  -2540,-32669,-2540,-32669,-2540,-32669,-2540,-32669,
                                  -2751,-32652,-2751,-32652,-2751,-32652,-2751,-32652,
                                  -2962,-32633,-2962,-32633,-2962,-32633,-2962,-32633,
                                  -3173,-32614,-3173,-32614,-3173,-32614,-3173,-32614,
                                  -3383,-32592,-3383,-32592,-3383,-32592,-3383,-32592,
                                  -3594,-32570,-3594,-32570,-3594,-32570,-3594,-32570,
                                  -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                  -4015,-32521,-4015,-32521,-4015,-32521,-4015,-32521,
                                  -4225,-32494,-4225,-32494,-4225,-32494,-4225,-32494,
                                  -4435,-32466,-4435,-32466,-4435,-32466,-4435,-32466,
                                  -4645,-32437,-4645,-32437,-4645,-32437,-4645,-32437,
                                  -4854,-32406,-4854,-32406,-4854,-32406,-4854,-32406,
                                  -5064,-32374,-5064,-32374,-5064,-32374,-5064,-32374,
                                  -5273,-32341,-5273,-32341,-5273,-32341,-5273,-32341,
                                  -5482,-32306,-5482,-32306,-5482,-32306,-5482,-32306,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -5899,-32232,-5899,-32232,-5899,-32232,-5899,-32232,
                                  -6107,-32193,-6107,-32193,-6107,-32193,-6107,-32193,
                                  -6315,-32153,-6315,-32153,-6315,-32153,-6315,-32153,
                                  -6523,-32112,-6523,-32112,-6523,-32112,-6523,-32112,
                                  -6730,-32069,-6730,-32069,-6730,-32069,-6730,-32069,
                                  -6937,-32025,-6937,-32025,-6937,-32025,-6937,-32025,
                                  -7144,-31979,-7144,-31979,-7144,-31979,-7144,-31979,
                                  -7351,-31932,-7351,-31932,-7351,-31932,-7351,-31932,
                                  -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                  -7763,-31835,-7763,-31835,-7763,-31835,-7763,-31835,
                                  -7969,-31784,-7969,-31784,-7969,-31784,-7969,-31784,
                                  -8174,-31732,-8174,-31732,-8174,-31732,-8174,-31732,
                                  -8379,-31678,-8379,-31678,-8379,-31678,-8379,-31678,
                                  -8583,-31623,-8583,-31623,-8583,-31623,-8583,-31623,
                                  -8788,-31567,-8788,-31567,-8788,-31567,-8788,-31567,
                                  -8992,-31510,-8992,-31510,-8992,-31510,-8992,-31510,
                                  -9195,-31451,-9195,-31451,-9195,-31451,-9195,-31451,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -9601,-31330,-9601,-31330,-9601,-31330,-9601,-31330,
                                  -9803,-31267,-9803,-31267,-9803,-31267,-9803,-31267,
                                  -10005,-31203,-10005,-31203,-10005,-31203,-10005,-31203,
                                  -10207,-31137,-10207,-31137,-10207,-31137,-10207,-31137,
                                  -10408,-31071,-10408,-31071,-10408,-31071,-10408,-31071,
                                  -10608,-31003,-10608,-31003,-10608,-31003,-10608,-31003,
                                  -10808,-30934,-10808,-30934,-10808,-30934,-10808,-30934,
                                  -11008,-30863,-11008,-30863,-11008,-30863,-11008,-30863,
                                  -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                  -11406,-30718,-11406,-30718,-11406,-30718,-11406,-30718,
                                  -11605,-30644,-11605,-30644,-11605,-30644,-11605,-30644,
                                  -11802,-30568,-11802,-30568,-11802,-30568,-11802,-30568,
                                  -12000,-30491,-12000,-30491,-12000,-30491,-12000,-30491,
                                  -12197,-30413,-12197,-30413,-12197,-30413,-12197,-30413,
                                  -12393,-30334,-12393,-30334,-12393,-30334,-12393,-30334,
                                  -12589,-30253,-12589,-30253,-12589,-30253,-12589,-30253,
                                  -12784,-30171,-12784,-30171,-12784,-30171,-12784,-30171,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13173,-30003,-13173,-30003,-13173,-30003,-13173,-30003,
                                  -13367,-29917,-13367,-29917,-13367,-29917,-13367,-29917,
                                  -13560,-29830,-13560,-29830,-13560,-29830,-13560,-29830,
                                  -13752,-29742,-13752,-29742,-13752,-29742,-13752,-29742,
                                  -13944,-29653,-13944,-29653,-13944,-29653,-13944,-29653,
                                  -14136,-29562,-14136,-29562,-14136,-29562,-14136,-29562,
                                  -14327,-29470,-14327,-29470,-14327,-29470,-14327,-29470,
                                  -14517,-29377,-14517,-29377,-14517,-29377,-14517,-29377,
                                  -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                  -14895,-29186,-14895,-29186,-14895,-29186,-14895,-29186,
                                  -15084,-29090,-15084,-29090,-15084,-29090,-15084,-29090,
                                  -15271,-28991,-15271,-28991,-15271,-28991,-15271,-28991,
                                  -15458,-28892,-15458,-28892,-15458,-28892,-15458,-28892,
                                  -15645,-28792,-15645,-28792,-15645,-28792,-15645,-28792,
                                  -15831,-28690,-15831,-28690,-15831,-28690,-15831,-28690,
                                  -16016,-28587,-16016,-28587,-16016,-28587,-16016,-28587,
                                  -16200,-28483,-16200,-28483,-16200,-28483,-16200,-28483
                                 };
Raymond Knopp's avatar
 
Raymond Knopp committed
13022
static int16_t twb972[323*2*4] = {32764,-424,32764,-424,32764,-424,32764,-424,
13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348
                                  32756,-848,32756,-848,32756,-848,32756,-848,
                                  32742,-1271,32742,-1271,32742,-1271,32742,-1271,
                                  32723,-1694,32723,-1694,32723,-1694,32723,-1694,
                                  32698,-2117,32698,-2117,32698,-2117,32698,-2117,
                                  32668,-2540,32668,-2540,32668,-2540,32668,-2540,
                                  32632,-2962,32632,-2962,32632,-2962,32632,-2962,
                                  32591,-3383,32591,-3383,32591,-3383,32591,-3383,
                                  32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                  32493,-4225,32493,-4225,32493,-4225,32493,-4225,
                                  32436,-4645,32436,-4645,32436,-4645,32436,-4645,
                                  32373,-5064,32373,-5064,32373,-5064,32373,-5064,
                                  32305,-5482,32305,-5482,32305,-5482,32305,-5482,
                                  32231,-5899,32231,-5899,32231,-5899,32231,-5899,
                                  32152,-6315,32152,-6315,32152,-6315,32152,-6315,
                                  32068,-6730,32068,-6730,32068,-6730,32068,-6730,
                                  31978,-7144,31978,-7144,31978,-7144,31978,-7144,
                                  31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                  31783,-7969,31783,-7969,31783,-7969,31783,-7969,
                                  31677,-8379,31677,-8379,31677,-8379,31677,-8379,
                                  31566,-8788,31566,-8788,31566,-8788,31566,-8788,
                                  31450,-9195,31450,-9195,31450,-9195,31450,-9195,
                                  31329,-9601,31329,-9601,31329,-9601,31329,-9601,
                                  31202,-10005,31202,-10005,31202,-10005,31202,-10005,
                                  31070,-10408,31070,-10408,31070,-10408,31070,-10408,
                                  30933,-10808,30933,-10808,30933,-10808,30933,-10808,
                                  30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                  30643,-11605,30643,-11605,30643,-11605,30643,-11605,
                                  30490,-12000,30490,-12000,30490,-12000,30490,-12000,
                                  30333,-12393,30333,-12393,30333,-12393,30333,-12393,
                                  30170,-12784,30170,-12784,30170,-12784,30170,-12784,
                                  30002,-13173,30002,-13173,30002,-13173,30002,-13173,
                                  29829,-13560,29829,-13560,29829,-13560,29829,-13560,
                                  29652,-13944,29652,-13944,29652,-13944,29652,-13944,
                                  29469,-14327,29469,-14327,29469,-14327,29469,-14327,
                                  29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                  29089,-15084,29089,-15084,29089,-15084,29089,-15084,
                                  28891,-15458,28891,-15458,28891,-15458,28891,-15458,
                                  28689,-15831,28689,-15831,28689,-15831,28689,-15831,
                                  28482,-16200,28482,-16200,28482,-16200,28482,-16200,
                                  28270,-16567,28270,-16567,28270,-16567,28270,-16567,
                                  28054,-16931,28054,-16931,28054,-16931,28054,-16931,
                                  27832,-17292,27832,-17292,27832,-17292,27832,-17292,
                                  27606,-17651,27606,-17651,27606,-17651,27606,-17651,
                                  27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                  27141,-18359,27141,-18359,27141,-18359,27141,-18359,
                                  26901,-18708,26901,-18708,26901,-18708,26901,-18708,
                                  26657,-19054,26657,-19054,26657,-19054,26657,-19054,
                                  26409,-19397,26409,-19397,26409,-19397,26409,-19397,
                                  26156,-19737,26156,-19737,26156,-19737,26156,-19737,
                                  25898,-20074,25898,-20074,25898,-20074,25898,-20074,
                                  25637,-20407,25637,-20407,25637,-20407,25637,-20407,
                                  25371,-20736,25371,-20736,25371,-20736,25371,-20736,
                                  25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                  24826,-21385,24826,-21385,24826,-21385,24826,-21385,
                                  24548,-21705,24548,-21705,24548,-21705,24548,-21705,
                                  24265,-22020,24265,-22020,24265,-22020,24265,-22020,
                                  23978,-22332,23978,-22332,23978,-22332,23978,-22332,
                                  23688,-22640,23688,-22640,23688,-22640,23688,-22640,
                                  23393,-22945,23393,-22945,23393,-22945,23393,-22945,
                                  23094,-23245,23094,-23245,23094,-23245,23094,-23245,
                                  22792,-23542,22792,-23542,22792,-23542,22792,-23542,
                                  22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                  22176,-24123,22176,-24123,22176,-24123,22176,-24123,
                                  21862,-24408,21862,-24408,21862,-24408,21862,-24408,
                                  21545,-24688,21545,-24688,21545,-24688,21545,-24688,
                                  21224,-24965,21224,-24965,21224,-24965,21224,-24965,
                                  20899,-25237,20899,-25237,20899,-25237,20899,-25237,
                                  20571,-25505,20571,-25505,20571,-25505,20571,-25505,
                                  20240,-25769,20240,-25769,20240,-25769,20240,-25769,
                                  19905,-26029,19905,-26029,19905,-26029,19905,-26029,
                                  19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                  19225,-26534,19225,-26534,19225,-26534,19225,-26534,
                                  18881,-26781,18881,-26781,18881,-26781,18881,-26781,
                                  18533,-27023,18533,-27023,18533,-27023,18533,-27023,
                                  18182,-27260,18182,-27260,18182,-27260,18182,-27260,
                                  17828,-27493,17828,-27493,17828,-27493,17828,-27493,
                                  17471,-27721,17471,-27721,17471,-27721,17471,-27721,
                                  17111,-27944,17111,-27944,17111,-27944,17111,-27944,
                                  16748,-28163,16748,-28163,16748,-28163,16748,-28163,
                                  16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                  16015,-28587,16015,-28587,16015,-28587,16015,-28587,
                                  15644,-28792,15644,-28792,15644,-28792,15644,-28792,
                                  15270,-28991,15270,-28991,15270,-28991,15270,-28991,
                                  14894,-29186,14894,-29186,14894,-29186,14894,-29186,
                                  14516,-29377,14516,-29377,14516,-29377,14516,-29377,
                                  14135,-29562,14135,-29562,14135,-29562,14135,-29562,
                                  13751,-29742,13751,-29742,13751,-29742,13751,-29742,
                                  13366,-29917,13366,-29917,13366,-29917,13366,-29917,
                                  12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                  12588,-30253,12588,-30253,12588,-30253,12588,-30253,
                                  12196,-30413,12196,-30413,12196,-30413,12196,-30413,
                                  11801,-30568,11801,-30568,11801,-30568,11801,-30568,
                                  11405,-30718,11405,-30718,11405,-30718,11405,-30718,
                                  11007,-30863,11007,-30863,11007,-30863,11007,-30863,
                                  10607,-31003,10607,-31003,10607,-31003,10607,-31003,
                                  10206,-31137,10206,-31137,10206,-31137,10206,-31137,
                                  9802,-31267,9802,-31267,9802,-31267,9802,-31267,
                                  9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                  8991,-31510,8991,-31510,8991,-31510,8991,-31510,
                                  8582,-31623,8582,-31623,8582,-31623,8582,-31623,
                                  8173,-31732,8173,-31732,8173,-31732,8173,-31732,
                                  7762,-31835,7762,-31835,7762,-31835,7762,-31835,
                                  7350,-31932,7350,-31932,7350,-31932,7350,-31932,
                                  6936,-32025,6936,-32025,6936,-32025,6936,-32025,
                                  6522,-32112,6522,-32112,6522,-32112,6522,-32112,
                                  6106,-32193,6106,-32193,6106,-32193,6106,-32193,
                                  5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                  5272,-32341,5272,-32341,5272,-32341,5272,-32341,
                                  4853,-32406,4853,-32406,4853,-32406,4853,-32406,
                                  4434,-32466,4434,-32466,4434,-32466,4434,-32466,
                                  4014,-32521,4014,-32521,4014,-32521,4014,-32521,
                                  3593,-32570,3593,-32570,3593,-32570,3593,-32570,
                                  3172,-32614,3172,-32614,3172,-32614,3172,-32614,
                                  2750,-32652,2750,-32652,2750,-32652,2750,-32652,
                                  2327,-32685,2327,-32685,2327,-32685,2327,-32685,
                                  1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                  1482,-32734,1482,-32734,1482,-32734,1482,-32734,
                                  1058,-32750,1058,-32750,1058,-32750,1058,-32750,
                                  635,-32761,635,-32761,635,-32761,635,-32761,
                                  211,-32767,211,-32767,211,-32767,211,-32767,
                                  -212,-32767,-212,-32767,-212,-32767,-212,-32767,
                                  -636,-32761,-636,-32761,-636,-32761,-636,-32761,
                                  -1059,-32750,-1059,-32750,-1059,-32750,-1059,-32750,
                                  -1483,-32734,-1483,-32734,-1483,-32734,-1483,-32734,
                                  -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                  -2328,-32685,-2328,-32685,-2328,-32685,-2328,-32685,
                                  -2751,-32652,-2751,-32652,-2751,-32652,-2751,-32652,
                                  -3173,-32614,-3173,-32614,-3173,-32614,-3173,-32614,
                                  -3594,-32570,-3594,-32570,-3594,-32570,-3594,-32570,
                                  -4015,-32521,-4015,-32521,-4015,-32521,-4015,-32521,
                                  -4435,-32466,-4435,-32466,-4435,-32466,-4435,-32466,
                                  -4854,-32406,-4854,-32406,-4854,-32406,-4854,-32406,
                                  -5273,-32341,-5273,-32341,-5273,-32341,-5273,-32341,
                                  -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                  -6107,-32193,-6107,-32193,-6107,-32193,-6107,-32193,
                                  -6523,-32112,-6523,-32112,-6523,-32112,-6523,-32112,
                                  -6937,-32025,-6937,-32025,-6937,-32025,-6937,-32025,
                                  -7351,-31932,-7351,-31932,-7351,-31932,-7351,-31932,
                                  -7763,-31835,-7763,-31835,-7763,-31835,-7763,-31835,
                                  -8174,-31732,-8174,-31732,-8174,-31732,-8174,-31732,
                                  -8583,-31623,-8583,-31623,-8583,-31623,-8583,-31623,
                                  -8992,-31510,-8992,-31510,-8992,-31510,-8992,-31510,
                                  -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                  -9803,-31267,-9803,-31267,-9803,-31267,-9803,-31267,
                                  -10207,-31137,-10207,-31137,-10207,-31137,-10207,-31137,
                                  -10608,-31003,-10608,-31003,-10608,-31003,-10608,-31003,
                                  -11008,-30863,-11008,-30863,-11008,-30863,-11008,-30863,
                                  -11406,-30718,-11406,-30718,-11406,-30718,-11406,-30718,
                                  -11802,-30568,-11802,-30568,-11802,-30568,-11802,-30568,
                                  -12197,-30413,-12197,-30413,-12197,-30413,-12197,-30413,
                                  -12589,-30253,-12589,-30253,-12589,-30253,-12589,-30253,
                                  -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                  -13367,-29917,-13367,-29917,-13367,-29917,-13367,-29917,
                                  -13752,-29742,-13752,-29742,-13752,-29742,-13752,-29742,
                                  -14136,-29562,-14136,-29562,-14136,-29562,-14136,-29562,
                                  -14517,-29377,-14517,-29377,-14517,-29377,-14517,-29377,
                                  -14895,-29186,-14895,-29186,-14895,-29186,-14895,-29186,
                                  -15271,-28991,-15271,-28991,-15271,-28991,-15271,-28991,
                                  -15645,-28792,-15645,-28792,-15645,-28792,-15645,-28792,
                                  -16016,-28587,-16016,-28587,-16016,-28587,-16016,-28587,
                                  -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                  -16749,-28163,-16749,-28163,-16749,-28163,-16749,-28163,
                                  -17112,-27944,-17112,-27944,-17112,-27944,-17112,-27944,
                                  -17472,-27721,-17472,-27721,-17472,-27721,-17472,-27721,
                                  -17829,-27493,-17829,-27493,-17829,-27493,-17829,-27493,
                                  -18183,-27260,-18183,-27260,-18183,-27260,-18183,-27260,
                                  -18534,-27023,-18534,-27023,-18534,-27023,-18534,-27023,
                                  -18882,-26781,-18882,-26781,-18882,-26781,-18882,-26781,
                                  -19226,-26534,-19226,-26534,-19226,-26534,-19226,-26534,
                                  -19568,-26284,-19568,-26284,-19568,-26284,-19568,-26284,
                                  -19906,-26029,-19906,-26029,-19906,-26029,-19906,-26029,
                                  -20241,-25769,-20241,-25769,-20241,-25769,-20241,-25769,
                                  -20572,-25505,-20572,-25505,-20572,-25505,-20572,-25505,
                                  -20900,-25237,-20900,-25237,-20900,-25237,-20900,-25237,
                                  -21225,-24965,-21225,-24965,-21225,-24965,-21225,-24965,
                                  -21546,-24688,-21546,-24688,-21546,-24688,-21546,-24688,
                                  -21863,-24408,-21863,-24408,-21863,-24408,-21863,-24408,
                                  -22177,-24123,-22177,-24123,-22177,-24123,-22177,-24123,
                                  -22487,-23834,-22487,-23834,-22487,-23834,-22487,-23834,
                                  -22793,-23542,-22793,-23542,-22793,-23542,-22793,-23542,
                                  -23095,-23245,-23095,-23245,-23095,-23245,-23095,-23245,
                                  -23394,-22945,-23394,-22945,-23394,-22945,-23394,-22945,
                                  -23689,-22640,-23689,-22640,-23689,-22640,-23689,-22640,
                                  -23979,-22332,-23979,-22332,-23979,-22332,-23979,-22332,
                                  -24266,-22020,-24266,-22020,-24266,-22020,-24266,-22020,
                                  -24549,-21705,-24549,-21705,-24549,-21705,-24549,-21705,
                                  -24827,-21385,-24827,-21385,-24827,-21385,-24827,-21385,
                                  -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                  -25372,-20736,-25372,-20736,-25372,-20736,-25372,-20736,
                                  -25638,-20407,-25638,-20407,-25638,-20407,-25638,-20407,
                                  -25899,-20074,-25899,-20074,-25899,-20074,-25899,-20074,
                                  -26157,-19737,-26157,-19737,-26157,-19737,-26157,-19737,
                                  -26410,-19397,-26410,-19397,-26410,-19397,-26410,-19397,
                                  -26658,-19054,-26658,-19054,-26658,-19054,-26658,-19054,
                                  -26902,-18708,-26902,-18708,-26902,-18708,-26902,-18708,
                                  -27142,-18359,-27142,-18359,-27142,-18359,-27142,-18359,
                                  -27377,-18006,-27377,-18006,-27377,-18006,-27377,-18006,
                                  -27607,-17651,-27607,-17651,-27607,-17651,-27607,-17651,
                                  -27833,-17292,-27833,-17292,-27833,-17292,-27833,-17292,
                                  -28055,-16931,-28055,-16931,-28055,-16931,-28055,-16931,
                                  -28271,-16567,-28271,-16567,-28271,-16567,-28271,-16567,
                                  -28483,-16200,-28483,-16200,-28483,-16200,-28483,-16200,
                                  -28690,-15831,-28690,-15831,-28690,-15831,-28690,-15831,
                                  -28892,-15458,-28892,-15458,-28892,-15458,-28892,-15458,
                                  -29090,-15084,-29090,-15084,-29090,-15084,-29090,-15084,
                                  -29282,-14706,-29282,-14706,-29282,-14706,-29282,-14706,
                                  -29470,-14327,-29470,-14327,-29470,-14327,-29470,-14327,
                                  -29653,-13944,-29653,-13944,-29653,-13944,-29653,-13944,
                                  -29830,-13560,-29830,-13560,-29830,-13560,-29830,-13560,
                                  -30003,-13173,-30003,-13173,-30003,-13173,-30003,-13173,
                                  -30171,-12784,-30171,-12784,-30171,-12784,-30171,-12784,
                                  -30334,-12393,-30334,-12393,-30334,-12393,-30334,-12393,
                                  -30491,-12000,-30491,-12000,-30491,-12000,-30491,-12000,
                                  -30644,-11605,-30644,-11605,-30644,-11605,-30644,-11605,
                                  -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                  -30934,-10808,-30934,-10808,-30934,-10808,-30934,-10808,
                                  -31071,-10408,-31071,-10408,-31071,-10408,-31071,-10408,
                                  -31203,-10005,-31203,-10005,-31203,-10005,-31203,-10005,
                                  -31330,-9601,-31330,-9601,-31330,-9601,-31330,-9601,
                                  -31451,-9195,-31451,-9195,-31451,-9195,-31451,-9195,
                                  -31567,-8788,-31567,-8788,-31567,-8788,-31567,-8788,
                                  -31678,-8379,-31678,-8379,-31678,-8379,-31678,-8379,
                                  -31784,-7969,-31784,-7969,-31784,-7969,-31784,-7969,
                                  -31884,-7557,-31884,-7557,-31884,-7557,-31884,-7557,
                                  -31979,-7144,-31979,-7144,-31979,-7144,-31979,-7144,
                                  -32069,-6730,-32069,-6730,-32069,-6730,-32069,-6730,
                                  -32153,-6315,-32153,-6315,-32153,-6315,-32153,-6315,
                                  -32232,-5899,-32232,-5899,-32232,-5899,-32232,-5899,
                                  -32306,-5482,-32306,-5482,-32306,-5482,-32306,-5482,
                                  -32374,-5064,-32374,-5064,-32374,-5064,-32374,-5064,
                                  -32437,-4645,-32437,-4645,-32437,-4645,-32437,-4645,
                                  -32494,-4225,-32494,-4225,-32494,-4225,-32494,-4225,
                                  -32546,-3805,-32546,-3805,-32546,-3805,-32546,-3805,
                                  -32592,-3383,-32592,-3383,-32592,-3383,-32592,-3383,
                                  -32633,-2962,-32633,-2962,-32633,-2962,-32633,-2962,
                                  -32669,-2540,-32669,-2540,-32669,-2540,-32669,-2540,
                                  -32699,-2117,-32699,-2117,-32699,-2117,-32699,-2117,
                                  -32724,-1694,-32724,-1694,-32724,-1694,-32724,-1694,
                                  -32743,-1271,-32743,-1271,-32743,-1271,-32743,-1271,
                                  -32757,-848,-32757,-848,-32757,-848,-32757,-848,
                                  -32765,-424,-32765,-424,-32765,-424,-32765,-424,
                                  -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                  -32765,423,-32765,423,-32765,423,-32765,423,
                                  -32757,847,-32757,847,-32757,847,-32757,847,
                                  -32743,1270,-32743,1270,-32743,1270,-32743,1270,
                                  -32724,1693,-32724,1693,-32724,1693,-32724,1693,
                                  -32699,2116,-32699,2116,-32699,2116,-32699,2116,
                                  -32669,2539,-32669,2539,-32669,2539,-32669,2539,
                                  -32633,2961,-32633,2961,-32633,2961,-32633,2961,
                                  -32592,3382,-32592,3382,-32592,3382,-32592,3382,
                                  -32546,3804,-32546,3804,-32546,3804,-32546,3804,
                                  -32494,4224,-32494,4224,-32494,4224,-32494,4224,
                                  -32437,4644,-32437,4644,-32437,4644,-32437,4644,
                                  -32374,5063,-32374,5063,-32374,5063,-32374,5063,
                                  -32306,5481,-32306,5481,-32306,5481,-32306,5481,
                                  -32232,5898,-32232,5898,-32232,5898,-32232,5898,
                                  -32153,6314,-32153,6314,-32153,6314,-32153,6314,
                                  -32069,6729,-32069,6729,-32069,6729,-32069,6729,
                                  -31979,7143,-31979,7143,-31979,7143,-31979,7143,
                                  -31884,7556,-31884,7556,-31884,7556,-31884,7556,
                                  -31784,7968,-31784,7968,-31784,7968,-31784,7968,
                                  -31678,8378,-31678,8378,-31678,8378,-31678,8378,
                                  -31567,8787,-31567,8787,-31567,8787,-31567,8787,
                                  -31451,9194,-31451,9194,-31451,9194,-31451,9194,
                                  -31330,9600,-31330,9600,-31330,9600,-31330,9600,
                                  -31203,10004,-31203,10004,-31203,10004,-31203,10004,
                                  -31071,10407,-31071,10407,-31071,10407,-31071,10407,
                                  -30934,10807,-30934,10807,-30934,10807,-30934,10807,
                                  -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                  -30644,11604,-30644,11604,-30644,11604,-30644,11604,
                                  -30491,11999,-30491,11999,-30491,11999,-30491,11999,
                                  -30334,12392,-30334,12392,-30334,12392,-30334,12392,
                                  -30171,12783,-30171,12783,-30171,12783,-30171,12783,
                                  -30003,13172,-30003,13172,-30003,13172,-30003,13172,
                                  -29830,13559,-29830,13559,-29830,13559,-29830,13559,
                                  -29653,13943,-29653,13943,-29653,13943,-29653,13943,
                                  -29470,14326,-29470,14326,-29470,14326,-29470,14326,
                                  -29282,14705,-29282,14705,-29282,14705,-29282,14705,
                                  -29090,15083,-29090,15083,-29090,15083,-29090,15083,
                                  -28892,15457,-28892,15457,-28892,15457,-28892,15457,
                                  -28690,15830,-28690,15830,-28690,15830,-28690,15830,
                                  -28483,16199,-28483,16199,-28483,16199,-28483,16199,
                                  -28271,16566,-28271,16566,-28271,16566,-28271,16566,
                                  -28055,16930,-28055,16930,-28055,16930,-28055,16930,
                                  -27833,17291,-27833,17291,-27833,17291,-27833,17291,
                                  -27607,17650,-27607,17650,-27607,17650,-27607,17650,
                                  -27377,18005,-27377,18005,-27377,18005,-27377,18005,
                                  -27142,18358,-27142,18358,-27142,18358,-27142,18358,
                                  -26902,18707,-26902,18707,-26902,18707,-26902,18707,
                                  -26658,19053,-26658,19053,-26658,19053,-26658,19053,
                                  -26410,19396,-26410,19396,-26410,19396,-26410,19396,
                                  -26157,19736,-26157,19736,-26157,19736,-26157,19736,
                                  -25899,20073,-25899,20073,-25899,20073,-25899,20073,
                                  -25638,20406,-25638,20406,-25638,20406,-25638,20406,
                                  -25372,20735,-25372,20735,-25372,20735,-25372,20735,
                                  -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                  -24827,21384,-24827,21384,-24827,21384,-24827,21384,
                                  -24549,21704,-24549,21704,-24549,21704,-24549,21704,
                                  -24266,22019,-24266,22019,-24266,22019,-24266,22019,
                                  -23979,22331,-23979,22331,-23979,22331,-23979,22331,
                                  -23689,22639,-23689,22639,-23689,22639,-23689,22639,
                                  -23394,22944,-23394,22944,-23394,22944,-23394,22944,
                                  -23095,23244,-23095,23244,-23095,23244,-23095,23244,
                                  -22793,23541,-22793,23541,-22793,23541,-22793,23541,
                                  -22487,23833,-22487,23833,-22487,23833,-22487,23833,
                                  -22177,24122,-22177,24122,-22177,24122,-22177,24122,
                                  -21863,24407,-21863,24407,-21863,24407,-21863,24407,
                                  -21546,24687,-21546,24687,-21546,24687,-21546,24687,
                                  -21225,24964,-21225,24964,-21225,24964,-21225,24964,
                                  -20900,25236,-20900,25236,-20900,25236,-20900,25236,
                                  -20572,25504,-20572,25504,-20572,25504,-20572,25504,
                                  -20241,25768,-20241,25768,-20241,25768,-20241,25768,
                                  -19906,26028,-19906,26028,-19906,26028,-19906,26028,
                                  -19568,26283,-19568,26283,-19568,26283,-19568,26283,
                                  -19226,26533,-19226,26533,-19226,26533,-19226,26533,
                                  -18882,26780,-18882,26780,-18882,26780,-18882,26780,
                                  -18534,27022,-18534,27022,-18534,27022,-18534,27022,
                                  -18183,27259,-18183,27259,-18183,27259,-18183,27259,
                                  -17829,27492,-17829,27492,-17829,27492,-17829,27492,
                                  -17472,27720,-17472,27720,-17472,27720,-17472,27720,
                                  -17112,27943,-17112,27943,-17112,27943,-17112,27943,
                                  -16749,28162,-16749,28162,-16749,28162,-16749,28162
                                 };

void dft972(int16_t *x,int16_t *y,unsigned char scale_flag)  // 324 x 3
{
Raymond Knopp's avatar
 
Raymond Knopp committed
13349
  int i,j;
13350 13351 13352 13353 13354 13355
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa972[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb972[0];
  simd_q15_t x2128[972];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[972];//=&ytmp128array3[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
13356 13357 13358



13359
  for (i=0,j=0; i<324; i++,j+=3) {
Raymond Knopp's avatar
 
Raymond Knopp committed
13360 13361 13362 13363 13364 13365 13366 13367 13368 13369
    x2128[i]    = x128[j];
    x2128[i+324] = x128[j+1];
    x2128[i+648] = x128[j+2];
  }

  dft324((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft324((int16_t *)(x2128+324),(int16_t *)(ytmp128+324),1);
  dft324((int16_t *)(x2128+648),(int16_t *)(ytmp128+648),1);

  bfly3_tw1(ytmp128,ytmp128+324,ytmp128+648,y128,y128+324,y128+648);
13370 13371

  for (i=1,j=0; i<324; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
13372
    bfly3(ytmp128+i,
13373 13374 13375 13376 13377 13378 13379
          ytmp128+324+i,
          ytmp128+648+i,
          y128+i,
          y128+324+i,
          y128+648+i,
          twa128+j,
          twb128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
13380 13381 13382
  }

  if (scale_flag==1) {
13383
    norm128 = set1_int16(dft_norm_table[14]);
13384 13385

    for (i=0; i<972; i++) {
13386
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419
    }
  }

  _mm_empty();
  _m_empty();

};

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:359)/1080));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:359)/1080));
twa2 = zeros(1,2*359);
twb2 = zeros(1,2*359);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa1080[359*2*4] = {");
for i=1:2:(2*358)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"static int16_t twb1080[359*2*4] = {");
for i=1:2:(2*358)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fclose(fd);
*/
static int16_t twa1080[359*2*4] = {32766,-191,32766,-191,32766,-191,32766,-191,
13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778
                                   32764,-382,32764,-382,32764,-382,32764,-382,
                                   32762,-572,32762,-572,32762,-572,32762,-572,
                                   32758,-763,32758,-763,32758,-763,32758,-763,
                                   32753,-954,32753,-954,32753,-954,32753,-954,
                                   32747,-1144,32747,-1144,32747,-1144,32747,-1144,
                                   32739,-1335,32739,-1335,32739,-1335,32739,-1335,
                                   32731,-1525,32731,-1525,32731,-1525,32731,-1525,
                                   32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                                   32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                   32699,-2096,32699,-2096,32699,-2096,32699,-2096,
                                   32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                   32673,-2476,32673,-2476,32673,-2476,32673,-2476,
                                   32658,-2666,32658,-2666,32658,-2666,32658,-2666,
                                   32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                   32625,-3046,32625,-3046,32625,-3046,32625,-3046,
                                   32606,-3236,32606,-3236,32606,-3236,32606,-3236,
                                   32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                   32567,-3615,32567,-3615,32567,-3615,32567,-3615,
                                   32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                   32522,-3994,32522,-3994,32522,-3994,32522,-3994,
                                   32498,-4183,32498,-4183,32498,-4183,32498,-4183,
                                   32474,-4372,32474,-4372,32474,-4372,32474,-4372,
                                   32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                   32421,-4749,32421,-4749,32421,-4749,32421,-4749,
                                   32392,-4938,32392,-4938,32392,-4938,32392,-4938,
                                   32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                                   32333,-5315,32333,-5315,32333,-5315,32333,-5315,
                                   32301,-5503,32301,-5503,32301,-5503,32301,-5503,
                                   32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                   32235,-5878,32235,-5878,32235,-5878,32235,-5878,
                                   32200,-6066,32200,-6066,32200,-6066,32200,-6066,
                                   32164,-6253,32164,-6253,32164,-6253,32164,-6253,
                                   32128,-6440,32128,-6440,32128,-6440,32128,-6440,
                                   32090,-6627,32090,-6627,32090,-6627,32090,-6627,
                                   32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                   32010,-6999,32010,-6999,32010,-6999,32010,-6999,
                                   31969,-7186,31969,-7186,31969,-7186,31969,-7186,
                                   31927,-7371,31927,-7371,31927,-7371,31927,-7371,
                                   31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                   31839,-7742,31839,-7742,31839,-7742,31839,-7742,
                                   31793,-7928,31793,-7928,31793,-7928,31793,-7928,
                                   31747,-8112,31747,-8112,31747,-8112,31747,-8112,
                                   31699,-8297,31699,-8297,31699,-8297,31699,-8297,
                                   31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                   31600,-8665,31600,-8665,31600,-8665,31600,-8665,
                                   31549,-8849,31549,-8849,31549,-8849,31549,-8849,
                                   31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                   31444,-9215,31444,-9215,31444,-9215,31444,-9215,
                                   31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                   31335,-9581,31335,-9581,31335,-9581,31335,-9581,
                                   31278,-9763,31278,-9763,31278,-9763,31278,-9763,
                                   31221,-9945,31221,-9945,31221,-9945,31221,-9945,
                                   31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                   31103,-10307,31103,-10307,31103,-10307,31103,-10307,
                                   31043,-10488,31043,-10488,31043,-10488,31043,-10488,
                                   30981,-10668,30981,-10668,30981,-10668,30981,-10668,
                                   30919,-10848,30919,-10848,30919,-10848,30919,-10848,
                                   30855,-11028,30855,-11028,30855,-11028,30855,-11028,
                                   30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                   30725,-11386,30725,-11386,30725,-11386,30725,-11386,
                                   30658,-11565,30658,-11565,30658,-11565,30658,-11565,
                                   30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                                   30521,-11921,30521,-11921,30521,-11921,30521,-11921,
                                   30451,-12098,30451,-12098,30451,-12098,30451,-12098,
                                   30381,-12275,30381,-12275,30381,-12275,30381,-12275,
                                   30309,-12452,30309,-12452,30309,-12452,30309,-12452,
                                   30236,-12628,30236,-12628,30236,-12628,30236,-12628,
                                   30162,-12804,30162,-12804,30162,-12804,30162,-12804,
                                   30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                   30011,-13154,30011,-13154,30011,-13154,30011,-13154,
                                   29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                   29856,-13502,29856,-13502,29856,-13502,29856,-13502,
                                   29777,-13675,29777,-13675,29777,-13675,29777,-13675,
                                   29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                   29615,-14021,29615,-14021,29615,-14021,29615,-14021,
                                   29533,-14193,29533,-14193,29533,-14193,29533,-14193,
                                   29450,-14365,29450,-14365,29450,-14365,29450,-14365,
                                   29366,-14536,29366,-14536,29366,-14536,29366,-14536,
                                   29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                   29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                                   29108,-15046,29108,-15046,29108,-15046,29108,-15046,
                                   29020,-15215,29020,-15215,29020,-15215,29020,-15215,
                                   28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                   28841,-15552,28841,-15552,28841,-15552,28841,-15552,
                                   28750,-15719,28750,-15719,28750,-15719,28750,-15719,
                                   28658,-15886,28658,-15886,28658,-15886,28658,-15886,
                                   28565,-16053,28565,-16053,28565,-16053,28565,-16053,
                                   28471,-16219,28471,-16219,28471,-16219,28471,-16219,
                                   28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                   28281,-16549,28281,-16549,28281,-16549,28281,-16549,
                                   28184,-16713,28184,-16713,28184,-16713,28184,-16713,
                                   28086,-16877,28086,-16877,28086,-16877,28086,-16877,
                                   27988,-17040,27988,-17040,27988,-17040,27988,-17040,
                                   27888,-17202,27888,-17202,27888,-17202,27888,-17202,
                                   27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                   27686,-17526,27686,-17526,27686,-17526,27686,-17526,
                                   27584,-17687,27584,-17687,27584,-17687,27584,-17687,
                                   27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                                   27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                   27271,-18165,27271,-18165,27271,-18165,27271,-18165,
                                   27165,-18324,27165,-18324,27165,-18324,27165,-18324,
                                   27058,-18481,27058,-18481,27058,-18481,27058,-18481,
                                   26950,-18638,26950,-18638,26950,-18638,26950,-18638,
                                   26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                   26731,-18951,26731,-18951,26731,-18951,26731,-18951,
                                   26620,-19106,26620,-19106,26620,-19106,26620,-19106,
                                   26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                   26396,-19414,26396,-19414,26396,-19414,26396,-19414,
                                   26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                   26168,-19720,26168,-19720,26168,-19720,26168,-19720,
                                   26053,-19872,26053,-19872,26053,-19872,26053,-19872,
                                   25937,-20023,25937,-20023,25937,-20023,25937,-20023,
                                   25820,-20174,25820,-20174,25820,-20174,25820,-20174,
                                   25702,-20324,25702,-20324,25702,-20324,25702,-20324,
                                   25584,-20473,25584,-20473,25584,-20473,25584,-20473,
                                   25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                                   25344,-20769,25344,-20769,25344,-20769,25344,-20769,
                                   25223,-20916,25223,-20916,25223,-20916,25223,-20916,
                                   25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                   24978,-21208,24978,-21208,24978,-21208,24978,-21208,
                                   24854,-21353,24854,-21353,24854,-21353,24854,-21353,
                                   24729,-21498,24729,-21498,24729,-21498,24729,-21498,
                                   24604,-21641,24604,-21641,24604,-21641,24604,-21641,
                                   24477,-21784,24477,-21784,24477,-21784,24477,-21784,
                                   24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                   24222,-22067,24222,-22067,24222,-22067,24222,-22067,
                                   24093,-22208,24093,-22208,24093,-22208,24093,-22208,
                                   23964,-22348,23964,-22348,23964,-22348,23964,-22348,
                                   23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                   23702,-22625,23702,-22625,23702,-22625,23702,-22625,
                                   23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                   23437,-22899,23437,-22899,23437,-22899,23437,-22899,
                                   23304,-23035,23304,-23035,23304,-23035,23304,-23035,
                                   23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                   23034,-23305,23034,-23305,23034,-23305,23034,-23305,
                                   22898,-23438,22898,-23438,22898,-23438,22898,-23438,
                                   22761,-23571,22761,-23571,22761,-23571,22761,-23571,
                                   22624,-23703,22624,-23703,22624,-23703,22624,-23703,
                                   22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                   22347,-23965,22347,-23965,22347,-23965,22347,-23965,
                                   22207,-24094,22207,-24094,22207,-24094,22207,-24094,
                                   22066,-24223,22066,-24223,22066,-24223,22066,-24223,
                                   21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                   21783,-24478,21783,-24478,21783,-24478,21783,-24478,
                                   21640,-24605,21640,-24605,21640,-24605,21640,-24605,
                                   21497,-24730,21497,-24730,21497,-24730,21497,-24730,
                                   21352,-24855,21352,-24855,21352,-24855,21352,-24855,
                                   21207,-24979,21207,-24979,21207,-24979,21207,-24979,
                                   21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                   20915,-25224,20915,-25224,20915,-25224,20915,-25224,
                                   20768,-25345,20768,-25345,20768,-25345,20768,-25345,
                                   20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                                   20472,-25585,20472,-25585,20472,-25585,20472,-25585,
                                   20323,-25703,20323,-25703,20323,-25703,20323,-25703,
                                   20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                   20022,-25938,20022,-25938,20022,-25938,20022,-25938,
                                   19871,-26054,19871,-26054,19871,-26054,19871,-26054,
                                   19719,-26169,19719,-26169,19719,-26169,19719,-26169,
                                   19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                   19413,-26397,19413,-26397,19413,-26397,19413,-26397,
                                   19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                   19105,-26621,19105,-26621,19105,-26621,19105,-26621,
                                   18950,-26732,18950,-26732,18950,-26732,18950,-26732,
                                   18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                   18637,-26951,18637,-26951,18637,-26951,18637,-26951,
                                   18480,-27059,18480,-27059,18480,-27059,18480,-27059,
                                   18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                   18164,-27272,18164,-27272,18164,-27272,18164,-27272,
                                   18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                   17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                                   17686,-27585,17686,-27585,17686,-27585,17686,-27585,
                                   17525,-27687,17525,-27687,17525,-27687,17525,-27687,
                                   17363,-27788,17363,-27788,17363,-27788,17363,-27788,
                                   17201,-27889,17201,-27889,17201,-27889,17201,-27889,
                                   17039,-27989,17039,-27989,17039,-27989,17039,-27989,
                                   16876,-28087,16876,-28087,16876,-28087,16876,-28087,
                                   16712,-28185,16712,-28185,16712,-28185,16712,-28185,
                                   16548,-28282,16548,-28282,16548,-28282,16548,-28282,
                                   16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                   16218,-28472,16218,-28472,16218,-28472,16218,-28472,
                                   16052,-28566,16052,-28566,16052,-28566,16052,-28566,
                                   15885,-28659,15885,-28659,15885,-28659,15885,-28659,
                                   15718,-28751,15718,-28751,15718,-28751,15718,-28751,
                                   15551,-28842,15551,-28842,15551,-28842,15551,-28842,
                                   15383,-28932,15383,-28932,15383,-28932,15383,-28932,
                                   15214,-29021,15214,-29021,15214,-29021,15214,-29021,
                                   15045,-29109,15045,-29109,15045,-29109,15045,-29109,
                                   14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                                   14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                   14535,-29367,14535,-29367,14535,-29367,14535,-29367,
                                   14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                   14192,-29534,14192,-29534,14192,-29534,14192,-29534,
                                   14020,-29616,14020,-29616,14020,-29616,14020,-29616,
                                   13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                   13674,-29778,13674,-29778,13674,-29778,13674,-29778,
                                   13501,-29857,13501,-29857,13501,-29857,13501,-29857,
                                   13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                   13153,-30012,13153,-30012,13153,-30012,13153,-30012,
                                   12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                   12803,-30163,12803,-30163,12803,-30163,12803,-30163,
                                   12627,-30237,12627,-30237,12627,-30237,12627,-30237,
                                   12451,-30310,12451,-30310,12451,-30310,12451,-30310,
                                   12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                   12097,-30452,12097,-30452,12097,-30452,12097,-30452,
                                   11920,-30522,11920,-30522,11920,-30522,11920,-30522,
                                   11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                                   11564,-30659,11564,-30659,11564,-30659,11564,-30659,
                                   11385,-30726,11385,-30726,11385,-30726,11385,-30726,
                                   11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                   11027,-30856,11027,-30856,11027,-30856,11027,-30856,
                                   10847,-30920,10847,-30920,10847,-30920,10847,-30920,
                                   10667,-30982,10667,-30982,10667,-30982,10667,-30982,
                                   10487,-31044,10487,-31044,10487,-31044,10487,-31044,
                                   10306,-31104,10306,-31104,10306,-31104,10306,-31104,
                                   10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                   9944,-31222,9944,-31222,9944,-31222,9944,-31222,
                                   9762,-31279,9762,-31279,9762,-31279,9762,-31279,
                                   9580,-31336,9580,-31336,9580,-31336,9580,-31336,
                                   9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                   9214,-31445,9214,-31445,9214,-31445,9214,-31445,
                                   9031,-31498,9031,-31498,9031,-31498,9031,-31498,
                                   8848,-31550,8848,-31550,8848,-31550,8848,-31550,
                                   8664,-31601,8664,-31601,8664,-31601,8664,-31601,
                                   8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                   8296,-31700,8296,-31700,8296,-31700,8296,-31700,
                                   8111,-31748,8111,-31748,8111,-31748,8111,-31748,
                                   7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                   7741,-31840,7741,-31840,7741,-31840,7741,-31840,
                                   7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                   7370,-31928,7370,-31928,7370,-31928,7370,-31928,
                                   7185,-31970,7185,-31970,7185,-31970,7185,-31970,
                                   6998,-32011,6998,-32011,6998,-32011,6998,-32011,
                                   6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                   6626,-32091,6626,-32091,6626,-32091,6626,-32091,
                                   6439,-32129,6439,-32129,6439,-32129,6439,-32129,
                                   6252,-32165,6252,-32165,6252,-32165,6252,-32165,
                                   6065,-32201,6065,-32201,6065,-32201,6065,-32201,
                                   5877,-32236,5877,-32236,5877,-32236,5877,-32236,
                                   5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                   5502,-32302,5502,-32302,5502,-32302,5502,-32302,
                                   5314,-32334,5314,-32334,5314,-32334,5314,-32334,
                                   5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                                   4937,-32393,4937,-32393,4937,-32393,4937,-32393,
                                   4748,-32422,4748,-32422,4748,-32422,4748,-32422,
                                   4560,-32449,4560,-32449,4560,-32449,4560,-32449,
                                   4371,-32475,4371,-32475,4371,-32475,4371,-32475,
                                   4182,-32499,4182,-32499,4182,-32499,4182,-32499,
                                   3993,-32523,3993,-32523,3993,-32523,3993,-32523,
                                   3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                   3614,-32568,3614,-32568,3614,-32568,3614,-32568,
                                   3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                   3235,-32607,3235,-32607,3235,-32607,3235,-32607,
                                   3045,-32626,3045,-32626,3045,-32626,3045,-32626,
                                   2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                   2665,-32659,2665,-32659,2665,-32659,2665,-32659,
                                   2475,-32674,2475,-32674,2475,-32674,2475,-32674,
                                   2285,-32688,2285,-32688,2285,-32688,2285,-32688,
                                   2095,-32700,2095,-32700,2095,-32700,2095,-32700,
                                   1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                   1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                                   1524,-32732,1524,-32732,1524,-32732,1524,-32732,
                                   1334,-32740,1334,-32740,1334,-32740,1334,-32740,
                                   1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                   953,-32754,953,-32754,953,-32754,953,-32754,
                                   762,-32759,762,-32759,762,-32759,762,-32759,
                                   571,-32763,571,-32763,571,-32763,571,-32763,
                                   381,-32765,381,-32765,381,-32765,381,-32765,
                                   190,-32767,190,-32767,190,-32767,190,-32767,
                                   0,-32767,0,-32767,0,-32767,0,-32767,
                                   -191,-32767,-191,-32767,-191,-32767,-191,-32767,
                                   -382,-32765,-382,-32765,-382,-32765,-382,-32765,
                                   -572,-32763,-572,-32763,-572,-32763,-572,-32763,
                                   -763,-32759,-763,-32759,-763,-32759,-763,-32759,
                                   -954,-32754,-954,-32754,-954,-32754,-954,-32754,
                                   -1144,-32748,-1144,-32748,-1144,-32748,-1144,-32748,
                                   -1335,-32740,-1335,-32740,-1335,-32740,-1335,-32740,
                                   -1525,-32732,-1525,-32732,-1525,-32732,-1525,-32732,
                                   -1715,-32723,-1715,-32723,-1715,-32723,-1715,-32723,
                                   -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                   -2096,-32700,-2096,-32700,-2096,-32700,-2096,-32700,
                                   -2286,-32688,-2286,-32688,-2286,-32688,-2286,-32688,
                                   -2476,-32674,-2476,-32674,-2476,-32674,-2476,-32674,
                                   -2666,-32659,-2666,-32659,-2666,-32659,-2666,-32659,
                                   -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                   -3046,-32626,-3046,-32626,-3046,-32626,-3046,-32626,
                                   -3236,-32607,-3236,-32607,-3236,-32607,-3236,-32607,
                                   -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                   -3615,-32568,-3615,-32568,-3615,-32568,-3615,-32568,
                                   -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                   -3994,-32523,-3994,-32523,-3994,-32523,-3994,-32523,
                                   -4183,-32499,-4183,-32499,-4183,-32499,-4183,-32499,
                                   -4372,-32475,-4372,-32475,-4372,-32475,-4372,-32475,
                                   -4561,-32449,-4561,-32449,-4561,-32449,-4561,-32449,
                                   -4749,-32422,-4749,-32422,-4749,-32422,-4749,-32422,
                                   -4938,-32393,-4938,-32393,-4938,-32393,-4938,-32393,
                                   -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                                   -5315,-32334,-5315,-32334,-5315,-32334,-5315,-32334,
                                   -5503,-32302,-5503,-32302,-5503,-32302,-5503,-32302,
                                   -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                   -5878,-32236,-5878,-32236,-5878,-32236,-5878,-32236,
                                   -6066,-32201,-6066,-32201,-6066,-32201,-6066,-32201,
                                   -6253,-32165,-6253,-32165,-6253,-32165,-6253,-32165,
                                   -6440,-32129,-6440,-32129,-6440,-32129,-6440,-32129,
                                   -6627,-32091,-6627,-32091,-6627,-32091,-6627,-32091,
                                   -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                   -6999,-32011,-6999,-32011,-6999,-32011,-6999,-32011,
                                   -7186,-31970,-7186,-31970,-7186,-31970,-7186,-31970,
                                   -7371,-31928,-7371,-31928,-7371,-31928,-7371,-31928,
                                   -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                   -7742,-31840,-7742,-31840,-7742,-31840,-7742,-31840,
                                   -7928,-31794,-7928,-31794,-7928,-31794,-7928,-31794,
                                   -8112,-31748,-8112,-31748,-8112,-31748,-8112,-31748,
                                   -8297,-31700,-8297,-31700,-8297,-31700,-8297,-31700,
                                   -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                   -8665,-31601,-8665,-31601,-8665,-31601,-8665,-31601,
                                   -8849,-31550,-8849,-31550,-8849,-31550,-8849,-31550,
                                   -9032,-31498,-9032,-31498,-9032,-31498,-9032,-31498,
                                   -9215,-31445,-9215,-31445,-9215,-31445,-9215,-31445,
                                   -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                   -9581,-31336,-9581,-31336,-9581,-31336,-9581,-31336,
                                   -9763,-31279,-9763,-31279,-9763,-31279,-9763,-31279,
                                   -9945,-31222,-9945,-31222,-9945,-31222,-9945,-31222,
                                   -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                   -10307,-31104,-10307,-31104,-10307,-31104,-10307,-31104,
                                   -10488,-31044,-10488,-31044,-10488,-31044,-10488,-31044,
                                   -10668,-30982,-10668,-30982,-10668,-30982,-10668,-30982,
                                   -10848,-30920,-10848,-30920,-10848,-30920,-10848,-30920,
                                   -11028,-30856,-11028,-30856,-11028,-30856,-11028,-30856,
                                   -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                   -11386,-30726,-11386,-30726,-11386,-30726,-11386,-30726,
                                   -11565,-30659,-11565,-30659,-11565,-30659,-11565,-30659,
                                   -11743,-30591,-11743,-30591,-11743,-30591,-11743,-30591,
                                   -11921,-30522,-11921,-30522,-11921,-30522,-11921,-30522,
                                   -12098,-30452,-12098,-30452,-12098,-30452,-12098,-30452,
                                   -12275,-30382,-12275,-30382,-12275,-30382,-12275,-30382,
                                   -12452,-30310,-12452,-30310,-12452,-30310,-12452,-30310,
                                   -12628,-30237,-12628,-30237,-12628,-30237,-12628,-30237,
                                   -12804,-30163,-12804,-30163,-12804,-30163,-12804,-30163,
                                   -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                   -13154,-30012,-13154,-30012,-13154,-30012,-13154,-30012,
                                   -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                   -13502,-29857,-13502,-29857,-13502,-29857,-13502,-29857,
                                   -13675,-29778,-13675,-29778,-13675,-29778,-13675,-29778,
                                   -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                   -14021,-29616,-14021,-29616,-14021,-29616,-14021,-29616,
                                   -14193,-29534,-14193,-29534,-14193,-29534,-14193,-29534,
                                   -14365,-29451,-14365,-29451,-14365,-29451,-14365,-29451,
                                   -14536,-29367,-14536,-29367,-14536,-29367,-14536,-29367,
                                   -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                   -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                                   -15046,-29109,-15046,-29109,-15046,-29109,-15046,-29109,
                                   -15215,-29021,-15215,-29021,-15215,-29021,-15215,-29021,
                                   -15384,-28932,-15384,-28932,-15384,-28932,-15384,-28932,
                                   -15552,-28842,-15552,-28842,-15552,-28842,-15552,-28842,
                                   -15719,-28751,-15719,-28751,-15719,-28751,-15719,-28751,
                                   -15886,-28659,-15886,-28659,-15886,-28659,-15886,-28659,
                                   -16053,-28566,-16053,-28566,-16053,-28566,-16053,-28566,
                                   -16219,-28472,-16219,-28472,-16219,-28472,-16219,-28472
                                  };
Raymond Knopp's avatar
 
Raymond Knopp committed
13779
static int16_t twb1080[359*2*4] = {32764,-382,32764,-382,32764,-382,32764,-382,
13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141
                                   32758,-763,32758,-763,32758,-763,32758,-763,
                                   32747,-1144,32747,-1144,32747,-1144,32747,-1144,
                                   32731,-1525,32731,-1525,32731,-1525,32731,-1525,
                                   32711,-1906,32711,-1906,32711,-1906,32711,-1906,
                                   32687,-2286,32687,-2286,32687,-2286,32687,-2286,
                                   32658,-2666,32658,-2666,32658,-2666,32658,-2666,
                                   32625,-3046,32625,-3046,32625,-3046,32625,-3046,
                                   32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                                   32545,-3805,32545,-3805,32545,-3805,32545,-3805,
                                   32498,-4183,32498,-4183,32498,-4183,32498,-4183,
                                   32448,-4561,32448,-4561,32448,-4561,32448,-4561,
                                   32392,-4938,32392,-4938,32392,-4938,32392,-4938,
                                   32333,-5315,32333,-5315,32333,-5315,32333,-5315,
                                   32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                   32200,-6066,32200,-6066,32200,-6066,32200,-6066,
                                   32128,-6440,32128,-6440,32128,-6440,32128,-6440,
                                   32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                                   31969,-7186,31969,-7186,31969,-7186,31969,-7186,
                                   31883,-7557,31883,-7557,31883,-7557,31883,-7557,
                                   31793,-7928,31793,-7928,31793,-7928,31793,-7928,
                                   31699,-8297,31699,-8297,31699,-8297,31699,-8297,
                                   31600,-8665,31600,-8665,31600,-8665,31600,-8665,
                                   31497,-9032,31497,-9032,31497,-9032,31497,-9032,
                                   31390,-9398,31390,-9398,31390,-9398,31390,-9398,
                                   31278,-9763,31278,-9763,31278,-9763,31278,-9763,
                                   31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                                   31043,-10488,31043,-10488,31043,-10488,31043,-10488,
                                   30919,-10848,30919,-10848,30919,-10848,30919,-10848,
                                   30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                   30658,-11565,30658,-11565,30658,-11565,30658,-11565,
                                   30521,-11921,30521,-11921,30521,-11921,30521,-11921,
                                   30381,-12275,30381,-12275,30381,-12275,30381,-12275,
                                   30236,-12628,30236,-12628,30236,-12628,30236,-12628,
                                   30087,-12979,30087,-12979,30087,-12979,30087,-12979,
                                   29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                                   29777,-13675,29777,-13675,29777,-13675,29777,-13675,
                                   29615,-14021,29615,-14021,29615,-14021,29615,-14021,
                                   29450,-14365,29450,-14365,29450,-14365,29450,-14365,
                                   29281,-14706,29281,-14706,29281,-14706,29281,-14706,
                                   29108,-15046,29108,-15046,29108,-15046,29108,-15046,
                                   28931,-15384,28931,-15384,28931,-15384,28931,-15384,
                                   28750,-15719,28750,-15719,28750,-15719,28750,-15719,
                                   28565,-16053,28565,-16053,28565,-16053,28565,-16053,
                                   28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                   28184,-16713,28184,-16713,28184,-16713,28184,-16713,
                                   27988,-17040,27988,-17040,27988,-17040,27988,-17040,
                                   27787,-17364,27787,-17364,27787,-17364,27787,-17364,
                                   27584,-17687,27584,-17687,27584,-17687,27584,-17687,
                                   27376,-18006,27376,-18006,27376,-18006,27376,-18006,
                                   27165,-18324,27165,-18324,27165,-18324,27165,-18324,
                                   26950,-18638,26950,-18638,26950,-18638,26950,-18638,
                                   26731,-18951,26731,-18951,26731,-18951,26731,-18951,
                                   26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                                   26283,-19568,26283,-19568,26283,-19568,26283,-19568,
                                   26053,-19872,26053,-19872,26053,-19872,26053,-19872,
                                   25820,-20174,25820,-20174,25820,-20174,25820,-20174,
                                   25584,-20473,25584,-20473,25584,-20473,25584,-20473,
                                   25344,-20769,25344,-20769,25344,-20769,25344,-20769,
                                   25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                   24854,-21353,24854,-21353,24854,-21353,24854,-21353,
                                   24604,-21641,24604,-21641,24604,-21641,24604,-21641,
                                   24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                                   24093,-22208,24093,-22208,24093,-22208,24093,-22208,
                                   23833,-22487,23833,-22487,23833,-22487,23833,-22487,
                                   23570,-22762,23570,-22762,23570,-22762,23570,-22762,
                                   23304,-23035,23304,-23035,23304,-23035,23304,-23035,
                                   23034,-23305,23034,-23305,23034,-23305,23034,-23305,
                                   22761,-23571,22761,-23571,22761,-23571,22761,-23571,
                                   22486,-23834,22486,-23834,22486,-23834,22486,-23834,
                                   22207,-24094,22207,-24094,22207,-24094,22207,-24094,
                                   21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                                   21640,-24605,21640,-24605,21640,-24605,21640,-24605,
                                   21352,-24855,21352,-24855,21352,-24855,21352,-24855,
                                   21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                   20768,-25345,20768,-25345,20768,-25345,20768,-25345,
                                   20472,-25585,20472,-25585,20472,-25585,20472,-25585,
                                   20173,-25821,20173,-25821,20173,-25821,20173,-25821,
                                   19871,-26054,19871,-26054,19871,-26054,19871,-26054,
                                   19567,-26284,19567,-26284,19567,-26284,19567,-26284,
                                   19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                                   18950,-26732,18950,-26732,18950,-26732,18950,-26732,
                                   18637,-26951,18637,-26951,18637,-26951,18637,-26951,
                                   18323,-27166,18323,-27166,18323,-27166,18323,-27166,
                                   18005,-27377,18005,-27377,18005,-27377,18005,-27377,
                                   17686,-27585,17686,-27585,17686,-27585,17686,-27585,
                                   17363,-27788,17363,-27788,17363,-27788,17363,-27788,
                                   17039,-27989,17039,-27989,17039,-27989,17039,-27989,
                                   16712,-28185,16712,-28185,16712,-28185,16712,-28185,
                                   16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                   16052,-28566,16052,-28566,16052,-28566,16052,-28566,
                                   15718,-28751,15718,-28751,15718,-28751,15718,-28751,
                                   15383,-28932,15383,-28932,15383,-28932,15383,-28932,
                                   15045,-29109,15045,-29109,15045,-29109,15045,-29109,
                                   14705,-29282,14705,-29282,14705,-29282,14705,-29282,
                                   14364,-29451,14364,-29451,14364,-29451,14364,-29451,
                                   14020,-29616,14020,-29616,14020,-29616,14020,-29616,
                                   13674,-29778,13674,-29778,13674,-29778,13674,-29778,
                                   13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                                   12978,-30088,12978,-30088,12978,-30088,12978,-30088,
                                   12627,-30237,12627,-30237,12627,-30237,12627,-30237,
                                   12274,-30382,12274,-30382,12274,-30382,12274,-30382,
                                   11920,-30522,11920,-30522,11920,-30522,11920,-30522,
                                   11564,-30659,11564,-30659,11564,-30659,11564,-30659,
                                   11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                   10847,-30920,10847,-30920,10847,-30920,10847,-30920,
                                   10487,-31044,10487,-31044,10487,-31044,10487,-31044,
                                   10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                                   9762,-31279,9762,-31279,9762,-31279,9762,-31279,
                                   9397,-31391,9397,-31391,9397,-31391,9397,-31391,
                                   9031,-31498,9031,-31498,9031,-31498,9031,-31498,
                                   8664,-31601,8664,-31601,8664,-31601,8664,-31601,
                                   8296,-31700,8296,-31700,8296,-31700,8296,-31700,
                                   7927,-31794,7927,-31794,7927,-31794,7927,-31794,
                                   7556,-31884,7556,-31884,7556,-31884,7556,-31884,
                                   7185,-31970,7185,-31970,7185,-31970,7185,-31970,
                                   6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                                   6439,-32129,6439,-32129,6439,-32129,6439,-32129,
                                   6065,-32201,6065,-32201,6065,-32201,6065,-32201,
                                   5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                   5314,-32334,5314,-32334,5314,-32334,5314,-32334,
                                   4937,-32393,4937,-32393,4937,-32393,4937,-32393,
                                   4560,-32449,4560,-32449,4560,-32449,4560,-32449,
                                   4182,-32499,4182,-32499,4182,-32499,4182,-32499,
                                   3804,-32546,3804,-32546,3804,-32546,3804,-32546,
                                   3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                                   3045,-32626,3045,-32626,3045,-32626,3045,-32626,
                                   2665,-32659,2665,-32659,2665,-32659,2665,-32659,
                                   2285,-32688,2285,-32688,2285,-32688,2285,-32688,
                                   1905,-32712,1905,-32712,1905,-32712,1905,-32712,
                                   1524,-32732,1524,-32732,1524,-32732,1524,-32732,
                                   1143,-32748,1143,-32748,1143,-32748,1143,-32748,
                                   762,-32759,762,-32759,762,-32759,762,-32759,
                                   381,-32765,381,-32765,381,-32765,381,-32765,
                                   0,-32767,0,-32767,0,-32767,0,-32767,
                                   -382,-32765,-382,-32765,-382,-32765,-382,-32765,
                                   -763,-32759,-763,-32759,-763,-32759,-763,-32759,
                                   -1144,-32748,-1144,-32748,-1144,-32748,-1144,-32748,
                                   -1525,-32732,-1525,-32732,-1525,-32732,-1525,-32732,
                                   -1906,-32712,-1906,-32712,-1906,-32712,-1906,-32712,
                                   -2286,-32688,-2286,-32688,-2286,-32688,-2286,-32688,
                                   -2666,-32659,-2666,-32659,-2666,-32659,-2666,-32659,
                                   -3046,-32626,-3046,-32626,-3046,-32626,-3046,-32626,
                                   -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                                   -3805,-32546,-3805,-32546,-3805,-32546,-3805,-32546,
                                   -4183,-32499,-4183,-32499,-4183,-32499,-4183,-32499,
                                   -4561,-32449,-4561,-32449,-4561,-32449,-4561,-32449,
                                   -4938,-32393,-4938,-32393,-4938,-32393,-4938,-32393,
                                   -5315,-32334,-5315,-32334,-5315,-32334,-5315,-32334,
                                   -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                   -6066,-32201,-6066,-32201,-6066,-32201,-6066,-32201,
                                   -6440,-32129,-6440,-32129,-6440,-32129,-6440,-32129,
                                   -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                                   -7186,-31970,-7186,-31970,-7186,-31970,-7186,-31970,
                                   -7557,-31884,-7557,-31884,-7557,-31884,-7557,-31884,
                                   -7928,-31794,-7928,-31794,-7928,-31794,-7928,-31794,
                                   -8297,-31700,-8297,-31700,-8297,-31700,-8297,-31700,
                                   -8665,-31601,-8665,-31601,-8665,-31601,-8665,-31601,
                                   -9032,-31498,-9032,-31498,-9032,-31498,-9032,-31498,
                                   -9398,-31391,-9398,-31391,-9398,-31391,-9398,-31391,
                                   -9763,-31279,-9763,-31279,-9763,-31279,-9763,-31279,
                                   -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                                   -10488,-31044,-10488,-31044,-10488,-31044,-10488,-31044,
                                   -10848,-30920,-10848,-30920,-10848,-30920,-10848,-30920,
                                   -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                   -11565,-30659,-11565,-30659,-11565,-30659,-11565,-30659,
                                   -11921,-30522,-11921,-30522,-11921,-30522,-11921,-30522,
                                   -12275,-30382,-12275,-30382,-12275,-30382,-12275,-30382,
                                   -12628,-30237,-12628,-30237,-12628,-30237,-12628,-30237,
                                   -12979,-30088,-12979,-30088,-12979,-30088,-12979,-30088,
                                   -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                                   -13675,-29778,-13675,-29778,-13675,-29778,-13675,-29778,
                                   -14021,-29616,-14021,-29616,-14021,-29616,-14021,-29616,
                                   -14365,-29451,-14365,-29451,-14365,-29451,-14365,-29451,
                                   -14706,-29282,-14706,-29282,-14706,-29282,-14706,-29282,
                                   -15046,-29109,-15046,-29109,-15046,-29109,-15046,-29109,
                                   -15384,-28932,-15384,-28932,-15384,-28932,-15384,-28932,
                                   -15719,-28751,-15719,-28751,-15719,-28751,-15719,-28751,
                                   -16053,-28566,-16053,-28566,-16053,-28566,-16053,-28566,
                                   -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                   -16713,-28185,-16713,-28185,-16713,-28185,-16713,-28185,
                                   -17040,-27989,-17040,-27989,-17040,-27989,-17040,-27989,
                                   -17364,-27788,-17364,-27788,-17364,-27788,-17364,-27788,
                                   -17687,-27585,-17687,-27585,-17687,-27585,-17687,-27585,
                                   -18006,-27377,-18006,-27377,-18006,-27377,-18006,-27377,
                                   -18324,-27166,-18324,-27166,-18324,-27166,-18324,-27166,
                                   -18638,-26951,-18638,-26951,-18638,-26951,-18638,-26951,
                                   -18951,-26732,-18951,-26732,-18951,-26732,-18951,-26732,
                                   -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                                   -19568,-26284,-19568,-26284,-19568,-26284,-19568,-26284,
                                   -19872,-26054,-19872,-26054,-19872,-26054,-19872,-26054,
                                   -20174,-25821,-20174,-25821,-20174,-25821,-20174,-25821,
                                   -20473,-25585,-20473,-25585,-20473,-25585,-20473,-25585,
                                   -20769,-25345,-20769,-25345,-20769,-25345,-20769,-25345,
                                   -21063,-25101,-21063,-25101,-21063,-25101,-21063,-25101,
                                   -21353,-24855,-21353,-24855,-21353,-24855,-21353,-24855,
                                   -21641,-24605,-21641,-24605,-21641,-24605,-21641,-24605,
                                   -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                                   -22208,-24094,-22208,-24094,-22208,-24094,-22208,-24094,
                                   -22487,-23834,-22487,-23834,-22487,-23834,-22487,-23834,
                                   -22762,-23571,-22762,-23571,-22762,-23571,-22762,-23571,
                                   -23035,-23305,-23035,-23305,-23035,-23305,-23035,-23305,
                                   -23305,-23035,-23305,-23035,-23305,-23035,-23305,-23035,
                                   -23571,-22762,-23571,-22762,-23571,-22762,-23571,-22762,
                                   -23834,-22487,-23834,-22487,-23834,-22487,-23834,-22487,
                                   -24094,-22208,-24094,-22208,-24094,-22208,-24094,-22208,
                                   -24351,-21926,-24351,-21926,-24351,-21926,-24351,-21926,
                                   -24605,-21641,-24605,-21641,-24605,-21641,-24605,-21641,
                                   -24855,-21353,-24855,-21353,-24855,-21353,-24855,-21353,
                                   -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                   -25345,-20769,-25345,-20769,-25345,-20769,-25345,-20769,
                                   -25585,-20473,-25585,-20473,-25585,-20473,-25585,-20473,
                                   -25821,-20174,-25821,-20174,-25821,-20174,-25821,-20174,
                                   -26054,-19872,-26054,-19872,-26054,-19872,-26054,-19872,
                                   -26284,-19568,-26284,-19568,-26284,-19568,-26284,-19568,
                                   -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                                   -26732,-18951,-26732,-18951,-26732,-18951,-26732,-18951,
                                   -26951,-18638,-26951,-18638,-26951,-18638,-26951,-18638,
                                   -27166,-18324,-27166,-18324,-27166,-18324,-27166,-18324,
                                   -27377,-18006,-27377,-18006,-27377,-18006,-27377,-18006,
                                   -27585,-17687,-27585,-17687,-27585,-17687,-27585,-17687,
                                   -27788,-17364,-27788,-17364,-27788,-17364,-27788,-17364,
                                   -27989,-17040,-27989,-17040,-27989,-17040,-27989,-17040,
                                   -28185,-16713,-28185,-16713,-28185,-16713,-28185,-16713,
                                   -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                   -28566,-16053,-28566,-16053,-28566,-16053,-28566,-16053,
                                   -28751,-15719,-28751,-15719,-28751,-15719,-28751,-15719,
                                   -28932,-15384,-28932,-15384,-28932,-15384,-28932,-15384,
                                   -29109,-15046,-29109,-15046,-29109,-15046,-29109,-15046,
                                   -29282,-14706,-29282,-14706,-29282,-14706,-29282,-14706,
                                   -29451,-14365,-29451,-14365,-29451,-14365,-29451,-14365,
                                   -29616,-14021,-29616,-14021,-29616,-14021,-29616,-14021,
                                   -29778,-13675,-29778,-13675,-29778,-13675,-29778,-13675,
                                   -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                                   -30088,-12979,-30088,-12979,-30088,-12979,-30088,-12979,
                                   -30237,-12628,-30237,-12628,-30237,-12628,-30237,-12628,
                                   -30382,-12275,-30382,-12275,-30382,-12275,-30382,-12275,
                                   -30522,-11921,-30522,-11921,-30522,-11921,-30522,-11921,
                                   -30659,-11565,-30659,-11565,-30659,-11565,-30659,-11565,
                                   -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                   -30920,-10848,-30920,-10848,-30920,-10848,-30920,-10848,
                                   -31044,-10488,-31044,-10488,-31044,-10488,-31044,-10488,
                                   -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                                   -31279,-9763,-31279,-9763,-31279,-9763,-31279,-9763,
                                   -31391,-9398,-31391,-9398,-31391,-9398,-31391,-9398,
                                   -31498,-9032,-31498,-9032,-31498,-9032,-31498,-9032,
                                   -31601,-8665,-31601,-8665,-31601,-8665,-31601,-8665,
                                   -31700,-8297,-31700,-8297,-31700,-8297,-31700,-8297,
                                   -31794,-7928,-31794,-7928,-31794,-7928,-31794,-7928,
                                   -31884,-7557,-31884,-7557,-31884,-7557,-31884,-7557,
                                   -31970,-7186,-31970,-7186,-31970,-7186,-31970,-7186,
                                   -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                                   -32129,-6440,-32129,-6440,-32129,-6440,-32129,-6440,
                                   -32201,-6066,-32201,-6066,-32201,-6066,-32201,-6066,
                                   -32270,-5690,-32270,-5690,-32270,-5690,-32270,-5690,
                                   -32334,-5315,-32334,-5315,-32334,-5315,-32334,-5315,
                                   -32393,-4938,-32393,-4938,-32393,-4938,-32393,-4938,
                                   -32449,-4561,-32449,-4561,-32449,-4561,-32449,-4561,
                                   -32499,-4183,-32499,-4183,-32499,-4183,-32499,-4183,
                                   -32546,-3805,-32546,-3805,-32546,-3805,-32546,-3805,
                                   -32588,-3426,-32588,-3426,-32588,-3426,-32588,-3426,
                                   -32626,-3046,-32626,-3046,-32626,-3046,-32626,-3046,
                                   -32659,-2666,-32659,-2666,-32659,-2666,-32659,-2666,
                                   -32688,-2286,-32688,-2286,-32688,-2286,-32688,-2286,
                                   -32712,-1906,-32712,-1906,-32712,-1906,-32712,-1906,
                                   -32732,-1525,-32732,-1525,-32732,-1525,-32732,-1525,
                                   -32748,-1144,-32748,-1144,-32748,-1144,-32748,-1144,
                                   -32759,-763,-32759,-763,-32759,-763,-32759,-763,
                                   -32765,-382,-32765,-382,-32765,-382,-32765,-382,
                                   -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                   -32765,381,-32765,381,-32765,381,-32765,381,
                                   -32759,762,-32759,762,-32759,762,-32759,762,
                                   -32748,1143,-32748,1143,-32748,1143,-32748,1143,
                                   -32732,1524,-32732,1524,-32732,1524,-32732,1524,
                                   -32712,1905,-32712,1905,-32712,1905,-32712,1905,
                                   -32688,2285,-32688,2285,-32688,2285,-32688,2285,
                                   -32659,2665,-32659,2665,-32659,2665,-32659,2665,
                                   -32626,3045,-32626,3045,-32626,3045,-32626,3045,
                                   -32588,3425,-32588,3425,-32588,3425,-32588,3425,
                                   -32546,3804,-32546,3804,-32546,3804,-32546,3804,
                                   -32499,4182,-32499,4182,-32499,4182,-32499,4182,
                                   -32449,4560,-32449,4560,-32449,4560,-32449,4560,
                                   -32393,4937,-32393,4937,-32393,4937,-32393,4937,
                                   -32334,5314,-32334,5314,-32334,5314,-32334,5314,
                                   -32270,5689,-32270,5689,-32270,5689,-32270,5689,
                                   -32201,6065,-32201,6065,-32201,6065,-32201,6065,
                                   -32129,6439,-32129,6439,-32129,6439,-32129,6439,
                                   -32051,6812,-32051,6812,-32051,6812,-32051,6812,
                                   -31970,7185,-31970,7185,-31970,7185,-31970,7185,
                                   -31884,7556,-31884,7556,-31884,7556,-31884,7556,
                                   -31794,7927,-31794,7927,-31794,7927,-31794,7927,
                                   -31700,8296,-31700,8296,-31700,8296,-31700,8296,
                                   -31601,8664,-31601,8664,-31601,8664,-31601,8664,
                                   -31498,9031,-31498,9031,-31498,9031,-31498,9031,
                                   -31391,9397,-31391,9397,-31391,9397,-31391,9397,
                                   -31279,9762,-31279,9762,-31279,9762,-31279,9762,
                                   -31164,10125,-31164,10125,-31164,10125,-31164,10125,
                                   -31044,10487,-31044,10487,-31044,10487,-31044,10487,
                                   -30920,10847,-30920,10847,-30920,10847,-30920,10847,
                                   -30791,11206,-30791,11206,-30791,11206,-30791,11206,
                                   -30659,11564,-30659,11564,-30659,11564,-30659,11564,
                                   -30522,11920,-30522,11920,-30522,11920,-30522,11920,
                                   -30382,12274,-30382,12274,-30382,12274,-30382,12274,
                                   -30237,12627,-30237,12627,-30237,12627,-30237,12627,
                                   -30088,12978,-30088,12978,-30088,12978,-30088,12978,
                                   -29935,13327,-29935,13327,-29935,13327,-29935,13327,
                                   -29778,13674,-29778,13674,-29778,13674,-29778,13674,
                                   -29616,14020,-29616,14020,-29616,14020,-29616,14020,
                                   -29451,14364,-29451,14364,-29451,14364,-29451,14364,
                                   -29282,14705,-29282,14705,-29282,14705,-29282,14705,
                                   -29109,15045,-29109,15045,-29109,15045,-29109,15045,
                                   -28932,15383,-28932,15383,-28932,15383,-28932,15383,
                                   -28751,15718,-28751,15718,-28751,15718,-28751,15718,
                                   -28566,16052,-28566,16052,-28566,16052,-28566,16052,
                                   -28378,16383,-28378,16383,-28378,16383,-28378,16383,
                                   -28185,16712,-28185,16712,-28185,16712,-28185,16712,
                                   -27989,17039,-27989,17039,-27989,17039,-27989,17039,
                                   -27788,17363,-27788,17363,-27788,17363,-27788,17363,
                                   -27585,17686,-27585,17686,-27585,17686,-27585,17686,
                                   -27377,18005,-27377,18005,-27377,18005,-27377,18005,
                                   -27166,18323,-27166,18323,-27166,18323,-27166,18323,
                                   -26951,18637,-26951,18637,-26951,18637,-26951,18637,
                                   -26732,18950,-26732,18950,-26732,18950,-26732,18950,
                                   -26510,19259,-26510,19259,-26510,19259,-26510,19259,
                                   -26284,19567,-26284,19567,-26284,19567,-26284,19567,
                                   -26054,19871,-26054,19871,-26054,19871,-26054,19871,
                                   -25821,20173,-25821,20173,-25821,20173,-25821,20173,
                                   -25585,20472,-25585,20472,-25585,20472,-25585,20472,
                                   -25345,20768,-25345,20768,-25345,20768,-25345,20768,
                                   -25101,21062,-25101,21062,-25101,21062,-25101,21062,
                                   -24855,21352,-24855,21352,-24855,21352,-24855,21352,
                                   -24605,21640,-24605,21640,-24605,21640,-24605,21640,
                                   -24351,21925,-24351,21925,-24351,21925,-24351,21925,
                                   -24094,22207,-24094,22207,-24094,22207,-24094,22207,
                                   -23834,22486,-23834,22486,-23834,22486,-23834,22486,
                                   -23571,22761,-23571,22761,-23571,22761,-23571,22761,
                                   -23305,23034,-23305,23034,-23305,23034,-23305,23034,
                                   -23035,23304,-23035,23304,-23035,23304,-23035,23304,
                                   -22762,23570,-22762,23570,-22762,23570,-22762,23570,
                                   -22487,23833,-22487,23833,-22487,23833,-22487,23833,
                                   -22208,24093,-22208,24093,-22208,24093,-22208,24093,
                                   -21926,24350,-21926,24350,-21926,24350,-21926,24350,
                                   -21641,24604,-21641,24604,-21641,24604,-21641,24604,
                                   -21353,24854,-21353,24854,-21353,24854,-21353,24854,
                                   -21063,25100,-21063,25100,-21063,25100,-21063,25100,
                                   -20769,25344,-20769,25344,-20769,25344,-20769,25344,
                                   -20473,25584,-20473,25584,-20473,25584,-20473,25584,
                                   -20174,25820,-20174,25820,-20174,25820,-20174,25820,
                                   -19872,26053,-19872,26053,-19872,26053,-19872,26053,
                                   -19568,26283,-19568,26283,-19568,26283,-19568,26283,
                                   -19260,26509,-19260,26509,-19260,26509,-19260,26509,
                                   -18951,26731,-18951,26731,-18951,26731,-18951,26731,
                                   -18638,26950,-18638,26950,-18638,26950,-18638,26950,
                                   -18324,27165,-18324,27165,-18324,27165,-18324,27165,
                                   -18006,27376,-18006,27376,-18006,27376,-18006,27376,
                                   -17687,27584,-17687,27584,-17687,27584,-17687,27584,
                                   -17364,27787,-17364,27787,-17364,27787,-17364,27787,
                                   -17040,27988,-17040,27988,-17040,27988,-17040,27988,
                                   -16713,28184,-16713,28184,-16713,28184,-16713,28184
                                  };

void dft1080(int16_t *x,int16_t *y,unsigned char scale_flag)  // 360 x 3
{
Raymond Knopp's avatar
 
Raymond Knopp committed
14142
  int i,j;
14143 14144 14145 14146 14147 14148
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa1080[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb1080[0];
  simd_q15_t x2128[1080];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[1080];//=&ytmp128array3[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
14149 14150 14151



14152
  for (i=0,j=0; i<360; i++,j+=3) {
Raymond Knopp's avatar
 
Raymond Knopp committed
14153 14154
    x2128[i]    = x128[j];
    x2128[i+360] = x128[j+1];
14155
    x2128[i+720] = x128[j+2];
Raymond Knopp's avatar
 
Raymond Knopp committed
14156 14157 14158 14159 14160 14161 14162
  }

  dft360((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft360((int16_t *)(x2128+360),(int16_t *)(ytmp128+360),1);
  dft360((int16_t *)(x2128+720),(int16_t *)(ytmp128+720),1);

  bfly3_tw1(ytmp128,ytmp128+360,ytmp128+720,y128,y128+360,y128+720);
14163 14164

  for (i=1,j=0; i<360; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
14165
    bfly3(ytmp128+i,
14166 14167 14168 14169 14170 14171 14172
          ytmp128+360+i,
          ytmp128+720+i,
          y128+i,
          y128+360+i,
          y128+720+i,
          twa128+j,
          twb128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
14173 14174 14175
  }

  if (scale_flag==1) {
14176
    norm128 = set1_int16(dft_norm_table[14]);
14177 14178

    for (i=0; i<1080; i++) {
14179
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222
    }
  }

  _mm_empty();
  _m_empty();

};

/* Twiddles generated with
twa = floor(32767*exp(-sqrt(-1)*2*pi*(1:287)/1152));
twb = floor(32767*exp(-sqrt(-1)*2*pi*2*(1:287)/1152));
twc = floor(32767*exp(-sqrt(-1)*2*pi*3*(1:287)/1152));
twa2 = zeros(1,2*287);
twb2 = zeros(1,2*287);
twc2 = zeros(1,2*287);
twa2(1:2:end) = real(twa);
twa2(2:2:end) = imag(twa);
twb2(1:2:end) = real(twb);
twb2(2:2:end) = imag(twb);
twc2(1:2:end) = real(twc);
twc2(2:2:end) = imag(twc);
fd=fopen("twiddle_tmp.txt","w");
fprintf(fd,"static int16_t twa1152[287*2*4] = {");
for i=1:2:(2*286)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1),twa2(i),twa2(i+1));
fprintf(fd,"\nstatic int16_t twb1152[287*2*4] = {");
for i=1:2:(2*286)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1),twb2(i),twb2(i+1));
fprintf(fd,"\nstatic int16_t twc1152[287*2*4] = {");
for i=1:2:(2*286)
  fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d,\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
end
i=i+2;
fprintf(fd,"%d,%d,%d,%d,%d,%d,%d,%d};\n",twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1),twc2(i),twc2(i+1));
fclose(fd);
*/
static int16_t twa1152[287*2*4] = {32766,-179,32766,-179,32766,-179,32766,-179,
14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509
                                   32765,-358,32765,-358,32765,-358,32765,-358,
                                   32762,-537,32762,-537,32762,-537,32762,-537,
                                   32759,-715,32759,-715,32759,-715,32759,-715,
                                   32754,-894,32754,-894,32754,-894,32754,-894,
                                   32749,-1073,32749,-1073,32749,-1073,32749,-1073,
                                   32743,-1251,32743,-1251,32743,-1251,32743,-1251,
                                   32735,-1430,32735,-1430,32735,-1430,32735,-1430,
                                   32727,-1608,32727,-1608,32727,-1608,32727,-1608,
                                   32718,-1787,32718,-1787,32718,-1787,32718,-1787,
                                   32708,-1965,32708,-1965,32708,-1965,32708,-1965,
                                   32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                   32684,-2322,32684,-2322,32684,-2322,32684,-2322,
                                   32671,-2500,32671,-2500,32671,-2500,32671,-2500,
                                   32657,-2678,32657,-2678,32657,-2678,32657,-2678,
                                   32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                   32626,-3034,32626,-3034,32626,-3034,32626,-3034,
                                   32609,-3212,32609,-3212,32609,-3212,32609,-3212,
                                   32591,-3390,32591,-3390,32591,-3390,32591,-3390,
                                   32572,-3568,32572,-3568,32572,-3568,32572,-3568,
                                   32552,-3745,32552,-3745,32552,-3745,32552,-3745,
                                   32531,-3923,32531,-3923,32531,-3923,32531,-3923,
                                   32509,-4100,32509,-4100,32509,-4100,32509,-4100,
                                   32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                   32462,-4455,32462,-4455,32462,-4455,32462,-4455,
                                   32438,-4632,32438,-4632,32438,-4632,32438,-4632,
                                   32412,-4808,32412,-4808,32412,-4808,32412,-4808,
                                   32385,-4985,32385,-4985,32385,-4985,32385,-4985,
                                   32357,-5162,32357,-5162,32357,-5162,32357,-5162,
                                   32329,-5338,32329,-5338,32329,-5338,32329,-5338,
                                   32299,-5514,32299,-5514,32299,-5514,32299,-5514,
                                   32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                   32237,-5866,32237,-5866,32237,-5866,32237,-5866,
                                   32205,-6042,32205,-6042,32205,-6042,32205,-6042,
                                   32171,-6218,32171,-6218,32171,-6218,32171,-6218,
                                   32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                   32102,-6568,32102,-6568,32102,-6568,32102,-6568,
                                   32065,-6743,32065,-6743,32065,-6743,32065,-6743,
                                   32028,-6918,32028,-6918,32028,-6918,32028,-6918,
                                   31990,-7093,31990,-7093,31990,-7093,31990,-7093,
                                   31951,-7267,31951,-7267,31951,-7267,31951,-7267,
                                   31911,-7441,31911,-7441,31911,-7441,31911,-7441,
                                   31869,-7615,31869,-7615,31869,-7615,31869,-7615,
                                   31827,-7789,31827,-7789,31827,-7789,31827,-7789,
                                   31785,-7962,31785,-7962,31785,-7962,31785,-7962,
                                   31741,-8135,31741,-8135,31741,-8135,31741,-8135,
                                   31696,-8308,31696,-8308,31696,-8308,31696,-8308,
                                   31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                   31603,-8654,31603,-8654,31603,-8654,31603,-8654,
                                   31556,-8826,31556,-8826,31556,-8826,31556,-8826,
                                   31507,-8998,31507,-8998,31507,-8998,31507,-8998,
                                   31457,-9170,31457,-9170,31457,-9170,31457,-9170,
                                   31407,-9341,31407,-9341,31407,-9341,31407,-9341,
                                   31356,-9512,31356,-9512,31356,-9512,31356,-9512,
                                   31303,-9683,31303,-9683,31303,-9683,31303,-9683,
                                   31250,-9854,31250,-9854,31250,-9854,31250,-9854,
                                   31196,-10024,31196,-10024,31196,-10024,31196,-10024,
                                   31141,-10194,31141,-10194,31141,-10194,31141,-10194,
                                   31085,-10364,31085,-10364,31085,-10364,31085,-10364,
                                   31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                   30970,-10702,30970,-10702,30970,-10702,30970,-10702,
                                   30911,-10871,30911,-10871,30911,-10871,30911,-10871,
                                   30851,-11039,30851,-11039,30851,-11039,30851,-11039,
                                   30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                   30729,-11375,30729,-11375,30729,-11375,30729,-11375,
                                   30666,-11543,30666,-11543,30666,-11543,30666,-11543,
                                   30603,-11710,30603,-11710,30603,-11710,30603,-11710,
                                   30539,-11877,30539,-11877,30539,-11877,30539,-11877,
                                   30473,-12043,30473,-12043,30473,-12043,30473,-12043,
                                   30407,-12209,30407,-12209,30407,-12209,30407,-12209,
                                   30340,-12375,30340,-12375,30340,-12375,30340,-12375,
                                   30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                   30203,-12705,30203,-12705,30203,-12705,30203,-12705,
                                   30134,-12869,30134,-12869,30134,-12869,30134,-12869,
                                   30063,-13034,30063,-13034,30063,-13034,30063,-13034,
                                   29992,-13197,29992,-13197,29992,-13197,29992,-13197,
                                   29919,-13361,29919,-13361,29919,-13361,29919,-13361,
                                   29846,-13524,29846,-13524,29846,-13524,29846,-13524,
                                   29772,-13686,29772,-13686,29772,-13686,29772,-13686,
                                   29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                   29621,-14010,29621,-14010,29621,-14010,29621,-14010,
                                   29544,-14172,29544,-14172,29544,-14172,29544,-14172,
                                   29466,-14332,29466,-14332,29466,-14332,29466,-14332,
                                   29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                   29308,-14653,29308,-14653,29308,-14653,29308,-14653,
                                   29227,-14813,29227,-14813,29227,-14813,29227,-14813,
                                   29146,-14972,29146,-14972,29146,-14972,29146,-14972,
                                   29064,-15131,29064,-15131,29064,-15131,29064,-15131,
                                   28981,-15289,28981,-15289,28981,-15289,28981,-15289,
                                   28897,-15447,28897,-15447,28897,-15447,28897,-15447,
                                   28813,-15604,28813,-15604,28813,-15604,28813,-15604,
                                   28727,-15761,28727,-15761,28727,-15761,28727,-15761,
                                   28641,-15918,28641,-15918,28641,-15918,28641,-15918,
                                   28554,-16073,28554,-16073,28554,-16073,28554,-16073,
                                   28465,-16229,28465,-16229,28465,-16229,28465,-16229,
                                   28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                   28287,-16539,28287,-16539,28287,-16539,28287,-16539,
                                   28196,-16693,28196,-16693,28196,-16693,28196,-16693,
                                   28105,-16846,28105,-16846,28105,-16846,28105,-16846,
                                   28012,-16999,28012,-16999,28012,-16999,28012,-16999,
                                   27919,-17152,27919,-17152,27919,-17152,27919,-17152,
                                   27825,-17304,27825,-17304,27825,-17304,27825,-17304,
                                   27731,-17455,27731,-17455,27731,-17455,27731,-17455,
                                   27635,-17606,27635,-17606,27635,-17606,27635,-17606,
                                   27538,-17757,27538,-17757,27538,-17757,27538,-17757,
                                   27441,-17907,27441,-17907,27441,-17907,27441,-17907,
                                   27343,-18056,27343,-18056,27343,-18056,27343,-18056,
                                   27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                   27145,-18353,27145,-18353,27145,-18353,27145,-18353,
                                   27044,-18501,27044,-18501,27044,-18501,27044,-18501,
                                   26943,-18648,26943,-18648,26943,-18648,26943,-18648,
                                   26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                   26738,-18941,26738,-18941,26738,-18941,26738,-18941,
                                   26634,-19087,26634,-19087,26634,-19087,26634,-19087,
                                   26530,-19232,26530,-19232,26530,-19232,26530,-19232,
                                   26424,-19376,26424,-19376,26424,-19376,26424,-19376,
                                   26318,-19520,26318,-19520,26318,-19520,26318,-19520,
                                   26211,-19663,26211,-19663,26211,-19663,26211,-19663,
                                   26104,-19806,26104,-19806,26104,-19806,26104,-19806,
                                   25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                   25886,-20089,25886,-20089,25886,-20089,25886,-20089,
                                   25776,-20230,25776,-20230,25776,-20230,25776,-20230,
                                   25665,-20370,25665,-20370,25665,-20370,25665,-20370,
                                   25554,-20510,25554,-20510,25554,-20510,25554,-20510,
                                   25442,-20649,25442,-20649,25442,-20649,25442,-20649,
                                   25329,-20788,25329,-20788,25329,-20788,25329,-20788,
                                   25215,-20926,25215,-20926,25215,-20926,25215,-20926,
                                   25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                   24985,-21199,24985,-21199,24985,-21199,24985,-21199,
                                   24869,-21335,24869,-21335,24869,-21335,24869,-21335,
                                   24753,-21471,24753,-21471,24753,-21471,24753,-21471,
                                   24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                   24517,-21739,24517,-21739,24517,-21739,24517,-21739,
                                   24398,-21873,24398,-21873,24398,-21873,24398,-21873,
                                   24278,-22005,24278,-22005,24278,-22005,24278,-22005,
                                   24158,-22138,24158,-22138,24158,-22138,24158,-22138,
                                   24037,-22269,24037,-22269,24037,-22269,24037,-22269,
                                   23915,-22400,23915,-22400,23915,-22400,23915,-22400,
                                   23792,-22530,23792,-22530,23792,-22530,23792,-22530,
                                   23669,-22659,23669,-22659,23669,-22659,23669,-22659,
                                   23545,-22788,23545,-22788,23545,-22788,23545,-22788,
                                   23421,-22916,23421,-22916,23421,-22916,23421,-22916,
                                   23295,-23044,23295,-23044,23295,-23044,23295,-23044,
                                   23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                   23043,-23296,23043,-23296,23043,-23296,23043,-23296,
                                   22915,-23422,22915,-23422,22915,-23422,22915,-23422,
                                   22787,-23546,22787,-23546,22787,-23546,22787,-23546,
                                   22658,-23670,22658,-23670,22658,-23670,22658,-23670,
                                   22529,-23793,22529,-23793,22529,-23793,22529,-23793,
                                   22399,-23916,22399,-23916,22399,-23916,22399,-23916,
                                   22268,-24038,22268,-24038,22268,-24038,22268,-24038,
                                   22137,-24159,22137,-24159,22137,-24159,22137,-24159,
                                   22004,-24279,22004,-24279,22004,-24279,22004,-24279,
                                   21872,-24399,21872,-24399,21872,-24399,21872,-24399,
                                   21738,-24518,21738,-24518,21738,-24518,21738,-24518,
                                   21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                   21470,-24754,21470,-24754,21470,-24754,21470,-24754,
                                   21334,-24870,21334,-24870,21334,-24870,21334,-24870,
                                   21198,-24986,21198,-24986,21198,-24986,21198,-24986,
                                   21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                   20925,-25216,20925,-25216,20925,-25216,20925,-25216,
                                   20787,-25330,20787,-25330,20787,-25330,20787,-25330,
                                   20648,-25443,20648,-25443,20648,-25443,20648,-25443,
                                   20509,-25555,20509,-25555,20509,-25555,20509,-25555,
                                   20369,-25666,20369,-25666,20369,-25666,20369,-25666,
                                   20229,-25777,20229,-25777,20229,-25777,20229,-25777,
                                   20088,-25887,20088,-25887,20088,-25887,20088,-25887,
                                   19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                   19805,-26105,19805,-26105,19805,-26105,19805,-26105,
                                   19662,-26212,19662,-26212,19662,-26212,19662,-26212,
                                   19519,-26319,19519,-26319,19519,-26319,19519,-26319,
                                   19375,-26425,19375,-26425,19375,-26425,19375,-26425,
                                   19231,-26531,19231,-26531,19231,-26531,19231,-26531,
                                   19086,-26635,19086,-26635,19086,-26635,19086,-26635,
                                   18940,-26739,18940,-26739,18940,-26739,18940,-26739,
                                   18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                   18647,-26944,18647,-26944,18647,-26944,18647,-26944,
                                   18500,-27045,18500,-27045,18500,-27045,18500,-27045,
                                   18352,-27146,18352,-27146,18352,-27146,18352,-27146,
                                   18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                   18055,-27344,18055,-27344,18055,-27344,18055,-27344,
                                   17906,-27442,17906,-27442,17906,-27442,17906,-27442,
                                   17756,-27539,17756,-27539,17756,-27539,17756,-27539,
                                   17605,-27636,17605,-27636,17605,-27636,17605,-27636,
                                   17454,-27732,17454,-27732,17454,-27732,17454,-27732,
                                   17303,-27826,17303,-27826,17303,-27826,17303,-27826,
                                   17151,-27920,17151,-27920,17151,-27920,17151,-27920,
                                   16998,-28013,16998,-28013,16998,-28013,16998,-28013,
                                   16845,-28106,16845,-28106,16845,-28106,16845,-28106,
                                   16692,-28197,16692,-28197,16692,-28197,16692,-28197,
                                   16538,-28288,16538,-28288,16538,-28288,16538,-28288,
                                   16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                   16228,-28466,16228,-28466,16228,-28466,16228,-28466,
                                   16072,-28555,16072,-28555,16072,-28555,16072,-28555,
                                   15917,-28642,15917,-28642,15917,-28642,15917,-28642,
                                   15760,-28728,15760,-28728,15760,-28728,15760,-28728,
                                   15603,-28814,15603,-28814,15603,-28814,15603,-28814,
                                   15446,-28898,15446,-28898,15446,-28898,15446,-28898,
                                   15288,-28982,15288,-28982,15288,-28982,15288,-28982,
                                   15130,-29065,15130,-29065,15130,-29065,15130,-29065,
                                   14971,-29147,14971,-29147,14971,-29147,14971,-29147,
                                   14812,-29228,14812,-29228,14812,-29228,14812,-29228,
                                   14652,-29309,14652,-29309,14652,-29309,14652,-29309,
                                   14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                   14331,-29467,14331,-29467,14331,-29467,14331,-29467,
                                   14171,-29545,14171,-29545,14171,-29545,14171,-29545,
                                   14009,-29622,14009,-29622,14009,-29622,14009,-29622,
                                   13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                   13685,-29773,13685,-29773,13685,-29773,13685,-29773,
                                   13523,-29847,13523,-29847,13523,-29847,13523,-29847,
                                   13360,-29920,13360,-29920,13360,-29920,13360,-29920,
                                   13196,-29993,13196,-29993,13196,-29993,13196,-29993,
                                   13033,-30064,13033,-30064,13033,-30064,13033,-30064,
                                   12868,-30135,12868,-30135,12868,-30135,12868,-30135,
                                   12704,-30204,12704,-30204,12704,-30204,12704,-30204,
                                   12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                   12374,-30341,12374,-30341,12374,-30341,12374,-30341,
                                   12208,-30408,12208,-30408,12208,-30408,12208,-30408,
                                   12042,-30474,12042,-30474,12042,-30474,12042,-30474,
                                   11876,-30540,11876,-30540,11876,-30540,11876,-30540,
                                   11709,-30604,11709,-30604,11709,-30604,11709,-30604,
                                   11542,-30667,11542,-30667,11542,-30667,11542,-30667,
                                   11374,-30730,11374,-30730,11374,-30730,11374,-30730,
                                   11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                   11038,-30852,11038,-30852,11038,-30852,11038,-30852,
                                   10870,-30912,10870,-30912,10870,-30912,10870,-30912,
                                   10701,-30971,10701,-30971,10701,-30971,10701,-30971,
                                   10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                   10363,-31086,10363,-31086,10363,-31086,10363,-31086,
                                   10193,-31142,10193,-31142,10193,-31142,10193,-31142,
                                   10023,-31197,10023,-31197,10023,-31197,10023,-31197,
                                   9853,-31251,9853,-31251,9853,-31251,9853,-31251,
                                   9682,-31304,9682,-31304,9682,-31304,9682,-31304,
                                   9511,-31357,9511,-31357,9511,-31357,9511,-31357,
                                   9340,-31408,9340,-31408,9340,-31408,9340,-31408,
                                   9169,-31458,9169,-31458,9169,-31458,9169,-31458,
                                   8997,-31508,8997,-31508,8997,-31508,8997,-31508,
                                   8825,-31557,8825,-31557,8825,-31557,8825,-31557,
                                   8653,-31604,8653,-31604,8653,-31604,8653,-31604,
                                   8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                   8307,-31697,8307,-31697,8307,-31697,8307,-31697,
                                   8134,-31742,8134,-31742,8134,-31742,8134,-31742,
                                   7961,-31786,7961,-31786,7961,-31786,7961,-31786,
                                   7788,-31828,7788,-31828,7788,-31828,7788,-31828,
                                   7614,-31870,7614,-31870,7614,-31870,7614,-31870,
                                   7440,-31912,7440,-31912,7440,-31912,7440,-31912,
                                   7266,-31952,7266,-31952,7266,-31952,7266,-31952,
                                   7092,-31991,7092,-31991,7092,-31991,7092,-31991,
                                   6917,-32029,6917,-32029,6917,-32029,6917,-32029,
                                   6742,-32066,6742,-32066,6742,-32066,6742,-32066,
                                   6567,-32103,6567,-32103,6567,-32103,6567,-32103,
                                   6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                   6217,-32172,6217,-32172,6217,-32172,6217,-32172,
                                   6041,-32206,6041,-32206,6041,-32206,6041,-32206,
                                   5865,-32238,5865,-32238,5865,-32238,5865,-32238,
                                   5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                   5513,-32300,5513,-32300,5513,-32300,5513,-32300,
                                   5337,-32330,5337,-32330,5337,-32330,5337,-32330,
                                   5161,-32358,5161,-32358,5161,-32358,5161,-32358,
                                   4984,-32386,4984,-32386,4984,-32386,4984,-32386,
                                   4807,-32413,4807,-32413,4807,-32413,4807,-32413,
                                   4631,-32439,4631,-32439,4631,-32439,4631,-32439,
                                   4454,-32463,4454,-32463,4454,-32463,4454,-32463,
                                   4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                   4099,-32510,4099,-32510,4099,-32510,4099,-32510,
                                   3922,-32532,3922,-32532,3922,-32532,3922,-32532,
                                   3744,-32553,3744,-32553,3744,-32553,3744,-32553,
                                   3567,-32573,3567,-32573,3567,-32573,3567,-32573,
                                   3389,-32592,3389,-32592,3389,-32592,3389,-32592,
                                   3211,-32610,3211,-32610,3211,-32610,3211,-32610,
                                   3033,-32627,3033,-32627,3033,-32627,3033,-32627,
                                   2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                   2677,-32658,2677,-32658,2677,-32658,2677,-32658,
                                   2499,-32672,2499,-32672,2499,-32672,2499,-32672,
                                   2321,-32685,2321,-32685,2321,-32685,2321,-32685,
                                   2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                   1964,-32709,1964,-32709,1964,-32709,1964,-32709,
                                   1786,-32719,1786,-32719,1786,-32719,1786,-32719,
                                   1607,-32728,1607,-32728,1607,-32728,1607,-32728,
                                   1429,-32736,1429,-32736,1429,-32736,1429,-32736,
                                   1250,-32744,1250,-32744,1250,-32744,1250,-32744,
                                   1072,-32750,1072,-32750,1072,-32750,1072,-32750,
                                   893,-32755,893,-32755,893,-32755,893,-32755,
                                   714,-32760,714,-32760,714,-32760,714,-32760,
                                   536,-32763,536,-32763,536,-32763,536,-32763,
                                   357,-32766,357,-32766,357,-32766,357,-32766,
                                   178,-32767,178,-32767,178,-32767,178,-32767
                                  };
Raymond Knopp's avatar
 
Raymond Knopp committed
14510 14511

static int16_t twb1152[287*2*4] = {32765,-358,32765,-358,32765,-358,32765,-358,
14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798
                                   32759,-715,32759,-715,32759,-715,32759,-715,
                                   32749,-1073,32749,-1073,32749,-1073,32749,-1073,
                                   32735,-1430,32735,-1430,32735,-1430,32735,-1430,
                                   32718,-1787,32718,-1787,32718,-1787,32718,-1787,
                                   32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                   32671,-2500,32671,-2500,32671,-2500,32671,-2500,
                                   32642,-2856,32642,-2856,32642,-2856,32642,-2856,
                                   32609,-3212,32609,-3212,32609,-3212,32609,-3212,
                                   32572,-3568,32572,-3568,32572,-3568,32572,-3568,
                                   32531,-3923,32531,-3923,32531,-3923,32531,-3923,
                                   32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                   32438,-4632,32438,-4632,32438,-4632,32438,-4632,
                                   32385,-4985,32385,-4985,32385,-4985,32385,-4985,
                                   32329,-5338,32329,-5338,32329,-5338,32329,-5338,
                                   32269,-5690,32269,-5690,32269,-5690,32269,-5690,
                                   32205,-6042,32205,-6042,32205,-6042,32205,-6042,
                                   32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                   32065,-6743,32065,-6743,32065,-6743,32065,-6743,
                                   31990,-7093,31990,-7093,31990,-7093,31990,-7093,
                                   31911,-7441,31911,-7441,31911,-7441,31911,-7441,
                                   31827,-7789,31827,-7789,31827,-7789,31827,-7789,
                                   31741,-8135,31741,-8135,31741,-8135,31741,-8135,
                                   31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                   31556,-8826,31556,-8826,31556,-8826,31556,-8826,
                                   31457,-9170,31457,-9170,31457,-9170,31457,-9170,
                                   31356,-9512,31356,-9512,31356,-9512,31356,-9512,
                                   31250,-9854,31250,-9854,31250,-9854,31250,-9854,
                                   31141,-10194,31141,-10194,31141,-10194,31141,-10194,
                                   31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                   30911,-10871,30911,-10871,30911,-10871,30911,-10871,
                                   30790,-11207,30790,-11207,30790,-11207,30790,-11207,
                                   30666,-11543,30666,-11543,30666,-11543,30666,-11543,
                                   30539,-11877,30539,-11877,30539,-11877,30539,-11877,
                                   30407,-12209,30407,-12209,30407,-12209,30407,-12209,
                                   30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                   30134,-12869,30134,-12869,30134,-12869,30134,-12869,
                                   29992,-13197,29992,-13197,29992,-13197,29992,-13197,
                                   29846,-13524,29846,-13524,29846,-13524,29846,-13524,
                                   29696,-13848,29696,-13848,29696,-13848,29696,-13848,
                                   29544,-14172,29544,-14172,29544,-14172,29544,-14172,
                                   29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                   29227,-14813,29227,-14813,29227,-14813,29227,-14813,
                                   29064,-15131,29064,-15131,29064,-15131,29064,-15131,
                                   28897,-15447,28897,-15447,28897,-15447,28897,-15447,
                                   28727,-15761,28727,-15761,28727,-15761,28727,-15761,
                                   28554,-16073,28554,-16073,28554,-16073,28554,-16073,
                                   28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                   28196,-16693,28196,-16693,28196,-16693,28196,-16693,
                                   28012,-16999,28012,-16999,28012,-16999,28012,-16999,
                                   27825,-17304,27825,-17304,27825,-17304,27825,-17304,
                                   27635,-17606,27635,-17606,27635,-17606,27635,-17606,
                                   27441,-17907,27441,-17907,27441,-17907,27441,-17907,
                                   27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                   27044,-18501,27044,-18501,27044,-18501,27044,-18501,
                                   26841,-18795,26841,-18795,26841,-18795,26841,-18795,
                                   26634,-19087,26634,-19087,26634,-19087,26634,-19087,
                                   26424,-19376,26424,-19376,26424,-19376,26424,-19376,
                                   26211,-19663,26211,-19663,26211,-19663,26211,-19663,
                                   25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                   25776,-20230,25776,-20230,25776,-20230,25776,-20230,
                                   25554,-20510,25554,-20510,25554,-20510,25554,-20510,
                                   25329,-20788,25329,-20788,25329,-20788,25329,-20788,
                                   25100,-21063,25100,-21063,25100,-21063,25100,-21063,
                                   24869,-21335,24869,-21335,24869,-21335,24869,-21335,
                                   24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                   24398,-21873,24398,-21873,24398,-21873,24398,-21873,
                                   24158,-22138,24158,-22138,24158,-22138,24158,-22138,
                                   23915,-22400,23915,-22400,23915,-22400,23915,-22400,
                                   23669,-22659,23669,-22659,23669,-22659,23669,-22659,
                                   23421,-22916,23421,-22916,23421,-22916,23421,-22916,
                                   23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                   22915,-23422,22915,-23422,22915,-23422,22915,-23422,
                                   22658,-23670,22658,-23670,22658,-23670,22658,-23670,
                                   22399,-23916,22399,-23916,22399,-23916,22399,-23916,
                                   22137,-24159,22137,-24159,22137,-24159,22137,-24159,
                                   21872,-24399,21872,-24399,21872,-24399,21872,-24399,
                                   21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                   21334,-24870,21334,-24870,21334,-24870,21334,-24870,
                                   21062,-25101,21062,-25101,21062,-25101,21062,-25101,
                                   20787,-25330,20787,-25330,20787,-25330,20787,-25330,
                                   20509,-25555,20509,-25555,20509,-25555,20509,-25555,
                                   20229,-25777,20229,-25777,20229,-25777,20229,-25777,
                                   19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                   19662,-26212,19662,-26212,19662,-26212,19662,-26212,
                                   19375,-26425,19375,-26425,19375,-26425,19375,-26425,
                                   19086,-26635,19086,-26635,19086,-26635,19086,-26635,
                                   18794,-26842,18794,-26842,18794,-26842,18794,-26842,
                                   18500,-27045,18500,-27045,18500,-27045,18500,-27045,
                                   18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                   17906,-27442,17906,-27442,17906,-27442,17906,-27442,
                                   17605,-27636,17605,-27636,17605,-27636,17605,-27636,
                                   17303,-27826,17303,-27826,17303,-27826,17303,-27826,
                                   16998,-28013,16998,-28013,16998,-28013,16998,-28013,
                                   16692,-28197,16692,-28197,16692,-28197,16692,-28197,
                                   16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                   16072,-28555,16072,-28555,16072,-28555,16072,-28555,
                                   15760,-28728,15760,-28728,15760,-28728,15760,-28728,
                                   15446,-28898,15446,-28898,15446,-28898,15446,-28898,
                                   15130,-29065,15130,-29065,15130,-29065,15130,-29065,
                                   14812,-29228,14812,-29228,14812,-29228,14812,-29228,
                                   14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                   14171,-29545,14171,-29545,14171,-29545,14171,-29545,
                                   13847,-29697,13847,-29697,13847,-29697,13847,-29697,
                                   13523,-29847,13523,-29847,13523,-29847,13523,-29847,
                                   13196,-29993,13196,-29993,13196,-29993,13196,-29993,
                                   12868,-30135,12868,-30135,12868,-30135,12868,-30135,
                                   12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                   12208,-30408,12208,-30408,12208,-30408,12208,-30408,
                                   11876,-30540,11876,-30540,11876,-30540,11876,-30540,
                                   11542,-30667,11542,-30667,11542,-30667,11542,-30667,
                                   11206,-30791,11206,-30791,11206,-30791,11206,-30791,
                                   10870,-30912,10870,-30912,10870,-30912,10870,-30912,
                                   10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                   10193,-31142,10193,-31142,10193,-31142,10193,-31142,
                                   9853,-31251,9853,-31251,9853,-31251,9853,-31251,
                                   9511,-31357,9511,-31357,9511,-31357,9511,-31357,
                                   9169,-31458,9169,-31458,9169,-31458,9169,-31458,
                                   8825,-31557,8825,-31557,8825,-31557,8825,-31557,
                                   8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                   8134,-31742,8134,-31742,8134,-31742,8134,-31742,
                                   7788,-31828,7788,-31828,7788,-31828,7788,-31828,
                                   7440,-31912,7440,-31912,7440,-31912,7440,-31912,
                                   7092,-31991,7092,-31991,7092,-31991,7092,-31991,
                                   6742,-32066,6742,-32066,6742,-32066,6742,-32066,
                                   6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                   6041,-32206,6041,-32206,6041,-32206,6041,-32206,
                                   5689,-32270,5689,-32270,5689,-32270,5689,-32270,
                                   5337,-32330,5337,-32330,5337,-32330,5337,-32330,
                                   4984,-32386,4984,-32386,4984,-32386,4984,-32386,
                                   4631,-32439,4631,-32439,4631,-32439,4631,-32439,
                                   4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                   3922,-32532,3922,-32532,3922,-32532,3922,-32532,
                                   3567,-32573,3567,-32573,3567,-32573,3567,-32573,
                                   3211,-32610,3211,-32610,3211,-32610,3211,-32610,
                                   2855,-32643,2855,-32643,2855,-32643,2855,-32643,
                                   2499,-32672,2499,-32672,2499,-32672,2499,-32672,
                                   2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                   1786,-32719,1786,-32719,1786,-32719,1786,-32719,
                                   1429,-32736,1429,-32736,1429,-32736,1429,-32736,
                                   1072,-32750,1072,-32750,1072,-32750,1072,-32750,
                                   714,-32760,714,-32760,714,-32760,714,-32760,
                                   357,-32766,357,-32766,357,-32766,357,-32766,
                                   0,-32767,0,-32767,0,-32767,0,-32767,
                                   -358,-32766,-358,-32766,-358,-32766,-358,-32766,
                                   -715,-32760,-715,-32760,-715,-32760,-715,-32760,
                                   -1073,-32750,-1073,-32750,-1073,-32750,-1073,-32750,
                                   -1430,-32736,-1430,-32736,-1430,-32736,-1430,-32736,
                                   -1787,-32719,-1787,-32719,-1787,-32719,-1787,-32719,
                                   -2144,-32697,-2144,-32697,-2144,-32697,-2144,-32697,
                                   -2500,-32672,-2500,-32672,-2500,-32672,-2500,-32672,
                                   -2856,-32643,-2856,-32643,-2856,-32643,-2856,-32643,
                                   -3212,-32610,-3212,-32610,-3212,-32610,-3212,-32610,
                                   -3568,-32573,-3568,-32573,-3568,-32573,-3568,-32573,
                                   -3923,-32532,-3923,-32532,-3923,-32532,-3923,-32532,
                                   -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                   -4632,-32439,-4632,-32439,-4632,-32439,-4632,-32439,
                                   -4985,-32386,-4985,-32386,-4985,-32386,-4985,-32386,
                                   -5338,-32330,-5338,-32330,-5338,-32330,-5338,-32330,
                                   -5690,-32270,-5690,-32270,-5690,-32270,-5690,-32270,
                                   -6042,-32206,-6042,-32206,-6042,-32206,-6042,-32206,
                                   -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                   -6743,-32066,-6743,-32066,-6743,-32066,-6743,-32066,
                                   -7093,-31991,-7093,-31991,-7093,-31991,-7093,-31991,
                                   -7441,-31912,-7441,-31912,-7441,-31912,-7441,-31912,
                                   -7789,-31828,-7789,-31828,-7789,-31828,-7789,-31828,
                                   -8135,-31742,-8135,-31742,-8135,-31742,-8135,-31742,
                                   -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                   -8826,-31557,-8826,-31557,-8826,-31557,-8826,-31557,
                                   -9170,-31458,-9170,-31458,-9170,-31458,-9170,-31458,
                                   -9512,-31357,-9512,-31357,-9512,-31357,-9512,-31357,
                                   -9854,-31251,-9854,-31251,-9854,-31251,-9854,-31251,
                                   -10194,-31142,-10194,-31142,-10194,-31142,-10194,-31142,
                                   -10533,-31029,-10533,-31029,-10533,-31029,-10533,-31029,
                                   -10871,-30912,-10871,-30912,-10871,-30912,-10871,-30912,
                                   -11207,-30791,-11207,-30791,-11207,-30791,-11207,-30791,
                                   -11543,-30667,-11543,-30667,-11543,-30667,-11543,-30667,
                                   -11877,-30540,-11877,-30540,-11877,-30540,-11877,-30540,
                                   -12209,-30408,-12209,-30408,-12209,-30408,-12209,-30408,
                                   -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                   -12869,-30135,-12869,-30135,-12869,-30135,-12869,-30135,
                                   -13197,-29993,-13197,-29993,-13197,-29993,-13197,-29993,
                                   -13524,-29847,-13524,-29847,-13524,-29847,-13524,-29847,
                                   -13848,-29697,-13848,-29697,-13848,-29697,-13848,-29697,
                                   -14172,-29545,-14172,-29545,-14172,-29545,-14172,-29545,
                                   -14493,-29388,-14493,-29388,-14493,-29388,-14493,-29388,
                                   -14813,-29228,-14813,-29228,-14813,-29228,-14813,-29228,
                                   -15131,-29065,-15131,-29065,-15131,-29065,-15131,-29065,
                                   -15447,-28898,-15447,-28898,-15447,-28898,-15447,-28898,
                                   -15761,-28728,-15761,-28728,-15761,-28728,-15761,-28728,
                                   -16073,-28555,-16073,-28555,-16073,-28555,-16073,-28555,
                                   -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                   -16693,-28197,-16693,-28197,-16693,-28197,-16693,-28197,
                                   -16999,-28013,-16999,-28013,-16999,-28013,-16999,-28013,
                                   -17304,-27826,-17304,-27826,-17304,-27826,-17304,-27826,
                                   -17606,-27636,-17606,-27636,-17606,-27636,-17606,-27636,
                                   -17907,-27442,-17907,-27442,-17907,-27442,-17907,-27442,
                                   -18205,-27245,-18205,-27245,-18205,-27245,-18205,-27245,
                                   -18501,-27045,-18501,-27045,-18501,-27045,-18501,-27045,
                                   -18795,-26842,-18795,-26842,-18795,-26842,-18795,-26842,
                                   -19087,-26635,-19087,-26635,-19087,-26635,-19087,-26635,
                                   -19376,-26425,-19376,-26425,-19376,-26425,-19376,-26425,
                                   -19663,-26212,-19663,-26212,-19663,-26212,-19663,-26212,
                                   -19948,-25996,-19948,-25996,-19948,-25996,-19948,-25996,
                                   -20230,-25777,-20230,-25777,-20230,-25777,-20230,-25777,
                                   -20510,-25555,-20510,-25555,-20510,-25555,-20510,-25555,
                                   -20788,-25330,-20788,-25330,-20788,-25330,-20788,-25330,
                                   -21063,-25101,-21063,-25101,-21063,-25101,-21063,-25101,
                                   -21335,-24870,-21335,-24870,-21335,-24870,-21335,-24870,
                                   -21605,-24636,-21605,-24636,-21605,-24636,-21605,-24636,
                                   -21873,-24399,-21873,-24399,-21873,-24399,-21873,-24399,
                                   -22138,-24159,-22138,-24159,-22138,-24159,-22138,-24159,
                                   -22400,-23916,-22400,-23916,-22400,-23916,-22400,-23916,
                                   -22659,-23670,-22659,-23670,-22659,-23670,-22659,-23670,
                                   -22916,-23422,-22916,-23422,-22916,-23422,-22916,-23422,
                                   -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                   -23422,-22916,-23422,-22916,-23422,-22916,-23422,-22916,
                                   -23670,-22659,-23670,-22659,-23670,-22659,-23670,-22659,
                                   -23916,-22400,-23916,-22400,-23916,-22400,-23916,-22400,
                                   -24159,-22138,-24159,-22138,-24159,-22138,-24159,-22138,
                                   -24399,-21873,-24399,-21873,-24399,-21873,-24399,-21873,
                                   -24636,-21605,-24636,-21605,-24636,-21605,-24636,-21605,
                                   -24870,-21335,-24870,-21335,-24870,-21335,-24870,-21335,
                                   -25101,-21063,-25101,-21063,-25101,-21063,-25101,-21063,
                                   -25330,-20788,-25330,-20788,-25330,-20788,-25330,-20788,
                                   -25555,-20510,-25555,-20510,-25555,-20510,-25555,-20510,
                                   -25777,-20230,-25777,-20230,-25777,-20230,-25777,-20230,
                                   -25996,-19948,-25996,-19948,-25996,-19948,-25996,-19948,
                                   -26212,-19663,-26212,-19663,-26212,-19663,-26212,-19663,
                                   -26425,-19376,-26425,-19376,-26425,-19376,-26425,-19376,
                                   -26635,-19087,-26635,-19087,-26635,-19087,-26635,-19087,
                                   -26842,-18795,-26842,-18795,-26842,-18795,-26842,-18795,
                                   -27045,-18501,-27045,-18501,-27045,-18501,-27045,-18501,
                                   -27245,-18205,-27245,-18205,-27245,-18205,-27245,-18205,
                                   -27442,-17907,-27442,-17907,-27442,-17907,-27442,-17907,
                                   -27636,-17606,-27636,-17606,-27636,-17606,-27636,-17606,
                                   -27826,-17304,-27826,-17304,-27826,-17304,-27826,-17304,
                                   -28013,-16999,-28013,-16999,-28013,-16999,-28013,-16999,
                                   -28197,-16693,-28197,-16693,-28197,-16693,-28197,-16693,
                                   -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                   -28555,-16073,-28555,-16073,-28555,-16073,-28555,-16073,
                                   -28728,-15761,-28728,-15761,-28728,-15761,-28728,-15761,
                                   -28898,-15447,-28898,-15447,-28898,-15447,-28898,-15447,
                                   -29065,-15131,-29065,-15131,-29065,-15131,-29065,-15131,
                                   -29228,-14813,-29228,-14813,-29228,-14813,-29228,-14813,
                                   -29388,-14493,-29388,-14493,-29388,-14493,-29388,-14493,
                                   -29545,-14172,-29545,-14172,-29545,-14172,-29545,-14172,
                                   -29697,-13848,-29697,-13848,-29697,-13848,-29697,-13848,
                                   -29847,-13524,-29847,-13524,-29847,-13524,-29847,-13524,
                                   -29993,-13197,-29993,-13197,-29993,-13197,-29993,-13197,
                                   -30135,-12869,-30135,-12869,-30135,-12869,-30135,-12869,
                                   -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                   -30408,-12209,-30408,-12209,-30408,-12209,-30408,-12209,
                                   -30540,-11877,-30540,-11877,-30540,-11877,-30540,-11877,
                                   -30667,-11543,-30667,-11543,-30667,-11543,-30667,-11543,
                                   -30791,-11207,-30791,-11207,-30791,-11207,-30791,-11207,
                                   -30912,-10871,-30912,-10871,-30912,-10871,-30912,-10871,
                                   -31029,-10533,-31029,-10533,-31029,-10533,-31029,-10533,
                                   -31142,-10194,-31142,-10194,-31142,-10194,-31142,-10194,
                                   -31251,-9854,-31251,-9854,-31251,-9854,-31251,-9854,
                                   -31357,-9512,-31357,-9512,-31357,-9512,-31357,-9512,
                                   -31458,-9170,-31458,-9170,-31458,-9170,-31458,-9170,
                                   -31557,-8826,-31557,-8826,-31557,-8826,-31557,-8826,
                                   -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                   -31742,-8135,-31742,-8135,-31742,-8135,-31742,-8135,
                                   -31828,-7789,-31828,-7789,-31828,-7789,-31828,-7789,
                                   -31912,-7441,-31912,-7441,-31912,-7441,-31912,-7441,
                                   -31991,-7093,-31991,-7093,-31991,-7093,-31991,-7093,
                                   -32066,-6743,-32066,-6743,-32066,-6743,-32066,-6743,
                                   -32138,-6393,-32138,-6393,-32138,-6393,-32138,-6393,
                                   -32206,-6042,-32206,-6042,-32206,-6042,-32206,-6042,
                                   -32270,-5690,-32270,-5690,-32270,-5690,-32270,-5690,
                                   -32330,-5338,-32330,-5338,-32330,-5338,-32330,-5338,
                                   -32386,-4985,-32386,-4985,-32386,-4985,-32386,-4985,
                                   -32439,-4632,-32439,-4632,-32439,-4632,-32439,-4632,
                                   -32487,-4277,-32487,-4277,-32487,-4277,-32487,-4277,
                                   -32532,-3923,-32532,-3923,-32532,-3923,-32532,-3923,
                                   -32573,-3568,-32573,-3568,-32573,-3568,-32573,-3568,
                                   -32610,-3212,-32610,-3212,-32610,-3212,-32610,-3212,
                                   -32643,-2856,-32643,-2856,-32643,-2856,-32643,-2856,
                                   -32672,-2500,-32672,-2500,-32672,-2500,-32672,-2500,
                                   -32697,-2144,-32697,-2144,-32697,-2144,-32697,-2144,
                                   -32719,-1787,-32719,-1787,-32719,-1787,-32719,-1787,
                                   -32736,-1430,-32736,-1430,-32736,-1430,-32736,-1430,
                                   -32750,-1073,-32750,-1073,-32750,-1073,-32750,-1073,
                                   -32760,-715,-32760,-715,-32760,-715,-32760,-715,
                                   -32766,-358,-32766,-358,-32766,-358,-32766,-358
                                  };
Raymond Knopp's avatar
 
Raymond Knopp committed
14799 14800

static int16_t twc1152[287*2*4] = {32762,-537,32762,-537,32762,-537,32762,-537,
14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090
                                   32749,-1073,32749,-1073,32749,-1073,32749,-1073,
                                   32727,-1608,32727,-1608,32727,-1608,32727,-1608,
                                   32696,-2144,32696,-2144,32696,-2144,32696,-2144,
                                   32657,-2678,32657,-2678,32657,-2678,32657,-2678,
                                   32609,-3212,32609,-3212,32609,-3212,32609,-3212,
                                   32552,-3745,32552,-3745,32552,-3745,32552,-3745,
                                   32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                                   32412,-4808,32412,-4808,32412,-4808,32412,-4808,
                                   32329,-5338,32329,-5338,32329,-5338,32329,-5338,
                                   32237,-5866,32237,-5866,32237,-5866,32237,-5866,
                                   32137,-6393,32137,-6393,32137,-6393,32137,-6393,
                                   32028,-6918,32028,-6918,32028,-6918,32028,-6918,
                                   31911,-7441,31911,-7441,31911,-7441,31911,-7441,
                                   31785,-7962,31785,-7962,31785,-7962,31785,-7962,
                                   31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                                   31507,-8998,31507,-8998,31507,-8998,31507,-8998,
                                   31356,-9512,31356,-9512,31356,-9512,31356,-9512,
                                   31196,-10024,31196,-10024,31196,-10024,31196,-10024,
                                   31028,-10533,31028,-10533,31028,-10533,31028,-10533,
                                   30851,-11039,30851,-11039,30851,-11039,30851,-11039,
                                   30666,-11543,30666,-11543,30666,-11543,30666,-11543,
                                   30473,-12043,30473,-12043,30473,-12043,30473,-12043,
                                   30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                                   30063,-13034,30063,-13034,30063,-13034,30063,-13034,
                                   29846,-13524,29846,-13524,29846,-13524,29846,-13524,
                                   29621,-14010,29621,-14010,29621,-14010,29621,-14010,
                                   29387,-14493,29387,-14493,29387,-14493,29387,-14493,
                                   29146,-14972,29146,-14972,29146,-14972,29146,-14972,
                                   28897,-15447,28897,-15447,28897,-15447,28897,-15447,
                                   28641,-15918,28641,-15918,28641,-15918,28641,-15918,
                                   28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                                   28105,-16846,28105,-16846,28105,-16846,28105,-16846,
                                   27825,-17304,27825,-17304,27825,-17304,27825,-17304,
                                   27538,-17757,27538,-17757,27538,-17757,27538,-17757,
                                   27244,-18205,27244,-18205,27244,-18205,27244,-18205,
                                   26943,-18648,26943,-18648,26943,-18648,26943,-18648,
                                   26634,-19087,26634,-19087,26634,-19087,26634,-19087,
                                   26318,-19520,26318,-19520,26318,-19520,26318,-19520,
                                   25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                                   25665,-20370,25665,-20370,25665,-20370,25665,-20370,
                                   25329,-20788,25329,-20788,25329,-20788,25329,-20788,
                                   24985,-21199,24985,-21199,24985,-21199,24985,-21199,
                                   24635,-21605,24635,-21605,24635,-21605,24635,-21605,
                                   24278,-22005,24278,-22005,24278,-22005,24278,-22005,
                                   23915,-22400,23915,-22400,23915,-22400,23915,-22400,
                                   23545,-22788,23545,-22788,23545,-22788,23545,-22788,
                                   23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                                   22787,-23546,22787,-23546,22787,-23546,22787,-23546,
                                   22399,-23916,22399,-23916,22399,-23916,22399,-23916,
                                   22004,-24279,22004,-24279,22004,-24279,22004,-24279,
                                   21604,-24636,21604,-24636,21604,-24636,21604,-24636,
                                   21198,-24986,21198,-24986,21198,-24986,21198,-24986,
                                   20787,-25330,20787,-25330,20787,-25330,20787,-25330,
                                   20369,-25666,20369,-25666,20369,-25666,20369,-25666,
                                   19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                                   19519,-26319,19519,-26319,19519,-26319,19519,-26319,
                                   19086,-26635,19086,-26635,19086,-26635,19086,-26635,
                                   18647,-26944,18647,-26944,18647,-26944,18647,-26944,
                                   18204,-27245,18204,-27245,18204,-27245,18204,-27245,
                                   17756,-27539,17756,-27539,17756,-27539,17756,-27539,
                                   17303,-27826,17303,-27826,17303,-27826,17303,-27826,
                                   16845,-28106,16845,-28106,16845,-28106,16845,-28106,
                                   16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                                   15917,-28642,15917,-28642,15917,-28642,15917,-28642,
                                   15446,-28898,15446,-28898,15446,-28898,15446,-28898,
                                   14971,-29147,14971,-29147,14971,-29147,14971,-29147,
                                   14492,-29388,14492,-29388,14492,-29388,14492,-29388,
                                   14009,-29622,14009,-29622,14009,-29622,14009,-29622,
                                   13523,-29847,13523,-29847,13523,-29847,13523,-29847,
                                   13033,-30064,13033,-30064,13033,-30064,13033,-30064,
                                   12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                                   12042,-30474,12042,-30474,12042,-30474,12042,-30474,
                                   11542,-30667,11542,-30667,11542,-30667,11542,-30667,
                                   11038,-30852,11038,-30852,11038,-30852,11038,-30852,
                                   10532,-31029,10532,-31029,10532,-31029,10532,-31029,
                                   10023,-31197,10023,-31197,10023,-31197,10023,-31197,
                                   9511,-31357,9511,-31357,9511,-31357,9511,-31357,
                                   8997,-31508,8997,-31508,8997,-31508,8997,-31508,
                                   8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                                   7961,-31786,7961,-31786,7961,-31786,7961,-31786,
                                   7440,-31912,7440,-31912,7440,-31912,7440,-31912,
                                   6917,-32029,6917,-32029,6917,-32029,6917,-32029,
                                   6392,-32138,6392,-32138,6392,-32138,6392,-32138,
                                   5865,-32238,5865,-32238,5865,-32238,5865,-32238,
                                   5337,-32330,5337,-32330,5337,-32330,5337,-32330,
                                   4807,-32413,4807,-32413,4807,-32413,4807,-32413,
                                   4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                                   3744,-32553,3744,-32553,3744,-32553,3744,-32553,
                                   3211,-32610,3211,-32610,3211,-32610,3211,-32610,
                                   2677,-32658,2677,-32658,2677,-32658,2677,-32658,
                                   2143,-32697,2143,-32697,2143,-32697,2143,-32697,
                                   1607,-32728,1607,-32728,1607,-32728,1607,-32728,
                                   1072,-32750,1072,-32750,1072,-32750,1072,-32750,
                                   536,-32763,536,-32763,536,-32763,536,-32763,
                                   0,-32767,0,-32767,0,-32767,0,-32767,
                                   -537,-32763,-537,-32763,-537,-32763,-537,-32763,
                                   -1073,-32750,-1073,-32750,-1073,-32750,-1073,-32750,
                                   -1608,-32728,-1608,-32728,-1608,-32728,-1608,-32728,
                                   -2144,-32697,-2144,-32697,-2144,-32697,-2144,-32697,
                                   -2678,-32658,-2678,-32658,-2678,-32658,-2678,-32658,
                                   -3212,-32610,-3212,-32610,-3212,-32610,-3212,-32610,
                                   -3745,-32553,-3745,-32553,-3745,-32553,-3745,-32553,
                                   -4277,-32487,-4277,-32487,-4277,-32487,-4277,-32487,
                                   -4808,-32413,-4808,-32413,-4808,-32413,-4808,-32413,
                                   -5338,-32330,-5338,-32330,-5338,-32330,-5338,-32330,
                                   -5866,-32238,-5866,-32238,-5866,-32238,-5866,-32238,
                                   -6393,-32138,-6393,-32138,-6393,-32138,-6393,-32138,
                                   -6918,-32029,-6918,-32029,-6918,-32029,-6918,-32029,
                                   -7441,-31912,-7441,-31912,-7441,-31912,-7441,-31912,
                                   -7962,-31786,-7962,-31786,-7962,-31786,-7962,-31786,
                                   -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                                   -8998,-31508,-8998,-31508,-8998,-31508,-8998,-31508,
                                   -9512,-31357,-9512,-31357,-9512,-31357,-9512,-31357,
                                   -10024,-31197,-10024,-31197,-10024,-31197,-10024,-31197,
                                   -10533,-31029,-10533,-31029,-10533,-31029,-10533,-31029,
                                   -11039,-30852,-11039,-30852,-11039,-30852,-11039,-30852,
                                   -11543,-30667,-11543,-30667,-11543,-30667,-11543,-30667,
                                   -12043,-30474,-12043,-30474,-12043,-30474,-12043,-30474,
                                   -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                                   -13034,-30064,-13034,-30064,-13034,-30064,-13034,-30064,
                                   -13524,-29847,-13524,-29847,-13524,-29847,-13524,-29847,
                                   -14010,-29622,-14010,-29622,-14010,-29622,-14010,-29622,
                                   -14493,-29388,-14493,-29388,-14493,-29388,-14493,-29388,
                                   -14972,-29147,-14972,-29147,-14972,-29147,-14972,-29147,
                                   -15447,-28898,-15447,-28898,-15447,-28898,-15447,-28898,
                                   -15918,-28642,-15918,-28642,-15918,-28642,-15918,-28642,
                                   -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                                   -16846,-28106,-16846,-28106,-16846,-28106,-16846,-28106,
                                   -17304,-27826,-17304,-27826,-17304,-27826,-17304,-27826,
                                   -17757,-27539,-17757,-27539,-17757,-27539,-17757,-27539,
                                   -18205,-27245,-18205,-27245,-18205,-27245,-18205,-27245,
                                   -18648,-26944,-18648,-26944,-18648,-26944,-18648,-26944,
                                   -19087,-26635,-19087,-26635,-19087,-26635,-19087,-26635,
                                   -19520,-26319,-19520,-26319,-19520,-26319,-19520,-26319,
                                   -19948,-25996,-19948,-25996,-19948,-25996,-19948,-25996,
                                   -20370,-25666,-20370,-25666,-20370,-25666,-20370,-25666,
                                   -20788,-25330,-20788,-25330,-20788,-25330,-20788,-25330,
                                   -21199,-24986,-21199,-24986,-21199,-24986,-21199,-24986,
                                   -21605,-24636,-21605,-24636,-21605,-24636,-21605,-24636,
                                   -22005,-24279,-22005,-24279,-22005,-24279,-22005,-24279,
                                   -22400,-23916,-22400,-23916,-22400,-23916,-22400,-23916,
                                   -22788,-23546,-22788,-23546,-22788,-23546,-22788,-23546,
                                   -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                                   -23546,-22788,-23546,-22788,-23546,-22788,-23546,-22788,
                                   -23916,-22400,-23916,-22400,-23916,-22400,-23916,-22400,
                                   -24279,-22005,-24279,-22005,-24279,-22005,-24279,-22005,
                                   -24636,-21605,-24636,-21605,-24636,-21605,-24636,-21605,
                                   -24986,-21199,-24986,-21199,-24986,-21199,-24986,-21199,
                                   -25330,-20788,-25330,-20788,-25330,-20788,-25330,-20788,
                                   -25666,-20370,-25666,-20370,-25666,-20370,-25666,-20370,
                                   -25996,-19948,-25996,-19948,-25996,-19948,-25996,-19948,
                                   -26319,-19520,-26319,-19520,-26319,-19520,-26319,-19520,
                                   -26635,-19087,-26635,-19087,-26635,-19087,-26635,-19087,
                                   -26944,-18648,-26944,-18648,-26944,-18648,-26944,-18648,
                                   -27245,-18205,-27245,-18205,-27245,-18205,-27245,-18205,
                                   -27539,-17757,-27539,-17757,-27539,-17757,-27539,-17757,
                                   -27826,-17304,-27826,-17304,-27826,-17304,-27826,-17304,
                                   -28106,-16846,-28106,-16846,-28106,-16846,-28106,-16846,
                                   -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                                   -28642,-15918,-28642,-15918,-28642,-15918,-28642,-15918,
                                   -28898,-15447,-28898,-15447,-28898,-15447,-28898,-15447,
                                   -29147,-14972,-29147,-14972,-29147,-14972,-29147,-14972,
                                   -29388,-14493,-29388,-14493,-29388,-14493,-29388,-14493,
                                   -29622,-14010,-29622,-14010,-29622,-14010,-29622,-14010,
                                   -29847,-13524,-29847,-13524,-29847,-13524,-29847,-13524,
                                   -30064,-13034,-30064,-13034,-30064,-13034,-30064,-13034,
                                   -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                                   -30474,-12043,-30474,-12043,-30474,-12043,-30474,-12043,
                                   -30667,-11543,-30667,-11543,-30667,-11543,-30667,-11543,
                                   -30852,-11039,-30852,-11039,-30852,-11039,-30852,-11039,
                                   -31029,-10533,-31029,-10533,-31029,-10533,-31029,-10533,
                                   -31197,-10024,-31197,-10024,-31197,-10024,-31197,-10024,
                                   -31357,-9512,-31357,-9512,-31357,-9512,-31357,-9512,
                                   -31508,-8998,-31508,-8998,-31508,-8998,-31508,-8998,
                                   -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                                   -31786,-7962,-31786,-7962,-31786,-7962,-31786,-7962,
                                   -31912,-7441,-31912,-7441,-31912,-7441,-31912,-7441,
                                   -32029,-6918,-32029,-6918,-32029,-6918,-32029,-6918,
                                   -32138,-6393,-32138,-6393,-32138,-6393,-32138,-6393,
                                   -32238,-5866,-32238,-5866,-32238,-5866,-32238,-5866,
                                   -32330,-5338,-32330,-5338,-32330,-5338,-32330,-5338,
                                   -32413,-4808,-32413,-4808,-32413,-4808,-32413,-4808,
                                   -32487,-4277,-32487,-4277,-32487,-4277,-32487,-4277,
                                   -32553,-3745,-32553,-3745,-32553,-3745,-32553,-3745,
                                   -32610,-3212,-32610,-3212,-32610,-3212,-32610,-3212,
                                   -32658,-2678,-32658,-2678,-32658,-2678,-32658,-2678,
                                   -32697,-2144,-32697,-2144,-32697,-2144,-32697,-2144,
                                   -32728,-1608,-32728,-1608,-32728,-1608,-32728,-1608,
                                   -32750,-1073,-32750,-1073,-32750,-1073,-32750,-1073,
                                   -32763,-537,-32763,-537,-32763,-537,-32763,-537,
                                   -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                                   -32763,536,-32763,536,-32763,536,-32763,536,
                                   -32750,1072,-32750,1072,-32750,1072,-32750,1072,
                                   -32728,1607,-32728,1607,-32728,1607,-32728,1607,
                                   -32697,2143,-32697,2143,-32697,2143,-32697,2143,
                                   -32658,2677,-32658,2677,-32658,2677,-32658,2677,
                                   -32610,3211,-32610,3211,-32610,3211,-32610,3211,
                                   -32553,3744,-32553,3744,-32553,3744,-32553,3744,
                                   -32487,4276,-32487,4276,-32487,4276,-32487,4276,
                                   -32413,4807,-32413,4807,-32413,4807,-32413,4807,
                                   -32330,5337,-32330,5337,-32330,5337,-32330,5337,
                                   -32238,5865,-32238,5865,-32238,5865,-32238,5865,
                                   -32138,6392,-32138,6392,-32138,6392,-32138,6392,
                                   -32029,6917,-32029,6917,-32029,6917,-32029,6917,
                                   -31912,7440,-31912,7440,-31912,7440,-31912,7440,
                                   -31786,7961,-31786,7961,-31786,7961,-31786,7961,
                                   -31651,8480,-31651,8480,-31651,8480,-31651,8480,
                                   -31508,8997,-31508,8997,-31508,8997,-31508,8997,
                                   -31357,9511,-31357,9511,-31357,9511,-31357,9511,
                                   -31197,10023,-31197,10023,-31197,10023,-31197,10023,
                                   -31029,10532,-31029,10532,-31029,10532,-31029,10532,
                                   -30852,11038,-30852,11038,-30852,11038,-30852,11038,
                                   -30667,11542,-30667,11542,-30667,11542,-30667,11542,
                                   -30474,12042,-30474,12042,-30474,12042,-30474,12042,
                                   -30273,12539,-30273,12539,-30273,12539,-30273,12539,
                                   -30064,13033,-30064,13033,-30064,13033,-30064,13033,
                                   -29847,13523,-29847,13523,-29847,13523,-29847,13523,
                                   -29622,14009,-29622,14009,-29622,14009,-29622,14009,
                                   -29388,14492,-29388,14492,-29388,14492,-29388,14492,
                                   -29147,14971,-29147,14971,-29147,14971,-29147,14971,
                                   -28898,15446,-28898,15446,-28898,15446,-28898,15446,
                                   -28642,15917,-28642,15917,-28642,15917,-28642,15917,
                                   -28378,16383,-28378,16383,-28378,16383,-28378,16383,
                                   -28106,16845,-28106,16845,-28106,16845,-28106,16845,
                                   -27826,17303,-27826,17303,-27826,17303,-27826,17303,
                                   -27539,17756,-27539,17756,-27539,17756,-27539,17756,
                                   -27245,18204,-27245,18204,-27245,18204,-27245,18204,
                                   -26944,18647,-26944,18647,-26944,18647,-26944,18647,
                                   -26635,19086,-26635,19086,-26635,19086,-26635,19086,
                                   -26319,19519,-26319,19519,-26319,19519,-26319,19519,
                                   -25996,19947,-25996,19947,-25996,19947,-25996,19947,
                                   -25666,20369,-25666,20369,-25666,20369,-25666,20369,
                                   -25330,20787,-25330,20787,-25330,20787,-25330,20787,
                                   -24986,21198,-24986,21198,-24986,21198,-24986,21198,
                                   -24636,21604,-24636,21604,-24636,21604,-24636,21604,
                                   -24279,22004,-24279,22004,-24279,22004,-24279,22004,
                                   -23916,22399,-23916,22399,-23916,22399,-23916,22399,
                                   -23546,22787,-23546,22787,-23546,22787,-23546,22787,
                                   -23170,23169,-23170,23169,-23170,23169,-23170,23169,
                                   -22788,23545,-22788,23545,-22788,23545,-22788,23545,
                                   -22400,23915,-22400,23915,-22400,23915,-22400,23915,
                                   -22005,24278,-22005,24278,-22005,24278,-22005,24278,
                                   -21605,24635,-21605,24635,-21605,24635,-21605,24635,
                                   -21199,24985,-21199,24985,-21199,24985,-21199,24985,
                                   -20788,25329,-20788,25329,-20788,25329,-20788,25329,
                                   -20370,25665,-20370,25665,-20370,25665,-20370,25665,
                                   -19948,25995,-19948,25995,-19948,25995,-19948,25995,
                                   -19520,26318,-19520,26318,-19520,26318,-19520,26318,
                                   -19087,26634,-19087,26634,-19087,26634,-19087,26634,
                                   -18648,26943,-18648,26943,-18648,26943,-18648,26943,
                                   -18205,27244,-18205,27244,-18205,27244,-18205,27244,
                                   -17757,27538,-17757,27538,-17757,27538,-17757,27538,
                                   -17304,27825,-17304,27825,-17304,27825,-17304,27825,
                                   -16846,28105,-16846,28105,-16846,28105,-16846,28105,
                                   -16384,28377,-16384,28377,-16384,28377,-16384,28377,
                                   -15918,28641,-15918,28641,-15918,28641,-15918,28641,
                                   -15447,28897,-15447,28897,-15447,28897,-15447,28897,
                                   -14972,29146,-14972,29146,-14972,29146,-14972,29146,
                                   -14493,29387,-14493,29387,-14493,29387,-14493,29387,
                                   -14010,29621,-14010,29621,-14010,29621,-14010,29621,
                                   -13524,29846,-13524,29846,-13524,29846,-13524,29846,
                                   -13034,30063,-13034,30063,-13034,30063,-13034,30063,
                                   -12540,30272,-12540,30272,-12540,30272,-12540,30272,
                                   -12043,30473,-12043,30473,-12043,30473,-12043,30473,
                                   -11543,30666,-11543,30666,-11543,30666,-11543,30666,
                                   -11039,30851,-11039,30851,-11039,30851,-11039,30851,
                                   -10533,31028,-10533,31028,-10533,31028,-10533,31028,
                                   -10024,31196,-10024,31196,-10024,31196,-10024,31196,
                                   -9512,31356,-9512,31356,-9512,31356,-9512,31356,
                                   -8998,31507,-8998,31507,-8998,31507,-8998,31507,
                                   -8481,31650,-8481,31650,-8481,31650,-8481,31650,
                                   -7962,31785,-7962,31785,-7962,31785,-7962,31785,
                                   -7441,31911,-7441,31911,-7441,31911,-7441,31911,
                                   -6918,32028,-6918,32028,-6918,32028,-6918,32028,
                                   -6393,32137,-6393,32137,-6393,32137,-6393,32137,
                                   -5866,32237,-5866,32237,-5866,32237,-5866,32237,
                                   -5338,32329,-5338,32329,-5338,32329,-5338,32329,
                                   -4808,32412,-4808,32412,-4808,32412,-4808,32412,
                                   -4277,32486,-4277,32486,-4277,32486,-4277,32486,
                                   -3745,32552,-3745,32552,-3745,32552,-3745,32552,
                                   -3212,32609,-3212,32609,-3212,32609,-3212,32609,
                                   -2678,32657,-2678,32657,-2678,32657,-2678,32657,
                                   -2144,32696,-2144,32696,-2144,32696,-2144,32696,
                                   -1608,32727,-1608,32727,-1608,32727,-1608,32727,
                                   -1073,32749,-1073,32749,-1073,32749,-1073,32749,
                                   -537,32762,-537,32762,-537,32762,-537,32762
                                  };

void dft1152(int16_t *x,int16_t *y,unsigned char scale_flag)  // 288 x 4
{
Raymond Knopp's avatar
 
Raymond Knopp committed
15091 15092

  int i,j;
15093 15094 15095 15096 15097 15098 15099
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa1152[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb1152[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc1152[0];
  simd_q15_t x2128[1152];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[1152];//=&ytmp128array2[0];
Raymond Knopp's avatar
 
Raymond Knopp committed
15100 15101 15102



15103
  for (i=0,j=0; i<288; i++,j+=4) {
Raymond Knopp's avatar
 
Raymond Knopp committed
15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115
    x2128[i]    = x128[j];
    x2128[i+288] = x128[j+1];
    x2128[i+576] = x128[j+2];
    x2128[i+864] = x128[j+3];
  }

  dft288((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft288((int16_t *)(x2128+288),(int16_t *)(ytmp128+288),1);
  dft288((int16_t *)(x2128+576),(int16_t *)(ytmp128+576),1);
  dft288((int16_t *)(x2128+864),(int16_t *)(ytmp128+864),1);

  bfly4_tw1(ytmp128,ytmp128+288,ytmp128+576,ytmp128+864,y128,y128+288,y128+576,y128+864);
15116 15117

  for (i=1,j=0; i<288; i++,j++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
15118
    bfly4(ytmp128+i,
15119 15120 15121 15122 15123 15124 15125 15126 15127 15128
          ytmp128+288+i,
          ytmp128+576+i,
          ytmp128+864+i,
          y128+i,
          y128+288+i,
          y128+576+i,
          y128+864+i,
          twa128+j,
          twb128+j,
          twc128+j);
Raymond Knopp's avatar
 
Raymond Knopp committed
15129 15130 15131
  }

  if (scale_flag==1) {
15132
    norm128 = set1_int16(16384);//dft_norm_table[13]);
15133 15134

    for (i=0; i<1152; i++) {
15135
      y128[i] = mulhi_int16(y128[i],norm128);
Raymond Knopp's avatar
 
Raymond Knopp committed
15136 15137 15138 15139 15140 15141 15142
    }
  }

  _mm_empty();
  _m_empty();
};

15143
int16_t twa1200[4784] = { 32766,-172,32766,-172,32766,-172,32766,-172,
15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442
                          32765,-344,32765,-344,32765,-344,32765,-344,
                          32762,-515,32762,-515,32762,-515,32762,-515,
                          32759,-687,32759,-687,32759,-687,32759,-687,
                          32755,-858,32755,-858,32755,-858,32755,-858,
                          32750,-1030,32750,-1030,32750,-1030,32750,-1030,
                          32744,-1201,32744,-1201,32744,-1201,32744,-1201,
                          32738,-1373,32738,-1373,32738,-1373,32738,-1373,
                          32730,-1544,32730,-1544,32730,-1544,32730,-1544,
                          32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                          32712,-1887,32712,-1887,32712,-1887,32712,-1887,
                          32702,-2058,32702,-2058,32702,-2058,32702,-2058,
                          32691,-2229,32691,-2229,32691,-2229,32691,-2229,
                          32679,-2400,32679,-2400,32679,-2400,32679,-2400,
                          32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                          32652,-2742,32652,-2742,32652,-2742,32652,-2742,
                          32637,-2913,32637,-2913,32637,-2913,32637,-2913,
                          32621,-3084,32621,-3084,32621,-3084,32621,-3084,
                          32604,-3255,32604,-3255,32604,-3255,32604,-3255,
                          32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                          32569,-3596,32569,-3596,32569,-3596,32569,-3596,
                          32549,-3767,32549,-3767,32549,-3767,32549,-3767,
                          32529,-3937,32529,-3937,32529,-3937,32529,-3937,
                          32508,-4107,32508,-4107,32508,-4107,32508,-4107,
                          32486,-4277,32486,-4277,32486,-4277,32486,-4277,
                          32463,-4447,32463,-4447,32463,-4447,32463,-4447,
                          32440,-4617,32440,-4617,32440,-4617,32440,-4617,
                          32415,-4787,32415,-4787,32415,-4787,32415,-4787,
                          32389,-4957,32389,-4957,32389,-4957,32389,-4957,
                          32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                          32336,-5296,32336,-5296,32336,-5296,32336,-5296,
                          32308,-5465,32308,-5465,32308,-5465,32308,-5465,
                          32279,-5634,32279,-5634,32279,-5634,32279,-5634,
                          32249,-5803,32249,-5803,32249,-5803,32249,-5803,
                          32218,-5972,32218,-5972,32218,-5972,32218,-5972,
                          32186,-6140,32186,-6140,32186,-6140,32186,-6140,
                          32154,-6309,32154,-6309,32154,-6309,32154,-6309,
                          32120,-6477,32120,-6477,32120,-6477,32120,-6477,
                          32086,-6645,32086,-6645,32086,-6645,32086,-6645,
                          32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                          32014,-6981,32014,-6981,32014,-6981,32014,-6981,
                          31977,-7148,31977,-7148,31977,-7148,31977,-7148,
                          31940,-7316,31940,-7316,31940,-7316,31940,-7316,
                          31901,-7483,31901,-7483,31901,-7483,31901,-7483,
                          31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                          31821,-7817,31821,-7817,31821,-7817,31821,-7817,
                          31779,-7983,31779,-7983,31779,-7983,31779,-7983,
                          31737,-8149,31737,-8149,31737,-8149,31737,-8149,
                          31694,-8315,31694,-8315,31694,-8315,31694,-8315,
                          31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                          31605,-8647,31605,-8647,31605,-8647,31605,-8647,
                          31559,-8812,31559,-8812,31559,-8812,31559,-8812,
                          31513,-8977,31513,-8977,31513,-8977,31513,-8977,
                          31465,-9142,31465,-9142,31465,-9142,31465,-9142,
                          31417,-9307,31417,-9307,31417,-9307,31417,-9307,
                          31368,-9471,31368,-9471,31368,-9471,31368,-9471,
                          31318,-9635,31318,-9635,31318,-9635,31318,-9635,
                          31267,-9799,31267,-9799,31267,-9799,31267,-9799,
                          31215,-9963,31215,-9963,31215,-9963,31215,-9963,
                          31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                          31109,-10289,31109,-10289,31109,-10289,31109,-10289,
                          31055,-10452,31055,-10452,31055,-10452,31055,-10452,
                          31000,-10614,31000,-10614,31000,-10614,31000,-10614,
                          30944,-10776,30944,-10776,30944,-10776,30944,-10776,
                          30887,-10938,30887,-10938,30887,-10938,30887,-10938,
                          30829,-11100,30829,-11100,30829,-11100,30829,-11100,
                          30771,-11261,30771,-11261,30771,-11261,30771,-11261,
                          30711,-11422,30711,-11422,30711,-11422,30711,-11422,
                          30651,-11583,30651,-11583,30651,-11583,30651,-11583,
                          30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                          30528,-11903,30528,-11903,30528,-11903,30528,-11903,
                          30465,-12063,30465,-12063,30465,-12063,30465,-12063,
                          30402,-12222,30402,-12222,30402,-12222,30402,-12222,
                          30338,-12381,30338,-12381,30338,-12381,30338,-12381,
                          30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                          30206,-12698,30206,-12698,30206,-12698,30206,-12698,
                          30139,-12856,30139,-12856,30139,-12856,30139,-12856,
                          30072,-13014,30072,-13014,30072,-13014,30072,-13014,
                          30003,-13171,30003,-13171,30003,-13171,30003,-13171,
                          29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                          29863,-13485,29863,-13485,29863,-13485,29863,-13485,
                          29792,-13641,29792,-13641,29792,-13641,29792,-13641,
                          29721,-13797,29721,-13797,29721,-13797,29721,-13797,
                          29648,-13952,29648,-13952,29648,-13952,29648,-13952,
                          29575,-14107,29575,-14107,29575,-14107,29575,-14107,
                          29500,-14262,29500,-14262,29500,-14262,29500,-14262,
                          29425,-14416,29425,-14416,29425,-14416,29425,-14416,
                          29349,-14570,29349,-14570,29349,-14570,29349,-14570,
                          29273,-14723,29273,-14723,29273,-14723,29273,-14723,
                          29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                          29117,-15029,29117,-15029,29117,-15029,29117,-15029,
                          29038,-15181,29038,-15181,29038,-15181,29038,-15181,
                          28958,-15333,28958,-15333,28958,-15333,28958,-15333,
                          28877,-15485,28877,-15485,28877,-15485,28877,-15485,
                          28796,-15636,28796,-15636,28796,-15636,28796,-15636,
                          28713,-15786,28713,-15786,28713,-15786,28713,-15786,
                          28630,-15936,28630,-15936,28630,-15936,28630,-15936,
                          28547,-16086,28547,-16086,28547,-16086,28547,-16086,
                          28462,-16235,28462,-16235,28462,-16235,28462,-16235,
                          28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                          28290,-16532,28290,-16532,28290,-16532,28290,-16532,
                          28203,-16680,28203,-16680,28203,-16680,28203,-16680,
                          28116,-16828,28116,-16828,28116,-16828,28116,-16828,
                          28027,-16975,28027,-16975,28027,-16975,28027,-16975,
                          27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                          27848,-17267,27848,-17267,27848,-17267,27848,-17267,
                          27757,-17413,27757,-17413,27757,-17413,27757,-17413,
                          27666,-17558,27666,-17558,27666,-17558,27666,-17558,
                          27573,-17703,27573,-17703,27573,-17703,27573,-17703,
                          27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                          27386,-17990,27386,-17990,27386,-17990,27386,-17990,
                          27292,-18133,27292,-18133,27292,-18133,27292,-18133,
                          27197,-18276,27197,-18276,27197,-18276,27197,-18276,
                          27100,-18418,27100,-18418,27100,-18418,27100,-18418,
                          27004,-18560,27004,-18560,27004,-18560,27004,-18560,
                          26906,-18701,26906,-18701,26906,-18701,26906,-18701,
                          26808,-18842,26808,-18842,26808,-18842,26808,-18842,
                          26709,-18982,26709,-18982,26709,-18982,26709,-18982,
                          26609,-19121,26609,-19121,26609,-19121,26609,-19121,
                          26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                          26407,-19399,26407,-19399,26407,-19399,26407,-19399,
                          26305,-19537,26305,-19537,26305,-19537,26305,-19537,
                          26203,-19674,26203,-19674,26203,-19674,26203,-19674,
                          26099,-19811,26099,-19811,26099,-19811,26099,-19811,
                          25995,-19948,25995,-19948,25995,-19948,25995,-19948,
                          25891,-20084,25891,-20084,25891,-20084,25891,-20084,
                          25785,-20219,25785,-20219,25785,-20219,25785,-20219,
                          25679,-20354,25679,-20354,25679,-20354,25679,-20354,
                          25572,-20488,25572,-20488,25572,-20488,25572,-20488,
                          25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                          25356,-20754,25356,-20754,25356,-20754,25356,-20754,
                          25247,-20887,25247,-20887,25247,-20887,25247,-20887,
                          25137,-21019,25137,-21019,25137,-21019,25137,-21019,
                          25027,-21150,25027,-21150,25027,-21150,25027,-21150,
                          24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                          24804,-21411,24804,-21411,24804,-21411,24804,-21411,
                          24692,-21541,24692,-21541,24692,-21541,24692,-21541,
                          24578,-21670,24578,-21670,24578,-21670,24578,-21670,
                          24465,-21798,24465,-21798,24465,-21798,24465,-21798,
                          24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                          24235,-22053,24235,-22053,24235,-22053,24235,-22053,
                          24119,-22180,24119,-22180,24119,-22180,24119,-22180,
                          24003,-22306,24003,-22306,24003,-22306,24003,-22306,
                          23886,-22431,23886,-22431,23886,-22431,23886,-22431,
                          23768,-22556,23768,-22556,23768,-22556,23768,-22556,
                          23649,-22680,23649,-22680,23649,-22680,23649,-22680,
                          23530,-22803,23530,-22803,23530,-22803,23530,-22803,
                          23411,-22926,23411,-22926,23411,-22926,23411,-22926,
                          23290,-23049,23290,-23049,23290,-23049,23290,-23049,
                          23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                          23048,-23291,23048,-23291,23048,-23291,23048,-23291,
                          22925,-23412,22925,-23412,22925,-23412,22925,-23412,
                          22802,-23531,22802,-23531,22802,-23531,22802,-23531,
                          22679,-23650,22679,-23650,22679,-23650,22679,-23650,
                          22555,-23769,22555,-23769,22555,-23769,22555,-23769,
                          22430,-23887,22430,-23887,22430,-23887,22430,-23887,
                          22305,-24004,22305,-24004,22305,-24004,22305,-24004,
                          22179,-24120,22179,-24120,22179,-24120,22179,-24120,
                          22052,-24236,22052,-24236,22052,-24236,22052,-24236,
                          21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                          21797,-24466,21797,-24466,21797,-24466,21797,-24466,
                          21669,-24579,21669,-24579,21669,-24579,21669,-24579,
                          21540,-24693,21540,-24693,21540,-24693,21540,-24693,
                          21410,-24805,21410,-24805,21410,-24805,21410,-24805,
                          21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                          21149,-25028,21149,-25028,21149,-25028,21149,-25028,
                          21018,-25138,21018,-25138,21018,-25138,21018,-25138,
                          20886,-25248,20886,-25248,20886,-25248,20886,-25248,
                          20753,-25357,20753,-25357,20753,-25357,20753,-25357,
                          20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                          20487,-25573,20487,-25573,20487,-25573,20487,-25573,
                          20353,-25680,20353,-25680,20353,-25680,20353,-25680,
                          20218,-25786,20218,-25786,20218,-25786,20218,-25786,
                          20083,-25892,20083,-25892,20083,-25892,20083,-25892,
                          19947,-25996,19947,-25996,19947,-25996,19947,-25996,
                          19810,-26100,19810,-26100,19810,-26100,19810,-26100,
                          19673,-26204,19673,-26204,19673,-26204,19673,-26204,
                          19536,-26306,19536,-26306,19536,-26306,19536,-26306,
                          19398,-26408,19398,-26408,19398,-26408,19398,-26408,
                          19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                          19120,-26610,19120,-26610,19120,-26610,19120,-26610,
                          18981,-26710,18981,-26710,18981,-26710,18981,-26710,
                          18841,-26809,18841,-26809,18841,-26809,18841,-26809,
                          18700,-26907,18700,-26907,18700,-26907,18700,-26907,
                          18559,-27005,18559,-27005,18559,-27005,18559,-27005,
                          18417,-27101,18417,-27101,18417,-27101,18417,-27101,
                          18275,-27198,18275,-27198,18275,-27198,18275,-27198,
                          18132,-27293,18132,-27293,18132,-27293,18132,-27293,
                          17989,-27387,17989,-27387,17989,-27387,17989,-27387,
                          17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                          17702,-27574,17702,-27574,17702,-27574,17702,-27574,
                          17557,-27667,17557,-27667,17557,-27667,17557,-27667,
                          17412,-27758,17412,-27758,17412,-27758,17412,-27758,
                          17266,-27849,17266,-27849,17266,-27849,17266,-27849,
                          17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                          16974,-28028,16974,-28028,16974,-28028,16974,-28028,
                          16827,-28117,16827,-28117,16827,-28117,16827,-28117,
                          16679,-28204,16679,-28204,16679,-28204,16679,-28204,
                          16531,-28291,16531,-28291,16531,-28291,16531,-28291,
                          16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                          16234,-28463,16234,-28463,16234,-28463,16234,-28463,
                          16085,-28548,16085,-28548,16085,-28548,16085,-28548,
                          15935,-28631,15935,-28631,15935,-28631,15935,-28631,
                          15785,-28714,15785,-28714,15785,-28714,15785,-28714,
                          15635,-28797,15635,-28797,15635,-28797,15635,-28797,
                          15484,-28878,15484,-28878,15484,-28878,15484,-28878,
                          15332,-28959,15332,-28959,15332,-28959,15332,-28959,
                          15180,-29039,15180,-29039,15180,-29039,15180,-29039,
                          15028,-29118,15028,-29118,15028,-29118,15028,-29118,
                          14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                          14722,-29274,14722,-29274,14722,-29274,14722,-29274,
                          14569,-29350,14569,-29350,14569,-29350,14569,-29350,
                          14415,-29426,14415,-29426,14415,-29426,14415,-29426,
                          14261,-29501,14261,-29501,14261,-29501,14261,-29501,
                          14106,-29576,14106,-29576,14106,-29576,14106,-29576,
                          13951,-29649,13951,-29649,13951,-29649,13951,-29649,
                          13796,-29722,13796,-29722,13796,-29722,13796,-29722,
                          13640,-29793,13640,-29793,13640,-29793,13640,-29793,
                          13484,-29864,13484,-29864,13484,-29864,13484,-29864,
                          13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                          13170,-30004,13170,-30004,13170,-30004,13170,-30004,
                          13013,-30073,13013,-30073,13013,-30073,13013,-30073,
                          12855,-30140,12855,-30140,12855,-30140,12855,-30140,
                          12697,-30207,12697,-30207,12697,-30207,12697,-30207,
                          12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                          12380,-30339,12380,-30339,12380,-30339,12380,-30339,
                          12221,-30403,12221,-30403,12221,-30403,12221,-30403,
                          12062,-30466,12062,-30466,12062,-30466,12062,-30466,
                          11902,-30529,11902,-30529,11902,-30529,11902,-30529,
                          11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                          11582,-30652,11582,-30652,11582,-30652,11582,-30652,
                          11421,-30712,11421,-30712,11421,-30712,11421,-30712,
                          11260,-30772,11260,-30772,11260,-30772,11260,-30772,
                          11099,-30830,11099,-30830,11099,-30830,11099,-30830,
                          10937,-30888,10937,-30888,10937,-30888,10937,-30888,
                          10775,-30945,10775,-30945,10775,-30945,10775,-30945,
                          10613,-31001,10613,-31001,10613,-31001,10613,-31001,
                          10451,-31056,10451,-31056,10451,-31056,10451,-31056,
                          10288,-31110,10288,-31110,10288,-31110,10288,-31110,
                          10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                          9962,-31216,9962,-31216,9962,-31216,9962,-31216,
                          9798,-31268,9798,-31268,9798,-31268,9798,-31268,
                          9634,-31319,9634,-31319,9634,-31319,9634,-31319,
                          9470,-31369,9470,-31369,9470,-31369,9470,-31369,
                          9306,-31418,9306,-31418,9306,-31418,9306,-31418,
                          9141,-31466,9141,-31466,9141,-31466,9141,-31466,
                          8976,-31514,8976,-31514,8976,-31514,8976,-31514,
                          8811,-31560,8811,-31560,8811,-31560,8811,-31560,
                          8646,-31606,8646,-31606,8646,-31606,8646,-31606,
                          8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                          8314,-31695,8314,-31695,8314,-31695,8314,-31695,
                          8148,-31738,8148,-31738,8148,-31738,8148,-31738,
                          7982,-31780,7982,-31780,7982,-31780,7982,-31780,
                          7816,-31822,7816,-31822,7816,-31822,7816,-31822,
                          7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                          7482,-31902,7482,-31902,7482,-31902,7482,-31902,
                          7315,-31941,7315,-31941,7315,-31941,7315,-31941,
                          7147,-31978,7147,-31978,7147,-31978,7147,-31978,
                          6980,-32015,6980,-32015,6980,-32015,6980,-32015,
                          6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                          6644,-32087,6644,-32087,6644,-32087,6644,-32087,
                          6476,-32121,6476,-32121,6476,-32121,6476,-32121,
                          6308,-32155,6308,-32155,6308,-32155,6308,-32155,
                          6139,-32187,6139,-32187,6139,-32187,6139,-32187,
                          5971,-32219,5971,-32219,5971,-32219,5971,-32219,
                          5802,-32250,5802,-32250,5802,-32250,5802,-32250,
                          5633,-32280,5633,-32280,5633,-32280,5633,-32280,
                          5464,-32309,5464,-32309,5464,-32309,5464,-32309,
                          5295,-32337,5295,-32337,5295,-32337,5295,-32337,
                          5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                          4956,-32390,4956,-32390,4956,-32390,4956,-32390,
                          4786,-32416,4786,-32416,4786,-32416,4786,-32416,
                          4616,-32441,4616,-32441,4616,-32441,4616,-32441,
                          4446,-32464,4446,-32464,4446,-32464,4446,-32464,
                          4276,-32487,4276,-32487,4276,-32487,4276,-32487,
                          4106,-32509,4106,-32509,4106,-32509,4106,-32509,
                          3936,-32530,3936,-32530,3936,-32530,3936,-32530,
                          3766,-32550,3766,-32550,3766,-32550,3766,-32550,
                          3595,-32570,3595,-32570,3595,-32570,3595,-32570,
                          3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                          3254,-32605,3254,-32605,3254,-32605,3254,-32605,
                          3083,-32622,3083,-32622,3083,-32622,3083,-32622,
                          2912,-32638,2912,-32638,2912,-32638,2912,-32638,
                          2741,-32653,2741,-32653,2741,-32653,2741,-32653,
                          2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                          2399,-32680,2399,-32680,2399,-32680,2399,-32680,
                          2228,-32692,2228,-32692,2228,-32692,2228,-32692,
                          2057,-32703,2057,-32703,2057,-32703,2057,-32703,
                          1886,-32713,1886,-32713,1886,-32713,1886,-32713,
                          1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                          1543,-32731,1543,-32731,1543,-32731,1543,-32731,
                          1372,-32739,1372,-32739,1372,-32739,1372,-32739,
                          1200,-32745,1200,-32745,1200,-32745,1200,-32745,
                          1029,-32751,1029,-32751,1029,-32751,1029,-32751,
                          857,-32756,857,-32756,857,-32756,857,-32756,
                          686,-32760,686,-32760,686,-32760,686,-32760,
                          514,-32763,514,-32763,514,-32763,514,-32763,
                          343,-32766,343,-32766,343,-32766,343,-32766,
                          171,-32767,171,-32767,171,-32767,171,-32767
                        };
15443 15444

int16_t twb1200[4784] = {32765,-344,32765,-344,32765,-344,32765,-344,
15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743
                         32759,-687,32759,-687,32759,-687,32759,-687,
                         32750,-1030,32750,-1030,32750,-1030,32750,-1030,
                         32738,-1373,32738,-1373,32738,-1373,32738,-1373,
                         32722,-1715,32722,-1715,32722,-1715,32722,-1715,
                         32702,-2058,32702,-2058,32702,-2058,32702,-2058,
                         32679,-2400,32679,-2400,32679,-2400,32679,-2400,
                         32652,-2742,32652,-2742,32652,-2742,32652,-2742,
                         32621,-3084,32621,-3084,32621,-3084,32621,-3084,
                         32587,-3426,32587,-3426,32587,-3426,32587,-3426,
                         32549,-3767,32549,-3767,32549,-3767,32549,-3767,
                         32508,-4107,32508,-4107,32508,-4107,32508,-4107,
                         32463,-4447,32463,-4447,32463,-4447,32463,-4447,
                         32415,-4787,32415,-4787,32415,-4787,32415,-4787,
                         32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                         32308,-5465,32308,-5465,32308,-5465,32308,-5465,
                         32249,-5803,32249,-5803,32249,-5803,32249,-5803,
                         32186,-6140,32186,-6140,32186,-6140,32186,-6140,
                         32120,-6477,32120,-6477,32120,-6477,32120,-6477,
                         32050,-6813,32050,-6813,32050,-6813,32050,-6813,
                         31977,-7148,31977,-7148,31977,-7148,31977,-7148,
                         31901,-7483,31901,-7483,31901,-7483,31901,-7483,
                         31821,-7817,31821,-7817,31821,-7817,31821,-7817,
                         31737,-8149,31737,-8149,31737,-8149,31737,-8149,
                         31650,-8481,31650,-8481,31650,-8481,31650,-8481,
                         31559,-8812,31559,-8812,31559,-8812,31559,-8812,
                         31465,-9142,31465,-9142,31465,-9142,31465,-9142,
                         31368,-9471,31368,-9471,31368,-9471,31368,-9471,
                         31267,-9799,31267,-9799,31267,-9799,31267,-9799,
                         31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                         31055,-10452,31055,-10452,31055,-10452,31055,-10452,
                         30944,-10776,30944,-10776,30944,-10776,30944,-10776,
                         30829,-11100,30829,-11100,30829,-11100,30829,-11100,
                         30711,-11422,30711,-11422,30711,-11422,30711,-11422,
                         30590,-11743,30590,-11743,30590,-11743,30590,-11743,
                         30465,-12063,30465,-12063,30465,-12063,30465,-12063,
                         30338,-12381,30338,-12381,30338,-12381,30338,-12381,
                         30206,-12698,30206,-12698,30206,-12698,30206,-12698,
                         30072,-13014,30072,-13014,30072,-13014,30072,-13014,
                         29934,-13328,29934,-13328,29934,-13328,29934,-13328,
                         29792,-13641,29792,-13641,29792,-13641,29792,-13641,
                         29648,-13952,29648,-13952,29648,-13952,29648,-13952,
                         29500,-14262,29500,-14262,29500,-14262,29500,-14262,
                         29349,-14570,29349,-14570,29349,-14570,29349,-14570,
                         29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                         29038,-15181,29038,-15181,29038,-15181,29038,-15181,
                         28877,-15485,28877,-15485,28877,-15485,28877,-15485,
                         28713,-15786,28713,-15786,28713,-15786,28713,-15786,
                         28547,-16086,28547,-16086,28547,-16086,28547,-16086,
                         28377,-16384,28377,-16384,28377,-16384,28377,-16384,
                         28203,-16680,28203,-16680,28203,-16680,28203,-16680,
                         28027,-16975,28027,-16975,28027,-16975,28027,-16975,
                         27848,-17267,27848,-17267,27848,-17267,27848,-17267,
                         27666,-17558,27666,-17558,27666,-17558,27666,-17558,
                         27480,-17847,27480,-17847,27480,-17847,27480,-17847,
                         27292,-18133,27292,-18133,27292,-18133,27292,-18133,
                         27100,-18418,27100,-18418,27100,-18418,27100,-18418,
                         26906,-18701,26906,-18701,26906,-18701,26906,-18701,
                         26709,-18982,26709,-18982,26709,-18982,26709,-18982,
                         26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                         26305,-19537,26305,-19537,26305,-19537,26305,-19537,
                         26099,-19811,26099,-19811,26099,-19811,26099,-19811,
                         25891,-20084,25891,-20084,25891,-20084,25891,-20084,
                         25679,-20354,25679,-20354,25679,-20354,25679,-20354,
                         25464,-20621,25464,-20621,25464,-20621,25464,-20621,
                         25247,-20887,25247,-20887,25247,-20887,25247,-20887,
                         25027,-21150,25027,-21150,25027,-21150,25027,-21150,
                         24804,-21411,24804,-21411,24804,-21411,24804,-21411,
                         24578,-21670,24578,-21670,24578,-21670,24578,-21670,
                         24350,-21926,24350,-21926,24350,-21926,24350,-21926,
                         24119,-22180,24119,-22180,24119,-22180,24119,-22180,
                         23886,-22431,23886,-22431,23886,-22431,23886,-22431,
                         23649,-22680,23649,-22680,23649,-22680,23649,-22680,
                         23411,-22926,23411,-22926,23411,-22926,23411,-22926,
                         23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                         22925,-23412,22925,-23412,22925,-23412,22925,-23412,
                         22679,-23650,22679,-23650,22679,-23650,22679,-23650,
                         22430,-23887,22430,-23887,22430,-23887,22430,-23887,
                         22179,-24120,22179,-24120,22179,-24120,22179,-24120,
                         21925,-24351,21925,-24351,21925,-24351,21925,-24351,
                         21669,-24579,21669,-24579,21669,-24579,21669,-24579,
                         21410,-24805,21410,-24805,21410,-24805,21410,-24805,
                         21149,-25028,21149,-25028,21149,-25028,21149,-25028,
                         20886,-25248,20886,-25248,20886,-25248,20886,-25248,
                         20620,-25465,20620,-25465,20620,-25465,20620,-25465,
                         20353,-25680,20353,-25680,20353,-25680,20353,-25680,
                         20083,-25892,20083,-25892,20083,-25892,20083,-25892,
                         19810,-26100,19810,-26100,19810,-26100,19810,-26100,
                         19536,-26306,19536,-26306,19536,-26306,19536,-26306,
                         19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                         18981,-26710,18981,-26710,18981,-26710,18981,-26710,
                         18700,-26907,18700,-26907,18700,-26907,18700,-26907,
                         18417,-27101,18417,-27101,18417,-27101,18417,-27101,
                         18132,-27293,18132,-27293,18132,-27293,18132,-27293,
                         17846,-27481,17846,-27481,17846,-27481,17846,-27481,
                         17557,-27667,17557,-27667,17557,-27667,17557,-27667,
                         17266,-27849,17266,-27849,17266,-27849,17266,-27849,
                         16974,-28028,16974,-28028,16974,-28028,16974,-28028,
                         16679,-28204,16679,-28204,16679,-28204,16679,-28204,
                         16383,-28378,16383,-28378,16383,-28378,16383,-28378,
                         16085,-28548,16085,-28548,16085,-28548,16085,-28548,
                         15785,-28714,15785,-28714,15785,-28714,15785,-28714,
                         15484,-28878,15484,-28878,15484,-28878,15484,-28878,
                         15180,-29039,15180,-29039,15180,-29039,15180,-29039,
                         14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                         14569,-29350,14569,-29350,14569,-29350,14569,-29350,
                         14261,-29501,14261,-29501,14261,-29501,14261,-29501,
                         13951,-29649,13951,-29649,13951,-29649,13951,-29649,
                         13640,-29793,13640,-29793,13640,-29793,13640,-29793,
                         13327,-29935,13327,-29935,13327,-29935,13327,-29935,
                         13013,-30073,13013,-30073,13013,-30073,13013,-30073,
                         12697,-30207,12697,-30207,12697,-30207,12697,-30207,
                         12380,-30339,12380,-30339,12380,-30339,12380,-30339,
                         12062,-30466,12062,-30466,12062,-30466,12062,-30466,
                         11742,-30591,11742,-30591,11742,-30591,11742,-30591,
                         11421,-30712,11421,-30712,11421,-30712,11421,-30712,
                         11099,-30830,11099,-30830,11099,-30830,11099,-30830,
                         10775,-30945,10775,-30945,10775,-30945,10775,-30945,
                         10451,-31056,10451,-31056,10451,-31056,10451,-31056,
                         10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                         9798,-31268,9798,-31268,9798,-31268,9798,-31268,
                         9470,-31369,9470,-31369,9470,-31369,9470,-31369,
                         9141,-31466,9141,-31466,9141,-31466,9141,-31466,
                         8811,-31560,8811,-31560,8811,-31560,8811,-31560,
                         8480,-31651,8480,-31651,8480,-31651,8480,-31651,
                         8148,-31738,8148,-31738,8148,-31738,8148,-31738,
                         7816,-31822,7816,-31822,7816,-31822,7816,-31822,
                         7482,-31902,7482,-31902,7482,-31902,7482,-31902,
                         7147,-31978,7147,-31978,7147,-31978,7147,-31978,
                         6812,-32051,6812,-32051,6812,-32051,6812,-32051,
                         6476,-32121,6476,-32121,6476,-32121,6476,-32121,
                         6139,-32187,6139,-32187,6139,-32187,6139,-32187,
                         5802,-32250,5802,-32250,5802,-32250,5802,-32250,
                         5464,-32309,5464,-32309,5464,-32309,5464,-32309,
                         5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                         4786,-32416,4786,-32416,4786,-32416,4786,-32416,
                         4446,-32464,4446,-32464,4446,-32464,4446,-32464,
                         4106,-32509,4106,-32509,4106,-32509,4106,-32509,
                         3766,-32550,3766,-32550,3766,-32550,3766,-32550,
                         3425,-32588,3425,-32588,3425,-32588,3425,-32588,
                         3083,-32622,3083,-32622,3083,-32622,3083,-32622,
                         2741,-32653,2741,-32653,2741,-32653,2741,-32653,
                         2399,-32680,2399,-32680,2399,-32680,2399,-32680,
                         2057,-32703,2057,-32703,2057,-32703,2057,-32703,
                         1714,-32723,1714,-32723,1714,-32723,1714,-32723,
                         1372,-32739,1372,-32739,1372,-32739,1372,-32739,
                         1029,-32751,1029,-32751,1029,-32751,1029,-32751,
                         686,-32760,686,-32760,686,-32760,686,-32760,
                         343,-32766,343,-32766,343,-32766,343,-32766,
                         0,-32767,0,-32767,0,-32767,0,-32767,
                         -344,-32766,-344,-32766,-344,-32766,-344,-32766,
                         -687,-32760,-687,-32760,-687,-32760,-687,-32760,
                         -1030,-32751,-1030,-32751,-1030,-32751,-1030,-32751,
                         -1373,-32739,-1373,-32739,-1373,-32739,-1373,-32739,
                         -1715,-32723,-1715,-32723,-1715,-32723,-1715,-32723,
                         -2058,-32703,-2058,-32703,-2058,-32703,-2058,-32703,
                         -2400,-32680,-2400,-32680,-2400,-32680,-2400,-32680,
                         -2742,-32653,-2742,-32653,-2742,-32653,-2742,-32653,
                         -3084,-32622,-3084,-32622,-3084,-32622,-3084,-32622,
                         -3426,-32588,-3426,-32588,-3426,-32588,-3426,-32588,
                         -3767,-32550,-3767,-32550,-3767,-32550,-3767,-32550,
                         -4107,-32509,-4107,-32509,-4107,-32509,-4107,-32509,
                         -4447,-32464,-4447,-32464,-4447,-32464,-4447,-32464,
                         -4787,-32416,-4787,-32416,-4787,-32416,-4787,-32416,
                         -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                         -5465,-32309,-5465,-32309,-5465,-32309,-5465,-32309,
                         -5803,-32250,-5803,-32250,-5803,-32250,-5803,-32250,
                         -6140,-32187,-6140,-32187,-6140,-32187,-6140,-32187,
                         -6477,-32121,-6477,-32121,-6477,-32121,-6477,-32121,
                         -6813,-32051,-6813,-32051,-6813,-32051,-6813,-32051,
                         -7148,-31978,-7148,-31978,-7148,-31978,-7148,-31978,
                         -7483,-31902,-7483,-31902,-7483,-31902,-7483,-31902,
                         -7817,-31822,-7817,-31822,-7817,-31822,-7817,-31822,
                         -8149,-31738,-8149,-31738,-8149,-31738,-8149,-31738,
                         -8481,-31651,-8481,-31651,-8481,-31651,-8481,-31651,
                         -8812,-31560,-8812,-31560,-8812,-31560,-8812,-31560,
                         -9142,-31466,-9142,-31466,-9142,-31466,-9142,-31466,
                         -9471,-31369,-9471,-31369,-9471,-31369,-9471,-31369,
                         -9799,-31268,-9799,-31268,-9799,-31268,-9799,-31268,
                         -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                         -10452,-31056,-10452,-31056,-10452,-31056,-10452,-31056,
                         -10776,-30945,-10776,-30945,-10776,-30945,-10776,-30945,
                         -11100,-30830,-11100,-30830,-11100,-30830,-11100,-30830,
                         -11422,-30712,-11422,-30712,-11422,-30712,-11422,-30712,
                         -11743,-30591,-11743,-30591,-11743,-30591,-11743,-30591,
                         -12063,-30466,-12063,-30466,-12063,-30466,-12063,-30466,
                         -12381,-30339,-12381,-30339,-12381,-30339,-12381,-30339,
                         -12698,-30207,-12698,-30207,-12698,-30207,-12698,-30207,
                         -13014,-30073,-13014,-30073,-13014,-30073,-13014,-30073,
                         -13328,-29935,-13328,-29935,-13328,-29935,-13328,-29935,
                         -13641,-29793,-13641,-29793,-13641,-29793,-13641,-29793,
                         -13952,-29649,-13952,-29649,-13952,-29649,-13952,-29649,
                         -14262,-29501,-14262,-29501,-14262,-29501,-14262,-29501,
                         -14570,-29350,-14570,-29350,-14570,-29350,-14570,-29350,
                         -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                         -15181,-29039,-15181,-29039,-15181,-29039,-15181,-29039,
                         -15485,-28878,-15485,-28878,-15485,-28878,-15485,-28878,
                         -15786,-28714,-15786,-28714,-15786,-28714,-15786,-28714,
                         -16086,-28548,-16086,-28548,-16086,-28548,-16086,-28548,
                         -16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,
                         -16680,-28204,-16680,-28204,-16680,-28204,-16680,-28204,
                         -16975,-28028,-16975,-28028,-16975,-28028,-16975,-28028,
                         -17267,-27849,-17267,-27849,-17267,-27849,-17267,-27849,
                         -17558,-27667,-17558,-27667,-17558,-27667,-17558,-27667,
                         -17847,-27481,-17847,-27481,-17847,-27481,-17847,-27481,
                         -18133,-27293,-18133,-27293,-18133,-27293,-18133,-27293,
                         -18418,-27101,-18418,-27101,-18418,-27101,-18418,-27101,
                         -18701,-26907,-18701,-26907,-18701,-26907,-18701,-26907,
                         -18982,-26710,-18982,-26710,-18982,-26710,-18982,-26710,
                         -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                         -19537,-26306,-19537,-26306,-19537,-26306,-19537,-26306,
                         -19811,-26100,-19811,-26100,-19811,-26100,-19811,-26100,
                         -20084,-25892,-20084,-25892,-20084,-25892,-20084,-25892,
                         -20354,-25680,-20354,-25680,-20354,-25680,-20354,-25680,
                         -20621,-25465,-20621,-25465,-20621,-25465,-20621,-25465,
                         -20887,-25248,-20887,-25248,-20887,-25248,-20887,-25248,
                         -21150,-25028,-21150,-25028,-21150,-25028,-21150,-25028,
                         -21411,-24805,-21411,-24805,-21411,-24805,-21411,-24805,
                         -21670,-24579,-21670,-24579,-21670,-24579,-21670,-24579,
                         -21926,-24351,-21926,-24351,-21926,-24351,-21926,-24351,
                         -22180,-24120,-22180,-24120,-22180,-24120,-22180,-24120,
                         -22431,-23887,-22431,-23887,-22431,-23887,-22431,-23887,
                         -22680,-23650,-22680,-23650,-22680,-23650,-22680,-23650,
                         -22926,-23412,-22926,-23412,-22926,-23412,-22926,-23412,
                         -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                         -23412,-22926,-23412,-22926,-23412,-22926,-23412,-22926,
                         -23650,-22680,-23650,-22680,-23650,-22680,-23650,-22680,
                         -23887,-22431,-23887,-22431,-23887,-22431,-23887,-22431,
                         -24120,-22180,-24120,-22180,-24120,-22180,-24120,-22180,
                         -24351,-21926,-24351,-21926,-24351,-21926,-24351,-21926,
                         -24579,-21670,-24579,-21670,-24579,-21670,-24579,-21670,
                         -24805,-21411,-24805,-21411,-24805,-21411,-24805,-21411,
                         -25028,-21150,-25028,-21150,-25028,-21150,-25028,-21150,
                         -25248,-20887,-25248,-20887,-25248,-20887,-25248,-20887,
                         -25465,-20621,-25465,-20621,-25465,-20621,-25465,-20621,
                         -25680,-20354,-25680,-20354,-25680,-20354,-25680,-20354,
                         -25892,-20084,-25892,-20084,-25892,-20084,-25892,-20084,
                         -26100,-19811,-26100,-19811,-26100,-19811,-26100,-19811,
                         -26306,-19537,-26306,-19537,-26306,-19537,-26306,-19537,
                         -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                         -26710,-18982,-26710,-18982,-26710,-18982,-26710,-18982,
                         -26907,-18701,-26907,-18701,-26907,-18701,-26907,-18701,
                         -27101,-18418,-27101,-18418,-27101,-18418,-27101,-18418,
                         -27293,-18133,-27293,-18133,-27293,-18133,-27293,-18133,
                         -27481,-17847,-27481,-17847,-27481,-17847,-27481,-17847,
                         -27667,-17558,-27667,-17558,-27667,-17558,-27667,-17558,
                         -27849,-17267,-27849,-17267,-27849,-17267,-27849,-17267,
                         -28028,-16975,-28028,-16975,-28028,-16975,-28028,-16975,
                         -28204,-16680,-28204,-16680,-28204,-16680,-28204,-16680,
                         -28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,
                         -28548,-16086,-28548,-16086,-28548,-16086,-28548,-16086,
                         -28714,-15786,-28714,-15786,-28714,-15786,-28714,-15786,
                         -28878,-15485,-28878,-15485,-28878,-15485,-28878,-15485,
                         -29039,-15181,-29039,-15181,-29039,-15181,-29039,-15181,
                         -29196,-14876,-29196,-14876,-29196,-14876,-29196,-14876,
                         -29350,-14570,-29350,-14570,-29350,-14570,-29350,-14570,
                         -29501,-14262,-29501,-14262,-29501,-14262,-29501,-14262,
                         -29649,-13952,-29649,-13952,-29649,-13952,-29649,-13952,
                         -29793,-13641,-29793,-13641,-29793,-13641,-29793,-13641,
                         -29935,-13328,-29935,-13328,-29935,-13328,-29935,-13328,
                         -30073,-13014,-30073,-13014,-30073,-13014,-30073,-13014,
                         -30207,-12698,-30207,-12698,-30207,-12698,-30207,-12698,
                         -30339,-12381,-30339,-12381,-30339,-12381,-30339,-12381,
                         -30466,-12063,-30466,-12063,-30466,-12063,-30466,-12063,
                         -30591,-11743,-30591,-11743,-30591,-11743,-30591,-11743,
                         -30712,-11422,-30712,-11422,-30712,-11422,-30712,-11422,
                         -30830,-11100,-30830,-11100,-30830,-11100,-30830,-11100,
                         -30945,-10776,-30945,-10776,-30945,-10776,-30945,-10776,
                         -31056,-10452,-31056,-10452,-31056,-10452,-31056,-10452,
                         -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                         -31268,-9799,-31268,-9799,-31268,-9799,-31268,-9799,
                         -31369,-9471,-31369,-9471,-31369,-9471,-31369,-9471,
                         -31466,-9142,-31466,-9142,-31466,-9142,-31466,-9142,
                         -31560,-8812,-31560,-8812,-31560,-8812,-31560,-8812,
                         -31651,-8481,-31651,-8481,-31651,-8481,-31651,-8481,
                         -31738,-8149,-31738,-8149,-31738,-8149,-31738,-8149,
                         -31822,-7817,-31822,-7817,-31822,-7817,-31822,-7817,
                         -31902,-7483,-31902,-7483,-31902,-7483,-31902,-7483,
                         -31978,-7148,-31978,-7148,-31978,-7148,-31978,-7148,
                         -32051,-6813,-32051,-6813,-32051,-6813,-32051,-6813,
                         -32121,-6477,-32121,-6477,-32121,-6477,-32121,-6477,
                         -32187,-6140,-32187,-6140,-32187,-6140,-32187,-6140,
                         -32250,-5803,-32250,-5803,-32250,-5803,-32250,-5803,
                         -32309,-5465,-32309,-5465,-32309,-5465,-32309,-5465,
                         -32364,-5126,-32364,-5126,-32364,-5126,-32364,-5126,
                         -32416,-4787,-32416,-4787,-32416,-4787,-32416,-4787,
                         -32464,-4447,-32464,-4447,-32464,-4447,-32464,-4447,
                         -32509,-4107,-32509,-4107,-32509,-4107,-32509,-4107,
                         -32550,-3767,-32550,-3767,-32550,-3767,-32550,-3767,
                         -32588,-3426,-32588,-3426,-32588,-3426,-32588,-3426,
                         -32622,-3084,-32622,-3084,-32622,-3084,-32622,-3084,
                         -32653,-2742,-32653,-2742,-32653,-2742,-32653,-2742,
                         -32680,-2400,-32680,-2400,-32680,-2400,-32680,-2400,
                         -32703,-2058,-32703,-2058,-32703,-2058,-32703,-2058,
                         -32723,-1715,-32723,-1715,-32723,-1715,-32723,-1715,
                         -32739,-1373,-32739,-1373,-32739,-1373,-32739,-1373,
                         -32751,-1030,-32751,-1030,-32751,-1030,-32751,-1030,
                         -32760,-687,-32760,-687,-32760,-687,-32760,-687,
                         -32766,-344,-32766,-344,-32766,-344,-32766,-344
                        };
15744

15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048
int16_t twc1200[4784] = { 32762,-515,32762,-515,32762,-515,32762,-515,
                          32750,-1030,32750,-1030,32750,-1030,32750,-1030,
                          32730,-1544,32730,-1544,32730,-1544,32730,-1544,
                          32702,-2058,32702,-2058,32702,-2058,32702,-2058,
                          32665,-2571,32665,-2571,32665,-2571,32665,-2571,
                          32621,-3084,32621,-3084,32621,-3084,32621,-3084,
                          32569,-3596,32569,-3596,32569,-3596,32569,-3596,
                          32508,-4107,32508,-4107,32508,-4107,32508,-4107,
                          32440,-4617,32440,-4617,32440,-4617,32440,-4617,
                          32363,-5126,32363,-5126,32363,-5126,32363,-5126,
                          32279,-5634,32279,-5634,32279,-5634,32279,-5634,
                          32186,-6140,32186,-6140,32186,-6140,32186,-6140,
                          32086,-6645,32086,-6645,32086,-6645,32086,-6645,
                          31977,-7148,31977,-7148,31977,-7148,31977,-7148,
                          31861,-7650,31861,-7650,31861,-7650,31861,-7650,
                          31737,-8149,31737,-8149,31737,-8149,31737,-8149,
                          31605,-8647,31605,-8647,31605,-8647,31605,-8647,
                          31465,-9142,31465,-9142,31465,-9142,31465,-9142,
                          31318,-9635,31318,-9635,31318,-9635,31318,-9635,
                          31163,-10126,31163,-10126,31163,-10126,31163,-10126,
                          31000,-10614,31000,-10614,31000,-10614,31000,-10614,
                          30829,-11100,30829,-11100,30829,-11100,30829,-11100,
                          30651,-11583,30651,-11583,30651,-11583,30651,-11583,
                          30465,-12063,30465,-12063,30465,-12063,30465,-12063,
                          30272,-12540,30272,-12540,30272,-12540,30272,-12540,
                          30072,-13014,30072,-13014,30072,-13014,30072,-13014,
                          29863,-13485,29863,-13485,29863,-13485,29863,-13485,
                          29648,-13952,29648,-13952,29648,-13952,29648,-13952,
                          29425,-14416,29425,-14416,29425,-14416,29425,-14416,
                          29195,-14876,29195,-14876,29195,-14876,29195,-14876,
                          28958,-15333,28958,-15333,28958,-15333,28958,-15333,
                          28713,-15786,28713,-15786,28713,-15786,28713,-15786,
                          28462,-16235,28462,-16235,28462,-16235,28462,-16235,
                          28203,-16680,28203,-16680,28203,-16680,28203,-16680,
                          27938,-17121,27938,-17121,27938,-17121,27938,-17121,
                          27666,-17558,27666,-17558,27666,-17558,27666,-17558,
                          27386,-17990,27386,-17990,27386,-17990,27386,-17990,
                          27100,-18418,27100,-18418,27100,-18418,27100,-18418,
                          26808,-18842,26808,-18842,26808,-18842,26808,-18842,
                          26509,-19260,26509,-19260,26509,-19260,26509,-19260,
                          26203,-19674,26203,-19674,26203,-19674,26203,-19674,
                          25891,-20084,25891,-20084,25891,-20084,25891,-20084,
                          25572,-20488,25572,-20488,25572,-20488,25572,-20488,
                          25247,-20887,25247,-20887,25247,-20887,25247,-20887,
                          24916,-21281,24916,-21281,24916,-21281,24916,-21281,
                          24578,-21670,24578,-21670,24578,-21670,24578,-21670,
                          24235,-22053,24235,-22053,24235,-22053,24235,-22053,
                          23886,-22431,23886,-22431,23886,-22431,23886,-22431,
                          23530,-22803,23530,-22803,23530,-22803,23530,-22803,
                          23169,-23170,23169,-23170,23169,-23170,23169,-23170,
                          22802,-23531,22802,-23531,22802,-23531,22802,-23531,
                          22430,-23887,22430,-23887,22430,-23887,22430,-23887,
                          22052,-24236,22052,-24236,22052,-24236,22052,-24236,
                          21669,-24579,21669,-24579,21669,-24579,21669,-24579,
                          21280,-24917,21280,-24917,21280,-24917,21280,-24917,
                          20886,-25248,20886,-25248,20886,-25248,20886,-25248,
                          20487,-25573,20487,-25573,20487,-25573,20487,-25573,
                          20083,-25892,20083,-25892,20083,-25892,20083,-25892,
                          19673,-26204,19673,-26204,19673,-26204,19673,-26204,
                          19259,-26510,19259,-26510,19259,-26510,19259,-26510,
                          18841,-26809,18841,-26809,18841,-26809,18841,-26809,
                          18417,-27101,18417,-27101,18417,-27101,18417,-27101,
                          17989,-27387,17989,-27387,17989,-27387,17989,-27387,
                          17557,-27667,17557,-27667,17557,-27667,17557,-27667,
                          17120,-27939,17120,-27939,17120,-27939,17120,-27939,
                          16679,-28204,16679,-28204,16679,-28204,16679,-28204,
                          16234,-28463,16234,-28463,16234,-28463,16234,-28463,
                          15785,-28714,15785,-28714,15785,-28714,15785,-28714,
                          15332,-28959,15332,-28959,15332,-28959,15332,-28959,
                          14875,-29196,14875,-29196,14875,-29196,14875,-29196,
                          14415,-29426,14415,-29426,14415,-29426,14415,-29426,
                          13951,-29649,13951,-29649,13951,-29649,13951,-29649,
                          13484,-29864,13484,-29864,13484,-29864,13484,-29864,
                          13013,-30073,13013,-30073,13013,-30073,13013,-30073,
                          12539,-30273,12539,-30273,12539,-30273,12539,-30273,
                          12062,-30466,12062,-30466,12062,-30466,12062,-30466,
                          11582,-30652,11582,-30652,11582,-30652,11582,-30652,
                          11099,-30830,11099,-30830,11099,-30830,11099,-30830,
                          10613,-31001,10613,-31001,10613,-31001,10613,-31001,
                          10125,-31164,10125,-31164,10125,-31164,10125,-31164,
                          9634,-31319,9634,-31319,9634,-31319,9634,-31319,
                          9141,-31466,9141,-31466,9141,-31466,9141,-31466,
                          8646,-31606,8646,-31606,8646,-31606,8646,-31606,
                          8148,-31738,8148,-31738,8148,-31738,8148,-31738,
                          7649,-31862,7649,-31862,7649,-31862,7649,-31862,
                          7147,-31978,7147,-31978,7147,-31978,7147,-31978,
                          6644,-32087,6644,-32087,6644,-32087,6644,-32087,
                          6139,-32187,6139,-32187,6139,-32187,6139,-32187,
                          5633,-32280,5633,-32280,5633,-32280,5633,-32280,
                          5125,-32364,5125,-32364,5125,-32364,5125,-32364,
                          4616,-32441,4616,-32441,4616,-32441,4616,-32441,
                          4106,-32509,4106,-32509,4106,-32509,4106,-32509,
                          3595,-32570,3595,-32570,3595,-32570,3595,-32570,
                          3083,-32622,3083,-32622,3083,-32622,3083,-32622,
                          2570,-32666,2570,-32666,2570,-32666,2570,-32666,
                          2057,-32703,2057,-32703,2057,-32703,2057,-32703,
                          1543,-32731,1543,-32731,1543,-32731,1543,-32731,
                          1029,-32751,1029,-32751,1029,-32751,1029,-32751,
                          514,-32763,514,-32763,514,-32763,514,-32763,
                          0,-32767,0,-32767,0,-32767,0,-32767,
                          -515,-32763,-515,-32763,-515,-32763,-515,-32763,
                          -1030,-32751,-1030,-32751,-1030,-32751,-1030,-32751,
                          -1544,-32731,-1544,-32731,-1544,-32731,-1544,-32731,
                          -2058,-32703,-2058,-32703,-2058,-32703,-2058,-32703,
                          -2571,-32666,-2571,-32666,-2571,-32666,-2571,-32666,
                          -3084,-32622,-3084,-32622,-3084,-32622,-3084,-32622,
                          -3596,-32570,-3596,-32570,-3596,-32570,-3596,-32570,
                          -4107,-32509,-4107,-32509,-4107,-32509,-4107,-32509,
                          -4617,-32441,-4617,-32441,-4617,-32441,-4617,-32441,
                          -5126,-32364,-5126,-32364,-5126,-32364,-5126,-32364,
                          -5634,-32280,-5634,-32280,-5634,-32280,-5634,-32280,
                          -6140,-32187,-6140,-32187,-6140,-32187,-6140,-32187,
                          -6645,-32087,-6645,-32087,-6645,-32087,-6645,-32087,
                          -7148,-31978,-7148,-31978,-7148,-31978,-7148,-31978,
                          -7650,-31862,-7650,-31862,-7650,-31862,-7650,-31862,
                          -8149,-31738,-8149,-31738,-8149,-31738,-8149,-31738,
                          -8647,-31606,-8647,-31606,-8647,-31606,-8647,-31606,
                          -9142,-31466,-9142,-31466,-9142,-31466,-9142,-31466,
                          -9635,-31319,-9635,-31319,-9635,-31319,-9635,-31319,
                          -10126,-31164,-10126,-31164,-10126,-31164,-10126,-31164,
                          -10614,-31001,-10614,-31001,-10614,-31001,-10614,-31001,
                          -11100,-30830,-11100,-30830,-11100,-30830,-11100,-30830,
                          -11583,-30652,-11583,-30652,-11583,-30652,-11583,-30652,
                          -12063,-30466,-12063,-30466,-12063,-30466,-12063,-30466,
                          -12540,-30273,-12540,-30273,-12540,-30273,-12540,-30273,
                          -13014,-30073,-13014,-30073,-13014,-30073,-13014,-30073,
                          -13485,-29864,-13485,-29864,-13485,-29864,-13485,-29864,
                          -13952,-29649,-13952,-29649,-13952,-29649,-13952,-29649,
                          -14416,-29426,-14416,-29426,-14416,-29426,-14416,-29426,
                          -14876,-29196,-14876,-29196,-14876,-29196,-14876,-29196,
                          -15333,-28959,-15333,-28959,-15333,-28959,-15333,-28959,
                          -15786,-28714,-15786,-28714,-15786,-28714,-15786,-28714,
                          -16235,-28463,-16235,-28463,-16235,-28463,-16235,-28463,
                          -16680,-28204,-16680,-28204,-16680,-28204,-16680,-28204,
                          -17121,-27939,-17121,-27939,-17121,-27939,-17121,-27939,
                          -17558,-27667,-17558,-27667,-17558,-27667,-17558,-27667,
                          -17990,-27387,-17990,-27387,-17990,-27387,-17990,-27387,
                          -18418,-27101,-18418,-27101,-18418,-27101,-18418,-27101,
                          -18842,-26809,-18842,-26809,-18842,-26809,-18842,-26809,
                          -19260,-26510,-19260,-26510,-19260,-26510,-19260,-26510,
                          -19674,-26204,-19674,-26204,-19674,-26204,-19674,-26204,
                          -20084,-25892,-20084,-25892,-20084,-25892,-20084,-25892,
                          -20488,-25573,-20488,-25573,-20488,-25573,-20488,-25573,
                          -20887,-25248,-20887,-25248,-20887,-25248,-20887,-25248,
                          -21281,-24917,-21281,-24917,-21281,-24917,-21281,-24917,
                          -21670,-24579,-21670,-24579,-21670,-24579,-21670,-24579,
                          -22053,-24236,-22053,-24236,-22053,-24236,-22053,-24236,
                          -22431,-23887,-22431,-23887,-22431,-23887,-22431,-23887,
                          -22803,-23531,-22803,-23531,-22803,-23531,-22803,-23531,
                          -23170,-23170,-23170,-23170,-23170,-23170,-23170,-23170,
                          -23531,-22803,-23531,-22803,-23531,-22803,-23531,-22803,
                          -23887,-22431,-23887,-22431,-23887,-22431,-23887,-22431,
                          -24236,-22053,-24236,-22053,-24236,-22053,-24236,-22053,
                          -24579,-21670,-24579,-21670,-24579,-21670,-24579,-21670,
                          -24917,-21281,-24917,-21281,-24917,-21281,-24917,-21281,
                          -25248,-20887,-25248,-20887,-25248,-20887,-25248,-20887,
                          -25573,-20488,-25573,-20488,-25573,-20488,-25573,-20488,
                          -25892,-20084,-25892,-20084,-25892,-20084,-25892,-20084,
                          -26204,-19674,-26204,-19674,-26204,-19674,-26204,-19674,
                          -26510,-19260,-26510,-19260,-26510,-19260,-26510,-19260,
                          -26809,-18842,-26809,-18842,-26809,-18842,-26809,-18842,
                          -27101,-18418,-27101,-18418,-27101,-18418,-27101,-18418,
                          -27387,-17990,-27387,-17990,-27387,-17990,-27387,-17990,
                          -27667,-17558,-27667,-17558,-27667,-17558,-27667,-17558,
                          -27939,-17121,-27939,-17121,-27939,-17121,-27939,-17121,
                          -28204,-16680,-28204,-16680,-28204,-16680,-28204,-16680,
                          -28463,-16235,-28463,-16235,-28463,-16235,-28463,-16235,
                          -28714,-15786,-28714,-15786,-28714,-15786,-28714,-15786,
                          -28959,-15333,-28959,-15333,-28959,-15333,-28959,-15333,
                          -29196,-14876,-29196,-14876,-29196,-14876,-29196,-14876,
                          -29426,-14416,-29426,-14416,-29426,-14416,-29426,-14416,
                          -29649,-13952,-29649,-13952,-29649,-13952,-29649,-13952,
                          -29864,-13485,-29864,-13485,-29864,-13485,-29864,-13485,
                          -30073,-13014,-30073,-13014,-30073,-13014,-30073,-13014,
                          -30273,-12540,-30273,-12540,-30273,-12540,-30273,-12540,
                          -30466,-12063,-30466,-12063,-30466,-12063,-30466,-12063,
                          -30652,-11583,-30652,-11583,-30652,-11583,-30652,-11583,
                          -30830,-11100,-30830,-11100,-30830,-11100,-30830,-11100,
                          -31001,-10614,-31001,-10614,-31001,-10614,-31001,-10614,
                          -31164,-10126,-31164,-10126,-31164,-10126,-31164,-10126,
                          -31319,-9635,-31319,-9635,-31319,-9635,-31319,-9635,
                          -31466,-9142,-31466,-9142,-31466,-9142,-31466,-9142,
                          -31606,-8647,-31606,-8647,-31606,-8647,-31606,-8647,
                          -31738,-8149,-31738,-8149,-31738,-8149,-31738,-8149,
                          -31862,-7650,-31862,-7650,-31862,-7650,-31862,-7650,
                          -31978,-7148,-31978,-7148,-31978,-7148,-31978,-7148,
                          -32087,-6645,-32087,-6645,-32087,-6645,-32087,-6645,
                          -32187,-6140,-32187,-6140,-32187,-6140,-32187,-6140,
                          -32280,-5634,-32280,-5634,-32280,-5634,-32280,-5634,
                          -32364,-5126,-32364,-5126,-32364,-5126,-32364,-5126,
                          -32441,-4617,-32441,-4617,-32441,-4617,-32441,-4617,
                          -32509,-4107,-32509,-4107,-32509,-4107,-32509,-4107,
                          -32570,-3596,-32570,-3596,-32570,-3596,-32570,-3596,
                          -32622,-3084,-32622,-3084,-32622,-3084,-32622,-3084,
                          -32666,-2571,-32666,-2571,-32666,-2571,-32666,-2571,
                          -32703,-2058,-32703,-2058,-32703,-2058,-32703,-2058,
                          -32731,-1544,-32731,-1544,-32731,-1544,-32731,-1544,
                          -32751,-1030,-32751,-1030,-32751,-1030,-32751,-1030,
                          -32763,-515,-32763,-515,-32763,-515,-32763,-515,
                          -32767,-1,-32767,-1,-32767,-1,-32767,-1,
                          -32763,514,-32763,514,-32763,514,-32763,514,
                          -32751,1029,-32751,1029,-32751,1029,-32751,1029,
                          -32731,1543,-32731,1543,-32731,1543,-32731,1543,
                          -32703,2057,-32703,2057,-32703,2057,-32703,2057,
                          -32666,2570,-32666,2570,-32666,2570,-32666,2570,
                          -32622,3083,-32622,3083,-32622,3083,-32622,3083,
                          -32570,3595,-32570,3595,-32570,3595,-32570,3595,
                          -32509,4106,-32509,4106,-32509,4106,-32509,4106,
                          -32441,4616,-32441,4616,-32441,4616,-32441,4616,
                          -32364,5125,-32364,5125,-32364,5125,-32364,5125,
                          -32280,5633,-32280,5633,-32280,5633,-32280,5633,
                          -32187,6139,-32187,6139,-32187,6139,-32187,6139,
                          -32087,6644,-32087,6644,-32087,6644,-32087,6644,
                          -31978,7147,-31978,7147,-31978,7147,-31978,7147,
                          -31862,7649,-31862,7649,-31862,7649,-31862,7649,
                          -31738,8148,-31738,8148,-31738,8148,-31738,8148,
                          -31606,8646,-31606,8646,-31606,8646,-31606,8646,
                          -31466,9141,-31466,9141,-31466,9141,-31466,9141,
                          -31319,9634,-31319,9634,-31319,9634,-31319,9634,
                          -31164,10125,-31164,10125,-31164,10125,-31164,10125,
                          -31001,10613,-31001,10613,-31001,10613,-31001,10613,
                          -30830,11099,-30830,11099,-30830,11099,-30830,11099,
                          -30652,11582,-30652,11582,-30652,11582,-30652,11582,
                          -30466,12062,-30466,12062,-30466,12062,-30466,12062,
                          -30273,12539,-30273,12539,-30273,12539,-30273,12539,
                          -30073,13013,-30073,13013,-30073,13013,-30073,13013,
                          -29864,13484,-29864,13484,-29864,13484,-29864,13484,
                          -29649,13951,-29649,13951,-29649,13951,-29649,13951,
                          -29426,14415,-29426,14415,-29426,14415,-29426,14415,
                          -29196,14875,-29196,14875,-29196,14875,-29196,14875,
                          -28959,15332,-28959,15332,-28959,15332,-28959,15332,
                          -28714,15785,-28714,15785,-28714,15785,-28714,15785,
                          -28463,16234,-28463,16234,-28463,16234,-28463,16234,
                          -28204,16679,-28204,16679,-28204,16679,-28204,16679,
                          -27939,17120,-27939,17120,-27939,17120,-27939,17120,
                          -27667,17557,-27667,17557,-27667,17557,-27667,17557,
                          -27387,17989,-27387,17989,-27387,17989,-27387,17989,
                          -27101,18417,-27101,18417,-27101,18417,-27101,18417,
                          -26809,18841,-26809,18841,-26809,18841,-26809,18841,
                          -26510,19259,-26510,19259,-26510,19259,-26510,19259,
                          -26204,19673,-26204,19673,-26204,19673,-26204,19673,
                          -25892,20083,-25892,20083,-25892,20083,-25892,20083,
                          -25573,20487,-25573,20487,-25573,20487,-25573,20487,
                          -25248,20886,-25248,20886,-25248,20886,-25248,20886,
                          -24917,21280,-24917,21280,-24917,21280,-24917,21280,
                          -24579,21669,-24579,21669,-24579,21669,-24579,21669,
                          -24236,22052,-24236,22052,-24236,22052,-24236,22052,
                          -23887,22430,-23887,22430,-23887,22430,-23887,22430,
                          -23531,22802,-23531,22802,-23531,22802,-23531,22802,
                          -23170,23169,-23170,23169,-23170,23169,-23170,23169,
                          -22803,23530,-22803,23530,-22803,23530,-22803,23530,
                          -22431,23886,-22431,23886,-22431,23886,-22431,23886,
                          -22053,24235,-22053,24235,-22053,24235,-22053,24235,
                          -21670,24578,-21670,24578,-21670,24578,-21670,24578,
                          -21281,24916,-21281,24916,-21281,24916,-21281,24916,
                          -20887,25247,-20887,25247,-20887,25247,-20887,25247,
                          -20488,25572,-20488,25572,-20488,25572,-20488,25572,
                          -20084,25891,-20084,25891,-20084,25891,-20084,25891,
                          -19674,26203,-19674,26203,-19674,26203,-19674,26203,
                          -19260,26509,-19260,26509,-19260,26509,-19260,26509,
                          -18842,26808,-18842,26808,-18842,26808,-18842,26808,
                          -18418,27100,-18418,27100,-18418,27100,-18418,27100,
                          -17990,27386,-17990,27386,-17990,27386,-17990,27386,
                          -17558,27666,-17558,27666,-17558,27666,-17558,27666,
                          -17121,27938,-17121,27938,-17121,27938,-17121,27938,
                          -16680,28203,-16680,28203,-16680,28203,-16680,28203,
                          -16235,28462,-16235,28462,-16235,28462,-16235,28462,
                          -15786,28713,-15786,28713,-15786,28713,-15786,28713,
                          -15333,28958,-15333,28958,-15333,28958,-15333,28958,
                          -14876,29195,-14876,29195,-14876,29195,-14876,29195,
                          -14416,29425,-14416,29425,-14416,29425,-14416,29425,
                          -13952,29648,-13952,29648,-13952,29648,-13952,29648,
                          -13485,29863,-13485,29863,-13485,29863,-13485,29863,
                          -13014,30072,-13014,30072,-13014,30072,-13014,30072,
                          -12540,30272,-12540,30272,-12540,30272,-12540,30272,
                          -12063,30465,-12063,30465,-12063,30465,-12063,30465,
                          -11583,30651,-11583,30651,-11583,30651,-11583,30651,
                          -11100,30829,-11100,30829,-11100,30829,-11100,30829,
                          -10614,31000,-10614,31000,-10614,31000,-10614,31000,
                          -10126,31163,-10126,31163,-10126,31163,-10126,31163,
                          -9635,31318,-9635,31318,-9635,31318,-9635,31318,
                          -9142,31465,-9142,31465,-9142,31465,-9142,31465,
                          -8647,31605,-8647,31605,-8647,31605,-8647,31605,
                          -8149,31737,-8149,31737,-8149,31737,-8149,31737,
                          -7650,31861,-7650,31861,-7650,31861,-7650,31861,
                          -7148,31977,-7148,31977,-7148,31977,-7148,31977,
                          -6645,32086,-6645,32086,-6645,32086,-6645,32086,
                          -6140,32186,-6140,32186,-6140,32186,-6140,32186,
                          -5634,32279,-5634,32279,-5634,32279,-5634,32279,
                          -5126,32363,-5126,32363,-5126,32363,-5126,32363,
                          -4617,32440,-4617,32440,-4617,32440,-4617,32440,
                          -4107,32508,-4107,32508,-4107,32508,-4107,32508,
                          -3596,32569,-3596,32569,-3596,32569,-3596,32569,
                          -3084,32621,-3084,32621,-3084,32621,-3084,32621,
                          -2571,32665,-2571,32665,-2571,32665,-2571,32665,
                          -2058,32702,-2058,32702,-2058,32702,-2058,32702,
                          -1544,32730,-1544,32730,-1544,32730,-1544,32730,
                          -1030,32750,-1030,32750,-1030,32750,-1030,32750,
                          -515,32762,-515,32762,-515,32762,-515,32762
                        };


void dft1200(int16_t *x,int16_t *y,unsigned char scale_flag)
{
16049 16050

  int i,j;
16051 16052 16053 16054 16055 16056 16057
  simd_q15_t *x128=(simd_q15_t *)x;
  simd_q15_t *y128=(simd_q15_t *)y;
  simd_q15_t *twa128=(simd_q15_t *)&twa1200[0];
  simd_q15_t *twb128=(simd_q15_t *)&twb1200[0];
  simd_q15_t *twc128=(simd_q15_t *)&twc1200[0];
  simd_q15_t x2128[1200];// = (simd_q15_t *)&x2128array[0];
  simd_q15_t ytmp128[1200];//=&ytmp128array2[0];
16058 16059 16060



16061
  for (i=0,j=0; i<300; i++,j+=4) {
16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073
    x2128[i]    = x128[j];
    x2128[i+300] = x128[j+1];
    x2128[i+600] = x128[j+2];
    x2128[i+900] = x128[j+3];
  }

  dft300((int16_t *)x2128,(int16_t *)ytmp128,1);
  dft300((int16_t *)(x2128+300),(int16_t *)(ytmp128+300),1);
  dft300((int16_t *)(x2128+600),(int16_t *)(ytmp128+600),1);
  dft300((int16_t *)(x2128+900),(int16_t *)(ytmp128+900),1);

  bfly4_tw1(ytmp128,ytmp128+300,ytmp128+600,ytmp128+900,y128,y128+300,y128+600,y128+900);
16074 16075

  for (i=1,j=0; i<300; i++,j++) {
16076
    bfly4(ytmp128+i,
16077 16078 16079 16080 16081 16082 16083 16084 16085 16086
          ytmp128+300+i,
          ytmp128+600+i,
          ytmp128+900+i,
          y128+i,
          y128+300+i,
          y128+600+i,
          y128+900+i,
          twa128+j,
          twb128+j,
          twc128+j);
16087 16088 16089
  }

  if (scale_flag==1) {
16090
    norm128 = set1_int16(16384);//dft_norm_table[13]);
16091 16092

    for (i=0; i<1200; i++) {
16093
      y128[i] = mulhi_int16(y128[i],norm128);
16094 16095 16096 16097 16098 16099 16100 16101 16102 16103
    }
  }

  _mm_empty();
  _m_empty();

}


#ifdef MR_MAIN
16104 16105
#include <string.h>
#include <stdio.h>
16106

16107

16108 16109
int main(int argc, char**argv)
{
16110 16111 16112


  time_stats_t ts;
16113
  simd_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3;
16114 16115 16116 16117 16118


  int i;

  set_taus_seed(0);
16119
  opp_enabled = 1;
16120
 /* 
16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155
    ((int16_t *)&tw0)[0] = 32767;
    ((int16_t *)&tw0)[1] = 0;
    ((int16_t *)&tw0)[2] = 32767;
    ((int16_t *)&tw0)[3] = 0;
    ((int16_t *)&tw0)[4] = 32767;
    ((int16_t *)&tw0)[5] = 0;
    ((int16_t *)&tw0)[6] = 32767;
    ((int16_t *)&tw0)[7] = 0;

    ((int16_t *)&tw1)[0] = 32767;
    ((int16_t *)&tw1)[1] = 0;
    ((int16_t *)&tw1)[2] = 32767;
    ((int16_t *)&tw1)[3] = 0;
    ((int16_t *)&tw1)[4] = 32767;
    ((int16_t *)&tw1)[5] = 0;
    ((int16_t *)&tw1)[6] = 32767;
    ((int16_t *)&tw1)[7] = 0;

    ((int16_t *)&tw2)[0] = 32767;
    ((int16_t *)&tw2)[1] = 0;
    ((int16_t *)&tw2)[2] = 32767;
    ((int16_t *)&tw2)[3] = 0;
    ((int16_t *)&tw2)[4] = 32767;
    ((int16_t *)&tw2)[5] = 0;
    ((int16_t *)&tw2)[6] = 32767;
    ((int16_t *)&tw2)[7] = 0;

    ((int16_t *)&tw3)[0] = 32767;
    ((int16_t *)&tw3)[1] = 0;
    ((int16_t *)&tw3)[2] = 32767;
    ((int16_t *)&tw3)[3] = 0;
    ((int16_t *)&tw3)[4] = 32767;
    ((int16_t *)&tw3)[5] = 0;
    ((int16_t *)&tw3)[6] = 32767;
    ((int16_t *)&tw3)[7] = 0;
16156

16157
    for (i=0;i<300;i++) {
16158
#if defined(__x86_64__) || defined(__i386__)
16159 16160
      x[i] = _mm_set1_epi32(taus());
      x[i] = _mm_srai_epi16(x[i],4);
16161 16162 16163 16164
#elif defined(__arm__)
      x[i] = (int16x8_t)vdupq_n_s32(taus());
      x[i] = vshrq_n_s16(x[i],4);
#endif
16165
    }
16166

16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426
    bfly2_tw1(x,x+1,y,y+1);
    printf("(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[0],((int16_t*)&y[0])[1],((int16_t*)&y[1])[0],((int16_t*)&y[1])[1]);
    printf("(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[2],((int16_t*)&y[0])[3],((int16_t*)&y[1])[2],((int16_t*)&y[1])[3]);
    printf("(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[4],((int16_t*)&y[0])[5],((int16_t*)&y[1])[4],((int16_t*)&y[1])[5]);
    printf("(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[6],((int16_t*)&y[0])[7],((int16_t*)&y[1])[6],((int16_t*)&y[1])[7]);
    bfly2(x,x+1,y,y+1, &tw0);
    printf("0(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[0],((int16_t*)&y[0])[1],((int16_t*)&y[1])[0],((int16_t*)&y[1])[1]);
    printf("1(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[2],((int16_t*)&y[0])[3],((int16_t*)&y[1])[2],((int16_t*)&y[1])[3]);
    printf("2(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[4],((int16_t*)&y[0])[5],((int16_t*)&y[1])[4],((int16_t*)&y[1])[5]);
    printf("3(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[6],((int16_t*)&y[0])[7],((int16_t*)&y[1])[6],((int16_t*)&y[1])[7]);
    bfly2(x,x+1,y,y+1, &tw0);

    bfly3_tw1(x,x+1,x+2,y, y+1,y+2);
    printf("0(%d,%d) (%d,%d) (%d %d) => (%d,%d) (%d,%d) (%d %d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&y[0])[0],((int16_t*)&y[0])[1],((int16_t*)&y[1])[0],((int16_t*)&y[1])[1],((int16_t*)&y[2])[0],((int16_t*)&y[2])[1]);
    printf("1(%d,%d) (%d,%d) (%d %d) => (%d,%d) (%d,%d) (%d %d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&y[0])[2],((int16_t*)&y[0])[3],((int16_t*)&y[1])[2],((int16_t*)&y[1])[3],((int16_t*)&y[2])[2],((int16_t*)&y[2])[3]);
    printf("2(%d,%d) (%d,%d) (%d %d) => (%d,%d) (%d,%d) (%d %d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&y[0])[4],((int16_t*)&y[0])[5],((int16_t*)&y[1])[4],((int16_t*)&y[1])[5],((int16_t*)&y[2])[4],((int16_t*)&y[2])[5]);
    printf("3(%d,%d) (%d,%d) (%d %d) => (%d,%d) (%d,%d) (%d %d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&y[0])[6],((int16_t*)&y[0])[7],((int16_t*)&y[1])[6],((int16_t*)&y[1])[7],((int16_t*)&y[2])[6],((int16_t*)&y[2])[7]);
    bfly3(x,x+1,x+2,y, y+1,y+2,&tw0,&tw1);

    printf("0(%d,%d) (%d,%d) (%d %d) => (%d,%d) (%d,%d) (%d %d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&y[0])[0],((int16_t*)&y[0])[1],((int16_t*)&y[1])[0],((int16_t*)&y[1])[1],((int16_t*)&y[2])[0],((int16_t*)&y[2])[1]);
    printf("1(%d,%d) (%d,%d) (%d %d) => (%d,%d) (%d,%d) (%d %d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&y[0])[2],((int16_t*)&y[0])[3],((int16_t*)&y[1])[2],((int16_t*)&y[1])[3],((int16_t*)&y[2])[2],((int16_t*)&y[2])[3]);
    printf("2(%d,%d) (%d,%d) (%d %d) => (%d,%d) (%d,%d) (%d %d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&y[0])[4],((int16_t*)&y[0])[5],((int16_t*)&y[1])[4],((int16_t*)&y[1])[5],((int16_t*)&y[2])[4],((int16_t*)&y[2])[5]);
    printf("3(%d,%d) (%d,%d) (%d %d) => (%d,%d) (%d,%d) (%d %d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&y[0])[6],((int16_t*)&y[0])[7],((int16_t*)&y[1])[6],((int16_t*)&y[1])[7],((int16_t*)&y[2])[6],((int16_t*)&y[2])[7]);


    bfly4_tw1(x,x+1,x+2,x+3,y, y+1,y+2,y+3);
    printf("(%d,%d) (%d,%d) (%d %d) (%d,%d) => (%d,%d) (%d,%d) (%d %d) (%d,%d)\n",
     ((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],
     ((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&x[3])[0],((int16_t*)&x[3])[1],
     ((int16_t*)&y[0])[0],((int16_t*)&y[0])[1],((int16_t*)&y[1])[0],((int16_t*)&y[1])[1],
     ((int16_t*)&y[2])[0],((int16_t*)&y[2])[1],((int16_t*)&y[3])[0],((int16_t*)&y[3])[1]);

    bfly4(x,x+1,x+2,x+3,y, y+1,y+2,y+3,&tw0,&tw1,&tw2);
    printf("0(%d,%d) (%d,%d) (%d %d) (%d,%d) => (%d,%d) (%d,%d) (%d %d) (%d,%d)\n",
     ((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],
     ((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&x[3])[0],((int16_t*)&x[3])[1],
     ((int16_t*)&y[0])[0],((int16_t*)&y[0])[1],((int16_t*)&y[1])[0],((int16_t*)&y[1])[1],
     ((int16_t*)&y[2])[0],((int16_t*)&y[2])[1],((int16_t*)&y[3])[0],((int16_t*)&y[3])[1]);
    printf("1(%d,%d) (%d,%d) (%d %d) (%d,%d) => (%d,%d) (%d,%d) (%d %d) (%d,%d)\n",
     ((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],
     ((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&x[3])[0],((int16_t*)&x[3])[1],
     ((int16_t*)&y[0])[2],((int16_t*)&y[0])[3],((int16_t*)&y[1])[2],((int16_t*)&y[1])[3],
     ((int16_t*)&y[2])[2],((int16_t*)&y[2])[3],((int16_t*)&y[3])[2],((int16_t*)&y[3])[3]);
    printf("2(%d,%d) (%d,%d) (%d %d) (%d,%d) => (%d,%d) (%d,%d) (%d %d) (%d,%d)\n",
     ((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],
     ((int16_t*)&x[2])[0],((int16_t*)&x[2])[1],((int16_t*)&x[3])[0],((int16_t*)&x[3])[1],
     ((int16_t*)&y[0])[4],((int16_t*)&y[0])[5],((int16_t*)&y[1])[4],((int16_t*)&y[1])[5],
     ((int16_t*)&y[2])[4],((int16_t*)&y[2])[5],((int16_t*)&y[3])[4],((int16_t*)&y[3])[5]);
    printf("3(%d,%d) (%d,%d) (%d %d) (%d,%d) => (%d,%d) (%d,%d) (%d %d) (%d,%d)\n",
     ((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],
     ((int16_t*)&x[2])[6],((int16_t*)&x[2])[7],((int16_t*)&x[3])[6],((int16_t*)&x[3])[7],
     ((int16_t*)&y[0])[6],((int16_t*)&y[0])[7],((int16_t*)&y[1])[6],((int16_t*)&y[1])[7],
     ((int16_t*)&y[2])[0],((int16_t*)&y[2])[1],((int16_t*)&y[3])[0],((int16_t*)&y[3])[1]);

    bfly5_tw1(x,x+1,x+2,x+3,x+4,y,y+1,y+2,y+3,y+4);

    for (i=0;i<5;i++)
      printf("%d,%d,",
       ((int16_t*)&x[i])[0],((int16_t*)&x[i])[1]);
    printf("\n");
    for (i=0;i<5;i++)
      printf("%d,%d,",
       ((int16_t*)&y[i])[0],((int16_t*)&y[i])[1]);
    printf("\n");

    bfly5(x,x+1,x+2,x+3,x+4,y, y+1,y+2,y+3,y+4,&tw0,&tw1,&tw2,&tw3);
    for (i=0;i<5;i++)
      printf("%d,%d,",
       ((int16_t*)&x[i])[0],((int16_t*)&x[i])[1]);
    printf("\n");
    for (i=0;i<5;i++)
      printf("%d,%d,",
       ((int16_t*)&y[i])[0],((int16_t*)&y[i])[1]);
    printf("\n");


    printf("\n\n12-point\n");
    dft12f(x,
     x+1,
     x+2,
     x+3,
     x+4,
     x+5,
     x+6,
     x+7,
     x+8,
     x+9,
     x+10,
     x+11,
     y,
     y+1,
     y+2,
     y+3,
     y+4,
     y+5,
     y+6,
     y+7,
     y+8,
     y+9,
     y+10,
     y+11);


    printf("X: ");
    for (i=0;i<12;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<12;i++)
      printf("%d,%d,",((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft24((int16_t *)x,(int16_t *)y,1);
    printf("\n\n24-point\n");
    printf("X: ");
    for (i=0;i<24;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<24;i++)
      printf("%d,%d,",((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft36((int16_t *)x,(int16_t *)y,1);
    printf("\n\n36-point\n");
    printf("X: ");
    for (i=0;i<36;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<36;i++)
      printf("%d,%d,",((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft48((int16_t *)x,(int16_t *)y,1);
    printf("\n\n48-point\n");
    printf("X: ");
    for (i=0;i<48;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<48;i++)
      printf("%d,%d,",((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft60((int16_t *)x,(int16_t *)y,1);
    printf("\n\n60-point\n");
    printf("X: ");
    for (i=0;i<60;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<60;i++)
      printf("%d,%d,",((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft72((int16_t *)x,(int16_t *)y,1);
    printf("\n\n72-point\n");
    printf("X: ");
    for (i=0;i<72;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<72;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft96((int16_t *)x,(int16_t *)y,1);
    printf("\n\n96-point\n");
    printf("X: ");
    for (i=0;i<96;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<96;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft108((int16_t *)x,(int16_t *)y,1);
    printf("\n\n108-point\n");
    printf("X: ");
    for (i=0;i<108;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<108;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft120((int16_t *)x,(int16_t *)y,1);
    printf("\n\n120-point\n");
    printf("X: ");
    for (i=0;i<120;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<120;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft144((int16_t *)x,(int16_t *)y,1);
    printf("\n\n144-point\n");
    printf("X: ");
    for (i=0;i<144;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<144;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft180((int16_t *)x,(int16_t *)y,1);
    printf("\n\n180-point\n");
    printf("X: ");
    for (i=0;i<180;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<180;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft192((int16_t *)x,(int16_t *)y,1);
    printf("\n\n192-point\n");
    printf("X: ");
    for (i=0;i<192;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<192;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft216((int16_t *)x,(int16_t *)y,1);
    printf("\n\n216-point\n");
    printf("X: ");
    for (i=0;i<216;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<216;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft240((int16_t *)x,(int16_t *)y,1);
    printf("\n\n240-point\n");
    printf("X: ");
    for (i=0;i<240;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<240;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft288((int16_t *)x,(int16_t *)y,1);
    printf("\n\n288-point\n");
    printf("X: ");
    for (i=0;i<288;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<288;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");

    dft300((int16_t *)x,(int16_t *)y,1);
    printf("\n\n300-point\n");
    printf("X: ");
    for (i=0;i<300;i++)
      printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
    printf("\nY:");
    for (i=0;i<300;i++)
      printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
    printf("\n");
16427

16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442
    for (i=0;i<32;i++) {
      ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5;
    }
    memset((void*)&y[0],0,16*4);
    idft16((int16_t *)x,(int16_t *)y);
    printf("\n\n16-point\n");
    printf("X: ");
    for (i=0;i<4;i++)
      printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]);
    printf("\nY:");

    for (i=0;i<4;i++)
      printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]);
    printf("\n");
  */
16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457
  memset((void*)&x[0],0,64*4);
/*
  for (i=0; i<64; i+=4) {
     ((int16_t*)x)[i<<1] = 1024;
     ((int16_t*)x)[1+(i<<1)] = 0;
     ((int16_t*)x)[2+(i<<1)] = 0;
     ((int16_t*)x)[3+(i<<1)] = 1024;
     ((int16_t*)x)[4+(i<<1)] = -1024;
     ((int16_t*)x)[5+(i<<1)] = 0;
     ((int16_t*)x)[6+(i<<1)] = 0;
     ((int16_t*)x)[7+(i<<1)] = -1024;
  }
*/
  for (i=0;i<64;i++) {
      ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5;
16458 16459
  }
  memset((void*)&y[0],0,64*4);
16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472
/*
  dft16((int16_t *)x,(int16_t *)y);
  printf("16-point\n");
  printf("X: ");
  for (i=0;i<4;i++)
    printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]);
  printf("\nY:");

  for (i=0;i<4;i++)
    printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]);
  printf("\n");
  exit(-1); 
*/
16473 16474
  dft64((int16_t *)x,(int16_t *)y,1);
  dft64((int16_t *)x,(int16_t *)y,1);
16475
  dft64((int16_t *)x,(int16_t *)y,1);
16476
  reset_meas(&ts);
16477 16478

  for (i=0; i<10000000; i++) {
16479 16480 16481 16482 16483
    start_meas(&ts);
    dft64((int16_t *)x,(int16_t *)y,1);
    stop_meas(&ts);

  }
16484

16485
  printf("\n\n64-point (%f cycles, #trials %d)\n",(double)ts.diff/(double)ts.trials,ts.trials);
16486 16487
  write_output("x64.m","x64",x,64,1,1);
  write_output("y64.m","y64",y,64,1,1);
16488

16489 16490
/*
  printf("X: ");
16491 16492 16493 16494 16495 16496 16497
  for (i=0;i<16;i++)
    printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]);
  printf("\nY:");

  for (i=0;i<16;i++)
    printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]);
  printf("\n");
16498 16499 16500 16501 16502 16503

  idft64((int16_t*)y,(int16_t*)x,1);
  printf("X: ");
  for (i=0;i<16;i++)
    printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]);
 
16504
  for (i=0; i<256; i++) {
16505 16506
    ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5;
  }
16507 16508
*/
  
16509 16510
  memset((void*)&y[0],0,128*4);
  reset_meas(&ts);
16511 16512

  for (i=0; i<10000; i++) {
16513 16514 16515 16516
    start_meas(&ts);
    dft128((int16_t *)x,(int16_t *)y,0);
    stop_meas(&ts);
  }
16517

16518 16519
  printf("\n\n128-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);

16520 16521 16522 16523 16524 16525 16526 16527 16528 16529
  /* printf("X: ");
   for (i=0;i<32;i++)
     printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]);
   printf("\nY:");

   for (i=0;i<32;i++)
     printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]);
   printf("\n");
  */
  for (i=0; i<512; i++) {
16530 16531
    ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5;
  }
16532

16533 16534
  memset((void*)&y[0],0,256*4);
  reset_meas(&ts);
16535 16536

  for (i=0; i<10000; i++) {
16537 16538 16539 16540
    start_meas(&ts);
    dft256((int16_t *)x,(int16_t *)y,1);
    stop_meas(&ts);
  }
16541

16542 16543 16544
  printf("\n\n256-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);

  reset_meas(&ts);
16545 16546

  for (i=0; i<10000; i++) {
16547 16548 16549 16550
    start_meas(&ts);
    dft512((int16_t *)x,(int16_t *)y,1);
    stop_meas(&ts);
  }
16551

16552 16553
  printf("\n\n512-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);

16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567
  write_output("x.m","x",x,512,1,1);
  write_output("y.m","y",y,512,1,1);

  /*
  printf("X: ");
  for (i=0;i<64;i++)
    printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]);
  printf("\nY:");

  for (i=0;i<64;i++)
    printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]);
  printf("\n");
  */

16568
  reset_meas(&ts);
16569 16570

  for (i=0; i<10000; i++) {
16571 16572 16573 16574
    start_meas(&ts);
    dft1024((int16_t *)x,(int16_t *)y,1);
    stop_meas(&ts);
  }
16575

16576 16577 16578
  printf("\n\n1024-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);

  reset_meas(&ts);
16579 16580

  for (i=0; i<10000; i++) {
16581 16582 16583 16584
    start_meas(&ts);
    dft2048((int16_t *)x,(int16_t *)y,1);
    stop_meas(&ts);
  }
16585

16586 16587 16588 16589 16590 16591
  printf("\n\n2048-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);
  return(0);
}


#endif