Fix encode regression with GPU processing.