Exploiting spatial and temporal redundancies for vector quantization of speech and images