diff --git a/system/camerad/sensors/os04c10.cc b/system/camerad/sensors/os04c10.cc index 53ac37f08a..5109a28240 100644 --- a/system/camerad/sensors/os04c10.cc +++ b/system/camerad/sensors/os04c10.cc @@ -70,7 +70,7 @@ OS04C10::OS04C10() { }; for (int i = 0; i < 65; i++) { float fx = i / 64.0; - gamma_lut_rgb.push_back((uint32_t)(pow(fx, 0.7)*1023.0 + 0.5)); + gamma_lut_rgb.push_back((uint32_t)((10*fx)/(1+9*fx)*1023.0 + 0.5)); } prepare_gamma_lut(); linearization_lut = { diff --git a/system/camerad/sensors/os04c10_cl.h b/system/camerad/sensors/os04c10_cl.h index 7cfc99655e..e285fb37e0 100644 --- a/system/camerad/sensors/os04c10_cl.h +++ b/system/camerad/sensors/os04c10_cl.h @@ -52,11 +52,7 @@ float3 color_correct(float3 rgb) { } float3 apply_gamma(float3 rgb, int expo_time) { - return powr(rgb, 0.7); -/*float s = log2((float)expo_time); - if (s < 6) {s = fmin(12.0 - s, 9.0);} - // log function adaptive to number of bits - return clamp(log(1 + rgb*(PV_MAX16 - BLACK_LVL)) * (0.48*s*s - 12.92*s + 115.0) - (1.08*s*s - 29.2*s + 260.0), 0.0, 255.0) / 255.0;*/ + return (10 * rgb) / (1 + 9 * rgb); } #endif