Optimize clipping of data