mbox series

[0/6] Stateless FWHT de-staging

Message ID 20201126132717.1216907-1-hverkuil-cisco@xs4all.nl
Headers show
Series Stateless FWHT de-staging | expand

Message

Hans Verkuil Nov. 26, 2020, 1:27 p.m. UTC
This series sits on top of Ezequiel's H.264 de-staging series:

https://patchwork.linuxtv.org/project/linux-media/cover/20201126093618.137292-1-ezequiel@collabora.com/

The first patch does a rename of the FWHT version and FWHT flags,
since these will become part of the public API. No other changes
in this patch.

The second patch moves all the FWHT-related API elements to the
public headers and deletes include/media/fwht-ctrls.h.

The third moves the FWHT stateless documentation to
ext-ctrls-codec-stateless.rst (no other changes).

The 4th and 5th patches clean up some formatting issues, not
related to FWHT.

The final patch documents V4L2_CTRL_TYPE_FWHT_PARAMS and p_fwht_params
and improves the V4L2_PIX_FMT_FWHT_STATELESS description.

Regards,

        Hans

Hans Verkuil (6):
  vicodec: add V4L2_ prefix before FWHT_VERSION and FWHT_FL_*
  vicodec: mark the stateless FWHT API as stable
  ext-ctrls-codec.rst: move FWHT docs to ext-ctrls-codec-stateless.rst
  pixfmt-compressed.rst: fix 'bullet' formatting
  vidioc-g-ext-ctrls.rst: add missing 'struct' before the types
  userspace-api/media: finalize stateless FWHT codec docs

 .../media/v4l/ext-ctrls-codec-stateless.rst   | 120 +++++++++++++++++
 .../media/v4l/ext-ctrls-codec.rst             | 121 ------------------
 .../media/v4l/pixfmt-compressed.rst           |  12 +-
 .../media/v4l/vidioc-g-ext-ctrls.rst          |  18 ++-
 .../media/v4l/vidioc-queryctrl.rst            |   6 +
 .../media/videodev2.h.rst.exceptions          |   1 +
 .../media/test-drivers/vicodec/codec-fwht.c   |  13 +-
 .../media/test-drivers/vicodec/codec-fwht.h   |  32 -----
 .../test-drivers/vicodec/codec-v4l2-fwht.c    |  88 ++++++-------
 .../media/test-drivers/vicodec/vicodec-core.c |  46 +++----
 drivers/media/v4l2-core/v4l2-ctrls.c          |  20 ++-
 include/media/fwht-ctrls.h                    |  31 -----
 include/media/v4l2-ctrls.h                    |   1 -
 include/uapi/linux/v4l2-controls.h            |  70 ++++++++++
 include/uapi/linux/videodev2.h                |   3 +
 15 files changed, 310 insertions(+), 272 deletions(-)
 delete mode 100644 include/media/fwht-ctrls.h

Comments

Mauro Carvalho Chehab Dec. 3, 2020, 10:49 a.m. UTC | #1
Em Thu, 26 Nov 2020 14:27:16 +0100
Hans Verkuil <hverkuil-cisco@xs4all.nl> escreveu:

> Add 'struct' to clarify that these are pointers to structs.


This patch is actually wrong :-)

It is incompatible with Sphinx 3.

> 

> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

> ---

>  .../userspace-api/media/v4l/vidioc-g-ext-ctrls.rst | 14 +++++++-------

>  1 file changed, 7 insertions(+), 7 deletions(-)

> 

> diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> index 726d6a97325f..5b1fc62ade0d 100644

> --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> @@ -180,31 +180,31 @@ still cause this situation.

>        - ``p_u32``

>        - A pointer to a matrix control of unsigned 32-bit values. Valid if

>  	this control is of type ``V4L2_CTRL_TYPE_U32``.

> -    * - :c:type:`v4l2_area` *

> +    * - struct :c:type:`v4l2_area` *



See, with Sphinx 3, :c:type: can only be used for typedefs and defines.

The right markup for struct is:

	:c:struct:

