Message ID | HE1PR0301MB21547184BB3C14504681F67C8F5E9@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | 4fda451c9f2dda4ced8cff92cd7c5387550dad83 |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp2020168pxb; Thu, 29 Apr 2021 17:05:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrW081jpLxQENZmXnp9dvWLOi7NPvpMXs9+5HpXONfJJ5gbBNHetFuTfuIE9OefgwVPPHc X-Received: by 2002:a17:906:d9c3:: with SMTP id qk3mr1116905ejb.376.1619741104808; Thu, 29 Apr 2021 17:05:04 -0700 (PDT) Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r12si99383edp.101.2021.04.29.17.04.58; Thu, 29 Apr 2021 17:05:04 -0700 (PDT) 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="X/PRjUDj"; 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 EA35168A52D; Fri, 30 Apr 2021 03:00:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR06-VI1-obe.outbound.protection.outlook.com (mail-vi1eur06olkn2053.outbound.protection.outlook.com [40.92.17.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 24BF868A51F for <ffmpeg-devel@ffmpeg.org>; Fri, 30 Apr 2021 03:00:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mBjvdMg7J1qkjro/yJ1bjz5wSy3WtbSftMg/ZJXwBi/NbH4cGr2DOlJQ1z3aeTR84GSeSFLv2ns4RwH/51S8eEN7O+MbVCnLbua/MwsWA9DI4LFk5zp3pMomVp8eP7B65tdiMzBY5ua9W4aFEz51R24B1qKJSAK1sOerFy2PI0L45u8+AzZu5ZqZ5oK86XAcT00Kab6BvW2MBtQUcwoMKwG0uyXEMy7xokCPRKEGU2prjZL+yIYkHG2XcwijVB9WfmHTWWOhV6P+1/fAWZ7S8ydeV2LaK8cJEOR3hC+viLaK2DZrN6TTNMySaXalesv2GrvjLlNtZwNdEP873vTopA== 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-SenderADCheck; bh=9m2OFE23hLMRap1vsAcDQOmNW9EZEDlpD06UYwhZ/bI=; b=VxOEZS42mU2WQGHoJSYTnfIAGAEg/BBgXYL3pJeYo4rCsnDL91clbIMfM6hSDehS9eQ8qldVxrIytUOP0GCDinM64R9bCr3F5DdTLv0bzn9y/n7PDLaoIJi/edpiCBw5v5hve+5C4B158IrPru6kr4mCD7yUYApBlGa14PXlDzS1yxU9KaTAaSkDfqB4Vdmoe2EW4C5/EGsYiREY6sEtHnUMr9vFdTZaG3dFtTzZVq/ONQ9GGLdzmX490p4e/0mwx7LZPFxaY22lqi5geQjhOVsQZ+M3D6O90gTWK+k1XMyTQIHf1v+dXjsyNJaL7A/s2Q9w8WpHa9wNh2tbifuqnQ== 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=9m2OFE23hLMRap1vsAcDQOmNW9EZEDlpD06UYwhZ/bI=; b=X/PRjUDjWg/+b+8ZyML7eHpdMImWwHkE6PUaZQU36W9RPoP9Z2XGdkpoOYkhyJv5b4jYO/+gQe1GCus8O8iR5qDcvf/0NSmSuHU03Oe5f7qOKp94eg16ymRR9M/rzA0S9Gb+9rQU6hqsmZiPGFRruKfglkB/5JW4xSnYnYr50ChtJz8pbVvYER9ghup0KiGGSQ+ONU3jB2YV2+beiDXoD6w/thAPpx/dAmGL5QOu9CtXvIIaE5VhTPARwI8WTWetoyH6f6/DlM6efSoCPAyIeh/9OyBcOkSRIKrPNbVJVItWPhc9XJulqqpOufOaOvi6Tqb5vHYPa1JH4GCNrU6N6w== Received: from AM7EUR06FT057.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::52) by AM7EUR06HT011.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::375) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27; Fri, 30 Apr 2021 00:00:17 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:fc36::4f) by AM7EUR06FT057.mail.protection.outlook.com (2a01:111:e400:fc36::445) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Fri, 30 Apr 2021 00:00:17 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:892C22A214F439E3B0B61A7A13389EFAF40E313C820BE4C2C6D5A0C544050E25; UpperCasedChecksum:FAB765A682E4BD947265822A4FA2A9E9EA86DB902C52B6354B5D419EF98CF959; SizeAsReceived:7776; Count:50 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::45bb:c44f:2b75:23b7]) by HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::45bb:c44f:2b75:23b7%5]) with mapi id 15.20.4065.027; Fri, 30 Apr 2021 00:00:17 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Apr 2021 01:57:17 +0200 Message-ID: <HE1PR0301MB21547184BB3C14504681F67C8F5E9@HE1PR0301MB2154.eurprd03.prod.outlook.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <HE1PR0301MB2154FA2BF76462B67F0D851C8F5F9@HE1PR0301MB2154.eurprd03.prod.outlook.com> References: <HE1PR0301MB2154FA2BF76462B67F0D851C8F5F9@HE1PR0301MB2154.eurprd03.prod.outlook.com> X-TMN: [ncdyIWG79acNZlLLifLpt7ZkGrdlqiyj] X-ClientProxiedBy: ZR0P278CA0088.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:22::21) To HE1PR0301MB2154.eurprd03.prod.outlook.com (2603:10a6:3:2a::22) X-Microsoft-Original-Message-ID: <20210429235717.2067041-45-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.248.86) by ZR0P278CA0088.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:22::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Fri, 30 Apr 2021 00:00:16 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 0af4d595-d5cf-4ad5-9351-08d90b6aefd5 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNU6XUx7q8EQ5McclV510mdNSQ6zVwN/I7HfPahThcrjVxcGkGHRB7Vptrh81pajQRIBDJRuzYt2mjkCIx3YfP/iQz4LHLviJ3j0xCQYRy9sIXpdRBUwSDi2BhLqgdBuskSzIgL9uaDBvYg05lRTorDW7I5B6dml4qGFh3R8/EA0528mj6P/M2BkgJDBvXOs4NCJtmSgt4UzTWSioXxrI3bXrk2WpI0xRxPPFtU64/vS7GwU7MpHo6ShukmRS5kuGo3vqof6jx+Lg4wWqcqcC8x/U9d8T/rNWQYW7whmvhfIKPMyg1R4MdMOwczQ90wP1eOhoLOWyN/Zwq27u6EvgJnpLja3zruI4Ev/D0AsLDOT9vxq3ER1CIqowzY9J0UVso0HGjTkjnNLrnbULk842kZ7Y3ilHXoOJRSbruXGOTDnp5AuIMPQnyo7cUIGT5npt8jivXahp0Ma5cSzXu/s5l/y44KBLOzw3drBL1XMWVppSj1pMXB9oC5cXmwPf5UjH6OIUhrsYage1+uu/cp4q+2xTr4yFhgQxpxOl0ilaks0ytVP1cBffSHZezetMSKCOHPkKRXdUap7jt2vN8nBAuKkE3Ks4GUxO2kq4ncLUpwyrsxO2nFCjqGO5apjAUVs0vr5FzGo3q/lYOipsbj7thItWZq2x+ATqehNzODUo4z2fpP/HyW8SHiFATOzat+jF9tZaYOWx+8X7tth1iNCY8Bc96jFQy5B9UE= X-MS-TrafficTypeDiagnostic: AM7EUR06HT011: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nPP1EM2k9bJqjCwdmEloQx3m4tXPT1Q1q6+eNxNiCsrYWPKZ6fbTRqs0WriK7flsBUVvvld574giipvlan3Bnq4xvbKsUrptEs9O473ZMtHV6ccaFqmBYfjXJFcm8WlKx+adj0OXndAE4FFfARnsWjn7gH3pVQP+bCKZ//ehIH79D1/IGM4unQIwx66KeHoco7JKQ2gOh9N+4/90PZ6QGmYKLt0Q84i1E5SNwjg/Tm5b9k7pia0O3EI0y9SnyFcxwLiQzrTxX6Mis2RxU9uYNCn+UiR6EqIzu35g+1zFzJhXzCh9znWWo2bNJd80pr0w4V+KaHC9jjJK6whMtlCCWGX4/5sOQQie4gZuE17HSENpDxT8sBIBU61GWr0VTet/XP8P5lyb1PPfWbFTnsFN0A== X-MS-Exchange-AntiSpam-MessageData: zx/+qNZKL7gvf5NSeJQn5R0ceoQG3em3O9xP7byPREIkEJlp1Xd/12bZGzviWLlTPgmmFGkD/CdLS6U5zCBeQ/rKI6tvPkawEXtTmy6DlZmLaUCa9zIRAudP0vTO/66oHiZhGJz/wzc+p6znWoccoQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0af4d595-d5cf-4ad5-9351-08d90b6aefd5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2021 00:00:16.9715 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT057.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7EUR06HT011 Subject: [FFmpeg-devel] [PATCH 46/46] avcodec/zmbvenc: Avoid copying packet data, allow user-supplied buffers X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> X-TUID: kkxf56M4AeP6 |
Series |
[FFmpeg-devel,01/46] avcodec/a64multienc: Avoid intermediate buffer
|
expand
|
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | success | Make fate finished |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | success | Make fate finished |
diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index 68618f77e9..531559e264 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -30,6 +30,7 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "encode.h" #include "internal.h" #include <zlib.h> @@ -275,7 +276,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, } pkt_size = c->zstream.total_out + 1 + 6*keyframe; - if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size, 0)) < 0) + if ((ret = ff_get_encode_buffer(avctx, pkt, pkt_size, 0)) < 0) return ret; buf = pkt->data; @@ -427,6 +428,7 @@ const AVCodec ff_zmbv_encoder = { .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_ZMBV, + .capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(ZmbvEncContext), .init = encode_init, .encode2 = encode_frame,
Here the packet size is known before allocating the packet because the encoder itself works with an internal buffer, so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; one can also switch to ff_get_encode_buffer() and directly use user-supplied buffers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/zmbvenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)