Commit 45f97ba1 authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab
Browse files

media: uapi: mpeg2: Remove V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS



The Hantro and Cedrus drivers work in frame-mode,
meaning they expect all the slices in a picture (either frame
or field structure) to be passed in each OUTPUT buffer.

These two are the only V4L2 MPEG-2 stateless decoders currently
supported. Given the VA-API drivers also work per-frame,
coalescing all the MPEG-2 slices in a buffer before the decoding
operation, it makes sense to not expect slice-mode drivers and
therefore remove V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS.

This is done to avoid carrying an unused interface. If needed,
this control can be added without breaking backwards compatibility.
Note that this would mean introducing a enumerator control to
specify the decoding mode (see V4L2_CID_STATELESS_H264_DECODE_MODE).

Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Co-developed-by: default avatarNicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: default avatarNicolas Dufresne <nicolas.dufresne@collabora.com>
Tested-by: default avatarJernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: default avatarJernej Skrabec <jernej.skrabec@siol.net>
Tested-by: default avatarDaniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 701a6a41
Loading
Loading
Loading
Loading
+0 −35
Original line number Diff line number Diff line
@@ -1608,41 +1608,6 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -

.. _v4l2-mpeg-mpeg2:

``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (struct)``
    Specifies the slice parameters (as extracted from the bitstream) for the
    associated MPEG-2 slice data. This includes the necessary parameters for
    configuring a stateless hardware decoding pipeline for MPEG-2.
    The bitstream parameters are defined according to :ref:`mpeg2part2`.

    .. note::

       This compound control is not yet part of the public kernel API and
       it is expected to change.

.. c:type:: v4l2_ctrl_mpeg2_slice_params

.. tabularcolumns:: |p{5.6cm}|p{4.6cm}|p{7.1cm}|

.. cssclass:: longtable

.. flat-table:: struct v4l2_ctrl_mpeg2_slice_params
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - __u32
      - ``bit_size``
      - Size (in bits) of the current slice data.
    * - __u32
      - ``data_bit_offset``
      - Offset (in bits) to the video data in the current slice data.
    * - __u32
      - ``quantiser_scale_code``
      - Code used to determine the quantization scale to use for the IDCT.
    * - __u8
      - ``reserved``
      - Applications and drivers must set this to zero.

``V4L2_CID_MPEG_VIDEO_MPEG2_SEQUENCE (struct)``
    Specifies the sequence parameters (as extracted from the bitstream) for the
    associated MPEG-2 slice data. This includes fields matching the syntax
+3 −3
Original line number Diff line number Diff line
@@ -114,9 +114,9 @@ Compressed Formats
	This format is adapted for stateless video decoders that implement a
	MPEG-2 pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
	Metadata associated with the frame to decode is required to be passed
	through the ``V4L2_CID_MPEG_VIDEO_MPEG2_SEQUENCE``,
        ``V4L2_CID_MPEG_VIDEO_MPEG2_PICTURE``, and ``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS``
        controls. Quantisation matrices can optionally be specified through the
	through the ``V4L2_CID_MPEG_VIDEO_MPEG2_SEQUENCE`` and
        ``V4L2_CID_MPEG_VIDEO_MPEG2_PICTURE`` controls.
        Quantisation matrices can optionally be specified through the
	``V4L2_CID_MPEG_VIDEO_MPEG2_QUANTISATION`` control.
	See the :ref:`associated Codec Control IDs <v4l2-mpeg-mpeg2>`.
	Exactly one output and one capture buffer must be provided for use with
+0 −6
Original line number Diff line number Diff line
@@ -417,12 +417,6 @@ See also the examples in :ref:`control`.
      - any
      - An unsigned 32-bit valued control ranging from minimum to maximum
	inclusive. The step value indicates the increment between values.
    * - ``V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS``
      - n/a
      - n/a
      - n/a
      - A struct :c:type:`v4l2_ctrl_mpeg2_slice_params`, containing MPEG-2
	slice parameters for stateless video decoders.
    * - ``V4L2_CTRL_TYPE_MPEG2_QUANTISATION``
      - n/a
      - n/a
+0 −1
Original line number Diff line number Diff line
@@ -136,7 +136,6 @@ replace symbol V4L2_CTRL_TYPE_U32 :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_U8 :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_MPEG2_SEQUENCE :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_MPEG2_PICTURE :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_MPEG2_QUANTISATION :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_H264_SPS :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_H264_PPS :c:type:`v4l2_ctrl_type`
+0 −19
Original line number Diff line number Diff line
@@ -979,7 +979,6 @@ const char *v4l2_ctrl_get_name(u32 id)
	case V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES:		return "Use LTR Frames";
	case V4L2_CID_MPEG_VIDEO_MPEG2_SEQUENCE:		return "MPEG-2 Sequence Header";
	case V4L2_CID_MPEG_VIDEO_MPEG2_PICTURE:			return "MPEG-2 Picture Header";
	case V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS:		return "MPEG-2 Slice Parameters";
	case V4L2_CID_MPEG_VIDEO_MPEG2_QUANTISATION:		return "MPEG-2 Quantisation Matrices";
	case V4L2_CID_FWHT_I_FRAME_QP:				return "FWHT I-Frame QP Value";
	case V4L2_CID_FWHT_P_FRAME_QP:				return "FWHT P-Frame QP Value";
@@ -1507,9 +1506,6 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
	case V4L2_CID_MPEG_VIDEO_MPEG2_PICTURE:
		*type = V4L2_CTRL_TYPE_MPEG2_PICTURE;
		break;
	case V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS:
		*type = V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS;
		break;
	case V4L2_CID_MPEG_VIDEO_MPEG2_QUANTISATION:
		*type = V4L2_CTRL_TYPE_MPEG2_QUANTISATION;
		break;
@@ -1723,11 +1719,6 @@ static void std_init_compound(const struct v4l2_ctrl *ctrl, u32 idx,
	else
		memset(p, 0, ctrl->elem_size);

	/*
	 * The cast is needed to get rid of a gcc warning complaining that
	 * V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS is not part of the
	 * v4l2_ctrl_type enum.
	 */
	switch ((u32)ctrl->type) {
	case V4L2_CTRL_TYPE_MPEG2_SEQUENCE:
		p_mpeg2_sequence = p;
@@ -1925,7 +1916,6 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx,
{
	struct v4l2_ctrl_mpeg2_sequence *p_mpeg2_sequence;
	struct v4l2_ctrl_mpeg2_picture *p_mpeg2_picture;
	struct v4l2_ctrl_mpeg2_slice_params *p_mpeg2_slice_params;
	struct v4l2_ctrl_vp8_frame *p_vp8_frame;
	struct v4l2_ctrl_fwht_params *p_fwht_params;
	struct v4l2_ctrl_h264_sps *p_h264_sps;
@@ -1988,12 +1978,6 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx,
		zero_reserved(*p_mpeg2_picture);
		break;

	case V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS:
		p_mpeg2_slice_params = p;

		zero_reserved(*p_mpeg2_slice_params);
		break;

	case V4L2_CTRL_TYPE_MPEG2_QUANTISATION:
		break;

@@ -2966,9 +2950,6 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
	case V4L2_CTRL_TYPE_MPEG2_PICTURE:
		elem_size = sizeof(struct v4l2_ctrl_mpeg2_picture);
		break;
	case V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS:
		elem_size = sizeof(struct v4l2_ctrl_mpeg2_slice_params);
		break;
	case V4L2_CTRL_TYPE_MPEG2_QUANTISATION:
		elem_size = sizeof(struct v4l2_ctrl_mpeg2_quantisation);
		break;
Loading