lkml.org 
[lkml]   [2022]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/1] atomisp: Make bds_factors_list be type of struct u32_fract
On Mon, Nov 21, 2022 at 02:21:30PM +0100, Hans de Goede wrote:
> On 11/18/22 19:43, Andy Shevchenko wrote:

...

> Thanks, patch looks good to me:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>
> I've added this to my media-atomisp branch now and will
> include this in the pull-req which I will send to Mauro after I've
> run some quick tests (tonight or tomorrow).

Thank you!

...

> > res->sc_bayer_origin_x_bqs_on_shading_table =
> > ((left_padding_adjusted_bqs + bad_bqs_on_left_before_bs)
> > - * bs_hor_ratio_out + bs_hor_ratio_in / 2) / bs_hor_ratio_in
> > + * bds.denominator + bds.numerator / 2) / bds.numerator
> > + bad_bqs_on_left_after_bs;
> > - /* "+ bs_hor_ratio_in/2": rounding for division by bs_hor_ratio_in */
> > + /* "+ bds.numerator / 2": rounding for division by bds.numerator */
> > res->sc_bayer_origin_y_bqs_on_shading_table =
> > - (bad_bqs_on_top_before_bs * bs_ver_ratio_out + bs_ver_ratio_in / 2) / bs_ver_ratio_in
> > + (bad_bqs_on_top_before_bs * bds.denominator + bds.numerator / 2) / bds.numerator
> > + bad_bqs_on_top_after_bs;
> > - /* "+ bs_ver_ratio_in/2": rounding for division by bs_ver_ratio_in */
> > + /* "+ bds.numerator / 2": rounding for division by bds.numerator */

While reading this code again I just realized this is open coded
DIV_ROUND_CLOSEST(). But, thinking more, I believe we may rather introduce
the FRACT_DIV_ROUND_CLOSEST() macro in the math.h and take struct *_fract
as a parameter. In any case, it's for the future improvements.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-11-21 14:33    [W:0.035 / U:1.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site