Move csum to Decoder, only needs to be allocated once.