All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] media: amphion: decoder add support to sorenson spark format
@ 2023-01-12  9:04 ` Ming Qian
  0 siblings, 0 replies; 14+ messages in thread
From: Ming Qian @ 2023-01-12  9:04 UTC (permalink / raw)
  To: mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel

Sorenson Spark is an implementation of H.263 for use
in Flash Video and Adobe Flash files.
amphion decoder can support decoding this video format.

v2
- correct the code in document

Ming Qian (2):
  media: add Sorenson Spark video format
  media: amphion: support to decode sorenson spark video

 .../media/v4l/pixfmt-compressed.rst            |  5 +++++
 drivers/media/platform/amphion/vdec.c          |  7 +++++++
 drivers/media/platform/amphion/vpu_malone.c    | 18 ++++++++++++++++++
 drivers/media/v4l2-core/v4l2-ioctl.c           |  1 +
 include/uapi/linux/videodev2.h                 |  1 +
 5 files changed, 32 insertions(+)

-- 
2.38.1


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 0/2] media: amphion: decoder add support to sorenson spark format
@ 2023-01-12  9:04 ` Ming Qian
  0 siblings, 0 replies; 14+ messages in thread
From: Ming Qian @ 2023-01-12  9:04 UTC (permalink / raw)
  To: mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel

Sorenson Spark is an implementation of H.263 for use
in Flash Video and Adobe Flash files.
amphion decoder can support decoding this video format.

v2
- correct the code in document

Ming Qian (2):
  media: add Sorenson Spark video format
  media: amphion: support to decode sorenson spark video

 .../media/v4l/pixfmt-compressed.rst            |  5 +++++
 drivers/media/platform/amphion/vdec.c          |  7 +++++++
 drivers/media/platform/amphion/vpu_malone.c    | 18 ++++++++++++++++++
 drivers/media/v4l2-core/v4l2-ioctl.c           |  1 +
 include/uapi/linux/videodev2.h                 |  1 +
 5 files changed, 32 insertions(+)

-- 
2.38.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 1/2] media: add Sorenson Spark video format
  2023-01-12  9:04 ` Ming Qian
@ 2023-01-12  9:04   ` Ming Qian
  -1 siblings, 0 replies; 14+ messages in thread
From: Ming Qian @ 2023-01-12  9:04 UTC (permalink / raw)
  To: mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel

Sorenson Spark is an implementation of H.263 for use
in Flash Video and Adobe Flash files.
Sorenson Spark is an incomplete implementation of H.263.
It differs mostly in header structure and ranges of the coefficients.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
---
 Documentation/userspace-api/media/v4l/pixfmt-compressed.rst | 5 +++++
 drivers/media/v4l2-core/v4l2-ioctl.c                        | 1 +
 include/uapi/linux/videodev2.h                              | 1 +
 3 files changed, 7 insertions(+)

diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
index 506dd3c98884..a0230f357680 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
@@ -88,6 +88,11 @@ Compressed Formats
       - ``V4L2_PIX_FMT_H263``
       - 'H263'
       - H263 video elementary stream.
+    * .. _V4L2-PIX-FMT-SPK:
+
+      - ``V4L2_PIX_FMT_SPK``
+      - 'SPK0'
+      - Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files
     * .. _V4L2-PIX-FMT-MPEG1:
 
       - ``V4L2_PIX_FMT_MPEG1``
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 8e0a0ff62a70..9b5b04b8aa69 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1472,6 +1472,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
 		case V4L2_PIX_FMT_HEVC_SLICE:	descr = "HEVC Parsed Slice Data"; break;
 		case V4L2_PIX_FMT_FWHT:		descr = "FWHT"; break; /* used in vicodec */
 		case V4L2_PIX_FMT_FWHT_STATELESS:	descr = "FWHT Stateless"; break; /* used in vicodec */
+		case V4L2_PIX_FMT_SPK:		descr = "Sorenson Spark"; break;
 		case V4L2_PIX_FMT_CPIA1:	descr = "GSPCA CPiA YUV"; break;
 		case V4L2_PIX_FMT_WNVA:		descr = "WNVA"; break;
 		case V4L2_PIX_FMT_SN9C10X:	descr = "GSPCA SN9C10X"; break;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 3c56b81424f3..262ef10cfa02 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -739,6 +739,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_FWHT_STATELESS     v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */
 #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
 #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
+#define V4L2_PIX_FMT_SPK      v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */
 
 /*  Vendor-specific formats   */
 #define V4L2_PIX_FMT_CPIA1    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
-- 
2.38.1


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 1/2] media: add Sorenson Spark video format
@ 2023-01-12  9:04   ` Ming Qian
  0 siblings, 0 replies; 14+ messages in thread
From: Ming Qian @ 2023-01-12  9:04 UTC (permalink / raw)
  To: mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel

Sorenson Spark is an implementation of H.263 for use
in Flash Video and Adobe Flash files.
Sorenson Spark is an incomplete implementation of H.263.
It differs mostly in header structure and ranges of the coefficients.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
---
 Documentation/userspace-api/media/v4l/pixfmt-compressed.rst | 5 +++++
 drivers/media/v4l2-core/v4l2-ioctl.c                        | 1 +
 include/uapi/linux/videodev2.h                              | 1 +
 3 files changed, 7 insertions(+)

diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
index 506dd3c98884..a0230f357680 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
@@ -88,6 +88,11 @@ Compressed Formats
       - ``V4L2_PIX_FMT_H263``
       - 'H263'
       - H263 video elementary stream.
+    * .. _V4L2-PIX-FMT-SPK:
+
+      - ``V4L2_PIX_FMT_SPK``
+      - 'SPK0'
+      - Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files
     * .. _V4L2-PIX-FMT-MPEG1:
 
       - ``V4L2_PIX_FMT_MPEG1``
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 8e0a0ff62a70..9b5b04b8aa69 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1472,6 +1472,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
 		case V4L2_PIX_FMT_HEVC_SLICE:	descr = "HEVC Parsed Slice Data"; break;
 		case V4L2_PIX_FMT_FWHT:		descr = "FWHT"; break; /* used in vicodec */
 		case V4L2_PIX_FMT_FWHT_STATELESS:	descr = "FWHT Stateless"; break; /* used in vicodec */
+		case V4L2_PIX_FMT_SPK:		descr = "Sorenson Spark"; break;
 		case V4L2_PIX_FMT_CPIA1:	descr = "GSPCA CPiA YUV"; break;
 		case V4L2_PIX_FMT_WNVA:		descr = "WNVA"; break;
 		case V4L2_PIX_FMT_SN9C10X:	descr = "GSPCA SN9C10X"; break;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 3c56b81424f3..262ef10cfa02 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -739,6 +739,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_FWHT_STATELESS     v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */
 #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
 #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
+#define V4L2_PIX_FMT_SPK      v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */
 
 /*  Vendor-specific formats   */
 #define V4L2_PIX_FMT_CPIA1    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 2/2] media: amphion: support to decode sorenson spark video
  2023-01-12  9:04 ` Ming Qian
