mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-20 22:45:44 +08:00
Re-add the audio blanking for too corrupt audio in DMR, NXDN and YSFDN
modes.
This commit is contained in:
16
AMBEFEC.cpp
16
AMBEFEC.cpp
@@ -527,9 +527,9 @@ unsigned int CAMBEFEC::regenerateDMR(unsigned char* bytes) const
|
|||||||
c3 |= MASK;
|
c3 |= MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int errors = regenerateDMR(a1, b1);
|
unsigned int errors = regenerateDMR(a1, b1, c1);
|
||||||
errors += regenerateDMR(a2, b2);
|
errors += regenerateDMR(a2, b2, c2);
|
||||||
errors += regenerateDMR(a3, b3);
|
errors += regenerateDMR(a3, b3, c3);
|
||||||
|
|
||||||
MASK = 0x800000U;
|
MASK = 0x800000U;
|
||||||
for (unsigned int i = 0U; i < 24U; i++, MASK >>= 1) {
|
for (unsigned int i = 0U; i < 24U; i++, MASK >>= 1) {
|
||||||
@@ -633,7 +633,7 @@ unsigned int CAMBEFEC::regenerateYSFDN(unsigned char* bytes) const
|
|||||||
c |= MASK;
|
c |= MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int errors = regenerateDMR(a, b);
|
unsigned int errors = regenerateDMR(a, b, c);
|
||||||
|
|
||||||
MASK = 0x800000U;
|
MASK = 0x800000U;
|
||||||
for (unsigned int i = 0U; i < 24U; i++, MASK >>= 1) {
|
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;
|
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_a = a;
|
||||||
unsigned int orig_b = b;
|
unsigned int orig_b = b;
|
||||||
@@ -861,5 +861,11 @@ unsigned int CAMBEFEC::regenerateDMR(unsigned int& a, unsigned int& b) const
|
|||||||
errsB++;
|
errsB++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (errsA >= 4U || ((errsA + errsB) >= 6U && errsA >= 2U)) {
|
||||||
|
a = 0xF00292U;
|
||||||
|
b = 0x0E0B20U;
|
||||||
|
c = 0x000000U;
|
||||||
|
}
|
||||||
|
|
||||||
return errsA + errsB;
|
return errsA + errsB;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int regenerateDStar(unsigned int& a, unsigned int& b) const;
|
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
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user