From patchwork Mon Feb 12 00:03:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46193 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9002:b0:19e:cdac:8cce with SMTP id d2csp402646pzc; Sun, 11 Feb 2024 16:03:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IECtQx1VDSvmB+OsXVDv+0u8WS18wranBlzRlPNATDP4a34hc1HD9MSu2UjXTe14zhbNyfn X-Received: by 2002:a50:fb19:0:b0:55c:d503:764c with SMTP id d25-20020a50fb19000000b0055cd503764cmr3230869edq.22.1707696227000; Sun, 11 Feb 2024 16:03:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVwtlIFLjw+YUSgurB2hAm2DHGYaY6bjDbMsCqCKe1LAP+GfV0DSflPsxC1Zg2EtC2qdtmxNawwtZ44vWrx/WOUlcRt97a5/JtErRBoayDNfwXwc1yhX0fsxv3cuDolZ3kKFbxQTiN0jua+t9g397QlpHPqEZPzvYp1mw6uEU4dpqtNG+cueLeK1RH+wrzsbEdSbki8AjCdynO1bjG9UkposW/rP5jUO+rzmGMuWfi9c/MB0PvIlJD4wgof5nOeOB+6CjfhvwBSGnY9JGFcmu1Lu+tP9hqWUCN6D28a93yjgybY928Gm1V+BJ2Gi4JziMXgk6wQ6Xf4V/WcC6jlnseM1ogNb1AR1Tte07TpDVMW0TZBVPRflxUzcT6lETJoVQXX6LDCwxbpN2XkUatgfbjBlskjbIuqefIKej6C5S7VlWlnUJ3vy/NnojvguvqIWx4uSzz3XdvQ1/JSwIlc/ANEsXNgwLVbUfunaDpAudAObml8c/C5mx7/+ob5s1nAsie8aihZgaUu75C/YMIxo0W5KNFLgHIr3MFOdvmJlt3zTyEEsvOXt1xMeoto3OOt++ThhwRn5e4ZjJKwql2ibogvpc3Dc5hXaLdU/UyQSY/U/shDC2s8LF2yjfLLGCK0rhIUeUswp0Sn+BE4C0uhqiYO1sff8Ni0svqBHdw9q3XQeHVoC71xtWdG4NiY1300Bokj40weQ5Dccs8TjHmDbLCysXFLaLv3W1+NzDilF7K4Zidj8pRG4AycaqrPQ9lvlliEVvJy2wjExRmfVPutHRl6R0q7bdeU/ywPoSpXHugywM1iUNjL49UELiLW2mltgF0O3u0avYWqXDoHtxwbmv/U7oDl6uGCqzePU4gNikjlCDIVkIbRrwDLZnFNE0FManacoucmYLHtKnN2ruwxSliZeioWtCNnJMCLMxwjASldNVEaClD3eBWPoR2EDSYTiLyUuS 5ahn5lDVptvRV88ZLwmxaFluvPzVKx67gpr3gjPzGQ1cxfhA+ErbateaBZiejNKbjo+mjbhCekufvy8GMHuv9GIxQzeFO6sdJqMuzRZkYUWAPCYO+fxhTQl5j2rdCvzbL45tRTNuwnTqH20VEkPpPlYKpZNJdAI+cncBTc7AYZ7QCrkiyK9mgmyG698dhCtoUe8iEx8v3uVPyae7Qr8uYGRIjSpTjI0QFIgHUwDDb/dta5bh0jW4hHNY/QVZGUA8oaJQ7r6Y/2/cQB+arhgthT3rjUJbS+1A1x2KCn55A2BHC0NdN57FuUY1kokIMi5IzLA6EOrp/hPcx3jqte7lYqrrgjGl6pb0RjE49nXKfEM4D3vNu3tBoo0XURc0D2+1kHKukUvC4iDeSRMaY3IQZvacE3JWmPTuJJNBzl9sYoW5lTWFfattDwuJtkPgwfQp+dQ8AD6M8/KnPQPOGs6WvGP4VVNbCTNzt6O9rrHNI8oj9AbO3f8UzFZ0r4nuvDYhroUQA/+YJ8d2YF+Y6HTnw7CfmlBkk1Z6dqf0gm6KEtca+HOQ7+ardSUJkUaEVuPgns0aXI6ou8Ho7mnWYs2KvZG9Dx3cct0SyUNqJByGjjIAAamQo1yg3jJ/bRh/Q= Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p7-20020aa7d307000000b00560ebb44462si2278509edq.479.2024.02.11.16.03.46; Sun, 11 Feb 2024 16:03:46 -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; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=k0SkgjtJ; arc=fail (body hash mismatch); 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=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 49D8F68D1C4; Mon, 12 Feb 2024 02:02:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04olkn2073.outbound.protection.outlook.com [40.92.73.73]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 99BC668D178 for ; Mon, 12 Feb 2024 02:02:50 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZcNQqRs0WTHIAuuS8rcOEI9I4Agou9oxDoeQ5yDdPxDGNui4fTlNLCR7vXP/v6pFrWpBOZq7+YAK+XBUbvtBpOirOanEbaTmOltffxfcEnpOHlgxIiuS1Ma00dtxkcfNbZ1+ntknFo9ik7v2TztCsA5rkNA3cu54Fh8MDkFJCaQBL0WDKHqoP6PcRDdatQ+5K4uW0PWltCIBk2/2oYsLzoK0aHQsjD1u6gKExqhuWEZa+e8oLyq8dWvoqS7xK+EqTVXJmXR1iyBgCaaivlwbt+KdKVOtBKys0bN416j6vcy8pOaPe8CrXFrcRnKFcvIm3eql5Jq/6co1rXcudlahbw== 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=3DiGdtESLSonVLb4p23TRwPq08Z55vS46fkRbNtQ+D8=; b=nYeIYJSykfqcdYZQMQt983MmnexKWDHkUY/cS1tIdGgFDqs9iiC4kZEZUYgXPjVqpAUvxYXPnWJdSYhFV1Nuw9df3nAteQdDhBonXwgln11RGtK5WH7w7XN5/RijeJMBmXPOMcrrGhTgq1GmgWDiZfBqTZrwHHo9O22jamKMgL2NJuthDyk5lwzBcwtxDLMoBJrxiY9MCpKT1YOjFT3oqzRVSuQSQ0hOp/TuazxSWBEwoa30P3pk7L2msjAx0z1DUdUIvmdGv1UbJTLkXWH3Jn8rNyECAXdpWhPuP9OIZhq88zYmLFVg4eltlQpq7NBeM/bFRDeNKT9IHZPUHIMtzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3DiGdtESLSonVLb4p23TRwPq08Z55vS46fkRbNtQ+D8=; b=k0SkgjtJuJM58rv6qv0ohBneiuLtjn3b4VrcmW+rpNI3mTvpaGIGO/h/2rKG/V/tPKwdToG7ncf4Fes4TKV46BcQ/PNrl9onY+sdATMfMre2nT4ibQ5H6KkUx7glzbLeH6uZOAAI6uYiqHnx2uThHIdaIjeyltdkeDKP1Qh8vS83OyL3UgJ+JGb3vBSny9txlCKkBHaxpu7tJlUF+2sxasWjNdLpLikWcL9jm5vM083lq2E6j0s+SLRbVd0rdhDhrAwqGn/1LrkWVnOEHy1XF8S6xx1yCroefj9fW0p1BwQwQ2ok3Zvoc2wJt9y300jpj3SoqTHHZNzBp+xgDumHNA== Received: from DU0P250MB0747.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:3cb::16) by PR3P250MB0257.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.35; Mon, 12 Feb 2024 00:02:49 +0000 Received: from DU0P250MB0747.EURP250.PROD.OUTLOOK.COM ([fe80::db07:87f6:7c75:38cc]) by DU0P250MB0747.EURP250.PROD.OUTLOOK.COM ([fe80::db07:87f6:7c75:38cc%3]) with mapi id 15.20.7270.036; Mon, 12 Feb 2024 00:02:49 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 12 Feb 2024 01:03:27 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [oly+3DAYiqE9gHicNkqkRy+0d3eKfrN/tc/ojij2GDg=] X-ClientProxiedBy: FR3P281CA0146.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::18) To DU0P250MB0747.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:3cb::16) X-Microsoft-Original-Message-ID: <20240212000335.27984-14-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0P250MB0747:EE_|PR3P250MB0257:EE_ X-MS-Office365-Filtering-Correlation-Id: 52e1687f-f2fd-4144-fa43-08dc2b5df2ee X-MS-Exchange-SLBlob-MailProps: Cq7lScuPrnqwZHg0HfSFdl5Zlrnc8YAZMqDtUbVXlqasn6cfMx/BBt5oep8ZNiPVMHpY1yNbAfkVH9PMLikUi2QoeRpSSJKcuWRm8eJ+YL/zR6gP/xVfwPxXG76RowpMehaA+De6zC2QIMh+hPLrBmxTi8xx2pQvSNt3KthTQVSkTuDPY4/recNlCNWZaRz0javPc+MqJ+wwKW9PXhdLPE+5lY4BZWmI2qJ+eDO77n2tcKBxRJ0mrtwpLQfzrdFbEG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QENMGfOcdc5R5pJyO1z0fxMXkZH+Tb/wrbyRB1Sw8nK8jF+12n7+kxjcMxx0BhPRflPYUAFRLk7kbMjbtrFcKUJwoMtdP/rABSydS8AeTUdoZsxNg/nmiORORHhQdSzwm3gpCnltAQUrJQvdl03KX0F08S/vna4X5dAQLe5lBU69CZEVJtz6kQlGmcI69fHvFOy2UETbHV/Bs/pOl96mOuEmtTGI2pcfc9YeyKPHX8thQ8EigRS+sGoUkHdjir/UX6G62kiZupBFRJt3xONeM2IaJ/J3Y7JG0DxMdFAoKVfa1lGOAYymUQ44IrA3uM3qBGAdBr9k14iB1v1IPmwlqJ8su8s1eNSPDjulcXRSRnjONWd1031QwkKRGbVmz5i4PgvsILZLo6g8/CwFz9imjNQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52e1687f-f2fd-4144-fa43-08dc2b5df2ee X-MS-Exchange-CrossTenant-AuthSource: DU0P250MB0747.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 00:02:48.9255 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P250MB0257 Subject: [FFmpeg-devel] [PATCH 15/23] avutil/hwcontext_qsv: Allocate pub and priv frames hwctx together 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: l3VMb2/Mq0MD This is possible because the lifetime of both coincide. Besides reducing the number of allocations this also simplifies access to QSVFramesContext as one no longer has to go through AVHWFramesInternal. Signed-off-by: Andreas Rheinhardt --- libavutil/hwcontext_qsv.c | 46 +++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 99d974f25f..f524a663b1 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -85,6 +85,11 @@ typedef struct QSVDeviceContext { } QSVDeviceContext; typedef struct QSVFramesContext { + /** + * The public AVQSVFramesContext. See hwcontext_qsv.h for it. + */ + AVQSVFramesContext p; + mfxSession session_download; atomic_int session_download_init; mfxSession session_upload; @@ -329,7 +334,7 @@ static int qsv_device_init(AVHWDeviceContext *ctx) static void qsv_frames_uninit(AVHWFramesContext *ctx) { - QSVFramesContext *s = ctx->internal->priv; + QSVFramesContext *s = ctx->hwctx; if (s->session_download) { MFXVideoVPP_Close(s->session_download); @@ -367,8 +372,8 @@ static void qsv_pool_release_dummy(void *opaque, uint8_t *data) static AVBufferRef *qsv_pool_alloc(void *opaque, size_t size) { AVHWFramesContext *ctx = (AVHWFramesContext*)opaque; - QSVFramesContext *s = ctx->internal->priv; - AVQSVFramesContext *hwctx = ctx->hwctx; + QSVFramesContext *s = ctx->hwctx; + AVQSVFramesContext *hwctx = &s->p; if (s->nb_surfaces_used < hwctx->nb_surfaces) { s->nb_surfaces_used++; @@ -381,9 +386,9 @@ static AVBufferRef *qsv_pool_alloc(void *opaque, size_t size) static int qsv_init_child_ctx(AVHWFramesContext *ctx) { - AVQSVFramesContext *hwctx = ctx->hwctx; - QSVFramesContext *s = ctx->internal->priv; QSVDeviceContext *device_priv = ctx->device_ctx->hwctx; + QSVFramesContext *s = ctx->hwctx; + AVQSVFramesContext *hwctx = &s->p; AVBufferRef *child_device_ref = NULL; AVBufferRef *child_frames_ref = NULL; @@ -562,8 +567,8 @@ static int qsv_init_surface(AVHWFramesContext *ctx, mfxFrameSurface1 *surf) static int qsv_init_pool(AVHWFramesContext *ctx, uint32_t fourcc) { - QSVFramesContext *s = ctx->internal->priv; - AVQSVFramesContext *frames_hwctx = ctx->hwctx; + QSVFramesContext *s = ctx->hwctx; + AVQSVFramesContext *frames_hwctx = &s->p; int i, ret = 0; @@ -615,8 +620,8 @@ static mfxStatus frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, mfxFrameAllocResponse *resp) { AVHWFramesContext *ctx = pthis; - QSVFramesContext *s = ctx->internal->priv; - AVQSVFramesContext *hwctx = ctx->hwctx; + QSVFramesContext *s = ctx->hwctx; + AVQSVFramesContext *hwctx = &s->p; mfxFrameInfo *i = &req->Info; mfxFrameInfo *i1 = &hwctx->surfaces[0].Info; @@ -1133,7 +1138,7 @@ static int qsv_init_internal_session(AVHWFramesContext *ctx, void **loader = &hwctx->loader; #if QSV_HAVE_OPAQUE - QSVFramesContext *s = ctx->internal->priv; + QSVFramesContext *s = ctx->hwctx; opaque = !!(frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME); #endif @@ -1210,8 +1215,8 @@ fail: static int qsv_frames_init(AVHWFramesContext *ctx) { - QSVFramesContext *s = ctx->internal->priv; - AVQSVFramesContext *frames_hwctx = ctx->hwctx; + QSVFramesContext *s = ctx->hwctx; + AVQSVFramesContext *frames_hwctx = &s->p; int opaque = 0; @@ -1387,7 +1392,7 @@ static int qsv_frames_derive_from(AVHWFramesContext *dst_ctx, static int qsv_map_from(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src, int flags) { - QSVFramesContext *s = ctx->internal->priv; + QSVFramesContext *s = ctx->hwctx; mfxFrameSurface1 *surf = (mfxFrameSurface1*)src->data[3]; AVHWFramesContext *child_frames_ctx; const AVPixFmtDescriptor *desc; @@ -1490,7 +1495,7 @@ fail: static int qsv_transfer_data_child(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src) { - QSVFramesContext *s = ctx->internal->priv; + QSVFramesContext *s = ctx->hwctx; AVHWFramesContext *child_frames_ctx = (AVHWFramesContext*)s->child_frames_ref->data; int download = !!src->hw_frames_ctx; mfxFrameSurface1 *surf = (mfxFrameSurface1*)(download ? src->data[3] : dst->data[3]); @@ -1592,7 +1597,7 @@ static int map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface) static int qsv_internal_session_check_init(AVHWFramesContext *ctx, int upload) { - QSVFramesContext *s = ctx->internal->priv; + QSVFramesContext *s = ctx->hwctx; atomic_int *inited = upload ? &s->session_upload_init : &s->session_download_init; mfxSession *session = upload ? &s->session_upload : &s->session_download; int ret = 0; @@ -1619,7 +1624,7 @@ static int qsv_internal_session_check_init(AVHWFramesContext *ctx, int upload) static int qsv_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src) { - QSVFramesContext *s = ctx->internal->priv; + QSVFramesContext *s = ctx->hwctx; mfxFrameSurface1 out = {{ 0 }}; mfxFrameSurface1 *in = (mfxFrameSurface1*)src->data[3]; @@ -1702,7 +1707,7 @@ static int qsv_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src) { - QSVFramesContext *s = ctx->internal->priv; + QSVFramesContext *s = ctx->hwctx; mfxFrameSurface1 in = {{ 0 }}; mfxFrameSurface1 *out = (mfxFrameSurface1*)dst->data[3]; mfxFrameInfo tmp_info; @@ -1795,8 +1800,8 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, static int qsv_frames_derive_to(AVHWFramesContext *dst_ctx, AVHWFramesContext *src_ctx, int flags) { - QSVFramesContext *s = dst_ctx->internal->priv; - AVQSVFramesContext *dst_hwctx = dst_ctx->hwctx; + QSVFramesContext *s = dst_ctx->hwctx; + AVQSVFramesContext *dst_hwctx = &s->p; int i; if (src_ctx->initial_pool_size == 0) { @@ -2252,8 +2257,7 @@ const HWContextType ff_hwcontext_type_qsv = { .name = "QSV", .device_hwctx_size = sizeof(QSVDeviceContext), - .frames_hwctx_size = sizeof(AVQSVFramesContext), - .frames_priv_size = sizeof(QSVFramesContext), + .frames_hwctx_size = sizeof(QSVFramesContext), .device_create = qsv_device_create, .device_derive = qsv_device_derive,