Message ID | HE1PR0301MB21540AA28743B6B3AE07175D8F5F9@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp2016148pxb; Thu, 29 Apr 2021 17:00:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykFpFRq2Px+zTW25pbzuIbP4JuQjDxgdXH9g75uFlpIf/K5F8XIHH+fzhyQYaJm8ISMXaH X-Received: by 2002:a05:6402:2216:: with SMTP id cq22mr2590878edb.265.1619740831620; Thu, 29 Apr 2021 17:00:31 -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 pk10si1433164ejb.359.2021.04.29.17.00.31; Thu, 29 Apr 2021 17:00:31 -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=qEGXHWSj; 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 CA6FC68A336; Fri, 30 Apr 2021 02:59:20 +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-vi1eur06olkn2033.outbound.protection.outlook.com [40.92.17.33]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1605568A2F6 for <ffmpeg-devel@ffmpeg.org>; Fri, 30 Apr 2021 02:59:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5ceq7DndGHjDuzH7xOHwkMBBB6bSntBL8JzFQtXmry3IDIbHaMuioGx5obZznVy33wJl0DnCLKGo1waUy3tZSgezY8et6dnyYEn4xzja/CXmxPAAXbXy5kBsNhbsrdgnlSSMC6Ds8+l2qVJjoS7pYfBoRdHi2chW0ac9VQKf2OQ/Eu+8ut/PemKl2WkLTWCqGIx/uUPT9cLgYBQxZHxqdHiuFoubM0ECoyLVFoXlVjzQL47HAWhufUEajnWN8HMNl702Cs8qweSuWs1pYG48K0PxIW2/S0rXKVHNCE1GcWWlr4bJFByVykXWA0CklQFViHcEiOlCQu0e4Qexb6Jcg== 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=TAMo6BWGBHFVyKrrh7siCeA1QvJo56AGBLw50MRRt/c=; b=iLGuV9lkXuZlCmPiu/O3UIeWQzOMiMytv3IF/CnoVnFvmA/gQsysYCehIZNdnIqLLnc4RUL0HT3I4Rr8oth1Y/Bvwd0xhQQxyb9KU4XEVwhSunAryY08JyCIhY6yrLctsgXFM2n11NAwG1qhl1jQXUIqIW4B40voUxJ9+gRNmrDae154EuAc4DOU+aG8fqMmRK5EBr/s5KDgp4bpB64vh+Pfsr7ay16aivkcwGnMQeb74S9KXOUe7sAdJ6tgpFBlr+fxPi8MCPvclaDN+GdTkFsYLBD4ZCvH9E3A5tWj6A44FSlMybN4FmYsMWYUo+hPeSDcsU+z051T/XNANVnhnw== 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=TAMo6BWGBHFVyKrrh7siCeA1QvJo56AGBLw50MRRt/c=; b=qEGXHWSjNFXH/1vjjSvI8wNGBS42ia2SgPc7w8o+w9BQoHw6zpKNjhjBGsH+t14xVmol69NAYfBHwSU302wlbEcmRueqcacc+d4hapJT/Qbn9WHCwyqs8whpqimF8yAZWJoGe3H5UGQsjER2RO9CGXGq6TUqaPUtvDjj97y0ax7wIVee9u1t8c93uIU3J3WxJIHFCx9tq6B0PDN/HsWZhhjc8ClsvkBB6bQoQd/YNTClYr2TD8kljZxjQIlLdYB54FT7Is0upUZstL+P9EY971sjuWZewUSdwVxV3czXOICFPzsiy+zNJOL+qH7VbxO7su39/q7uWjc8Y9uVXoTRFA== Received: from AM7EUR06FT005.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::53) by AM7EUR06HT141.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::120) 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:17 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:fc36::4c) by AM7EUR06FT005.mail.protection.outlook.com (2a01:111:e400:fc36::397) 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:17 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:5600F707E3BFAADD19FC5E5D8558888D6D4730BB617B20F9A26B57583CBA3EEC; UpperCasedChecksum:06A4F69DBCE7A5858EDDB05A4A691AA94D9FEFA707AA89BE9D095D50706D88C8; SizeAsReceived:7613; 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:17 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Apr 2021 01:56:50 +0200 Message-ID: <HE1PR0301MB21540AA28743B6B3AE07175D8F5F9@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: [L0qvDzLe3iODkgKae16hYo+i80zLFr33] 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-18-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:16 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 6c69afa5-2197-48e1-62f2-08d90b6acc1b X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQnJqnaHo6w7XTEhYoMxTOUqqC1aAam4bzntlwSzJ+E2NJMR6q+pEDMHtaAnWskKt5ZEiwKxpjI8b/rcjtSSq01wZS7HqoQLhgwVlKJIXfpSk0PRkMmYu3DiMSrFekfE1Oyf33WxKhg/0Y76qr6J7v99Wg6NxCNisVfeV1wBZFEHBL8jEVtAmAndZ/LgNaOivwJoGdzghrnW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3adUel0ucJY+WMmSD8mX1z2JxqCEacYQ+ZGiYYYy5EAJIG0NXB+jGQI8UkZ1Dkg8dsc7l2ZUWFLFZVM99VQjKG4IEer1OwemnBzPbGLe/Kk6HosmgrpVSMJhQ3hIkjOZwNxPgG6tzMXu0Q5l2A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c69afa5-2197-48e1-62f2-08d90b6acc1b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 23:59:17.0500 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT005.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: AM7EUR06HT141 Subject: [FFmpeg-devel] [PATCH 19/46] avcodec/g722enc: 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: ZiMVPHXXtDrC |
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/g722enc.c b/libavcodec/g722enc.c index 24880f9550..fadadd5cdf 100644 --- a/libavcodec/g722enc.c +++ b/libavcodec/g722enc.c @@ -29,6 +29,7 @@ #include "libavutil/avassert.h" #include "avcodec.h" +#include "encode.h" #include "internal.h" #include "g722.h" #include "libavutil/common.h" @@ -346,7 +347,7 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, int nb_samples, out_size, ret; out_size = (frame->nb_samples + 1) / 2; - if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, 0)) < 0) + if ((ret = ff_get_encode_buffer(avctx, avpkt, out_size, 0)) < 0) return ret; nb_samples = frame->nb_samples - (frame->nb_samples & 1); @@ -373,11 +374,11 @@ const AVCodec ff_adpcm_g722_encoder = { .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), .type = AVMEDIA_TYPE_AUDIO, .id = AV_CODEC_ID_ADPCM_G722, + .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(G722Context), .init = g722_encode_init, .close = g722_encode_close, .encode2 = g722_encode_frame, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, .caps_internal = 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/g722enc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)