mirror of https://github.com/status-im/leopard.git
Disable warning
This commit is contained in:
parent
8673889a9a
commit
94bf94771e
|
@ -192,6 +192,8 @@ void xor_mem(
|
||||||
} while (bytes > 0);
|
} while (bytes > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LEO_M1_OPT
|
||||||
|
|
||||||
void xor_mem_2to1(
|
void xor_mem_2to1(
|
||||||
void * LEO_RESTRICT x,
|
void * LEO_RESTRICT x,
|
||||||
const void * LEO_RESTRICT y,
|
const void * LEO_RESTRICT y,
|
||||||
|
@ -255,6 +257,8 @@ void xor_mem_2to1(
|
||||||
} while (bytes > 0);
|
} while (bytes > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // LEO_M1_OPT
|
||||||
|
|
||||||
#ifdef LEO_USE_VECTOR4_OPT
|
#ifdef LEO_USE_VECTOR4_OPT
|
||||||
|
|
||||||
void xor_mem4(
|
void xor_mem4(
|
||||||
|
|
|
@ -322,6 +322,8 @@ void xor_mem(
|
||||||
void * LEO_RESTRICT x, const void * LEO_RESTRICT y,
|
void * LEO_RESTRICT x, const void * LEO_RESTRICT y,
|
||||||
uint64_t bytes);
|
uint64_t bytes);
|
||||||
|
|
||||||
|
#ifdef LEO_M1_OPT
|
||||||
|
|
||||||
// x[] ^= y[] ^ z[]
|
// x[] ^= y[] ^ z[]
|
||||||
void xor_mem_2to1(
|
void xor_mem_2to1(
|
||||||
void * LEO_RESTRICT x,
|
void * LEO_RESTRICT x,
|
||||||
|
@ -329,6 +331,8 @@ void xor_mem_2to1(
|
||||||
const void * LEO_RESTRICT z,
|
const void * LEO_RESTRICT z,
|
||||||
uint64_t bytes);
|
uint64_t bytes);
|
||||||
|
|
||||||
|
#endif // LEO_M1_OPT
|
||||||
|
|
||||||
#ifdef LEO_USE_VECTOR4_OPT
|
#ifdef LEO_USE_VECTOR4_OPT
|
||||||
|
|
||||||
// For i = {0, 1, 2, 3}: x_i[] ^= x_i[]
|
// For i = {0, 1, 2, 3}: x_i[] ^= x_i[]
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable: 4752) // found Intel(R) Advanced Vector Extensions; consider using /arch:AVX
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace leopard { namespace ff8 {
|
namespace leopard { namespace ff8 {
|
||||||
|
|
||||||
|
|
||||||
|
|
23
leopard.cpp
23
leopard.cpp
|
@ -150,7 +150,11 @@ LEO_EXPORT LeopardResult leo_encode(
|
||||||
// Handle m = 1 case
|
// Handle m = 1 case
|
||||||
if (recovery_count == 1)
|
if (recovery_count == 1)
|
||||||
{
|
{
|
||||||
EncodeM1(buffer_bytes, original_count, original_data, work_data[0]);
|
EncodeM1(
|
||||||
|
buffer_bytes,
|
||||||
|
original_count,
|
||||||
|
original_data,
|
||||||
|
work_data[0]);
|
||||||
return Leopard_Success;
|
return Leopard_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,23 +255,23 @@ LEO_EXPORT LeopardResult leo_decode(
|
||||||
|
|
||||||
// Check if not enough recovery data arrived
|
// Check if not enough recovery data arrived
|
||||||
unsigned original_loss_count = 0;
|
unsigned original_loss_count = 0;
|
||||||
unsigned original_loss_index = 0;
|
unsigned original_loss_i = 0;
|
||||||
for (unsigned i = 0; i < original_count; ++i)
|
for (unsigned i = 0; i < original_count; ++i)
|
||||||
{
|
{
|
||||||
if (!original_data[i])
|
if (!original_data[i])
|
||||||
{
|
{
|
||||||
++original_loss_count;
|
++original_loss_count;
|
||||||
original_loss_index = i;
|
original_loss_i = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unsigned recovery_got_count = 0;
|
unsigned recovery_got_count = 0;
|
||||||
unsigned recovery_last_i = 0;
|
unsigned recovery_got_i = 0;
|
||||||
for (unsigned i = 0; i < recovery_count; ++i)
|
for (unsigned i = 0; i < recovery_count; ++i)
|
||||||
{
|
{
|
||||||
if (recovery_data[i])
|
if (recovery_data[i])
|
||||||
{
|
{
|
||||||
++recovery_got_count;
|
++recovery_got_count;
|
||||||
recovery_last_i = i;
|
recovery_got_i = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (recovery_got_count < original_loss_count)
|
if (recovery_got_count < original_loss_count)
|
||||||
|
@ -276,14 +280,19 @@ LEO_EXPORT LeopardResult leo_decode(
|
||||||
// Handle k = 1 case
|
// Handle k = 1 case
|
||||||
if (original_count == 1)
|
if (original_count == 1)
|
||||||
{
|
{
|
||||||
memcpy(work_data[0], recovery_data[recovery_last_i], buffer_bytes);
|
memcpy(work_data[0], recovery_data[recovery_got_i], buffer_bytes);
|
||||||
return Leopard_Success;
|
return Leopard_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle m = 1 case
|
// Handle m = 1 case
|
||||||
if (recovery_count == 1)
|
if (recovery_count == 1)
|
||||||
{
|
{
|
||||||
DecodeM1(buffer_bytes, original_count, original_data, recovery_data[0], work_data[original_loss_index]);
|
DecodeM1(
|
||||||
|
buffer_bytes,
|
||||||
|
original_count,
|
||||||
|
original_data,
|
||||||
|
recovery_data[0],
|
||||||
|
work_data[original_loss_i]);
|
||||||
return Leopard_Success;
|
return Leopard_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ struct TestParameters
|
||||||
unsigned recovery_count = 100; // under 65536 - original_count
|
unsigned recovery_count = 100; // under 65536 - original_count
|
||||||
#else
|
#else
|
||||||
unsigned original_count = 3; // under 65536
|
unsigned original_count = 3; // under 65536
|
||||||
unsigned recovery_count = 1; // under 65536 - original_count
|
unsigned recovery_count = 2; // under 65536 - original_count
|
||||||
#endif
|
#endif
|
||||||
unsigned buffer_bytes = 64000; // multiple of 64 bytes
|
unsigned buffer_bytes = 64000; // multiple of 64 bytes
|
||||||
unsigned loss_count = 16; // some fraction of original_count
|
unsigned loss_count = 2; // some fraction of original_count
|
||||||
unsigned seed = 0;
|
unsigned seed = 0;
|
||||||
bool multithreaded = true;
|
bool multithreaded = true;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue