From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1C180442B7 for ; Mon, 5 Sep 2022 02:48:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1991C68B9A3; Mon, 5 Sep 2022 05:48:19 +0300 (EEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C811C68B8BF for ; Mon, 5 Sep 2022 05:48:12 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662346098; x=1693882098; h=from:to:subject:date:message-id:references:in-reply-to: content-id:content-transfer-encoding:mime-version; bh=1RQ/iv1K9VJlPO705H7rvN5eXLDSQ7bcGVl6yobe/Gs=; b=iER/APHWXGJjsbv9K/vwFeSiryIyPJgH3i5kwMfa0tF2/yJnOa6qJGw1 CGGzQVq71BcZ/3NHy6h42q13AyHiUIB6llilbSqwFUEgmHgFgFxJZLKsI r1igKSdwa1dyRcvuMKwDxVVBwa8m4D7MqZfX2X+M7BFxQX+6vc8Ki+AGy 456GsWcjm7CRu387xzebr2BMYjC6CWaq9g1Io1U1mock1ExzeiqpSD+Mo 737znWLxJXbmTmpwdnIgliiZbZ/zJyA917Y6rD6sz8N5o3wG0Kq8TG24t SqXITuWDnQ/imp8vDSnOJH+fwbGYCT4ShWkz9tEAYxLxBqHeLvbN3mP6Q w==; X-IronPort-AV: E=McAfee;i="6500,9779,10460"; a="322458858" X-IronPort-AV: E=Sophos;i="5.93,290,1654585200"; d="scan'208";a="322458858" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2022 19:48:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,290,1654585200"; d="scan'208";a="681903709" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga004.fm.intel.com with ESMTP; 04 Sep 2022 19:48:10 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 4 Sep 2022 19:48:10 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 4 Sep 2022 19:48:09 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Sun, 4 Sep 2022 19:48:09 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Sun, 4 Sep 2022 19:48:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JKVB37bHcQS+OC5nby12AWgaxcF8YVUt1ikuyXA8IvGkECpJW4xL+QhX1K0BbkZ20t/dVHu3rjSTdPqGw3uS7PGpBK29SIo1CEOL85IG8aw9ysjfWPoXoWbWAsyL9Ia96w2rBYwaPn3FpAchwIr97Y24DfYu9zUvvXa09kgITWwmscohIEpn/FnJxcKPV/FxkhIk2X+7VrTTGWD0yOkquRIDCVFvVh6KhV7CdLpZzt5EGLPnA2Piq5dY9aIjde5KxpaAw6mJtXePSWUMfLv01HUyZlQ1RLPAZ1q64bqzlPUcSqiRD2v+umfz51lxQBp7tzYLGxQ8aJQsmd4vdVFc5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1RQ/iv1K9VJlPO705H7rvN5eXLDSQ7bcGVl6yobe/Gs=; b=kwIJaEYudZ3Gb6dWcxfXb7JtM53T39uaKS2zzkDjcrn3svSMWAgUxmdWZytNNUSOX6Drsv4QHatPCLaYHaNJ7MsvifoWRZAL2bQkzEAMIslMjTLcgdztXnGoXqiOH2hpykhLRntqKP19N58A5jwEtR3F2NGxSAm53vsk0KA053BhI88nHQSXiMEM5kFpvsI3b9sb2Zasvbd0g8BZSwedP6DMHyMVKW7+0P5f6anW+WcgJM0TeytYjefW0s5tCc06Q6wupOR6DhVXMTdgpX3EG9tXuR5typmBnC7fgGP2gML/hMTfgSnwWVkiZNx0KwEyuMzpFuelhjmRlBbmbvnULg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BN9PR11MB5515.namprd11.prod.outlook.com (2603:10b6:408:104::8) by MWHPR1101MB2271.namprd11.prod.outlook.com (2603:10b6:301:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.11; Mon, 5 Sep 2022 02:48:07 +0000 Received: from BN9PR11MB5515.namprd11.prod.outlook.com ([fe80::8444:e015:794f:441b]) by BN9PR11MB5515.namprd11.prod.outlook.com ([fe80::8444:e015:794f:441b%2]) with mapi id 15.20.5588.012; Mon, 5 Sep 2022 02:48:07 +0000 From: "Xiang, Haihao" To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [FFmpeg-devel][PATCH] lavc/qsvenc: use VBR if maxrate is not specified on Windows Thread-Index: AQHYvaiSQJbgoKwBPU+kKqV+3IGVTa3QKIgA Date: Mon, 5 Sep 2022 02:48:07 +0000 Message-ID: References: <20220901021257.9334-1-haihao.xiang@intel.com> In-Reply-To: <20220901021257.9334-1-haihao.xiang@intel.com> Accept-Language: en-AS, zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Evolution 3.28.5-0ubuntu0.18.04.2 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 93cb2688-fcf6-46a7-0394-08da8ee91035 x-ms-traffictypediagnostic: MWHPR1101MB2271:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GkzrzvsVhD0KX6vsPOL7OnN0zitWBXbR0UHFGiB6CN4Jziol6432Vj0u9oAJKIJKMBDToh+1rTUC7UjqZH9Nq58VDqV0xnl1bUQd8XMOP0iUrGdrPqx+0MaUUfePs0AQM1Lx4j8UQQ90AQt7RR5PqtaX37ZGfnRYCeUnA93zqyVHiW1SB0xfLILdHqxsKH63AQ05tQvwThiMHpA5HxYOeeO1fMWhZDSh2HtZIpR1i3FRdk9fZ3UL3+q1948y5cHRUImGEwyPnlY+BbZgWr9CfQWWorqtUzxFN6iEs7ZpG/y62og9tVtL9QuozWMqR5Slo2lbIdS0hutwYnJP2zQvuav7H+00WNSfL9AMfaAYWTxi1cor0hJs2VEtgAxYlm4wQox0C75+V1fFPMcJIFpkR3d7P1h4cGIOrTswvNh9EKQ6SPxScfras/pM44F0/TYdfHEh+e/x5avxNqwnIOFq5m1dXVerVKx9I+kbRXWWcml+dvo/I7JbN2iUIFjgj2kFvDJfxOyCR3SYU+9lLj7EFcDOzw4D4pUFtcKMMUSwdRLmhSfxAZx+3ZI7OgGCfMl9vjSu6BeEGBkkrxvidYBbikrNcTa5ja/Mx5/nKPM+8RT7hEyN+LaP5itYLqwCcUendFom0qL3CFleZlYP2mbosX3AtrHEf7c5C+8LpPsuBIIQnNI+ZAKt5OZG6zgSgePGSlUhprDQDlHfP+GMHsFOds73sNwI6ENbla8ukaSQi9qybyFkmO+3RTSQRR1r5nZR9TMS6KXg2rlRoRn1NeZAsgn1uiQ8k/DjruoDSUpMp27NxmI1GHjzfggduUBb0Um8 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR11MB5515.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(39860400002)(136003)(346002)(396003)(376002)(2616005)(86362001)(5660300002)(186003)(8936002)(41300700001)(6506007)(6512007)(26005)(2906002)(76116006)(38070700005)(38100700002)(122000001)(36756003)(478600001)(6486002)(6916009)(91956017)(66556008)(83380400001)(66946007)(82960400001)(316002)(66476007)(66446008)(71200400001)(8676002)(64756008)(99106002)(460985005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?anZGb2VqZXQrYUEzUG1hcWlSaUlBWVB3d2pQRVp3d25iMnN2bDdJRDBKSmdu?= =?utf-8?B?d1plKzF0endlbTF5SDRpMGZoczA2bU4veUIrUEUxNFlTTUVVOXg3UDJUNllQ?= =?utf-8?B?bm53b1I4MmcyaUNqaHpCbVJsam91elpObEUxTGk1RExMSjg5bkFrVVQyVTFk?= =?utf-8?B?L2x4Z2tkcWVVV25NMm9ZWHZFZVpmRVFoV2hqUCtIa2pPb0w2eWdBcUc4UGN5?= =?utf-8?B?d2lxd2UyUjdCenZFd1Rnbi9Hc25RdTN4bTlCMHBBTGZMeTg5RkhKVG11UU95?= =?utf-8?B?Q3FQbGlMVWZpY3FUWFZ5N0wzWFlYNkdtcSsxWHZVS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ITFN0?= =?utf-8?B?dkxVY1RDWDU2bmhVTTE5TXVKY212YVVMWGlpUU9kdTlyanN3SkpodjEvWWtN?= =?utf-8?B?MEE9PQ==?= Content-ID: <00C6E89B68AD7244A36AAB95750B1279@namprd11.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5515.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93cb2688-fcf6-46a7-0394-08da8ee91035 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Sep 2022 02:48:07.6623 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sRYAP/tjOLcboffWNbaJqXYVwCNLN33GcGPovJ4MO/Ha1qBGIegNlIy5e6YBgBkb+tF3tlLHm9+ucc/BcBCOxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2271 X-OriginatorOrg: intel.com Subject: Re: [FFmpeg-devel] [PATCH] lavc/qsvenc: use VBR if maxrate is not specified on Windows X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Thu, 2022-09-01 at 10:12 +0800, Xiang, Haihao wrote: > From: Haihao Xiang > > Currently AVBR is disabled and VBR is the default method if maxrate is > not specified on Linux, but AVBR is the default one if maxrate is not > specified on Windows. In order to make user experience better accross > Linux and Windows, use VBR by default on Windows if maxrate is not > specified. User need to set both avbr_accuracy and avbr_convergence to > non-zero explicitly and not to specify maxrate if AVBR is expected. > > In addition, AVBR works for H264 and HEVC only in the SDK. > > $ ffmpeg.exe -v verbose -f lavfi -i yuvtestsrc -vf "format=nv12" -c:v > vp9_qsv -f null - > --- > doc/encoders.texi | 45 ++++++++++++++++++++++++++-------------- > libavcodec/qsvenc.c | 5 ++++- > libavcodec/qsvenc.h | 6 ++++-- > libavcodec/qsvenc_h264.c | 1 + > libavcodec/qsvenc_hevc.c | 1 + > 5 files changed, 39 insertions(+), 19 deletions(-) > > diff --git a/doc/encoders.texi b/doc/encoders.texi > index d36464d629..d2046e437d 100644 > --- a/doc/encoders.texi > +++ b/doc/encoders.texi > @@ -3244,9 +3244,9 @@ the average bitrate. > than the average bitrate. > > @item > -@var{AVBR} - average VBR mode, when @option{maxrate} is not specified. This > mode > -is further configured by the @option{avbr_accuracy} and > -@option{avbr_convergence} options. > +@var{AVBR} - average VBR mode, when @option{maxrate} is not specified, both > +@option{avbr_accuracy} and @option{avbr_convergence} are set to non-zero. > This > +mode is available for H264 and HEVC on Windows. > @end itemize > @end itemize > > @@ -3300,19 +3300,6 @@ Specifies how many asynchronous operations an > application performs > before the application explicitly synchronizes the result. If zero, > the value is not specified. > > -@item @var{avbr_accuracy} > -Accuracy of the AVBR ratecontrol (unit of tenth of percent). > - > -@item @var{avbr_convergence} > -Convergence of the AVBR ratecontrol (unit of 100 frames) > - > -The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the > -average variable bitrate control (AVBR) algorithm. > -The algorithm focuses on overall encoding quality while meeting the specified > -bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy}, > -after a @var{avbr_Convergence} period. This method does not follow HRD and > the > -instant bitrate is not capped or padded. > - > @item @var{preset} > This option itemizes a range of choices from veryfast (best speed) to > veryslow > (best quality). > @@ -3518,6 +3505,19 @@ Provides a hint to encoder about the scenario for the > encoding session. > @item remotegaming > @end table > > +@item @var{avbr_accuracy} > +Accuracy of the AVBR ratecontrol (unit of tenth of percent). > + > +@item @var{avbr_convergence} > +Convergence of the AVBR ratecontrol (unit of 100 frames) > + > +The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the > +average variable bitrate control (AVBR) algorithm. > +The algorithm focuses on overall encoding quality while meeting the specified > +bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy}, > +after a @var{avbr_Convergence} period. This method does not follow HRD and > the > +instant bitrate is not capped or padded. > + > @end table > > @subsection HEVC Options > @@ -3681,6 +3681,19 @@ Provides a hint to encoder about the scenario for the > encoding session. > @item remotegaming > @end table > > +@item @var{avbr_accuracy} > +Accuracy of the AVBR ratecontrol (unit of tenth of percent). > + > +@item @var{avbr_convergence} > +Convergence of the AVBR ratecontrol (unit of 100 frames) > + > +The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the > +average variable bitrate control (AVBR) algorithm. > +The algorithm focuses on overall encoding quality while meeting the specified > +bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy}, > +after a @var{avbr_Convergence} period. This method does not follow HRD and > the > +instant bitrate is not capped or padded. > + > @end table > > @subsection MPEG2 Options > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c > index 7ac5390f10..31ff3b76ed 100644 > --- a/libavcodec/qsvenc.c > +++ b/libavcodec/qsvenc.c > @@ -479,7 +479,10 @@ static int select_rc_mode(AVCodecContext *avctx, > QSVEncContext *q) > rc_desc = "constant bitrate (CBR)"; > } > #if QSV_HAVE_AVBR > - else if (!avctx->rc_max_rate) { > + else if (!avctx->rc_max_rate && > + (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == > AV_CODEC_ID_HEVC) && > + q->avbr_accuracy && > + q->avbr_convergence) { > rc_mode = MFX_RATECONTROL_AVBR; > rc_desc = "average variable bitrate (AVBR)"; > } > diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h > index a983651dda..ff859f2a7e 100644 > --- a/libavcodec/qsvenc.h > +++ b/libavcodec/qsvenc.h > @@ -52,8 +52,6 @@ > > #define QSV_COMMON_OPTS \ > { "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), > AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VE > }, \ > -{ "avbr_accuracy", "Accuracy of the AVBR ratecontrol (unit of tenth of > percent)", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, > UINT16_MAX, VE }, \ > -{ "avbr_convergence", "Convergence of the AVBR ratecontrol (unit of 100 > frames)", OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, > UINT16_MAX, VE }, \ > { "preset", NULL, OFFSET(qsv.preset), AV_OPT_TYPE_INT, { .i64 = > MFX_TARGETUSAGE_BALANCED }, MFX_TARGETUSAGE_BEST_QUALITY, > MFX_TARGETUSAGE_BEST_SPEED, VE, "preset" }, \ > { "veryfast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = > MFX_TARGETUSAGE_BEST_SPEED }, INT_MIN, INT_MAX, VE, "preset" > }, \ > { "faster", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = > MFX_TARGETUSAGE_6 }, INT_MIN, INT_MAX, VE, "preset" > }, \ > @@ -124,6 +122,10 @@ > { "gamestreaming", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = > MFX_SCENARIO_GAME_STREAMING }, .flags = VE, "scenario" > }, \ > { "remotegaming", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = > MFX_SCENARIO_REMOTE_GAMING }, .flags = VE, "scenario" }, > > +#define QSV_OPTION_AVBR \ > +{ "avbr_accuracy", "Accuracy of the AVBR ratecontrol (unit of tenth of > percent)", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, > UINT16_MAX, VE }, \ > +{ "avbr_convergence", "Convergence of the AVBR ratecontrol (unit of 100 > frames)", OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, > UINT16_MAX, VE }, > + > extern const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[]; > > typedef int SetEncodeCtrlCB (AVCodecContext *avctx, > diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c > index a0dc31e24a..4b29ccac0f 100644 > --- a/libavcodec/qsvenc_h264.c > +++ b/libavcodec/qsvenc_h264.c > @@ -115,6 +115,7 @@ static const AVOption options[] = { > QSV_OPTION_LOW_DELAY_BRC > QSV_OPTION_MAX_MIN_QP > QSV_OPTION_SCENARIO > + QSV_OPTION_AVBR > > { "cavlc", "Enable > CAVLC", OFFSET(qsv.cavlc), AV_OPT_TYPE_BOOL > , { .i64 = 0 }, 0, 1, VE }, > #if QSV_HAVE_VCM > diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c > index e59747fda3..29086337fb 100644 > --- a/libavcodec/qsvenc_hevc.c > +++ b/libavcodec/qsvenc_hevc.c > @@ -236,6 +236,7 @@ static const AVOption options[] = { > QSV_OPTION_ADAPTIVE_I > QSV_OPTION_ADAPTIVE_B > QSV_OPTION_SCENARIO > + QSV_OPTION_AVBR > > { "idr_interval", "Distance (in I-frames) between IDR frames", > OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT_MAX, VE, > "idr_interval" }, > { "begin_only", "Output an IDR-frame only at the beginning of the > stream", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, 0, 0, VE, "idr_interval" }, Will apply -Haihao _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".