Actually, due to automarkup.py extension, I would just rename them to:

	struct foo

And let the automarkup code to use the right markup, as it will ensure
that the proper dialect will be used, no matter what Sphinx version 
will be used to produce the docs.

So, I'll drop this patch from the series. I'll propose a new one
instead, after testing with multiple versions of Sphinx.

Regards,
Mauro



>        - ``p_area``

>        - A pointer to a struct :c:type:`v4l2_area`. Valid if this control is

>          of type ``V4L2_CTRL_TYPE_AREA``.

> -    * - :c:type:`v4l2_ctrl_h264_sps` *

> +    * - struct :c:type:`v4l2_ctrl_h264_sps` *

>        - ``p_h264_sps``

>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_sps`. Valid if this control is

>          of type ``V4L2_CTRL_TYPE_H264_SPS``.

> -    * - :c:type:`v4l2_ctrl_h264_pps` *

> +    * - struct :c:type:`v4l2_ctrl_h264_pps` *

>        - ``p_h264_pps``

>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_pps`. Valid if this control is

>          of type ``V4L2_CTRL_TYPE_H264_PPS``.

> -    * - :c:type:`v4l2_ctrl_h264_scaling_matrix` *

> +    * - struct :c:type:`v4l2_ctrl_h264_scaling_matrix` *

>        - ``p_h264_scaling_matrix``

>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_scaling_matrix`. Valid if this control is

>          of type ``V4L2_CTRL_TYPE_H264_SCALING_MATRIX``.

> -    * - :c:type:`v4l2_ctrl_h264_pred_weights` *

> +    * - struct :c:type:`v4l2_ctrl_h264_pred_weights` *

>        - ``p_h264_pred_weights``

>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_pred_weights`. Valid if this control is

>          of type ``V4L2_CTRL_TYPE_H264_PRED_WEIGHTS``.

> -    * - :c:type:`v4l2_ctrl_h264_slice_params` *

> +    * - struct :c:type:`v4l2_ctrl_h264_slice_params` *

>        - ``p_h264_slice_params``

>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_slice_params`. Valid if this control is

>          of type ``V4L2_CTRL_TYPE_H264_SLICE_PARAMS``.

> -    * - :c:type:`v4l2_ctrl_h264_decode_params` *

> +    * - struct :c:type:`v4l2_ctrl_h264_decode_params` *

>        - ``p_h264_decode_params``

>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_decode_params`. Valid if this control is

>          of type ``V4L2_CTRL_TYPE_H264_DECODE_PARAMS``.




Thanks,
Mauro
Mauro Carvalho Chehab Dec. 3, 2020, 10:50 a.m. UTC | #2
Em Thu, 26 Nov 2020 14:27:17 +0100
Hans Verkuil <hverkuil-cisco@xs4all.nl> escreveu:

> Document V4L2_CTRL_TYPE_FWHT_PARAMS and p_fwht_params. Also

> improve the V4L2_PIX_FMT_FWHT_STATELESS description.

> 

> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

> ---

>  Documentation/userspace-api/media/v4l/pixfmt-compressed.rst | 4 +++-

>  .../userspace-api/media/v4l/vidioc-g-ext-ctrls.rst          | 4 ++++

>  Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst  | 6 ++++++

>  .../userspace-api/media/videodev2.h.rst.exceptions          | 1 +

>  4 files changed, 14 insertions(+), 1 deletion(-)

> 

> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst

> index 4ae737520925..acad5f3ca0c1 100644

> --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst

> +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst

> @@ -217,4 +217,6 @@ Compressed Formats

>        - ``V4L2_PIX_FMT_FWHT_STATELESS``

>        - 'SFWH'

>        - Same format as V4L2_PIX_FMT_FWHT but requires stateless codec implementation.

> -	See the :ref:`associated Codec Control IDs <v4l2-mpeg-fwht>`.

> +        Metadata associated with the frame to decode is required to be passed

> +        through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control.

> +	See the :ref:`associated Codec Control ID <codec-stateless-fwht>`.

> diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> index 5b1fc62ade0d..116d128fa9cf 100644

