* [PATCH v3 1/3] media: uapi: add WebP uAPI
2024-11-21 13:19 [PATCH v3 0/3] Add WebP support to hantro decoder Hugues Fruchet
@ 2024-11-21 13:19 ` Hugues Fruchet
2025-04-22 19:53 ` Nicolas Dufresne
2024-11-21 13:19 ` [PATCH v3 2/3] media: verisilicon: add WebP decoding support Hugues Fruchet
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Hugues Fruchet @ 2024-11-21 13:19 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Ezequiel Garcia, Philipp Zabel,
Alexandre Torgue, Hugues Fruchet, Sebastian Fricke,
Ricardo Ribalda, Erling Ljunggren, Hans Verkuil,
Laurent Pinchart, Sakari Ailus, Jacopo Mondi,
Jean-Michel Hautbois, Benjamin Gaignard, linux-media,
linux-kernel, linux-rockchip, linux-stm32, linux-arm-kernel
This patch adds the WebP picture decoding kernel uAPI.
This design is based on currently available VP8 API implementation and
aims to support the development of WebP stateless video codecs
on Linux.
Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
---
.../userspace-api/media/v4l/biblio.rst | 9 +++++++++
.../media/v4l/pixfmt-compressed.rst | 17 +++++++++++++++++
drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
include/uapi/linux/videodev2.h | 1 +
4 files changed, 28 insertions(+)
diff --git a/Documentation/userspace-api/media/v4l/biblio.rst b/Documentation/userspace-api/media/v4l/biblio.rst
index 35674eeae20d..df3e963fc54f 100644
--- a/Documentation/userspace-api/media/v4l/biblio.rst
+++ b/Documentation/userspace-api/media/v4l/biblio.rst
@@ -447,3 +447,12 @@ AV1
:title: AV1 Bitstream & Decoding Process Specification
:author: Peter de Rivaz, Argon Design Ltd, Jack Haughton, Argon Design Ltd
+
+.. _webp:
+
+WEBP
+====
+
+:title: WEBP picture Bitstream & Decoding Process Specification
+
+:author: Google (https://developers.google.com/speed/webp)
diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
index 806ed73ac474..08a989511e7d 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
@@ -169,6 +169,23 @@ Compressed Formats
this pixel format. The output buffer must contain the appropriate number
of macroblocks to decode a full corresponding frame to the matching
capture buffer.
+ * .. _V4L2-PIX-FMT-WEBP-FRAME:
+
+ - ``V4L2_PIX_FMT_WEBP_FRAME``
+ - 'WEBP'
+ - WEBP VP8 parsed frame, excluding WEBP RIFF header, keeping only the VP8
+ bitstream including the frame header, as extracted from the container.
+ This format is adapted for stateless video decoders that implement a
+ WEBP pipeline with the :ref:`stateless_decoder`.
+ Metadata associated with the frame to decode is required to be passed
+ through the ``V4L2_CID_STATELESS_VP8_FRAME`` control.
+ See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp8>`.
+ Because of key frames only bitstream, ``V4L2_VP8_FRAME_FLAG_KEY_FRAME``
+ flag must be set, see :ref:`Frame Flags <vp8_frame_flags>`.
+ Exactly one output and one capture buffer must be provided for use with
+ this pixel format. The output buffer must contain the appropriate number
+ of macroblocks to decode a full corresponding frame to the matching
+ capture buffer.
* .. _V4L2-PIX-FMT-VP9:
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 0304daa8471d..e2ff03d0d773 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1501,6 +1501,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
case V4L2_PIX_FMT_VC1_ANNEX_L: descr = "VC-1 (SMPTE 412M Annex L)"; break;
case V4L2_PIX_FMT_VP8: descr = "VP8"; break;
case V4L2_PIX_FMT_VP8_FRAME: descr = "VP8 Frame"; break;
+ case V4L2_PIX_FMT_WEBP_FRAME: descr = "WEBP VP8 Frame"; break;
case V4L2_PIX_FMT_VP9: descr = "VP9"; break;
case V4L2_PIX_FMT_VP9_FRAME: descr = "VP9 Frame"; break;
case V4L2_PIX_FMT_HEVC: descr = "HEVC"; break; /* aka H.265 */
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index e7c4dce39007..09fff269e852 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -757,6 +757,7 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
#define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') /* VP8 parsed frame */
+#define V4L2_PIX_FMT_WEBP_FRAME v4l2_fourcc('W', 'B', 'P', 'F') /* WEBP VP8 parsed frame */
#define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') /* VP9 */
#define V4L2_PIX_FMT_VP9_FRAME v4l2_fourcc('V', 'P', '9', 'F') /* VP9 parsed frame */
#define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */
--
2.25.1
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 1/3] media: uapi: add WebP uAPI
2024-11-21 13:19 ` [PATCH v3 1/3] media: uapi: add WebP uAPI Hugues Fruchet
@ 2025-04-22 19:53 ` Nicolas Dufresne
0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Dufresne @ 2025-04-22 19:53 UTC (permalink / raw)
To: Hugues Fruchet, Mauro Carvalho Chehab, Ezequiel Garcia,
Philipp Zabel, Alexandre Torgue, Sebastian Fricke,
Ricardo Ribalda, Erling Ljunggren, Hans Verkuil,
Laurent Pinchart, Sakari Ailus, Jacopo Mondi,
Jean-Michel Hautbois, Benjamin Gaignard, linux-media,
linux-kernel, linux-rockchip, linux-stm32, linux-arm-kernel
Hi,
sorry for the late come back.
Le jeudi 21 novembre 2024 à 14:19 +0100, Hugues Fruchet a écrit :
> This patch adds the WebP picture decoding kernel uAPI.
>
> This design is based on currently available VP8 API implementation and
> aims to support the development of WebP stateless video codecs
> on Linux.
Should mention that this new pix fmt is added to make it possible to
support both intra-only and VP8 with reference, while advertising
different frame sizes.
>
> Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
> ---
> .../userspace-api/media/v4l/biblio.rst | 9 +++++++++
> .../media/v4l/pixfmt-compressed.rst | 17 +++++++++++++++++
> drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
> include/uapi/linux/videodev2.h | 1 +
> 4 files changed, 28 insertions(+)
>
> diff --git a/Documentation/userspace-api/media/v4l/biblio.rst b/Documentation/userspace-api/media/v4l/biblio.rst
> index 35674eeae20d..df3e963fc54f 100644
> --- a/Documentation/userspace-api/media/v4l/biblio.rst
> +++ b/Documentation/userspace-api/media/v4l/biblio.rst
> @@ -447,3 +447,12 @@ AV1
> :title: AV1 Bitstream & Decoding Process Specification
>
> :author: Peter de Rivaz, Argon Design Ltd, Jack Haughton, Argon Design Ltd
> +
> +.. _webp:
> +
> +WEBP
> +====
> +
> +:title: WEBP picture Bitstream & Decoding Process Specification
> +
> +:author: Google (https://developers.google.com/speed/webp)
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> index 806ed73ac474..08a989511e7d 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> @@ -169,6 +169,23 @@ Compressed Formats
> this pixel format. The output buffer must contain the appropriate number
> of macroblocks to decode a full corresponding frame to the matching
> capture buffer.
> + * .. _V4L2-PIX-FMT-WEBP-FRAME:
> +
> + - ``V4L2_PIX_FMT_WEBP_FRAME``
> + - 'WEBP'
After plenty of thinking, WebP is a container the support 2 codecs. We
should not name this WebP, but instead VP8_INTRA_FRAME. Meaning, intra
only VP8 decoder.
> + - WEBP VP8 parsed frame, excluding WEBP RIFF header, keeping only the VP8
> + bitstream including the frame header, as extracted from the container.
This comment will then not be needed, since VP8_INTRA will make it
clear.
regards,
Nicolas
> + This format is adapted for stateless video decoders that implement a
> + WEBP pipeline with the :ref:`stateless_decoder`.
> + Metadata associated with the frame to decode is required to be passed
> + through the ``V4L2_CID_STATELESS_VP8_FRAME`` control.
> + See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp8>`.
> + Because of key frames only bitstream, ``V4L2_VP8_FRAME_FLAG_KEY_FRAME``
> + flag must be set, see :ref:`Frame Flags <vp8_frame_flags>`.
> + Exactly one output and one capture buffer must be provided for use with
> + this pixel format. The output buffer must contain the appropriate number
> + of macroblocks to decode a full corresponding frame to the matching
> + capture buffer.
>
> * .. _V4L2-PIX-FMT-VP9:
>
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 0304daa8471d..e2ff03d0d773 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1501,6 +1501,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
> case V4L2_PIX_FMT_VC1_ANNEX_L: descr = "VC-1 (SMPTE 412M Annex L)"; break;
> case V4L2_PIX_FMT_VP8: descr = "VP8"; break;
> case V4L2_PIX_FMT_VP8_FRAME: descr = "VP8 Frame"; break;
> + case V4L2_PIX_FMT_WEBP_FRAME: descr = "WEBP VP8 Frame"; break;
> case V4L2_PIX_FMT_VP9: descr = "VP9"; break;
> case V4L2_PIX_FMT_VP9_FRAME: descr = "VP9 Frame"; break;
> case V4L2_PIX_FMT_HEVC: descr = "HEVC"; break; /* aka H.265 */
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index e7c4dce39007..09fff269e852 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -757,6 +757,7 @@ struct v4l2_pix_format {
> #define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
> #define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
> #define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') /* VP8 parsed frame */
> +#define V4L2_PIX_FMT_WEBP_FRAME v4l2_fourcc('W', 'B', 'P', 'F') /* WEBP VP8 parsed frame */
> #define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') /* VP9 */
> #define V4L2_PIX_FMT_VP9_FRAME v4l2_fourcc('V', 'P', '9', 'F') /* VP9 parsed frame */
> #define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 2/3] media: verisilicon: add WebP decoding support
2024-11-21 13:19 [PATCH v3 0/3] Add WebP support to hantro decoder Hugues Fruchet
2024-11-21 13:19 ` [PATCH v3 1/3] media: uapi: add WebP uAPI Hugues Fruchet
@ 2024-11-21 13:19 ` Hugues Fruchet
2025-04-22 20:02 ` Nicolas Dufresne
2024-11-21 13:19 ` [PATCH v3 3/3] media: verisilicon: postproc: 4K support Hugues Fruchet
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Hugues Fruchet @ 2024-11-21 13:19 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Ezequiel Garcia, Philipp Zabel,
Alexandre Torgue, Hugues Fruchet, Sebastian Fricke,
Ricardo Ribalda, Erling Ljunggren, Hans Verkuil,
Laurent Pinchart, Sakari Ailus, Jacopo Mondi,
Jean-Michel Hautbois, Benjamin Gaignard, linux-media,
linux-kernel, linux-rockchip, linux-stm32, linux-arm-kernel
Add WebP picture decoding support to VP8 stateless decoder.
Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
---
.../media/platform/verisilicon/hantro_g1_regs.h | 1 +
.../platform/verisilicon/hantro_g1_vp8_dec.c | 14 ++++++++++++++
.../media/platform/verisilicon/hantro_v4l2.c | 2 ++
.../platform/verisilicon/stm32mp25_vpu_hw.c | 17 +++++++++++++++--
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/verisilicon/hantro_g1_regs.h b/drivers/media/platform/verisilicon/hantro_g1_regs.h
index c623b3b0be18..e7d4db788e57 100644
--- a/drivers/media/platform/verisilicon/hantro_g1_regs.h
+++ b/drivers/media/platform/verisilicon/hantro_g1_regs.h
@@ -232,6 +232,7 @@
#define G1_REG_DEC_CTRL7_DCT7_START_BIT(x) (((x) & 0x3f) << 0)
#define G1_REG_ADDR_STR 0x030
#define G1_REG_ADDR_DST 0x034
+#define G1_REG_ADDR_DST_CHROMA 0x038
#define G1_REG_ADDR_REF(i) (0x038 + ((i) * 0x4))
#define G1_REG_ADDR_REF_FIELD_E BIT(1)
#define G1_REG_ADDR_REF_TOPC_E BIT(0)
diff --git a/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c b/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
index 851eb67f19f5..c83ee6f5edc8 100644
--- a/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
+++ b/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
@@ -307,6 +307,12 @@ static void cfg_parts(struct hantro_ctx *ctx,
G1_REG_DEC_CTRL3_STREAM_LEN(dct_part_total_len),
G1_REG_DEC_CTRL3);
+ if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_WEBP_FRAME)
+ vdpu_write_relaxed(vpu,
+ G1_REG_DEC_CTRL3_STREAM_LEN_EXT
+ (dct_part_total_len >> 24),
+ G1_REG_DEC_CTRL3);
+
/* DCT partitions base address */
for (i = 0; i < hdr->num_dct_parts; i++) {
u32 byte_offset = dct_part_offset + dct_size_part_size + count;
@@ -427,6 +433,12 @@ static void cfg_buffers(struct hantro_ctx *ctx,
dst_dma = hantro_get_dec_buf_addr(ctx, &vb2_dst->vb2_buf);
vdpu_write_relaxed(vpu, dst_dma, G1_REG_ADDR_DST);
+
+ if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_WEBP_FRAME)
+ vdpu_write_relaxed(vpu, dst_dma +
+ ctx->dst_fmt.plane_fmt[0].bytesperline *
+ ctx->dst_fmt.height,
+ G1_REG_ADDR_DST_CHROMA);
}
int hantro_g1_vp8_dec_run(struct hantro_ctx *ctx)
@@ -471,6 +483,8 @@ int hantro_g1_vp8_dec_run(struct hantro_ctx *ctx)
reg |= G1_REG_DEC_CTRL0_SKIP_MODE;
if (hdr->lf.level == 0)
reg |= G1_REG_DEC_CTRL0_FILTERING_DIS;
+ if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_WEBP_FRAME)
+ reg |= G1_REG_DEC_CTRL0_WEBP_E;
vdpu_write_relaxed(vpu, reg, G1_REG_DEC_CTRL0);
/* Frame dimensions */
diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
index 2513adfbd825..7075b2ba1ec2 100644
--- a/drivers/media/platform/verisilicon/hantro_v4l2.c
+++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
@@ -470,6 +470,7 @@ hantro_update_requires_request(struct hantro_ctx *ctx, u32 fourcc)
break;
case V4L2_PIX_FMT_MPEG2_SLICE:
case V4L2_PIX_FMT_VP8_FRAME:
+ case V4L2_PIX_FMT_WEBP_FRAME:
case V4L2_PIX_FMT_H264_SLICE:
case V4L2_PIX_FMT_HEVC_SLICE:
case V4L2_PIX_FMT_VP9_FRAME:
@@ -492,6 +493,7 @@ hantro_update_requires_hold_capture_buf(struct hantro_ctx *ctx, u32 fourcc)
case V4L2_PIX_FMT_JPEG:
case V4L2_PIX_FMT_MPEG2_SLICE:
case V4L2_PIX_FMT_VP8_FRAME:
+ case V4L2_PIX_FMT_WEBP_FRAME:
case V4L2_PIX_FMT_HEVC_SLICE:
case V4L2_PIX_FMT_VP9_FRAME:
vq->subsystem_flags &= ~(VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF);
diff --git a/drivers/media/platform/verisilicon/stm32mp25_vpu_hw.c b/drivers/media/platform/verisilicon/stm32mp25_vpu_hw.c
index 833821120b20..c291b1560e20 100644
--- a/drivers/media/platform/verisilicon/stm32mp25_vpu_hw.c
+++ b/drivers/media/platform/verisilicon/stm32mp25_vpu_hw.c
@@ -22,10 +22,10 @@ static const struct hantro_fmt stm32mp25_vdec_fmts[] = {
.codec_mode = HANTRO_MODE_NONE,
.frmsize = {
.min_width = FMT_MIN_WIDTH,
- .max_width = FMT_FHD_WIDTH,
+ .max_width = FMT_4K_WIDTH,
.step_width = MB_DIM,
.min_height = FMT_MIN_HEIGHT,
- .max_height = FMT_FHD_HEIGHT,
+ .max_height = FMT_4K_HEIGHT,
.step_height = MB_DIM,
},
},
@@ -42,6 +42,19 @@ static const struct hantro_fmt stm32mp25_vdec_fmts[] = {
.step_height = MB_DIM,
},
},
+ {
+ .fourcc = V4L2_PIX_FMT_WEBP_FRAME,
+ .codec_mode = HANTRO_MODE_VP8_DEC,
+ .max_depth = 2,
+ .frmsize = {
+ .min_width = FMT_MIN_WIDTH,
+ .max_width = FMT_4K_WIDTH,
+ .step_width = MB_DIM,
+ .min_height = FMT_MIN_HEIGHT,
+ .max_height = FMT_4K_HEIGHT,
+ .step_height = MB_DIM,
+ },
+ },
{
.fourcc = V4L2_PIX_FMT_H264_SLICE,
.codec_mode = HANTRO_MODE_H264_DEC,
--
2.25.1
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 2/3] media: verisilicon: add WebP decoding support
2024-11-21 13:19 ` [PATCH v3 2/3] media: verisilicon: add WebP decoding support Hugues Fruchet
@ 2025-04-22 20:02 ` Nicolas Dufresne
0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Dufresne @ 2025-04-22 20:02 UTC (permalink / raw)
To: Hugues Fruchet, Mauro Carvalho Chehab, Ezequiel Garcia,
Philipp Zabel, Alexandre Torgue, Sebastian Fricke,
Ricardo Ribalda, Erling Ljunggren, Hans Verkuil,
Laurent Pinchart, Sakari Ailus, Jacopo Mondi,
Jean-Michel Hautbois, Benjamin Gaignard, linux-media,
linux-kernel, linux-rockchip, linux-stm32, linux-arm-kernel
Hi,
Le jeudi 21 novembre 2024 à 14:19 +0100, Hugues Fruchet a écrit :
> Add WebP picture decoding support to VP8 stateless decoder.
This is a bit short. I believe I've asked to explain why its fine to
bump the NV12 max width/height to 4K here or in the code. Also, will
need a simple port once the PIX_FMT is changed.
Nicolas
>
> Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
> ---
> .../media/platform/verisilicon/hantro_g1_regs.h | 1 +
> .../platform/verisilicon/hantro_g1_vp8_dec.c | 14 ++++++++++++++
> .../media/platform/verisilicon/hantro_v4l2.c | 2 ++
> .../platform/verisilicon/stm32mp25_vpu_hw.c | 17
> +++++++++++++++--
> 4 files changed, 32 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro_g1_regs.h
> b/drivers/media/platform/verisilicon/hantro_g1_regs.h
> index c623b3b0be18..e7d4db788e57 100644
> --- a/drivers/media/platform/verisilicon/hantro_g1_regs.h
> +++ b/drivers/media/platform/verisilicon/hantro_g1_regs.h
> @@ -232,6 +232,7 @@
> #define G1_REG_DEC_CTRL7_DCT7_START_BIT(x) (((x) &
> 0x3f) << 0)
> #define
> G1_REG_ADDR_STR 0x030
> #define
> G1_REG_ADDR_DST 0x034
> +#define G1_REG_ADDR_DST_CHROMA 0x038
> #define G1_REG_ADDR_REF(i) (0x038 +
> ((i) * 0x4))
> #define G1_REG_ADDR_REF_FIELD_E BIT(1)
> #define G1_REG_ADDR_REF_TOPC_E BIT(0)
> diff --git a/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
> b/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
> index 851eb67f19f5..c83ee6f5edc8 100644
> --- a/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
> +++ b/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
> @@ -307,6 +307,12 @@ static void cfg_parts(struct hantro_ctx *ctx,
>
> G1_REG_DEC_CTRL3_STREAM_LEN(dct_part_total_len),
> G1_REG_DEC_CTRL3);
>
> + if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_WEBP_FRAME)
> + vdpu_write_relaxed(vpu,
> + G1_REG_DEC_CTRL3_STREAM_LEN_EXT
> + (dct_part_total_len >> 24),
> + G1_REG_DEC_CTRL3);
> +
> /* DCT partitions base address */
> for (i = 0; i < hdr->num_dct_parts; i++) {
> u32 byte_offset = dct_part_offset +
> dct_size_part_size + count;
> @@ -427,6 +433,12 @@ static void cfg_buffers(struct hantro_ctx *ctx,
>
> dst_dma = hantro_get_dec_buf_addr(ctx, &vb2_dst->vb2_buf);
> vdpu_write_relaxed(vpu, dst_dma, G1_REG_ADDR_DST);
> +
> + if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_WEBP_FRAME)
> + vdpu_write_relaxed(vpu, dst_dma +
> + ctx-
> >dst_fmt.plane_fmt[0].bytesperline *
> + ctx->dst_fmt.height,
> + G1_REG_ADDR_DST_CHROMA);
> }
>
> int hantro_g1_vp8_dec_run(struct hantro_ctx *ctx)
> @@ -471,6 +483,8 @@ int hantro_g1_vp8_dec_run(struct hantro_ctx *ctx)
> reg |= G1_REG_DEC_CTRL0_SKIP_MODE;
> if (hdr->lf.level == 0)
> reg |= G1_REG_DEC_CTRL0_FILTERING_DIS;
> + if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_WEBP_FRAME)
> + reg |= G1_REG_DEC_CTRL0_WEBP_E;
> vdpu_write_relaxed(vpu, reg, G1_REG_DEC_CTRL0);
>
> /* Frame dimensions */
> diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c
> b/drivers/media/platform/verisilicon/hantro_v4l2.c
> index 2513adfbd825..7075b2ba1ec2 100644
> --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> @@ -470,6 +470,7 @@ hantro_update_requires_request(struct hantro_ctx
> *ctx, u32 fourcc)
> break;
> case V4L2_PIX_FMT_MPEG2_SLICE:
> case V4L2_PIX_FMT_VP8_FRAME:
> + case V4L2_PIX_FMT_WEBP_FRAME:
> case V4L2_PIX_FMT_H264_SLICE:
> case V4L2_PIX_FMT_HEVC_SLICE:
> case V4L2_PIX_FMT_VP9_FRAME:
> @@ -492,6 +493,7 @@ hantro_update_requires_hold_capture_buf(struct
> hantro_ctx *ctx, u32 fourcc)
> case V4L2_PIX_FMT_JPEG:
> case V4L2_PIX_FMT_MPEG2_SLICE:
> case V4L2_PIX_FMT_VP8_FRAME:
> + case V4L2_PIX_FMT_WEBP_FRAME:
> case V4L2_PIX_FMT_HEVC_SLICE:
> case V4L2_PIX_FMT_VP9_FRAME:
> vq->subsystem_flags &=
> ~(VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF);
> diff --git a/drivers/media/platform/verisilicon/stm32mp25_vpu_hw.c
> b/drivers/media/platform/verisilicon/stm32mp25_vpu_hw.c
> index 833821120b20..c291b1560e20 100644
> --- a/drivers/media/platform/verisilicon/stm32mp25_vpu_hw.c
> +++ b/drivers/media/platform/verisilicon/stm32mp25_vpu_hw.c
> @@ -22,10 +22,10 @@ static const struct hantro_fmt
> stm32mp25_vdec_fmts[] = {
> .codec_mode = HANTRO_MODE_NONE,
> .frmsize = {
> .min_width = FMT_MIN_WIDTH,
> - .max_width = FMT_FHD_WIDTH,
> + .max_width = FMT_4K_WIDTH,
> .step_width = MB_DIM,
> .min_height = FMT_MIN_HEIGHT,
> - .max_height = FMT_FHD_HEIGHT,
> + .max_height = FMT_4K_HEIGHT,
> .step_height = MB_DIM,
> },
> },
> @@ -42,6 +42,19 @@ static const struct hantro_fmt
> stm32mp25_vdec_fmts[] = {
> .step_height = MB_DIM,
> },
> },
> + {
> + .fourcc = V4L2_PIX_FMT_WEBP_FRAME,
> + .codec_mode = HANTRO_MODE_VP8_DEC,
> + .max_depth = 2,
> + .frmsize = {
> + .min_width = FMT_MIN_WIDTH,
> + .max_width = FMT_4K_WIDTH,
> + .step_width = MB_DIM,
> + .min_height = FMT_MIN_HEIGHT,
> + .max_height = FMT_4K_HEIGHT,
> + .step_height = MB_DIM,
> + },
> + },
> {
> .fourcc = V4L2_PIX_FMT_H264_SLICE,
> .codec_mode = HANTRO_MODE_H264_DEC,
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 3/3] media: verisilicon: postproc: 4K support
2024-11-21 13:19 [PATCH v3 0/3] Add WebP support to hantro decoder Hugues Fruchet
2024-11-21 13:19 ` [PATCH v3 1/3] media: uapi: add WebP uAPI Hugues Fruchet
2024-11-21 13:19 ` [PATCH v3 2/3] media: verisilicon: add WebP decoding support Hugues Fruchet
@ 2024-11-21 13:19 ` Hugues Fruchet
2025-04-22 19:58 ` Nicolas Dufresne
2024-11-21 14:16 ` [PATCH v3 0/3] Add WebP support to hantro decoder Hugues FRUCHET
2024-11-24 3:09 ` Adam Ford
4 siblings, 1 reply; 10+ messages in thread
From: Hugues Fruchet @ 2024-11-21 13:19 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Ezequiel Garcia, Philipp Zabel,
Alexandre Torgue, Hugues Fruchet, Sebastian Fricke,
Ricardo Ribalda, Erling Ljunggren, Hans Verkuil,
Laurent Pinchart, Sakari Ailus, Jacopo Mondi,
Jean-Michel Hautbois, Benjamin Gaignard, linux-media,
linux-kernel, linux-rockchip, linux-stm32, linux-arm-kernel
Support input larger than 4096x2048 using extended input width/height
fields of swreg92.
This is needed to decode large WebP or JPEG pictures.
Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
---
drivers/media/platform/verisilicon/hantro.h | 2 ++
drivers/media/platform/verisilicon/hantro_g1_regs.h | 2 +-
drivers/media/platform/verisilicon/hantro_postproc.c | 6 +++++-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/verisilicon/hantro.h b/drivers/media/platform/verisilicon/hantro.h
index 811260dc3c77..d1337f7742e4 100644
--- a/drivers/media/platform/verisilicon/hantro.h
+++ b/drivers/media/platform/verisilicon/hantro.h
@@ -321,6 +321,8 @@ struct hantro_postproc_regs {
struct hantro_reg output_fmt;
struct hantro_reg orig_width;
struct hantro_reg display_width;
+ struct hantro_reg input_width_ext;
+ struct hantro_reg input_height_ext;
};
struct hantro_vp9_decoded_buffer_info {
diff --git a/drivers/media/platform/verisilicon/hantro_g1_regs.h b/drivers/media/platform/verisilicon/hantro_g1_regs.h
index e7d4db788e57..f6e5bbeb1914 100644
--- a/drivers/media/platform/verisilicon/hantro_g1_regs.h
+++ b/drivers/media/platform/verisilicon/hantro_g1_regs.h
@@ -351,7 +351,7 @@
#define G1_REG_PP_CONTROL_OUT_WIDTH(v) (((v) << 4) & GENMASK(14, 4))
#define G1_REG_PP_MASK1_ORIG_WIDTH G1_SWREG(88)
#define G1_REG_PP_ORIG_WIDTH(v) (((v) << 23) & GENMASK(31, 23))
-#define G1_REG_PP_DISPLAY_WIDTH G1_SWREG(92)
+#define G1_REG_PP_DISPLAY_WIDTH_IN_EXT G1_SWREG(92)
#define G1_REG_PP_FUSE G1_SWREG(99)
#endif /* HANTRO_G1_REGS_H_ */
diff --git a/drivers/media/platform/verisilicon/hantro_postproc.c b/drivers/media/platform/verisilicon/hantro_postproc.c
index 232c93eea7ee..84c8e287470d 100644
--- a/drivers/media/platform/verisilicon/hantro_postproc.c
+++ b/drivers/media/platform/verisilicon/hantro_postproc.c
@@ -49,7 +49,9 @@ static const struct hantro_postproc_regs hantro_g1_postproc_regs = {
.input_fmt = {G1_REG_PP_CONTROL, 29, 0x7},
.output_fmt = {G1_REG_PP_CONTROL, 26, 0x7},
.orig_width = {G1_REG_PP_MASK1_ORIG_WIDTH, 23, 0x1ff},
- .display_width = {G1_REG_PP_DISPLAY_WIDTH, 0, 0xfff},
+ .display_width = {G1_REG_PP_DISPLAY_WIDTH_IN_EXT, 0, 0xfff},
+ .input_width_ext = {G1_REG_PP_DISPLAY_WIDTH_IN_EXT, 26, 0x7},
+ .input_height_ext = {G1_REG_PP_DISPLAY_WIDTH_IN_EXT, 29, 0x7},
};
bool hantro_needs_postproc(const struct hantro_ctx *ctx,
@@ -103,6 +105,8 @@ static void hantro_postproc_g1_enable(struct hantro_ctx *ctx)
HANTRO_PP_REG_WRITE(vpu, output_height, ctx->dst_fmt.height);
HANTRO_PP_REG_WRITE(vpu, orig_width, MB_WIDTH(ctx->dst_fmt.width));
HANTRO_PP_REG_WRITE(vpu, display_width, ctx->dst_fmt.width);
+ HANTRO_PP_REG_WRITE(vpu, input_width_ext, MB_WIDTH(ctx->dst_fmt.width) >> 9);
+ HANTRO_PP_REG_WRITE(vpu, input_height_ext, MB_HEIGHT(ctx->dst_fmt.height >> 8));
}
static int down_scale_factor(struct hantro_ctx *ctx)
--
2.25.1
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 3/3] media: verisilicon: postproc: 4K support
2024-11-21 13:19 ` [PATCH v3 3/3] media: verisilicon: postproc: 4K support Hugues Fruchet
@ 2025-04-22 19:58 ` Nicolas Dufresne
0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Dufresne @ 2025-04-22 19:58 UTC (permalink / raw)
To: Hugues Fruchet, Mauro Carvalho Chehab, Ezequiel Garcia,
Philipp Zabel, Alexandre Torgue, Sebastian Fricke,
Ricardo Ribalda, Erling Ljunggren, Hans Verkuil,
Laurent Pinchart, Sakari Ailus, Jacopo Mondi,
Jean-Michel Hautbois, Benjamin Gaignard, linux-media,
linux-kernel, linux-rockchip, linux-stm32, linux-arm-kernel
Hi,
Le jeudi 21 novembre 2024 à 14:19 +0100, Hugues Fruchet a écrit :
> Support input larger than 4096x2048 using extended input width/height
> fields of swreg92.
> This is needed to decode large WebP or JPEG pictures.
>
> Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
> drivers/media/platform/verisilicon/hantro.h | 2 ++
> drivers/media/platform/verisilicon/hantro_g1_regs.h | 2 +-
> drivers/media/platform/verisilicon/hantro_postproc.c | 6 +++++-
> 3 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro.h b/drivers/media/platform/verisilicon/hantro.h
> index 811260dc3c77..d1337f7742e4 100644
> --- a/drivers/media/platform/verisilicon/hantro.h
> +++ b/drivers/media/platform/verisilicon/hantro.h
> @@ -321,6 +321,8 @@ struct hantro_postproc_regs {
> struct hantro_reg output_fmt;
> struct hantro_reg orig_width;
> struct hantro_reg display_width;
> + struct hantro_reg input_width_ext;
> + struct hantro_reg input_height_ext;
> };
>
> struct hantro_vp9_decoded_buffer_info {
> diff --git a/drivers/media/platform/verisilicon/hantro_g1_regs.h b/drivers/media/platform/verisilicon/hantro_g1_regs.h
> index e7d4db788e57..f6e5bbeb1914 100644
> --- a/drivers/media/platform/verisilicon/hantro_g1_regs.h
> +++ b/drivers/media/platform/verisilicon/hantro_g1_regs.h
> @@ -351,7 +351,7 @@
> #define G1_REG_PP_CONTROL_OUT_WIDTH(v) (((v) << 4) & GENMASK(14, 4))
> #define G1_REG_PP_MASK1_ORIG_WIDTH G1_SWREG(88)
> #define G1_REG_PP_ORIG_WIDTH(v) (((v) << 23) & GENMASK(31, 23))
> -#define G1_REG_PP_DISPLAY_WIDTH G1_SWREG(92)
> +#define G1_REG_PP_DISPLAY_WIDTH_IN_EXT G1_SWREG(92)
> #define G1_REG_PP_FUSE G1_SWREG(99)
>
> #endif /* HANTRO_G1_REGS_H_ */
> diff --git a/drivers/media/platform/verisilicon/hantro_postproc.c b/drivers/media/platform/verisilicon/hantro_postproc.c
> index 232c93eea7ee..84c8e287470d 100644
> --- a/drivers/media/platform/verisilicon/hantro_postproc.c
> +++ b/drivers/media/platform/verisilicon/hantro_postproc.c
> @@ -49,7 +49,9 @@ static const struct hantro_postproc_regs hantro_g1_postproc_regs = {
> .input_fmt = {G1_REG_PP_CONTROL, 29, 0x7},
> .output_fmt = {G1_REG_PP_CONTROL, 26, 0x7},
> .orig_width = {G1_REG_PP_MASK1_ORIG_WIDTH, 23, 0x1ff},
> - .display_width = {G1_REG_PP_DISPLAY_WIDTH, 0, 0xfff},
> + .display_width = {G1_REG_PP_DISPLAY_WIDTH_IN_EXT, 0, 0xfff},
> + .input_width_ext = {G1_REG_PP_DISPLAY_WIDTH_IN_EXT, 26, 0x7},
> + .input_height_ext = {G1_REG_PP_DISPLAY_WIDTH_IN_EXT, 29, 0x7},
> };
>
> bool hantro_needs_postproc(const struct hantro_ctx *ctx,
> @@ -103,6 +105,8 @@ static void hantro_postproc_g1_enable(struct hantro_ctx *ctx)
> HANTRO_PP_REG_WRITE(vpu, output_height, ctx->dst_fmt.heighat);
> HANTRO_PP_REG_WRITE(vpu, orig_width, MB_WIDTH(ctx->dst_fmt.width));
> HANTRO_PP_REG_WRITE(vpu, display_width, ctx->dst_fmt.width);
> + HANTRO_PP_REG_WRITE(vpu, input_width_ext, MB_WIDTH(ctx->dst_fmt.width) >> 9);
> + HANTRO_PP_REG_WRITE(vpu, input_height_ext, MB_HEIGHT(ctx->dst_fmt.height >> 8));
> }
>
> static int down_scale_factor(struct hantro_ctx *ctx)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 0/3] Add WebP support to hantro decoder
2024-11-21 13:19 [PATCH v3 0/3] Add WebP support to hantro decoder Hugues Fruchet
` (2 preceding siblings ...)
2024-11-21 13:19 ` [PATCH v3 3/3] media: verisilicon: postproc: 4K support Hugues Fruchet
@ 2024-11-21 14:16 ` Hugues FRUCHET
2024-11-24 3:09 ` Adam Ford
4 siblings, 0 replies; 10+ messages in thread
From: Hugues FRUCHET @ 2024-11-21 14:16 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Ezequiel Garcia, Philipp Zabel,
Alexandre Torgue, Sebastian Fricke, Ricardo Ribalda,
Erling Ljunggren, Hans Verkuil, Laurent Pinchart, Sakari Ailus,
Jacopo Mondi, Jean-Michel Hautbois, Benjamin Gaignard,
linux-media, linux-kernel, linux-rockchip, linux-stm32,
linux-arm-kernel
Hi all,
The corresponding GStreamer code has been pushed here (v4l2slwebpdec):
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7939
BR,
Hugues.
On 11/21/24 14:19, Hugues Fruchet wrote:
> Add WebP image decoding support to stateless V4L2 VP8 decoder.
>
> This have been tested on STM32MP257-EV board using GStreamer.
>
> Simple basic test:
> $> wget https://www.gstatic.com/webp/gallery/1.webp
> $> gst-launch-1.0 filesrc location= 1.webp ! typefind ! v4l2slwebpdec ! imagefreeze num-buffers=20 ! waylandsink fullscreen=true
>
> Slideshow of a set of WebP pictures and WebM video files:
> $> wget https://www.gstatic.com/webp/gallery/2.webp
> $> wget https://www.gstatic.com/webp/gallery/3.webp
> $> wget https://www.gstatic.com/webp/gallery/4.webp
> $> wget https://www.gstatic.com/webp/gallery/5.webp
> $> wget https://samplemedia.linaro.org/VP8/big_buck_bunny_480p_VP8_VORBIS_25fps_1900K_short.WebM
> $> gst-play-1.0 *.webp *.webm *.WebM --wait-on-eos
> <hit key ">" to display next file >
>
> Large WebP image > 16777215 (size > 2^24)
> $> gst-launch-1.0 fakesrc num-buffers=1 format=4 do-timestamp=true filltype=3 sizetype=2 sizemax=25165824 blocksize=25165824 ! video/x-raw, format=I420, width=4096, height=3072, framerate=1/1 ! webpenc quality=100 ! filesink location=4096x3072_HQ_random.webp
> $> ls -l 4096x3072_HQ_random.webp
> [...] 16877404 Nov 20 11:40 4096x3072_HQ_random.webp
> $> gst-launch-1.0 filesrc location= 4096x3072_HQ_random.webp blocksize=16876610 ! image/webp, width=1, height=1, framerate=0/1 ! v4l2slwebpdec ! imagefreeze num-buffers=20 ! waylandsink fullscreen=true
>
> Large WebP image decoding using post-processor is untested because of lack
> of hardware support on this platform, nevertheless support is provided in
> this serie for further testing on another platform having post-processor
> support.
>
> ===========
> = history =
> ===========
> version 3:
> - Fix remarks from Nicolas Dufresne:
> - Document constraint about key frame only for WebP
> - Fix rebase issue
> - Fix typo detected by Diederik de Haas
>
> version 2:
> - Fix remarks from Nicolas Dufresne:
> - Use bytesperline helper to compute chroma size
> - Introduce a new explicit WEBP frame compressed format
> instead of relying on VP8 + WebP flag
> - 4K support in both decoder and post-proc
>
> version 1:
> - Initial submission
>
> Hugues Fruchet (3):
> media: uapi: add WebP uAPI
> media: verisilicon: add WebP decoding support
> media: verisilicon: postproc: 4K support
>
> .../userspace-api/media/v4l/biblio.rst | 9 +++++++++
> .../media/v4l/pixfmt-compressed.rst | 17 +++++++++++++++++
> drivers/media/platform/verisilicon/hantro.h | 2 ++
> .../media/platform/verisilicon/hantro_g1_regs.h | 3 ++-
> .../platform/verisilicon/hantro_g1_vp8_dec.c | 14 ++++++++++++++
> .../platform/verisilicon/hantro_postproc.c | 6 +++++-
> .../media/platform/verisilicon/hantro_v4l2.c | 2 ++
> .../platform/verisilicon/stm32mp25_vpu_hw.c | 17 +++++++++++++++--
> drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
> include/uapi/linux/videodev2.h | 1 +
> 10 files changed, 68 insertions(+), 4 deletions(-)
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 0/3] Add WebP support to hantro decoder
2024-11-21 13:19 [PATCH v3 0/3] Add WebP support to hantro decoder Hugues Fruchet
` (3 preceding siblings ...)
2024-11-21 14:16 ` [PATCH v3 0/3] Add WebP support to hantro decoder Hugues FRUCHET
@ 2024-11-24 3:09 ` Adam Ford
2024-11-25 7:49 ` Hugues FRUCHET
4 siblings, 1 reply; 10+ messages in thread
From: Adam Ford @ 2024-11-24 3:09 UTC (permalink / raw)
To: Hugues Fruchet
Cc: Mauro Carvalho Chehab, Ezequiel Garcia, Philipp Zabel,
Alexandre Torgue, Sebastian Fricke, Ricardo Ribalda,
Erling Ljunggren, Hans Verkuil, Laurent Pinchart, Sakari Ailus,
Jacopo Mondi, Jean-Michel Hautbois, Benjamin Gaignard,
linux-media, linux-kernel, linux-rockchip, linux-stm32,
linux-arm-kernel
On Thu, Nov 21, 2024 at 7:22 AM Hugues Fruchet
<hugues.fruchet@foss.st.com> wrote:
>
> Add WebP image decoding support to stateless V4L2 VP8 decoder.
>
> This have been tested on STM32MP257-EV board using GStreamer.
I want to test this on an i.MX8M Mini. Is there a certain gstreamer
version or branch I should use, or is 1.24 sufficient?
adam
>
> Simple basic test:
> $> wget https://www.gstatic.com/webp/gallery/1.webp
> $> gst-launch-1.0 filesrc location= 1.webp ! typefind ! v4l2slwebpdec ! imagefreeze num-buffers=20 ! waylandsink fullscreen=true
>
> Slideshow of a set of WebP pictures and WebM video files:
> $> wget https://www.gstatic.com/webp/gallery/2.webp
> $> wget https://www.gstatic.com/webp/gallery/3.webp
> $> wget https://www.gstatic.com/webp/gallery/4.webp
> $> wget https://www.gstatic.com/webp/gallery/5.webp
> $> wget https://samplemedia.linaro.org/VP8/big_buck_bunny_480p_VP8_VORBIS_25fps_1900K_short.WebM
> $> gst-play-1.0 *.webp *.webm *.WebM --wait-on-eos
> <hit key ">" to display next file >
>
> Large WebP image > 16777215 (size > 2^24)
> $> gst-launch-1.0 fakesrc num-buffers=1 format=4 do-timestamp=true filltype=3 sizetype=2 sizemax=25165824 blocksize=25165824 ! video/x-raw, format=I420, width=4096, height=3072, framerate=1/1 ! webpenc quality=100 ! filesink location=4096x3072_HQ_random.webp
> $> ls -l 4096x3072_HQ_random.webp
> [...] 16877404 Nov 20 11:40 4096x3072_HQ_random.webp
> $> gst-launch-1.0 filesrc location= 4096x3072_HQ_random.webp blocksize=16876610 ! image/webp, width=1, height=1, framerate=0/1 ! v4l2slwebpdec ! imagefreeze num-buffers=20 ! waylandsink fullscreen=true
>
> Large WebP image decoding using post-processor is untested because of lack
> of hardware support on this platform, nevertheless support is provided in
> this serie for further testing on another platform having post-processor
> support.
>
> ===========
> = history =
> ===========
> version 3:
> - Fix remarks from Nicolas Dufresne:
> - Document constraint about key frame only for WebP
> - Fix rebase issue
> - Fix typo detected by Diederik de Haas
>
> version 2:
> - Fix remarks from Nicolas Dufresne:
> - Use bytesperline helper to compute chroma size
> - Introduce a new explicit WEBP frame compressed format
> instead of relying on VP8 + WebP flag
> - 4K support in both decoder and post-proc
>
> version 1:
> - Initial submission
>
> Hugues Fruchet (3):
> media: uapi: add WebP uAPI
> media: verisilicon: add WebP decoding support
> media: verisilicon: postproc: 4K support
>
> .../userspace-api/media/v4l/biblio.rst | 9 +++++++++
> .../media/v4l/pixfmt-compressed.rst | 17 +++++++++++++++++
> drivers/media/platform/verisilicon/hantro.h | 2 ++
> .../media/platform/verisilicon/hantro_g1_regs.h | 3 ++-
> .../platform/verisilicon/hantro_g1_vp8_dec.c | 14 ++++++++++++++
> .../platform/verisilicon/hantro_postproc.c | 6 +++++-
> .../media/platform/verisilicon/hantro_v4l2.c | 2 ++
> .../platform/verisilicon/stm32mp25_vpu_hw.c | 17 +++++++++++++++--
> drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
> include/uapi/linux/videodev2.h | 1 +
> 10 files changed, 68 insertions(+), 4 deletions(-)
>
> --
> 2.25.1
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 0/3] Add WebP support to hantro decoder
2024-11-24 3:09 ` Adam Ford
@ 2024-11-25 7:49 ` Hugues FRUCHET
0 siblings, 0 replies; 10+ messages in thread
From: Hugues FRUCHET @ 2024-11-25 7:49 UTC (permalink / raw)
To: Adam Ford
Cc: Mauro Carvalho Chehab, Ezequiel Garcia, Philipp Zabel,
Alexandre Torgue, Sebastian Fricke, Ricardo Ribalda,
Erling Ljunggren, Hans Verkuil, Laurent Pinchart, Sakari Ailus,
Jacopo Mondi, Jean-Michel Hautbois, Benjamin Gaignard,
linux-media, linux-kernel, linux-rockchip, linux-stm32,
linux-arm-kernel
Hi Adam,
On 11/24/24 04:09, Adam Ford wrote:
> On Thu, Nov 21, 2024 at 7:22 AM Hugues Fruchet
> <hugues.fruchet@foss.st.com> wrote:
>>
>> Add WebP image decoding support to stateless V4L2 VP8 decoder.
>>
>> This have been tested on STM32MP257-EV board using GStreamer.
>
> I want to test this on an i.MX8M Mini. Is there a certain gstreamer
> version or branch I should use, or is 1.24 sufficient?
The corresponding GStreamer code has been pushed here (v4l2slwebpdec):
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7939
BR,
Hugues.
>
> adam
>>
>> Simple basic test:
>> $> wget https://www.gstatic.com/webp/gallery/1.webp
>> $> gst-launch-1.0 filesrc location= 1.webp ! typefind ! v4l2slwebpdec ! imagefreeze num-buffers=20 ! waylandsink fullscreen=true
>>
>> Slideshow of a set of WebP pictures and WebM video files:
>> $> wget https://www.gstatic.com/webp/gallery/2.webp
>> $> wget https://www.gstatic.com/webp/gallery/3.webp
>> $> wget https://www.gstatic.com/webp/gallery/4.webp
>> $> wget https://www.gstatic.com/webp/gallery/5.webp
>> $> wget https://samplemedia.linaro.org/VP8/big_buck_bunny_480p_VP8_VORBIS_25fps_1900K_short.WebM
>> $> gst-play-1.0 *.webp *.webm *.WebM --wait-on-eos
>> <hit key ">" to display next file >
>>
>> Large WebP image > 16777215 (size > 2^24)
>> $> gst-launch-1.0 fakesrc num-buffers=1 format=4 do-timestamp=true filltype=3 sizetype=2 sizemax=25165824 blocksize=25165824 ! video/x-raw, format=I420, width=4096, height=3072, framerate=1/1 ! webpenc quality=100 ! filesink location=4096x3072_HQ_random.webp
>> $> ls -l 4096x3072_HQ_random.webp
>> [...] 16877404 Nov 20 11:40 4096x3072_HQ_random.webp
>> $> gst-launch-1.0 filesrc location= 4096x3072_HQ_random.webp blocksize=16876610 ! image/webp, width=1, height=1, framerate=0/1 ! v4l2slwebpdec ! imagefreeze num-buffers=20 ! waylandsink fullscreen=true
>>
>> Large WebP image decoding using post-processor is untested because of lack
>> of hardware support on this platform, nevertheless support is provided in
>> this serie for further testing on another platform having post-processor
>> support.
>>
>> ===========
>> = history =
>> ===========
>> version 3:
>> - Fix remarks from Nicolas Dufresne:
>> - Document constraint about key frame only for WebP
>> - Fix rebase issue
>> - Fix typo detected by Diederik de Haas
>>
>> version 2:
>> - Fix remarks from Nicolas Dufresne:
>> - Use bytesperline helper to compute chroma size
>> - Introduce a new explicit WEBP frame compressed format
>> instead of relying on VP8 + WebP flag
>> - 4K support in both decoder and post-proc
>>
>> version 1:
>> - Initial submission
>>
>> Hugues Fruchet (3):
>> media: uapi: add WebP uAPI
>> media: verisilicon: add WebP decoding support
>> media: verisilicon: postproc: 4K support
>>
>> .../userspace-api/media/v4l/biblio.rst | 9 +++++++++
>> .../media/v4l/pixfmt-compressed.rst | 17 +++++++++++++++++
>> drivers/media/platform/verisilicon/hantro.h | 2 ++
>> .../media/platform/verisilicon/hantro_g1_regs.h | 3 ++-
>> .../platform/verisilicon/hantro_g1_vp8_dec.c | 14 ++++++++++++++
>> .../platform/verisilicon/hantro_postproc.c | 6 +++++-
>> .../media/platform/verisilicon/hantro_v4l2.c | 2 ++
>> .../platform/verisilicon/stm32mp25_vpu_hw.c | 17 +++++++++++++++--
>> drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
>> include/uapi/linux/videodev2.h | 1 +
>> 10 files changed, 68 insertions(+), 4 deletions(-)
>>
>> --
>> 2.25.1
>>
>>
^ permalink raw reply [flat|nested] 10+ messages in thread