This commit is contained in:
Christopher Taylor 2017-05-27 21:39:02 -07:00
parent 111c0c3eb2
commit 6bf48a9c4a
2 changed files with 13 additions and 6 deletions

View File

@ -846,17 +846,20 @@ void Encode(
// work <- data
// 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);
for (unsigned i = original_count; i < m; ++i)
memset(work[i], 0, buffer_bytes);
// work <- IFFT(data, m, m)
const unsigned first_end = (original_count < m) ? original_count : m;
for (unsigned width = 1; width < m; width <<= 1)
{
const unsigned range = width << 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(
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)
{
// temp <- data + i
@ -949,6 +955,7 @@ void Encode(
}
// work <- FFT(work, m, 0)
skip_body:
for (unsigned width = (m >> 1); width > 0; width >>= 1)
{

View File

@ -389,18 +389,18 @@ struct TestParameters
unsigned original_count = 1000; // under 65536
unsigned recovery_count = 100; // under 65536 - original_count
#else
unsigned original_count = 100; // under 65536
unsigned recovery_count = 10; // under 65536 - original_count
unsigned original_count = 128; // under 65536
unsigned recovery_count = 128; // under 65536 - original_count
#endif
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;
bool multithreaded = true;
};
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);