encoder and decoder terminated