From 6b46fe6ee0f96fa89408e63e87dcfc2f71e829bc Mon Sep 17 00:00:00 2001 From: ZwX1616 Date: Mon, 26 Oct 2020 14:49:28 -0700 Subject: [PATCH] restore behavior (#2418) old-commit-hash: d7052094c453220491056abbb8a9155734b71aa4 --- selfdrive/camerad/cameras/camera_common.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/camerad/cameras/camera_common.cc b/selfdrive/camerad/cameras/camera_common.cc index ac44903f51..47120bcde3 100644 --- a/selfdrive/camerad/cameras/camera_common.cc +++ b/selfdrive/camerad/cameras/camera_common.cc @@ -293,7 +293,8 @@ void set_exposure_target(CameraState *c, const uint8_t *pix_ptr, bool front, int uint8_t lum = pix_ptr[(y * b->yuv_width) + x]; lum_binning[lum]++; } else { - const uint8_t *pix = &pix_ptr[y * b->rgb_width * 3 + x * 3]; + // TODO: should get rid of RGB here + const uint8_t *pix = &pix_ptr[y * b->rgb_stride + x * 3]; unsigned int lum = (unsigned int)(pix[0] + pix[1] + pix[2]); lum_binning[std::min(lum / 3, 255u)]++; }