More refactoring, remove more #ifdef guards and fix repeat samples for planar formats.