From patchwork Mon Nov 7 01:49:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 39219 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp1849049pzb; Sun, 6 Nov 2022 17:49:47 -0800 (PST) X-Google-Smtp-Source: AMsMyM5IRiVCm+5zXe/e9Sp+EoZBO3zAY0OZmjYMhIcBz/aNyRvR5iOI3T+FosrA/rVf1brs8SfH X-Received: by 2002:a17:906:9bd5:b0:7ad:939d:79a9 with SMTP id de21-20020a1709069bd500b007ad939d79a9mr44963541ejc.479.1667785786888; Sun, 06 Nov 2022 17:49:46 -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 y9-20020a50e609000000b00457e9f88b90si7733328edm.246.2022.11.06.17.49.45; Sun, 06 Nov 2022 17:49:46 -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=Vm12lpv6; 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 B8C6268BA6F; Mon, 7 Nov 2022 03:49:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-oln040092066071.outbound.protection.outlook.com [40.92.66.71]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 314CF68B9F2 for ; Mon, 7 Nov 2022 03:49:40 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S9YarOTPLVo+0XddPewH/ALDevnkX5gaF709v/B4U0Dr+67T2boV3KOXTwWcPkJTaGN/N2/eWcsi5e8CKQcfceITB3rtVGGCo56Rs3stPHEgKiYf9ykA4DKAV6j1/fBXzYDjOgBqUKOmCU2MxZgDjZQHFWb5YXdYbloxTNH0JHLpJbhg46q4nlEJ+eZ5Chj4RnRKTqKVzvM6wiA9O8almU/rxiHuzRs1Fy+Xai3Fs8aND5ZYVNrfo7aLNZl5nhrcFdtd2ccKCyaggTGLcXuov7dJnMk6+Ke5+e56vtX1aszEnbwLE+M8UbVeNgBdPaLp9ePXGXlr+zzjP/LDWKc1ew== 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=iVLp76V+6WGYBtZf9wtlaTHdQg0MZkeAo+Dz5X/Jf44=; b=WSQqE/uHu4byr6R8iQ7WiReYO1RDSLOOcNddAnO136fXrjIWHPvmn55uO8YS3Y9YgrMJyDEZN/0sRLmGREqu3ADqdo5HHtBMBHncfU71x9/qfcK/qKEwqGv3vB8J3fta/V6Nt4Cd3whjaD9nGOhDgJJMGQuZ0evkkENbTWvgnGP+ZgN5z1V+SnxQeEm5RwJTMrest7unAnAD0iEq9o1kxKvQFi8KgnS944Ex1JWaOVrLskFukeYLY4NAzZlnSMSu/ulGgX92hUNR63/nwcmSTnZHdsfiJgyy2EL+0hTPHx+tABMa7yA1ohWYmiAo9uoPMoKlF0jLbanp+7S6Ow69uQ== 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=iVLp76V+6WGYBtZf9wtlaTHdQg0MZkeAo+Dz5X/Jf44=; b=Vm12lpv6vKtbF7WT7DntqY+ldJQL6W/WO/lZ7Xns9IZOiCaoyt6wU0hG34D73inV3pRWCUxFI/f1fOATYlsldqcLpMMI4r+2L9oBRuX2uUWIUIF2hsOqIboDDlPujmmBrqN4F34qVwLkaTGO/YXcIL4FtnmBkRT6WW7kJ0h9MoTgAnu6vjJGEC3MQhQwlXS3icnUuNWWo9b/QWi/jhrUX91z0127l4OmdaGj6yRDrlwTBlDpKzp4uf6BiPr1rHFRbPKvGZJ5UgQEgUc/+nJBn2ZRuMCGvB2qWU14YriWg4qhIQW5qJg06JCZQfL/z/BLOZop+Zn1T/EuNezhdi7fig== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0923.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:7a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.25; Mon, 7 Nov 2022 01:49:39 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::c323:d08c:85d0:dafe]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::c323:d08c:85d0:dafe%4]) with mapi id 15.20.5791.026; Mon, 7 Nov 2022 01:49:39 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 7 Nov 2022 02:49:21 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [g7+CfqQAXKjrvpCM1LhRZxv9N07qJTfCd8HPunHpx6c=] X-ClientProxiedBy: FR0P281CA0009.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:15::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221107014922.1503434-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0923:EE_ X-MS-Office365-Filtering-Correlation-Id: e6cd9a97-e064-487d-72f3-08dac0625541 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqxUC2t/XAH2K/2kJg/kN5yyay+y0EZg60xdXKPjsBQ7X2iR67xNTwY6p1EcOdQp/ohfngmpo1M+yn/4S6l/LUeRq8qmmIjeljx+P9iaoQD240v/b7qXgl4G/oa9XizvV6wDNOgd5+Wk+pyaOCiq7b1TFaNy25ZGv2EnvGOAoYmzljRfDVEcqgSul21IZirHkQOgL2qne5z1hcLgYdgcR8/Cno5YAdYYdPPxolQiItt+BEpKGf7MCZGk670f8zoJD85bkBW3aSwzbjiaxLcivcJbf1Sdq6tcn9Wgc3L1gY2CPftpCJ30nTuj2UoWKBY4cr5ewc3+t5rNQ+jxd0BOwjXbghMW/6tQi9+GABXKusMQ9ZN46UB63gyfAWJBi380k7GbH9gMUE9P7GpDFbncYpfamBDeF831VBHKWsNxf2p3vCQhOax5B9MhB0hO5P6L3+2KtPkBkqCPgT9ZnjCjtGUg7ZRavmG3tJm3zMSsJ6UB6LfU3uTbzmRd7pXucI0OSg1m/jAQyOCQMMqIxS58Xl7TrexjsQ50v47ohlbuf1avT24oHYZpOSwTWH0/2xA11ZEDnfXuzmFyjUixm6/rcEPDn6l/a4vAULyLj2ab8Ll2YxiW4MjJn0ekAxsl92IjnjYWaG4V+VLvgD6QovIPONLB7m5c4PuTTDicLvbBx9OjTQL3iytltkmX1EbEJHGq9Xw9neRyHy6mYZplA+WZmYukBQX/l1wLXeYHbaGgTWzh6apeWtZ//8Il4ahQkYOYeI= X-Microsoft-Antispam: BCL:0;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com X-MS-Exchange-CrossTenant-Network-Message-Id: e6cd9a97-e064-487d-72f3-08dac0625541 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2022 01:49:39.8239 (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: GV2P250MB0923 Subject: [FFmpeg-devel] [PATCH 4/5] avcodec/clearvideo: 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: 0Oen7zsbRiV/ Signed-off-by: Andreas Rheinhardt --- libavcodec/clearvideo.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 11ae6ca9ad..d3cbd71f72 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -222,14 +222,15 @@ static int decode_mb(CLVContext *c, int x, int y) return 0; } -static int copy_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, +static int copy_block(AVCodecContext *avctx, AVFrame *dst, const AVFrame *src, int plane, int x, int y, int dx, int dy, int size) { int shift = plane > 0; int sx = x + dx; int sy = y + dy; int sstride, dstride, soff, doff; - uint8_t *sbuf, *dbuf; + uint8_t *dbuf; + const uint8_t *sbuf; int i; if (x < 0 || sx < 0 || y < 0 || sy < 0 || @@ -248,7 +249,7 @@ static int copy_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, for (i = 0; i < size; i++) { uint8_t *dptr = &dbuf[doff]; - uint8_t *sptr = &sbuf[soff]; + const uint8_t *sptr = &sbuf[soff]; memcpy(dptr, sptr, size); doff += dstride; @@ -258,7 +259,7 @@ static int copy_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, return 0; } -static int copyadd_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, +static int copyadd_block(AVCodecContext *avctx, AVFrame *dst, const AVFrame *src, int plane, int x, int y, int dx, int dy, int size, int bias) { int shift = plane > 0; @@ -267,7 +268,7 @@ static int copyadd_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, int sstride = src->linesize[plane]; int dstride = dst->linesize[plane]; int soff = sx + sy * sstride; - uint8_t *sbuf = src->data[plane]; + const uint8_t *sbuf = src->data[plane]; int doff = x + y * dstride; uint8_t *dbuf = dst->data[plane]; int i, j; @@ -281,7 +282,7 @@ static int copyadd_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, for (j = 0; j < size; j++) { uint8_t *dptr = &dbuf[doff]; - uint8_t *sptr = &sbuf[soff]; + const uint8_t *sptr = &sbuf[soff]; for (i = 0; i < size; i++) { int val = sptr[i] + bias; @@ -368,7 +369,7 @@ static void mvi_update_row(MVInfo *mvi) } } -static int tile_do_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, +static int tile_do_block(AVCodecContext *avctx, AVFrame *dst, const AVFrame *src, int plane, int x, int y, int dx, int dy, int size, int bias) { int ret;