From 8b856a9e535de06df96588fb566b8d629e128580 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 31 Jan 2022 01:03:04 +0100 Subject: [PATCH] avcodec/motion_est: Constify mv-table parameters where possible 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 a191fd06ba..87f197ce8d 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -1594,7 +1594,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s, } /* find best f_code for ME which do unlimited searches */ -int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type) +int ff_get_best_fcode(MpegEncContext * 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 5742e51486..d0950bf7e6 100644 --- a/libavcodec/motion_est.h +++ b/libavcodec/motion_est.h @@ -118,14 +118,14 @@ int ff_pre_estimate_p_frame_motion(struct MpegEncContext *s, int ff_epzs_motion_search(struct MpegEncContext *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 MpegEncContext *s, int mx, int my, int src_index, int ref_index, int size, int h, int add_rate); int ff_get_best_fcode(struct MpegEncContext *s, - int16_t (*mv_table)[2], int type); + const int16_t (*mv_table)[2], int type); void ff_fix_long_p_mvs(struct MpegEncContext *s, int type); void ff_fix_long_mvs(struct MpegEncContext *s, uint8_t *field_select_table, diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c index 6ab0ea13dc..f3e94b7ebb 100644 --- a/libavcodec/motion_est_template.c +++ b/libavcodec/motion_est_template.c @@ -858,7 +858,7 @@ static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dm optimal mv. */ static av_always_inline int epzs_motion_search_internal(MpegEncContext * 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(MpegEncContext * s, int //this function is dedicated to the brain damaged gcc int ff_epzs_motion_search(MpegEncContext *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(MpegEncContext *s, int *mx_ptr, int *my_ptr, static int epzs_motion_search2(MpegEncContext * 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;