Generalize optimization for intra-only compression.