os04c10: 12bit tune (#33947)

* much better

* also isp

---------

Co-authored-by: Comma Device <device@comma.ai>
pull/33948/head
ZwX1616 6 months ago committed by GitHub
parent 3081dca9e5
commit c3ca9a26c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      system/camerad/sensors/os04c10.cc
  2. 6
      system/camerad/sensors/os04c10_cl.h

@ -70,7 +70,7 @@ OS04C10::OS04C10() {
}; };
for (int i = 0; i < 65; i++) { for (int i = 0; i < 65; i++) {
float fx = i / 64.0; 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(); prepare_gamma_lut();
linearization_lut = { linearization_lut = {

@ -52,11 +52,7 @@ float3 color_correct(float3 rgb) {
} }
float3 apply_gamma(float3 rgb, int expo_time) { float3 apply_gamma(float3 rgb, int expo_time) {
return powr(rgb, 0.7); return (10 * rgb) / (1 + 9 * rgb);
/*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;*/
} }
#endif #endif

Loading…
Cancel
Save