Refactored AAC encoder selection code.