Merge "RD costing fix in loop-restoration expt" into nextgenv2