diff --git a/misc/run_length_encoding b/misc/run_length_encoding deleted file mode 100755 index b3229343..00000000 Binary files a/misc/run_length_encoding and /dev/null differ diff --git a/misc/run_length_encoding.c b/misc/run_length_encoding.c index 9857f499..bb6ca3df 100644 --- a/misc/run_length_encoding.c +++ b/misc/run_length_encoding.c @@ -2,12 +2,21 @@ * @file * @author [serturx](https://github.com/serturx/) * @brief Encode a null terminated string using [Run-length encoding](https://en.wikipedia.org/wiki/Run-length_encoding) + * @section Description + * Run-length encoding is a lossless compression algorithm. + * It works by counting the consecutive occurences symbols + * and encodes that series of consecutive symbols into the + * counted symbol and a number denoting the number of + * consecutive occorences. + * + * For example the string "AAAABBCCD" gets encoded into "4A2B2C1D" + * */ -#include -#include -#include -#include +#include //For printf +#include //For string functions like strlen +#include //For malloc/free +#include //For assert /** * @brief Encodes a null-terminated string using run-length encoding