Message ID | HE1PR0301MB215428DB2466C079223DD6B38F5F9@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | 4569c70f140f01447d1de385a2dd490976d95f89 |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp2015505pxb; Thu, 29 Apr 2021 16:59:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm6MWJ7xa3ybOGlJV4+bOjweXh0X+eMlOIuiOWUnsz66mr835KlPKQyusoxMThUC4tNnTK X-Received: by 2002:a17:906:170f:: with SMTP id c15mr1097379eje.358.1619740778689; Thu, 29 Apr 2021 16:59:38 -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 h16si106393edv.35.2021.04.29.16.59.38; Thu, 29 Apr 2021 16:59:38 -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=hYqz8Str; 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 4007968A2AE; Fri, 30 Apr 2021 02:59:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR06-DB8-obe.outbound.protection.outlook.com (mail-db8eur06olkn2041.outbound.protection.outlook.com [40.92.51.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B1552689F19 for <ffmpeg-devel@ffmpeg.org>; Fri, 30 Apr 2021 02:59:11 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jzrumh99fb0Xa+3bGN3o7nxcc3/5RpqAo6voa7zYPb7WPXz/SvNVjVc9uHZcWDdI7cyrTa2rbCPqqeqexBMs/+Rz0apSovCZiFPQ/KF8uIQcnhm/eAG1nyxzwoCN+/uh73jFw+GN8uNwYtZZYxzn1kyMu/YnUiNW9WIf5Np7Il1idnZ+anUonGAO6OmVKuRSEvJWUDzODjkbRo1TRmlSNHMcslBMJvsRKpR/4z5xM7l2vbEfoGI+DM/eAam4ixs5FdVhkWBXopOmCjOtA1CIC74pNLL1choyRuLyn4eALb8Dw+XKQB9RYxCi2I1LOJdjfJsNlaI/ZV3v97aO9no/+Q== 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=i6A+aUWd/imrvhNOOFOf+1Esc6a4EDbObO2ozKoiui0=; b=XJY5w8AHA3tq8Ps2g3R0wzHiVcX+yuCsGQ7Kiao7QjLMifjO+Ak80PyCOMhq7PIHlVJejGD35TXfoQMID2Doi8dZDyEJ0q1jdv70f6APczMsRnRrMflHNWGhhiqxdNax6NRt0yPaTlgQHs8DkNiYF8rkWH5k/bH22wnbr3W+jyI/T65unZEHza/QsICXCmYXQHcm8GrZ485wniejJsr/oV5G3paoWQ+KonPkJKPjD20KjuDeYTO4iEy7yBcDgvGfJz0hQihTNCr6+l6PE9j+i1hMhvYYgT3TCwOD5W7BhuRcUdhValyv88ALwtMv1tm2WuSVfm1+00i7jeducJjbng== 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=i6A+aUWd/imrvhNOOFOf+1Esc6a4EDbObO2ozKoiui0=; b=hYqz8Streu/Z38UojX6+AMFFWPtRbxChPmNjb6xd3qxgYuxJwbTugqQJLyyEJpFpabuONfszQQCp/B/0i4YnhMxAk25/Nhn5qG4klwKbfh3PPK7s5Szl4tZRChUqLnUZAjpbV/3sJmv50uMIdIlAwJ0aoVMYk/BeUwr67r1k2TGKg1Urqd1jvJ7akK0rD+oiroNgpUFeuLGlkCFu+UpIWiuvYuig3JkVKEZNEiYhxz9SoX7qA9eCgkrebl+3E1vWZGtCJ2xKOBJDKg8Gt0c0ueGaAYBESdlMvnfe3CaqsQmr8gvGjiS5hpecbN58TYE8cz2Io7xZ6hwe+IXwQf8k0g== Received: from AM7EUR06FT005.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::53) by AM7EUR06HT213.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::137) 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:59:10 +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:59:10 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:609ED2B8972E4993C25CF39764F49C7C282066893DAE32261B6CBE4EB996B648; UpperCasedChecksum:7B7063FA688E48E981DDCA41BFBACA263649977DBC4681A6CC9E68CC9BA89B0A; SizeAsReceived:7610; 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:59:10 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Apr 2021 01:56:45 +0200 Message-ID: <HE1PR0301MB215428DB2466C079223DD6B38F5F9@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: [b2FDhagjjJscG/+2LP+iww3rtrZMc450] 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-13-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:59:09 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: c1443d3d-258d-49a2-0ad3-08d90b6ac81d X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNU6XUx7q8EQ5McclV510mdNSQ6zVwN/I7EX+rk7h1h8roCTGdsyjXMArBwxX0cv8ZAYALSTjF4VUUAm6tCpDOSEvvLY9pBm6CCsepI7oX4RuzmOJCiVqnRfWtyAwzCk3BZmajqeDBLzFggGumyM7gSCaz1IsFlaR6fyveGEMa/ftvvF3CLqNhvxtQj93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HFf4r3DIiYnIu6RzUWkI3tWS3WpbwU/7S2zJlcN4dYwMUqyvtEsRwBcQ02ESSK1OPg+oKkRH9IGs98Kcq8JaVG+Qkoy8UauinlKTsCG+v7EVqwPNvzvnPGxbmYdlU/fvA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1443d3d-258d-49a2-0ad3-08d90b6ac81d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 23:59:10.3220 (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: AM7EUR06HT213 Subject: [FFmpeg-devel] [PATCH 14/46] avcodec/dcaenc: 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: iL9pOPi/Nk7d |
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/dcaenc.c b/libavcodec/dcaenc.c index 76f1f141d1..71a76bc356 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -37,6 +37,7 @@ #include "dca_core.h" #include "dcadata.h" #include "dcaenc.h" +#include "encode.h" #include "fft.h" #include "internal.h" #include "mathops.h" @@ -1182,7 +1183,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const int32_t *samples; int ret, i; - if ((ret = ff_alloc_packet2(avctx, avpkt, c->frame_size, 0)) < 0) + if ((ret = ff_get_encode_buffer(avctx, avpkt, c->frame_size, 0)) < 0) return ret; samples = (const int32_t *)frame->data[0]; @@ -1239,11 +1240,11 @@ const AVCodec ff_dca_encoder = { .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), .type = AVMEDIA_TYPE_AUDIO, .id = AV_CODEC_ID_DTS, + .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, .priv_data_size = sizeof(DCAEncContext), .init = encode_init, .close = encode_close, .encode2 = encode_frame, - .capabilities = AV_CODEC_CAP_EXPERIMENTAL, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE },
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/dcaenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)