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

Add a test encoder taking LZ matches as input #24

Open
gendx opened this issue Dec 21, 2019 · 0 comments
Open

Add a test encoder taking LZ matches as input #24

gendx opened this issue Dec 21, 2019 · 0 comments

Comments

@gendx
Copy link
Owner

gendx commented Dec 21, 2019

The current dumb encoder only generates a sequence of byte literals to be encoded one by one. This makes it hard to unit test decoding of LZ matches (distance + length).

Although finding matches in real inputs is a non-trivial task (#9), there could be some "synthetic" encoder taking as input a sequence of already prepared matches.

Something like the following.

enum LZMAElement {
    Literal(u8),
    Match(usize, usize),
}

fn compress(input: impl Iterator<Item=LZMAElement>) {
    /* TODO */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant