PCM code optimization