Message ID | HE1PR0301MB2154CF0AE1B43FC29EED12538F439@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Superseded |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp3459901iob; Sun, 25 Apr 2021 15:39:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoGgRp+nwbH/M+nljk+Ndw1ExABtmTuohm6V3/lfOMU2hvMMzctsj//y0yc5noW++Bilbv X-Received: by 2002:a17:906:c83b:: with SMTP id dd27mr9542595ejb.477.1619390397065; Sun, 25 Apr 2021 15:39:57 -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 t1si11556208eju.712.2021.04.25.15.39.56; Sun, 25 Apr 2021 15:39:57 -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=UIGtfQK1; 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 42EB568A009; Mon, 26 Apr 2021 01:36:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-oln040092065084.outbound.protection.outlook.com [40.92.65.84]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3C46E689E9A for <ffmpeg-devel@ffmpeg.org>; Mon, 26 Apr 2021 01:36:23 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AyefZpNxOpz4aHnuPhfkubsaOOC6UnHsgfZtjf1FvENt7nzISM4b8XGrJa3GIK5Zx/ElWdGK96ye4IEgetuf1RWcwDFRTYW9YrqP6Jy9eBpPc7ZsVPlE/LKtXOxKXo92o4GAPAWGtG8JggNASVU9IZF3/O84GD1X1sEJU3IAkZK9acKcYOu99DGwStYqcnYc753wTY0xqC/ySGSPsmiDEfPd04tnZgM9zXKDtlv3Zd6wqtAo2RZgVPITxTERvp0Cqj9ekJBvZOON3fof564gcpco11y7yUU89oWqQ45KQ+w5S+I9L0rIY0tWV6GGqtURPSTyeLKmcLLsXpxAJWWysQ== 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=9HIo2kuQMUY9lCXJLKdp6R3kCjuNlUBr7hM7mUCT7cc=; b=WSmTNKCtNm8kAlQPcBrHFks4NmzUecfzGNhRpupGUWAIH3dm+IldoPQ7XOz2Et4xK8z0rI1QlIkhhS//z95qn1fnkNymReeEoLxDod5cP0vWJRUTZoPeHapY7mMO0oKVoha63L57OWs0c0bVV32RFxR4235LXPLijblUmmJ6/Oj/zyQQ4ah4GAwBePM/QCOrYSUTis88GGK1gmzBvu6KSva2/DauurYbxIk4aowXsLD6YO9F7Zo63S4jeDzwuHGU6J8QK+QH+gynR1RIQoMjWrnsr6vNu04+wBXqRWA0GrUooIp4FnLdNu0M9cKtM+Pb7XYhPZj/ulTtCwcSbw8BJA== 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=9HIo2kuQMUY9lCXJLKdp6R3kCjuNlUBr7hM7mUCT7cc=; b=UIGtfQK1GAhh6/EVKnHgyb1urDnAO+H/KNNSuVSNEOvjJ9HI+vDI0xu3acjHta8pclFjYUu3hD2WXLKctg8l1Gf+TOUMFzfYviJO2McEvDnC74u+Cd8AdnICoSBxOvGMLFN8GPsQY1Deys9vVtTHOCHXOfS7NZDZgpIVhvC827lLSic0aEjs9VsEZZB2l/qnntaNuHgWCdlV+Vs51duswlt71YSk8j/c2oos/BAU44g3yXQxRY7pAmwG25ZKct3T5mTYERRlxwMxyFsKiRGb6SsV0emTbXa2nXI9ZwTdwPCSrSUUQIX91YbgnaJ4937M9nGkJi2wtsTETEO1S4qdSw== Received: from HE1EUR01FT054.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::47) by HE1EUR01HT059.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::333) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Sun, 25 Apr 2021 22:36:22 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:7e18::4b) by HE1EUR01FT054.mail.protection.outlook.com (2a01:111:e400:7e18::317) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Sun, 25 Apr 2021 22:36:22 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:1357BA351DB923D20CB25B191E2840F62697F121B9B7217B0A63EA809F2229AD; UpperCasedChecksum:894A87656A8173506C0A56A86101055B0C71F77D3A0BB324D77CBF47AD7ACD23; SizeAsReceived:7748; 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.026; Sun, 25 Apr 2021 22:36:22 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Apr 2021 00:34:47 +0200 Message-ID: <HE1PR0301MB2154CF0AE1B43FC29EED12538F439@HE1PR0301MB2154.eurprd03.prod.outlook.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <HE1PR0301MB2154D98403AA87DB5AA09D088F439@HE1PR0301MB2154.eurprd03.prod.outlook.com> References: <HE1PR0301MB2154D98403AA87DB5AA09D088F439@HE1PR0301MB2154.eurprd03.prod.outlook.com> X-TMN: [sgKO77QILEUntpBIkiM3Ai9Qlxc3DdeF] X-ClientProxiedBy: ZR0P278CA0100.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::15) To HE1PR0301MB2154.eurprd03.prod.outlook.com (2603:10a6:3:2a::22) X-Microsoft-Original-Message-ID: <20210425223448.130684-32-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.248.86) by ZR0P278CA0100.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.22 via Frontend Transport; Sun, 25 Apr 2021 22:36:21 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 2f54958e-e7e6-48b1-2520-08d9083a8d5b X-MS-Exchange-SLBlob-MailProps: dEG5jEBie8lxmSIYGjeOxtpX/NMoEuKPm4TpTgpXwh5X7m23nzwkc5c8ECZsPy0/uJORgcPRudGGxfROeG8dtcLZYZ9OY4HxHtTKid3QQyNfnIKoXmH2NPZLh+bV2kLhMIlv0gjCqxaBD/CDOchAOP+y122lcHXiV9bFLlQCuIq/E4YjdTK05LAAZ5lvUoJl/oh2XPDSP/MHbbcsULdd4gZFdBBHtoBRK5w23WY5U0eL/bWpeBg2ysTxzrddO84llavw5Kf1D6bQUDLmqX2cqZ1Vy5vEAyMYbmKYKdwXWrgV4VTqR3g/7j5OLsHlyWGeG9ZAvny7HQUDQB8wczm6wUPjzRFSQWNr26+5Y4fLwNcbIsY1FY/MIAESY0NHYQAz1JYhvxhrGUNR2rvI2bNAjlc4/y7FHvNFG64fvnJovuKtJdLi4PmIYqChN9VQwXRcgMhRUqbKRrGaiw6NIy29VERZn+fG674P+4CjyIVYzIGK+AbIoyUfg3RI8SKq1lhuUhBAd7a7Kw4sdcd/j8Mdu2VL3X2VaPAUMx85roj2FlxP3ITE1OFNUiAIoWOQNjnn+zZGp6byYh0n4pcH4vwz8zqV3JO83Zb92ohc3DD9Kzn1dIEwyuusqv5elo6xe4IgZdF1vUq9eJ9wIW1DPlkDfC4u2hlej6lDhVEc0RA/AFyMgulKy4hlMQ== X-MS-TrafficTypeDiagnostic: HE1EUR01HT059: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sa576vcOl6n5Ewfz9up0ZoYy97SosTNIFrXXZbT8UwftKRvgtRP1uikPSLsHl1vmomvbvEq+8FgcZOxcq0KE8k8UMluWZcFZXs3Sfc96HW/rsjyPJ3WxcXgAGt2WUimW9TODLCsP+KL8HjdDnwRCL2k+t6yHtmTr+tvkWIDLLbXEykOPMwHo2qhr883wN6cfuEjaS01dm3n/vMI3qoYUdvPtW2fD7RY4U/ooJZ9Nk593FNaoaal063lWMrlCH3YRRFjWiLpIuWABCvySAWYACam5jjOtr9dTUrqW5/xxkUllq5seJG8295NxfFWhs318ZuSNuE27ErQuC3Wjzw8wnYr75pdzCjkFz5U7Ia1vy+54h4SCExkzwXGBYfx4ai0wVxYP+psiZeJzJ2uXU8fXaQ== X-MS-Exchange-AntiSpam-MessageData: zqFqKNkfzH/d6UgsDdsmg1nwoVee6jaULuEg87QnyUc5P1mURIbYyCOrq6K5VrtvQpnO7jaAJhej9IpUfs+MTbMHF8U388G/jfVVmZfa4h57nTQC2h44aNzUMhA8eeueAwMyjiCu4vDd3EOeMoFZ8w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f54958e-e7e6-48b1-2520-08d9083a8d5b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2021 22:36:22.4381 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT054.eop-EUR01.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: HE1EUR01HT059 Subject: [FFmpeg-devel] [PATCH 33/34] avcodec/libshine: Avoid copying packet data 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: ZbTfLxlg5eIa |
Series |
[FFmpeg-devel,01/34] avcodec/adpcmenc: Avoid copying packet data
|
expand
|
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | fail | Make fate failed |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | warning | Make fate failed |
diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c index 7056fcd2e3..dcda996ad1 100644 --- a/libavcodec/libshine.c +++ b/libavcodec/libshine.c @@ -102,7 +102,7 @@ static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, len = hdr.frame_size; if (len <= s->buffer_index) { - if ((ret = ff_alloc_packet2(avctx, avpkt, len, 0))) + if ((ret = ff_alloc_packet2(avctx, avpkt, len, len))) return ret; memcpy(avpkt->data, s->buffer, len); s->buffer_index -= len; @@ -111,7 +111,6 @@ static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts, &avpkt->duration); - avpkt->size = len; *got_packet_ptr = 1; } return 0;
The libshine encoder already uses an internal buffer, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by setting the min_size parameter in ff_alloc_packet2(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/libshine.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)