More minor opto.

* Use ints for state machine to avoid indirection through enums.
* Inline transcoding buffer accessors.