linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH v3 4/5] media: vsp1: Split out pre-filter multiplier
Date: Fri, 10 May 2019 12:15:51 +0100	[thread overview]
Message-ID: <c6222a3f-ea53-e147-7269-e6113be38520@ideasonboard.com> (raw)
In-Reply-To: <20190418063754.GH4806@pendragon.ideasonboard.com>

Hi Laurent

On 18/04/2019 07:37, Laurent Pinchart wrote:
> Hi Kieran,
> 
> Thank you for the patch.
> 
> On Thu, Apr 11, 2019 at 05:12:55PM +0100, Kieran Bingham wrote:
>> The 'mp' value is used through many calculations in determining the scaling
>> factors of the UDS. Factor this out so that it can be reused in further
>> calculations, and also ensure that if the BLADV control is ever changed only a
>> single function needs to be modified.
>>
>> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
>> ---
>>  drivers/media/platform/vsp1/vsp1_uds.c | 22 ++++++++++++++--------
>>  1 file changed, 14 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/media/platform/vsp1/vsp1_uds.c b/drivers/media/platform/vsp1/vsp1_uds.c
>> index 27012af973b2..c71c24363d54 100644
>> --- a/drivers/media/platform/vsp1/vsp1_uds.c
>> +++ b/drivers/media/platform/vsp1/vsp1_uds.c
>> @@ -46,6 +46,18 @@ void vsp1_uds_set_alpha(struct vsp1_entity *entity, struct vsp1_dl_body *dlb,
>>  		       alpha << VI6_UDS_ALPVAL_VAL0_SHIFT);
>>  }
>>  
>> +/*
>> + * Determine the pre-filter multiplication value.
> 
> This would benefit from a more detailed description, and in particular a
> definition of what "pre-filter" means.

There is a pre-filter processing stage to the scaling filter. I think it
does some form of pixel binning. The specifics are not documented.

I could update this to:

/*
 * Determine the pre-filter binning divider
 *
 * The UDS uses a two stage filter scaler process. This determines the
 * rate at which pixels are reduced for large down-scaling ratios before
 * being fed into the bicubic filter.
 */

>> + *
>> + * This calculation assumes that the BLADV control is unset.
> 
> s/control/bit/ ?
> s/unset/not set/ ?
> 

Sure.

>> + */
>> +static unsigned int uds_multiplier(int ratio)
> 
> Should the function be renamed to uds_pre_multiplier() ? And isn't it a
> divisor ? :-)

Indeed in the pipeline, the component is used when  downscaling, and so
I believe it is part of a pre-filter divider.

How about: uds_binning_ratio() ?




>> +{
>> +	unsigned int mp = ratio / 4096;
>> +
>> +	return mp < 4 ? 1 : (mp < 8 ? 2 : 4);
>> +}
>> +
>>  /*
>>   * uds_output_size - Return the output size for an input size and scaling ratio
>>   * @input: input size in pixels
>> @@ -55,10 +67,7 @@ static unsigned int uds_output_size(unsigned int input, unsigned int ratio)
>>  {
>>  	if (ratio > 4096) {
>>  		/* Down-scaling */
>> -		unsigned int mp;
>> -
>> -		mp = ratio / 4096;
>> -		mp = mp < 4 ? 1 : (mp < 8 ? 2 : 4);
>> +		unsigned int mp = uds_multiplier(ratio);
>>  
>>  		return (input - 1) / mp * mp * 4096 / ratio + 1;
>>  	} else {
>> @@ -88,10 +97,7 @@ static unsigned int uds_passband_width(unsigned int ratio)
>>  {
>>  	if (ratio >= 4096) {
>>  		/* Down-scaling */
>> -		unsigned int mp;
>> -
>> -		mp = ratio / 4096;
>> -		mp = mp < 4 ? 1 : (mp < 8 ? 2 : 4);
>> +		unsigned int mp = uds_multiplier(ratio);
>>  
>>  		return 64 * 4096 * mp / ratio;
>>  	} else {
> 
--
Regards

Kieran



  reply	other threads:[~2019-05-10 11:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 16:12 [PATCH v3 0/5] media: vsp1: Phased partition overlap support Kieran Bingham
2019-04-11 16:12 ` [PATCH v3 1/5] media: vsp1: Define partition algorithm helper Kieran Bingham
2019-04-18  6:30   ` Laurent Pinchart
2019-04-11 16:12 ` [PATCH v3 2/5] media: vsp1: Initialise partition windows Kieran Bingham
2019-04-18  6:32   ` Laurent Pinchart
2019-05-07 10:20     ` Kieran Bingham
2019-04-11 16:12 ` [PATCH v3 3/5] media: vsp1: Document partition algorithm in code header Kieran Bingham
2019-04-18  6:33   ` Laurent Pinchart
2019-05-07 10:22     ` Kieran Bingham
2019-04-11 16:12 ` [PATCH v3 4/5] media: vsp1: Split out pre-filter multiplier Kieran Bingham
2019-04-18  6:37   ` Laurent Pinchart
2019-05-10 11:15     ` Kieran Bingham [this message]
2019-04-11 16:12 ` [PATCH v3 5/5] media: vsp1: Provide partition overlap algorithm Kieran Bingham
2019-04-18 12:42   ` Laurent Pinchart
2019-05-13 15:32     ` Kieran Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6222a3f-ea53-e147-7269-e6113be38520@ideasonboard.com \
    --to=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).