From patchwork Sun Apr 25 22:34:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 27406 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp3458307iob; Sun, 25 Apr 2021 15:36:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbZpiCmKjNViZBIH9hl9xmShaHRmcb2BF4H6QH+fkV3iYs1iopw/4TceYuqgdGgZE2MdmJ X-Received: by 2002:a17:906:17ca:: with SMTP id u10mr15112515eje.124.1619390188348; Sun, 25 Apr 2021 15:36:28 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d16si11001374edr.524.2021.04.25.15.36.28; Sun, 25 Apr 2021 15:36:28 -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=DPlJ3uyg; 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 321A4689815; Mon, 26 Apr 2021 01:35:29 +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-oln040092065104.outbound.protection.outlook.com [40.92.65.104]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E8E6E6881E8 for ; Mon, 26 Apr 2021 01:35:24 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UuP0Hg/Muj9IJeaPju/3tcNDDatF+/kuPUY+ne5Gwz7JyVDxZOGYqyBTExUedmzKdJVRRTaCfqd8xgF80SeEMJ4/sd56I/MjvAXCzm8x8HTDHjw/D9c9+uhRjavGaTN2Cu855k6MNbhG3boGmzazEX4P/UQ0T9idP3YXK37VRbr9dBjRG5GeaUd4ISSf/mpSmVgQkn8++oIqmwJ5fxm0GsRY/qKKizQAnS04lMswLpcNWt2oqaoml5jWe81Ch5/dCoLKjOtWhNBeFVgncwnilHa84rUWeEn+1gPqcHvc4FIr2geQQi6AdNwT3heu9qAIg17Oae9plGmZQPuriXguzw== 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=gcGdzLGJBQZqBvXB2ZV/7yd0czMJ6hqQ9+ejfpdm2eY=; b=YpHZ9UPOqpLt9hS5xiKcBcyJA/bfBwaRvySVfjY7zIchCkpkpfWg108TgjqV7mX9bCkDy4SMnxIOQJFDWTvQ5HFsp5ctmOvs0qesq2lIdaHRtAxDBgxARiIS8Ju1CVEXcNQgm5RGWINlVZl58jW3hpYvDcZDkY+lkAjN7PLqS7m9Nn5klMod6BkzR0oPFOkes9PtqkW+sJoF7/+CHFe7ySDWIfTnm+HbA1hgz/LDeWxdNqPLHH25b6pyz1z16S28VbDg6Ih8qyJhx8Gl2Siu+uLZEapM01AuNXF0soi4RI6H/m6Cb3dUIbMzV7GrgS3NOaWefojz1spKx6o+da5hlA== 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=gcGdzLGJBQZqBvXB2ZV/7yd0czMJ6hqQ9+ejfpdm2eY=; b=DPlJ3uygmeFKn4lULeEJWC1CIRhuurSLO6PN5AaztrIV7+yHb4KVN2/iDbQMCCUo+I+zSFVYl6nq5czgCPGiqNjnmkUaqrVxu3zy71Er61dn8pFqstgmu+02DSZ9/i2ZI9TcBqhadEyq5Sv8l9lAWsABXQzcONA8OJjxNj3Js2DVcwFN5f+HOEsSfp8OCTiHUwr5FmZRohc0VActcaCCnlFj+goUs2kCSdVYLMT+O06p3JvfEMDtwcl7FCxmkL8rUCFquUazMF3AnJjKQbSC3kNV9hPk2ybQfQRArjrwrB8Aq2jkPvvLsZOmDBOF7RtEwjih+aLgZRLDFFA/aFHixQ== Received: from HE1EUR01FT030.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::46) by HE1EUR01HT054.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::276) 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:35:22 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:7e18::44) by HE1EUR01FT030.mail.protection.outlook.com (2a01:111:e400:7e18::170) 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:35:22 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:9DB9D14C379405EE7B4F3024CAE3BFAE3A3BF2BCF595E232BEA7B7F7C0CD0B3B; UpperCasedChecksum:1135B10ADCEBD13781215F69BC63652F3ADEFE4E0B93DD7F95FF62282D2805F4; SizeAsReceived:7588; 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.026; Sun, 25 Apr 2021 22:35:22 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Apr 2021 00:34:25 +0200 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: X-TMN: [3AucUC8kg7l/l07JgNX6roEbZuCQ8WgN] 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-10-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:35:22 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: c61f58d4-79bb-40e1-4e85-08d9083a69d1 X-MS-Exchange-SLBlob-MailProps: dEG5jEBie8lxmSIYGjeOxtpX/NMoEuKP+KIiUrOPq6xFdC5mb3F7OsT6T3mA9/X0Kn6GGu7nX6Z3Z0bRlApwzCU8tRcLijUIOztIsPZieYBLaGacTlvBbgLrhu6EjdDtWHEI18UrSUuv7dSJoKWSzKlIoacoLDpswtLU2G/x3l6Bx9GXuLWFaqWIC04fOhcjjQc08d0z7Tgz4dqhfqRtkYMjNcbHNRa8hbdZuh7E5Q+qkV40RP6XIbyWvGxebcIe11njgdBtzV4lJGeJeAYZRp6bkOhBkzWKe4aq7pGTlp/N384HE8PM1xxbZDzFC+4NScCqLcj++9I9hipEVr/bngdvrlbav4lP/i5Lmzy3w+s8Z7jvJQj+49jr5Iaxye7pWk1qm8HF/KGUwxAxSf4AcP6DaYhP1T+i7P4qMXR8mKNppnytkOqQ399wNlMrF7yH1GE3ydyYiSJERni/D4siur4MlTEd7qUALQaUBz8YgRSgfAFVlSs6qyHaNFJQekPjrj16og2vztAbDZOmkC31OKVrB/lngxK97ngyEtD836WTlZl2RHr5lEVBeuausX87yyUY9kKgZbTOcusSe1AeHWAD/F4uhA3DpZ8HmpbkcIfN6w7kEdbcp5fnTKynG7tPiNBvbKJDtq44tMrsy1jVOqCQoOxjm+mTEWGMzlKeO571jl9tKXwWFA== X-MS-TrafficTypeDiagnostic: HE1EUR01HT054: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BYAgRv4ioUNSt+eyX1tHht68NvVuT3yyY4724LAy9xgDOPZOHkDZv59Af/O0lFrT/8E80kCDzixUkOm10nN4Y4EFRkKBoEf0PmKL/5rDGEcYC+dp32b8AWzsB5//IdL+J62NUPvC/rRibezcSnRrfB/LHavdIi48OXhYTwTQIIIRQEFKFTBeWGvM2DgYOBo7RgFTm5vR9dvVGDDNODJvBAiqaVhaX2CLlCnSCZvVOUnyT9TVL2xMCAgLMB6CL8Xno/Saj68sWT8sScD/+IFQQPsBEpELHDTJuTovo35y+FRHaibY3OrjusPxpbu+MMgVXRGU3ISNmgTz0hYVuuW7f3z5sljV4dmUf7zdKmZNRxrVRQskQniOI/ZPewT78e0ZdICeQQ1pnY2lnVpDcsOp4w== X-MS-Exchange-AntiSpam-MessageData: oD/8hfcg7d35WLvr+PEZwHFE1QI7nklg4uZaOxNWa/1D2TiEDKRSD32aZVncM/MkCkkwUBEZG23AltqSwnkfGqkZc+4ROVs8qTt/JRK77kZzzM/3MTOsMVfuPjAX1hlpG2cCzRN+vtm3V0soCgyi9A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c61f58d4-79bb-40e1-4e85-08d9083a69d1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2021 22:35:22.8245 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT030.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: HE1EUR01HT054 Subject: [FFmpeg-devel] [PATCH 11/34] avcodec/nellymoserenc: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ch3l15lSZ8F5 When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/nellymoserenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 8670431dcc..5b32b4c86d 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -405,7 +405,8 @@ 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_alloc_packet2(avctx, avpkt, NELLY_BLOCK_LEN, + NELLY_BLOCK_LEN)) < 0) return ret; encode_block(s, avpkt->data, avpkt->size);