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 74FAA43665 for ; Mon, 19 Sep 2022 06:09:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 83EA068BC57; Mon, 19 Sep 2022 09:09:47 +0300 (EEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 80ADF68BB72 for ; Mon, 19 Sep 2022 09:09:40 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663567785; x=1695103785; h=from:to:subject:date:message-id:references:in-reply-to: content-id:content-transfer-encoding:mime-version; bh=mwpmrHmnK3YZhXJDAMvFCqdSwpFqWGfanYtBm9eSQo8=; b=f5iQLDa6pn5NdxPh+V9/C3MuyZPWNqW/hOFDT3X3JyLLvJv0Py/bqPOT rWB1OmjiicOUEUFw0UYeK7NySAHuUK2ZQqO4CjUqjVnsSxd3KAFqXDH/7 8Ux23hvi4z764kLslqVCjgdtYPH658B6v6g0Q+o930p8aH69S43CIu/Eg 5pjrr6zuEc6uH/TLyldvruYFNSgoD9J5rbR+9LQrLNQxvQDn3r9AnOm3O 7HD4fEv49gIDQarnnrviYa3eR+HRseKLxRbr3aSY0ck0ks59iHc1H4KBi UR+Bclhi1C4RJfR/qGEgGt1jVTdoV8nTUeyHgymH85q8Og9JuG3YR0Ysv g==; X-IronPort-AV: E=McAfee;i="6500,9779,10474"; a="325600872" X-IronPort-AV: E=Sophos;i="5.93,327,1654585200"; d="scan'208";a="325600872" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2022 23:09:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,327,1654585200"; d="scan'208";a="760731320" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga001.fm.intel.com with ESMTP; 18 Sep 2022 23:09:07 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2375.31; Sun, 18 Sep 2022 23:09:07 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 18 Sep 2022 23:09:06 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) 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, 18 Sep 2022 23:09:06 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) 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.2375.31; Sun, 18 Sep 2022 23:09:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LEAVSeuJnIjUf4Jutpiamt2zdSbVma2C/XnoN+qBD4HbtmIvUjiPB2DSmex25X3xKXyP4tJPM9PtouxxMjhk5mSkOndLRPeZzo8H7AFD+WVgm82fdEpU90+GIx23AXIo3y2yieddINDu901lpjhGxpGqW24y0HTzx3kCDDFsBECNoXfivw6pQyhvxDz4VhFEeD6o2GIvbXvlYFwQNxNTtx0FUnFoZpoi2tO/4G5RBMXRFMU1amWj69aFqIX4hbQbA2u6D2bbR2Y7Mu2XoWXMaahUxz4pVfOkTMPSksnN8UbAMgBZRaJMSOSgDOrsAp4YCbgibiWyBQEpInmNwh6zTQ== 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=mwpmrHmnK3YZhXJDAMvFCqdSwpFqWGfanYtBm9eSQo8=; b=oHOXVdSxTqtBMkMwo8yg/TO/4z5h7NarxAcA9P8l5wMbIosjyEubFB95Gs2PvctXZkLXLGF26g0oC9/Q8i6OkfOmSLhU0oE02Q6/RrAqoGSz07cY8jsUqXvX/WvOtDtUyqXnINOvb5KtSWRBjyosux485FWihHP1QTIPJzW1+kGQ8uwlpdUPeo3xgsycDUrMjMmul/DBK+2Inq2a0IDSYTmYUt1GSSnA7RXGSduNiccttZ2RoK8Wjo/dYKPwQhmf52U7g7TN/jzODWJISFQIxAjIC2Erq9rRV/RauVZgLOxJAqlTvPWVk9JGV5l1hlvBs471oZSOa/bo3vS2o2q6Fw== 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 SJ0PR11MB5868.namprd11.prod.outlook.com (2603:10b6:a03:42b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Mon, 19 Sep 2022 06:09:04 +0000 Received: from PH0PR11MB5030.namprd11.prod.outlook.com ([fe80::af00:cb84:f7f5:bc12]) by PH0PR11MB5030.namprd11.prod.outlook.com ([fe80::af00:cb84:f7f5:bc12%6]) with mapi id 15.20.5632.018; Mon, 19 Sep 2022 06:09:04 +0000 From: "Wang, Fei W" To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [FFmpeg-devel] [PATCH v3 2/3] lavc/decode: Add internal surface re-allocate method for hwaccel Thread-Index: AQHYtsk3i0aRS5iWpEC903eL1cV6/a3Um9WAgBHS+oA= Date: Mon, 19 Sep 2022 06:09:04 +0000 Message-ID: References: <20220823081929.413947-1-fei.w.wang@intel.com> <20220823081929.413947-2-fei.w.wang@intel.com> <9599a3fb-8cd4-b2df-366d-bf6257ea63e4@jkqxz.net> In-Reply-To: <9599a3fb-8cd4-b2df-366d-bf6257ea63e4@jkqxz.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Evolution 3.36.5-0ubuntu1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR11MB5030:EE_|SJ0PR11MB5868:EE_ x-ms-office365-filtering-correlation-id: 201d524a-1ef3-42ff-5598-08da9a0574a5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ynm7hjgx9HNA0/cSaaPgiMGfDvpDQ/2mZPDVnDhvo2UdA6PFRWbvmfxozYc5/eMyfe7JPvs2Zlh4WF8ZZI09LVz1dNAn6xsWE2/++CSFeXJE/LelUdtGcDNtf15rMe/1UtUkH371+O2f+3ZD3rlvU763BqCZmfKoZW1Xbpsw1yU12I78LB8KYUTtpgx2vZNkrEnl5rb9mMGzTLRNMv9ixhkVKfTcRV2QgF502OUaSGXQssmYziiMzK2FMUjg2+2+yw2A/MH3P16Dd4zdJIxC5iCHr63eOCrNR2tN9tLsWrIDEHEIvOHQyIPJUzkjqRJqGDPngg+aXwp6WzGNlbWu9GbDxGy914KfDm8vRDm+Ksb9IoIDv0jOA7GyKxBHlTpvGO9/D+jYLYW66KCK3SCfRgUYWx6sQD+QynK/mlLHDPjbZG+7I4VwBolKlm0+WFNVb9nrzwAnMMNqzn42ctEoigOz2lecj9gWOc95NvlcfRMidxbMCWQWwlDjeQ7wyq6pLuc0wyJJtlQJnYtfusg6gVorEOa3uR+4Ut/BCYmCytmQJa9FRXB3HP2ssyM93fYuOjVYTRzH4IxnU3PKGbbxMZ718nUQBISzrcubdI35mDaflO4+5mfr7KrHJDCsOZ3mzs0fxf7YgLmfPhiZwxP68yhvIAUXFKOxooAVEX5HYuXXokcuXON5J1lANY3+z6qLG1wCV/0Slka8sqi3afmcKJpYP89XaMhhnKGb+dD8gYaQaDLqHiQml4iRX9jemw+imIXsjqdtAzGsWWHkfZ4YLb+UaohfUtRhd3ajN/i/TjE= 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:(13230022)(136003)(366004)(396003)(376002)(346002)(39860400002)(451199015)(38100700002)(6486002)(36756003)(8936002)(66476007)(66556008)(53546011)(2906002)(41300700001)(91956017)(66446008)(64756008)(2616005)(82960400001)(5660300002)(316002)(26005)(186003)(86362001)(478600001)(83380400001)(6512007)(966005)(38070700005)(8676002)(122000001)(6916009)(76116006)(6506007)(66946007)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?R20vS3F1VGx0dVhTWXQzc3dmbzFwNmV6Sm5KRmsxS0dhM2FDT29iQnZzVUpO?= =?utf-8?B?Q1IwTjdYS2o4MG5EbWZxOVRidkdxZTVwNXJtL3dPckw1WXkybzBqeXBlS1Vq?= =?utf-8?B?NlR0clhFM3l4NzF1b3lkcW03YjNXbHl1YmVPNmNxWjBIWm0wYUNnLy9GZHBv?= =?utf-8?B?enJsRmxSL1BhTnBCM09oVmZLdCs0RlJJcHE2RlBZbUt6VHR5ZW9Sa1VZdDV5?= =?utf-8?B?SDdoQTFNRW1hb0RtL1k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f-8?B?MnhXTmRNRk5FRVJ0Tk5Xd3FhcUx5aWpBZzZiNkpuTGVsQXdvWHR5TWVuTkFC?= =?utf-8?B?ZGt0c1FnOG9TL3hyTUdldittUER1QXdNVmlHNUNuQnJkcmFNV3c4OVRlRkoy?= =?utf-8?B?K3c9PQ==?= Content-ID: <44DB9607E6383744BC01FD456E2FA0C4@namprd11.prod.outlook.com> 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: 201d524a-1ef3-42ff-5598-08da9a0574a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2022 06:09:04.8696 (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: qU1hcSxZyOGs7QqcBMpFXgtBaFMA09arOHpmGkP7GG4HWJlU/pa1GrEWVs65W5lXtuyREKPs8pSMxehIApIo+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5868 X-OriginatorOrg: intel.com Subject: Re: [FFmpeg-devel] [PATCH v3 2/3] lavc/decode: Add internal surface re-allocate method for hwaccel 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 Wed, 2022-09-07 at 22:56 +0100, Mark Thompson wrote: > On 23/08/2022 09:19, Fei Wang wrote: > > From: Linjie Fu > > > > Add HWACCEL_CAP_INTERNAL_ALLOC flag to indicate hwaccels are able > > to > > re-allocate surface internally through ff_decode_get_hw_frames_ctx. > > So that hwaccels don't need to reinitialize all hw related configs > > when decode resolution change, just need to re-allocate new surface > > by using new resolution. > > > > Signed-off-by: Linjie Fu > > Signed-off-by: Fei Wang > > --- > > libavcodec/decode.c | 36 ++++++++++++++++++++++++++++++++++++ > > libavcodec/hwconfig.h | 1 + > > 2 files changed, 37 insertions(+) > > You can't just not call the user get_format callback and allocate > your own surfaces - this breaks direct rendering and other cases > where the user wanted to manage the surfaces. > > This is also missing any check that the hardware decoder supports the > stream post-transition - if the decoder does not support the new size > (or any other property of the new stream) then this will try to > blindly decode it anyway and fail, where previously it would have > correctly fallen back to software decoding. > > > None of these patches say what the aim is, but from reading them and > seeing that VP9 is the intended target then I am guessing that this > is intended to support the case where the stream resizes while still > using previous reference frames - is that right? Yes, this fixed some vp9 resize streams which reference frames has different resolution. > > If my guess is correct, I think you should (a) mention that fact in > the patches, and (b) target the support at specifically that case, > and not try to mess with any other reinit cases. > > Something like: if you know you are in that case (the decoder itself > has this information and could pass it to ff_get_format somehow) and > the context supports it (I am still unclear how this support can be > determined - the libva documentation is very clear that a context is > tied to a particular height/width), then remember the context across > the user get_format call and if things match up then re-use it. Thanks, the logic looks good. I will check it later to see if any blocks on the detail implementation. Thanks Fei > > If for some reason you are in that case but it can't work (e.g. > because the new size isn't supported by the hardware), then you need > a better error message - the stream is actually broken because most > frames are not decodable until you reach another recovery point > (since the reference frames are in hardware surfaces so the software > decoder can't use them). > > - 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".