Here's how to compress greyscale image bytes using dcode4:
static void foo(byte* data, int bytes) {
byte cenoded[bytes * 2];
int k = encode4(data, bytes, coded, sizeof(encoded));
byte decoded[bytes];
int n = decode4(encoded, k, decoded, sizeof(decoded));