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 87B7C40F76 for ; Mon, 14 Mar 2022 11:08:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D6A768AFCC; Mon, 14 Mar 2022 13:07:59 +0200 (EET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DB2A8688154 for ; Mon, 14 Mar 2022 13:07:51 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647256077; x=1678792077; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=IXNtE8EZaGXt7H/dAl7dPbJxOPdU/NjETkcAL6whgNw=; b=WFZ+waCyooJb0VirrJNKQ/u/sfPcap1e+RR2WBqQ1prJuXbNZwBYMytF eQ7+G0izKefn0c9am9Ge7sp6nMAB6h3UK6H+Df8JZl00/MIngYMvRIjDy GqRhRnb3jLhispbN3h5FQ5lF+devkXijkO8THWFbW1UgUi/ytC4ixTl3b kweoGNA0ZVLbhKl3OEh539B9IYfvWbWiuVPSObXD9ky5pgE8X7uDyvTrL C3MjRztpY9KNPS/n+WOjQ3FbqBfeNwvLlUt/9Pt98hiiShMHIJexbYZWc q0XOmddFSk4fyuXBWpyb7qzZt35qOVKZgMVVXiydnxzv2g3b9wZP/agwV g==; X-IronPort-AV: E=McAfee;i="6200,9189,10285"; a="235943706" X-IronPort-AV: E=Sophos;i="5.90,180,1643702400"; d="scan'208";a="235943706" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2022 04:07:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,180,1643702400"; d="scan'208";a="634154237" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by FMSMGA003.fm.intel.com with ESMTP; 14 Mar 2022 04:07:48 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 14 Mar 2022 04:07:48 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 14 Mar 2022 04:07:48 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Mon, 14 Mar 2022 04:07:48 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Mon, 14 Mar 2022 04:07:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F4JYII6sjhn7A4wlWCRAg81OAs0utDuc79gUKvDBQ/3Pfn5tpEes5lSpX3mIAmcoVe5adsFeB8k5SUkJZZW8tQr5MxDSHsenbEyD8d2Fo0Te1VdBvDz1qKl51jMLulmM003k62Mwawv6dirVMA5An+MLNeRA1ljk+CuWPF5HSa4OLRdSKD45KV6IMCEgsV2+lNIcvLyJg7GtfUKl9uhmwWHeEcBRtfGL+CRMDysEHhpbogDvXt4vaXZEYzYXxnUIq4pB4lJX74+dEo+micymrGQ1nGXhr5DbAsVgP39ORMtCVWy+E9bnZNmcnnJaUW4+9rz9yBgnTvSx35NpwHWazQ== 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=AooMk779EI4jrxc6JUFVdr0T5yCUQQRTpS69WMNvpRI=; b=RsBM12PfOTjTxpAOL3e/mwLhPM/2zy2X4DvyPMHNplYKQyd6/3y33PncUZDStdVD4VxCRJr3T0DaKKOyOpA8L/lx/NgCMwe6iOKxKKA8hOMOkdO73bkKxOIY/W89E0QPvKLJt8Hu1lZBIv6kz2kUUj5MgS8tWu2FfZDxDHoODj+3VvcosFRJIh90a0JTk28eXAXqnTE7uhCR+m0W1niC0ljv7E+KftyDNDMiBew8meKOK6ZrSgMc5rdxtOuoMNCOTpAxpDWYjHerelRO0Np3QImlCP+S7UaF5QrrQiJx8nTk4NGCBFdSuaSjT5exsNKZxOz0xQHqr+hRotF09BhFmg== 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 PH0PR11MB5030.namprd11.prod.outlook.com (2603:10b6:510:41::5) by MWHPR11MB2014.namprd11.prod.outlook.com (2603:10b6:300:25::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Mon, 14 Mar 2022 11:07:46 +0000 Received: from PH0PR11MB5030.namprd11.prod.outlook.com ([fe80::5d7d:e941:5f63:7d62]) by PH0PR11MB5030.namprd11.prod.outlook.com ([fe80::5d7d:e941:5f63:7d62%9]) with mapi id 15.20.5061.028; Mon, 14 Mar 2022 11:07:46 +0000 From: "Wang, Fei W" To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH v4 1/4] lavc/vaapi_encode_h265: Add GPB frame support for hevc_vaapi Thread-Index: AQHYNSdXHNr9VRHbaUu0k7nY+3zj5qy9zFCAgABcHQCAAHNhgA== Date: Mon, 14 Mar 2022 11:07:46 +0000 Message-ID: References: <20220311090046.262777-1-fei.w.wang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 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: f33caaed-be5c-4e87-34d7-08da05aadeb4 x-ms-traffictypediagnostic: MWHPR11MB2014:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1coehZsoVUCmancMmWduaw4QAqiyttjB1a4HX7rR5L0yBaEhC5+uZOW7ftghAr+RGuTrIp8YDd8bQ5dSdgOAHVYPXObcnN56WR70R1/VD9pwI+yqxu73xRhpYPfNBblO0tbQJebGmC14j/QIXmkOBX8aOerWwOGVaZ8UkAzvPeMbgP1UVlJmeOL1j09zFt8xL44JMuPfM/Q8SXARao6tfHVL6gFSAj+VsHPMczRsyPeBcKSA5lrpgMv++uRExFIsd8KIBnoPopuPo3XM2YFTQKgaNp40KLmiMCvVpxCz/InAnUgTJXzrYyxzOTtUUGLbjRcawiY0RCjxyiBPlqD+wZ7kONcYy51jmjEVRH6UM6ZArI0fQcfu6qfHYAyduknxE5YznXrMFJjw6t2ibc4uOqumYHwUIz/UYdUdTbVGkbeWDah8t+XZbyCNtn810dhgc91m55K7BCjWQSZH+9e8mqecunB5AzZ/hAJnJAr/ZB2DAOcmiHxkHFDVjA11krPqciC2UpdAPquKdCug0N8LdYIuAPSR5ouCC4cIIzTpOmtX74bqbgqfd8nJRxlQBbmLc8wlqoV9sbj5WLJ2kXZ2CgKLbjFKQ1m970VXXVTLHmBSkv1rOSMdX+86ek+F0e29jAQgVS7Tfj/cdErkcvHHaKO0wdQaoSfQv7ErdEAzWwjaeQwJ2XteP6ZVQ5WZ0duGRYpWrwYiphmjXRbvLn/ISdi0XMlmNxIyXrVVie9KWtGhAXq16+Q1MVqxh/UBJ26vyuEVdzWgC8/5TgqqTmlYMjLtNBHDcqARyvJE5f5Jyaw= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5030.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(316002)(83380400001)(2906002)(86362001)(55016003)(38070700005)(8676002)(66446008)(52536014)(38100700002)(66556008)(66946007)(76116006)(7696005)(6506007)(53546011)(508600001)(8936002)(71200400001)(64756008)(66476007)(6916009)(9686003)(966005)(122000001)(5660300002)(26005)(33656002)(186003)(82960400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OE2nceEw4egTDSnzYE9rGEjnG1LNJvc7p9isO0zb4SRb6DCAM+rjGp6FAz18?= =?us-ascii?Q?XDByNSRCj58fZUCa91vgyLq2uhOQGcbmefru70sHKob1SARZFr7BvJiDei5U?= =?us-ascii?Q?gMxb4sgbX1Ru98Jl2xpAPfgQnvzfWkw56eDDB59XXhTvXXwgRoifSrr+RYZH?= =?us-ascii?Q?XTyKQJ8BJQh9yYsh5dSQKTHXN6aFgxRGiiq96wtqmCkal4RMBhzIzj0whD/Y?= =?us-ascii?Q?08J5s7eOoDG2sKQMUJq3y7XTbMjNG5FKACgjqIY+brZN6tNruFCt17usYUEj?= =?us-ascii?Q?V4xRlYOhgiTsPdWtjmnmPf9oBBLWBx0ft/O2/2s0yadrt01M1LTD05TzW12B?= =?us-ascii?Q?rgmRo/UEB8VIx/FznXgfAGPDKC6A0AZwzjDfSOVApGalL3ehMvKArH1x8gZL?= =?us-ascii?Q?QTwsk09xirKEH9qcIuBocDgXeUfwrr2rCz/PnN7WD9gf6l2EE1NquCoYh0CE?= =?us-ascii?Q?nxK28ajOX+gi1IL+B7uQP3HLEUaoQZ/9HGxBXKn1++J2to1i5KQFAIuFn8WS?= =?us-ascii?Q?LDKYPY1vUi+Kb1Cl5Ar5OA9vbwfuopFDYAP9Sl2DoVXpsXM2s4dp8GW1IwqL?= =?us-ascii?Q?5Uk8kD1w5I5hdbgTsRvjzSs7Pt1aobH61INZ3jB6JL4p6TqHXkydqgcGA/fY?= =?us-ascii?Q?KY0/M8kGpiZhxKdsAdadyQkocltc9n/dZ1CZoJDpUwSwGRTzCQpgo0y6xsRR?= =?us-ascii?Q?HMEYpVJjBQs4c1nSNItNlOHTuZ7KSBPds09isMNi45wKu7yxInd2XA/jeuaX?= =?us-ascii?Q?ZG3wpl5nEzB3bLbSDCrcVEuGE6S8MBHJkeeal/vVHmHjTK6TGdH9YBAc7uVT?= =?us-ascii?Q?tkaMS3iTYCs7N1U0wRrLVGtsQ3rahZb/Onc77nyG/F1EWuYNlDBuMXtjHHpV?= =?us-ascii?Q?1LWUXAYDmkbD5uI+4PUI9v5p2RjHr9Gw0ZAHZ/KYLgayyexaA6jN7Dzg2BG3?= =?us-ascii?Q?iJzoAMiMekWeC+noKzuayW4btbsubsPh6W0LcPIhxKUJbengGF6+PZC4xvKz?= =?us-ascii?Q?q/RBQstT6AoacEL6hzMuVJSTuecjHFhhvE+nkTF5DRH+LaFS3Ozhk6YBST6K?= =?us-ascii?Q?NViqgTSmjpRTE4MLanMz0rFKWyhZbwgC1N7kdXfTuYJGl+mOebKUGZvoizuL?= =?us-ascii?Q?lwRQzOh+22tWpySEDWo77iIQwXgXLqdAe4ctYhTpMJuSgCGdVYlgIk/YPewB?= =?us-ascii?Q?AMiSYhddkDeuLkO5RdP64RCJl3CxB8te06g14qRoxLjSKpyzOnyQIPR/Gu0F?= =?us-ascii?Q?ypHqh36RNmMtJMQE6qYvChgwZcb4NGZG6Yyxa4dLgTXnz3h24tCyN8J2ZORq?= =?us-ascii?Q?JLmexC6FI2VmyEzeDy7lqVdQuqQsjW0s4xynI59H0Gz4lhuPJZkxaRQBdZEy?= =?us-ascii?Q?alX2yB6DywLQzC2YU5TYqu/EJ2b5JzI5NmSGy3nbwxOWUz7f897i5QTtKmdH?= =?us-ascii?Q?t+a0W6P27W/VbBqJ8ur8/ntgB3v8DmkI?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5030.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f33caaed-be5c-4e87-34d7-08da05aadeb4 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2022 11:07:46.4496 (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: 380nEHxHDsfJnPm4vj3zhQ69EGErVZdzlqdZFu+aX2wqRACtLqzP20Gv862NxHZ9CykDvOGi+ddLLN0h/NuAhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB2014 X-OriginatorOrg: intel.com Subject: Re: [FFmpeg-devel] [PATCH v4 1/4] lavc/vaapi_encode_h265: Add GPB frame support for hevc_vaapi 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: > -----Original Message----- > From: ffmpeg-devel On Behalf Of Xiang, > Haihao > Sent: Monday, March 14, 2022 10:15 AM > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH v4 1/4] lavc/vaapi_encode_h265: Add GPB > frame support for hevc_vaapi > > On Sun, 2022-03-13 at 20:45 +0000, Mark Thompson wrote: > > On 11/03/2022 09:00, Fei Wang wrote: > > > From: Linjie Fu > > > > > > Use GPB frames to replace regular P/B frames if backend driver does > > > not support it. > > > > > > - GPB: > > > Generalized P and B picture. Regular P/B frames replaced by B > > > frames with previous-predict only, L0 == L1. Normal B frames > > > still have 2 different ref_lists and allow bi-prediction > > > > > > Signed-off-by: Linjie Fu > > > Signed-off-by: Fei Wang > > > --- > > > update: > > > 1. Add b to gpb. > > > 2. Optimise debug message. > > > > > > libavcodec/vaapi_encode.c | 74 +++++++++++++++++++++++++++++++-- > - > > > libavcodec/vaapi_encode.h | 2 + > > > libavcodec/vaapi_encode_h265.c | 24 ++++++++++- > > > 3 files changed, 93 insertions(+), 7 deletions(-) > > > > > > diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c > > > index 3bf379b1a0..bdba9726b2 100644 > > > --- a/libavcodec/vaapi_encode.c > > > +++ b/libavcodec/vaapi_encode.c > > > @@ -848,9 +848,13 @@ static void > > > vaapi_encode_set_b_pictures(AVCodecContext > > > *avctx, > > > pic->b_depth = current_depth; > > > > > > vaapi_encode_add_ref(avctx, pic, start, 1, 1, 0); > > > - vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); > > > vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); > > > > > > + if (!ctx->b_to_gpb) > > > + vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); > > > + else > > > + vaapi_encode_add_ref(avctx, pic, end, 0, 1, 0); > > > > This is doing something extremely dubious. If b-to-gpb is set, then > > don't use the future reference? > > According to > https://github.com/intel/media- > driver/blob/master/media_driver/agnostic/common/codec/hal/codechal_vdenc > _hevc.cpp#L3072-L3087 > , L0 and L1 should be the same for vdenc hevc on some platforms, so user can't > use past and future reference together, which is why you experienced the failure > after applying version 2 > > Thanks > Haihao > > > > That means these pictures will only have the past reference, and the > > coding efficiency will often be much worse. > > > > E.g. if you have the default structure (max_b_frames = 2, max_b_depth > > = 1) then in a sequence of four pictures you get: > > > > 1 referring to something previous > > 4 referring to 1 > > 2 referring to 1 and 4 > > 3 referring to 1 and 4 > > > > and this change means you lose the 2 -> 4 and 3 -> 4 references. > > Therefore, a change in the picture between 1 and 2 will end up coded > > three times in 2, 3 and 4 rather than just being coded in 4 and then referred to > by the others. If driver doesn't support B frames with two different reference lists, use gpb instead of regular B is a best way. In V3, I turned B frames to P, but this will break gop structure. If user set I/P/B frames, while the output only contains I/P frames will be much confuse. > > > > > + > > > for (ref = end->refs[1]; ref; ref = ref->refs[1]) > > > vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); > > > } > > > @@ -871,8 +875,11 @@ static void > > > vaapi_encode_set_b_pictures(AVCodecContext > > > *avctx, > > > > > > vaapi_encode_add_ref(avctx, pic, pic, 0, 1, 0); > > > vaapi_encode_add_ref(avctx, pic, start, 1, 1, 0); > > > - vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); > > > vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); > > > + if (!ctx->b_to_gpb) > > > + vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); > > > + else > > > + vaapi_encode_add_ref(avctx, pic, end, 0, 1, 0); > > > > > > for (ref = end->refs[1]; ref; ref = ref->refs[1]) > > > vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); @@ > > > -1845,6 +1852,51 @@ static av_cold int > > > vaapi_encode_init_gop_structure(AVCodecContext *avctx) > > > ref_l1 = attr.value >> 16 & 0xffff; > > > } > > > > > > + ctx->p_to_gpb = 0; > > > + ctx->b_to_gpb = 0; > > > + > > > +#if VA_CHECK_VERSION(1, 9, 0) > > > + if (!(ctx->codec->flags & FLAG_INTRA_ONLY || > > > + avctx->gop_size <= 1)) { > > > + attr = (VAConfigAttrib) { VAConfigAttribPredictionDirection }; > > > + vas = vaGetConfigAttributes(ctx->hwctx->display, > > > + ctx->va_profile, > > > + ctx->va_entrypoint, > > > + &attr, 1); > > > + if (vas != VA_STATUS_SUCCESS) { > > > + av_log(avctx, AV_LOG_WARNING, "Failed to query > > > +prediction > > > direction " > > > + "attribute: %d (%s).\n", vas, vaErrorStr(vas)); > > > + return AVERROR_EXTERNAL; > > > + } else if (attr.value == VA_ATTRIB_NOT_SUPPORTED) { > > > + av_log(avctx, AV_LOG_VERBOSE, "Driver does not report > > > + any > > > additional " > > > + "prediction constraints.\n"); > > > + } else { > > > + if (((ref_l0 > 0 || ref_l1 > 0) && !(attr.value & > > > VA_PREDICTION_DIRECTION_PREVIOUS)) || > > > + ((ref_l1 == 0) && (attr.value & > > > (VA_PREDICTION_DIRECTION_FUTURE | > > > VA_PREDICTION_DIRECTION_BI_NOT_EMPTY)))) { > > > + av_log(avctx, AV_LOG_ERROR, "Driver report > > > + incorrect > > > prediction " > > > + "direction attribute.\n"); > > > + return AVERROR_EXTERNAL; > > > + } > > > + > > > + if (!(attr.value & VA_PREDICTION_DIRECTION_FUTURE)) { > > > + if (ref_l0 > 0 && ref_l1 > 0) { > > > + ctx->b_to_gpb = 1; > > > + av_log(avctx, AV_LOG_VERBOSE, "Driver support > > > + previous > > > prediction " > > > + "only for B-frames.\n"); > > > + } > > > + } > > > > Please note that the PREDICTION_DIRECTION_FUTURE/PREVIOUS options > > don't mean anything for H.265. > > > > The driver isn't told which direction the prediction is in, it's only > > told about some reference frames and how to refer to them. Whether > > those frames are in the past or future is unspecified and irrelevant - > > a P frame can refer to a single future frame if it wants. > > > > (I tried to argue this when it was added, but given that they are > > meaningless I didn't argue very hard.) > > > > I suspect you are trying to use this as a test of something else. > > Perhaps you could explain what the test you actually want is? VA_PREDICTION_DIRECTION_PREVIOUS/ VA_PREDICTION_DIRECTION_FUTURE/ VA_PREDICTION_DIRECTION_BI_NOT_EMPTY are used to indicate if driver has the limitation on how to set regular P and B frame's reference list when the queried max reference list ref_l0 and ref_l1 both are not zero. If queried value is VA_PREDICTION_DIRECTION_PREVIOUS only, this means driver doesn't support B frame with different l0/l1, need to set l1 = 10. VA_PREDICTION_DIRECTION_PREVIOUS | VA_PREDICTION_DIRECTION_FUTURE means different l0/l1 is support for B frame. And if queried value is VA_PREDICTION_DIRECTION_BI_NOT_EMPTY, this means driver doesn't support P frame with l0 only. And in debug message, maybe use "Driver only support same reference list for B-frames\n" will be more clear. Fei > > > > > + > > > + if (attr.value & VA_PREDICTION_DIRECTION_BI_NOT_EMPTY) { > > > + if (ref_l0 > 0 && ref_l1 > 0) { > > > + ctx->p_to_gpb = 1; > > > + av_log(avctx, AV_LOG_VERBOSE, "Driver does not > > > + support > > > P-frames, " > > > + "replacing them with previous prediction > > > + only B- > > > frames.\n"); > > > + } > > > + } > > > + } > > > + } > > > +#endif > > > ... > > > > - Mark > > _______________________________________________ > > 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". > _______________________________________________ > 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". _______________________________________________ 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".