- if (pType == 2) { // then marker bit which should be a 1
- if (!BitStream[j]) return 0;
- } else {
- if (parityTest(parityWd, pLen, pType) == 0) return 0;
+ switch (pType) {
+ case 3: if (BitStream[j]==1) return 0; break; //should be 0 spacer bit
+ case 2: if (BitStream[j]==0) return 0; break; //should be 1 spacer bit
+ default: //test parity
+ if (parityTest(parityWd, pLen, pType) == 0) return 0; break;