Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Initialisation of an RS(127,113) decoder.

jenni80
Beginner
534 Views
Hi,

i want to initialise an RS (127, 113) decoder. The given Informations to this RS code are:

BCH(127,113), with an generator polynomial x^14 + x^9 + x^8 + x^6 + x^5 + x^4 + x^2 + x + 1.
So i wrote this code to initalize the decoder specc:
BCH.h:

class BCH{
private:
Ipp8u *Codeword;
int * pSize;
int* pRootNum;
IppsGFSpec_8u* pGF;
IppsRSDecodeSpec_8u* pRS;
Ipp8u *pRoot, *pBuffer;
IppsPoly_GF8u* pPoly;
int* pErasureList;
Ipp8u *Coeffs;


public:
BCH();

};

BCH.cpp :

static const Ipp8u COEFFS[15] = {1,1,1,0,1,1,1,0,1,1,0,0,0,0,1}; //notation of the generator polynomial

BCH::BCH(){ //Constructor

pSize = new int;
pRoot = ippsMalloc_8u(10);
pRootNum = new int;
pErasureList = new int[20] ; // Setting some values for testing, my code shouldn't have any erasures.
pErasureList[0] = 2;
pErasureList[1] = 4;
pErasureList[2] = 6;
pErasureList[3] = 8;
pErasureList[4] = 11;
Codeword = ippsMalloc_8u(127);
cout << " 1 " < pGF = (IppsGFSpec_8u*)ippsMalloc_8u(*pSize); //allocating memory for the GFSpec
*pSize = 0; //resetting pSize , for debugging only, to see if any pSize Value is //set afterwards
cout<<" 2 " < pPoly = (IppsPoly_GF8u*)ippsMalloc_8u(*pSize); //allocating memory for the PolyGFSpec
*pSize = 0; //debugging ....
cout << " 3 " << ippsGFInit_8u(8, COEFFS, pGF)< cout << " 4 " << ippsPolyGFInit_8u( pGF, 14, pPoly)< pRoot[0]=1; //debugging ....
cout << " 5 " << ippsPolyGFRoots_8u( pPoly, pRoot, pRootNum)<cout << "pRoot" <<(short)pRoot[0]<<" pRootNum " <<*pRootNum << endl; // just an cout
cout << " 6 " << ippsRSDecodeGetSize_8u(127, 113,pSize)< pRS = (IppsRSDecodeSpec_8u*)ippsMalloc_8u(*pSize); //allocating memory for the RSDecodeSpec
*pSize = 0; //debugging...
cout << " 7 " << ippsRSDecodeInit_8u(127, 113,pGF,pRoot[0], pRS)< cout << " 8 " << ippsRSDecodeBMGetBufferSize_8u( pRS, pSize)< pBuffer =ippsMalloc_8u(*pSize); //allocating work buffer memory
Sleep(1000); //see cout values
}

The console has the following output:
------------
1 0
2 0
3 0
4 0
5 0
pRoot 1 0
6 0
7 0
8 0
-------------

so every Ipp function has returned "0" which means everything is okay. But why is the value of pRoot not changed and the number of elements of pRoot (pRootNum) "0" ? Did i mixed up, or set some values wrong?
if i now call the function :

cout << ippsRSDecodeBM_8u(NULL,0, Codeword, pRS, pBuffer)<cout << ippsRSDecodeBM_8u(pErasureList,0, Codeword, pRS, pBuffer)<
where Codeword is an array fof 127 random values of 0 or 1 . the console writes : -6 which is declared as, "ippStsSizeErr" or "Wrong value of data size" this error is not specified for this function in the reference manual so i don't know where the error is. Changing the pointer value for the Erasure list from "NULL" to pErasureList does not changes anything. The Codeword should be okay as long as it's at least 127 elements long and pBuffer can be empty and its Size is directly computed from the pRS value. So i assume there are some bad values in "pRS" which needs the above mentioned pRoot value for initialisation. But now i cannot figure out why the pRoot value isn't set correctly.
Can you give me some advise ?
Thanks in advance..

Jenni
0 Kudos
1 Reply
meg_meh
Beginner
534 Views

Did you ever figure this out? I'm seeing the same problem
0 Kudos
Reply