> --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> @@ -208,6 +208,10 @@ still cause this situation.

>        - ``p_h264_decode_params``

>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_decode_params`. Valid if this control is

>          of type ``V4L2_CTRL_TYPE_H264_DECODE_PARAMS``.

> +    * - struct :c:type:`v4l2_ctrl_fwht_params` *

> +      - ``p_fwht_params``

> +      - A pointer to a struct :c:type:`v4l2_ctrl_fwht_params`. Valid if this control is

> +        of type ``V4L2_CTRL_TYPE_FWHT_PARAMS``.


Please see my notes for patch 5/6. The same applies here.

Regards,
Mauro

>      * - void *

>        - ``ptr``

>        - A pointer to a compound type which can be an N-dimensional array

> diff --git a/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst b/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst

> index 9b8716f90f12..82f61f1e2fb8 100644

> --- a/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst

> +++ b/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst

> @@ -462,6 +462,12 @@ See also the examples in :ref:`control`.

>        - n/a

>        - A struct :c:type:`v4l2_ctrl_h264_decode_params`, containing H264

>  	decode parameters for stateless video decoders.

> +    * - ``V4L2_CTRL_TYPE_FWHT_PARAMS``

> +      - n/a

> +      - n/a

> +      - n/a

> +      - A struct :c:type:`v4l2_ctrl_fwht_params`, containing FWHT

> +	parameters for stateless video decoders.

>      * - ``V4L2_CTRL_TYPE_HEVC_SPS``

>        - n/a

>        - n/a

> diff --git a/Documentation/userspace-api/media/videodev2.h.rst.exceptions b/Documentation/userspace-api/media/videodev2.h.rst.exceptions

> index 7f6a4cc2ac4e..0ed170c6e720 100644

> --- a/Documentation/userspace-api/media/videodev2.h.rst.exceptions

> +++ b/Documentation/userspace-api/media/videodev2.h.rst.exceptions

> @@ -146,6 +146,7 @@ replace symbol V4L2_CTRL_TYPE_HEVC_SPS :c:type:`v4l2_ctrl_type`

>  replace symbol V4L2_CTRL_TYPE_HEVC_PPS :c:type:`v4l2_ctrl_type`

>  replace symbol V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS :c:type:`v4l2_ctrl_type`

>  replace symbol V4L2_CTRL_TYPE_AREA :c:type:`v4l2_ctrl_type`

> +replace symbol V4L2_CTRL_TYPE_FWHT_PARAMS :c:type:`v4l2_ctrl_type`

>  

>  # V4L2 capability defines

>  replace define V4L2_CAP_VIDEO_CAPTURE device-capabilities




Thanks,
Mauro
Hans Verkuil Dec. 3, 2020, 10:52 a.m. UTC | #3
On 03/12/2020 11:49, Mauro Carvalho Chehab wrote:
> Em Thu, 26 Nov 2020 14:27:16 +0100

> Hans Verkuil <hverkuil-cisco@xs4all.nl> escreveu:

> 

>> Add 'struct' to clarify that these are pointers to structs.

> 

> This patch is actually wrong :-)

> 

> It is incompatible with Sphinx 3.

> 

>>

>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

>> ---

>>  .../userspace-api/media/v4l/vidioc-g-ext-ctrls.rst | 14 +++++++-------

>>  1 file changed, 7 insertions(+), 7 deletions(-)

>>

>> diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

>> index 726d6a97325f..5b1fc62ade0d 100644

>> --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

>> +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

>> @@ -180,31 +180,31 @@ still cause this situation.

>>        - ``p_u32``

>>        - A pointer to a matrix control of unsigned 32-bit values. Valid if

>>  	this control is of type ``V4L2_CTRL_TYPE_U32``.

>> -    * - :c:type:`v4l2_area` *

>> +    * - struct :c:type:`v4l2_area` *

> 

> 

> See, with Sphinx 3, :c:type: can only be used for typedefs and defines.

> 

> The right markup for struct is:

> 

> 	:c:struct:

> 

> Actually, due to automarkup.py extension, I would just rename them to:

> 

> 	struct foo

> 

> And let the automarkup code to use the right markup, as it will ensure

> that the proper dialect will be used, no matter what Sphinx version 

> will be used to produce the docs.

> 

> So, I'll drop this patch from the series. I'll propose a new one

> instead, after testing with multiple versions of Sphinx.


'git grep struct.*:c:type Documentation' shows a lot of those incorrect
markups. Perhaps make a media-wide patch to fix this? Otherwise people
will just keep copy-and-pasting the same incorrect markup.

Regards,

	Hans

> 

> Regards,

> Mauro

> 

> 

> 

>>        - ``p_area``

>>        - A pointer to a struct :c:type:`v4l2_area`. Valid if this control is

>>          of type ``V4L2_CTRL_TYPE_AREA``.

>> -    * - :c:type:`v4l2_ctrl_h264_sps` *

>> +    * - struct :c:type:`v4l2_ctrl_h264_sps` *

>>        - ``p_h264_sps``

>>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_sps`. Valid if this control is

