All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Ezequiel Garcia <ezequiel@collabora.com>,
	Nicolas Dufresne <nicolas@ndufresne.ca>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [RFC] V4L2_PIX_FMT_MJPEG vs V4L2_PIX_FMT_JPEG
Date: Mon, 01 Oct 2018 20:09:53 +0300	[thread overview]
Message-ID: <2837034.jU5LiXlfQ2@avalon> (raw)
In-Reply-To: <0ea4fe85-508a-8a9d-0abe-7ae06b0146d3@xs4all.nl>

Hi Hans,

On Monday, 1 October 2018 19:28:58 EEST Hans Verkuil wrote:
> On 10/01/2018 06:12 PM, Ezequiel Garcia wrote:
> > On Mon, 2018-10-01 at 08:42 -0400, Nicolas Dufresne wrote:
> >> Le lundi 01 octobre 2018 à 10:43 +0200, Hans Verkuil a écrit :
> >>> It turns out that we have both JPEG and Motion-JPEG pixel formats
> >>> defined.
> >>> 
> >>> Furthermore, some drivers support one, some the other and some both.
> >>> 
> >>> These pixelformats both mean the same.
> >>> 
> >>> I propose that we settle on JPEG (since it seems to be used most often)
> >>> and add JPEG support to those drivers that currently only use MJPEG.
> >> 
> >> Thanks for looking into this. As per GStreamer code, I see 3 alias for
> >> JPEG. V4L2_PIX_FMT_MJPEG/JPEG/PJPG. I don't know the context, this code
> >> was written before I knew GStreamer existed. It's possible there is a
> >> subtle difference, I have never looked at it, but clearly all our JPEG
> >> decoder handle these as being the same.
> >> 
> >> https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/sys/v4l2/gst
> >> v4l2object.c#n956
> > 
> > To add more data points on the gstreamer side, there's really no
> > difference between gstreamer's types image/jpeg and video/x-jpeg.
> > 
> > Notably, jpegdec element just stuffs a huffman table if one is missing,
> > for any jpeg:
> > 
> > https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/ext/jpeg/gstj
> > pegdec.c#n584
> 
> lib/libv4lconvert/libv4lconvert.c also treats JPEG and MJPEG the same.
> 
> It looks like JPEG and MJPEG are randomly used and I don't think you can
> assume that one will have a huffman table and not the other.

That at least should be fixed. If we decide that whether the frames will 
contain a Huffman table or not is useful information for userspace, then we 
should convey it, either through the current mechanism (JPEG vs. MJPEG) or 
through a different mechanism. Otherwise, we can merge JPEG and MJPEG (as long 
as it doesn't break userspace).

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2018-10-01 23:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01  8:43 [RFC] V4L2_PIX_FMT_MJPEG vs V4L2_PIX_FMT_JPEG Hans Verkuil
2018-10-01 11:48 ` Laurent Pinchart
2018-10-01 11:54   ` Hans Verkuil
2018-10-01 12:03     ` Laurent Pinchart
2018-10-01 16:31       ` Ezequiel Garcia
2018-10-01 17:19         ` Dave Stevenson
2018-10-05 11:55           ` Mauro Carvalho Chehab
2018-10-05 12:58             ` Hans de Goede
2018-10-01 12:42 ` Nicolas Dufresne
2018-10-01 13:33   ` Laurent Pinchart
2018-10-01 16:12   ` Ezequiel Garcia
2018-10-01 16:28     ` Hans Verkuil
2018-10-01 17:09       ` Laurent Pinchart [this message]
2018-10-05 11:52   ` Mauro Carvalho Chehab

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=2837034.jU5LiXlfQ2@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=ezequiel@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=nicolas@ndufresne.ca \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.