Define encoder_t class