encoder: inline and make private helpers
encoder: suppress warnings