You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possibile to define a codec starting from a pre-made table of symbols, prefixes and values? I don't have frequencies, etc., I have just a table like the one attached below.
I inspected the pickle objects provided for predefined frequency tables (json, xml, etc.); I think that I can manage to create the code_table part, but cannot figure how to build type, concat and metadata. It would nice if I can just declare a dictionary or something like this in the code, instead of integrating a pickle object into the library.
P.S. the table above is the default Huffman table used to compress electrocardiography data using the SCP-ECG standard.
The text was updated successfully, but these errors were encountered:
yes it's possible when you use PrefixCodec, which is the parent class of HuffmanCodec.
The latter actually just takes care of converting the frequency table to a prefix code table, the former takes care of the prefix code encoding and decoding.
when you have for example this code table (based on your screenshot):
A problem might be that the current implementation requires you to have an "end of file" (eof) symbol in the table, which is used to mark the end of the bit stream when it does not align properly with byte boundaries. In this example I used symbol 6 as eof.
Is it possibile to define a codec starting from a pre-made table of symbols, prefixes and values? I don't have frequencies, etc., I have just a table like the one attached below.
I inspected the pickle objects provided for predefined frequency tables (json, xml, etc.); I think that I can manage to create the code_table part, but cannot figure how to build type, concat and metadata. It would nice if I can just declare a dictionary or something like this in the code, instead of integrating a pickle object into the library.
P.S. the table above is the default Huffman table used to compress electrocardiography data using the SCP-ECG standard.
The text was updated successfully, but these errors were encountered: