SCHL1Encoder::SCHL1Encoder(L1FEC* wParent) :GeneratorL1Encoder(0,gSCHMapping,wParent), mBlockCoder(0x0575,10,25), mU(25+10+4), mE(78), mD(mU.head(25)),mP(mU.segment(25,10)), mE1(mE.segment(0,39)),mE2(mE.segment(39,39)) { // The SCH extended training sequence. // GSM 05.02 5.2.5. static const BitVector xts("1011100101100010000001000000111100101101010001010111011000011011"); xts.copyToSegment(mBurst,42); // Set the tail bits in u[] now, just once. mU.fillField(35,0,4); }
void GprsEncoder::encodeCS4(const BitVector &src) { //if (sFecDebug) GPRSLOG(1) <<"encodeCS4 src\n"<<src; src.copyToSegment(mD_CS4,0,53*8); //if (sFecDebug) GPRSLOG(1) <<"encodeCS4 mD_CS4\n"<<mD_CS4; // mC.zero(); // DEBUG TEST!! Did not help. mD_CS4.fillField(53*8,0,7); // zero out 7 spare bits. mD_CS4.LSB8MSB(); // Ignores the last incomplete byte of 7 zero bits. //if (sFecDebug) GPRSLOG(1) <<"mC before parity\n"<<mC; // Parity is computed on original D before doing the USF translation above. mBlockCoder_CS4.writeParityWord(mD_CS4,mP_CS4); // Note that usf has been moved to the first three bits by the byte swapping above, // so when we write the 12 bits of GPRSUSFEncoding for usf into mC, it will overwrite // the original 3 parity bits. int reverseUsf = mD_CS4.peekField(0,3); // mU overwrites the first 3 bits of mD within mC. mU_CS4.fillField(0,GPRS::GPRSUSFEncoding[reverseUsf],12); // Result is left in mC. devassert(mC.peekField(0,12) == (unsigned) GPRS::GPRSUSFEncoding[reverseUsf]); devassert(mC.peekField(433,7) == 0); // unused bits not modified. //if (sFecDebug) GPRSLOG(1) <<"mC before interleave\n"<<mC; interleave41(); // Interleaves mC into mI. }