From patchwork Sun Apr 25 22:34:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 27378 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp3459027iob; Sun, 25 Apr 2021 15:37:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdeJCOzrIpJE9OVwSRh+o66unQlHHYD9v/rOEmlIIUnawJ5ku5dtvelDTtaEvDelueYh6M X-Received: by 2002:a17:906:3e89:: with SMTP id a9mr14960140ejj.405.1619390275422; Sun, 25 Apr 2021 15:37:55 -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 bl4si13813367ejb.17.2021.04.25.15.37.55; Sun, 25 Apr 2021 15:37:55 -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=HA1YEOkW; 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 DF019688075; Mon, 26 Apr 2021 01:35:42 +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-oln040092065015.outbound.protection.outlook.com [40.92.65.15]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F3610688075 for ; Mon, 26 Apr 2021 01:35:39 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OaovQ6jx7QCrOfnHZYq1K/fzeff1zhh7W01m05dRXY2WAKWN/f45w3VqC/jfkajKK9avLQ1Ar7WxMcmIgbfGGCaLnb1PEMo2OCfk8lazscB66yQe6vf1a/PylRtmAGLEEGUFT1LAUXxeYoH8pQ6KIzsFtP1iJ6/tNek/Wte0RuXP4Ky4wOiF12tRHTxHikSekXXNy4qnLhtg3v6Y//UoTZXV21UjMcRqgOyVW2RX88LJkKhF86J5vXd2yV3sFZw40gtNZvhea8qutv4QiniedzeelMrioYW2I51mauHJfzOMW+dfJ7cF+haJ7z2WKkXkyGNlTYPZV91j17WxBi7MFg== 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=Uf6us5qK8KGNtmZ4vyoLupEtIk0BIdwtzxdNp22SpJs=; b=DbTWuy5O8f8Ly9bj7OKIw5SERa2gI9H2+XA5PCOw5wtL6WZ74unITg42m3DuWJDJ0e7Hw5JvBHy9UEswA1ROhMrNSo9V6nSj/om3Vv0W/ySbL0HF0Ojj+yA3Zah4INU4E9ItO4prNEPVmaUXW+eYfgHt72XMYD7wT9JKJ5jjgHBPwGFifmQqX3OPMyhOhTpphJD/IisTRlzCVBolccEtlUCGEi4CXCgkr4VRu6KUUgsPNxw54PzyuxVxqYrJOu+qNJN5YQDohA3t3CEwXp+luo4kDCEyCytVDkMdqkF/0eo9i3Fag0IfPKccghPsYCP7BjKAKIax9YyNBx2ScBdOAg== 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=Uf6us5qK8KGNtmZ4vyoLupEtIk0BIdwtzxdNp22SpJs=; b=HA1YEOkWWMD/W95+JQ3J7gVTJ2ytWxWJTf13i9z4Z14XLg5gVJ1wwWypyzY52gnZTPnbe44uMrgBhFt4J/yhJEzh0udJ8J59Bl0jkpo5K+6Gqy4bHdARNj/iSa5AR+tSZdLGcAdbqE+Mx6EMfMvrNpu9ujeXqpZ2kr/AWpZeUY532eg9lbf3apxgwKKUof/n/2U+5coEsZbYe/bwnmCEWi+1ADsj97iO2+uauq9ZGJwp85cHhSdDFcxjoQRXfyNaNFbl9gtr30QxQR2mMc/ubMtJ7/g4OOMmHJO7STSaBM3o626vAujCPYBlioo5R2JghVG3SzKMx5L3muPqhIkQMA== Received: from HE1EUR01FT030.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::4c) by HE1EUR01HT082.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::277) 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:38 +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:38 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:788BA9564602581A99E4D38A18AE97B103BA2F836DDADF1C6412DC7412EBE038; UpperCasedChecksum:AA703CA693D21FDD5F2E118668DAA86C04572886D50815359DD7DD1E905050B1; SizeAsReceived:7584; 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:38 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Apr 2021 00:34:33 +0200 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: X-TMN: [30R26MB8zAQjYzPq8B5zh2YE9pOA7sNN] 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-18-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:37 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: cf53074c-988a-434c-dddf-08d9083a72f7 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNWJWQ5lR/nEnbarXZJSK/i4i6upxEzFgJTr9iZEFBWYAs0hXFNhhin9lj5eyZTMyVupKKBNxXG6WSmAAJOoOH6ySEeA/U2Tin73HeE8dcbsEP2LukfoDPXrIpt/ryxg3SMyPnPFASq7bL0vlq58/43dBBfF4l8Q8vFNfDM4qKzsFN14qTcL60M9onKrDwhZdL6pjZ30dqOc8/Ov/uaz+opunhe9nJFMoeqhjRdusMvKMQMhc75gAl69Tx6HHcfRJ7Bs1jj36zXXJbLj8XF3UpWgi8h3EjRlc/6ta+o7THtf9KLCD+Upa3NdPkIrcr26BdIr9aQzmhq0BLlsGYqiDKeS7FpupNJE3kIq44tQWzwhvTJmwT9wd9AqwqWjnnpocua6b7DUSFl0W8UHtcjBL2FQW06b+SMwZk48+e8utwU+trUtgUTvLVXs5loMdm88xSik0dd8C13rJ7suBHgfAlNp1SZqqYxJuF0t9ez5uHXdHYtYyS+eJ8eUvN4iscyBZ3RCclMe2kkNtZTQvK6jsKqZpp61+l3+2qGFgnbRBg2m8pKzIMkULw/CUEt/FvNXqAmV61yVLZYR01vcaNDcFvQFa3AZXowOp0zId6dT2SEM9GpNVBo4ztT/e9EhVfuidd2BoIWlcgjfSFFcQSYUYA0jFNPsRRYeRH0IrWeMwBWNcnnnRJyxwybnbpQ5h1DreAqKE5ly/PzsM4vVJBe/Z8ssykcoHpn8WBc= X-MS-TrafficTypeDiagnostic: HE1EUR01HT082: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PzlHgCtUCUEwbM1+Pxtx9uRh/q4EG1BWuA1rvPZgp1xnj9a+kWChsQkviDQLGi/ggkWu2uHILTqkOvKChWkD/VB6DhWL7mpK3IFoq51Er2EJgUzjKgUFvrgT88RS/x8MQm9kNt3RsmwdFXhAVZGdeWKJxVFYmbqrvrhOcPu65S20bjm1gAL8w9wZPOljOvxlpULoimJSy7YkGvdU2zLMs2JCXGjq/zOZmGkne27kEot0ij6qQmRs0thr/8V14gu+WS4ItEQ+FkPdkBAxlCRZUB6RwXfWlsiKzsMKVL6r0/TVjot3SZawOp3O5BVnm67eFXaMaxZlHybB94Zk9mXGNp+6If1yL6Cd5ugRx5YTKoFEu01ynPRPvvbC+9WPtuxIN+Wk0q2i+bstBo6r5sS9Zw== X-MS-Exchange-AntiSpam-MessageData: 4pgcXf0PPkVe1am1FANB128Yz6xMwiwSxAFKKCcn4lzC7eIctjH//qE8Q216T5jvhY27xvMuK/S0C88d7CxRn0LbGd/N8DjBycwsyrb4f5HQbPSaLOFJ1SDwwizMSYsUpAM2WYx18wiaVljh0iDw8w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf53074c-988a-434c-dddf-08d9083a72f7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2021 22:35:38.1597 (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: HE1EUR01HT082 Subject: [FFmpeg-devel] [PATCH 19/34] avcodec/xfaceenc: 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: 3FmB9tjRSr0s 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/xfaceenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/xfaceenc.c b/libavcodec/xfaceenc.c index dd5bb689c2..4d6087fe17 100644 --- a/libavcodec/xfaceenc.c +++ b/libavcodec/xfaceenc.c @@ -195,7 +195,7 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt, intbuf[i++] = r + XFACE_FIRST_PRINT; } - if ((ret = ff_alloc_packet2(avctx, pkt, i+2, 0)) < 0) + if ((ret = ff_alloc_packet2(avctx, pkt, i + 2, i + 2)) < 0) return ret; /* revert the number, and close the buffer */