RLE optimization