Commit 481b97a1 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] vivid-tpg: improve colorspace support

Add support for the new AdobeRGB and BT.2020 colorspaces. Also support
explicit Y'CbCr and quantization settings.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 3930e906
This diff is collapsed.
......@@ -119,6 +119,18 @@ struct tpg_data {
u32 fourcc;
bool is_yuv;
u32 colorspace;
u32 ycbcr_enc;
/*
* Stores the actual Y'CbCr encoding, i.e. will never be
* V4L2_YCBCR_ENC_DEFAULT.
*/
u32 real_ycbcr_enc;
u32 quantization;
/*
* Stores the actual quantization, i.e. will never be
* V4L2_QUANTIZATION_DEFAULT.
*/
u32 real_quantization;
enum tpg_video_aspect vid_aspect;
enum tpg_pixel_aspect pix_aspect;
unsigned rgb_range;
......@@ -286,6 +298,32 @@ static inline u32 tpg_g_colorspace(const struct tpg_data *tpg)
return tpg->colorspace;
}
static inline void tpg_s_ycbcr_enc(struct tpg_data *tpg, u32 ycbcr_enc)
{
if (tpg->ycbcr_enc == ycbcr_enc)
return;
tpg->ycbcr_enc = ycbcr_enc;
tpg->recalc_colors = true;
}
static inline u32 tpg_g_ycbcr_enc(const struct tpg_data *tpg)
{
return tpg->ycbcr_enc;
}
static inline void tpg_s_quantization(struct tpg_data *tpg, u32 quantization)
{
if (tpg->quantization == quantization)
return;
tpg->quantization = quantization;
tpg->recalc_colors = true;
}
static inline u32 tpg_g_quantization(const struct tpg_data *tpg)
{
return tpg->quantization;
}
static inline unsigned tpg_g_planes(const struct tpg_data *tpg)
{
return tpg->planes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment