Re-add the audio blanking for too corrupt audio in DMR, NXDN and YSFDN

modes.
This commit is contained in:
Jonathan Naylor 2018-03-07 20:14:07 +00:00
parent 25bd10fa7d
commit 06ccaf6032
2 changed files with 12 additions and 6 deletions

View File

@ -527,9 +527,9 @@ unsigned int CAMBEFEC::regenerateDMR(unsigned char* bytes) const
c3 |= MASK;
}
unsigned int errors = regenerateDMR(a1, b1);
errors += regenerateDMR(a2, b2);
errors += regenerateDMR(a3, b3);
unsigned int errors = regenerateDMR(a1, b1, c1);
errors += regenerateDMR(a2, b2, c2);
errors += regenerateDMR(a3, b3, c3);
MASK = 0x800000U;
for (unsigned int i = 0U; i < 24U; i++, MASK >>= 1) {
@ -633,7 +633,7 @@ unsigned int CAMBEFEC::regenerateYSFDN(unsigned char* bytes) const
c |= MASK;
}
unsigned int errors = regenerateDMR(a, b);
unsigned int errors = regenerateDMR(a, b, c);
MASK = 0x800000U;
for (unsigned int i = 0U; i < 24U; i++, MASK >>= 1) {
@ -827,7 +827,7 @@ unsigned int CAMBEFEC::regenerateDStar(unsigned int& a, unsigned int& b) const
return errsA + errsB;
}
unsigned int CAMBEFEC::regenerateDMR(unsigned int& a, unsigned int& b) const
unsigned int CAMBEFEC::regenerateDMR(unsigned int& a, unsigned int& b, unsigned int& c) const
{
unsigned int orig_a = a;
unsigned int orig_b = b;
@ -861,5 +861,11 @@ unsigned int CAMBEFEC::regenerateDMR(unsigned int& a, unsigned int& b) const
errsB++;
}
if (errsA >= 4U || ((errsA + errsB) >= 6U && errsA >= 2U)) {
a = 0xF00292U;
b = 0x0E0B20U;
c = 0x000000U;
}
return errsA + errsB;
}

View File

@ -34,7 +34,7 @@ public:
private:
unsigned int regenerateDStar(unsigned int& a, unsigned int& b) const;
unsigned int regenerateDMR(unsigned int& a, unsigned int& b) const;
unsigned int regenerateDMR(unsigned int& a, unsigned int& b,unsigned int& c) const;
};
#endif