>>          of type ``V4L2_CTRL_TYPE_H264_SPS``.

>> -    * - :c:type:`v4l2_ctrl_h264_pps` *

>> +    * - struct :c:type:`v4l2_ctrl_h264_pps` *

>>        - ``p_h264_pps``

>>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_pps`. Valid if this control is

>>          of type ``V4L2_CTRL_TYPE_H264_PPS``.

>> -    * - :c:type:`v4l2_ctrl_h264_scaling_matrix` *

>> +    * - struct :c:type:`v4l2_ctrl_h264_scaling_matrix` *

>>        - ``p_h264_scaling_matrix``

>>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_scaling_matrix`. Valid if this control is

>>          of type ``V4L2_CTRL_TYPE_H264_SCALING_MATRIX``.

>> -    * - :c:type:`v4l2_ctrl_h264_pred_weights` *

>> +    * - struct :c:type:`v4l2_ctrl_h264_pred_weights` *

>>        - ``p_h264_pred_weights``

>>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_pred_weights`. Valid if this control is

>>          of type ``V4L2_CTRL_TYPE_H264_PRED_WEIGHTS``.

>> -    * - :c:type:`v4l2_ctrl_h264_slice_params` *

>> +    * - struct :c:type:`v4l2_ctrl_h264_slice_params` *

>>        - ``p_h264_slice_params``

>>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_slice_params`. Valid if this control is

>>          of type ``V4L2_CTRL_TYPE_H264_SLICE_PARAMS``.

>> -    * - :c:type:`v4l2_ctrl_h264_decode_params` *

>> +    * - struct :c:type:`v4l2_ctrl_h264_decode_params` *

>>        - ``p_h264_decode_params``

