Tool/software:
Hi Gang Hua,
We are looking into parsing H3a data before feeding to Auto exposure. We need couple of clarifications on this regard.
In file imaging/kernels/aewb/arm/vx_aewb_target.c, In below function. Ti is Doing Avg of gr and gb values .However, we didn't get why +1 , you guys are doing (sum_gr + sum_gb + 1) >> 1).can you please explain ?Please refer below higlighted code.
static void parse_h3a_out(uint8_t h3a_buf[], int32_t n_col, int32_t n_row,
int32_t id_r, int32_t id_gr, int32_t id_gb, int32_t id_b,
h3a_aewb_paxel_data_t *h3a_data)
{
uint8_t * cur_addr = h3a_buf;
int n_win = 0;
int j, i;
for (j = 0; j < n_row; j++)
{
for (i = 0; i < n_col; i++)
{
uint16_t * pAewbWinData = (uint16_t *)cur_addr;
uint32_t sum_gr = pAewbWinData[id_gr];
uint32_t sum_gb = pAewbWinData[id_gb];
uint16_t sum_g = (uint16_t)((sum_gr + sum_gb + 1) >> 1);
h3a_data[j * n_col + i].green = sum_g;
h3a_data[j * n_col + i].red = pAewbWinData[id_r];
h3a_data[j * n_col + i].blue = pAewbWinData[id_b];
cur_addr += sizeof(uint16_t) * 8;
n_win++;
if (n_win % 8 == 0)
{
cur_addr += sizeof(uint16_t) * 8;
}
}
if ((cur_addr - h3a_buf) % 32 == 16)
{
cur_addr += 16;
}
}
}
Regards
Sriharsha