MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / encodeCS4

Method encodeCS4

GPRS/FEC.cpp:527–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525
526static BitVector mCcopy;
527void GprsEncoder::encodeCS4(const BitVector &src)
528{
529 //if (sFecDebug) GPRSLOG(1) <<"encodeCS4 src\n"<<src;
530 src.copyToSegment(mD_CS4,0,53*8);
531 //if (sFecDebug) GPRSLOG(1) <<"encodeCS4 mD_CS4\n"<<mD_CS4;
532 // mC.zero(); // DEBUG TEST!! Did not help.
533 mD_CS4.fillField(53*8,0,7); // zero out 7 spare bits.
534 mD_CS4.LSB8MSB(); // Ignores the last incomplete byte of 7 zero bits.
535 //if (sFecDebug) GPRSLOG(1) <<"mC before parity\n"<<mC;
536 // Parity is computed on original D before doing the USF translation above.
537 mBlockCoder_CS4.writeParityWord(mD_CS4,mP_CS4);
538 // Note that usf has been moved to the first three bits by the byte swapping above,
539 // so when we write the 12 bits of GPRSUSFEncoding for usf into mC, it will overwrite
540 // the original 3 parity bits.
541 int reverseUsf = mD_CS4.peekField(0,3);
542 // mU overwrites the first 3 bits of mD within mC.
543 mU_CS4.fillField(0,GPRS::GPRSUSFEncoding[reverseUsf],12);
544 // Result is left in mC.
545 devassert(mC.peekField(0,12) == (unsigned) GPRS::GPRSUSFEncoding[reverseUsf]);
546 devassert(mC.peekField(433,7) == 0); // unused bits not modified.
547 //if (sFecDebug) GPRSLOG(1) <<"mC before interleave\n"<<mC;
548
549 interleave41(); // Interleaves mC into mI.
550}
551
552
553// Return decoded frame if success and B == 3, otherwise NULL.

Callers 1

send1FrameMethod · 0.80

Calls 1

copyToSegmentMethod · 0.80

Tested by

no test coverage detected