/* Convert an integer (30-bit words, little-endian) to unsigned little-endian encoding. The total encoding length is provided; all the destination bytes will be filled.  */
static void le30_to_le8(unsigned char *dst, size_t len, const uint32_t *src)
/* Convert an integer (30-bit words, little-endian) to unsigned little-endian encoding. The total encoding length is provided; all the destination bytes will be filled.  */
static void le30_to_le8(unsigned char *dst, size_t len, const uint32_t *src)
{
	uint32_t acc;
	int acc_len;
	acc = 0;
	acc_len = 0;
	while (len -- > 0) {
		if (acc_len < 8) {
			uint32_t w;
			w = *src ++;
			*dst ++ = (unsigned char)(acc | (w << acc_len));
			acc = w >> (8 - acc_len);
			acc_len += 22;
		} else {
			*dst ++ = (unsigned char)acc;
			acc >>= 8;
			acc_len -= 8;
		}
	}
}