This probably is not ready for review as I am not even sure if it works or compiles.
This patch is an updated version of the svn patch found in T30411
For details on the patch have a look at https://wiki.blender.org/index.php/User:Sobotka/Cubic_B-Spline_Scaling_Algorithm