Splitted quantize and shrinkage code.