@ 2023-01-12  9:04   ` Ming Qian
  -1 siblings, 0 replies; 14+ messages in thread
From: Ming Qian @ 2023-01-12  9:04 UTC (permalink / raw)
  To: mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel

Sorenson Spark is an implementation of H.263 for use
in Flash Video and Adobe Flash files.
amphion decoder can support it by insert some startcode
before sequence and picture.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
---
 drivers/media/platform/amphion/vdec.c       |  7 +++++++
 drivers/media/platform/amphion/vpu_malone.c | 18 ++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c
index 87f9f8e90ab1..09304b96f40d 100644
--- a/drivers/media/platform/amphion/vdec.c
+++ b/drivers/media/platform/amphion/vdec.c
@@ -165,6 +165,13 @@ static const struct vpu_format vdec_formats[] = {
 		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
 		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
 	},
+	{
+		.pixfmt = V4L2_PIX_FMT_SPK,
+		.mem_planes = 1,
+		.comp_planes = 1,
+		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
+		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
+	},
 	{0, 0, 0, 0},
 };
 
diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c
index 2c9bfc6a5a72..67ba637c4c7f 100644
--- a/drivers/media/platform/amphion/vpu_malone.c
+++ b/drivers/media/platform/amphion/vpu_malone.c
@@ -562,6 +562,7 @@ static struct malone_fmt_mapping fmt_mappings[] = {
 	{V4L2_PIX_FMT_H263,        MALONE_FMT_ASP},
 	{V4L2_PIX_FMT_JPEG,        MALONE_FMT_JPG},
 	{V4L2_PIX_FMT_VP8,         MALONE_FMT_VP8},
+	{V4L2_PIX_FMT_SPK,         MALONE_FMT_SPK},
 };
 
 static enum vpu_malone_format vpu_malone_format_remap(u32 pixelformat)
@@ -987,6 +988,7 @@ static const struct malone_padding_scode padding_scodes[] = {
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
+	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0xefff0000, 0x0}},
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264,        {0x0B010000, 0}},
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264_MVC,    {0x0B010000, 0}},
@@ -998,6 +1000,7 @@ static const struct malone_padding_scode padding_scodes[] = {
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
+	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0x0, 0x0}},
 	{SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264,        {0x15010000, 0x0}},
 	{SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC,    {0x15010000, 0x0}},
@@ -1411,6 +1414,16 @@ static int vpu_malone_insert_scode_vp8_pic(struct malone_scode_t *scode)
 	return size;
 }
 
+static int vpu_malone_insert_scode_spk_seq(struct malone_scode_t *scode)
+{
+	return vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_SPK, 0);
+}
+
+static int vpu_malone_insert_scode_spk_pic(struct malone_scode_t *scode)
+{
+	return vpu_malone_insert_scode_pic(scode, MALONE_CODEC_ID_SPK, 0);
+}
+
 static const struct malone_scode_handler scode_handlers[] = {
 	{
 		/* fix me, need to swap return operation after gstreamer swap */
@@ -1427,6 +1440,11 @@ static const struct malone_scode_handler scode_handlers[] = {
 		.insert_scode_seq = vpu_malone_insert_scode_vp8_seq,
 		.insert_scode_pic = vpu_malone_insert_scode_vp8_pic,
 	},
+	{
+		.pixelformat = V4L2_PIX_FMT_SPK,
+		.insert_scode_seq = vpu_malone_insert_scode_spk_seq,
+		.insert_scode_pic = vpu_malone_insert_scode_spk_pic,
+	},
 };
 
 static const struct malone_scode_handler *get_scode_handler(u32 pixelformat)
-- 
2.38.1


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 2/2] media: amphion: support to decode sorenson spark video
@ 2023-01-12  9:04   ` Ming Qian
  0 siblings, 0 replies; 14+ messages in thread
From: Ming Qian @ 2023-01-12  9:04 UTC (permalink / raw)
  To: mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel

Sorenson Spark is an implementation of H.263 for use
in Flash Video and Adobe Flash files.
amphion decoder can support it by insert some startcode
before sequence and picture.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
---
 drivers/media/platform/amphion/vdec.c       |  7 +++++++
 drivers/media/platform/amphion/vpu_malone.c | 18 ++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c
index 87f9f8e90ab1..09304b96f40d 100644
--- a/drivers/media/platform/amphion/vdec.c
+++ b/drivers/media/platform/amphion/vdec.c
@@ -165,6 +165,13 @@ static const struct vpu_format vdec_formats[] = {
 		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
 		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
 	},
+	{
+		.pixfmt = V4L2_PIX_FMT_SPK,
+		.mem_planes = 1,
+		.comp_planes = 1,
+		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
+		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
+	},
 	{0, 0, 0, 0},
 };
 
diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c
index 2c9bfc6a5a72..67ba637c4c7f 100644
--- a/drivers/media/platform/amphion/vpu_malone.c
+++ b/drivers/media/platform/amphion/vpu_malone.c
@@ -562,6 +562,7 @@ static struct malone_fmt_mapping fmt_mappings[] = {
 	{V4L2_PIX_FMT_H263,        MALONE_FMT_ASP},
 	{V4L2_PIX_FMT_JPEG,        MALONE_FMT_JPG},
 	{V4L2_PIX_FMT_VP8,         MALONE_FMT_VP8},
+	{V4L2_PIX_FMT_SPK,         MALONE_FMT_SPK},
 };
 
 static enum vpu_malone_format vpu_malone_format_remap(u32 pixelformat)
@@ -987,6 +988,7 @@ static const struct malone_padding_scode padding_scodes[] = {
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
+	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0xefff0000, 0x0}},
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264,        {0x0B010000, 0}},
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264_MVC,    {0x0B010000, 0}},
@@ -998,6 +1000,7 @@ static const struct malone_padding_scode padding_scodes[] = {
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
 	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
+	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
 	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0x0, 0x0}},
 	{SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264,        {0x15010000, 0x0}},
 	{SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC,    {0x15010000, 0x0}},
@@ -1411,6 +1414,16 @@ static int vpu_malone_insert_scode_vp8_pic(struct malone_scode_t *scode)
 	return size;
 }
 
+static int vpu_malone_insert_scode_spk_seq(struct malone_scode_t *scode)
+{
+	return vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_SPK, 0);
+}
+
+static int vpu_malone_insert_scode_spk_pic(struct malone_scode_t *scode)
+{
+	return vpu_malone_insert_scode_pic(scode, MALONE_CODEC_ID_SPK, 0);
+}
+
 static const struct malone_scode_handler scode_handlers[] = {
 	{
 		/* fix me, need to swap return operation after gstreamer swap */
@@ -1427,6 +1440,11 @@ static const struct malone_scode_handler scode_handlers[] = {
 		.insert_scode_seq = vpu_malone_insert_scode_vp8_seq,
 		.insert_scode_pic = vpu_malone_insert_scode_vp8_pic,
 	},
+	{
+		.pixelformat = V4L2_PIX_FMT_SPK,
+		.insert_scode_seq = vpu_malone_insert_scode_spk_seq,
+		.insert_scode_pic = vpu_malone_insert_scode_spk_pic,
+	},
 };
 
 static const struct malone_scode_handler *get_scode_handler(u32 pixelformat)
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/2] media: add Sorenson Spark video format
  2023-01-12  9:04   ` Ming Qian
@ 2023-01-19 20:40     ` Nicolas Dufresne
  -1 siblings, 0 replies; 14+ messages in thread
