public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: jean-philippe francois <jp.francois@cynove.com>
Cc: linux-media <linux-media@vger.kernel.org>, linux-omap@vger.kernel.org
Subject: Re: OMAP3 previewer bayer pattern selection
Date: Wed, 02 May 2012 13:15:37 +0200	[thread overview]
Message-ID: <3183330.bDB7oJcFEp@avalon> (raw)
In-Reply-To: <CAGGh5h01=YdRtmhe1pXpvmXSPP5e1UPBtqGbN3c2tTbjdmEtVw@mail.gmail.com>

Hi Jean-Philippe,

On Monday 30 April 2012 12:23:27 jean-philippe francois wrote:
> Hi,
> 
> I am trying to get a working preview from a CMOS sensor with a CFA bayer
> pattern.
> 
> Does the CCDC_COLPTN register have any effect on previewer CFA interpolation
> ?

No it doesn't. The CCDC COLPTN register only affects CCDC operation.

> From my experience it does not. I can set BGGR or GRBG, but the output is
> always the same. When doing raw capture, I get nice image if I use a BGGR
> pattern for my software bayer to rgb interpolation. When using previewer,
> the output looks like BGGR interpreted as GRBG, ie blue and red are green,
> and green turns into purple.
> 
> Looking at the driver code (mainline), there is nothing about bayer order
> in the previewer code. Looking at the TRM, theres is also nothing in the
> previewer part about bayer order.
> 
> How are we supposed to debayer something different from GRBG ? By modifying
> the cfa_coef_table table ? Cropping at the previewer output to start on an
> odd line ?

Selecting the CFA pattern requires modifying several registers:

- PCR:CFA_FMT

0x0: Mode 0: conventional Bayer.
0x1: Mode 1: horizontal 2x downsample.
0x2: Mode 2: bypass CFA stage (RGB Foveon X3)
0x3: Mode 3: horizontal and vertical 2x downsample.
0x4: Mode 4: Super CCD Honeycom movie mode sensor.
0x5: Mode5: bypass CFA stage (RRRR GGGG BBBB Foveon X3).

The default value is Bayer, you won't need to change that.

- WBSEL

This register selects which white balance coefficient is applied to which 
pixel. This needs to match the Bayer pattern.

- CFA table

That's where the bulk of the work will be. The CFA coefficients table needs to 
be adjusted based on the Bayer pattern. Unfortunately the publicly available 
TRM doesn't document how the table should be computed.

> Thank you for any pointer on this issue.

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2012-05-02 11:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30 10:23 OMAP3 previewer bayer pattern selection jean-philippe francois
2012-05-02 11:15 ` Laurent Pinchart [this message]

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=3183330.bDB7oJcFEp@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=jp.francois@cynove.com \
    --cc=linux-media@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