Message ID | HE1PR0301MB2154D0789E077D1DB67AE1DA8F5E9@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | a043dcbe65efbc07d6f83b5822b99377035039a1 |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp2019937pxb; Thu, 29 Apr 2021 17:04:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAytPO2df4uV6oYdSE6BzkkP1DDxuOfkz/9sdlCZx/5B66I1HvGmUxaGZz+xBVulWAci5H X-Received: by 2002:a17:907:961d:: with SMTP id gb29mr1064079ejc.381.1619741086673; Thu, 29 Apr 2021 17:04:46 -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 gn22si1431142ejc.426.2021.04.29.17.04.39; Thu, 29 Apr 2021 17:04:46 -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=Fs5BhkT7; 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 3C37D68A52A; Fri, 30 Apr 2021 03:00:18 +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-vi1eur06olkn2025.outbound.protection.outlook.com [40.92.17.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5242668A4EC for <ffmpeg-devel@ffmpeg.org>; Fri, 30 Apr 2021 03:00:14 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n9UPp4ksc2mdDHzTOFBAJMoYUE3Rx8YLGYKM9LSD5ZymgvAGFtaA1J/sPzz/AUPF/ZETDRHj4WI3o6hKHd6XmNwSb7GaAdRei1zWM29FzGILxHFdj5BeDKUZyjOHW+RGvySmCkaVEJtVjJpS+TnccsqVuwc1/nZk8FNBqfSt3rC0uhz33g2ZkrDUMg7ViULd8LTHE/Tuip+FA84mSd0VI50w2HN1SVM/kw+0BktVE9d8uf165BGY9LOvH+ZVswPB/LD0VM1ZGx7AkQtUfDuqWYckiMbN8wBWF5ycRduISIJpazfx3/eFDBBdfx1mlMp2Rgk7ighQ9rhIPoH4P+j5XQ== 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=y7oD5BGY7BS7Spc7NgFhndOSKbjvdPj7J+ppe7lw4uQ=; b=DDZAJ0obRoKMK95Upu8MXNK/aQZ82onvvsV4Z9v+ykCPvVbdec78pCCBoHtEgQ7SGzxNEKkNTGSh5VgFIUU2Xvy6//75Ej84TFUynzUhbYE8ubDE9x0/3QsOWVgi306RauZjIZtcoVV14F5wGHDl9AUmBKbGEMOPgmOwAhD1eVoCsmV+aLOsIDoQcJeQXptS025R3UQpSOGxRsceH2aQwSqDManSuf7KVnnF/Z4YyjFbEMg2OJtpAbAVsV3G35P3XlW1hDTO4x2gyv9N9gFkXtijvUs+gG9jbjSNANaPGMVO4sq7hDxCs/O0d9yq9gyTg5NIyKsumT0MzgiFgiMrvg== 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=y7oD5BGY7BS7Spc7NgFhndOSKbjvdPj7J+ppe7lw4uQ=; b=Fs5BhkT71wctTCNhxgdjPj2oRJPL3Sbb17y96d45KbIkeUPms+wEiPOa1dKz6zad12HXJVNIEBFJgBDYrmwGQc7pfb/Hn/QaE8qENhlLsYvI23RsADwViEeTHTXZc8wc45tsaLOo9TD+7E+6JjzPzQfZGsgpBzPte/+AMIQc+e4zIhtYhqCIjpBn15f980xooGrwyNBZjZAzZUNzlDkR5rw5v39BEfCAWWdnVKW05r4yJAgJFVa3dWM955RBkIDZ5Rs7iOn+gz6zMf/UoBkazwmEm1x0SyGUQb0J4D/CIPvJpPfOYqIvXgjgrnZpVORy3PBamux8w4ul5UG8nNwSVw== Received: from AM7EUR06FT057.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::40) by AM7EUR06HT225.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::507) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27; Fri, 30 Apr 2021 00:00:13 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:fc36::4f) by AM7EUR06FT057.mail.protection.outlook.com (2a01:111:e400:fc36::445) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Fri, 30 Apr 2021 00:00:13 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:0C87990FC23C2F4DC26BB8EFBD99E1AFC0B500DD08B6F8F004F9CEA62F1383EF; UpperCasedChecksum:46545AE98471371307B7523CDCA65E40B711FDBF26F7882FD1A9425CA9665F0B; SizeAsReceived:7777; 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.027; Fri, 30 Apr 2021 00:00:13 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Apr 2021 01:57:15 +0200 Message-ID: <HE1PR0301MB2154D0789E077D1DB67AE1DA8F5E9@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: [RsMtnrbfG8Opaxz6Hi9HZIqlCt9BMwx/] 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-43-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; Fri, 30 Apr 2021 00:00:12 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 5fb304d4-ccee-4140-72fa-08d90b6aedbf X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQnJqnaHo6w7XTEhYoMxTOUqqC1aAam4by48Ty4c++T58WxgQac8GVsnJJamfQbDspX4PpXx24UwHsGcG/pkHUyf0kR5YwajV8uzTMCJJQYdiQ9dxmjGMxqOGI5PR8t+DeiAWql7R3l4Jd59zddvE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7kVM890ZwitkMmg== X-MS-Exchange-AntiSpam-MessageData: NdRH/exS3IqA8Be1AegIPE3qtAraiFEKpzehot0aG6+hjdM4BIuBMyZqEpB2g/lKooRZ2FWHjopIs/NwuAVbG6ycAkEn8Sugbu4Dt72/nEQClZJ2O9vKf9SNs7ltq483EIH99lV/pl3Y6DwpY4iiBg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5fb304d4-ccee-4140-72fa-08d90b6aedbf X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2021 00:00:13.4421 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT057.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: AM7EUR06HT225 Subject: [FFmpeg-devel] [PATCH 44/46] avcodec/y41penc: 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: qYeQTSJqpFTo |
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/y41penc.c b/libavcodec/y41penc.c index e7d639008f..cd4c43b800 100644 --- a/libavcodec/y41penc.c +++ b/libavcodec/y41penc.c @@ -21,6 +21,7 @@ */ #include "avcodec.h" +#include "encode.h" #include "internal.h" static av_cold int y41p_encode_init(AVCodecContext *avctx) @@ -43,7 +44,8 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt, uint8_t *y, *u, *v; int i, j, ret; - if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 1.5, 0)) < 0) + ret = ff_get_encode_buffer(avctx, pkt, avctx->width * avctx->height * 1.5, 0); + if (ret < 0) return ret; dst = pkt->data; @@ -80,6 +82,7 @@ const AVCodec ff_y41p_encoder = { .long_name = NULL_IF_CONFIG_SMALL("Uncompressed YUV 4:1:1 12-bit"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_Y41P, + .capabilities = AV_CODEC_CAP_DR1, .init = y41p_encode_init, .encode2 = y41p_encode_frame, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P,
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/y41penc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)