transform: Fix function prototypes
transform: Staticize
transform: Simplify qp_scaled computation