Viterbi decoding compatible with our model