proto encoder