I'm using the TCP2 on a 6482 (little endian) to decode 3GPP data... and it is decoding the blocks fine...
But I have 2 questions that may or may not be related...
1) I have to swap the of the output hard decisions around to get the correct buffer. I'm using TCP2_OUT_ORDER_31_0. Here's my code that swaps the bytes around:
for (int i = 0; i < (NumInfoBits + 4) / BITS_IN_BYTE; i += 4)
{
Uint8 tmp0 = turboHD[i];
Uint8 tmp1 = turboHD[i+1];
Uint8 tmp2 = turboHD[i+2];
Uint8 tmp3 = turboHD[i+3];
turboHD[i] = tmp3;
turboHD[i+1] = tmp2;
turboHD[i+2] = tmp1;
turboHD[i+3] = tmp0;
}
If I switch to TCP2_OUT_ORDER_0_31, then the data is in the correct bytes, but I'd have to swap bits 0 & 7, 1 & 6, etc.
Am I doing something wrong... causing the bits to need swapping around?
2) I'd like to use the TCP2's CRC stop criteria, but I can't get it to ever stop early (even though the CRC is good).
/* TCP2 configuration defines */
#define TCP2_INTERLEAVER_LOAD_FLAG TRUE /* To load the interleaver RAM */
#define TCP2_MAX_ITERATIONS 8 /* Maximum iterations of the TCP2 */
#define TCP2_MIN_ITERATIONS 2 /* minimum iterations of the TCP2 */
#define TCP2_OUT_PARAM_READ_FLAG TRUE /* Output parameters read flag */
#define TCP2_PROLOG_SIZE 12 /* prolog size */
#define TCP2_PROLOG_REDUCTION TRUE /* prolog reduction enabled */
#define TCP2_MAX_STAR_ENABLE TRUE /* Maximum star enable */
#define TCP2_EXTR_SCALE 0 /* set this if MAX STAR is FALSE */
/* setup the TCP2 base params */
tcp2BaseInit->inputSign = TCP2_INPUT_SIGN_POSITIVE;
tcp2BaseInit->intFlag = TCP2_INTERLEAVER_LOAD_FLAG;
tcp2BaseInit->maxIter = TCP2_MAX_ITERATIONS;
tcp2BaseInit->maxStarEn = TCP2_MAX_STAR_ENABLE;
tcp2BaseInit->standard = TCP2_STANDARD_3GPP;
tcp2BaseInit->crcLen = 24; /* CRC */
tcp2BaseInit->crcPoly = 0x00864CFB; /* CRC poly */
tcp2BaseInit->minIter = TCP2_MIN_ITERATIONS;
tcp2BaseInit->numCrcPass = 1; /* default value */
tcp2BaseInit->outParmFlag = TCP2_OUT_PARAM_READ_FLAG;
tcp2BaseInit->outputOrder = TCP2_OUT_ORDER_31_0;
tcp2BaseInit->prologRedEn = TCP2_PROLOG_REDUCTION;
tcp2BaseInit->prologSize = TCP2_PROLOG_SIZE;
tcp2BaseInit->rate = TCP2_RATE_1_3;
tcp2BaseInit->map = 0;
tcp2BaseInit->snr = 0; /* disable SNR threshold checking */
Maybe the CRC-stop problem is related to me having to swap the output bits around?
thanks,
Brad