Reduce some if-nesting in ac_encoder_process.