From: Nicolas Dufresne @ 2023-01-19 20:40 UTC (permalink / raw)
  To: Ming Qian, mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel


Le jeudi 12 janvier 2023 à 17:04 +0800, Ming Qian a écrit :
> Sorenson Spark is an implementation of H.263 for use
> in Flash Video and Adobe Flash files.
> Sorenson Spark is an incomplete implementation of H.263.
> It differs mostly in header structure and ranges of the coefficients.
> 
> Signed-off-by: Ming Qian <ming.qian@nxp.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  Documentation/userspace-api/media/v4l/pixfmt-compressed.rst | 5 +++++
>  drivers/media/v4l2-core/v4l2-ioctl.c                        | 1 +
>  include/uapi/linux/videodev2.h                              | 1 +
>  3 files changed, 7 insertions(+)
> 
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> index 506dd3c98884..a0230f357680 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> @@ -88,6 +88,11 @@ Compressed Formats
>        - ``V4L2_PIX_FMT_H263``
>        - 'H263'
>        - H263 video elementary stream.
> +    * .. _V4L2-PIX-FMT-SPK:
> +
> +      - ``V4L2_PIX_FMT_SPK``
> +      - 'SPK0'
> +      - Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files
>      * .. _V4L2-PIX-FMT-MPEG1:
>  
>        - ``V4L2_PIX_FMT_MPEG1``
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 8e0a0ff62a70..9b5b04b8aa69 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1472,6 +1472,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
>  		case V4L2_PIX_FMT_HEVC_SLICE:	descr = "HEVC Parsed Slice Data"; break;
>  		case V4L2_PIX_FMT_FWHT:		descr = "FWHT"; break; /* used in vicodec */
>  		case V4L2_PIX_FMT_FWHT_STATELESS:	descr = "FWHT Stateless"; break; /* used in vicodec */
> +		case V4L2_PIX_FMT_SPK:		descr = "Sorenson Spark"; break;
>  		case V4L2_PIX_FMT_CPIA1:	descr = "GSPCA CPiA YUV"; break;
>  		case V4L2_PIX_FMT_WNVA:		descr = "WNVA"; break;
>  		case V4L2_PIX_FMT_SN9C10X:	descr = "GSPCA SN9C10X"; break;
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 3c56b81424f3..262ef10cfa02 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -739,6 +739,7 @@ struct v4l2_pix_format {
>  #define V4L2_PIX_FMT_FWHT_STATELESS     v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */
>  #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
>  #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
> +#define V4L2_PIX_FMT_SPK      v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */
>  
>  /*  Vendor-specific formats   */
>  #define V4L2_PIX_FMT_CPIA1    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/2] media: add Sorenson Spark video format
@ 2023-01-19 20:40     ` Nicolas Dufresne
  0 siblings, 0 replies; 14+ messages in thread
From: Nicolas Dufresne @ 2023-01-19 20:40 UTC (permalink / raw)
  To: Ming Qian, mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel


Le jeudi 12 janvier 2023 à 17:04 +0800, Ming Qian a écrit :
> Sorenson Spark is an implementation of H.263 for use
> in Flash Video and Adobe Flash files.
> Sorenson Spark is an incomplete implementation of H.263.
> It differs mostly in header structure and ranges of the coefficients.
> 
> Signed-off-by: Ming Qian <ming.qian@nxp.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  Documentation/userspace-api/media/v4l/pixfmt-compressed.rst | 5 +++++
>  drivers/media/v4l2-core/v4l2-ioctl.c                        | 1 +
>  include/uapi/linux/videodev2.h                              | 1 +
>  3 files changed, 7 insertions(+)
> 
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> index 506dd3c98884..a0230f357680 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> @@ -88,6 +88,11 @@ Compressed Formats
>        - ``V4L2_PIX_FMT_H263``
>        - 'H263'
>        - H263 video elementary stream.
> +    * .. _V4L2-PIX-FMT-SPK:
> +
> +      - ``V4L2_PIX_FMT_SPK``
> +      - 'SPK0'
> +      - Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files
>      * .. _V4L2-PIX-FMT-MPEG1:
>  
>        - ``V4L2_PIX_FMT_MPEG1``
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 8e0a0ff62a70..9b5b04b8aa69 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1472,6 +1472,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
>  		case V4L2_PIX_FMT_HEVC_SLICE:	descr = "HEVC Parsed Slice Data"; break;
>  		case V4L2_PIX_FMT_FWHT:		descr = "FWHT"; break; /* used in vicodec */
>  		case V4L2_PIX_FMT_FWHT_STATELESS:	descr = "FWHT Stateless"; break; /* used in vicodec */
> +		case V4L2_PIX_FMT_SPK:		descr = "Sorenson Spark"; break;
>  		case V4L2_PIX_FMT_CPIA1:	descr = "GSPCA CPiA YUV"; break;
>  		case V4L2_PIX_FMT_WNVA:		descr = "WNVA"; break;
>  		case V4L2_PIX_FMT_SN9C10X:	descr = "GSPCA SN9C10X"; break;
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 3c56b81424f3..262ef10cfa02 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -739,6 +739,7 @@ struct v4l2_pix_format {
>  #define V4L2_PIX_FMT_FWHT_STATELESS     v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */
>  #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
>  #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
> +#define V4L2_PIX_FMT_SPK      v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */
>  
>  /*  Vendor-specific formats   */
>  #define V4L2_PIX_FMT_CPIA1    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 2/2] media: amphion: support to decode sorenson spark video
  2023-01-12  9:04   ` Ming Qian
@ 2023-01-19 20:41     ` Nicolas Dufresne
  -1 siblings, 0 replies; 14+ messages in thread
From: Nicolas Dufresne @ 2023-01-19 20:41 UTC (permalink / raw)
  To: Ming Qian, mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel

Le jeudi 12 janvier 2023 à 17:04 +0800, Ming Qian a écrit :
> Sorenson Spark is an implementation of H.263 for use
> in Flash Video and Adobe Flash files.
> amphion decoder can support it by insert some startcode
> before sequence and picture.

Its historical codec, but I'm surprise it does not also support H263 (and
possibly H263+). Note a review comment of course, just a curiosity.

> 
> Signed-off-by: Ming Qian <ming.qian@nxp.com>
> ---
>  drivers/media/platform/amphion/vdec.c       |  7 +++++++
>  drivers/media/platform/amphion/vpu_malone.c | 18 ++++++++++++++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c
> index 87f9f8e90ab1..09304b96f40d 100644
> --- a/drivers/media/platform/amphion/vdec.c
> +++ b/drivers/media/platform/amphion/vdec.c
> @@ -165,6 +165,13 @@ static const struct vpu_format vdec_formats[] = {
>  		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>  		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
>  	},
> +	{
> +		.pixfmt = V4L2_PIX_FMT_SPK,
> +		.mem_planes = 1,
> +		.comp_planes = 1,
> +		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> +		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
> +	},
>  	{0, 0, 0, 0},
>  };
>  
> diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c
> index 2c9bfc6a5a72..67ba637c4c7f 100644
> --- a/drivers/media/platform/amphion/vpu_malone.c
> +++ b/drivers/media/platform/amphion/vpu_malone.c
> @@ -562,6 +562,7 @@ static struct malone_fmt_mapping fmt_mappings[] = {
>  	{V4L2_PIX_FMT_H263,        MALONE_FMT_ASP},
>  	{V4L2_PIX_FMT_JPEG,        MALONE_FMT_JPG},
>  	{V4L2_PIX_FMT_VP8,         MALONE_FMT_VP8},
> +	{V4L2_PIX_FMT_SPK,         MALONE_FMT_SPK},
>  };
>  
>  static enum vpu_malone_format vpu_malone_format_remap(u32 pixelformat)
> @@ -987,6 +988,7 @@ static const struct malone_padding_scode padding_scodes[] = {
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
> +	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0xefff0000, 0x0}},
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264,        {0x0B010000, 0}},
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264_MVC,    {0x0B010000, 0}},
> @@ -998,6 +1000,7 @@ static const struct malone_padding_scode padding_scodes[] = {
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
> +	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0x0, 0x0}},
>  	{SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264,        {0x15010000, 0x0}},
>  	{SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC,    {0x15010000, 0x0}},
> @@ -1411,6 +1414,16 @@ static int vpu_malone_insert_scode_vp8_pic(struct malone_scode_t *scode)
>  	return size;
>  }
>  
> +static int vpu_malone_insert_scode_spk_seq(struct malone_scode_t *scode)
> +{
> +	return vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_SPK, 0);
> +}
> +
> +static int vpu_malone_insert_scode_spk_pic(struct malone_scode_t *scode)
> +{
> +	return vpu_malone_insert_scode_pic(scode, MALONE_CODEC_ID_SPK, 0);
> +}
> +
>  static const struct malone_scode_handler scode_handlers[] = {
>  	{
>  		/* fix me, need to swap return operation after gstreamer swap */
> @@ -1427,6 +1440,11 @@ static const struct malone_scode_handler scode_handlers[] = {
>  		.insert_scode_seq = vpu_malone_insert_scode_vp8_seq,
>  		.insert_scode_pic = vpu_malone_insert_scode_vp8_pic,
>  	},
> +	{
> +		.pixelformat = V4L2_PIX_FMT_SPK,
> +		.insert_scode_seq = vpu_malone_insert_scode_spk_seq,
> +		.insert_scode_pic = vpu_malone_insert_scode_spk_pic,
> +	},
>  };
>  
>  static const struct malone_scode_handler *get_scode_handler(u32 pixelformat)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 2/2] media: amphion: support to decode sorenson spark video
@ 2023-01-19 20:41     ` Nicolas Dufresne
  0 siblings, 0 replies; 14+ messages in thread
From: Nicolas Dufresne @ 2023-01-19 20:41 UTC (permalink / raw)
  To: Ming Qian, mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	xiahong.bao, eagle.zhou, tao.jiang_2, linux-media, linux-kernel,
	linux-arm-kernel

Le jeudi 12 janvier 2023 à 17:04 +0800, Ming Qian a écrit :
> Sorenson Spark is an implementation of H.263 for use
> in Flash Video and Adobe Flash files.
> amphion decoder can support it by insert some startcode
> before sequence and picture.

Its historical codec, but I'm surprise it does not also support H263 (and
possibly H263+). Note a review comment of course, just a curiosity.