>>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_decode_params`. Valid if this control is

>>          of type ``V4L2_CTRL_TYPE_H264_DECODE_PARAMS``.

> 

> 

> 

> Thanks,

> Mauro

>
Mauro Carvalho Chehab Dec. 3, 2020, 12:07 p.m. UTC | #4
Em Thu, 3 Dec 2020 11:52:29 +0100
Hans Verkuil <hverkuil-cisco@xs4all.nl> escreveu:

> On 03/12/2020 11:49, Mauro Carvalho Chehab wrote:

> > Em Thu, 26 Nov 2020 14:27:16 +0100

> > Hans Verkuil <hverkuil-cisco@xs4all.nl> escreveu:

> >   

> >> Add 'struct' to clarify that these are pointers to structs.  

> > 

> > This patch is actually wrong :-)

> > 

> > It is incompatible with Sphinx 3.

> >   

> >>

> >> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

> >> ---

> >>  .../userspace-api/media/v4l/vidioc-g-ext-ctrls.rst | 14 +++++++-------

> >>  1 file changed, 7 insertions(+), 7 deletions(-)

> >>

> >> diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> >> index 726d6a97325f..5b1fc62ade0d 100644

> >> --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> >> +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> >> @@ -180,31 +180,31 @@ still cause this situation.

> >>        - ``p_u32``

> >>        - A pointer to a matrix control of unsigned 32-bit values. Valid if

> >>  	this control is of type ``V4L2_CTRL_TYPE_U32``.

> >> -    * - :c:type:`v4l2_area` *

> >> +    * - struct :c:type:`v4l2_area` *  

> > 

> > 

> > See, with Sphinx 3, :c:type: can only be used for typedefs and defines.

> > 

> > The right markup for struct is:

> > 

> > 	:c:struct:

> > 

> > Actually, due to automarkup.py extension, I would just rename them to:

> > 

> > 	struct foo

> > 

> > And let the automarkup code to use the right markup, as it will ensure

> > that the proper dialect will be used, no matter what Sphinx version 

> > will be used to produce the docs.

> > 

> > So, I'll drop this patch from the series. I'll propose a new one

> > instead, after testing with multiple versions of Sphinx.  

> 

> 'git grep struct.*:c:type Documentation' shows a lot of those incorrect

> markups. Perhaps make a media-wide patch to fix this? Otherwise people

> will just keep copy-and-pasting the same incorrect markup.


Hmm... looking at Documentation/sphinx/parse-headers.pl, it seems
that the logic is not declaring structs using a Sphinx3 compatible
format, but, instead, using :c:type: everywhere.

So, I guess I'll just merge those two patches as-is, and then
work on a media-wide patchset.

> 

> Regards,

> 

> 	Hans

> 

> > 

> > Regards,

> > Mauro

> > 

> > 

> >   

> >>        - ``p_area``

> >>        - A pointer to a struct :c:type:`v4l2_area`. Valid if this control is

> >>          of type ``V4L2_CTRL_TYPE_AREA``.

> >> -    * - :c:type:`v4l2_ctrl_h264_sps` *

> >> +    * - struct :c:type:`v4l2_ctrl_h264_sps` *

> >>        - ``p_h264_sps``

> >>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_sps`. Valid if this control is

> >>          of type ``V4L2_CTRL_TYPE_H264_SPS``.

> >> -    * - :c:type:`v4l2_ctrl_h264_pps` *

> >> +    * - struct :c:type:`v4l2_ctrl_h264_pps` *

> >>        - ``p_h264_pps``

> >>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_pps`. Valid if this control is

> >>          of type ``V4L2_CTRL_TYPE_H264_PPS``.

> >> -    * - :c:type:`v4l2_ctrl_h264_scaling_matrix` *

> >> +    * - struct :c:type:`v4l2_ctrl_h264_scaling_matrix` *

> >>        - ``p_h264_scaling_matrix``

> >>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_scaling_matrix`. Valid if this control is

> >>          of type ``V4L2_CTRL_TYPE_H264_SCALING_MATRIX``.

> >> -    * - :c:type:`v4l2_ctrl_h264_pred_weights` *

> >> +    * - struct :c:type:`v4l2_ctrl_h264_pred_weights` *

> >>        - ``p_h264_pred_weights``

> >>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_pred_weights`. Valid if this control is

> >>          of type ``V4L2_CTRL_TYPE_H264_PRED_WEIGHTS``.

> >> -    * - :c:type:`v4l2_ctrl_h264_slice_params` *

> >> +    * - struct :c:type:`v4l2_ctrl_h264_slice_params` *

> >>        - ``p_h264_slice_params``

> >>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_slice_params`. Valid if this control is

> >>          of type ``V4L2_CTRL_TYPE_H264_SLICE_PARAMS``.

> >> -    * - :c:type:`v4l2_ctrl_h264_decode_params` *

> >> +    * - struct :c:type:`v4l2_ctrl_h264_decode_params` *

> >>        - ``p_h264_decode_params``

> >>        - A pointer to a struct :c:type:`v4l2_ctrl_h264_decode_params`. Valid if this control is

> >>          of type ``V4L2_CTRL_TYPE_H264_DECODE_PARAMS``.  

> > 

> > 

> > 

> > Thanks,

> > Mauro

> >   

> 




Thanks,
Mauro