Algorithmic and architectural design for real-time and power-efficient Retinex image/video processing