mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-26 20:25:39 +08:00
Get the convolution BER directly from the decoder.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2009-2016,2018,2021 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -97,7 +97,7 @@ void CNXDNConvolution::decode(uint8_t s0, uint8_t s1)
|
||||
m_newMetrics = tmp;
|
||||
}
|
||||
|
||||
void CNXDNConvolution::chainback(unsigned char* out, unsigned int nBits)
|
||||
unsigned int CNXDNConvolution::chainback(unsigned char* out, unsigned int nBits)
|
||||
{
|
||||
assert(out != NULL);
|
||||
|
||||
@@ -112,6 +112,15 @@ void CNXDNConvolution::chainback(unsigned char* out, unsigned int nBits)
|
||||
|
||||
WRITE_BIT1(out, nBits, bit != 0U);
|
||||
}
|
||||
|
||||
unsigned int minCost = m_oldMetrics[0];
|
||||
|
||||
for (unsigned int i = 0U; i < NUM_OF_STATES; i++) {
|
||||
if (m_oldMetrics[i] < minCost)
|
||||
minCost = m_oldMetrics[i];
|
||||
}
|
||||
|
||||
return minCost / (M >> 1);
|
||||
}
|
||||
|
||||
void CNXDNConvolution::encode(const unsigned char* in, unsigned char* out, unsigned int nBits) const
|
||||
|
||||
Reference in New Issue
Block a user