interLeaver::interLeaver (DabParams *p) { switch (p -> dabMode) { case 1: default: // shouldn't happen permTable = createMapper (p -> T_u, 511, 256, 256 + p -> K, new int16_t [p -> T_u]); break; case 2: permTable = createMapper (p -> T_u, 127, 64, 64 + p -> K, new int16_t [p -> T_u]); break; case 3: permTable = createMapper (p -> T_u, 63, 32, 32 + p -> K, new int16_t [p -> T_u]); break; case 4: permTable = createMapper (p -> T_u, 255, 128, 128 + p -> K, new int16_t [p -> T_u]); break; } }
permVector::permVector (DabParams *p) { //int16_t i; //int16_t index = 0; //int16_t *tmp = (int16_t *)alloca (p -> T_u * sizeof (int16_t)); // // permTable = new int16_t [p -> K]; // index = 0; //// step 1: generate the permutation // tmp [0] = 0; // for (i = 1; i < p -> T_u; i ++) // tmp [i] = (13 * tmp [i - 1] + 511) % (p -> T_u); //// step 2: make it into a map of p -> K elements // // for (i = 0; i < p -> T_u; i ++) { // if (tmp [i] == p -> T_u / 2) // continue; // if ((tmp [i] < 256) || // (tmp [i] > 1792)) // continue; //// we now have a table with values from 256 .. 1792 //// // permTable [index ++] = tmp [i] - p -> T_u / 2; //// we now have a table with values from -768 .. 768 // } switch (p -> dabMode) { case 1: default: // shouldn't happen permTable = createMapper (p -> T_u, 511, 256, 256 + p -> K, new int16_t [p -> T_u]); break; case 2: permTable = createMapper (p -> T_u, 127, 64, 64 + p -> K, new int16_t [p -> T_u]); break; case 3: permTable = createMapper (p -> T_u, 63, 32, 32 + p -> K, new int16_t [p -> T_u]); break; case 4: permTable = createMapper (p -> T_u, 255, 128, 128 + p -> K, new int16_t [p -> T_u]); break; } }