27 template<
typename comp_strategy_t ,
typename coding_strat_t = EncodeStrategy<HuffmanCoder, EliasGammaCoder> >
31 typedef std::tuple<uint,uint,uint> non_term;
32 typedef std::vector<non_term> non_terminal_symbols;
33 typedef std::vector<std::pair<uint,uint>> rules;
39 Meta m(
"compressor",
"lfs_comp",
40 "LFS compression scheme");
43 m.
option(
"computing_strat").
templated<comp_strategy_t>(
"computing_strat");
52 DLOG(INFO) <<
"Compressor instantiated";
59 non_terminal_symbols nts_symbols = non_terminal_symbols();
60 rules dictionary = rules();
63 comp_strategy_t strategy(
env().env_for_option(
"computing_strat"));
67 strategy.compute_rules( in, dictionary, nts_symbols);
69 DLOG(INFO)<<
"dict size: "<<dictionary.size() << std::endl;
70 DLOG(INFO)<<
"symbols:"<<nts_symbols.size()<< std::endl;
88 coding_strat_t coding_strategy(
env().env_for_option(
"coding_strat"));
90 coding_strategy.encode(in, output, dictionary, nts_symbols);
101 coding_strat_t strategy(
env().env_for_option(
"coding_strat"));
103 strategy.decode(input,output);
Contains the text compression and encoding framework.
Base for data compressors.
Env & env()
Provides access to the environment that the algorithm works in.
An abstraction layer for algorithm output.
static void log(const char *key, const T &value)
Logs a user statistic for the current phase.
virtual void compress(Input &input, Output &output) override
Compress the given input to the given output.
static auto wrap(const char *title, F func) -> typename std::result_of< F(StatPhase &)>::type
Executes a lambda as a single statistics phase.
Local environment for a compression/encoding/decompression call.
virtual void decompress(Input &input, Output &output) override
Decompress the given input to the given output.