pull/1404/head
unknown 2022-09-06 17:10:25 -03:00
rodzic 664e627191
commit fc1f5116d7
6 zmienionych plików z 21 dodań i 22 usunięć

Wyświetl plik

@ -407,4 +407,4 @@ struct M17FrameDecoder
State state() const { return state_; } State state() const { return state_; }
}; };
} // modemm17 } // modemm17

Wyświetl plik

@ -131,17 +131,17 @@ auto llr(float sample)
return std::get<1>(*it); return std::get<1>(*it);
} }
template <size_t IN, size_t OUT, size_t P> template <size_t IN1, size_t OUT1, size_t P>
size_t depuncture( // FIXME: MSVC size_t depuncture( // FIXED: MSVC (MULTIPLE DEFINITIONS SAME TEMPLATE)
const std::array<int8_t, IN>& in, const std::array<int8_t, IN1>& in,
std::array<int8_t, OUT>& out, std::array<int8_t, OUT1>& out,
const std::array<int8_t, P>& p const std::array<int8_t, P>& p
) )
{ {
size_t index = 0; size_t index = 0;
size_t pindex = 0; size_t pindex = 0;
size_t bit_count = 0; size_t bit_count = 0;
for (size_t i = 0; i != OUT && index < IN; ++i) for (size_t i = 0; i != OUT1 && index < IN1; ++i)
{ {
if (!p[pindex++]) if (!p[pindex++])
{ {
@ -160,17 +160,17 @@ size_t depuncture( // FIXME: MSVC
} }
template <size_t IN, size_t OUT, size_t P> template <size_t IN0, size_t OUT0, size_t P>
size_t puncture( // FIXME: MSVC size_t puncture( // FIXED::MSVC (MULTIPLE DEFINITIONS OF THE SAME TEMPLATE)
const std::array<uint8_t, IN>& in, const std::array<uint8_t, IN0>& in,
std::array<int8_t, OUT>& out, std::array<int8_t, OUT0>& out,
const std::array<int8_t, P>& p const std::array<int8_t, P>& p
) )
{ {
size_t index = 0; size_t index = 0;
size_t pindex = 0; size_t pindex = 0;
size_t bit_count = 0; size_t bit_count = 0;
for (size_t i = 0; i != IN && index != OUT; ++i) for (size_t i = 0; i != IN0 && index != OUT0; ++i)
{ {
if (p[pindex++]) if (p[pindex++])
{ {

Wyświetl plik

@ -159,10 +159,10 @@ struct Viterbi
* *
* @return path metric for estimating BER. * @return path metric for estimating BER.
*/ */
template <size_t IN, size_t OUT> template <size_t IN2, size_t OUT2>
size_t decode(const std::array<int8_t, IN>& in, std::array<uint8_t, OUT>& out) size_t decode(const std::array<int8_t, IN2>& in, std::array<uint8_t, OUT2>& out)
{ {
static_assert(sizeof(history_) >= IN / 2, "Invalid size"); static_assert(sizeof(history_) >= IN2 / 2, "Invalid size");
constexpr auto MAX_METRIC = std::numeric_limits<typename metrics_t::value_type>::max() / 2; constexpr auto MAX_METRIC = std::numeric_limits<typename metrics_t::value_type>::max() / 2;
@ -170,7 +170,7 @@ struct Viterbi
prevMetrics[0] = 0; // Starting point. prevMetrics[0] = 0; // Starting point.
auto hbegin = history_.begin(); auto hbegin = history_.begin();
auto hend = history_.begin() + IN / 2; auto hend = history_.begin() + IN2 / 2;
constexpr size_t BUTTERFLY_SIZE = NumStates / 2; constexpr size_t BUTTERFLY_SIZE = NumStates / 2;
@ -178,7 +178,7 @@ struct Viterbi
std::array<int16_t, BUTTERFLY_SIZE> cost0; std::array<int16_t, BUTTERFLY_SIZE> cost0;
std::array<int16_t, BUTTERFLY_SIZE> cost1; std::array<int16_t, BUTTERFLY_SIZE> cost1;
for (size_t i = 0; i != IN; i += 2, hindex += 1) for (size_t i = 0; i != IN2; i += 2, hindex += 1)
{ {
int16_t s0 = in[i]; int16_t s0 = in[i];
int16_t s1 = in[i + 1]; int16_t s1 = in[i + 1];
@ -227,11 +227,11 @@ struct Viterbi
auto hit = std::make_reverse_iterator(hend); // rbegin auto hit = std::make_reverse_iterator(hend); // rbegin
auto hrend = std::make_reverse_iterator(hbegin); // rend auto hrend = std::make_reverse_iterator(hbegin); // rend
size_t next_element = min_element; size_t next_element = min_element;
size_t index = IN / 2; size_t index = IN2 / 2;
while (oit != std::rend(out) && hit != hrend) while (oit != std::rend(out) && hit != hrend)
{ {
auto v = (*hit++)[next_element]; auto v = (*hit++)[next_element];
if (index-- <= OUT) *oit++ = next_element & 1; if (index-- <= OUT2) *oit++ = next_element & 1;
next_element = prevState_[next_element][v]; next_element = prevState_[next_element][v];
} }

Wyświetl plik

@ -97,7 +97,7 @@ if (ENABLE_CHANNELRX_DEMODFREEDV AND CODEC2_FOUND)
add_subdirectory(demodfreedv) add_subdirectory(demodfreedv)
endif() endif()
if (LINUX AND ENABLE_CHANNELRX_DEMODM17 AND CODEC2_FOUND) if (ENABLE_CHANNELRX_DEMODM17 AND CODEC2_FOUND)
add_subdirectory(demodm17) add_subdirectory(demodm17)
endif() endif()

Wyświetl plik

@ -16,8 +16,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "m17demodplugin.h" //REMOVED REPEATED INCLUDE...
#include <QtPlugin> #include <QtPlugin>
#include "plugin/pluginapi.h" #include "plugin/pluginapi.h"
#ifndef SERVER_MODE #ifndef SERVER_MODE

Wyświetl plik

@ -63,6 +63,6 @@ if (ENABLE_CHANNELTX_MODFREEDV AND CODEC2_FOUND)
add_subdirectory(modfreedv) add_subdirectory(modfreedv)
endif() endif()
if (LINUX AND ENABLE_CHANNELTX_MODM17 AND CODEC2_FOUND) if (ENABLE_CHANNELTX_MODM17 AND CODEC2_FOUND)
add_subdirectory(modm17) add_subdirectory(modm17)
endif() endif()