Trellis Based Quantization using the BCJR Algorithm