RLE encoder source code