Optimal and Near-Optimal Adaptive Vector Quantization