mirror of
https://github.com/status-im/leopard.git
synced 2025-02-21 10:19:06 +00:00
Fixes
This commit is contained in:
parent
111c0c3eb2
commit
6bf48a9c4a
@ -846,17 +846,20 @@ void Encode(
|
|||||||
// work <- data
|
// work <- data
|
||||||
|
|
||||||
// FIXME: Unroll first loop to eliminate this
|
// FIXME: Unroll first loop to eliminate this
|
||||||
for (unsigned i = 0; i < m; ++i)
|
for (unsigned i = 0; i < original_count; ++i)
|
||||||
memcpy(work[i], data[i], buffer_bytes);
|
memcpy(work[i], data[i], buffer_bytes);
|
||||||
|
for (unsigned i = original_count; i < m; ++i)
|
||||||
|
memset(work[i], 0, buffer_bytes);
|
||||||
|
|
||||||
// work <- IFFT(data, m, m)
|
// work <- IFFT(data, m, m)
|
||||||
|
|
||||||
|
const unsigned first_end = (original_count < m) ? original_count : m;
|
||||||
for (unsigned width = 1; width < m; width <<= 1)
|
for (unsigned width = 1; width < m; width <<= 1)
|
||||||
{
|
{
|
||||||
const unsigned range = width << 1;
|
const unsigned range = width << 1;
|
||||||
const ffe_t* skewLUT = FFTSkew + m - 1;
|
const ffe_t* skewLUT = FFTSkew + m - 1;
|
||||||
|
|
||||||
for (unsigned j = width; j < m; j += range)
|
for (unsigned j = width; j < first_end; j += range)
|
||||||
{
|
{
|
||||||
VectorIFFTButterfly(
|
VectorIFFTButterfly(
|
||||||
buffer_bytes,
|
buffer_bytes,
|
||||||
@ -867,6 +870,9 @@ void Encode(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m >= original_count)
|
||||||
|
goto skip_body;
|
||||||
|
|
||||||
for (unsigned i = m; i + m <= original_count; i += m)
|
for (unsigned i = m; i + m <= original_count; i += m)
|
||||||
{
|
{
|
||||||
// temp <- data + i
|
// temp <- data + i
|
||||||
@ -949,6 +955,7 @@ void Encode(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// work <- FFT(work, m, 0)
|
// work <- FFT(work, m, 0)
|
||||||
|
skip_body:
|
||||||
|
|
||||||
for (unsigned width = (m >> 1); width > 0; width >>= 1)
|
for (unsigned width = (m >> 1); width > 0; width >>= 1)
|
||||||
{
|
{
|
||||||
|
@ -389,18 +389,18 @@ struct TestParameters
|
|||||||
unsigned original_count = 1000; // under 65536
|
unsigned original_count = 1000; // under 65536
|
||||||
unsigned recovery_count = 100; // under 65536 - original_count
|
unsigned recovery_count = 100; // under 65536 - original_count
|
||||||
#else
|
#else
|
||||||
unsigned original_count = 100; // under 65536
|
unsigned original_count = 128; // under 65536
|
||||||
unsigned recovery_count = 10; // under 65536 - original_count
|
unsigned recovery_count = 128; // 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 = 10; // some fraction of original_count
|
unsigned loss_count = 128; // some fraction of original_count
|
||||||
unsigned seed = 0;
|
unsigned seed = 0;
|
||||||
bool multithreaded = true;
|
bool multithreaded = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void BasicTest(const TestParameters& params)
|
static void BasicTest(const TestParameters& params)
|
||||||
{
|
{
|
||||||
static const unsigned kTrials = 4;
|
static const unsigned kTrials = 10;
|
||||||
|
|
||||||
std::vector<uint8_t*> original_data(params.original_count);
|
std::vector<uint8_t*> original_data(params.original_count);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user