This is a really dumb algorithm but is simple to understand for unit testing purposes. It counts the number of consecutive bytes with the same value, and then stores the number of bytes with that value, and the byte value itself. For example: 0xA1 0xA1 0xA2 0xA3 0xA3 0xA3 0xA3 0xA3 0xA3 would be compressed to: 0x02 0xA1 0x01 0xA2 0x06 0xA3 This will make it easy to generate specific data sequences that compress to specific sizes to validate the different compression paths through the reduce library. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I0d48f98c080b9cdacb25433f53f44df7ada78c0a Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449072 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> |
||
---|---|---|
.. | ||
.gitignore | ||
Makefile | ||
reduce_ut.c |