Merge "Enforce trellis optimization for 1-pass encoding" into nextgenv2