-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add zlib compress (which is surprisingly fast)
- Loading branch information
Showing
9 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
[submodule "lib/heatshrink"] | ||
path = lib/heatshrink | ||
url = https://github.com/kripton/heatshrink.git | ||
[submodule "lib/snappy"] | ||
path = lib/snappy | ||
url = https://github.com/kripton/snappy.git | ||
[submodule "lib/zstd"] | ||
path = lib/zstd | ||
url = https://github.com/kripton/zstd.git | ||
[submodule "lib/zlib"] | ||
path = lib/zlib | ||
url = https://github.com/kripton/zlib.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,4 +71,4 @@ void heatshrink_uncompress(uint8_t *input, size_t insize, uint8_t *output, size_ | |
} | ||
|
||
*outsize = polled; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "algo-zlib.h" | ||
|
||
#include "../lib/zlib/zlib.h" | ||
|
||
void zlib_init() | ||
{ | ||
} | ||
|
||
void zlib_compress(uint8_t *input, size_t insize, uint8_t *output, size_t *outsize) | ||
{ | ||
long unsigned int outsize2 = *outsize; | ||
compress2(output, &outsize2, input, insize, 4); | ||
*outsize = outsize2; | ||
} | ||
|
||
void zlib_uncompress(uint8_t *input, size_t insize, uint8_t *output, size_t *outsize) | ||
{ | ||
long unsigned int outsize2 = *outsize; | ||
uncompress(output, &outsize2, input, insize); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef __ALGO_ZLIB_H__ | ||
#define __ALGO_ZLIB_H__ | ||
|
||
#include "pico/stdlib.h" | ||
|
||
void zlib_init(); | ||
void zlib_compress(uint8_t* input, size_t insize, uint8_t* output, size_t* outsize); | ||
void zlib_uncompress(uint8_t* input, size_t insize, uint8_t* output, size_t* outsize); | ||
|
||
#endif // __ALGO_ZLIB_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters