extracted 2nd rle encoder