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

Compact format for blocks with metadata #268

Open
lamphamsy opened this issue Dec 14, 2018 · 0 comments
Open

Compact format for blocks with metadata #268

lamphamsy opened this issue Dec 14, 2018 · 0 comments

Comments

@lamphamsy
Copy link
Contributor

It focuses on FNT(q = 2^p + 1).
Given a block of n symbols of FNT(q), a metadata part should indicate indices of all symbols whose value = 2^p.
If these symbols are uniformly distributed, we can use the frequency of 2^p to determine the size of metadata.
For general cases, the naive approach needs n indicators for n elements, i.e. metadata size = n.

For FNT(65537), the following approach results to metadata of only one indicator.
The indicator contains the index, e.g. i, of the first symbol = 2^p. Then the ith symbol will be used to contain index of the next symbol 2^p, and so on. If there is no more symbol 2^p, this symbol will be zero.

Example,
data = [1, 2, 65536, 3, 4, 65536, 5, 6, 7]
=> metadata = [2]
data = [1, 2, 5, 3, 4, 0, 5, 6, 7]

The approach can be used for FNT(257) for n < 257.

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

No branches or pull requests

1 participant