1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-29 19:28:47 -05:00

Merge pull request #1404 from Paulo-D2000/master

MSVC M17 FIX
This commit is contained in:
Edouard Griffiths 2022-09-07 11:57:27 +02:00 committed by GitHub
commit 18377638f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 22 deletions

View File

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

View File

@ -159,10 +159,10 @@ struct Viterbi
*
* @return path metric for estimating BER.
*/
template <size_t IN, size_t OUT>
size_t decode(const std::array<int8_t, IN>& in, std::array<uint8_t, OUT>& out)
template <size_t IN2, size_t OUT2>
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;
@ -170,7 +170,7 @@ struct Viterbi
prevMetrics[0] = 0; // Starting point.
auto hbegin = history_.begin();
auto hend = history_.begin() + IN / 2;
auto hend = history_.begin() + IN2 / 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> 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 s1 = in[i + 1];
@ -227,11 +227,11 @@ struct Viterbi
auto hit = std::make_reverse_iterator(hend); // rbegin
auto hrend = std::make_reverse_iterator(hbegin); // rend
size_t next_element = min_element;
size_t index = IN / 2;
size_t index = IN2 / 2;
while (oit != std::rend(out) && hit != hrend)
{
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];
}

View File

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

View File

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

View File

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