libfreerdp-codec: separate tile encoding from writing