Merge "Fix an encoding failure case when speed features are on" into nextgenv2