From: Gregor Jasny <gjasny@googlemail.com>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/2] libv4lconvert: Support for RGB32 and BGR32 format
Date: Sat, 03 Aug 2013 00:15:20 +0200 [thread overview]
Message-ID: <51FC2F78.1000902@googlemail.com> (raw)
In-Reply-To: <1375362294-30741-3-git-send-email-ricardo.ribalda@gmail.com>
Hello,
On 8/1/13 3:04 PM, Ricardo Ribalda Delgado wrote:
> --- a/lib/libv4lconvert/libv4lconvert-priv.h
> +++ b/lib/libv4lconvert/libv4lconvert-priv.h
> @@ -108,7 +108,7 @@ unsigned char *v4lconvert_alloc_buffer(int needed,
> int v4lconvert_oom_error(struct v4lconvert_data *data);
>
> void v4lconvert_rgb24_to_yuv420(const unsigned char *src, unsigned char *dest,
> - const struct v4l2_format *src_fmt, int bgr, int yvu);
> + const struct v4l2_format *src_fmt, int bgr, int yvu, int rgb32);
>
> void v4lconvert_yuv420_to_rgb24(const unsigned char *src, unsigned char *dst,
> int width, int height, int yvu);
> @@ -47,9 +47,15 @@ void v4lconvert_rgb24_to_yuv420(const unsigned char *src, unsigned char *dest,
> RGB2Y(src[2], src[1], src[0], *dest++);
> else
> RGB2Y(src[0], src[1], src[2], *dest++);
> - src += 3;
> + if (rgb32)
> + src += 4;
> + else
> + src += 3;
Instead of passing a 0/1 flag here I would call this variable
bits_per_pixel or bpp and pass 3 or 4 here. This would reduce the if
condition ugliness.
Thanks,
Gregor
next prev parent reply other threads:[~2013-08-02 22:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 13:04 [PATCH 0/2] Add support for V4L2_PIX_FMT_Y16, V4L2_PIX_FMT_RGB32 and V4L2_PIX_FMT_BGR32 Ricardo Ribalda Delgado
2013-08-01 13:04 ` [PATCH 1/2] libv4lconvert: Support for Y16 pixel format Ricardo Ribalda Delgado
2013-08-01 13:04 ` [PATCH 2/2] libv4lconvert: Support for RGB32 and BGR32 format Ricardo Ribalda Delgado
2013-08-02 22:15 ` Gregor Jasny [this message]
2013-08-02 22:43 ` Ricardo Ribalda Delgado
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=51FC2F78.1000902@googlemail.com \
--to=gjasny@googlemail.com \
--cc=linux-media@vger.kernel.org \
--cc=ricardo.ribalda@gmail.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 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.