Rate distortion theory calculates the minimum bit rate R needed to represent a source within a given distortion D. Scalar quantization maps samples to reconstruction levels, minimizing the distortion between original and reconstructed values. Optimal quantizers like Lloyd-Max iteratively assign samples to levels and update levels to centroids. Entropy-constrained quantization assigns variable length codes to levels to minimize a rate-distortion cost function.