> 
> Signed-off-by: Ming Qian <ming.qian@nxp.com>
> ---
>  drivers/media/platform/amphion/vdec.c       |  7 +++++++
>  drivers/media/platform/amphion/vpu_malone.c | 18 ++++++++++++++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c
> index 87f9f8e90ab1..09304b96f40d 100644
> --- a/drivers/media/platform/amphion/vdec.c
> +++ b/drivers/media/platform/amphion/vdec.c
> @@ -165,6 +165,13 @@ static const struct vpu_format vdec_formats[] = {
>  		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>  		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
>  	},
> +	{
> +		.pixfmt = V4L2_PIX_FMT_SPK,
> +		.mem_planes = 1,
> +		.comp_planes = 1,
> +		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> +		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
> +	},
>  	{0, 0, 0, 0},
>  };
>  
> diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c
> index 2c9bfc6a5a72..67ba637c4c7f 100644
> --- a/drivers/media/platform/amphion/vpu_malone.c
> +++ b/drivers/media/platform/amphion/vpu_malone.c
> @@ -562,6 +562,7 @@ static struct malone_fmt_mapping fmt_mappings[] = {
>  	{V4L2_PIX_FMT_H263,        MALONE_FMT_ASP},
>  	{V4L2_PIX_FMT_JPEG,        MALONE_FMT_JPG},
>  	{V4L2_PIX_FMT_VP8,         MALONE_FMT_VP8},
> +	{V4L2_PIX_FMT_SPK,         MALONE_FMT_SPK},
>  };
>  
>  static enum vpu_malone_format vpu_malone_format_remap(u32 pixelformat)
> @@ -987,6 +988,7 @@ static const struct malone_padding_scode padding_scodes[] = {
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
> +	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0xefff0000, 0x0}},
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264,        {0x0B010000, 0}},
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264_MVC,    {0x0B010000, 0}},
> @@ -998,6 +1000,7 @@ static const struct malone_padding_scode padding_scodes[] = {
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
>  	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
> +	{SCODE_PADDING_ABORT,    V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
>  	{SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0x0, 0x0}},
>  	{SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264,        {0x15010000, 0x0}},
>  	{SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC,    {0x15010000, 0x0}},
> @@ -1411,6 +1414,16 @@ static int vpu_malone_insert_scode_vp8_pic(struct malone_scode_t *scode)
>  	return size;
>  }
>  
> +static int vpu_malone_insert_scode_spk_seq(struct malone_scode_t *scode)
> +{
> +	return vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_SPK, 0);
> +}
> +
> +static int vpu_malone_insert_scode_spk_pic(struct malone_scode_t *scode)
> +{
> +	return vpu_malone_insert_scode_pic(scode, MALONE_CODEC_ID_SPK, 0);
> +}
> +
>  static const struct malone_scode_handler scode_handlers[] = {
>  	{
>  		/* fix me, need to swap return operation after gstreamer swap */
> @@ -1427,6 +1440,11 @@ static const struct malone_scode_handler scode_handlers[] = {
>  		.insert_scode_seq = vpu_malone_insert_scode_vp8_seq,
>  		.insert_scode_pic = vpu_malone_insert_scode_vp8_pic,
>  	},
> +	{
> +		.pixelformat = V4L2_PIX_FMT_SPK,
> +		.insert_scode_seq = vpu_malone_insert_scode_spk_seq,
> +		.insert_scode_pic = vpu_malone_insert_scode_spk_pic,
> +	},
>  };
>  
>  static const struct malone_scode_handler *get_scode_handler(u32 pixelformat)


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [EXT] Re: [PATCH v2 2/2] media: amphion: support to decode sorenson spark video
  2023-01-19 20:41     ` Nicolas Dufresne
@ 2023-01-20  9:59       ` Ming Qian
  -1 siblings, 0 replies; 14+ messages in thread
From: Ming Qian @ 2023-01-20  9:59 UTC (permalink / raw)
  To: Nicolas Dufresne, mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, dl-linux-imx,
	X.H. Bao, Eagle Zhou, Tao Jiang, linux-media, linux-kernel,
	linux-arm-kernel

>From: Nicolas Dufresne <nicolas@ndufresne.ca>
>Sent: 2023年1月20日 4:41
>To: Ming Qian <ming.qian@nxp.com>; mchehab@kernel.org; hverkuil-
>cisco@xs4all.nl
>Cc: shawnguo@kernel.org; robh+dt@kernel.org; s.hauer@pengutronix.de;
>kernel@pengutronix.de; festevam@gmail.com; dl-linux-imx <linux-
>imx@nxp.com>; X.H. Bao <xiahong.bao@nxp.com>; Eagle Zhou
><eagle.zhou@nxp.com>; Tao Jiang <tao.jiang_2@nxp.com>; linux-
>media@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
>kernel@lists.infradead.org
>Subject: [EXT] Re: [PATCH v2 2/2] media: amphion: support to decode
>sorenson spark video
>
>Caution: EXT Email
>
>Le jeudi 12 janvier 2023 à 17:04 +0800, Ming Qian a écrit :
>> Sorenson Spark is an implementation of H.263 for use in Flash Video
>> and Adobe Flash files.
>> amphion decoder can support it by insert some startcode before
>> sequence and picture.
>
>Its historical codec, but I'm surprise it does not also support H263 (and
>possibly H263+). Note a review comment of course, just a curiosity.
>

