Rate Distortion Optimized Tone Curve for High Dynamic Range Compression