Message ID | HE1PR0301MB2154FDBD7A3D307A0CCF13088F5F9@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | 5b8c18495c834253731cb55e4cda2e41ca40a2c4 |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp2015295pxb; Thu, 29 Apr 2021 16:59:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxx5Yf3sj1CvsSMU1tV5MA6LEC6NUW1exWedSZRsvMVC+TqMMPeM6d9V9bho8Ydx6xet0ds X-Received: by 2002:a17:907:10cb:: with SMTP id rv11mr1051896ejb.379.1619740759697; Thu, 29 Apr 2021 16:59:19 -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 r26si1395539ejc.505.2021.04.29.16.59.19; Thu, 29 Apr 2021 16:59:19 -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=hW9ReVdX; 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 E5E3168A247; Fri, 30 Apr 2021 02:59:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR06-AM7-obe.outbound.protection.outlook.com (mail-am7eur06olkn2057.outbound.protection.outlook.com [40.92.16.57]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AF170689D92 for <ffmpeg-devel@ffmpeg.org>; Fri, 30 Apr 2021 02:59:00 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eBaq9bB0dBWZQXhIqOHwog93T0ezQnf1NiGDAziYqCAlmIgABspHohFGZZSgsfS+XoIw61Jtq/ASpUQL6Za5FO629jNEkXtcTUFJgJQndCEBkcVvqMG2wbCJbo7SwEm1HIFMklGh4bRWHTrjJ8qu+WA5kZuADi2acWObuNps+X7XOvJpoz6cWIiDwG+nDIIRrNL1dmsxZm9WF6SjWao1inSmvLDGAkQVkrSD7s9poZaxwlYur71guE5nGqXrAou4XDKvW8No9VMzXobwKYbiggp5/ycZT8NXMbRh3UuugZayJxtHYwwel1MDdysZnUn+2beg+h20DSFKK1nKWbRscA== 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=YMX1ysP4lnPdSqwy/QSGYMLhJj3Gf/xULO2R8uAbC2U=; b=Kard2HkHifTXWWTwumOd7xpMtPH8MyoDRXCbjyf86fyy2gSSbSM7CBQmXB7rBKly0CJW+i3/Dko+mrXhoeYcELuJNN2mmp7+w9SOfq3ghnkRvDhLtXGbSvvNx3mKZWtxz37jYeMEh7uGQWR1gD/hPTUPrNe/Lm40yN197f7O7hjYnsoPfmlvCAi041b1TjgfPAk2ruvGAG0cTS0wrSzHCLOad/Y452YHpG7FkejjUEYobGZdE+vEUmCtXTbAGUXyPiX4kQzV+K8r4BjUHM2W+ieheC9Gr+AqlCxHTVKaLshZTT3ACNF99ovSFSflc9dBi2CszoH6Hv5bW5ycQWzsrg== 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=YMX1ysP4lnPdSqwy/QSGYMLhJj3Gf/xULO2R8uAbC2U=; b=hW9ReVdXBhm7dRL7GdMQtNoanzDMJwjHEKLM40LVeTeWifDoHeRpE/q/LY1dzsn5PcV1AyqUHKLoy4SpZNaeI1N1lvRG+iZf655uKU7sIoHr/iGsD7eAMXWeSw4a4wuEhQVFiix5qIuCs9yafYH0F1URAsEfz+hSvAD9C4uSnpOgx9rorkKxfXc9Dn3zGRehgBnFqU135IowRpY90O33Z8cee6GgwepFA0dhHV9i6UgmH4nQZfGu3WtZJZrM7hdRDLi4RHDKLPomSO4+fiiFJS1ZqlEAyRcGjEji9XDnWLkPsit82glxCIdwJRCIcSrtHdwGA7OV5c/Ei2f00WxCUw== Received: from AM7EUR06FT005.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::4b) by AM7EUR06HT161.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::231) 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:58:59 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:fc36::4c) by AM7EUR06FT005.mail.protection.outlook.com (2a01:111:e400:fc36::397) 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:58:59 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:BDAD8A6CAE3B18A14663E61F79B7FE57239CC37EFED4B9DF80BE7CF7C5377156; UpperCasedChecksum:BD09FCC675BB720253433368C626B3616313F08ED33F1EB5F9E83131DB0DE045; SizeAsReceived:7613; 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:58:59 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Apr 2021 01:56:42 +0200 Message-ID: <HE1PR0301MB2154FDBD7A3D307A0CCF13088F5F9@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: [IhCVacCkOSxn7thpr9khKyf56hSp/hYr] 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-10-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:58:59 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: f59eb0a8-0c0e-4eef-0678-08d90b6ac1b1 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNU6XUx7q8EQ5McclV510mdNNJ6vQ2SSPtVVEH+bkaPcCJIvziV40z8S54JG8vKsXDXy51RTtfB6feZSLHgAqGgH0IU9OHvSH1gVkF9qULAusjIwnv1PQL3V6CV2TNq0LSx/E7QE9AOX0yW9M5ovcA7tyB0Y+uYqWznoOD4SffFm9T559FF99o77ZjyJMe/W/kdCR5R2t/55m8Z74ROgp6USRiNP04ZuyXZLLdSsZxfI0ToeihWXJzOymqCiKc8HhmdScVakn/WUH6GDD/MDuwsJuuRKIDQEccmLdUJPobekw8u2a7bwxEzk6gaGhbmfRBioiGKtteFnhrbDAEbK/n1n0du5hJw5SGD2/l+wobew+oHrnC95odXq9XZkDD2+N8HgBIXORAp7pYo1MbVyeEMmbbYqOrxvcdCtDtpiMfttRBvwviworqqNgszuteneUjBjgGbVcxdcKNmRKVvQIIjZjIClVE8llEcz7T7zvis5Y3+r7ad5Jbh0a/n7FEqPc32nm4IaLIudQhQu/nestZ7EkVfn1XP93axUBlPf/nVE2nZCaUgN+rQy2rf5JP3/Ji2wC/zfPkOQKW018u6NXGAPuc0Jbtebf+c6QXaMp+DD0Seaf5R8Bltd9RMYU0z2FIPCebiIrLteR3dgCKOQEfkP0Nc0z2teG3FPOfgk3vDC2ekrUOQL4m50SycN5cNuLtFr02VWRvWbA0F6PUMJbPxu48iK7HsTKg4= X-MS-TrafficTypeDiagnostic: AM7EUR06HT161: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QEDwwjL74dozhM566yJOyjFRnyxJIUdOLFaBYcsIy44FvODpo9Ygg9yUgV4kSzrmz9IvI+971D7vZCMmCmf2z8I+jT6mrSA7Y3wBsgsVdcQgVu20PICAE64WYLQvDxieEhsBofp5LKHRqfcLKp8ATVQTPLCd0qHCsyQ39Y2UA9V/6nmRGV2NpiWcgSWfFsIhZIVIxRTYuYCmQ7aIqR8a+UiXV9sm087VUxKvM4BFsMzx6FHAVdUFLK1dtI5rh5Tux5noKH/6eKui6T8MMxGvrfZ0C9U/+aSCH3JyTYiIJcM1zbI6oChAza5Ci74kYmg6ENfxbQNY7xI+z/Ug5kDMhQ5zWduNS1gBOBeN6YZLWSWjf3KQb0CpFKw0vpNFiqo52TnKAj5RJUpIfrySJr9dVg== X-MS-Exchange-AntiSpam-MessageData: /jJGQYCrm19kEsSFz6A8qw3niYxv2FT9OVeFeHHhWNhJaALbkIFGLKUNYbtlkMYHSUtGjbcVZNONU6xW2Lh/bMN4AoSUGWWj5Rik+E4hxK6EiJHIuVqgEPrNIPnpPE4jDw24vK4zlGpM4ma+eWNuew== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f59eb0a8-0c0e-4eef-0678-08d90b6ac1b1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 23:58:59.5518 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT005.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: AM7EUR06HT161 Subject: [FFmpeg-devel] [PATCH 11/46] avcodec/cljrenc: Don't use too big buffers, don't copy them, set CAP_DR1 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: muj8f614dGGx |
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/cljrenc.c b/libavcodec/cljrenc.c index 6f04c62cb0..15fe43e073 100644 --- a/libavcodec/cljrenc.c +++ b/libavcodec/cljrenc.c @@ -28,6 +28,7 @@ #include "libavutil/opt.h" #include "avcodec.h" +#include "encode.h" #include "internal.h" #include "put_bits.h" @@ -56,7 +57,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, return AVERROR_EXPERIMENTAL; } - if ((ret = ff_alloc_packet2(avctx, pkt, 32*avctx->height*avctx->width/4, 0)) < 0) + ret = ff_get_encode_buffer(avctx, pkt, 4 * avctx->height * ((avctx->width + 3) / 4), 0); + if (ret < 0) return ret; init_put_bits(&pb, pkt->data, pkt->size); @@ -89,7 +91,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, flush_put_bits(&pb); - pkt->size = put_bytes_output(&pb); pkt->flags |= AV_PKT_FLAG_KEY; *got_packet = 1; return 0; @@ -114,6 +115,7 @@ const AVCodec ff_cljr_encoder = { .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_CLJR, + .capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(CLJRContext), .encode2 = encode_frame, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P,
Up until now, the cljr encoder used buffers that were too big by a factor of eight (probably bit/byte confusion). This has been fixed. And because the needed buffer size can be easily calculated in advance, one can avoid the implicit use of an intermediate buffer and can even allow user-supplied buffers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/cljrenc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)