mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
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: Li Zetao <lizetao1@huawei.com> Link: https://lore.kernel.org/r/20240830011752.603433-2-lizetao1@huawei.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
7483ce8fc7
commit
7adc719353
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user