Apply global encoding