Message ID | HE1PR0301MB2154CB477DFF70D9A0E00D908F5F9@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | 3e6dcf0b1aff77d742520261c83ebdaa68d0e5cd |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp2018011pxb; Thu, 29 Apr 2021 17:02:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk2VZaa2r8G1KjHCSpRydo7MVrRLVk+ttlUpRGyrL7na2B9789cUdoU61qkRlnXCIIIoql X-Received: by 2002:a05:6402:c1:: with SMTP id i1mr2487373edu.315.1619740957776; Thu, 29 Apr 2021 17:02:37 -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 q9si1459316ejy.299.2021.04.29.17.02.32; Thu, 29 Apr 2021 17:02:37 -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=l6QVmZvO; 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 C2EEC68A437; Fri, 30 Apr 2021 02:59:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR06-DB8-obe.outbound.protection.outlook.com (mail-db8eur06olkn2059.outbound.protection.outlook.com [40.92.51.59]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE15D68A3BE for <ffmpeg-devel@ffmpeg.org>; Fri, 30 Apr 2021 02:59:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MjfnTOrszIG94p23hBhH7Otw57ZH2GHVFUMuDOvRM9ex1cx9jFYwlDQihCSZzhEPhVg0gxkcxL1pSFrz595Dm9qsxus4dM5uzyTxm1F2PROPcIPartOenGf3EhTQ3fGyu+zq3dLJYcdnmI5AUadNFp9ADhGeeeqTmasilBAgTOvONrGLEtYZXwe4DF4ntubAnRlBKM8LdrBrLirmhHD+d5stDW9bh5LRDbf2OB4c8o1xZFi2YP58fTlUEb6bjPOR4Xr6zBMGlG8NthtzbqCdF4GkE6S1OPNL+OQow9sHOLwa4/3YNjZoyqwS3nhGVnR24GqtpQ2fJuuU5RLh7SXiQw== 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=mHUYtTHbLQFDjTKyfjggu7bgEsYMAiZRzXc0LM/4uzY=; b=I/wrEewKSSHjmzh03BQ7tYXqIsCNdnRvI8wbN3H+Zkd9Iedpq4uNWfweNVw9tXlCcMIdG8rtJ/x9UA7tTer0v+JDVvUT84UjphPTiuFMfbpwHiMhg6PPjjxFCeKx5wt+vPN5r1O8HIuFk0d2i/ZJsnqeSQJF9qJ4Yvr9oXa/8z0wRSbG5jGYTawOWQFUAwQD2a7tuIMWWWewomZjoUg2Bmg9Y5Z0UyO3n7ZxHa9eajBTLIkuTibtcYQ4sR3caOsm3c84n3h8owEinXVKGKZ/HbxsGtKde51wk68gP3ZbeufebMB3zC+5RGSqiNwP1r6tleauldt3uh9OGtlerLe1Lw== 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=mHUYtTHbLQFDjTKyfjggu7bgEsYMAiZRzXc0LM/4uzY=; b=l6QVmZvOtd0Pelvh/sM+Ix/v+ohFLFtb819xFA7yDyMF5Nq514byTAY6+Cb4Dwxu7O671zx9a13QLxK4VRfucFp47bky+2p4Qx5MxFDVJsu1ZyWDvW+/U0eaj9C3ELjhFkC0TvExLNuXA/O+u1/CJRHEVtyhVpXOcFHk7cwcAqdD/MKLrvq1aNSf+cDWxEQm2fOsxnXWZiEpwEAW9NvGCIR4CGl1PkSmysvjv014YXjWJpNqm3n4mqCV5yOEGupm0qNoD5H5dJF6htiIEO8teG0QVrWhIE0oDsCsOfI+8ZOtjlflmQr2260wshQuNbcWps4KknJufWJQsrU9/+1/aw== Received: from AM7EUR06FT055.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::41) by AM7EUR06HT098.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::130) 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:33 +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:33 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:64FF5D788DC1519EADF74F06A83EDB6FB33552C1F9F25DAAB5B5D091793C731B; UpperCasedChecksum:3F55572FD6ABAAB1781FE205A8BC363D1E7E5AE2C276865F528F9B08565792BA; SizeAsReceived:7616; 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:33 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Apr 2021 01:56:59 +0200 Message-ID: <HE1PR0301MB2154CB477DFF70D9A0E00D908F5F9@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: [3p4rJNS4aOHZ7yWeoqdU+renfKntNAc2] 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-27-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:32 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 43744281-eed3-45f0-57b9-08d90b6ad603 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQnJqnaHo6w7XTEhYoMxTOU9yELH1qRlIbwB2HmR2GBCRzf6G1lf1PxXN23Tiif3Ane4vfzSTA8uHSA5VQRD6quamzceN4ML2CVXajS+i1ab01U08Cal5Z3raeD0DLkglzlSSFJ8z7QfDpajvSvx/pUohbGCjP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7QFA== X-MS-Exchange-AntiSpam-MessageData: P/9ewQdc/Xmzfx84QOutOjyEAppEQlootONVPdSSNB50VYPBFD8EpMeT/1lbEm3MFPrnjGUtyvhF3qbU2TflYQ6k7ZXHl5VZv2RarmmIKk5ycEGIV0oIEM3T2hSP9S4OOHR+wYA+tKZH1GenbNIjsw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43744281-eed3-45f0-57b9-08d90b6ad603 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 23:59:33.6747 (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: AM7EUR06HT098 Subject: [FFmpeg-devel] [PATCH 28/46] avcodec/pcm-dvdenc: 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: eJDZ9mVEeBy3 |
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/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c index e644f30f5d..ae7de65f1d 100644 --- a/libavcodec/pcm-dvdenc.c +++ b/libavcodec/pcm-dvdenc.c @@ -21,6 +21,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "encode.h" #include "internal.h" typedef struct PCMDVDContext { @@ -119,7 +120,7 @@ static int pcm_dvd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, PutByteContext pb; int ret; - if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0) + if ((ret = ff_get_encode_buffer(avctx, avpkt, pkt_size, 0)) < 0) return ret; memcpy(avpkt->data, s->header, 3); @@ -163,7 +164,6 @@ static int pcm_dvd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } avpkt->pts = frame->pts; - avpkt->size = pkt_size; avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); *got_packet_ptr = 1; @@ -175,10 +175,10 @@ const AVCodec ff_pcm_dvd_encoder = { .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for DVD media"), .type = AVMEDIA_TYPE_AUDIO, .id = AV_CODEC_ID_PCM_DVD, + .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(PCMDVDContext), .init = pcm_dvd_encode_init, .encode2 = pcm_dvd_encode_frame, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, .supported_samplerates = (const int[]) { 48000, 96000, 0}, .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO,
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/pcm-dvdenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)