linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 1/2] OMAPDSS: DISPC: Update Fir Coefficients
Date: Thu, 15 Dec 2011 08:55:31 +0000	[thread overview]
Message-ID: <1323939331.2010.27.camel@deskari> (raw)
In-Reply-To: <1323838310-4439-1-git-send-email-cmahapatra@ti.com>

[-- Attachment #1: Type: text/plain, Size: 1746 bytes --]

On Wed, 2011-12-14 at 10:21 +0530, Chandrabhanu Mahapatra wrote:

> +const struct dispc_coef *dispc_ovl_get_scale_coef(int inc, int five_taps)
> +{
> +	int i;
> +	static const struct {
> +		int Mmin;
> +		int Mmax;
> +		const struct dispc_coef *coef_3;
> +		const struct dispc_coef *coef_5;
> +	} coefs[] = {
> +		{ 26, 32, coef3_M32, coef5_M32 },
> +		{ 22, 26, coef3_M26, coef5_M26 },
> +		{ 19, 22, coef3_M22, coef5_M22 },
> +		{ 16, 19, coef3_M19, coef5_M19 },
> +		{ 14, 16, coef3_M16, coef5_M16 },
> +		{ 13, 14, coef3_M14, coef5_M14 },
> +		{ 12, 13, coef3_M13, coef5_M13 },
> +		{ 11, 12, coef3_M12, coef5_M12 },
> +		{ 10, 11, coef3_M11, coef5_M11 },
> +		{  9, 10, coef3_M10, coef5_M10 },
> +		{  8,  9,  coef3_M9,  coef5_M9 },
> +		{  3,  8,  coef3_M8,  coef5_M8 },
> +		/*
> +		 * When upscaling more than two times, blockiness and outlines
> +		 * around the image are observed when M8 tables are used. M11,
> +		 * M16 and M19 tables are used to prevent this.
> +		 */
> +		{  2,  3, coef3_M11, coef5_M11 },
> +		{  1,  2, coef3_M16, coef5_M16 },
> +	};
> +
> +	inc /= 128;
> +	for (i = 0; i < ARRAY_LEN(coefs); ++i)
> +		if (inc > coefs[i].Mmin && inc <= coefs[i].Mmax)
> +			return five_taps ? coefs[i].coef_5 : coefs[i].coef_3;
> +	if (inc == 1)
> +		return five_taps ? coef3_M19 : coef5_M19;
> +	return NULL;
> +}

Why don't you handle the inc == 1 case the same as others? Just have an
entry in the table for Mmin=0, Mmax = 1.

Also, I think it's a bit confusing that Mmin is exclusive and Mmax is
inclusive in the comparison. It makes the table a bit hard to read, when
looking at which entry is used for which inc. I'd recommend using
inclusive comparison for both.

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2011-12-15  8:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14  4:53 [PATCH 1/2] OMAPDSS: DISPC: Update Fir Coefficients Chandrabhanu Mahapatra
2011-12-15  8:55 ` Tomi Valkeinen [this message]
2011-12-16  4:58   ` Mahapatra, Chandrabhanu
2011-12-16  8:15     ` Tomi Valkeinen
2011-12-16  8:48       ` Mahapatra, Chandrabhanu

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=1323939331.2010.27.camel@deskari \
    --to=tomi.valkeinen@ti.com \
    --cc=cmahapatra@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@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).