encoder merge