Color correction pipeline optimization for digital cameras