Message ID | HE1PR0301MB215476C162398A0DB36A20008F5F9@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | ef6232aa38d2f1054f3c46ffe83cbfcbd7ce042c |
Headers | show
Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:49c5:0:0:0:0:0 with SMTP id w188csp1912277yba; Thu, 29 Apr 2021 17:14:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKUa2LsKQc288qB9yFfeeCUTB99aer8fp+dMXZoEo9crSd2ojDU9olRJ007Rk2xB8z7Fm7 X-Received: by 2002:aa7:cf86:: with SMTP id z6mr2635330edx.120.1619741679765; Thu, 29 Apr 2021 17:14:39 -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 d12si1714638ejj.422.2021.04.29.17.14.39; Thu, 29 Apr 2021 17:14:39 -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=PDQXRrsz; 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 4DDF068A375; Fri, 30 Apr 2021 03:14:36 +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-vi1eur06olkn2010.outbound.protection.outlook.com [40.92.17.10]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0D486891CF for <ffmpeg-devel@ffmpeg.org>; Fri, 30 Apr 2021 03:14:28 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GeTBklG4wgjjXSjQhNGu6Pe6IZKULP3HHonEAaLKfWe1Bbivk5pAsVHcjxxbkqxz13b9w1QstfE0gP0zf2SAsAhGxnlEhWUOnflt9z46EaZzjNDfRVL7fkYmVMu101CPfOZD+rtxmt1dmJn+bNurAzZfCu8UU0G+0a/7iWxNia2JJs6LnjaxwK+dEtADnFk8cLubPHLMeB38xqrsvhEXuD4YxuBm7xXPDNrgDoVHm+Hy3tqBy7zydDtOZue6/34X+AhRA6SgC5K7arnZ0o7AKVRSCdcQ155hgucKir3iIzvSg4ZNnH5JC78AWF4ltHu0tF0xiIzUHCF1g/gBofDjEw== 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=71W9vra3B4q86GznY/2BRecpRPtYaV2Knm3AVCEnO4E=; b=IyNTz8NYxaxIeQkOK4/B6h05q8EXAEFwPWZPQkqh0cCiJyHEM8Jo9p9x93dDhPjFdDWPpuPmeW67CnmbkKoaTF422kxuvh25ETJEYMPH8UvL0dmpJbWkKtjA4LVooRIyL6y8JaemOqsuClbog7qQjgFwAfkBCtw6PYYeza3E+lJyFAUZM2q0vGXD2bhDjcqicg3kAdatemH6WZ5Kxqy39F/9ldKgJ0dJf2LmaESNaVxjVHTDeT+cZt4M8HYI6n65rNtZ/Q8aIZnPpJcyW/6IFblL12Zm0HMHCzHCmAbeEqy/F3lV6BKG8uyqrucQpJyHDRB17KIinmJ3a0aXg98etA== 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=71W9vra3B4q86GznY/2BRecpRPtYaV2Knm3AVCEnO4E=; b=PDQXRrszWaS5moZXBaXclXM8gXEkBcPGFIxXPX3suziL7eI3nMcRYNNUThPPXP9Jck88qUuLo5VV9dyuEq3k7iyPVaJE1Mk1vYPInOugwjitx7orkOCfn0fObDIMsXtapKctuhRGD4PnqzbISfTKfZVWGRhFjlEa2gkR+FLN4dbk3IaTT23PlLJxs3viye2qn7UEYSWBhlSyVhmIW8hkiBpbgyA/uw92Ltih34TyV0f/KAAHczNseSoCneUa1EbdRmAFhpOMJZU9aRXA8PIQBISz6hoDmKsAEjYFGP2YuWN8aY0xSpNjl2q4nNcC/zbfwyCcOMUzR5f478dDHFYL1Q== Received: from AM7EUR06FT055.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::40) by AM7EUR06HT040.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27; Thu, 29 Apr 2021 23:59:32 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:fc36::49) by AM7EUR06FT055.mail.protection.outlook.com (2a01:111:e400:fc36::61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Thu, 29 Apr 2021 23:59:32 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:3ABA531351DF62DF17928F0AB4ECCB72D46A6F8215CBCB1F222B5C4CC6BAE44C; UpperCasedChecksum:42A4862D4E9DB1C2657878A39FAD084B60A331BC8518DB16DF60AF05B72DB359; SizeAsReceived:7618; Count:48 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; Thu, 29 Apr 2021 23:59:32 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Apr 2021 01:56:58 +0200 Message-ID: <HE1PR0301MB215476C162398A0DB36A20008F5F9@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: [g30ydo/OkjJ/XQx+yhHPsZk3tYSzd4CI] 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-26-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; Thu, 29 Apr 2021 23:59:31 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 66742bbd-4cfb-4d1f-ef49-08d90b6ad51f X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQnJqnaHo6w7XTEhYoMxTOUtcA6bzJ0rs7JsUC/xI7faNOwIpqM5hIS/7dGyVs9l2/taPZOOc3ZhMGuNw3lojFrt3RF9IeG6tO+Kd5VrG8mfH/erQ0eDbcmjHDi/Zp8WHmx9isEVMpZUwtuMuCnMaSr5W+CVIWw7EJbyCDEiSx2rw/+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MS-Exchange-AntiSpam-MessageData: n+K6gdle0wgnh532oK7NLcuOHpEurZJ10iV/Y4aeol/n8bZMvWxzsw+5gQ7sBPx4n50RPfzee9ex4MJaxU70ax5pztBR/IPDxV+akRJDbPnx/87MD5Oa0r47xDFbxpWfQTVuPHGNwXPRiRJuV4KsZw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66742bbd-4cfb-4d1f-ef49-08d90b6ad51f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 23:59:32.1573 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT055.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: AM7EUR06HT040 Subject: [FFmpeg-devel] [PATCH 27/46] avcodec/nellymoserenc: 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: PIXeD5jc+NIT Content-Length: 2089 |
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/nellymoserenc.c b/libavcodec/nellymoserenc.c index 2e13e6af08..41d9117065 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -42,6 +42,7 @@ #include "audio_frame_queue.h" #include "avcodec.h" +#include "encode.h" #include "fft.h" #include "internal.h" #include "nellymoser.h" @@ -405,7 +406,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, s->last_frame = 1; } - if ((ret = ff_alloc_packet2(avctx, avpkt, NELLY_BLOCK_LEN, 0)) < 0) + if ((ret = ff_get_encode_buffer(avctx, avpkt, NELLY_BLOCK_LEN, 0)) < 0) return ret; encode_block(s, avpkt->data, avpkt->size); @@ -422,11 +423,12 @@ const AVCodec ff_nellymoser_encoder = { .long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"), .type = AVMEDIA_TYPE_AUDIO, .id = AV_CODEC_ID_NELLYMOSER, + .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(NellyMoserEncodeContext), .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/nellymoserenc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)