Skip to content

Commit

Permalink
EC driver: add systematic FNT
Browse files Browse the repository at this point in the history
  • Loading branch information
lamphamsy committed Sep 7, 2018
1 parent 0358bc1 commit 49de079
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/ec_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ char* prefix = nullptr;
void xusage()
{
std::cerr << std::string("Usage: ") +
"ec [-e rs-gf2n-v|rs-gf2n-c|rs-gf2n-fft|rs-gf2n-fft-add|rs-gfp-fft|rs-fnt|rs-nf4]" +
"ec [-e rs-gf2n-v|rs-gf2n-c|rs-gf2n-fft|rs-gf2n-fft-add|rs-gfp-fft|rs-fnt|rs-fnt-sys|rs-nf4]" +
"[-w word_size][-n n_data][-m n_parities][-p prefix][-v (verbose)]" +
" -c (encode) | -r (repair)\n";
exit(1);
Expand Down Expand Up @@ -123,7 +123,9 @@ void create_coding_files(
*
*/
template <typename T>
bool repair_data_files(quadiron::fec::FecCode<T>* fec)
bool repair_data_files(
quadiron::fec::FecCode<T>* fec,
bool operation_on_packet = false)
{
char filename[1024];
std::vector<std::istream*> d_files(fec->n_data, nullptr);
Expand Down Expand Up @@ -171,7 +173,10 @@ bool repair_data_files(quadiron::fec::FecCode<T>* fec)
}
}

fec->decode_bufs(d_files, c_files, c_props, r_files);
if (operation_on_packet)
fec->decode_packet(d_files, c_files, c_props, r_files);
else
fec->decode_bufs(d_files, c_files, c_props, r_files);

for (unsigned i = 0; i < fec->n_data; i++) {
if (nullptr != d_files[i]) {
Expand Down Expand Up @@ -354,7 +359,7 @@ void run_fec_rs_fnt(
exit(1);
}
if (rflag) {
if (0 != repair_data_files<T>(fec)) {
if (0 != repair_data_files<T>(fec, true)) {
exit(1);
}
}
Expand Down

0 comments on commit 49de079

Please sign in to comment.