Encoder state now stored in a single allocated object