Fast Template Evaluation with Vector Quantization