From patchwork Tue Feb 1 13:06:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 34023 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp610669iov; Tue, 1 Feb 2022 05:20:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjKALExhuA5LVH2e1HsXjxZB2TLnV1kzzxQjoMbVhVPXCE3PqxJprqp3UuzTW6RIODEvNA X-Received: by 2002:a17:906:6a20:: with SMTP id qw32mr20477386ejc.40.1643721618222; Tue, 01 Feb 2022 05:20:18 -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 i16si9429535ejo.352.2022.02.01.05.20.17; Tue, 01 Feb 2022 05:20:18 -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=YqeVNdz6; 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 8E9D068B41F; Tue, 1 Feb 2022 15:08:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2064.outbound.protection.outlook.com [40.92.91.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4033E68B3AD for ; Tue, 1 Feb 2022 15:08:41 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Efd4SYaIF341dpZwZIb+WXUdQNcWdKKRIz4EPtibiX15r1AdhA7euk+6SuDu5zfJgny6qTwVN0Nvdta0BIbTEaFikPvMc9g+49+4pcvb1odh7utfk9L6nY1oatvb6DfP6gBFXvm5mpTRjppyWrqem6nXdJE0MbJW4dFraixefc6+O7ieUsgG9CHaskwrh4ZxCC0Bvk0PasLqK2iAcHeiemoMN1z4Ect5nGYUnuuYDdwVzy1bXXKBYmKgJSzSE4+P7b+p/BxK0y41xMSTTJVnmzKzngtEliBlFvNUdBnvveXrAMUnhj1XA6ikbnFjBiP+xs874H5wxy2C9OPZGRfRSA== 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=+iCAUxHVpd0+1DqO+wxVvU/7W4uhPW50BmdIGcNw+3E=; b=H3EZSWejmRUOL2T10fzy876Xvz4Agfi/PSB+VOnQcY9c2oejGn8MXZrizmzmi6x9qHxEVE9OMN9qEW6UsIgqdilMoytmJTY36nOb1Jxt0Mq3OMPtm0kZqwc0pYtjgHgJ3pshoAUcHmNK5NMTZtdyqYvRSyG8z/MyJ7dPxEP6JlZykHBNxcDp2sNXu+6+MKoKjgDrKXuqZbLU515Q40B/iL3NP2N25l3f2w6Peb95Ytliys/owOfeNRztssH6dJbxbaAL9VecRjBUkPkh8J2nh8r5nSE97TsJ7SFM/+SG74GQbix7w/hQiXZtjH8isDVQpnulbQzkE1Hn1/YJM8gH6Q== 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=+iCAUxHVpd0+1DqO+wxVvU/7W4uhPW50BmdIGcNw+3E=; b=YqeVNdz6p1jAiXk8/AfgcIhZ8WWhqOdNwdI6kPLPV/KfSiFp738dugMW0vdph5AvI7Sauc6f/sg65TA8+EaqNbGBjoDk6l5/0zElxGjCHNQfNF3VxLU24SZ5Q2hGAVqhjWtnaTkJ6W0Tw09sfs5wFeZYQNFZlUJftRLX1R8VsxIzIQERdQtaIdXiegWrKkkkgkg+TgdYWFWsbpH2iHd2n01qnqZHYga6X4WyYRhNRnv9josZCUw8Jt4+jc66rT2sg0nwuNBCXoe4HkTQWafizapB03qlGhWiHliLZyPwW8a+6HklxOgviRvz65NfKsATRs5iisQ6NgaOMms5E/AGsg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM9PR03MB7962.eurprd03.prod.outlook.com (2603:10a6:20b:439::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.22; Tue, 1 Feb 2022 13:08:40 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22%6]) with mapi id 15.20.4951.011; Tue, 1 Feb 2022 13:08:40 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Feb 2022 14:06:51 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [j5cBT5iPEtR3gxqFOe+x/mv0z0NvV71z] X-ClientProxiedBy: AM6P195CA0092.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::33) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20220201130706.1420875-53-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 498c0b61-9318-4f63-55d4-08d9e583f612 X-MS-TrafficTypeDiagnostic: AM9PR03MB7962:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ISQujYocKM8ceq6su0zvXaYNGQfmhtADkiNSid22H+FKyZeZHZ2NoJAG55xbLs+ZCTBCx65v/cW7wMqNoc8W8CAPFTM/1jPXV4MPJKh31ZDDRih0Kp7Ge0ICINGXlow88w/W1UNxpK5bpqVpgZYUhsNnjyhn7ty2HaoZgRoA5zkLD78hQVg4BcdbcSyyyiarDXgumoErodyF8L56Yw54Gr6vg5tzoxrNaqE3J1J7iJzmIjaRMCrZJdZP/h0rUTNw+WdujprOxvptE5M5HmNMytR6oJxKb9MGTg1GzABmTMLWqGv8kXmUHnM0VgaF83g0NDB9Y60CSx6PyHwcaoy0sv2crCLAoLz3IawNblyA+1vwpra1lkXIXAQtQ909TVGYoYsb4MGDAapTtRJLd5ms1/NVx7cah0Q/gmAe+KPoeoh/Jj7oAe7YtUyg8wVE+FuCyLlNX6Wlaf4dgpJkavbd8kXAcYXoWNxi+2Hn+K9GvE5IlgnSwp4lY9Bg5IMJImGbv0NayK73Dkkv2uXpFpWoNySbwoUwqmkpdCAQYsij2AfPF+Vdz6RUqWjVHhzzMRS5 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MP0CCrHKFWidQkq/V3lTWDtgJguMwTzT0SPOekth4BX4G7heXzFkJmnk2fhFD+cchQnPFRStPWzAZgNMY2UqreZkEJGtm/8UjFSrbyxozvzRPoNybiV96br62vZ011hOptVR4C49Dw4MofoQHjWFzZUOTS+pt/BdchJHHO65GJsqa6g3VKcrmW62rJQ9wsCRDbyhYGPQsLieY4SrsR9W+hwRMdpD4NpLI0v0NNWdupH8ePPsM5YewjAnkCJGh2qPp+3iGEYrTQTNGV32/zwLCTCeXBrXkez4L0gefvqdqTvBSvk5wDsoG2hHPHf6BYRLYadeegXCuKMVc0/bHxBeLla7N4Ag9dxFNJG/rf/ViAv3ne4Ida3onMr/PiDH/zV17CRAjpONS0lRhaLNpG0Ute8xisBJ3rx51vkLFXlKExUhBzresDU0l044g6aCwnkbJlyxQ0X521cQZCNzzoElgfZzpl0ysVDJno2tShY7uMtMYFLCNDFJ5B98YZ809Z6yF4++e50cAuBeLktTyUXBmjSUp/6wibCoMnodYSbT/EetBHCjYB4E3ycPTW/gzLqQyoETT7aNGr8TAxYQ8XkA9tLniyuDKVCIWhFOaWyGWYe6w1D04SQB2VPqpAbc4fMnnZREoqpCd//+ESzR5qkl0l90pr71fqewGiIa0bv4ikyikMYMVU2T91kwXu2T943m2+jGTC+6fxRojwxCnYzPLh08mmKaqE0bRnVofdZZloU6TudiGpWe99PWPmf0Vd5OovbNqLVAU7Jm/FMVyUQ0uyLhViNGgDikjdgfuErhIHHoEy2tuWr47/ODESGbhiEHXuGlsvyMqf0C2gi9u4feJIXGdOqhNwos/kws96xAB4gTisPGhHQr+0HfyVgWbCNi3HaONo/UpwDnINP9wlumQlr7MWjPPjptj66zta6v2WA4Lf7KGQRkJTWe665VR+SFh3v9Ikw9bsWEmHw+cBLdRQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 498c0b61-9318-4f63-55d4-08d9e583f612 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2022 13:08:38.2445 (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: AM9PR03MB7962 Subject: [FFmpeg-devel] [PATCH v2 54/69] avcodec/motion_est: Constify mv-table parameters where possible 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: v3a3RAIy8loO Signed-off-by: Andreas Rheinhardt --- libavcodec/motion_est.c | 2 +- libavcodec/motion_est.h | 6 +++--- libavcodec/motion_est_template.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index cc305d06ff..3df1e4f40a 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -1595,7 +1595,7 @@ void ff_estimate_b_frame_motion(MPVEncContext *s, } /* find best f_code for ME which do unlimited searches */ -int ff_get_best_fcode(MPVEncContext *s, int16_t (*mv_table)[2], int type) +int ff_get_best_fcode(MPVEncContext *s, const int16_t (*mv_table)[2], int type) { if (s->motion_est != FF_ME_ZERO) { int score[8]; diff --git a/libavcodec/motion_est.h b/libavcodec/motion_est.h index b52b91ab3f..01ca14f9a9 100644 --- a/libavcodec/motion_est.h +++ b/libavcodec/motion_est.h @@ -119,14 +119,14 @@ int ff_pre_estimate_p_frame_motion(struct MPVEncContext *s, int ff_epzs_motion_search(struct MPVEncContext *s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, - int16_t (*last_mv)[2], int ref_mv_scale, int size, - int h); + const int16_t (*last_mv)[2], int ref_mv_scale, + int size, int h); int ff_get_mb_score(struct MPVEncContext *s, int mx, int my, int src_index, int ref_index, int size, int h, int add_rate); int ff_get_best_fcode(struct MPVEncContext *s, - int16_t (*mv_table)[2], int type); + const int16_t (*mv_table)[2], int type); void ff_fix_long_p_mvs(struct MPVEncContext *s, int type); void ff_fix_long_mvs(struct MPVEncContext *s, uint8_t *field_select_table, diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c index fc887b05b7..a8525afc6f 100644 --- a/libavcodec/motion_est_template.c +++ b/libavcodec/motion_est_template.c @@ -858,7 +858,7 @@ static av_always_inline int diamond_search(MPVEncContext *s, int *best, int dmin optimal mv. */ static av_always_inline int epzs_motion_search_internal(MPVEncContext *s, int *mx_ptr, int *my_ptr, - int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], + int P[10][2], int src_index, int ref_index, const int16_t (*last_mv)[2], int ref_mv_scale, int flags, int size, int h) { MotionEstContext * const c= &s->me; @@ -976,7 +976,7 @@ static av_always_inline int epzs_motion_search_internal(MPVEncContext *s, int *m //this function is dedicated to the brain damaged gcc int ff_epzs_motion_search(MPVEncContext *s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, - int16_t (*last_mv)[2], int ref_mv_scale, + const int16_t (*last_mv)[2], int ref_mv_scale, int size, int h) { MotionEstContext * const c= &s->me; @@ -992,7 +992,7 @@ int ff_epzs_motion_search(MPVEncContext *s, int *mx_ptr, int *my_ptr, static int epzs_motion_search2(MPVEncContext *s, int *mx_ptr, int *my_ptr, int P[10][2], - int src_index, int ref_index, int16_t (*last_mv)[2], + int src_index, int ref_index, const int16_t (*last_mv)[2], int ref_mv_scale, const int size) { MotionEstContext * const c= &s->me;