Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systematic FNT #239

Merged
merged 15 commits into from
Oct 5, 2018
Merged

Systematic FNT #239

merged 15 commits into from
Oct 5, 2018

Conversation

lamphamsy
Copy link
Contributor

@lamphamsy lamphamsy commented Aug 31, 2018

Add encode/decode for systematic FNT codes

@lamphamsy lamphamsy added the WIP Work In Progress label Aug 31, 2018
@vrancurel
Copy link
Contributor

amazing !

Copy link
Contributor

@slaperche-scality slaperche-scality left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We introduced a lot of if (type == FecType::SYSTEMATIC) in the code, maybe it would be worth it to make the FEC type a template parameter (you're unlikely to change the code type at runtime, after instantiating the object anyway), that would allow to specialize the code (less branch, more efficient/readable code).

To be investigated in another PR maybe.

src/fft_naive.h Outdated
{
fft_inv(output, input);

/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be replaced by a single line comment: // We need to divide output to N for the inverse formular.

src/fft_2n.h Outdated
@@ -328,7 +329,13 @@ void Radix2<T>::fft_inv(vec::Buffers<T>& output, vec::Buffers<T>& input)
}

// copy input to output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment can be removed, seeing that you're using the method copy, I think it's obvious.


if (type == FecType::SYSTEMATIC) {
this->fft->fft(*dec_inter_codeword, output);
for (unsigned i = 0; i < this->n_data; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really should use size_t here, especially on 64-bit.

I think after this PR you need to tackle #243 next.

src/fec_rs_fnt.h Outdated
private:
// buffers for intermediate symbols used for systematic FNT
std::unique_ptr<vec::Buffers<T>> inter_words;
// buffers for suffix symbols of cocdewords used for systematic FNT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a cocdewords? Did you mean codewords or codecwords ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it should be codewords :)

@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use curly braces (I haven't enable the linter for this, but it will come one day/soon).

    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); 
    }

@@ -50,7 +50,7 @@ void RsFnt<uint16_t>::encode_post_process(
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit should either have a proper commit message, or be squashed with the commit that introduced the bug.

Commit without proper commit message are just polluting the git log and makes git blame less useful to understand a code base.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be squashed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will rewrite the commit message :)

src/fec_rs_fnt.h Outdated

if (this->type == FecType::SYSTEMATIC) {
// for encoding
enc_frag_ids = std::unique_ptr<vec::Vector<T>>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If my PR to bump to C++14 is merged, you can use make_unique instead

@lamphamsy lamphamsy force-pushed the eh/decoding branch 3 times, most recently from 79f6c83 to e0a618e Compare September 28, 2018 15:37
@lamphamsy lamphamsy changed the base branch from eh/decoding to master October 5, 2018 08:28
@lamphamsy lamphamsy force-pushed the ft/systematic branch 3 times, most recently from 99b94e1 to 1ff011b Compare October 5, 2018 09:41
@lamphamsy
Copy link
Contributor Author

lamphamsy commented Oct 5, 2018

I've just rebased + squashed commits

@lamphamsy lamphamsy merged commit 816b634 into master Oct 5, 2018
@lamphamsy lamphamsy deleted the ft/systematic branch October 5, 2018 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants