All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: mripard@kernel.org, paul.kocialkowski@bootlin.com,
	hverkuil@xs4all.nl, gregkh@linuxfoundation.org, wens@csie.org,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/4] media: uapi: hevc: Add scaling matrix control
Date: Wed, 8 Jan 2020 15:11:57 +0100	[thread overview]
Message-ID: <20200108151157.17cf9774@kernel.org> (raw)
In-Reply-To: <20191213160428.54303-2-jernej.skrabec@siol.net>

Em Fri, 13 Dec 2019 17:04:25 +0100
Jernej Skrabec <jernej.skrabec@siol.net> escreveu:

> HEVC has a scaling matrix concept. Add support for it.

> +struct v4l2_ctrl_hevc_scaling_matrix {
> +	__u8	scaling_list_4x4[6][16];
> +	__u8	scaling_list_8x8[6][64];
> +	__u8	scaling_list_16x16[6][64];
> +	__u8	scaling_list_32x32[2][64];
> +	__u8	scaling_list_dc_coef_16x16[6];
> +	__u8	scaling_list_dc_coef_32x32[2];
> +};

I never looked at HEVC spec, but the above seems really weird.

Please correct me if I am wrong, but each of the above matrixes
is independent, and the driver will use just one of the above on
any specific time (for a given video output node), right?

If so, why would userspace be forced to update lots of matrixes, if would
likely use just one at a given time?

IMO, the proper way would be, instead, to use an uAPI like:

/*
 * Actually, as this is uAPI, we will use a fixed size integer type, like
 *  unsigned int
 */
enum hevc_scaling_matrix_type {
	HEVC_SCALING_MATRIX_4x4,
	HEVC_SCALING_MATRIX_8x8,
...
	HEVC_SCALING_MATRIX_DC_COEF_32x32,
};

struct v4l2_ctrl_hevc_scaling_matrix {
	__u32	scaling_type 		/* as defined by enum hevc_scaling_matrix_type */

	union {
		__u8	scaling_list_4x4[6][16];
		__u8	scaling_list_8x8[6][64];
		__u8	scaling_list_16x16[6][64];
		__u8	scaling_list_32x32[2][64];
		__u8	scaling_list_dc_coef_16x16[6];
		__u8	scaling_list_dc_coef_32x32[2];
	};
};

And let the core use a default for each scaling matrix, if userspace doesn't
set it.



Cheers,
Mauro

WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: devel@driverdev.osuosl.org, hverkuil@xs4all.nl,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v2 1/4] media: uapi: hevc: Add scaling matrix control
Date: Wed, 8 Jan 2020 15:11:57 +0100	[thread overview]
Message-ID: <20200108151157.17cf9774@kernel.org> (raw)
In-Reply-To: <20191213160428.54303-2-jernej.skrabec@siol.net>

Em Fri, 13 Dec 2019 17:04:25 +0100
Jernej Skrabec <jernej.skrabec@siol.net> escreveu:

> HEVC has a scaling matrix concept. Add support for it.

> +struct v4l2_ctrl_hevc_scaling_matrix {
> +	__u8	scaling_list_4x4[6][16];
> +	__u8	scaling_list_8x8[6][64];
> +	__u8	scaling_list_16x16[6][64];
> +	__u8	scaling_list_32x32[2][64];
> +	__u8	scaling_list_dc_coef_16x16[6];
> +	__u8	scaling_list_dc_coef_32x32[2];
> +};

I never looked at HEVC spec, but the above seems really weird.

Please correct me if I am wrong, but each of the above matrixes
is independent, and the driver will use just one of the above on
any specific time (for a given video output node), right?

If so, why would userspace be forced to update lots of matrixes, if would
likely use just one at a given time?

IMO, the proper way would be, instead, to use an uAPI like:

/*
 * Actually, as this is uAPI, we will use a fixed size integer type, like
 *  unsigned int
 */
enum hevc_scaling_matrix_type {
	HEVC_SCALING_MATRIX_4x4,
	HEVC_SCALING_MATRIX_8x8,
...
	HEVC_SCALING_MATRIX_DC_COEF_32x32,
};

struct v4l2_ctrl_hevc_scaling_matrix {
	__u32	scaling_type 		/* as defined by enum hevc_scaling_matrix_type */

	union {
		__u8	scaling_list_4x4[6][16];
		__u8	scaling_list_8x8[6][64];
		__u8	scaling_list_16x16[6][64];
		__u8	scaling_list_32x32[2][64];
		__u8	scaling_list_dc_coef_16x16[6];
		__u8	scaling_list_dc_coef_32x32[2];
	};
};

And let the core use a default for each scaling matrix, if userspace doesn't
set it.



Cheers,
Mauro
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: devel@driverdev.osuosl.org, hverkuil@xs4all.nl,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v2 1/4] media: uapi: hevc: Add scaling matrix control
Date: Wed, 8 Jan 2020 15:11:57 +0100	[thread overview]
Message-ID: <20200108151157.17cf9774@kernel.org> (raw)
In-Reply-To: <20191213160428.54303-2-jernej.skrabec@siol.net>

Em Fri, 13 Dec 2019 17:04:25 +0100
Jernej Skrabec <jernej.skrabec@siol.net> escreveu:

