From patchwork Sat Apr 24 11:14:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 27250 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:49c5:0:0:0:0:0 with SMTP id w188csp2034481yba; Sat, 24 Apr 2021 04:15:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx06oE1lr02sRT/yYiM03RIOZP4bP1iKTIxgPNtRHi04SrR+BR1HLLVGoc55/ZiDjyafNvx X-Received: by 2002:a05:6402:14da:: with SMTP id f26mr1324824edx.351.1619262928779; Sat, 24 Apr 2021 04:15:28 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j16si9557708edj.401.2021.04.24.04.15.28; Sat, 24 Apr 2021 04:15:28 -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=DqxRqPCD; 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 1CE7C689CC5; Sat, 24 Apr 2021 14:15:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074090.outbound.protection.outlook.com [40.92.74.90]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 684C1680074 for ; Sat, 24 Apr 2021 14:15:20 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mmMg/LPf8V/DFXgpFVPuU+U0Hft0L/AMHgPaqEc0SmdAQQtVZwWMXocqZt1LLWvVqVGfg6aDHktwSZoRqLIurlrQ/iYZ7X+z4qIB3EjiSVX7XZZg4/JK+xeUA2cvGAPYNVEfVm2udQdAor2dqJgwJ3Nna75aUvofCUv1p4OC+hiOmzIp45itzSKXAmMzdD6/LT8ch52OHfHMWa13rgq1kmufb/bSBA9r7nyKlxzu/45S0KlQqcOHf8wG+U35E7Sl0sa9DtBrpfthB9+Jxt9r/FcwV+VZy0beTWhiGA7vcUlVXVklZMMWqZEGOug7E1Ex8jbc0ynyAVdqGripIXFnoA== 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=HorHbN2lvmG76L9BmeWy2oz8toGIbbm5sNsjnv6kI/s=; b=Jt6Y02sRkwEZTjgf9Mo4nok87IA9YCUCIAjL4jh202hUmzBF6i7vr4bjfMLxlWnB9wLfZGIVUHNZGiAhpfjxssMLlrlwpX8hdaG5B1mEG78hGZvi62sRmhDXXDekKi3NFTBgz3zk9PFrQWSZm5MI67eodt1LjbH7sL/kWHRhMuHl9GBlLMTh7SdV6FvIGhQN5GDvVsDyv8N7Wo43DVpKV0rLanLYbYM4afDLfBtxNgDaQZQRc6gog8jPinVc9zQAn/br7+GJCSDJ7s8iXshKcCp2i/it4a+2IBQD99yGV3Uk28jB685saZX9kmJg+5xi5kurMLP1tMNbpAsvM+Rr3g== 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=HorHbN2lvmG76L9BmeWy2oz8toGIbbm5sNsjnv6kI/s=; b=DqxRqPCDnDt13Bk40KfubZoEPriq2GiWE0DdEdkXCHf6ndNeuCgS0kdACSn2/fdQuDWIe2wyav/2HuwSqCjDU3qxLtaf8gTzaldKM2e5D1ipJ/e9ts35nGeglz16RGKCn3VRgNCpOr11P6BgCSeonarm4S4qHVXjRo81QNlpvej3a9+tzx8xoKcMeb+eNv7kWylDTb/BAi9vTdn/yXdurTHiy6mERmz3sl8GczKTINMaA1rQ8O1KgWAfh1V+W2m+ViK3qhtuArYsqRF0qekw6iWhlHlFR8AWm8j+eezo0Rl7pFHVlDiTHIlw5ezxAfKc7VWhnytY1qay5wNMV1BFdg== Received: from HE1EUR04FT042.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::46) by HE1EUR04HT200.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::398) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Sat, 24 Apr 2021 11:15:18 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:7e0d::46) by HE1EUR04FT042.mail.protection.outlook.com (2a01:111:e400:7e0d::159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Sat, 24 Apr 2021 11:15:18 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:7F1FF28D93E18FEC7616D97A2C3F652111D48A4439AC620206822E7D0E9A8B0A; UpperCasedChecksum:BBFAA2BAA97D55A99CE3F6AD25467DC6A189A913C9A740CCF85C16D901FDB99F; SizeAsReceived:7588; 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.025; Sat, 24 Apr 2021 11:15:18 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 24 Apr 2021 13:14:35 +0200 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: X-TMN: [TIs1WkLhVo50JXdV8F8VmHsB1wIBBGd3] X-ClientProxiedBy: ZR0P278CA0160.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:41::18) To HE1PR0301MB2154.eurprd03.prod.outlook.com (2603:10a6:3:2a::22) X-Microsoft-Original-Message-ID: <20210424111446.30338-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.248.86) by ZR0P278CA0160.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:41::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Sat, 24 Apr 2021 11:15:17 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 653ba83c-b4e7-4975-2a20-08d907123e62 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiSHACczraePvIduOTLAdlimsBwclWOeIZl26ND0JD2eHcOb+FmPthLETEZU0CQnls3gMgI0PgogdeU/EZMjUcF8ui6RWMwd7NFqaAkZPtkAwMmvZYf3vOspEjHJt8zcbB+q/w71xQBZUQGA4DDYQGhyk2lDSq/kgypVU79RACGYoQOJmb5oGqeB99jJHsJtqK4YLt0Q1tNrkFOqwpzbWEz5RAVe89JHu6pqB2EAh/A4OevNwWBWWlanPSEgvS92+w6lzzKlx5FexBf229j5fmnyhP/IJJOqQ0hwojdshBB00PrzTCvAn4DDzo+7BklzNlO7mli3KpqejqYI5yztqMr1pDXIhV66Bk0SeFqv5d8pWN0myFVJdbKPr16lLY173Y9e6OTkE+JZtrwq90LegjF+Jzp1t1V0fZAsGqciCzW+Sc/BgYmF6RWUmQtCDxk2hdnh+ZRMPU7VwchaLY3LsC/fr1D8d195I7kIyx81dbEeSD1+1WM2UC3mhQCU38jJdHwFXUna7a8qCYLuKIGMC8cBoWF+PFL1a7uLlhx5UwzefaBFt/hZHhfKjrT6shMgltHx728pvU1cYM/8iAW2lygMzQhKfl90g4MYm1sR1kQrxBDpNGche+mKH6G5zjNhxEIj9QHzMgqaYhXpnVHFCI/MpWHrpE6ay/W4VQJrFlV454zm7D/eZfvU1gy974nRxiPzcdpS5v/fffTkQk0nRGELh1P36SEysuKtPIO+sEcFd3kzS9eUggGVjhXZAG4pNYQ= X-MS-TrafficTypeDiagnostic: HE1EUR04HT200: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BR+ZZEjY41mz2jmJ+eAUY7satiz0As1Tg09hsSEWBZ1PqrlWaDCt935VNGWCGAHUqqcgDQXt0sxvnmfiXdE4M7FixVycF5DWO5RptjDYbOFbOxuUbyqlbyf+7OnsMwUGOceiCv6AxpJFIJKZ24/dQugqiu+HaD59MwntaXFpRjDzBywUCRnYo3C/SDsmUwIvgUASIP08+DSRvaZjIGonBE4kFXBdMiNCglFZ0LVawSKHHg7oj41WLR7+L1WVvPkucj/mrfhXX8TQhLMQE+bWm9mTDMPf8smkycT6kjPReQLG2pwhsvJRp1lDZo6FL2wrLpPpMqhoSQuJeIxLsPn0AybD/Alzegu7QIEruowauehe8Z80s6EIhqcAG6Vvnrn+s5v3HOrthlUXabBohb0U0w== X-MS-Exchange-AntiSpam-MessageData: GI73TnE+qcISdgqifaHB+hwtr7q1MEZFjADAnS7x2c6tdHrkuMIUvtjz23snHnqffwWw6lp6J9LPxXyq8H/23gfT+nX49frfSJlNW2tQ+/rrEk/ICl63pnmyboPopY7uJdRlAP6kfscjDUVfugF2mg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 653ba83c-b4e7-4975-2a20-08d907123e62 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2021 11:15:18.8991 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT042.eop-eur04.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: HE1EUR04HT200 Subject: [FFmpeg-devel] [PATCH 03/14] avcodec/ffv1, ffv1dec: Add 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: Kriq2xKqJ1hx Content-Length: 2782 Signed-off-by: Andreas Rheinhardt --- libavcodec/ffv1.c | 4 ++-- libavcodec/ffv1.h | 4 ++-- libavcodec/ffv1dec.c | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 1c580c3b49..47bb032876 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -63,7 +63,7 @@ av_cold int ff_ffv1_common_init(AVCodecContext *avctx) return 0; } -av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) +av_cold int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1Context *fs) { int j, i; @@ -170,7 +170,7 @@ int ff_ffv1_allocate_initial_states(FFV1Context *f) return 0; } -void ff_ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs) +void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1Context *fs) { int i, j; diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h index 81cbe8757d..f5ac8090bd 100644 --- a/libavcodec/ffv1.h +++ b/libavcodec/ffv1.h @@ -142,11 +142,11 @@ typedef struct FFV1Context { } FFV1Context; int ff_ffv1_common_init(AVCodecContext *avctx); -int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs); +int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1Context *fs); int ff_ffv1_init_slices_state(FFV1Context *f); int ff_ffv1_init_slice_contexts(FFV1Context *f); int ff_ffv1_allocate_initial_states(FFV1Context *f); -void ff_ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs); +void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1Context *fs); int ff_ffv1_close(AVCodecContext *avctx); static av_always_inline int fold(int diff, int bits) diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index b3481df922..3ac2904b63 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -161,7 +161,7 @@ static int decode_plane(FFV1Context *s, uint8_t *src, return 0; } -static int decode_slice_header(FFV1Context *f, FFV1Context *fs) +static int decode_slice_header(const FFV1Context *f, FFV1Context *fs) { RangeCoder *c = &fs->c; uint8_t state[CONTEXT_SIZE]; @@ -993,7 +993,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac return buf_size; } -static void copy_fields(FFV1Context *fsdst, FFV1Context *fssrc, FFV1Context *fsrc) +static void copy_fields(FFV1Context *fsdst, const FFV1Context *fssrc, + const FFV1Context *fsrc) { fsdst->version = fsrc->version; fsdst->micro_version = fsrc->micro_version;