From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751778AbeA2NhT (ORCPT ); Mon, 29 Jan 2018 08:37:19 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:54794 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbeA2NhQ (ORCPT ); Mon, 29 Jan 2018 08:37:16 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180129133714epoutp01aabe14fd86106fb495392dd3451e0750~OS2gMSJPW0299602996epoutp01S X-AuditID: b6c32a4b-cd1ff70000001126-1d-5a6f238a9edc Subject: Re: [Patch v7 12/12] Documention: v4l: Documentation for HEVC CIDs From: Smitha T Murthy To: Hans Verkuil Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kyungmin.park@samsung.com, kamil@wypas.org, jtp.park@samsung.com, a.hajda@samsung.com, mchehab@kernel.org, pankaj.dubey@samsung.com, krzk@kernel.org, m.szyprowski@samsung.com, s.nawrocki@samsung.com In-Reply-To: Date: Mon, 29 Jan 2018 18:43:37 +0530 Message-ID: <1517231617.29374.12.camel@smitha-fedora> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIKsWRmVeSWpSXmKPExsWy7bCmum6Xcn6UwYz34ha31p1jtTg1+RmT xZG1V5ksZp5oZ7U4f34Du8XZpjfsFpseX2O1uLxrDptFz4atrBZrj9xlt1i26Q+TxaKtX9gt Dr9pZ3Xg9di0qpPNY/OSeo++LasYPT5vkvO4cqSR3ePU18/sAWxRXDYpqTmZZalF+nYJXBl/ F9xhLXhkWnHj7zf2BsYvWl2MHBwSAiYSxz84djFycQgJ7GaUmHhmHxuE84lR4tu69cwQzjdG ieXnb7J0MXKCdSy99JUJIrGXUWLL8/VQ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DHrBJHFmyiVmkASzgKZE6/bfYEUsQN03z80As3kFTCV2nWllBlnGKyAo 8XeHMMRB2hLrGs6wQLTKS2x/O4d5AqPgLCSTZiF0zEJStYCReRWjZGpBcW56brFhgVFearle cWJucWleul5yfu4mRnAcaWntYDxxIv4QowAHoxIP74fQvCgh1sSy4srcQ4wSHMxKIrz3CoFC vCmJlVWpRfnxRaU5qcWHGKU5WJTEeeXzj0UKCaQnlqRmp6YWpBbBZJk4OKUaGKOKPZoef96k tH1lbnzgAe/3YlN6Iot9mMUvd5dJbvwo8zrnzNfb6+qFyxjnTFCcHsndu3nq8jqdN6fma0/Y 5WOxqXyKU5K11tlYielxDQ+4hMSYXWp1csq0qy7/jBN7eeb6eUn/7xvMZu1hnX+dK2XRRiHl Q1smu4V08239LOncMPHH6+xX/kosxRmJhlrMRcWJAHDAkKifAgAA X-CMS-MailID: 20180129133714epcas5p20552f86ed65a7d19fcf8887ece1b0b05 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-MTR: 20180129133714epcas5p20552f86ed65a7d19fcf8887ece1b0b05 CMS-TYPE: 105P X-CMS-RootMailID: 20180124112406epcas2p3820cea581731825c7ad72ebbb1ca060c X-RootMTR: 20180124112406epcas2p3820cea581731825c7ad72ebbb1ca060c References: <1516791584-7980-1-git-send-email-smitha.t@samsung.com> <1516791584-7980-13-git-send-email-smitha.t@samsung.com> <127cfd7f-113f-6724-297c-6f3c3746a8ff@xs4all.nl> <1517229778.29374.9.camel@smitha-fedora> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-01-29 at 14:27 +0100, Hans Verkuil wrote: > On 01/29/2018 01:42 PM, Smitha T Murthy wrote: > > On Wed, 2018-01-24 at 15:16 +0100, Hans Verkuil wrote: > >> On 24/01/18 11:59, Smitha T Murthy wrote: > >>> Added V4l2 controls for HEVC encoder > >>> > >>> Signed-off-by: Smitha T Murthy > >>> --- > >>> Documentation/media/uapi/v4l/extended-controls.rst | 400 +++++++++++++++++++++ > >>> 1 file changed, 400 insertions(+) > >>> > >>> diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst > >>> index dfe49ae..46ee2bf 100644 > >>> --- a/Documentation/media/uapi/v4l/extended-controls.rst > >>> +++ b/Documentation/media/uapi/v4l/extended-controls.rst > >>> @@ -1960,6 +1960,406 @@ enum v4l2_vp8_golden_frame_sel - > >>> 1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3. > >>> > >>> > >>> +High Efficiency Video Coding (HEVC/H.265) Control Reference > >>> +----------------------------------------------------------- > >>> + > >>> +The HEVC/H.265 controls include controls for encoding parameters of HEVC/H.265 > >>> +video codec. > >>> + > >>> + > >>> +.. _hevc-control-id: > >>> + > >>> +HEVC/H.265 Control IDs > >>> +^^^^^^^^^^^^^^^^^^^^^^ > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP (integer)`` > >>> + Minimum quantization parameter for HEVC. > >>> + Valid range: from 0 to 51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP (integer)`` > >>> + Maximum quantization parameter for HEVC. > >>> + Valid range: from 0 to 51. > >> > >> You probably should mention the default values for MIN_QP and MAX_QP > >> (I assume those are 0 and 51 and are not driver specific). > >> > > Yes these values are not driver specific. > > I followed the way MAX_QP and MIN_QP are defined for other codecs like > > H264, H263, MPEG4 where only valid range is mentioned. > > > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP (integer)`` > >>> + Quantization parameter for an I frame for HEVC. > >>> + Valid range: from 0 to 51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP (integer)`` > >>> + Quantization parameter for a P frame for HEVC. > >>> + Valid range: from 0 to 51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP (integer)`` > >>> + Quantization parameter for a B frame for HEVC. > >>> + Valid range: from 0 to 51. > >> > >> Sorry, this still isn't clear to me. > >> > >> If I set V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP to 50, can I then still set > >> V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP to 51? Or is 50 then the maximum? > >> > >> In other words, what is the relationship between these three controls > >> and the MIN_QP/MAX_QP controls. > >> > > If we set V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP as 50 then > > V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP or > > 4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP or > > V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP will have maximum as 50. > > Similarly for minimum as well, the above three controls will adhere to > > the V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP set. > > These controls have similar in relation as seen with > > V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP and V4L2_CID_MPEG_VIDEO_H264_MAX_QP > > > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP (boolean)`` > >>> + HIERARCHICAL_QP allows the host to specify the quantization parameter > >>> + values for each temporal layer through HIERARCHICAL_QP_LAYER. This is > >>> + valid only if HIERARCHICAL_CODING_LAYER is greater than 1. Setting the > >>> + control value to 1 enables setting of the QP values for the layers. > >>> + > >>> +.. _v4l2-hevc-hier-coding-type: > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE`` > >>> + (enum) > >>> + > >>> +enum v4l2_mpeg_video_hevc_hier_coding_type - > >>> + Selects the hierarchical coding type for encoding. Possible values are: > >>> + > >>> +.. raw:: latex > >>> + > >>> + \begin{adjustbox}{width=\columnwidth} > >>> + > >>> +.. tabularcolumns:: |p{11.0cm}|p{10.0cm}| > >>> + > >>> +.. flat-table:: > >>> + :header-rows: 0 > >>> + :stub-columns: 0 > >>> + > >>> + * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B`` > >>> + - Use the B frame for hierarchical coding. > >>> + * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P`` > >>> + - Use the P frame for hierarchical coding. > >>> + > >>> +.. raw:: latex > >>> + > >>> + \end{adjustbox} > >>> + > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER (integer)`` > >>> + Selects the hierarchical coding layer. In normal encoding > >>> + (non-hierarchial coding), it should be zero. Possible values are [0, 6]. > >>> + 0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING > >>> + LAYER 1 and so on. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 0. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 1. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 2. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 3. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 4. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 5. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 6. > >>> + For HEVC it can have a value of 0-51. > >> > >> Same here: how does MIN_QP/MAX_QP influence these controls, if at all. > >> > >> Regards, > >> > >> Hans > >> > >> > > The values set in V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP and > > V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP will give the limits for the L0-L6 QP > > values that can be set. > > OK. If you can clarify this in the documentation, then I can Ack this. > > Note: if userspace changes MIN_QP or MAX_QP, then the driver should call > v4l2_ctrl_modify_range() to update the ranges of the controls that are > impacted by QP range changes. I'm not sure if that's done at the moment. > > Regards, > > Hans > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: smitha.t@samsung.com (Smitha T Murthy) Date: Mon, 29 Jan 2018 18:43:37 +0530 Subject: [Patch v7 12/12] Documention: v4l: Documentation for HEVC CIDs In-Reply-To: References: <1516791584-7980-1-git-send-email-smitha.t@samsung.com> <1516791584-7980-13-git-send-email-smitha.t@samsung.com> <127cfd7f-113f-6724-297c-6f3c3746a8ff@xs4all.nl> <1517229778.29374.9.camel@smitha-fedora> Message-ID: <1517231617.29374.12.camel@smitha-fedora> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, 2018-01-29 at 14:27 +0100, Hans Verkuil wrote: > On 01/29/2018 01:42 PM, Smitha T Murthy wrote: > > On Wed, 2018-01-24 at 15:16 +0100, Hans Verkuil wrote: > >> On 24/01/18 11:59, Smitha T Murthy wrote: > >>> Added V4l2 controls for HEVC encoder > >>> > >>> Signed-off-by: Smitha T Murthy > >>> --- > >>> Documentation/media/uapi/v4l/extended-controls.rst | 400 +++++++++++++++++++++ > >>> 1 file changed, 400 insertions(+) > >>> > >>> diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst > >>> index dfe49ae..46ee2bf 100644 > >>> --- a/Documentation/media/uapi/v4l/extended-controls.rst > >>> +++ b/Documentation/media/uapi/v4l/extended-controls.rst > >>> @@ -1960,6 +1960,406 @@ enum v4l2_vp8_golden_frame_sel - > >>> 1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3. > >>> > >>> > >>> +High Efficiency Video Coding (HEVC/H.265) Control Reference > >>> +----------------------------------------------------------- > >>> + > >>> +The HEVC/H.265 controls include controls for encoding parameters of HEVC/H.265 > >>> +video codec. > >>> + > >>> + > >>> +.. _hevc-control-id: > >>> + > >>> +HEVC/H.265 Control IDs > >>> +^^^^^^^^^^^^^^^^^^^^^^ > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP (integer)`` > >>> + Minimum quantization parameter for HEVC. > >>> + Valid range: from 0 to 51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP (integer)`` > >>> + Maximum quantization parameter for HEVC. > >>> + Valid range: from 0 to 51. > >> > >> You probably should mention the default values for MIN_QP and MAX_QP > >> (I assume those are 0 and 51 and are not driver specific). > >> > > Yes these values are not driver specific. > > I followed the way MAX_QP and MIN_QP are defined for other codecs like > > H264, H263, MPEG4 where only valid range is mentioned. > > > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP (integer)`` > >>> + Quantization parameter for an I frame for HEVC. > >>> + Valid range: from 0 to 51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP (integer)`` > >>> + Quantization parameter for a P frame for HEVC. > >>> + Valid range: from 0 to 51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP (integer)`` > >>> + Quantization parameter for a B frame for HEVC. > >>> + Valid range: from 0 to 51. > >> > >> Sorry, this still isn't clear to me. > >> > >> If I set V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP to 50, can I then still set > >> V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP to 51? Or is 50 then the maximum? > >> > >> In other words, what is the relationship between these three controls > >> and the MIN_QP/MAX_QP controls. > >> > > If we set V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP as 50 then > > V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP or > > 4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP or > > V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP will have maximum as 50. > > Similarly for minimum as well, the above three controls will adhere to > > the V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP set. > > These controls have similar in relation as seen with > > V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP and V4L2_CID_MPEG_VIDEO_H264_MAX_QP > > > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP (boolean)`` > >>> + HIERARCHICAL_QP allows the host to specify the quantization parameter > >>> + values for each temporal layer through HIERARCHICAL_QP_LAYER. This is > >>> + valid only if HIERARCHICAL_CODING_LAYER is greater than 1. Setting the > >>> + control value to 1 enables setting of the QP values for the layers. > >>> + > >>> +.. _v4l2-hevc-hier-coding-type: > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE`` > >>> + (enum) > >>> + > >>> +enum v4l2_mpeg_video_hevc_hier_coding_type - > >>> + Selects the hierarchical coding type for encoding. Possible values are: > >>> + > >>> +.. raw:: latex > >>> + > >>> + \begin{adjustbox}{width=\columnwidth} > >>> + > >>> +.. tabularcolumns:: |p{11.0cm}|p{10.0cm}| > >>> + > >>> +.. flat-table:: > >>> + :header-rows: 0 > >>> + :stub-columns: 0 > >>> + > >>> + * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B`` > >>> + - Use the B frame for hierarchical coding. > >>> + * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P`` > >>> + - Use the P frame for hierarchical coding. > >>> + > >>> +.. raw:: latex > >>> + > >>> + \end{adjustbox} > >>> + > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER (integer)`` > >>> + Selects the hierarchical coding layer. In normal encoding > >>> + (non-hierarchial coding), it should be zero. Possible values are [0, 6]. > >>> + 0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING > >>> + LAYER 1 and so on. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 0. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 1. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 2. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 3. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 4. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 5. > >>> + For HEVC it can have a value of 0-51. > >>> + > >>> +``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP (integer)`` > >>> + Indicates quantization parameter for hierarchical coding layer 6. > >>> + For HEVC it can have a value of 0-51. > >> > >> Same here: how does MIN_QP/MAX_QP influence these controls, if at all. > >> > >> Regards, > >> > >> Hans > >> > >> > > The values set in V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP and > > V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP will give the limits for the L0-L6 QP > > values that can be set. > > OK. If you can clarify this in the documentation, then I can Ack this. > > Note: if userspace changes MIN_QP or MAX_QP, then the driver should call > v4l2_ctrl_modify_range() to update the ranges of the controls that are > impacted by QP range changes. I'm not sure if that's done at the moment. > > Regards, > > Hans > >