add FME switch logic
Merge pull request #722 from sijchen/fme_merge75

[Encoder ME] add FME switch logic