Message ID | HE1PR0301MB21541B696C1C99E73264B0838F5F9@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | 83cb9be1d2f6037d11c921835d8300ae8acf44f8 |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp2017125pxb; Thu, 29 Apr 2021 17:01:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpx62xfPEGii4PxrYOsxUoUinxLoOPoMzM9cAceOP5X8RazKZF8RQe1LMTGQM8FCPOxE+W X-Received: by 2002:a17:906:a28e:: with SMTP id i14mr1063964ejz.461.1619740895489; Thu, 29 Apr 2021 17:01:35 -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 l23si1842215ejb.573.2021.04.29.17.01.35; Thu, 29 Apr 2021 17:01:35 -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=IjQgK9Q7; 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 4273468A252; Fri, 30 Apr 2021 02:59:40 +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-am7eur06olkn2106.outbound.protection.outlook.com [40.92.16.106]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9887968A2B9 for <ffmpeg-devel@ffmpeg.org>; Fri, 30 Apr 2021 02:59:30 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lrvnD1WPOTv44FttceUVPPsAnNAfGnzWicMkLpJs0Jd7sC1k46iNNiDlXIuN3Py+hcPF9ViZRbZqFTE0lJvfuY+rjzfL3V3fDEp0DAHYqYynpXGmzMibpR6LatZU5ia/T1GlaVP4pT0PmE7OLeEdNykpZwaSbzjVn89oOqMjQwiIy/vYBdOT4grJFuFFsAtkjb2EQgJytCQIWD0nr9WrNR45OAbZUqFWhLeX52K3Ql1KS848z8W4K4bOIUaSp1/d2gk6KrXOuz8kc/fwy/WTzlWPuO4ODuchRC2Jgb2QmKm6PlyH7L56vo+IH90aUIJ6jxDOglhc6Uypdpm+vKIsXg== 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=h1l8lNnR5E/lq5pEcZeGighoCeXTZVxNcj8BtevHvtA=; b=ZaOaRO3X5lqHG+Q1ANj0ncaHB9q5260nXMFj/1oc9ePdpVeboAyzycS1EvvdkRmZ6xl6mV8wNY0GOkCwcSI+mMuzCwc2PsZDYVSlznFneVXOmK1xCAIUUvmxI4/3L1XVikmy7xdNJxYFx391AabWobf0iFVCwjOuOGyPW5WuBgnJ5p3DBXo2cwnLVXhTTMeXekn2HrmDcndCgNj/1e+kdZbIv5EXjuMvVOfzhwbfxTPZhZPSalsDkHSf5yw4QWYnbo3XRAt0qldW21ad4q60kKCcMfk3fLiyQjt4UyCoJ6WGGxc1yFW3LsYqzjyLuNscVhtI7reyKSiTC7AMHYNvQQ== 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=h1l8lNnR5E/lq5pEcZeGighoCeXTZVxNcj8BtevHvtA=; b=IjQgK9Q7osLwfZCrLdjCPogUC4PXSFbm+LV4JLkfGiSuveiyvX6fmVYj4KzBE6IPBzxYZIbdi9sFg1hrIZh6SthvC0gnI/nU8W52jaIzvl/E4K1A0dKOan/Bf0GUHRfx0FMpYRbF3calp4DWF2G6zP+bVs81YUYWQpF6rPOeAlo7s2muAW4V0A4Rkq1rDk9uvD9fIQMNizAlObSWsiEh1KmieoTHS6GZ2JN5bgrRL70GTNuBch5JQYP2XxaC3+BI7IsqkZM0dcAIYrpoK+bgUiiThLpzF666cBEF/dVmVegopHZNSbDQs1eu1Df0QzADTFiNlC4RsUs5wa48SrPRkA== Received: from AM7EUR06FT055.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::41) by AM7EUR06HT145.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::367) 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:29 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:fc36::49) by AM7EUR06FT055.mail.protection.outlook.com (2a01:111:e400:fc36::61) 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:29 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:4171D094C4CB7B61AA3DBD1C251A63B5092AE29713547BCF2F9CACF42A0D7A8A; UpperCasedChecksum:390236B6C923145C4C750072375F52128188E1CBE83DD7AFA984159B9437739C; SizeAsReceived:7593; 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:29 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Apr 2021 01:56:56 +0200 Message-ID: <HE1PR0301MB21541B696C1C99E73264B0838F5F9@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: [UQkeCIGMdg9g433528PVdc5EP+2PI6yi] 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-24-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:29 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: a5274a00-8a0d-4100-532b-08d90b6ad3bd X-MS-Exchange-SLBlob-MailProps: dEG5jEBie8lZ/qLiIvG7M26yVq6lLwmYXRyi5DHSv5bW5hdRURHrfVOeiX1dixqTGOsCvm6OGPl/KoxF7f+MoirpXlJ/GGAkY1axe/kwh70ZyTP5TuJoLn50TZVakUy4VbXjXZsthTBndFxrFzkk7ErQ6klrTF4qWV3vFXWWkZ6ye+TlYd8I55/2RF6/YW5Tst8ykWRVr2X5n4UWdJnLN0GXoKwk28f8DaltA9LPutEoTb4iDrW09QnHb+v8nVVn7KXt4XYCjG58FegoT5821hzMfMVCKtFhvDfsgs/24VICyNdOtDfNWMYGKkC/yziKUod5/4shvJkBfawOfgxOilUkjxTUF3sFSfUg/qKlXkeJxJS5LiWtwN7Xu69t4+K9oMfMWaK6CzxR9qLC033ZSoD9SNOlK4b0EP4tnissLiu3bTugc3jI4tEZo3KyJVmUGmsWIm2DXxq2iwbXLB3tpZnEtJMJpejc5CEP/DNyndK2uTguUGcPG1XKa4oM8gwjh2/Y+mjhJ+X/F1vUUG4rVAd3GsHY17GypDDv+1rjGZv77msW3hZvz+66AT0zwSFRV+VZs4a5Xg5O3rIYXG3DXzeglSKhrPN3xl43rtx54lMW5w0L+kJFL40y0ac7suls4bdyzv3yrPNmBPdmVHvD+8n20kIaA1rSPJwg6NwNQ/mVCj74+24I6g== X-MS-TrafficTypeDiagnostic: AM7EUR06HT145: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HdGZ85M3NVJTL13JWpDzHUxij913YzVzOdg8QEKvm7V8Y2tUe+ch+d1J7DnH2jLqwCSMY59wVcatpQWOl6n2GzCG6Pl+5CAfaWHTEF0SiC9o8wenqsCtprsInA971zKYIu0FFDBnsjBgqU/+xwHwW0XbqacmPKwis+qUozd+01mIZ0RP69RYG6y6UZBvf47ckGLL+EjBW4QtNyhh9hTUHadWmgKrTuDS6Mz7hhfvEzY0zhALMuFRuQIxnsjds6UDvFz65pSA6KrC7K7vOc6u7Eq6N7LS0WhQdbTBaweNY7dElzKYIT/dzwV8H7sowiHV9GIPZWPbPWE2FpkPAGXc6ZqCoQ5ottpM2q8guSAcrOmBZ8bZvsghjw6INC2nJDr5ImX/+B7ITAGSnrfrZSiU4w== X-MS-Exchange-AntiSpam-MessageData: kyaAhnAvGTsgtk6Huc8YoV30prp0jSyqNi64YumIeawbtsH2vLCnl7t6qKz2gUN//sAhpcZwq3H08T/A9qOscfVV0bhw79hSkjXPsm4fOdpaAa+s/afLK8p62bYuZks+2bav6OuXxX+3tKnSEhaLWg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5274a00-8a0d-4100-532b-08d90b6ad3bd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 23:59:29.8314 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT055.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: AM7EUR06HT145 Subject: [FFmpeg-devel] [PATCH 25/46] avcodec/jpeglsenc: Remove redundant implicit checks 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: vabdf3rTaIay |
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/jpeglsenc.c b/libavcodec/jpeglsenc.c index a7bcd78275..c80d7373cf 100644 --- a/libavcodec/jpeglsenc.c +++ b/libavcodec/jpeglsenc.c @@ -25,6 +25,7 @@ * JPEG-LS encoder. */ +#define UNCHECKED_BITSTREAM_READER 1 #include "avcodec.h" #include "bytestream.h" #include "encode.h" @@ -53,12 +54,6 @@ static inline void put_marker_byteu(PutByteContext *pb, enum JpegMarker code) bytestream2_put_byteu(pb, code); } -static inline void put_marker_byte(PutByteContext *pb, enum JpegMarker code) -{ - bytestream2_put_byte(pb, 0xff); - bytestream2_put_byte(pb, code); -} - /** * Encode error from regular symbol */ @@ -408,15 +403,15 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, while (get_bits_count(&gb) < size_in_bits) { int v; v = get_bits(&gb, 8); - bytestream2_put_byte(&pb, v); + bytestream2_put_byteu(&pb, v); if (v == 0xFF) { v = get_bits(&gb, 7); - bytestream2_put_byte(&pb, v); + bytestream2_put_byteu(&pb, v); } } /* End of image */ - put_marker_byte(&pb, EOI); + put_marker_byteu(&pb, EOI); emms_c();
Now that the proper buffer size is calculated (and checked) before allocating the buffer, it is known that the buffer always suffices. So use the unchecked PutBit-API; and also use an unchecked bitstream reader as we check ourselves. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/jpeglsenc.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)