Hi Nicolas,
    The decoder does support H263, but for sorenson spark, the vpu requires extra startcode, but H263 doesn't.
So driver can't reuse H263 for format spark, as driver need to insert the startcode for format spark.

Ming

>>
>> Signed-off-by: Ming Qian <ming.qian@nxp.com>
>> ---
>>  drivers/media/platform/amphion/vdec.c       |  7 +++++++
>>  drivers/media/platform/amphion/vpu_malone.c | 18 ++++++++++++++++++
>>  2 files changed, 25 insertions(+)
>>
>> diff --git a/drivers/media/platform/amphion/vdec.c
>> b/drivers/media/platform/amphion/vdec.c
>> index 87f9f8e90ab1..09304b96f40d 100644
>> --- a/drivers/media/platform/amphion/vdec.c
>> +++ b/drivers/media/platform/amphion/vdec.c
>> @@ -165,6 +165,13 @@ static const struct vpu_format vdec_formats[] = {
>>               .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>>               .flags = V4L2_FMT_FLAG_DYN_RESOLUTION |
>V4L2_FMT_FLAG_COMPRESSED
>>       },
>> +     {
>> +             .pixfmt = V4L2_PIX_FMT_SPK,
>> +             .mem_planes = 1,
>> +             .comp_planes = 1,
>> +             .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>> +             .flags = V4L2_FMT_FLAG_DYN_RESOLUTION |
>V4L2_FMT_FLAG_COMPRESSED
>> +     },
>>       {0, 0, 0, 0},
>>  };
>>
>> diff --git a/drivers/media/platform/amphion/vpu_malone.c
>> b/drivers/media/platform/amphion/vpu_malone.c
>> index 2c9bfc6a5a72..67ba637c4c7f 100644
>> --- a/drivers/media/platform/amphion/vpu_malone.c
>> +++ b/drivers/media/platform/amphion/vpu_malone.c
>> @@ -562,6 +562,7 @@ static struct malone_fmt_mapping fmt_mappings[] =
>{
>>       {V4L2_PIX_FMT_H263,        MALONE_FMT_ASP},
>>       {V4L2_PIX_FMT_JPEG,        MALONE_FMT_JPG},
>>       {V4L2_PIX_FMT_VP8,         MALONE_FMT_VP8},
>> +     {V4L2_PIX_FMT_SPK,         MALONE_FMT_SPK},
>>  };
>>
>>  static enum vpu_malone_format vpu_malone_format_remap(u32
>> pixelformat) @@ -987,6 +988,7 @@ static const struct
>malone_padding_scode padding_scodes[] = {
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
>> +     {SCODE_PADDING_EOS,      V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0xefff0000, 0x0}},
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264,        {0x0B010000, 0}},
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264_MVC,    {0x0B010000,
>0}},
>> @@ -998,6 +1000,7 @@ static const struct malone_padding_scode
>padding_scodes[] = {
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_XVID,        {0xb1010000,
>0x0}},
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H263,        {0xb1010000,
>0x0}},
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_VP8,         {0x34010000,
>0x0}},
>> +     {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_SPK,         {0x34010000,
>0x0}},
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0x0, 0x0}},
>>       {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264,        {0x15010000,
>0x0}},
>>       {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC,
>{0x15010000, 0x0}},
>> @@ -1411,6 +1414,16 @@ static int
>vpu_malone_insert_scode_vp8_pic(struct malone_scode_t *scode)
>>       return size;
>>  }
>>
>> +static int vpu_malone_insert_scode_spk_seq(struct malone_scode_t
>> +*scode) {
>> +     return vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_SPK,
>> +0); }
>> +
>> +static int vpu_malone_insert_scode_spk_pic(struct malone_scode_t
>> +*scode) {
>> +     return vpu_malone_insert_scode_pic(scode, MALONE_CODEC_ID_SPK,
>> +0); }
>> +
>>  static const struct malone_scode_handler scode_handlers[] = {
>>       {
>>               /* fix me, need to swap return operation after gstreamer
>> swap */ @@ -1427,6 +1440,11 @@ static const struct
>malone_scode_handler scode_handlers[] = {
>>               .insert_scode_seq = vpu_malone_insert_scode_vp8_seq,
>>               .insert_scode_pic = vpu_malone_insert_scode_vp8_pic,
>>       },
>> +     {
>> +             .pixelformat = V4L2_PIX_FMT_SPK,
>> +             .insert_scode_seq = vpu_malone_insert_scode_spk_seq,
>> +             .insert_scode_pic = vpu_malone_insert_scode_spk_pic,
>> +     },
>>  };
>>
>>  static const struct malone_scode_handler *get_scode_handler(u32
>> pixelformat)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [EXT] Re: [PATCH v2 2/2] media: amphion: support to decode sorenson spark video
@ 2023-01-20  9:59       ` Ming Qian
  0 siblings, 0 replies; 14+ messages in thread
From: Ming Qian @ 2023-01-20  9:59 UTC (permalink / raw)
  To: Nicolas Dufresne, mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, dl-linux-imx,
	X.H. Bao, Eagle Zhou, Tao Jiang, linux-media, linux-kernel,
	linux-arm-kernel

>From: Nicolas Dufresne <nicolas@ndufresne.ca>
>Sent: 2023年1月20日 4:41
>To: Ming Qian <ming.qian@nxp.com>; mchehab@kernel.org; hverkuil-
>cisco@xs4all.nl
>Cc: shawnguo@kernel.org; robh+dt@kernel.org; s.hauer@pengutronix.de;
>kernel@pengutronix.de; festevam@gmail.com; dl-linux-imx <linux-
>imx@nxp.com>; X.H. Bao <xiahong.bao@nxp.com>; Eagle Zhou
><eagle.zhou@nxp.com>; Tao Jiang <tao.jiang_2@nxp.com>; linux-
>media@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
>kernel@lists.infradead.org
>Subject: [EXT] Re: [PATCH v2 2/2] media: amphion: support to decode
>sorenson spark video
>
>Caution: EXT Email
>
>Le jeudi 12 janvier 2023 à 17:04 +0800, Ming Qian a écrit :
>> Sorenson Spark is an implementation of H.263 for use in Flash Video
>> and Adobe Flash files.
>> amphion decoder can support it by insert some startcode before
>> sequence and picture.
>
>Its historical codec, but I'm surprise it does not also support H263 (and
>possibly H263+). Note a review comment of course, just a curiosity.
>

Hi Nicolas,
    The decoder does support H263, but for sorenson spark, the vpu requires extra startcode, but H263 doesn't.
So driver can't reuse H263 for format spark, as driver need to insert the startcode for format spark.

Ming

>>
>> Signed-off-by: Ming Qian <ming.qian@nxp.com>
>> ---
>>  drivers/media/platform/amphion/vdec.c       |  7 +++++++
>>  drivers/media/platform/amphion/vpu_malone.c | 18 ++++++++++++++++++
>>  2 files changed, 25 insertions(+)
>>
>> diff --git a/drivers/media/platform/amphion/vdec.c
>> b/drivers/media/platform/amphion/vdec.c
>> index 87f9f8e90ab1..09304b96f40d 100644
>> --- a/drivers/media/platform/amphion/vdec.c
>> +++ b/drivers/media/platform/amphion/vdec.c
>> @@ -165,6 +165,13 @@ static const struct vpu_format vdec_formats[] = {
>>               .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>>               .flags = V4L2_FMT_FLAG_DYN_RESOLUTION |
>V4L2_FMT_FLAG_COMPRESSED
>>       },
>> +     {
>> +             .pixfmt = V4L2_PIX_FMT_SPK,
>> +             .mem_planes = 1,
>> +             .comp_planes = 1,
>> +             .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>> +             .flags = V4L2_FMT_FLAG_DYN_RESOLUTION |
>V4L2_FMT_FLAG_COMPRESSED
>> +     },
>>       {0, 0, 0, 0},
>>  };
>>
>> diff --git a/drivers/media/platform/amphion/vpu_malone.c
>> b/drivers/media/platform/amphion/vpu_malone.c
>> index 2c9bfc6a5a72..67ba637c4c7f 100644
>> --- a/drivers/media/platform/amphion/vpu_malone.c
>> +++ b/drivers/media/platform/amphion/vpu_malone.c
>> @@ -562,6 +562,7 @@ static struct malone_fmt_mapping fmt_mappings[] =
>{
>>       {V4L2_PIX_FMT_H263,        MALONE_FMT_ASP},
>>       {V4L2_PIX_FMT_JPEG,        MALONE_FMT_JPG},
>>       {V4L2_PIX_FMT_VP8,         MALONE_FMT_VP8},
>> +     {V4L2_PIX_FMT_SPK,         MALONE_FMT_SPK},
>>  };
>>
>>  static enum vpu_malone_format vpu_malone_format_remap(u32
>> pixelformat) @@ -987,6 +988,7 @@ static const struct
>malone_padding_scode padding_scodes[] = {
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_XVID,        {0xb1010000, 0x0}},
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_H263,        {0xb1010000, 0x0}},
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_VP8,         {0x34010000, 0x0}},
>> +     {SCODE_PADDING_EOS,      V4L2_PIX_FMT_SPK,         {0x34010000, 0x0}},
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0xefff0000, 0x0}},
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264,        {0x0B010000, 0}},
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264_MVC,    {0x0B010000,
>0}},
>> @@ -998,6 +1000,7 @@ static const struct malone_padding_scode
>padding_scodes[] = {
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_XVID,        {0xb1010000,
>0x0}},
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H263,        {0xb1010000,
>0x0}},
>>       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_VP8,         {0x34010000,
>0x0}},
>> +     {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_SPK,         {0x34010000,
>0x0}},
>>       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0x0, 0x0}},
>>       {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264,        {0x15010000,
>0x0}},
>>       {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC,
>{0x15010000, 0x0}},
>> @@ -1411,6 +1414,16 @@ static int
>vpu_malone_insert_scode_vp8_pic(struct malone_scode_t *scode)
>>       return size;
>>  }
>>
>> +static int vpu_malone_insert_scode_spk_seq(struct malone_scode_t
>> +*scode) {
>> +     return vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_SPK,
>> +0); }
>> +
>> +static int vpu_malone_insert_scode_spk_pic(struct malone_scode_t
>> +*scode) {
>> +     return vpu_malone_insert_scode_pic(scode, MALONE_CODEC_ID_SPK,
>> +0); }
>> +
>>  static const struct malone_scode_handler scode_handlers[] = {
>>       {
>>               /* fix me, need to swap return operation after gstreamer
>> swap */ @@ -1427,6 +1440,11 @@ static const struct
>malone_scode_handler scode_handlers[] = {
>>               .insert_scode_seq = vpu_malone_insert_scode_vp8_seq,
>>               .insert_scode_pic = vpu_malone_insert_scode_vp8_pic,
>>       },
>> +     {
>> +             .pixelformat = V4L2_PIX_FMT_SPK,
>> +             .insert_scode_seq = vpu_malone_insert_scode_spk_seq,
>> +             .insert_scode_pic = vpu_malone_insert_scode_spk_pic,
>> +     },
>>  };
>>
>>  static const struct malone_scode_handler *get_scode_handler(u32
>> pixelformat)

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [EXT] Re: [PATCH v2 2/2] media: amphion: support to decode sorenson spark video
  2023-01-20  9:59       ` Ming Qian
@ 2023-01-23 19:46         ` Nicolas Dufresne
  -1 siblings, 0 replies; 14+ messages in thread
From: Nicolas Dufresne @ 2023-01-23 19:46 UTC (permalink / raw)
  To: Ming Qian, mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, dl-linux-imx,
	X.H. Bao, Eagle Zhou, Tao Jiang, linux-media, linux-kernel,
	linux-arm-kernel

Le vendredi 20 janvier 2023 à 09:59 +0000, Ming Qian a écrit :
> > From: Nicolas Dufresne <nicolas@ndufresne.ca>
> > Sent: 2023年1月20日 4:41
> > To: Ming Qian <ming.qian@nxp.com>; mchehab@kernel.org; hverkuil-
> > cisco@xs4all.nl
> > Cc: shawnguo@kernel.org; robh+dt@kernel.org; s.hauer@pengutronix.de;
> > kernel@pengutronix.de; festevam@gmail.com; dl-linux-imx <linux-
> > imx@nxp.com>; X.H. Bao <xiahong.bao@nxp.com>; Eagle Zhou
> > <eagle.zhou@nxp.com>; Tao Jiang <tao.jiang_2@nxp.com>; linux-
> > media@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
> > kernel@lists.infradead.org
> > Subject: [EXT] Re: [PATCH v2 2/2] media: amphion: support to decode
> > sorenson spark video
> > 
> > Caution: EXT Email
> > 
> > Le jeudi 12 janvier 2023 à 17:04 +0800, Ming Qian a écrit :
> > > Sorenson Spark is an implementation of H.263 for use in Flash Video
> > > and Adobe Flash files.
> > > amphion decoder can support it by insert some startcode before
> > > sequence and picture.
> > 
> > Its historical codec, but I'm surprise it does not also support H263 (and
> > possibly H263+). Note a review comment of course, just a curiosity.
> > 
> 
> Hi Nicolas,
>     The decoder does support H263, but for sorenson spark, the vpu requires
> extra startcode, but H263 doesn't.
> So driver can't reuse H263 for format spark, as driver need to insert the
> startcode for format spark.

Ack.

I noticed later that it was supported and it make sense to make this a specific
formats, its not compatible, even though both are H264.
> 
> Ming
> 
> > > 
> > > Signed-off-by: Ming Qian <ming.qian@nxp.com>
> > > ---
> > >  drivers/media/platform/amphion/vdec.c       |  7 +++++++
> > >  drivers/media/platform/amphion/vpu_malone.c | 18 ++++++++++++++++++
> > >  2 files changed, 25 insertions(+)
> > > 
> > > diff --git a/drivers/media/platform/amphion/vdec.c
> > > b/drivers/media/platform/amphion/vdec.c
> > > index 87f9f8e90ab1..09304b96f40d 100644
> > > --- a/drivers/media/platform/amphion/vdec.c
> > > +++ b/drivers/media/platform/amphion/vdec.c
> > > @@ -165,6 +165,13 @@ static const struct vpu_format vdec_formats[] = {
> > >               .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> > >               .flags = V4L2_FMT_FLAG_DYN_RESOLUTION |
> > V4L2_FMT_FLAG_COMPRESSED
> > >       },
> > > +     {
> > > +             .pixfmt = V4L2_PIX_FMT_SPK,
> > > +             .mem_planes = 1,
> > > +             .comp_planes = 1,
> > > +             .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> > > +             .flags = V4L2_FMT_FLAG_DYN_RESOLUTION |
> > V4L2_FMT_FLAG_COMPRESSED
> > > +     },
> > >       {0, 0, 0, 0},
> > >  };
> > > 
> > > diff --git a/drivers/media/platform/amphion/vpu_malone.c
> > > b/drivers/media/platform/amphion/vpu_malone.c
> > > index 2c9bfc6a5a72..67ba637c4c7f 100644
> > > --- a/drivers/media/platform/amphion/vpu_malone.c
> > > +++ b/drivers/media/platform/amphion/vpu_malone.c
> > > @@ -562,6 +562,7 @@ static struct malone_fmt_mapping fmt_mappings[] =
> > {
> > >       {V4L2_PIX_FMT_H263,        MALONE_FMT_ASP},
> > >       {V4L2_PIX_FMT_JPEG,        MALONE_FMT_JPG},
> > >       {V4L2_PIX_FMT_VP8,         MALONE_FMT_VP8},
> > > +     {V4L2_PIX_FMT_SPK,         MALONE_FMT_SPK},
> > >  };
> > > 
> > >  static enum vpu_malone_format vpu_malone_format_remap(u32
> > > pixelformat) @@ -987,6 +988,7 @@ static const struct
> > malone_padding_scode padding_scodes[] = {
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_XVID,        {0xb1010000,
> > > 0x0}},
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_H263,        {0xb1010000,
> > > 0x0}},
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_VP8,         {0x34010000,
> > > 0x0}},
> > > +     {SCODE_PADDING_EOS,      V4L2_PIX_FMT_SPK,         {0x34010000,
> > > 0x0}},
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0xefff0000,
> > > 0x0}},
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264,        {0x0B010000, 0}},
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264_MVC,    {0x0B010000,
> > 0}},
> > > @@ -998,6 +1000,7 @@ static const struct malone_padding_scode
> > padding_scodes[] = {
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_XVID,        {0xb1010000,
> > 0x0}},
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H263,        {0xb1010000,
> > 0x0}},
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_VP8,         {0x34010000,
> > 0x0}},
> > > +     {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_SPK,         {0x34010000,
> > 0x0}},
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0x0, 0x0}},
> > >       {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264,        {0x15010000,
> > 0x0}},
> > >       {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC,
> > {0x15010000, 0x0}},
> > > @@ -1411,6 +1414,16 @@ static int
> > vpu_malone_insert_scode_vp8_pic(struct malone_scode_t *scode)
> > >       return size;
> > >  }
> > > 
> > > +static int vpu_malone_insert_scode_spk_seq(struct malone_scode_t
> > > +*scode) {
> > > +     return vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_SPK,
> > > +0); }
> > > +
> > > +static int vpu_malone_insert_scode_spk_pic(struct malone_scode_t
> > > +*scode) {
> > > +     return vpu_malone_insert_scode_pic(scode, MALONE_CODEC_ID_SPK,
> > > +0); }
> > > +
> > >  static const struct malone_scode_handler scode_handlers[] = {
> > >       {
> > >               /* fix me, need to swap return operation after gstreamer
> > > swap */ @@ -1427,6 +1440,11 @@ static const struct
> > malone_scode_handler scode_handlers[] = {
> > >               .insert_scode_seq = vpu_malone_insert_scode_vp8_seq,
> > >               .insert_scode_pic = vpu_malone_insert_scode_vp8_pic,
> > >       },
> > > +     {
> > > +             .pixelformat = V4L2_PIX_FMT_SPK,
> > > +             .insert_scode_seq = vpu_malone_insert_scode_spk_seq,
> > > +             .insert_scode_pic = vpu_malone_insert_scode_spk_pic,
> > > +     },
> > >  };
> > > 
> > >  static const struct malone_scode_handler *get_scode_handler(u32
> > > pixelformat)
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [EXT] Re: [PATCH v2 2/2] media: amphion: support to decode sorenson spark video
@ 2023-01-23 19:46         ` Nicolas Dufresne
  0 siblings, 0 replies; 14+ messages in thread
From: Nicolas Dufresne @ 2023-01-23 19:46 UTC (permalink / raw)
  To: Ming Qian, mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, dl-linux-imx,
	X.H. Bao, Eagle Zhou, Tao Jiang, linux-media, linux-kernel,
	linux-arm-kernel

Le vendredi 20 janvier 2023 à 09:59 +0000, Ming Qian a écrit :
> > From: Nicolas Dufresne <nicolas@ndufresne.ca>
> > Sent: 2023年1月20日 4:41
> > To: Ming Qian <ming.qian@nxp.com>; mchehab@kernel.org; hverkuil-
> > cisco@xs4all.nl
> > Cc: shawnguo@kernel.org; robh+dt@kernel.org; s.hauer@pengutronix.de;
> > kernel@pengutronix.de; festevam@gmail.com; dl-linux-imx <linux-
> > imx@nxp.com>; X.H. Bao <xiahong.bao@nxp.com>; Eagle Zhou
> > <eagle.zhou@nxp.com>; Tao Jiang <tao.jiang_2@nxp.com>; linux-
> > media@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
> > kernel@lists.infradead.org
> > Subject: [EXT] Re: [PATCH v2 2/2] media: amphion: support to decode
> > sorenson spark video
> > 
> > Caution: EXT Email
> > 
> > Le jeudi 12 janvier 2023 à 17:04 +0800, Ming Qian a écrit :
> > > Sorenson Spark is an implementation of H.263 for use in Flash Video
> > > and Adobe Flash files.
> > > amphion decoder can support it by insert some startcode before
> > > sequence and picture.
> > 
> > Its historical codec, but I'm surprise it does not also support H263 (and
> > possibly H263+). Note a review comment of course, just a curiosity.
> > 
> 
> Hi Nicolas,
>     The decoder does support H263, but for sorenson spark, the vpu requires
> extra startcode, but H263 doesn't.
> So driver can't reuse H263 for format spark, as driver need to insert the
> startcode for format spark.

