From patchwork Fri Feb 24 01:42:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapathy Raman Kasi X-Patchwork-Id: 2667 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.149 with SMTP id x21csp485646vsf; Thu, 23 Feb 2017 17:42:43 -0800 (PST) X-Received: by 10.28.153.196 with SMTP id b187mr370725wme.53.1487900562922; Thu, 23 Feb 2017 17:42:42 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 137si291477wmb.112.2017.02.23.17.42.42; Thu, 23 Feb 2017 17:42:42 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 28FFA6882C4; Fri, 24 Feb 2017 03:42:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 42413680B16 for ; Fri, 24 Feb 2017 03:42:24 +0200 (EET) Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Thu, 23 Feb 2017 17:42:24 -0800 Received: from HQMAIL108.nvidia.com ([172.20.13.39]) by hqnvupgp08.nvidia.com (PGP Universal service); Thu, 23 Feb 2017 17:40:56 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 23 Feb 2017 17:40:56 -0800 Received: from HQMAIL102.nvidia.com (172.18.146.10) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 24 Feb 2017 01:42:28 +0000 Received: from HQMAIL106.nvidia.com (172.18.146.12) by HQMAIL102.nvidia.com (172.18.146.10) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 24 Feb 2017 01:42:28 +0000 Received: from HQMAIL106.nvidia.com ([::1]) by HQMAIL106.nvidia.com ([fe80::38c2:b015:eaec:9d8e%19]) with mapi id 15.00.1263.000; Fri, 24 Feb 2017 01:42:28 +0000 From: Ganapathy Raman Kasi To: FFmpeg development discussions and patches Thread-Topic: [PATCH] Remove qmin and qmax constraints for nvenc vbr Thread-Index: AQHSjj6kdxTOmS4Z+0qmGn2zF+ghNQ== Date: Fri, 24 Feb 2017 01:42:27 +0000 Message-ID: <1487900547839.27497@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [172.16.178.49] MIME-Version: 1.0 Content-Language: en-US X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] [PATCH] Remove qmin and qmax constraints for nvenc vbr X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi, qmin and qmax are not necessary for nvenc vbr. Enforcing this constraint, doesn't allow user to use vbr 2 pass mode ( NV_ENC_PARAMS_RC_2_PASS_VBR) without explicity setting the qmin and qmax options and reverts to the default vbr mode ( NV_ENC_PARAMS_RC_VBR). If needed user can still set qmin and qmax and those will be obeyed. Please review. Thanks. Regards Ganapathy Kasi ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- From 41f4541a1137f5a49da2ffb0013d2574f3ad46a0 Mon Sep 17 00:00:00 2001 From: Ganapathy Kasi Date: Thu, 23 Feb 2017 17:32:21 -0800 Subject: [PATCH] Remove qmin and qmax constraints for nvenc vbr qmin and qmax are not necessary for nvenc vbr. Enforcing this constraint, doesn't allow user to use vbr 2 pass mode without explicity setting the qmin and qmax options --- libavcodec/nvenc.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index ba2647b..3c24bc5 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -589,15 +589,6 @@ static void nvenc_override_rate_control(AVCodecContext *avctx) } set_constqp(avctx); return; - case NV_ENC_PARAMS_RC_2_PASS_VBR: - case NV_ENC_PARAMS_RC_VBR: - if (avctx->qmin < 0 && avctx->qmax < 0) { - av_log(avctx, AV_LOG_WARNING, - "The variable bitrate rate-control requires " - "the 'qmin' and/or 'qmax' option set.\n"); - set_vbr(avctx); - return; - } /* fall through */ case NV_ENC_PARAMS_RC_VBR_MINQP: if (avctx->qmin < 0) { @@ -609,6 +600,10 @@ static void nvenc_override_rate_control(AVCodecContext *avctx) } set_vbr(avctx); break; + case NV_ENC_PARAMS_RC_2_PASS_VBR: + case NV_ENC_PARAMS_RC_VBR: + set_vbr(avctx); + break; case NV_ENC_PARAMS_RC_CBR: case NV_ENC_PARAMS_RC_2_PASS_QUALITY: case NV_ENC_PARAMS_RC_2_PASS_FRAMESIZE_CAP: -- 2.7.4