> HEVC has a scaling matrix concept. Add support for it.

> +struct v4l2_ctrl_hevc_scaling_matrix {
> +	__u8	scaling_list_4x4[6][16];
> +	__u8	scaling_list_8x8[6][64];
> +	__u8	scaling_list_16x16[6][64];
> +	__u8	scaling_list_32x32[2][64];
> +	__u8	scaling_list_dc_coef_16x16[6];
> +	__u8	scaling_list_dc_coef_32x32[2];
> +};

I never looked at HEVC spec, but the above seems really weird.

Please correct me if I am wrong, but each of the above matrixes
is independent, and the driver will use just one of the above on
any specific time (for a given video output node), right?

If so, why would userspace be forced to update lots of matrixes, if would
likely use just one at a given time?

IMO, the proper way would be, instead, to use an uAPI like:

/*
 * Actually, as this is uAPI, we will use a fixed size integer type, like
 *  unsigned int
 */
enum hevc_scaling_matrix_type {
	HEVC_SCALING_MATRIX_4x4,
	HEVC_SCALING_MATRIX_8x8,
...
	HEVC_SCALING_MATRIX_DC_COEF_32x32,
};

struct v4l2_ctrl_hevc_scaling_matrix {
	__u32	scaling_type 		/* as defined by enum hevc_scaling_matrix_type */

	union {
		__u8	scaling_list_4x4[6][16];
		__u8	scaling_list_8x8[6][64];
		__u8	scaling_list_16x16[6][64];
		__u8	scaling_list_32x32[2][64];
		__u8	scaling_list_dc_coef_16x16[6];
		__u8	scaling_list_dc_coef_32x32[2];
	};
};

And let the core use a default for each scaling matrix, if userspace doesn't
set it.



Cheers,
Mauro

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-01-08 14:12 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 16:04 [PATCH v2 0/4] media: cedrus: hevc: Add support for scaling matrix and multi-slice frames Jernej Skrabec
2019-12-13 16:04 ` Jernej Skrabec
2019-12-13 16:04 ` Jernej Skrabec
2019-12-13 16:04 ` [PATCH v2 1/4] media: uapi: hevc: Add scaling matrix control Jernej Skrabec
2019-12-13 16:04   ` Jernej Skrabec
2019-12-13 16:04   ` Jernej Skrabec
2020-01-08 14:11   ` Mauro Carvalho Chehab [this message]
2020-01-08 14:11     ` Mauro Carvalho Chehab
2020-01-08 14:11     ` Mauro Carvalho Chehab
2020-01-08 14:43     ` Paul Kocialkowski
2020-01-08 14:43       ` Paul Kocialkowski
2020-01-08 14:43       ` Paul Kocialkowski
2020-01-09 15:17       ` Jernej Škrabec
2020-01-09 15:17         ` Jernej Škrabec
2020-01-09 15:17         ` Jernej Škrabec
2020-01-09 15:19         ` Hans Verkuil
2020-01-09 15:19           ` Hans Verkuil
2020-01-09 15:19           ` Hans Verkuil
2019-12-13 16:04 ` [PATCH v2 2/4] media: cedrus: hevc: Add support for scaling matrix Jernej Skrabec
2019-12-13 16:04   ` Jernej Skrabec
2019-12-13 16:04   ` Jernej Skrabec
2020-01-07 15:01   ` Hans Verkuil
2020-01-07 15:01     ` Hans Verkuil
2020-01-07 15:01     ` Hans Verkuil
2020-01-07 17:10     ` Jernej Škrabec
2020-01-07 17:10       ` Jernej Škrabec
2020-01-07 17:10       ` Jernej Škrabec
2020-01-08  7:48       ` Hans Verkuil
2020-01-08  7:48         ` Hans Verkuil
2020-01-08  7:48         ` Hans Verkuil
2020-01-08 14:46       ` Hans Verkuil
2020-01-08 14:46         ` Hans Verkuil
2020-01-08 14:46         ` Hans Verkuil
2020-01-16 19:49         ` Jernej Škrabec
2020-01-16 19:49           ` Jernej Škrabec
2020-01-16 19:49           ` Jernej Škrabec
2019-12-13 16:04 ` [PATCH v2 3/4] media: uapi: hevc: Add segment address field Jernej Skrabec
2019-12-13 16:04   ` Jernej Skrabec
2019-12-13 16:04   ` Jernej Skrabec
2020-01-08 14:31   ` Mauro Carvalho Chehab
2020-01-08 14:31     ` Mauro Carvalho Chehab
2020-01-08 14:31     ` Mauro Carvalho Chehab
2020-01-09 14:46     ` Jernej Škrabec
2020-01-09 14:46       ` Jernej Škrabec
2020-01-09 14:46       ` Jernej Škrabec
2019-12-13 16:04 ` [PATCH v2 4/4] media: cedrus: hevc: Add support for multiple slices Jernej Skrabec
2019-12-13 16:04   ` Jernej Skrabec
2019-12-13 16:04   ` Jernej Skrabec

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=20200108151157.17cf9774@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=jernej.skrabec@siol.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=wens@csie.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.