Ack.

I noticed later that it was supported and it make sense to make this a specific
formats, its not compatible, even though both are H264.
> 
> Ming
> 
> > > 
> > > Signed-off-by: Ming Qian <ming.qian@nxp.com>
> > > ---
> > >  drivers/media/platform/amphion/vdec.c       |  7 +++++++
> > >  drivers/media/platform/amphion/vpu_malone.c | 18 ++++++++++++++++++
> > >  2 files changed, 25 insertions(+)
> > > 
> > > diff --git a/drivers/media/platform/amphion/vdec.c
> > > b/drivers/media/platform/amphion/vdec.c
> > > index 87f9f8e90ab1..09304b96f40d 100644
> > > --- a/drivers/media/platform/amphion/vdec.c
> > > +++ b/drivers/media/platform/amphion/vdec.c
> > > @@ -165,6 +165,13 @@ static const struct vpu_format vdec_formats[] = {
> > >               .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> > >               .flags = V4L2_FMT_FLAG_DYN_RESOLUTION |
> > V4L2_FMT_FLAG_COMPRESSED
> > >       },
> > > +     {
> > > +             .pixfmt = V4L2_PIX_FMT_SPK,
> > > +             .mem_planes = 1,
> > > +             .comp_planes = 1,
> > > +             .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> > > +             .flags = V4L2_FMT_FLAG_DYN_RESOLUTION |
> > V4L2_FMT_FLAG_COMPRESSED
> > > +     },
> > >       {0, 0, 0, 0},
> > >  };
> > > 
> > > diff --git a/drivers/media/platform/amphion/vpu_malone.c
> > > b/drivers/media/platform/amphion/vpu_malone.c
> > > index 2c9bfc6a5a72..67ba637c4c7f 100644
> > > --- a/drivers/media/platform/amphion/vpu_malone.c
> > > +++ b/drivers/media/platform/amphion/vpu_malone.c
> > > @@ -562,6 +562,7 @@ static struct malone_fmt_mapping fmt_mappings[] =
> > {
> > >       {V4L2_PIX_FMT_H263,        MALONE_FMT_ASP},
> > >       {V4L2_PIX_FMT_JPEG,        MALONE_FMT_JPG},
> > >       {V4L2_PIX_FMT_VP8,         MALONE_FMT_VP8},
> > > +     {V4L2_PIX_FMT_SPK,         MALONE_FMT_SPK},
> > >  };
> > > 
> > >  static enum vpu_malone_format vpu_malone_format_remap(u32
> > > pixelformat) @@ -987,6 +988,7 @@ static const struct
> > malone_padding_scode padding_scodes[] = {
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_XVID,        {0xb1010000,
> > > 0x0}},
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_H263,        {0xb1010000,
> > > 0x0}},
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_VP8,         {0x34010000,
> > > 0x0}},
> > > +     {SCODE_PADDING_EOS,      V4L2_PIX_FMT_SPK,         {0x34010000,
> > > 0x0}},
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0xefff0000,
> > > 0x0}},
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264,        {0x0B010000, 0}},
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H264_MVC,    {0x0B010000,
> > 0}},
> > > @@ -998,6 +1000,7 @@ static const struct malone_padding_scode
> > padding_scodes[] = {
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_XVID,        {0xb1010000,
> > 0x0}},
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_H263,        {0xb1010000,
> > 0x0}},
> > >       {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_VP8,         {0x34010000,
> > 0x0}},
> > > +     {SCODE_PADDING_ABORT,    V4L2_PIX_FMT_SPK,         {0x34010000,
> > 0x0}},
> > >       {SCODE_PADDING_EOS,      V4L2_PIX_FMT_JPEG,        {0x0, 0x0}},
> > >       {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264,        {0x15010000,
> > 0x0}},
> > >       {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC,
> > {0x15010000, 0x0}},
> > > @@ -1411,6 +1414,16 @@ static int
> > vpu_malone_insert_scode_vp8_pic(struct malone_scode_t *scode)
> > >       return size;
> > >  }
> > > 
> > > +static int vpu_malone_insert_scode_spk_seq(struct malone_scode_t
> > > +*scode) {
> > > +     return vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_SPK,
> > > +0); }
> > > +
> > > +static int vpu_malone_insert_scode_spk_pic(struct malone_scode_t
> > > +*scode) {
> > > +     return vpu_malone_insert_scode_pic(scode, MALONE_CODEC_ID_SPK,
> > > +0); }
> > > +
> > >  static const struct malone_scode_handler scode_handlers[] = {
> > >       {
> > >               /* fix me, need to swap return operation after gstreamer
> > > swap */ @@ -1427,6 +1440,11 @@ static const struct
> > malone_scode_handler scode_handlers[] = {
> > >               .insert_scode_seq = vpu_malone_insert_scode_vp8_seq,
> > >               .insert_scode_pic = vpu_malone_insert_scode_vp8_pic,
> > >       },
> > > +     {
> > > +             .pixelformat = V4L2_PIX_FMT_SPK,
> > > +             .insert_scode_seq = vpu_malone_insert_scode_spk_seq,
> > > +             .insert_scode_pic = vpu_malone_insert_scode_spk_pic,
> > > +     },
> > >  };
> > > 
> > >  static const struct malone_scode_handler *get_scode_handler(u32
> > > pixelformat)
> 


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-01-23 19:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-12  9:04 [PATCH v2 0/2] media: amphion: decoder add support to sorenson spark format Ming Qian
2023-01-12  9:04 ` Ming Qian
2023-01-12  9:04 ` [PATCH v2 1/2] media: add Sorenson Spark video format Ming Qian
2023-01-12  9:04   ` Ming Qian
2023-01-19 20:40   ` Nicolas Dufresne
2023-01-19 20:40     ` Nicolas Dufresne
2023-01-12  9:04 ` [PATCH v2 2/2] media: amphion: support to decode sorenson spark video Ming Qian
2023-01-12  9:04   ` Ming Qian
2023-01-19 20:41   ` Nicolas Dufresne
2023-01-19 20:41     ` Nicolas Dufresne
2023-01-20  9:59     ` [EXT] " Ming Qian
2023-01-20  9:59       ` Ming Qian
2023-01-23 19:46       ` Nicolas Dufresne
2023-01-23 19:46         ` Nicolas Dufresne

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.