From: Hans Verkuil <hverkuil@xs4all.nl>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Markus Heiser <markus.heiser@darmarIT.de>,
Helen Mae Koike Fornazier <helen.koike@collabora.co.uk>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Antti Palosaari <crope@iki.fi>,
Philipp Zabel <p.zabel@pengutronix.de>,
Shuah Khan <shuahkh@osg.samsung.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH v3 4/9] [media] vivid: code refactor for color encoding
Date: Mon, 18 Jul 2016 10:40:01 +0200 [thread overview]
Message-ID: <e121c9da-fea2-9610-9e52-a02b28a3a7db@xs4all.nl> (raw)
In-Reply-To: <1468665716-10178-5-git-send-email-ricardo.ribalda@gmail.com>
On 07/16/2016 12:41 PM, Ricardo Ribalda Delgado wrote:
> Replace is_yuv with color_enc Which can be used by other
> color encodings such us HSV.
>
> This change should ease the review of the following patches.
>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> ---
> drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 49 +++++++++++++++--------
> drivers/media/platform/vivid/vivid-core.h | 2 +-
> drivers/media/platform/vivid/vivid-vid-common.c | 52 ++++++++++++-------------
> include/media/v4l2-tpg.h | 7 +++-
> 4 files changed, 66 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
> index 3ec3cebe62b9..e8d2bf388597 100644
> --- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
> +++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
> @@ -1889,11 +1893,24 @@ static int tpg_pattern_avg(const struct tpg_data *tpg,
> return -1;
> }
>
> +static const char *tpg_color_enc_str(enum tgp_color_enc
> + color_enc)
> +{
> + switch (color_enc) {
> + case TGP_COLOR_ENC_YUV:
> + return "YCbCr";
Use "Y'CbCr"
> + case TGP_COLOR_ENC_RGB:
> + default:
> + return "RGB";
and "R'G'B'".
That's more precise.
> +
> + }
> +}
> +
> void tpg_log_status(struct tpg_data *tpg)
> {
> pr_info("tpg source WxH: %ux%u (%s)\n",
> - tpg->src_width, tpg->src_height,
> - tpg->is_yuv ? "YCbCr" : "RGB");
> + tpg->src_width, tpg->src_height,
> + tpg_color_enc_str(tpg->color_enc));
> pr_info("tpg field: %u\n", tpg->field);
> pr_info("tpg crop: %ux%u@%dx%d\n", tpg->crop.width, tpg->crop.height,
> tpg->crop.left, tpg->crop.top);
> diff --git a/include/media/v4l2-tpg.h b/include/media/v4l2-tpg.h
> index 329bebfa930c..e4da507d40e2 100644
> --- a/include/media/v4l2-tpg.h
> +++ b/include/media/v4l2-tpg.h
> @@ -87,6 +87,11 @@ enum tpg_move_mode {
> TPG_MOVE_POS_FAST,
> };
>
> +enum tgp_color_enc {
> + TGP_COLOR_ENC_RGB,
> + TGP_COLOR_ENC_YUV,
Rename this to YCBCR. It's the technically correct name.
Regards,
Hans
> +};
> +
> extern const char * const tpg_aspect_strings[];
>
> #define TPG_MAX_PLANES 3
> @@ -119,7 +124,7 @@ struct tpg_data {
> u8 saturation;
> s16 hue;
> u32 fourcc;
> - bool is_yuv;
> + enum tgp_color_enc color_enc;
> u32 colorspace;
> u32 xfer_func;
> u32 ycbcr_enc;
>
next prev parent reply other threads:[~2016-07-18 8:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-16 10:41 [PATCH v3 0/9] Add HSV format Ricardo Ribalda Delgado
2016-07-16 10:41 ` [PATCH v3 1/9] [media] videodev2.h Add HSV formats Ricardo Ribalda Delgado
2016-07-16 10:41 ` [PATCH v3 2/9] [media] Documentation: Add HSV format Ricardo Ribalda Delgado
2016-07-16 10:41 ` [PATCH v3 3/9] [media] Documentation: Add Ricardo Ribalda Ricardo Ribalda Delgado
2016-07-16 10:41 ` [PATCH v3 4/9] [media] vivid: code refactor for color encoding Ricardo Ribalda Delgado
2016-07-18 8:40 ` Hans Verkuil [this message]
2016-07-16 10:41 ` [PATCH v3 5/9] [media] vivid: Add support for HSV formats Ricardo Ribalda Delgado
2016-07-16 10:41 ` [PATCH v3 6/9] [media] vivid: Rename variable Ricardo Ribalda Delgado
2016-07-16 10:41 ` [PATCH v3 7/9] [media] vivid: Introduce TPG_COLOR_ENC_LUMA Ricardo Ribalda Delgado
2016-07-16 10:41 ` [PATCH v3 8/9] [media] vivid: Fix YUV555 and YUV565 handling Ricardo Ribalda Delgado
2016-07-18 8:51 ` Hans Verkuil
2016-07-18 9:03 ` Ricardo Ribalda Delgado
2016-07-16 10:41 ` [PATCH v3 9/9] [media] vivid: Local optimization Ricardo Ribalda Delgado
2016-07-16 10:52 ` 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=e121c9da-fea2-9610-9e52-a02b28a3a7db@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=corbet@lwn.net \
--cc=crope@iki.fi \
--cc=helen.koike@collabora.co.uk \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=markus.heiser@darmarIT.de \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=ricardo.ribalda@gmail.com \
--cc=shuahkh@osg.samsung.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
all inboxes | Powered by JetHome®