#ifndef LDM_H #define LDM_H #include "mem.h" // from /lib/common/mem.h //#include "ldm_params.h" // ============================================================================= // Modify the parameters in ldm_params.h if "ldm_params.h" is included. // Otherwise, modify the parameters here. // ============================================================================= #ifndef LDM_PARAMS_H // Defines the size of the hash table. // Note that this is not the number of buckets. // Currently this should be less than WINDOW_SIZE_LOG + 4. #define LDM_MEMORY_USAGE 23 // The number of entries in a hash bucket. #define HASH_BUCKET_SIZE_LOG 3 // The maximum is 4 for now. // Defines the lag in inserting elements into the hash table. #define LDM_LAG 0 // The maximum window size when searching for matches. // The maximum value is 30 #define LDM_WINDOW_SIZE_LOG 28 // The minimum match length. // This should be a multiple of four. #define LDM_MIN_MATCH_LENGTH 64 // If INSERT_BY_TAG, insert entries into the hash table as a function of the // hash. Certain hashes will not be inserted. // // Otherwise, insert as a function of the position. #define INSERT_BY_TAG 1 // Store a checksum with the hash table entries for faster comparison. // This halves the number of entries the hash table can contain. #define USE_CHECKSUM 1 #endif // Output compression statistics. #define COMPUTE_STATS // Output the configuration. #define OUTPUT_CONFIGURATION // If defined, forces the probability of insertion to be approximately // one per (1 << HASH_ONLY_EVERY_LOG). If not defined, the probability will be // calculated based on the memory usage and window size for "even" insertion // throughout the window. // #define HASH_ONLY_EVERY_LOG 8 // ============================================================================= // The number of bytes storing the compressed and decompressed size // in the header. #define LDM_COMPRESSED_SIZE 8 #define LDM_DECOMPRESSED_SIZE 8 #define LDM_HEADER_SIZE ((LDM_COMPRESSED_SIZE)+(LDM_DECOMPRESSED_SIZE)) #define ML_BITS 4 #define ML_MASK ((1U<