Commit 7adc7193 authored by Li Zetao's avatar Li Zetao Committed by Mauro Carvalho Chehab
Browse files

media: atomisp: use clamp() in ia_css_eed1_8_encode()



When it needs to get a value within a certain interval, using clamp()
makes the code easier to understand than min(max()).

Signed-off-by: default avatarLi Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20240830011752.603433-2-lizetao1@huawei.com


Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 7483ce8f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -276,7 +276,7 @@ ia_css_eed1_8_encode(
	for (i = 0; i < (IA_CSS_NUMBER_OF_DEW_ENHANCE_SEGMENTS - 1); i++) {
		min_exp = max(min_exp, from->dew_enhance_seg_exp[i]);
	}
	to->e_dew_enh_asr = 13 - min(max(min_exp, 0), 13);
	to->e_dew_enh_asr = 13 - clamp(min_exp, 0, 13);

	to->dedgew_max = from->dedgew_max;
}