Received: by 10.223.176.5 with SMTP id f5csp2871915wra; Mon, 29 Jan 2018 05:28:35 -0800 (PST) X-Google-Smtp-Source: AH8x226L8ElHCz5MHQ8pgIN1mfUb1Rg/C2MD/3pTl4nTyAigy/I7hhyojHZ7Lwilm8IHr0Vt2TUp X-Received: by 2002:a17:902:14cb:: with SMTP id y11-v6mr2135184plg.294.1517232515157; Mon, 29 Jan 2018 05:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517232515; cv=none; d=google.com; s=arc-20160816; b=01mM3q3+A7YxVAwPFRWv68ZoNsD/sRYnXIZBB+XgfZZ3UI9FQx5IawdEUNDNsgUN3o be9CfdOqwhug8nzNTyVw5BcgcAmm+/C15Bek8BsxGOu81fvjFBHbjKkGeJX/qZ7+4Ih5 iftksvxNu2lnWmBPhAoss5/tO1squtk2qDA1M7ccWw2nt1CRmuAgrcggx6/LLJYixLPT Y+x1vLNNf05brfgOe0UqGDclXd8tHdL2Coa7yafOEV3Kh9EIA4lHGhWO3MpwFc+/A/4r jkgV3cSBacA3ev/LcdIfSMDfsuEInsGrv+TDtLnr/EZwJd5Vm/BTW4f3LoUqX2jcOtGa e5Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=CV1gM3vKukCTMMX0Y8rBPlEqgliItjqcePK23OesGB8=; b=Emii2n3kdWgneMx5JYiug2cDhWN3LlHDwJRDIH//b4Dj/8EuxTlyaqXfxmDmLqoAS5 ORTv1R/Jvlq7HyWI/HDXy/9vyi4kGO/NYqhQiPZdqrYAWYGsXFCwEQ1LP8yfDXq/akxt OafZUhUxBcqciN+DaxH7G5+kqhnQL8pFk1RqL34Krf7a552Pk7pohKdHeHWQhjpuqLNA DCRke7iv9bJLhSN3GiiSSAdVx+7pZJ1JuJuNnUdOfVSHEfd0SbeBgTYtfUVbsOrzHojd o8ft5XUjqy1lI7FJt4/I1mE4jMhWiaZTDwlgQ8FL/5KSlmSmXrwloZleDu1oEb42xJX4 S8Qg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si7387959pgq.332.2018.01.29.05.28.20; Mon, 29 Jan 2018 05:28:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751783AbeA2N14 (ORCPT + 99 others); Mon, 29 Jan 2018 08:27:56 -0500 Received: from lb3-smtp-cloud8.xs4all.net ([194.109.24.29]:48975 "EHLO lb3-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbeA2N1y (ORCPT ); Mon, 29 Jan 2018 08:27:54 -0500 Received: from [192.168.2.10] ([212.251.195.8]) by smtp-cloud8.xs4all.net with ESMTPA id g9TOevCizar0wg9TRe9vf0; Mon, 29 Jan 2018 14:27:53 +0100 Subject: Re: [Patch v7 12/12] Documention: v4l: Documentation for HEVC CIDs To: Smitha T Murthy 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 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> From: Hans Verkuil Message-ID: Date: Mon, 29 Jan 2018 14:27:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1517229778.29374.9.camel@smitha-fedora> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfB7aXht1mR++cYKqFJs7yNg8L6u7K1hFBY4kfpXJ5EMzb1jT9MqqgoRrM4ZrPagMW5qGSXNGEtd9etL9l/77hssfo4UQSWIrxV4w+QOE8fJ+dX0mm0B5 Hsgo9FZM9NF/wGnZR7D415TMq168zANP9SjVjgxywM3u+vvGVit+y73rKfTtBeZ+6qhOv/7SyZ8Y1IDkc4BXYZlCvQkBUVx6t5KKDBreYR916tIJxRh+BtKI xfyOh7Q9q+IneyVyRP2abaHUYIvdahSaH3XHGIVrIm3uLZX12dPVW/fxuAVlSNjf6+vpECfKgkiGViTBGilUk/+JCkYL8vECJ09yMAtSTiO4nV6Q2aGGmX9+ uyLwYaNC7UUOVGIMT2MM3tNCMxiKeRd0rokVMzoIZA4q4jVbyxXrVDOSdKuBpeYHfbjBcF99946DaM73B2qsCtHuyaZTi+dfXqPTmDGzdxIWh+giBNKSfjVp 1yUJ0PpmPd0rfHoqtikzPwdaEnkcjrwAt/9S0ddl5RyyaRYcfiZZ/V5TwsdFL3s/PW8+5qOi3m2nqX8C Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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