[FFmpeg-devel] [PATCH 01/10] tests/checkasm/hevc_*: Fix funtion pointer types

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed May 15 13:37:30 EEST 2024


Andreas Rheinhardt:
> Forgotten in b3bbbb14d0685c8c1fbcf8455e59c7f444290c7c.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  tests/checkasm/hevc_add_res.c |  2 +-
>  tests/checkasm/hevc_deblock.c |  6 ++++--
>  tests/checkasm/hevc_pel.c     | 28 ++++++++++++++--------------
>  tests/checkasm/hevc_sao.c     |  8 ++++----
>  4 files changed, 23 insertions(+), 21 deletions(-)
> 
> diff --git a/tests/checkasm/hevc_add_res.c b/tests/checkasm/hevc_add_res.c
> index f35e9fccd9..9dec3705c1 100644
> --- a/tests/checkasm/hevc_add_res.c
> +++ b/tests/checkasm/hevc_add_res.c
> @@ -50,7 +50,7 @@ static void compare_add_res(int size, ptrdiff_t stride, int overflow_test, int m
>      LOCAL_ALIGNED_32(uint8_t, dst0, [32 * 32 * 2]);
>      LOCAL_ALIGNED_32(uint8_t, dst1, [32 * 32 * 2]);
>  
> -    declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, int16_t *res, ptrdiff_t stride);
> +    declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, const int16_t *res, ptrdiff_t stride);
>  
>      randomize_buffers(res0, size);
>      randomize_buffers2(dst0, size, mask);
> diff --git a/tests/checkasm/hevc_deblock.c b/tests/checkasm/hevc_deblock.c
> index 04cf9d87ac..c7f4f7e9ab 100644
> --- a/tests/checkasm/hevc_deblock.c
> +++ b/tests/checkasm/hevc_deblock.c
> @@ -57,7 +57,8 @@ static void check_deblock_chroma(HEVCDSPContext *h, int bit_depth, int c)
>      LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
>      LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
>  
> -    declare_func(void, uint8_t *pix, ptrdiff_t stride, int32_t *tc, uint8_t *no_p, uint8_t *no_q);
> +    declare_func(void, uint8_t *pix, ptrdiff_t stride,
> +                 const int32_t *tc, const uint8_t *no_p, const uint8_t *no_q);
>  
>      if (check_func(c ? h->hevc_h_loop_filter_chroma_c : h->hevc_h_loop_filter_chroma,
>                           "hevc_h_loop_filter_chroma%d%s", bit_depth, c ? "_full" : ""))
> @@ -226,7 +227,8 @@ static void check_deblock_luma(HEVCDSPContext *h, int bit_depth, int c)
>      uint8_t *ptr0 = buf0 + BUF_OFFSET,
>              *ptr1 = buf1 + BUF_OFFSET;
>  
> -    declare_func(void, uint8_t *pix, ptrdiff_t stride, int beta, int32_t *tc, uint8_t *no_p, uint8_t *no_q);
> +    declare_func(void, uint8_t *pix, ptrdiff_t stride, int beta,
> +                 const int32_t *tc, const uint8_t *no_p, const uint8_t *no_q);
>      memset(buf0, 0, BUF_SIZE);
>  
>      for (int j = 0; j < 3; j++) {
> diff --git a/tests/checkasm/hevc_pel.c b/tests/checkasm/hevc_pel.c
> index ed22ec4f9d..aebdf104e6 100644
> --- a/tests/checkasm/hevc_pel.c
> +++ b/tests/checkasm/hevc_pel.c
> @@ -88,7 +88,7 @@ static void checkasm_check_hevc_qpel(void)
>  
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
> -    declare_func(void, int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
> +    declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
>                   int height, intptr_t mx, intptr_t my, int width);
>  
>      for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
> @@ -132,7 +132,7 @@ static void checkasm_check_hevc_qpel_uni(void)
>  
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
> -    declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
> +    declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
>                   int height, intptr_t mx, intptr_t my, int width);
>  
>      for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
> @@ -182,7 +182,7 @@ static void checkasm_check_hevc_qpel_uni_w(void)
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
>      const int *denom, *wx, *ox;
> -    declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
> +    declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
>                   int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
>  
>      for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
> @@ -239,8 +239,8 @@ static void checkasm_check_hevc_qpel_bi(void)
>  
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
> -    declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
> -                 int16_t *src2,
> +    declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
> +                 const int16_t *src2,
>                   int height, intptr_t mx, intptr_t my, int width);
>  
>      for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
> @@ -292,8 +292,8 @@ static void checkasm_check_hevc_qpel_bi_w(void)
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
>      const int *denom, *wx, *ox;
> -    declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
> -                 int16_t *src2,
> +    declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
> +                 const int16_t *src2,
>                   int height, int denom, int wx0, int wx1,
>                   int ox0, int ox1, intptr_t mx, intptr_t my, int width);
>  
> @@ -352,7 +352,7 @@ static void checkasm_check_hevc_epel(void)
>  
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
> -    declare_func(void, int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
> +    declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
>                   int height, intptr_t mx, intptr_t my, int width);
>  
>      for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
> @@ -396,7 +396,7 @@ static void checkasm_check_hevc_epel_uni(void)
>  
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
> -    declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
> +    declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
>                   int height, intptr_t mx, intptr_t my, int width);
>  
>      for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
> @@ -446,7 +446,7 @@ static void checkasm_check_hevc_epel_uni_w(void)
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
>      const int *denom, *wx, *ox;
> -    declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
> +    declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
>                   int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
>  
>      for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
> @@ -503,8 +503,8 @@ static void checkasm_check_hevc_epel_bi(void)
>  
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
> -    declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
> -                 int16_t *src2,
> +    declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
> +                 const int16_t *src2,
>                   int height, intptr_t mx, intptr_t my, int width);
>  
>      for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
> @@ -556,8 +556,8 @@ static void checkasm_check_hevc_epel_bi_w(void)
>      HEVCDSPContext h;
>      int size, bit_depth, i, j;
>      const int *denom, *wx, *ox;
> -    declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
> -                 int16_t *src2,
> +    declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
> +                 const int16_t *src2,
>                   int height, int denom, int wx0, int wx1,
>                   int ox0, int ox1, intptr_t mx, intptr_t my, int width);
>  
> diff --git a/tests/checkasm/hevc_sao.c b/tests/checkasm/hevc_sao.c
> index d05af9ac72..21c22b9749 100644
> --- a/tests/checkasm/hevc_sao.c
> +++ b/tests/checkasm/hevc_sao.c
> @@ -78,8 +78,8 @@ static void check_sao_band(HEVCDSPContext *h, int bit_depth)
>          int block_size = sao_size[i];
>          int prev_size = i > 0 ? sao_size[i - 1] : 0;
>          ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL;
> -        declare_func(void, uint8_t *dst, uint8_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride,
> -                     int16_t *sao_offset_val, int sao_left_class, int width, int height);
> +        declare_func(void, uint8_t *dst, const uint8_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride,
> +                     const int16_t *sao_offset_val, int sao_left_class, int width, int height);
>  
>          if (check_func(h->sao_band_filter[i], "hevc_sao_band_%d_%d", block_size, bit_depth)) {
>  
> @@ -116,8 +116,8 @@ static void check_sao_edge(HEVCDSPContext *h, int bit_depth)
>          int prev_size = i > 0 ? sao_size[i - 1] : 0;
>          ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL;
>          int offset = (AV_INPUT_BUFFER_PADDING_SIZE + PIXEL_STRIDE)*SIZEOF_PIXEL;
> -        declare_func(void, uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst,
> -                     int16_t *sao_offset_val, int eo, int width, int height);
> +        declare_func(void, uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst,
> +                     const int16_t *sao_offset_val, int eo, int width, int height);
>  
>          for (int w = prev_size + 4; w <= block_size; w += 4) {
>              randomize_buffers(src0, src1, BUF_SIZE);

Will apply this patchset tonight with the modifications necessitated by
recent changes (thanks for the heads-up, Marton).

- Andreas



More information about the ffmpeg-devel mailing list