From patchwork Sun Dec 6 10:27:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 338811 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1914679jai; Sun, 6 Dec 2020 02:30:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTkOwtuWrDBy48bty/d6OwYnf7ICnNqMcD1zVmnUF6NamtnYS+Y8tn5qm9pmAUcqI5ySiP X-Received: by 2002:a17:906:6713:: with SMTP id a19mr15188980ejp.468.1607250611510; Sun, 06 Dec 2020 02:30:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607250611; cv=none; d=google.com; s=arc-20160816; b=Retqovs7DshxwYelEMBSa1tD+BR1q9SENhvqQn0DhV390oZNzwo9v5ZeqJCPZnC6XV Dxnh6hVpODzCpHMfCvvhRW8gnjQzqPpMCxGToHzKhOtV/eoOwdqMt1Y0Ae8oJsViLe/v tb1eie7Nw++EY7EIzFVIISHaR2xR45o3DHERJrBJ15wyBxn0BoFoayXVX6xqsu0A1Lsd 1n4p9tg/xOTCMnwotWeReu0Oyu3B5tu7HVZkPFe8B+kDiXuhft56eN0XSsPeyHiG/GLu 2fsS0D6NShA0kDrDZo3LeDtjiGCzzNGA74ZyqKBFlCDKnfc5g4iumK4h4qT58qXsOkas PeGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=LkouQoHke2anJQVlx6D+TqgyIrZywjU7nWFfQMQRPxY=; b=hMCS6AgpDeyyY58WM0RpGZR07OSPp7VmlInZqprw3iTYydrWomC8KBrkRwbMCtujxX XqdojIXZetaK0LVakevPc4rMP9CV6X3nop8dMQI10YH+RZaZMfvTfzIl7IieKR0PpQbr El3XRo8r/tFjyJP0U1DlVnQHNdNgLCiFb8483/5Yp0LMkzWIkZeXm/IFMCAdJCgayVZE tGwmAa12kBkawIb+dY0w+M7XMwyWXD8BlPIDr1iYJfWaoo311YbITcKfFQshshj5yUvL zrj9qQGMwqt8kZH3aok8KEAd2qlyC6zCrzKDxpgh6NtqsxpukZDk3L5jTV8fiXIlzb41 3ihw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Zy6Na8/Y"; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si6254944edj.6.2020.12.06.02.30.11; Sun, 06 Dec 2020 02:30:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Zy6Na8/Y"; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727343AbgLFK21 (ORCPT + 4 others); Sun, 6 Dec 2020 05:28:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727290AbgLFK20 (ORCPT ); Sun, 6 Dec 2020 05:28:26 -0500 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C3DC061A53 for ; Sun, 6 Dec 2020 02:27:42 -0800 (PST) Received: by mail-ed1-x544.google.com with SMTP id q16so10481771edv.10 for ; Sun, 06 Dec 2020 02:27:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LkouQoHke2anJQVlx6D+TqgyIrZywjU7nWFfQMQRPxY=; b=Zy6Na8/YzIOd0z/7FasMN5MglqMug1tF32Gc3OnmDlsGum7uvzEwyIB1CudNYNlfm2 crPc0ItSFBNqkP14lXbpricf+h5ZOmzALro36jKuD7eJbJsuRQhhzD571XiKthcnqnaw mqxKWaNEq7NgN0MxK2iaKcKvfymAEw0aOqwKnSdtTrwlvfgO1etpd8y+nV0anyc4pE+4 iSAWeWIHp9Wy4XztzOuQer5beIpFrSGMuxvTqMivz27ohpdUxW8WKyev1eEExOGg8RkE XLUAbmpSTbI3Xw0TiZAq8Q9odneYApw8nbLtXIOa/zoP9utaB1TZ1sbS4qfw3JlyVplZ niSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LkouQoHke2anJQVlx6D+TqgyIrZywjU7nWFfQMQRPxY=; b=IaoktVMbudr/fHrhE+CxpY1rBRqQTpcknDAhdzb1jJQ7JcXyt44IwAcGinmLmDdXK7 MnL/Rq4QViZrrv2XXBBZwRXJ9DBJv57DV3UqhgWcB6N2Dn78WG1GE5iaCwrjiRTqDe1b LbaQoqRcqZ+RP9E9cg9v0iI7AlGMbWC3t8VIGYWwSDv1ORiXXMUsuMLg9oj6MjwE3FSv jGE3/Z9U5KhIksGVru+/wltHZGLRzqBKbAnKXgRDk6wCAzeugwb+ve9NtHiMRzCtc10W G3grDsCpQ5dNi6JkNVsFWEg1FgVaopBybnfb+Qh4qaUw6BEPUuDuSdl8dPbBYkOPBwCv fTrw== X-Gm-Message-State: AOAM533+wYF8ODTZ5Nl/R3QIU/APLb83cDIat5P3y/TmV+bfaJe4RNTK BgU6kh20r6sNwPQ7Cu4eSnMsG61qeDpQAyIV X-Received: by 2002:a50:e083:: with SMTP id f3mr18754edl.223.1607250461360; Sun, 06 Dec 2020 02:27:41 -0800 (PST) Received: from localhost.localdomain (hst-221-17.medicom.bg. [84.238.221.17]) by smtp.gmail.com with ESMTPSA id d4sm8464736edq.36.2020.12.06.02.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2020 02:27:40 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Ezequiel Garcia , Nicolas Dufresne , Maheshwar Ajja , Hans Verkuil , Stanimir Varbanov Subject: [PATCH v2 1/4] media: v4l2-ctrls: Add intra-refresh period control Date: Sun, 6 Dec 2020 12:27:14 +0200 Message-Id: <20201206102717.19000-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201206102717.19000-1-stanimir.varbanov@linaro.org> References: <20201206102717.19000-1-stanimir.varbanov@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a control to set intra-refresh period. Signed-off-by: Stanimir Varbanov --- .../userspace-api/media/v4l/ext-ctrls-codec.rst | 11 +++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 2 ++ include/uapi/linux/v4l2-controls.h | 1 + 3 files changed, 14 insertions(+) -- 2.17.1 diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index 454ecd9a0f83..d65d7c1381b7 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -1104,6 +1104,17 @@ enum v4l2_mpeg_video_h264_entropy_mode - macroblocks is refreshed until the cycle completes and starts from the top of the frame. Applicable to H264, H263 and MPEG4 encoder. +``V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (integer)`` + Intra macroblock refresh period. This sets the period to refresh + the whole frame. With other words, this defines the number of frames + for which the whole frame will be intra-refreshed. An example: + setting period to 1 means that the whole frame will be refreshed, + setting period to 2 means that the half of macroblocks will be + intra-refreshed on frameX and the other half of macroblocks + will be refreshed in frameX + 1 and so on. Setting period to zero + means no period is specified. + Applicable to H264 and HEVC encoders. + ``V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (boolean)`` Frame level rate control enable. If this control is disabled then the quantization parameter for each frame type is constant and set diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 5cbe0ffbf501..ac44848d2d6e 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -869,6 +869,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE: return "Decoder Slice Interface"; case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: return "MPEG4 Loop Filter Enable"; case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB: return "Number of Intra Refresh MBs"; + case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD: return "Intra Refresh Period"; case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE: return "Frame Level Rate Control Enable"; case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE: return "H264 MB Level Rate Control"; case V4L2_CID_MPEG_VIDEO_HEADER_MODE: return "Sequence Header Mode"; @@ -1260,6 +1261,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, break; case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE: case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: + case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD: *type = V4L2_CTRL_TYPE_INTEGER; break; case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 823b214aac0c..54b9072ac49d 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -422,6 +422,7 @@ enum v4l2_mpeg_video_multi_slice_mode { #define V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (V4L2_CID_CODEC_BASE+227) #define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (V4L2_CID_CODEC_BASE+228) #define V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (V4L2_CID_CODEC_BASE+229) +#define V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (V4L2_CID_CODEC_BASE+230) /* CIDs for the MPEG-2 Part 2 (H.262) codec */ #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270)