From patchwork Tue Jul 26 22:08:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37002 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp234607pzb; Wed, 27 Jul 2022 02:36:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sbYK0bROpIyjpse0wD0R9hXK3P0HXqbXY5yvwIJnGRTQU1DnI6pX8wB9k2UX2Ig1mEdeXH X-Received: by 2002:a05:6402:3514:b0:43b:d87c:7a99 with SMTP id b20-20020a056402351400b0043bd87c7a99mr21319413edd.43.1658914607001; Wed, 27 Jul 2022 02:36:47 -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 ht20-20020a170907609400b0072b7dab918csi19824479ejc.255.2022.07.27.02.36.46; Wed, 27 Jul 2022 02:36:46 -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=NYRziRH7; 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 D9D0068B894; Wed, 27 Jul 2022 12:33:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2098.outbound.protection.outlook.com [40.92.91.98]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D2BBA68B894 for ; Wed, 27 Jul 2022 12:32:54 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jbAVsijPFlFUcUDWYAIgxWg5xdIt46Ovx+WF++vnGRQWByMlywFDoEYT243LNrRklF+XUBWc8NETKU/jX4u19a5lkCOv/QcdXVbV1saLr7U2KnPXNxyfXHcGKjX7De1G7gW6lKvkZvgYaTcJWR9oXEncF5cDYz1mQVyhvhlZ0Fb704hmTatCQM5tLbuUUjg1dEpAvJYL5YdeLteUoHY3eJ/WQWSbvXh6kRNjO0iCIhQIbU4bD4NrrhrbKYWO0k+iCKD1WX8J6UU7ODPoj9kI5sno7TXyyr5+KaVLLGknzonpS7a6/dM97qYmJzR/fD+1eB/klEAJ6UiX/rCvlmfH5g== 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=sTUSMcy+c5lSobbH5WOO6F6cJcUZ5d7fDZGnaN+Mexo=; b=FUro+Uv/PJ8/sLGtK4+JY5+xokLaIP2yjUmc1Fa+3wuzf/fDpDnBPAtth97dZQvnLqKPahMVBTdIma9cKvPpUDm+V7qxCQw5mHOtPMr8aX6Yom3kqGzq8jhhxqWgLOvoKDn2HIm1Ui5EtzNZYTgZkJ1oCfsChjIUriZPqrvKCNY7isyecg18TfzflxSARL4TIKbJiScDhy9udn3cs1oOu4L0QLS/MmSAF5HpKkqe8E2OlblhRttmIJyuof6KlUBpgo7LEyHSw4gG1P0K2gi749ApuKBMio2FsO9baPyFgeVx38PzbqScwOM/yhvLFyZ8vz9OiPbgvgXhzGJJ9Ji/zA== 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=sTUSMcy+c5lSobbH5WOO6F6cJcUZ5d7fDZGnaN+Mexo=; b=NYRziRH73ICdKFuztkt5huLzFwfh9Si6BNH1Z3Eiaa8AvfC/RONRd3cSJCOrnWBwk00NiXrap9DjRFKag2q4GawFe8inrSAmTEzRi4KQQnz38NLVRl8RmD6nceFT2im7/LIJqp+10fYLhYLB3AkqeN4wE13NfTmjGnJ9umrBksTk+uplb0MkoEsTaBmHaq/iVAHXiSCg71nyzHIIrNeB/2auoFadNZns8hTfhT9uYjV2FRTVoNwcJgvyLtJjlJsHx0HjhotfGXNchr6EbK4aN+V5i/yNpG6qs33SliOfYu2cpfcYsdL4D7TrjDlgskRVpUDgi91n9x+TQbbz4pMiAg== Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) by HE1PR0102MB2716.eurprd01.prod.exchangelabs.com (2603:10a6:7:1f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Tue, 26 Jul 2022 22:09:55 +0000 Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::210e:b627:bcc9:8c46]) by DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::210e:b627:bcc9:8c46%11]) with mapi id 15.20.5458.025; Tue, 26 Jul 2022 22:09:55 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Jul 2022 00:08:12 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [kwLwYVTKWNBfOzcVlQGLsdnCBL9NM0Jp] X-ClientProxiedBy: FR3P281CA0157.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::13) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220726220814.695563-36-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 349afd10-e393-4bf0-5b81-08da6f539210 X-MS-Exchange-SLBlob-MailProps: q+fD6XS3/ULT2wyjUGO4RaZdS3jmh49tF3/vTDxXTR+D1Hmcg5agRWHJ0EEvPK5EUpIDdoXOV4UMLkOHROtxH2HVn0Yjgx7FtExDDm02HVh2RzmU1ybZCH2tEFmmTueUymVkEvmaX3S6jM+7k42kYCx247mQeCgGWikBvXsgezsMGPY9FBF2j29U6t075PLpuMHUtSMoLxsNnDiw7i6h+Uo41We0F6rXvsvArdwTosssvflRmjZm5hVoUaB8Rk3bbPd8VhxW7VCIIKCcSXSAKJLp9dc/9vcFvZrIYvC/Oo30DljvMS/2bpYyWqMUyNnCwWNv6NXdQPMrpiZXjD9QPI1lw3dc42y8ZyV6ulgl+Imzr2oCcMtK6nwvSOnsQfV14jOlCjzwvrss04JW+ys6d7FM5g18HI48jQfDR7HZlMNDD2KOMO6PcXITRhjYCZJ4QP0aGJ4QPbgomHazLbXYGIxhdrvkRgZOe52proq2498rPFf9PLMvevOJUDznLK4WCBDSsEPX09ds3WYky8cUNNDVrUo6Zjhb3kpwVOwcjLVzrxcVVJ1oQNq5fWWCcA/AeYRtDczzDj75umWlyQ+Ze2bbu5d0tCiJYsfl3yRCZdxh67GgOjMeZXksJHmeqbMZkrna3cHVP2JEZ2hZ+X2tNtgGF6w2d8EECJbND313tnQHz9jcQvMVyjOR/ymXyMi00VaANU1dFIhaFUg/ndvdHw== X-MS-TrafficTypeDiagnostic: HE1PR0102MB2716:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VqReVX6jBDrvkzGVxO+GZpl8FSjD6fLIMjFJhGlqeRH3dFdo3oOEnKpmoKJcgXyvtQbaO0PctiU+snh1ZpqJpKSxdCiXwU1euKQGebpJ181MIjc8BaWCB4HMrrRBDoOCB9CQ+k1In3/ygRvY9dEgf6mP2vMWrb2H9iasiV+iAWrNhkPLKgIlk+h4ubLAnk6FewjPKWs6p3XgwlkWQ0ilbUQ+ncpouqnOpwr+/gQHFzJUVw4ZiMEWr3VPQPR17N/rwGjZLK+HsS0XKmUQFrwqsJ5CcmnNXjgfTMgBo7dEj4Z3eokS26PAleKMMfG/R4oaL6rnKh3WQVvnk0yKQLMZlVcupH8sCMdlWeJ46MCuJnZfmvr2MvatkWyhykZVrjT127ENkXP/8LC2td6nRfUuMwmrDfrwF56CL3UipbAl8rsZnVbl3BgPsnSe9b90vgn6OpoOVU6u9Jv1NZ3+hDg7fY7bHAW5EP0AfpBaETgJ6PEtAqrBbU/DJpQtTCWXwu5tSmI1MuMnt2VHpNfMNJv5X6IvjU17YkHy35coEmL90tX5yuCjyOA5FnRL/tV+zBBcq+rUW0fX1Zxvcr2JSnO3TT73jOCueZs8Ian2bjlc5hcLxqP6V/6UQ69sw3oxds1IIWyN6VNi5CMf02GbKVdFSA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bORq/DivJS0yF4EGVivwuyuMKSaLAKovOWSxspen0+b/K276qT1uRDiNyqT8xrUTeQxawdNjPjppqRE1C5hTYVkXpbeVpDTrwrIThXwr/HH9+yDV9on7ACmMB1FRDo4h5ktkYAD4tTBao5GRFmKGtnmq6IGrY+1S0Nf1FOobpKP26UWgsFm7JWLAHUf3p7zlOyzzW+M1bfWgp5UEMqI9B4FtTBtkGMt08e2dPCDDvsAvJ/YWoDTWh1IG4GDuv+Us0vVZabGgufhWyzE3hS1bbOs9lq2Lzggrf6u3c6hDUjtYLwBhYdKYc904qzrgGFktW3KFcWSW46wiNQ3lcrPrDi9QxdAnExNdT+IJdUMsJzrvpR0Nrsnj/AeZmqMiD4WBq/LmGE4b4Es3XFNcUv5hRIhiStVhYtoZLXXTyCj23wkmzErVd+8+28FWoBjs8vcf/xHRd3+fC5fpzAEaUziulAVIuyP1wGt4rtfWrn+J87rhYUqUnP+xtTz5hZ88MBLK9VhwFUKpvryrAaKNSliFrjbiwRCzu7AKcU+RcJrGZvQ70HUBSRUhutV+iqA2EKEp4hj5TrCdD/IkWEkskenKBHhv3i9PTjDJLqaYeyNHdLkJHATY1w+nDtsYMJxfb+AvdL4ve/+RTDsn0QKHVwZG0AlbB2jLmJ3Ccmf3f0q986Ev5f7HFNlHJ6Vxgk07BpCbCEjK1RppFadZUAy06dY9Ke2jQt7I7jLlzIUGRz4s3p2LcNySckZ1q0uncaHYaEfFf0uxTLNRXi4vi9Ejl9/ahi+AuKaK1ms3lk7EyUawCnBmFdBJNJwVzmrnnJQ9JnvctZ2Ww4rUIa3Pf+sPDup5/CNNy2+swNpWbM6H22Edq0nBTOCDbxYYHJH/PXNDadlYHc30JweXLkuw199D/U6H84UGxNiNgaB+t+AmvATdXcrqQjrlX8M8TtFRNMSQvVum+OJut8D/WXIhSL0pV1qI65c6MJpbzTu40BrnCwsDEJVcc0031qZ/dP1YlmXyB2GSILbHMXlAEjNuF0rnZLOszcm4X1ZqMYI9k0PO0RuW1kJHz1c3b2qrnNo/HRlnMzCuxz7IF2+r2/W6gGuynjmcK+FK4AwLgc7OpUJC4NoJC6r3j9bvsoTmSJPV6PG+kldhe7qhxxQqU9EYPS/mcIx2LTW/PhdvrtL771DwnerDm2fY0QjrGZIi7jlt3JU0QqNabgItivDfcde6a72zijBgWKKGIre/z+vU9Fq0kxQyvVoGonMb26kPsSsMGnU0uf7yUGe2Tp4YltZ48cqWFTtGtnqJX3lp/uvbGz9LHKmiVns= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 349afd10-e393-4bf0-5b81-08da6f539210 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0101MB2214.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2022 22:09:55.2673 (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: HE1PR0102MB2716 Subject: [FFmpeg-devel] [PATCH 37/39] avcodec/mpegvideo_motion: Constify ff_mpv_motion 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: fwjpjIK3zT7U Also constify the corresponding code in mpegvideo.c that handles lowres. (Unfortunately, not everything that is const could be constified: ref_picture could be made const uint8_t* const* if C allowed the safe automatic conversion from uint8_t**; and pix_op, qpix_op could be made to point to const function pointers, but C's handling of const in pointers to arrays is broken.) Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo.c | 24 ++++++++++---------- libavcodec/mpegvideo.h | 2 +- libavcodec/mpegvideo_motion.c | 41 ++++++++++++++++++----------------- libavcodec/wmv2.c | 4 ++-- libavcodec/wmv2.h | 2 +- 5 files changed, 37 insertions(+), 36 deletions(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 319934a114..1405176c06 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -916,12 +916,12 @@ void ff_mpv_common_end(MpegEncContext *s) static inline int hpel_motion_lowres(MpegEncContext *s, - uint8_t *dest, uint8_t *src, + uint8_t *dest, const uint8_t *src, int field_based, int field_select, int src_x, int src_y, int width, int height, ptrdiff_t stride, int h_edge_pos, int v_edge_pos, - int w, int h, h264_chroma_mc_func *pix_op, + int w, int h, const h264_chroma_mc_func *pix_op, int motion_x, int motion_y) { const int lowres = s->avctx->lowres; @@ -969,12 +969,12 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, int field_based, int bottom_field, int field_select, - uint8_t **ref_picture, - h264_chroma_mc_func *pix_op, + uint8_t *const *ref_picture, + const h264_chroma_mc_func *pix_op, int motion_x, int motion_y, int h, int mb_y) { - uint8_t *ptr_y, *ptr_cb, *ptr_cr; + const uint8_t *ptr_y, *ptr_cb, *ptr_cr; int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, sx, sy, uvsx, uvsy; ptrdiff_t uvlinesize, linesize; const int lowres = s->avctx->lowres; @@ -1103,8 +1103,8 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, static inline void chroma_4mv_motion_lowres(MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, - h264_chroma_mc_func * pix_op, + uint8_t *const *ref_picture, + const h264_chroma_mc_func * pix_op, int mx, int my) { const int lowres = s->avctx->lowres; @@ -1115,7 +1115,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s, const int v_edge_pos = s->v_edge_pos >> lowres + 1; int emu = 0, src_x, src_y, sx, sy; ptrdiff_t offset; - uint8_t *ptr; + const uint8_t *ptr; if (s->quarter_sample) { mx /= 2; @@ -1172,8 +1172,8 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s, static inline void MPV_motion_lowres(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - int dir, uint8_t **ref_picture, - h264_chroma_mc_func *pix_op) + int dir, uint8_t *const *ref_picture, + const h264_chroma_mc_func *pix_op) { int mx, my; int mb_x, mb_y, i; @@ -1242,7 +1242,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s, break; case MV_TYPE_16X8: for (i = 0; i < 2; i++) { - uint8_t **ref2picture; + uint8_t *const *ref2picture; if (s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { @@ -1492,7 +1492,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], } if(lowres_flag){ - h264_chroma_mc_func *op_pix = s->h264chroma.put_h264_chroma_pixels_tab; + const h264_chroma_mc_func *op_pix = s->h264chroma.put_h264_chroma_pixels_tab; if (s->mv_dir & MV_DIR_FORWARD) { MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix); diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 82889a0edd..287fd38bd3 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -586,7 +586,7 @@ void ff_init_block_index(MpegEncContext *s); void ff_mpv_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16]); diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index 9a450b7c8e..fe3bfc4454 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -36,9 +36,9 @@ static void gmc1_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture) + uint8_t *const *ref_picture) { - uint8_t *ptr; + const uint8_t *ptr; int src_x, src_y, motion_x, motion_y; ptrdiff_t offset, linesize, uvlinesize; int emu = 0; @@ -133,9 +133,9 @@ static void gmc1_motion(MpegEncContext *s, static void gmc_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture) + uint8_t *const *ref_picture) { - uint8_t *ptr; + const uint8_t *ptr; int linesize, uvlinesize; const int a = s->sprite_warping_accuracy; int ox, oy; @@ -232,7 +232,7 @@ void mpeg_motion_internal(MpegEncContext *s, int field_based, int bottom_field, int field_select, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, @@ -241,7 +241,7 @@ void mpeg_motion_internal(MpegEncContext *s, int is_16x8, int mb_y) { - uint8_t *ptr_y, *ptr_cb, *ptr_cr; + const uint8_t *ptr_y, *ptr_cb, *ptr_cr; int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos, block_y_half; ptrdiff_t uvlinesize, linesize; @@ -369,7 +369,7 @@ void mpeg_motion_internal(MpegEncContext *s, /* apply one mpeg motion vector to the three components */ static void mpeg_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - int field_select, uint8_t **ref_picture, + int field_select, uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h, int is_16x8, int mb_y) { @@ -388,7 +388,7 @@ static void mpeg_motion(MpegEncContext *s, static void mpeg_motion_field(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int bottom_field, int field_select, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h, int mb_y) { @@ -489,12 +489,12 @@ static inline void qpel_motion(MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, int field_based, int bottom_field, - int field_select, uint8_t **ref_picture, + int field_select, uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16], int motion_x, int motion_y, int h) { - uint8_t *ptr_y, *ptr_cb, *ptr_cr; + const uint8_t *ptr_y, *ptr_cb, *ptr_cr; int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos; ptrdiff_t linesize, uvlinesize; @@ -593,11 +593,11 @@ static inline void qpel_motion(MpegEncContext *s, */ static void chroma_4mv_motion(MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func *pix_op, int mx, int my) { - uint8_t *ptr; + const uint8_t *ptr; int src_x, src_y, dxy, emu = 0; ptrdiff_t offset; @@ -643,7 +643,7 @@ static void chroma_4mv_motion(MpegEncContext *s, pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8); } -static inline void prefetch_motion(MpegEncContext *s, uint8_t **pix, int dir) +static inline void prefetch_motion(MpegEncContext *s, uint8_t *const *pix, int dir) { /* fetch pixels for estimated mv 4 macroblocks ahead * optimized for 64byte cache lines */ @@ -661,11 +661,11 @@ static inline void apply_obmc(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4]) { LOCAL_ALIGNED_8(int16_t, mv_cache, [4], [4][2]); - Picture *cur_frame = &s->current_picture; + const Picture *cur_frame = &s->current_picture; int mb_x = s->mb_x; int mb_y = s->mb_y; const int xy = mb_x + mb_y * s->mb_stride; @@ -749,7 +749,7 @@ static inline void apply_8x8(MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, int dir, - uint8_t **ref_picture, + uint8_t *const *ref_picture, qpel_mc_func (*qpix_op)[16], op_pixels_func (*pix_op)[4]) { @@ -757,7 +757,8 @@ static inline void apply_8x8(MpegEncContext *s, int i; int mb_x = s->mb_x; int mb_y = s->mb_y; - uint8_t *ptr, *dest; + uint8_t *dest; + const uint8_t *ptr; mx = 0; my = 0; @@ -833,7 +834,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, int dir, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16], int is_mpeg12) @@ -912,7 +913,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, case MV_TYPE_16X8: if (CONFIG_SMALL || is_mpeg12) { for (i = 0; i < 2; i++) { - uint8_t **ref2picture; + uint8_t *const *ref2picture; if ((s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == AV_PICTURE_TYPE_B || s->first_field) && @@ -974,7 +975,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, void ff_mpv_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16]) { diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c index 8d1d117dea..5fea009e12 100644 --- a/libavcodec/wmv2.c +++ b/libavcodec/wmv2.c @@ -49,11 +49,11 @@ av_cold void ff_wmv2_common_init(MpegEncContext *s) void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, op_pixels_func (*pix_op)[4], + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h) { WMV2Context *const w = s->private_ctx; - uint8_t *ptr; + const uint8_t *ptr; int dxy, mx, my, src_x, src_y, v_edge_pos; ptrdiff_t offset, linesize, uvlinesize; int emu = 0; diff --git a/libavcodec/wmv2.h b/libavcodec/wmv2.h index cdd58cf011..e49b81cdfb 100644 --- a/libavcodec/wmv2.h +++ b/libavcodec/wmv2.h @@ -39,7 +39,7 @@ void ff_wmv2_common_init(MpegEncContext *s); void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, op_pixels_func (*pix_op)[4], + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h);