2020-11-09 18:39:27

by Emmanuel Gil Peyrot

[permalink] [raw]
Subject: [RESEND PATCH 0/2] media: uapi: Expose VP8 probability lengths as defines

These values will be used by various drivers implementing the VP8
stateless API.

This had been suggested by Ezequiel Garcia for the Cedrus VP8 driver.

The only driver using this API (until now) has also been updated to use
these new defines.

This is a resend because I forgot to include most maintainers, sorry for
that. It’s my very first patch to the kernel, I didn’t know about
scripts/get_maintainers.pl

Emmanuel Gil Peyrot (2):
media: uapi: Expose probability lengths as defines
media: hantro: Use VP8 lengths defined in uapi

drivers/staging/media/hantro/hantro_vp8.c | 4 ++--
include/media/vp8-ctrls.h | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)

--
2.29.2


2020-11-09 18:41:56

by Emmanuel Gil Peyrot

[permalink] [raw]
Subject: [RESEND PATCH 1/2] media: uapi: Expose VP8 probability lengths as defines

These values will be used by various drivers implementing the VP8
stateless API.

This had been suggested by Ezequiel Garcia for the Cedrus VP8 driver.

Signed-off-by: Emmanuel Gil Peyrot <[email protected]>
---
include/media/vp8-ctrls.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/media/vp8-ctrls.h b/include/media/vp8-ctrls.h
index 53cba826e482..a920493361dc 100644
--- a/include/media/vp8-ctrls.h
+++ b/include/media/vp8-ctrls.h
@@ -53,11 +53,13 @@ struct v4l2_vp8_quantization_header {
__u16 padding;
};

+#define V4L2_VP8_COEFF_PROB_CNT 11
+#define V4L2_VP8_MV_PROB_CNT 19
struct v4l2_vp8_entropy_header {
- __u8 coeff_probs[4][8][3][11];
+ __u8 coeff_probs[4][8][3][V4L2_VP8_COEFF_PROB_CNT];
__u8 y_mode_probs[4];
__u8 uv_mode_probs[3];
- __u8 mv_probs[2][19];
+ __u8 mv_probs[2][V4L2_VP8_MV_PROB_CNT];
__u8 padding[3];
};

--
2.29.2

2020-11-09 18:42:06

by Emmanuel Gil Peyrot

[permalink] [raw]
Subject: [RESEND PATCH 2/2] media: hantro: Use VP8 lengths defined in uapi

Signed-off-by: Emmanuel Gil Peyrot <[email protected]>
---
drivers/staging/media/hantro/hantro_vp8.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_vp8.c b/drivers/staging/media/hantro/hantro_vp8.c
index 0e02d147b189..91ec9a05645b 100644
--- a/drivers/staging/media/hantro/hantro_vp8.c
+++ b/drivers/staging/media/hantro/hantro_vp8.c
@@ -23,11 +23,11 @@ struct vp8_prob_tbl_packed {
u8 padding1;

/* mv prob */
- u8 prob_mv_context[2][19];
+ u8 prob_mv_context[2][V4L2_VP8_MV_PROB_CNT];
u8 padding2[2];

/* coeff probs */
- u8 prob_coeffs[4][8][3][11];
+ u8 prob_coeffs[4][8][3][V4L2_VP8_COEFF_PROB_CNT];
u8 padding3[96];
};

--
2.29.2

2020-11-11 01:11:16

by Ezequiel Garcia

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/2] media: uapi: Expose VP8 probability lengths as defines

Hi Emmanuel,

Thanks for the patch.

On Mon, 9 Nov 2020 at 15:37, Emmanuel Gil Peyrot <[email protected]> wrote:
>
> These values will be used by various drivers implementing the VP8
> stateless API.
>
> This had been suggested by Ezequiel Garcia for the Cedrus VP8 driver.
>
> The only driver using this API (until now) has also been updated to use
> these new defines.
>
> This is a resend because I forgot to include most maintainers, sorry for
> that. It’s my very first patch to the kernel, I didn’t know about
> scripts/get_maintainers.pl
>

I haven't validated these two patches, but on a first look,
it seems it's a low-hanging fruit nice cleanup. Thanks for that!

Since it seems you are looking for interesting things to contribute,
note that the vp8-ctrls.h header is lacking some nice documentation
on each structure.

This should be done by looking at the VP8 syntax spec and documenting
things appropriately. See how it's done for H.264 and VP9:

https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/

Thanks,
Ezequiel

> Emmanuel Gil Peyrot (2):
> media: uapi: Expose probability lengths as defines
> media: hantro: Use VP8 lengths defined in uapi
>
> drivers/staging/media/hantro/hantro_vp8.c | 4 ++--
> include/media/vp8-ctrls.h | 6 ++++--
> 2 files changed, 6 insertions(+), 4 deletions(-)
>
> --
> 2.29.2
>