linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Longerbeam <slongerbeam@gmail.com>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	linux-media <linux-media@vger.kernel.org>
Subject: Re: IMX CSI capture issues with tda1997x HDMI receiver
Date: Sun, 3 Feb 2019 11:37:11 -0800	[thread overview]
Message-ID: <11700f2a-cc27-782a-2524-ecd8249fd65d@gmail.com> (raw)
In-Reply-To: <7cfe3570-64e5-d5e3-aeaf-35253c0fa918@gmail.com>

Hi Tim, cc: Philipp,

On 2/2/19 11:10 AM, Steve Longerbeam wrote:
>
> <snip>
> On 1/30/19 5:18 PM, Tim Harvey wrote:
>
>> # stream upscale via mem2mem then JPEG/RTP/UDP
>> gst-launch-1.0 v4l2src device=/dev/video4 ! \
>>    v4l2video8convert ! video/x-raw,width=1280,height=720 ! \
>>    jpegenc ! rtpjpegpay ! udpsink host=172.24.20.19 port=5000
>> ERROR: from element
>> /GstPipeline:pipeline0/v4l2video8convert:v4l2video8convert0: Device
>> '/dev/video8' does not support 2:4:7:1 colorimetry
>> # ^^^ fails because mem2mem doesn't support itu601
>> # stream H264/RTP/UDP
>> gst-launch-1.0 v4l2src device=/dev/video4 ! \
>>    v4l2h264enc output-io-mode=dmabuf-import ! \
>>    rtph264pay ! udpsink host=172.24.20.19 port=5001
>> ERROR: from element /GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0:
>> Device '/dev/video9' does not support 2:4:7:1 colorimetry
>> # ^^^ coda has same issue... can't del with itu601
>
> Well, just to see things working, try hacking 
> imx_media_fill_default_mbus_fields() to set Rec. 709 encoding:
>
> --- a/drivers/staging/media/imx/imx-media-utils.c
> +++ b/drivers/staging/media/imx/imx-media-utils.c
> @@ -571,7 +571,7 @@ void imx_media_fill_default_mbus_fields(struct 
> v4l2_mbus_framefmt *tryfmt,
>                 tryfmt->quantization = is_rgb ?
>                         V4L2_QUANTIZATION_FULL_RANGE :
>                         V4L2_QUANTIZATION_LIM_RANGE;
> -               tryfmt->ycbcr_enc = V4L2_YCBCR_ENC_601;
> +               tryfmt->ycbcr_enc = V4L2_YCBCR_ENC_709;
>         }
>  }
>  EXPORT_SYMBOL_GPL(imx_media_fill_default_mbus_fields);
>
>
> But of course that's not technically correct because the encoding in 
> ipu-ic.c is BT.601.
>
> The *real* way to fix this would be to allow programmable encodings in 
> ipu-ic.c. But unfortunately the encodings are hardcoded (grep for 
> ic_csc_rgb2ycbcr in ipu-ic.c).

I went ahead and implemented this!

The IC will now support both BT.601 and BT.709 encoding. I will post a 
patchset, please test!


>>
>> Am I perhaps missing a capsfilter to get the mem2mem driver to convert
>> the colorspace properly? If so, they the mem2mem driver could be used
>> to correct the colorspace to get IC output to coda working.
>
> Well, first I don't think the mem2mem driver is using the correct 
> encoding. The mem2mem driver is making use of the IC encoding so it 
> should be reporting and accepting only BT.601.

The mem2mem driver can now require BT.709 and/or BT.601 encoding with 
the above patchset.

Steve


  reply	other threads:[~2019-02-03 19:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23 23:21 IMX CSI capture issues with tda1997x HDMI receiver Tim Harvey
2019-01-25 23:57 ` Steve Longerbeam
2019-01-27 22:36   ` Steve Longerbeam
2019-01-28 19:14     ` Tim Harvey
2019-01-28 23:05       ` Steve Longerbeam
2019-01-28 19:03   ` Tim Harvey
2019-01-28 23:04     ` Steve Longerbeam
2019-01-31  1:18       ` Tim Harvey
2019-02-02 19:10         ` Steve Longerbeam
2019-02-03 19:37           ` Steve Longerbeam [this message]
2019-02-05 19:16           ` Tim Harvey
2019-02-05 23:52             ` Steve Longerbeam
2019-02-06 16:31               ` Tim Harvey
2019-02-08  1:15                 ` Tim Harvey
2019-02-08  1:53                   ` Steve Longerbeam
2019-02-08 21:23                     ` Tim Harvey
2019-02-08 23:22                       ` Steve Longerbeam
2019-02-11 17:13                         ` Tim Harvey
2019-02-08  1:48                 ` Steve Longerbeam

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=11700f2a-cc27-782a-2524-ecd8249fd65d@gmail.com \
    --to=slongerbeam@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=tharvey@gateworks.com \
    /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).