From patchwork Mon Nov 21 01:07:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 39369 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp1832981pzb; Sun, 20 Nov 2022 17:07:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf5jzEOk9/ZANg4MayAiXlEWSR8hHeX/vHbAWF6wmNoT2kKjjow8mPqm5A8ijyt1F15p/EZl X-Received: by 2002:aa7:d999:0:b0:461:7f5a:e04e with SMTP id u25-20020aa7d999000000b004617f5ae04emr5746912eds.389.1668992842385; Sun, 20 Nov 2022 17:07:22 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id sg34-20020a170907a42200b00791a7e441a3si8560824ejc.459.2022.11.20.17.07.22; Sun, 20 Nov 2022 17:07:22 -0800 (PST) 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=a+yWfFHD; 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 59C2768BCE4; Mon, 21 Nov 2022 03:07:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02olkn2059.outbound.protection.outlook.com [40.92.49.59]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E350368BC9F for ; Mon, 21 Nov 2022 03:07:10 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EmL6vxN4xPzsZm9GbUpjj8gknonNVuFXYN05FyF6JUVYICASYF3LKhbqIXHcEdbybnvanu9pJq1INzO1o9FLYb8e7VtyGQ+C/14AT43TMBw82JIE9RA33MSHo5fDrIB5bfYcNzYICBcq89Gfy3W3dPO0SNxzu1YcEoWs7eXSbilTNjZgbWYWZgNcRTQ2AywPDP8AN5MaeIN9QGzswYoChUfb61ASRfv6I5rDfC5PskaHE/ZmQuzIavNp12j05q2cA+6fG771mgPBlKvM9C8FIkTemkaanD3oJAqrz8zfYv5DOvxhEvkCfxZYKnfimuiLcaw/DSN+cxFNSC+YMtc5Sg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0j/bkwNoZfKgVVmyUfzlzpMd3wIXc39Y33fSZ9G5U6w=; b=iQCJjiRfv64OhL36P2w+amPeCTOP4mgjQOe+KpPhGfqi+u7eCpnvGJteIRwPMfw6xSf32yGN0CJi7mIoZ+mL3Pr3E9Yf5cN96k9u5PE+u1DU/4CqoojKN+J1fH8QdwjfkxGVohufcnvK/yhcHbhKHhgr1JLRRXMeXgsqBK+qGZEQDgkqPss0uuBEBeLhAq2n5jpIUobvhxRKjuTSwBTm2pYoiuFcs8fPPQW7WoRV1ywZ/e2mlQihv5YA8dL7kHKXqX4azARbzDhE3SgHnePb9k1wRA+VMP4AOPU7cDd6cjd5f0ZEEBl/4j83cdGC0pK3n2RQIA/t6aL4ZlQiLfZ1vw== 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=0j/bkwNoZfKgVVmyUfzlzpMd3wIXc39Y33fSZ9G5U6w=; b=a+yWfFHD4A+F1wTauhzTsG99K+vEH4QQzfeyUFyT13moGOtFPY8cTiTlfgzT+0hg6wboc6/eTEBKKbssxmUZwNWwEQatM2mSBuVeB7WhK+5lmDKIA/eJ5WBrVZ+1uPxiQXUk6dXo39xQ2zYadVUst4Sn3Cy62EPeony+ZJ1vqINiu4IVC/bvEa5MUPmdH0iI1H1EceqrrEfC2r/E0ZxTn3KxooZ/WeHYabbuuI3biHP0kb3pu4u/3gQDKGDCMj05IJ01EOBElHOZAq7YSIak4zt64Gh+Fo/dBAcoUXmLncHpM/OXsZGFwAJ9NV/cZWUFbN6ARjhHt4nnCY9VGp87Kg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PRAP250MB0465.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:278::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Mon, 21 Nov 2022 01:07:06 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::c37:cabe:316a:60b2]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::c37:cabe:316a:60b2%4]) with mapi id 15.20.5834.011; Mon, 21 Nov 2022 01:07:06 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 21 Nov 2022 02:07:13 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [OW5mwRmvAws24jvoYIj3kDYUJsV1Vtrauj3yBv7QCdU=] X-ClientProxiedBy: FR0P281CA0075.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::10) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221121010716.2131624-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PRAP250MB0465:EE_ X-MS-Office365-Filtering-Correlation-Id: a12ead8d-9ee6-4deb-295a-08dacb5cb54c X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmo0aNP8rr9jcp/TekB2Cf+UGEm6saw4ic6CccCQ0iG3JWwn9PT30zXxahRb0ehm5iac/rkkkifk5AjNeV9J6erZqqPkZ8i1zS0NSEOcaHbXb9AGe+S/vYOpO8ytljSqiyOA2c1u0iPTIVb0UUcmyR5eL8DXn/MQyIHcqYfttp1yHNvzYiR5QwwIxVlGMPQfa+SsYgq/mrS16PthQfjCWZk3dy84oVduZoElEkG7grDsaImKMtFt5KQ3gzfUjTGBTZApSiO2Ll+n0x5nKVBIFNg3WMU2y8bafExMcCtzZjvj/eUEcQmciak6kDMALN+okpgn5GILZ1Hl12wo9ggibhingerw7km+idzDEpUE0VRTm8gtLFtHKoZ3fYj94VBTnEDfkGHt3tJ1xFNOJT/ZoNKgC0zK+EaDErjt+Ml0yUlN/qhxmVb5gKDylQswJ0F14wToPB3/t7Ps1byVNTGFlUpDIfLWGBbQczz/4HXMeHCD1E47YsEhhM9W3bS0aPfCmuHcj4kSKg2j4yby7TGjss0f+g1ff5Gfv9BWPSabrOeHs5lJAop63LvTsG2HKx+WtOXEaP0e/2B09mkxiCAzMAEUapLBo9mIWIgCTgQmicmFuV/Gdf6R1IqVSN8KalzxzbqUdj8ayTs+LirmqL2VeGpKrrLgbUAET6UF0bWF9CmrGvagei5ZSUQmWYSjkQYqY0cZaavXtfSCxm+x64fU28Ty1XEsCeuaJILo87NJPUdmOsoL+ze2MszaEy89hPeKK8Y= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uSnfwfRAPUXhhGg0c4kLiDECwgeXHCuuvbnLiJotxMRs5GDqasfANwP8XDCXdMlolpKoOkqvfX3Jira4iX1CeARVlEPISpi/V0HwZLymX6BRMZsBWHd5riv44zz5ZyG5zbUBvL7KZYldddbMfVD7C0DhGIMo1mDws5TKaGvQgSd7UiPhnuEo6aWhw1HSDTu0STp/KRbaBV5SRydFLMd9B+a3nM/TLgjaBg9ERKUopZlPz0vxqScCJSsG49QtmTUdnYg9Q+mArenX+1vkEm+3QBwcG2YjlRlaZLgTiEFY5W/uZR8IsR0WIQLpaIA+YqX7ZrY92TO2HkytTlnEz9sf5YheOehU7zRpLs1f7+bm23Jp+nzWv6ryGKs1k0I5rsUAkQem30bmxIwhBMMN8UTB1sMy0DBnCMuESSjtq3S4xtBbwu9WRi9/KOfs7MRiY2vgP+kncrIp5yUlXteVg0YDgCtWycwcu2c7yScRMG5cAigjmaIMsn/azolBAN/d7NGjir+r6XkPA9AbIm6+9Y0U6OodCnlYp7d2mVVQ04HoTI1B9+knZNzSDkZEW8yfGxpLeRkfPP0qqRakdygcHW83IvvRjQMue1z3YAYeUFB7Nvtwp3rk6fRuDMsa59o2v7Cn4U7UzRh1t6PGEvwZKRqB+w== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Hfu63X9a1lQ1bQln/eYOEKYIiagCbl0ZafGEgdFKQD+kv0dBqYAyFde8QR8YnDQteKh4MY08L0B3LA0SHD/2cxDATVyT293zsTcqVJQTUX5dStCTU2joCoeLvEmTCwY7Q9ywD363bZplsFOaxqTdlpZsEI+zAZXjYPEqTVV6AGnQHUHV/apZgvMS7KMqU0M+dJXaTPKahaj9YrmIKw7IoSeM2k89Hn8Lvgpr7Vedneucm3NnR0FZhTGsGmgYgiQr4cwXD/y4MzmXRK7AvAfUn23GYG28Opbch0CF2jwmJGbeXIW5l51I8Je8UytZHGh60J//jFTUTkf1rWFE8eKnatBIyNgtQJPd+id82YXMQFFgAFoNmvz6wSL2j4kCLeUxwNa9n9qHiVPul4SxtoBtbdvz5i1yob6rkm8Cs6ntJjIWJPFbiYGTe5gtWrk3I1/X1/omN7lOqSvx9GwN0rFp3+JtfeQp2P+ypOsLVS4HOoUT4/a679VBV2gSBUNN6xStsfeTuYFZQS24BlOr+hrwbU/yMX7ZXLmDn+9mPu9nb42SUu1rqayJjMA89AWyvtOK/z68a5gkGtdhhUKKT+7OU46yeu8QoF196JOHnQQ2zXq7kLgut241fKP/vykdDHbSAEWjTnQFDzS+HkiRs3SJweMvwJg2rvR5k2uLcycfkBNtKTLAbEEGfLUY10UCuXQTngULRLrgq8heevoe5lPkoLQdA62VVMlBCYDhChFvSzz83TkjnfeMxtGueonJZmOBBGIp/e9Srutpar19DibDWmCnVw8xfJ6aIV9TXIkI3n2J8Vyhf9XXwA2f1psAwZmLolYwhhEitUy5jm1tvmeIIPfNlr18Tc1sSftDDsADwtIqkPq2yP/Cs7/WOetaq6NQTkRO1bwmi0Y0wFgl8Rh7sUFWaTTEFpiqP543xNO/9GFKW3pXdLsKhhbRLea9+mkGLOq9U2/XnMK0yMzmLJaP0uDAZfoEMFyaziXTxcTD7jvXDx8JQo2DSksezxYkfjQovQo6QQIvaG3MkufO/86LioeCWU9T9gOeNlGEe8qxv9/payiy/RgWMkTiOqS1lY5g/Y85gYIlBW1/72zP9ckoD279A4uE0mwqfGnnmYTc5naGDHWXMEXAH2J2tJgW+jczxhkHkmr+2W5P1TWJJK/n+aIltb1iLw3Ayr9XMh/0cFYN+1gG9QUorqaVyUUtluC+0d039dN7yEM/GLFTYXJfXnLlLNGfacAezHr0yMUBHEUc60Nc57+zn19oGu6EnU0EgKqp9LpIX16Xp1LlimKwJ2cT5QNVXkAekyQijAFd42pg5JR6d47wN+MC+soE/H9Q X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a12ead8d-9ee6-4deb-295a-08dacb5cb54c X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 01:07:06.7006 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PRAP250MB0465 Subject: [FFmpeg-devel] [PATCH v2 3/6] avcodec/flashsvenc: Use const where appropriate 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: JojTHbBFRKM5 Signed-off-by: Andreas Rheinhardt --- libavcodec/flashsvenc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c index d627b12351..bd912fb401 100644 --- a/libavcodec/flashsvenc.c +++ b/libavcodec/flashsvenc.c @@ -70,15 +70,14 @@ typedef struct FlashSVContext { } FlashSVContext; static int copy_region_enc(const uint8_t *sptr, uint8_t *dptr, int dx, int dy, - int h, int w, int stride, uint8_t *pfptr) + int h, int w, int stride, const uint8_t *pfptr) { int i, j; - uint8_t *npfptr; int diff = 0; for (i = dx + h; i > dx; i--) { const uint8_t *nsptr = sptr + i * stride + dy * 3; - npfptr = pfptr + i * stride + dy * 3; + const uint8_t *npfptr = pfptr + i * stride + dy * 3; for (j = 0; j < w * 3; j++) { diff |= npfptr[j] ^ nsptr[j]; dptr[j] = nsptr[j]; @@ -128,7 +127,7 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx) static int encode_bitstream(FlashSVContext *s, const AVFrame *p, uint8_t *buf, int buf_size, int block_width, int block_height, - uint8_t *previous_frame, int *I_frame) + const uint8_t *previous_frame, int *I_frame) { PutBitContext pb; @@ -204,7 +203,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt, { FlashSVContext * const s = avctx->priv_data; const AVFrame * const p = pict; - uint8_t *pfptr; + const uint8_t *pfptr; int res; int I_frame = 0; int opt_w = 4, opt_h = 4;