Efficient Computation Of Viterbi Decoder Reliability With An Application To Variable-Length Coding