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 2EF6444BC9 for ; Tue, 8 Nov 2022 11:59:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5AF0468BBCD; Tue, 8 Nov 2022 13:59:05 +0200 (EET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A3AF168A678 for ; Tue, 8 Nov 2022 13:58:58 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667908743; x=1699444743; h=from:to:subject:date:message-id:references:in-reply-to: content-id:content-transfer-encoding:mime-version; bh=dO1HmNfFe3Hb2b1yNuy1jO43GNsyd+JOCXvaRlEKreE=; b=ZBVQ43eSzcHJS1YmJqKsP+ssPS5qniLXqTO5AXiV0zbewYr+9nzSMFo6 w+v197nWaz3dHzJWHND8ShWwB5PjDUCwkf2hCFOdE1BkKMFKTdk16utTv 0Q9gAFGFpJgHubZpTa2c7E7xxZlwT9ovSdszn/ZKDWMnqtJHYvyHg+tt8 FnR1v++hFqiA/wynMh+zal+pspF4KnM+VjMlFlcF/zSNGhcRYpGfHTMAb fjHmPmJ7GDw2Jgjxb4Q2hdx52viZkHsyEEsUqDS7GV3wbwIp+Vwg8VIN+ Axq7ohDxFSggWrrlbdDgh0B5OgvbEf3IfW4wzg1TBzlHnQ/WBK/17zHDR A==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="291062408" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="291062408" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 03:58:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="811216356" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="811216356" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 08 Nov 2022 03:58:56 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 8 Nov 2022 03:58:55 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2375.31; Tue, 8 Nov 2022 03:58:55 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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 via Frontend Transport; Tue, 8 Nov 2022 03:58:55 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) 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; Tue, 8 Nov 2022 03:58:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jqXfPm0rCngI0FtB6zVxAhxBdN6d6epyoGRXrnpylxRypb0XWCW98A7jlNNXRF5GTD3CuFKN3m1osSj6LfiYNJ/pyOsD6SwQyWSuHyjl5xvAMPtM1RtpQjsC/8HclrdQx7UgTIlOSfwIl4Jhof9kAgPeZpYCjE8hcsyau2goWq1xG78+FTD2xQox0FgHnbzHoUuRPri1Tn0nWtyF+zB2Y0t12xf63C9tNW4l9iRAUAyqtxZFK5zY7XUkNe+byakc9/tx94i7X6vatlP/tmafflB2WHu7xIj5rlBkeMQFxHA0KKtb07yjLPLANGjad8FWMUSxj0WYaKCtB22QgHe5lQ== 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=dO1HmNfFe3Hb2b1yNuy1jO43GNsyd+JOCXvaRlEKreE=; b=a2dnGN4FupvwAmenKId6Dhm3AruD+O0V5rORKv9hW3N8wToYujKZypmmmeMLQqUKNgtgrUFrulyptM0wFAqtAJJVo8erPe2DENY0zcNEzwtMpVtgPdcfsz8SHJ3IkbE9sHqM0VF7AzfzUuBW1BHWubBQqFCF7F3bPPaJ1SyKzgEPgAHDhbYVzp++nW7HMqTxGqvd0DcIpXQbRVsEZ4OwsuA6KYZ8IymsdJKWQLob0HKJZZpS1dTiTc2Yba8z/PgYHJHODy7tC3XPMCvyUoKXt9hItohIR45reBIQVuZmIf98AdoM0Q0LDyslPhB1F0X8GMa+d4tFXCk/TfMPe4Dq7A== 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 PH0PR11MB5830.namprd11.prod.outlook.com (2603:10b6:510:129::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.26; Tue, 8 Nov 2022 11:58:54 +0000 Received: from PH0PR11MB5030.namprd11.prod.outlook.com ([fe80::684d:f7e7:6cb8:d10a]) by PH0PR11MB5030.namprd11.prod.outlook.com ([fe80::684d:f7e7:6cb8:d10a%3]) with mapi id 15.20.5791.027; Tue, 8 Nov 2022 11:58:54 +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+oCATvaNgA== Date: Tue, 8 Nov 2022 11:58:53 +0000 Message-ID: <823bdafc0125db35bb2f683059a85f938e9faeed.camel@intel.com> 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: 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_|PH0PR11MB5830:EE_ x-ms-office365-filtering-correlation-id: 3331a372-d28b-4c4e-c5f6-08dac1809bbf x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: klSYy1QjlxY29yytvrDmAIYkxET+UkQd5BL9BC9v0kqPEc+E44g2p4p+0U7591gstMheIybJjm2Rssn8xxgDk5lKMub27cT0yvv9GnnPKV9ONw7rdTQ68MDyxVV1ZlxjMShsgA60oV+sa8G/TYUTLqwwheoQHUTo+ukIBPm9TgcywmkVQO3PqSTYRntSk88PBiRHJPXYjdp0KkIy44KhNYmY3dQ+C7Sn0lYbQD4TLJyfTyezw8gALdYyVN79+e0rFxtUkOh4Iee/bxmRYLFaBDHBwKAy79lxPK3/5uWeRIhpW9/Gzy3wnev8mGoNTqxUZCwDxCooQzXqzymPQ4+J1gbo7aA/+JL7Yquw+XNTGkWqnfPhapDCNkYAmijsITj6ekqOMODZWL1Gi2t1CfpYRhieyT54bfLbIJYzGWLtVwj+WkSsbNsmNhd6Pecz4Q0NQ+vewJUyURCKo7G8yl0Dgr8epvOPZ6cY9bEkBPrtAXH+RlhJc8MBlJOjbuE6MDTS56TZnQZjcgqiLjclKIdqWR2FF8HAW+v7QXs/KTFzPWXXkFqpR2l9H+HTMVUrJhU7GA+RITDnECrxCZGHWAYTOwNLpQI3UeNOlV33118RZoYDian34gZpqaxpLNvt1svdGSDh1VgGEj3aEwT5pps/hGDBYuHLH0qs75zHyCwPh2E0UrVJRIvvFdFt+dD4q6Gv4wggRk2XtGSsxt/Oj1ovkwqyy4IX08/GlsvJpoE5am9CTAx/cTQTVTi/26u7Koom7zT5Gf1rLlGfbpK1K8zCeoCDTTtVJ3Mw89HHCmyje44= 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)(39860400002)(396003)(346002)(136003)(366004)(376002)(451199015)(41300700001)(316002)(6916009)(5660300002)(8936002)(91956017)(76116006)(66476007)(66446008)(66899015)(8676002)(66556008)(64756008)(66946007)(478600001)(71200400001)(2906002)(966005)(6486002)(186003)(2616005)(26005)(6512007)(6506007)(36756003)(53546011)(82960400001)(122000001)(86362001)(83380400001)(38070700005)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?Mk9ERzhhTW1GZHh1VzFIM2w5Y2UyWFJTdG9DZEJXK0tqN1BjZVpydzV3cTRL?= =?utf-8?B?OVZpYlAxdGRCd1IvdDc1bVVYS3JRYlhqd1krM00wT1RFUXJWaXk2ZmIrZGE0?= =?utf-8?B?K3M2SHBPMXUyNENnbHdKNE5PWnhiT2VzMDV5ZExRRjBoWGR4RU1mRlhDS2hR?= =?utf-8?B?L1JPR0xRVmlaMVJYbUpRNlY2Qm5HVTNKeWtBTnIv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dEdV?= =?utf-8?B?VUo3aHpPM1c0TnZXWU1XZlRlUTE3b2NXT04xcEttbENmczZrWEFhUUVaNUpK?= =?utf-8?B?b1ltN3BQNndZMUZ6dE4zRjZGVWttcVNBZDVUcGozRTdHY0lnTjBSZ3kvalFW?= =?utf-8?B?eVdScXlQNFZBTW9YeklUNkF3TzVDTC8rMkVFVWYvUDNFVUNZbmE3YnNKbGlZ?= =?utf-8?B?b0E9PQ==?= Content-ID: <7B31B95AC288934F9FD23BB4E377B41F@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: 3331a372-d28b-4c4e-c5f6-08dac1809bbf X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2022 11:58:53.8732 (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: yialQdKeSNQ1G76NDXNLYWLTQCf5TNmjWXYooA60aq0sTbFnisFXAqoVLv12e6oRbdSV5K7aB5tkdZKqcMTQ+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5830 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 Mon, 2022-09-19 at 14:08 +0800, Fei Wang wrote: > 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. Current decode logis is hwaccel->uninit, get_format, hwaccel->init. While the avctx->internal->hwaccel_priv_data is freed in uninit and re-alloc in init, so it can't store and re-use vaContext in get_format. I have modified the other version of V4, which can keep current decode logic as much as possible and still put alloc surfaces in hwaccel.init() after call back get_foramt. Thanks Fei > > 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".