All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: libv4lconvert: fix RGB32 conversion
Date: Sun, 20 Jul 2014 16:28:03 +0200	[thread overview]
Message-ID: <53CBD1F3.3020907@redhat.com> (raw)
In-Reply-To: <53CA74B8.2070506@xs4all.nl>

Hi,

On 07/19/2014 03:38 PM, Hans Verkuil wrote:
> On 07/19/2014 02:37 PM, Hans de Goede wrote:
>> Hi,
>>
>> On 07/19/2014 09:18 AM, Hans Verkuil wrote:
>>> The RGB32 formats start with an alpha byte in memory. So before calling the
>>> v4lconvert_rgb32_to_rgb24 or v4lconvert_rgb24_to_yuv420 function skip that initial
>>> alpha byte so the src pointer is aligned with the first color component, since
>>> that is what those functions expect.
>>>
>>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>>>
>>> diff --git a/lib/libv4lconvert/libv4lconvert.c b/lib/libv4lconvert/libv4lconvert.c
>>> index cea65aa..e4aa54a 100644
>>> --- a/lib/libv4lconvert/libv4lconvert.c
>>> +++ b/lib/libv4lconvert/libv4lconvert.c
>>> @@ -1132,6 +1132,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data,
>>>   			errno = EPIPE;
>>>   			result = -1;
>>>   		}
>>> +		src++;
>>
>> Hmm what about bgr versus rgb, since those are mirrored, maybe the location of
>> the alpha byte is mirrored to, and we should only do the src++ for one of them ?
> 
> Uh, that's what I do. Only for the RGB32 pixformats does the src have to be
> increased by one. The BGR32 pixformats have the alpha at the end, so there is
> no need to increment src.

Duh, I did not look closely enough, so the original patch is:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Feel free to push it.

Regards,

Hans

      reply	other threads:[~2014-07-20 14:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-19  7:18 libv4lconvert: fix RGB32 conversion Hans Verkuil
2014-07-19 12:37 ` Hans de Goede
2014-07-19 13:38   ` Hans Verkuil
2014-07-20 14:28     ` Hans de Goede [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=53CBD1F3.3020907@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@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 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.