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 handling of encodings others than binary #175

Open
retokromer opened this issue Jan 26, 2018 · 3 comments
Open

add handling of encodings others than binary #175

retokromer opened this issue Jan 26, 2018 · 3 comments
Labels
enhancement Add more content to the document, explaning more things format addition To consider in future EBML versions

Comments

@retokromer
Copy link
Contributor

Add a vector in the specification, which allows to define other encodings than binary, like the Gray codes.

@robUx4 robUx4 added enhancement Add more content to the document, explaning more things format addition To consider in future EBML versions labels Feb 11, 2018
@retokromer
Copy link
Contributor Author

For the example I presented in Vienna (I guess it’s the simplest one), the conversion Gray to binary would be:

b3 = g3
b2 = b3 ⊕ g2
b1 = b2 ⊕ g1
b0 = b1 ⊕ g0

or:

unsigned int Gray_to_Bin(unsigned int g) {
    num = g ^ (g >> 32);
    num = g ^ (g >> 16);
    num = g ^ (g >> 8);
    num = g ^ (g >> 4);
    num = g ^ (g >> 2);
    num = g ^ (g >> 1);
    return g;
}

and binary to Gray:

g3 = b3
g2 = b3 ⊕ b2
g1 = b2 ⊕ b1
g0 = b1 ⊕ b0

or:

unsigned int Bin_to_Gray(unsigned int b) {
    return b ^ (b >> 1);
}

@robUx4
Copy link
Contributor

robUx4 commented Apr 15, 2018

Would that be for the integers stored in EBML or the EBML ID and Length fields ? In any case must cover more than 32 bits values.

@retokromer
Copy link
Contributor Author

We must indeed cover more than 32-bit values. This is just the example I presented in Vienna in order to explain the idea. And yes this are integers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Add more content to the document, explaning more things format addition To consider in future EBML versions
Projects
None yet
Development

No branches or pull requests

2 participants