Encoder state is converted to struct.