[FFmpeg-cvslog] swscale/internal: constify SwsFunc

Niklas Haas git at videolan.org
Mon Oct 7 20:52:28 EEST 2024


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Wed Oct  2 15:37:10 2024 +0200| [c1a0e657638f7007dcc807a2d985c22631fcd6d3] | committer: Niklas Haas

swscale/internal: constify SwsFunc

I want to move away from having random leaf processing functions mutate
plane pointers, and while we're at it, we might as well make the strides
and tables const as well.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git at haasn.dev>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c1a0e657638f7007dcc807a2d985c22631fcd6d3
---

 libswscale/aarch64/swscale_unscaled.c |  34 ++---
 libswscale/alphablend.c               |   6 +-
 libswscale/arm/swscale_unscaled.c     |  26 ++--
 libswscale/bayer_template.c           |   4 +-
 libswscale/loongarch/yuv2rgb_lasx.c   |  12 +-
 libswscale/loongarch/yuv2rgb_lsx.c    |  12 +-
 libswscale/ppc/yuv2rgb_altivec.c      |  12 +-
 libswscale/rgb2rgb.c                  |   2 +-
 libswscale/rgb2rgb.h                  |   4 +-
 libswscale/rgb2rgb_template.c         |   2 +-
 libswscale/swscale_internal.h         |  12 +-
 libswscale/swscale_unscaled.c         | 242 +++++++++++++++++-----------------
 libswscale/x86/yuv2rgb.c              |  54 ++++----
 libswscale/yuv2rgb.c                  |   6 +-
 14 files changed, 220 insertions(+), 208 deletions(-)

diff --git a/libswscale/aarch64/swscale_unscaled.c b/libswscale/aarch64/swscale_unscaled.c
index 9dfccc0fdb..294411a726 100644
--- a/libswscale/aarch64/swscale_unscaled.c
+++ b/libswscale/aarch64/swscale_unscaled.c
@@ -37,9 +37,10 @@ int ff_##ifmt##_to_##ofmt##_neon(int w, int h,
                                  int y_offset,                                              \
                                  int y_coeff);                                              \
                                                                                             \
-static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[],             \
-                                           int srcStride[], int srcSliceY, int srcSliceH,   \
-                                           uint8_t *dst[], int dstStride[]) {               \
+static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *const src[],       \
+                                           const int srcStride[], int srcSliceY,            \
+                                           int srcSliceH, uint8_t *const dst[],             \
+                                           const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
     return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                 \
@@ -64,9 +65,10 @@ int ff_##ifmt##_to_##ofmt##_neon(int w, int h,
                                  uint8_t *dst1, int linesize1,                              \
                                  uint8_t *dst2, int linesize2);                             \
                                                                                             \
-static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[],             \
-                                           int srcStride[], int srcSliceY, int srcSliceH,   \
-                                           uint8_t *dst[], int dstStride[]) {               \
+static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *const src[],       \
+                                           const int srcStride[], int srcSliceY,            \
+                                           int srcSliceH, uint8_t *const dst[],             \
+                                           const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
     return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                 \
@@ -100,9 +102,10 @@ int ff_##ifmt##_to_##ofmt##_neon(int w, int h,
                                  int y_offset,                                              \
                                  int y_coeff);                                              \
                                                                                             \
-static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[],             \
-                                           int srcStride[], int srcSliceY, int srcSliceH,   \
-                                           uint8_t *dst[], int dstStride[]) {               \
+static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *const src[],       \
+                                           const int srcStride[], int srcSliceY,            \
+                                           int srcSliceH, uint8_t *const dst[],             \
+                                           const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
     return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                 \
@@ -124,9 +127,10 @@ int ff_##ifmt##_to_##ofmt##_neon(int w, int h,
                                  uint8_t *dst1, int linesize1,                              \
                                  uint8_t *dst2, int linesize2);                             \
                                                                                             \
-static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[],             \
-                                           int srcStride[], int srcSliceY, int srcSliceH,   \
-                                           uint8_t *dst[], int dstStride[]) {               \
+static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *const src[],       \
+                                           const int srcStride[], int srcSliceY,            \
+                                           int srcSliceH, uint8_t *const dst[],             \
+                                           const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
     return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                 \
@@ -144,9 +148,9 @@ void ff_nv24_to_yuv420p_chroma_neon(uint8_t *dst1, int dstStride1,
                                     const uint8_t *src, int srcStride,
                                     int w, int h);
 
-static int nv24_to_yuv420p_neon_wrapper(SwsContext *c, const uint8_t *src[],
-                                        int srcStride[], int srcSliceY, int srcSliceH,
-                                        uint8_t *dst[], int dstStride[])
+static int nv24_to_yuv420p_neon_wrapper(SwsContext *c, const uint8_t *const src[],
+                                        const int srcStride[], int srcSliceY, int srcSliceH,
+                                        const uint8_t *dst[], const int dstStride[])
 {
     uint8_t *dst1 = dst[1] + dstStride[1] * srcSliceY / 2;
     uint8_t *dst2 = dst[2] + dstStride[2] * srcSliceY / 2;
diff --git a/libswscale/alphablend.c b/libswscale/alphablend.c
index b5967c889b..8993a5bcd0 100644
--- a/libswscale/alphablend.c
+++ b/libswscale/alphablend.c
@@ -20,9 +20,9 @@
 
 #include "swscale_internal.h"
 
-int ff_sws_alphablendaway(SwsContext *c, const uint8_t *src[],
-                          int srcStride[], int srcSliceY, int srcSliceH,
-                          uint8_t *dst[], int dstStride[])
+int ff_sws_alphablendaway(SwsContext *c, const uint8_t *const src[],
+                          const int srcStride[], int srcSliceY, int srcSliceH,
+                          uint8_t *const dst[], const int dstStride[])
 {
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
     int nb_components = desc->nb_components;
diff --git a/libswscale/arm/swscale_unscaled.c b/libswscale/arm/swscale_unscaled.c
index 910610b86e..10216aaa4c 100644
--- a/libswscale/arm/swscale_unscaled.c
+++ b/libswscale/arm/swscale_unscaled.c
@@ -34,9 +34,9 @@ extern void rgbx_to_nv12_neon_16(const uint8_t *src, uint8_t *y, uint8_t *chroma
                 int y_stride, int c_stride, int src_stride,
                 int32_t coeff_tbl[9]);
 
-static int rgbx_to_nv12_neon_32_wrapper(SwsContext *context, const uint8_t *src[],
-                        int srcStride[], int srcSliceY, int srcSliceH,
-                        uint8_t *dst[], int dstStride[]) {
+static int rgbx_to_nv12_neon_32_wrapper(SwsContext *context, const uint8_t *const src[],
+                        const int srcStride[], int srcSliceY, int srcSliceH,
+                        uint8_t *const dst[], const int dstStride[]) {
 
     rgbx_to_nv12_neon_32(src[0] + srcSliceY * srcStride[0],
             dst[0] + srcSliceY * dstStride[0],
@@ -48,9 +48,9 @@ static int rgbx_to_nv12_neon_32_wrapper(SwsContext *context, const uint8_t *src[
     return 0;
 }
 
-static int rgbx_to_nv12_neon_16_wrapper(SwsContext *context, const uint8_t *src[],
-                        int srcStride[], int srcSliceY, int srcSliceH,
-                        uint8_t *dst[], int dstStride[]) {
+static int rgbx_to_nv12_neon_16_wrapper(SwsContext *context, const uint8_t *const src[],
+                        const int srcStride[], int srcSliceY, int srcSliceH,
+                        uint8_t *const dst[], int dstStride[]) {
 
     rgbx_to_nv12_neon_16(src[0] + srcSliceY * srcStride[0],
             dst[0] + srcSliceY * dstStride[0],
@@ -78,9 +78,10 @@ int ff_##ifmt##_to_##ofmt##_neon(int w, int h,
                                  int y_offset,                                              \
                                  int y_coeff);                                              \
                                                                                             \
-static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[],             \
-                                           int srcStride[], int srcSliceY, int srcSliceH,   \
-                                           uint8_t *dst[], int dstStride[]) {               \
+static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *const src[],       \
+                                           const int srcStride[], int srcSliceY,            \
+                                           int srcSliceH, uint8_t *const dst[],             \
+                                           const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
     ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                        \
@@ -113,9 +114,10 @@ int ff_##ifmt##_to_##ofmt##_neon(int w, int h,
                                  int y_offset,                                              \
                                  int y_coeff);                                              \
                                                                                             \
-static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[],             \
-                                           int srcStride[], int srcSliceY, int srcSliceH,   \
-                                           uint8_t *dst[], int dstStride[]) {               \
+static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *const src[],       \
+                                           const int srcStride[], int srcSliceY,            \
+                                           int srcSliceH, uint8_t *const dst[],             \
+                                           const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
     ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                        \
diff --git a/libswscale/bayer_template.c b/libswscale/bayer_template.c
index 46b5a4984d..14bbe93935 100644
--- a/libswscale/bayer_template.c
+++ b/libswscale/bayer_template.c
@@ -253,7 +253,7 @@ static void BAYER_RENAME(rgb48_interpolate)(const uint8_t *src, int src_stride,
     }
 }
 
-static void BAYER_RENAME(yv12_copy)(const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv)
+static void BAYER_RENAME(yv12_copy)(const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, const int32_t *rgb2yuv)
 {
     uint8_t dst[12];
     const int dst_stride = 6;
@@ -268,7 +268,7 @@ static void BAYER_RENAME(yv12_copy)(const uint8_t *src, int src_stride, uint8_t
     }
 }
 
-static void BAYER_RENAME(yv12_interpolate)(const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv)
+static void BAYER_RENAME(yv12_interpolate)(const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, const int32_t *rgb2yuv)
 {
     uint8_t dst[12];
     const int dst_stride = 6;
diff --git a/libswscale/loongarch/yuv2rgb_lasx.c b/libswscale/loongarch/yuv2rgb_lasx.c
index 0ce553005a..8bf6a7955a 100644
--- a/libswscale/loongarch/yuv2rgb_lasx.c
+++ b/libswscale/loongarch/yuv2rgb_lasx.c
@@ -160,9 +160,9 @@
 }
 
 #define YUV2RGBFUNC(func_name, dst_type, alpha)                                     \
-           int func_name(SwsContext *c, const uint8_t *src[],                       \
-                         int srcStride[], int srcSliceY, int srcSliceH,             \
-                         uint8_t *dst[], int dstStride[])                           \
+           int func_name(SwsContext *c, const uint8_t *const src[],                 \
+                         const int srcStride[], int srcSliceY, int srcSliceH,       \
+                         uint8_t *const dst[], const int dstStride[])               \
 {                                                                                   \
     int x, y, h_size, vshift, res;                                                  \
     __m256i m_y1, m_y2, m_u, m_v;                                                   \
@@ -188,9 +188,9 @@
         for(x = 0; x < h_size; x++) {                                               \
 
 #define YUV2RGBFUNC32(func_name, dst_type, alpha)                                   \
-           int func_name(SwsContext *c, const uint8_t *src[],                       \
-                         int srcStride[], int srcSliceY, int srcSliceH,             \
-                         uint8_t *dst[], int dstStride[])                           \
+           int func_name(SwsContext *c, const uint8_t *const src[],                 \
+                         const int srcStride[], int srcSliceY, int srcSliceH,       \
+                         uint8_t *const dst[], const int dstStride[])               \
 {                                                                                   \
     int x, y, h_size, vshift, res;                                                  \
     __m256i m_y1, m_y2, m_u, m_v;                                                   \
diff --git a/libswscale/loongarch/yuv2rgb_lsx.c b/libswscale/loongarch/yuv2rgb_lsx.c
index 11cd2f79d9..31f22a764f 100644
--- a/libswscale/loongarch/yuv2rgb_lsx.c
+++ b/libswscale/loongarch/yuv2rgb_lsx.c
@@ -113,9 +113,9 @@
 }
 
 #define YUV2RGBFUNC(func_name, dst_type, alpha)                                     \
-           int func_name(SwsContext *c, const uint8_t *src[],                       \
-                         int srcStride[], int srcSliceY, int srcSliceH,             \
-                         uint8_t *dst[], int dstStride[])                           \
+           int func_name(SwsContext *c, const uint8_t *const src[],                 \
+                         const int srcStride[], int srcSliceY, int srcSliceH,       \
+                         uint8_t *const dst[], const int dstStride[])               \
 {                                                                                   \
     int x, y, h_size, vshift, res;                                                  \
     __m128i m_y1, m_y2, m_u, m_v;                                                   \
@@ -142,9 +142,9 @@
         for(x = 0; x < h_size; x++) {                                               \
 
 #define YUV2RGBFUNC32(func_name, dst_type, alpha)                                   \
-           int func_name(SwsContext *c, const uint8_t *src[],                       \
-                         int srcStride[], int srcSliceY, int srcSliceH,             \
-                         uint8_t *dst[], int dstStride[])                           \
+           int func_name(SwsContext *c, const uint8_t *const src[],                 \
+                         const int srcStride[], int srcSliceY, int srcSliceH,       \
+                         uint8_t *const dst[], const int dstStride[])               \
 {                                                                                   \
     int x, y, h_size, vshift, res;                                                  \
     __m128i m_y1, m_y2, m_u, m_v;                                                   \
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..3ba6461dfb 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -295,9 +295,9 @@ static inline vector unsigned char vec_xl(signed long long offset, const ubyte *
 #endif /* !HAVE_VSX */
 
 #define DEFCSP420_CVT(name, out_pixels)                                       \
-static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
-                            int *instrides, int srcSliceY, int srcSliceH,     \
-                            unsigned char **oplanes, int *outstrides)         \
+static int altivec_ ## name(SwsContext *c, const unsigned char *const *in,    \
+                            const int *instrides, int srcSliceY, int srcSliceH,   \
+                            unsigned char *const *oplanes, const int *outstrides) \
 {                                                                             \
     int w = c->srcW;                                                          \
     int h = srcSliceH;                                                        \
@@ -471,9 +471,9 @@ static const vector unsigned char
 /*
  * this is so I can play live CCIR raw video
  */
-static int altivec_uyvy_rgb32(SwsContext *c, const unsigned char **in,
-                              int *instrides, int srcSliceY, int srcSliceH,
-                              unsigned char **oplanes, int *outstrides)
+static int altivec_uyvy_rgb32(SwsContext *c, const unsigned char *const *in,
+                              const int *instrides, int srcSliceY, int srcSliceH,
+                              unsigned char *const *oplanes, const int *outstrides)
 {
     int w = c->srcW;
     int h = srcSliceH;
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index e98fdac8ea..2750a29cea 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -82,7 +82,7 @@ void (*ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst,
                        uint8_t *udst, uint8_t *vdst,
                        int width, int height,
                        int lumStride, int chromStride, int srcStride,
-                       int32_t *rgb2yuv);
+                       const int32_t *rgb2yuv);
 void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height,
                  int srcStride, int dstStride);
 void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
diff --git a/libswscale/rgb2rgb.h b/libswscale/rgb2rgb.h
index e3b0883901..e4af7c7b6e 100644
--- a/libswscale/rgb2rgb.h
+++ b/libswscale/rgb2rgb.h
@@ -78,7 +78,7 @@ void    rgb12to15(const uint8_t *src, uint8_t *dst, int src_size);
 
 void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
                       uint8_t *vdst, int width, int height, int lumStride,
-                      int chromStride, int srcStride, int32_t *rgb2yuv);
+                      int chromStride, int srcStride, const int32_t *rgb2yuv);
 
 /**
  * Height should be a multiple of 2 and width should be a multiple of 16.
@@ -125,7 +125,7 @@ extern void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uin
 extern void (*ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
                               int width, int height,
                               int lumStride, int chromStride, int srcStride,
-                              int32_t *rgb2yuv);
+                              const int32_t *rgb2yuv);
 extern void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height,
                         int srcStride, int dstStride);
 
diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
index 32d90d44fe..197450169a 100644
--- a/libswscale/rgb2rgb_template.c
+++ b/libswscale/rgb2rgb_template.c
@@ -645,7 +645,7 @@ static inline void uyvytoyv12_c(const uint8_t *src, uint8_t *ydst,
  */
 void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
                    uint8_t *vdst, int width, int height, int lumStride,
-                   int chromStride, int srcStride, int32_t *rgb2yuv)
+                   int chromStride, int srcStride, const int32_t *rgb2yuv)
 {
     int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
     int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index b8d198a9f4..77a70d4d30 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -96,9 +96,9 @@ typedef struct RangeList {
 
 int ff_range_add(RangeList *r, unsigned int start, unsigned int len);
 
-typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t *src[],
-                       int srcStride[], int srcSliceY, int srcSliceH,
-                       uint8_t *dst[], int dstStride[]);
+typedef int (*SwsFunc)(struct SwsContext *c, const uint8_t *const src[],
+                       const int srcStride[], int srcSliceY, int srcSliceH,
+                       uint8_t *const dst[], const int dstStride[]);
 
 /**
  * Write one line of horizontally scaled data to planar output
@@ -1005,9 +1005,9 @@ void ff_hcscale_fast_mmxext(SwsContext *c, int16_t *dst1, int16_t *dst2,
                             int dstWidth, const uint8_t *src1,
                             const uint8_t *src2, int srcW, int xInc);
 
-int ff_sws_alphablendaway(SwsContext *c, const uint8_t *src[],
-                          int srcStride[], int srcSliceY, int srcSliceH,
-                          uint8_t *dst[], int dstStride[]);
+int ff_sws_alphablendaway(SwsContext *c, const uint8_t *const src[],
+                          const int srcStride[], int srcSliceY, int srcSliceH,
+                          uint8_t *const dst[], const int dstStride[]);
 
 void ff_copyPlane(const uint8_t *src, int srcStride,
                   int srcSliceY, int srcSliceH, int width,
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index dc1d5f3593..edb51a8250 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -139,10 +139,10 @@ void ff_copyPlane(const uint8_t *src, int srcStride,
     }
 }
 
-static int planarToNv12Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY,
-                               int srcSliceH, uint8_t *dstParam[],
-                               int dstStride[])
+static int planarToNv12Wrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY,
+                               int srcSliceH, uint8_t *const dstParam[],
+                               const int dstStride[])
 {
     uint8_t *dst = dstParam[1] + dstStride[1] * srcSliceY / 2;
 
@@ -159,10 +159,10 @@ static int planarToNv12Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int nv12ToPlanarWrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY,
-                               int srcSliceH, uint8_t *dstParam[],
-                               int dstStride[])
+static int nv12ToPlanarWrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY,
+                               int srcSliceH, uint8_t *const dstParam[],
+                               const int dstStride[])
 {
     uint8_t *dst1 = dstParam[1] + dstStride[1] * srcSliceY / 2;
     uint8_t *dst2 = dstParam[2] + dstStride[2] * srcSliceY / 2;
@@ -180,10 +180,10 @@ static int nv12ToPlanarWrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int planarToNv24Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY,
-                               int srcSliceH, uint8_t *dstParam[],
-                               int dstStride[])
+static int planarToNv24Wrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY,
+                               int srcSliceH, uint8_t *const dstParam[],
+                               const int dstStride[])
 {
     uint8_t *dst = dstParam[1] + dstStride[1] * srcSliceY;
 
@@ -200,10 +200,10 @@ static int planarToNv24Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int nv24ToPlanarWrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY,
-                               int srcSliceH, uint8_t *dstParam[],
-                               int dstStride[])
+static int nv24ToPlanarWrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY,
+                               int srcSliceH, uint8_t *const dstParam[],
+                               const int dstStride[])
 {
     uint8_t *dst1 = dstParam[1] + dstStride[1] * srcSliceY;
     uint8_t *dst2 = dstParam[2] + dstStride[2] * srcSliceY;
@@ -243,9 +243,9 @@ static void nv24_to_yuv420p_chroma(uint8_t *dst1, int dstStride1,
     }
 }
 
-static int nv24ToYuv420Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
+static int nv24ToYuv420Wrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY, int srcSliceH,
+                               uint8_t *const dstParam[], const int dstStride[])
 {
     uint8_t *dst1 = dstParam[1] + dstStride[1] * srcSliceY / 2;
     uint8_t *dst2 = dstParam[2] + dstStride[2] * srcSliceY / 2;
@@ -263,10 +263,10 @@ static int nv24ToYuv420Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int planarToP01xWrapper(SwsContext *c, const uint8_t *src8[],
-                               int srcStride[], int srcSliceY,
-                               int srcSliceH, uint8_t *dstParam8[],
-                               int dstStride[])
+static int planarToP01xWrapper(SwsContext *c, const uint8_t *const src8[],
+                               const int srcStride[], int srcSliceY,
+                               int srcSliceH, uint8_t *const dstParam8[],
+                               const int dstStride[])
 {
     const AVPixFmtDescriptor *src_format = av_pix_fmt_desc_get(c->srcFormat);
     const AVPixFmtDescriptor *dst_format = av_pix_fmt_desc_get(c->dstFormat);
@@ -323,11 +323,12 @@ static int planarToP01xWrapper(SwsContext *c, const uint8_t *src8[],
 #define output_pixel(p, v) (*p) = (v)
 #endif
 
-static int planar8ToP01xleWrapper(SwsContext *c, const uint8_t *src[],
-                                  int srcStride[], int srcSliceY,
-                                  int srcSliceH, uint8_t *dstParam8[],
-                                  int dstStride[])
+static int planar8ToP01xleWrapper(SwsContext *c, const uint8_t *const src[],
+                                  const int srcStride[], int srcSliceY,
+                                  int srcSliceH, uint8_t *const dstParam8[],
+                                  const int dstStride[])
 {
+    const uint8_t *src0 = src[0], *src1 = src[1], *src2 = src[2];
     uint16_t *dstY = (uint16_t*)(dstParam8[0] + dstStride[0] * srcSliceY);
     uint16_t *dstUV = (uint16_t*)(dstParam8[1] + dstStride[1] * srcSliceY / 2);
     int x, y, t;
@@ -336,26 +337,26 @@ static int planar8ToP01xleWrapper(SwsContext *c, const uint8_t *src[],
 
     for (y = 0; y < srcSliceH; y++) {
         uint16_t *tdstY = dstY;
-        const uint8_t *tsrc0 = src[0];
+        const uint8_t *tsrc0 = src0;
         for (x = c->srcW; x > 0; x--) {
             t = *tsrc0++;
             output_pixel(tdstY++, t | (t << 8));
         }
-        src[0] += srcStride[0];
+        src0 += srcStride[0];
         dstY += dstStride[0] / 2;
 
         if (!(y & 1)) {
             uint16_t *tdstUV = dstUV;
-            const uint8_t *tsrc1 = src[1];
-            const uint8_t *tsrc2 = src[2];
+            const uint8_t *tsrc1 = src1;
+            const uint8_t *tsrc2 = src2;
             for (x = c->srcW / 2; x > 0; x--) {
                 t = *tsrc1++;
                 output_pixel(tdstUV++, t | (t << 8));
                 t = *tsrc2++;
                 output_pixel(tdstUV++, t | (t << 8));
             }
-            src[1] += srcStride[1];
-            src[2] += srcStride[2];
+            src1 += srcStride[1];
+            src2 += srcStride[2];
             dstUV += dstStride[1] / 2;
         }
     }
@@ -365,9 +366,9 @@ static int planar8ToP01xleWrapper(SwsContext *c, const uint8_t *src[],
 
 #undef output_pixel
 
-static int planarToYuy2Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
+static int planarToYuy2Wrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY, int srcSliceH,
+                               uint8_t *const dstParam[], const int dstStride[])
 {
     uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY;
 
@@ -377,9 +378,9 @@ static int planarToYuy2Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int planarToUyvyWrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
+static int planarToUyvyWrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY, int srcSliceH,
+                               uint8_t *const dstParam[], const int dstStride[])
 {
     uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY;
 
@@ -389,9 +390,9 @@ static int planarToUyvyWrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int yuv422pToYuy2Wrapper(SwsContext *c, const uint8_t *src[],
-                                int srcStride[], int srcSliceY, int srcSliceH,
-                                uint8_t *dstParam[], int dstStride[])
+static int yuv422pToYuy2Wrapper(SwsContext *c, const uint8_t *const src[],
+                                const int srcStride[], int srcSliceY, int srcSliceH,
+                                uint8_t *const dstParam[], const int dstStride[])
 {
     uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY;
 
@@ -401,9 +402,9 @@ static int yuv422pToYuy2Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int yuv422pToUyvyWrapper(SwsContext *c, const uint8_t *src[],
-                                int srcStride[], int srcSliceY, int srcSliceH,
-                                uint8_t *dstParam[], int dstStride[])
+static int yuv422pToUyvyWrapper(SwsContext *c, const uint8_t *const src[],
+                                const int srcStride[], int srcSliceY, int srcSliceH,
+                                uint8_t *const dstParam[], const int dstStride[])
 {
     uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY;
 
@@ -413,9 +414,9 @@ static int yuv422pToUyvyWrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int yuyvToYuv420Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
+static int yuyvToYuv420Wrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY, int srcSliceH,
+                               uint8_t *const dstParam[], const int dstStride[])
 {
     uint8_t *ydst = dstParam[0] + dstStride[0] * srcSliceY;
     uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY / 2;
@@ -430,9 +431,9 @@ static int yuyvToYuv420Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int yuyvToYuv422Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
+static int yuyvToYuv422Wrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY, int srcSliceH,
+                               uint8_t *const dstParam[], const int dstStride[])
 {
     uint8_t *ydst = dstParam[0] + dstStride[0] * srcSliceY;
     uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY;
@@ -444,9 +445,9 @@ static int yuyvToYuv422Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int uyvyToYuv420Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
+static int uyvyToYuv420Wrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY, int srcSliceH,
+                               uint8_t *const dstParam[], const int dstStride[])
 {
     uint8_t *ydst = dstParam[0] + dstStride[0] * srcSliceY;
     uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY / 2;
@@ -461,9 +462,9 @@ static int uyvyToYuv420Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int uyvyToYuv422Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
+static int uyvyToYuv422Wrapper(SwsContext *c, const uint8_t *const src[],
+                               const int srcStride[], int srcSliceY, int srcSliceH,
+                               uint8_t *const dstParam[], const int dstStride[])
 {
     uint8_t *ydst = dstParam[0] + dstStride[0] * srcSliceY;
     uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY;
@@ -506,9 +507,9 @@ static void gray8aToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels,
     }
 }
 
-static int bswap_16bpc(SwsContext *c, const uint8_t *src[],
-                              int srcStride[], int srcSliceY, int srcSliceH,
-                              uint8_t *dst[], int dstStride[])
+static int bswap_16bpc(SwsContext *c, const uint8_t *const src[],
+                              const int srcStride[], int srcSliceY, int srcSliceH,
+                              uint8_t *const dst[], const int dstStride[])
 {
     int i, j, p;
 
@@ -533,9 +534,9 @@ static int bswap_16bpc(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int bswap_32bpc(SwsContext *c, const uint8_t *src[],
-                              int srcStride[], int srcSliceY, int srcSliceH,
-                              uint8_t *dst[], int dstStride[])
+static int bswap_32bpc(SwsContext *c, const uint8_t *const src[],
+                              const int srcStride[], int srcSliceY, int srcSliceH,
+                              uint8_t *const dst[], const int dstStride[])
 {
     int i, j, p;
 
@@ -561,9 +562,9 @@ static int bswap_32bpc(SwsContext *c, const uint8_t *src[],
 }
 
 
-static int palToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
-                           int srcSliceY, int srcSliceH, uint8_t *dst[],
-                           int dstStride[])
+static int palToRgbWrapper(SwsContext *c, const uint8_t *const src[], const int srcStride[],
+                           int srcSliceY, int srcSliceH, uint8_t *const dst[],
+                           const int dstStride[])
 {
     const enum AVPixelFormat srcFormat = c->srcFormat;
     const enum AVPixelFormat dstFormat = c->dstFormat;
@@ -608,7 +609,7 @@ static int palToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
 }
 
 static void packed16togbra16(const uint8_t *src, int srcStride,
-                             uint16_t *dst[], int dstStride[], int srcSliceH,
+                             uint16_t *dst[], const int dstStride[], int srcSliceH,
                              int src_alpha, int swap, int shift, int width)
 {
     int x, h, i;
@@ -741,9 +742,9 @@ static void packed16togbra16(const uint8_t *src, int srcStride,
     }
 }
 
-static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const uint8_t *src[],
-                                     int srcStride[], int srcSliceY, int srcSliceH,
-                                     uint8_t *dst[], int dstStride[])
+static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const uint8_t *const src[],
+                                     const int srcStride[], int srcSliceY, int srcSliceH,
+                                     uint8_t *const dst[], const int dstStride[])
 {
     uint16_t *dst2013[] = { (uint16_t *)dst[2], (uint16_t *)dst[0], (uint16_t *)dst[1], (uint16_t *)dst[3] };
     uint16_t *dst1023[] = { (uint16_t *)dst[1], (uint16_t *)dst[0], (uint16_t *)dst[2], (uint16_t *)dst[3] };
@@ -801,7 +802,7 @@ static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static void gbr16ptopacked16(const uint16_t *src[], int srcStride[],
+static void gbr16ptopacked16(const uint16_t *src[], const int srcStride[],
                              uint8_t *dst, int dstStride, int srcSliceH,
                              int alpha, int swap, int bpp, int width)
 {
@@ -920,9 +921,9 @@ static void gbr16ptopacked16(const uint16_t *src[], int srcStride[],
     }
 }
 
-static int planarRgb16ToRgb16Wrapper(SwsContext *c, const uint8_t *src[],
-                                     int srcStride[], int srcSliceY, int srcSliceH,
-                                     uint8_t *dst[], int dstStride[])
+static int planarRgb16ToRgb16Wrapper(SwsContext *c, const uint8_t *const src[],
+                                     const int srcStride[], int srcSliceY, int srcSliceH,
+                                     uint8_t *const dst[], const int dstStride[])
 {
     const uint16_t *src102[] = { (uint16_t *)src[1], (uint16_t *)src[0], (uint16_t *)src[2], (uint16_t *)src[3] };
     const uint16_t *src201[] = { (uint16_t *)src[2], (uint16_t *)src[0], (uint16_t *)src[1], (uint16_t *)src[3] };
@@ -980,7 +981,7 @@ static int planarRgb16ToRgb16Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static void gbr24ptopacked24(const uint8_t *src[], int srcStride[],
+static void gbr24ptopacked24(const uint8_t *src[], const int srcStride[],
                              uint8_t *dst, int dstStride, int srcSliceH,
                              int width)
 {
@@ -998,7 +999,7 @@ static void gbr24ptopacked24(const uint8_t *src[], int srcStride[],
     }
 }
 
-static void gbr24ptopacked32(const uint8_t *src[], int srcStride[],
+static void gbr24ptopacked32(const uint8_t *src[], const int srcStride[],
                              uint8_t *dst, int dstStride, int srcSliceH,
                              int alpha_first, int width)
 {
@@ -1027,7 +1028,7 @@ static void gbr24ptopacked32(const uint8_t *src[], int srcStride[],
     }
 }
 
-static void gbraptopacked32(const uint8_t *src[], int srcStride[],
+static void gbraptopacked32(const uint8_t *src[], const int srcStride[],
                             uint8_t *dst, int dstStride, int srcSliceH,
                             int alpha_first, int width)
 {
@@ -1056,9 +1057,9 @@ static void gbraptopacked32(const uint8_t *src[], int srcStride[],
     }
 }
 
-static int planarRgbaToRgbWrapper(SwsContext *c, const uint8_t *src[],
-                                  int srcStride[], int srcSliceY, int srcSliceH,
-                                  uint8_t *dst[], int dstStride[])
+static int planarRgbaToRgbWrapper(SwsContext *c, const uint8_t *const src[],
+                                  const int srcStride[], int srcSliceY, int srcSliceH,
+                                  uint8_t *const dst[], const int dstStride[])
 {
     int alpha_first = 0;
     const uint8_t *src102[] = { src[1], src[0], src[2], src[3] };
@@ -1112,9 +1113,9 @@ static int planarRgbaToRgbWrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
-                                 int srcStride[], int srcSliceY, int srcSliceH,
-                                 uint8_t *dst[], int dstStride[])
+static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *const src[],
+                                 const int srcStride[], int srcSliceY, int srcSliceH,
+                                 uint8_t *const dst[], const int dstStride[])
 {
     int alpha_first = 0;
     const uint8_t *src102[] = { src[1], src[0], src[2] };
@@ -1169,9 +1170,9 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
 }
 
 static int planarRgbToplanarRgbWrapper(SwsContext *c,
-                                       const uint8_t *src[], int srcStride[],
+                                       const uint8_t *const src[], const int srcStride[],
                                        int srcSliceY, int srcSliceH,
-                                       uint8_t *dst[], int dstStride[])
+                                       uint8_t *const dst[], const int dstStride[])
 {
     ff_copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
                  dst[0], dstStride[0]);
@@ -1186,7 +1187,7 @@ static int planarRgbToplanarRgbWrapper(SwsContext *c,
 }
 
 static void packedtogbr24p(const uint8_t *src, int srcStride,
-                           uint8_t *dst[], int dstStride[], int srcSliceH,
+                           uint8_t *const dst[], const int dstStride[], int srcSliceH,
                            int alpha_first, int inc_size, int width)
 {
     uint8_t *dest[3];
@@ -1214,9 +1215,9 @@ static void packedtogbr24p(const uint8_t *src, int srcStride,
     }
 }
 
-static int rgbToPlanarRgbWrapper(SwsContext *c, const uint8_t *src[],
-                                 int srcStride[], int srcSliceY, int srcSliceH,
-                                 uint8_t *dst[], int dstStride[])
+static int rgbToPlanarRgbWrapper(SwsContext *c, const uint8_t *const src[],
+                                 const int srcStride[], int srcSliceY, int srcSliceH,
+                                 uint8_t *const dst[], const int dstStride[])
 {
     int alpha_first = 0;
     int stride102[] = { dstStride[1], dstStride[0], dstStride[2] };
@@ -1319,8 +1320,9 @@ static int rgbToPlanarRgbWrapper(SwsContext *c, const uint8_t *src[],
 #define BAYER_RENAME(x) bayer_rggb16be_to_##x
 #include "bayer_template.c"
 
-static int bayer_to_rgb24_wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
-                                  int srcSliceH, uint8_t* dst[], int dstStride[])
+static int bayer_to_rgb24_wrapper(SwsContext *c, const uint8_t *const src[],
+                                  const int srcStride[], int srcSliceY, int srcSliceH,
+                                  uint8_t *const dst[], const int dstStride[])
 {
     uint8_t *dstPtr= dst[0] + srcSliceY * dstStride[0];
     const uint8_t *srcPtr= src[0];
@@ -1368,8 +1370,9 @@ static int bayer_to_rgb24_wrapper(SwsContext *c, const uint8_t* src[], int srcSt
     return srcSliceH;
 }
 
-static int bayer_to_rgb48_wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
-                                  int srcSliceH, uint8_t* dst[], int dstStride[])
+static int bayer_to_rgb48_wrapper(SwsContext *c, const uint8_t *const src[],
+                                  const int srcStride[], int srcSliceY, int srcSliceH,
+                                  uint8_t *const dst[], const int dstStride[])
 {
     uint8_t *dstPtr= dst[0] + srcSliceY * dstStride[0];
     const uint8_t *srcPtr= src[0];
@@ -1417,16 +1420,17 @@ static int bayer_to_rgb48_wrapper(SwsContext *c, const uint8_t* src[], int srcSt
     return srcSliceH;
 }
 
-static int bayer_to_yv12_wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
-                                 int srcSliceH, uint8_t* dst[], int dstStride[])
+static int bayer_to_yv12_wrapper(SwsContext *c, const uint8_t *const src[],
+                                 const int srcStride[], int srcSliceY, int srcSliceH,
+                                 uint8_t *const dst[], const int dstStride[])
 {
     const uint8_t *srcPtr= src[0];
     uint8_t *dstY= dst[0] + srcSliceY * dstStride[0];
     uint8_t *dstU= dst[1] + srcSliceY * dstStride[1] / 2;
     uint8_t *dstV= dst[2] + srcSliceY * dstStride[2] / 2;
     int i;
-    void (*copy)       (const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv);
-    void (*interpolate)(const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv);
+    void (*copy)       (const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, const int32_t *rgb2yuv);
+    void (*interpolate)(const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, const int32_t *rgb2yuv);
 
     switch(c->srcFormat) {
 #define CASE(pixfmt, prefix) \
@@ -1618,9 +1622,9 @@ static rgbConvFn findRgbConvFn(SwsContext *c)
 }
 
 /* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */
-static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
-                           int srcSliceY, int srcSliceH, uint8_t *dst[],
-                           int dstStride[])
+static int rgbToRgbWrapper(SwsContext *c, const uint8_t *const src[], const int srcStride[],
+                           int srcSliceY, int srcSliceH, uint8_t *const dst[],
+                           const int dstStride[])
 
 {
     const enum AVPixelFormat srcFormat = c->srcFormat;
@@ -1679,9 +1683,9 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
     return srcSliceH;
 }
 
-static int bgr24ToYv12Wrapper(SwsContext *c, const uint8_t *src[],
-                              int srcStride[], int srcSliceY, int srcSliceH,
-                              uint8_t *dst[], int dstStride[])
+static int bgr24ToYv12Wrapper(SwsContext *c, const uint8_t *const src[],
+                              const int srcStride[], int srcSliceY, int srcSliceH,
+                              uint8_t *const dst[], const int dstStride[])
 {
     ff_rgb24toyv12(
         src[0],
@@ -1696,9 +1700,9 @@ static int bgr24ToYv12Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int yvu9ToYv12Wrapper(SwsContext *c, const uint8_t *src[],
-                             int srcStride[], int srcSliceY, int srcSliceH,
-                             uint8_t *dst[], int dstStride[])
+static int yvu9ToYv12Wrapper(SwsContext *c, const uint8_t *const src[],
+                             const int srcStride[], int srcSliceY, int srcSliceH,
+                             uint8_t *const dst[], const int dstStride[])
 {
     ff_copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
                  dst[0], dstStride[0]);
@@ -1712,9 +1716,9 @@ static int yvu9ToYv12Wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int uint_y_to_float_y_wrapper(SwsContext *c, const uint8_t *src[],
-                                     int srcStride[], int srcSliceY,
-                                     int srcSliceH, uint8_t *dst[], int dstStride[])
+static int uint_y_to_float_y_wrapper(SwsContext *c, const uint8_t *const src[],
+                                     const int srcStride[], int srcSliceY,
+                                     int srcSliceH, uint8_t *const dst[], const int dstStride[])
 {
     int y, x;
     ptrdiff_t dstStrideFloat = dstStride[0] >> 2;
@@ -1732,9 +1736,11 @@ static int uint_y_to_float_y_wrapper(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static int float_y_to_uint_y_wrapper(SwsContext *c, const uint8_t* src[],
-                                     int srcStride[], int srcSliceY,
-                                     int srcSliceH, uint8_t* dst[], int dstStride[])
+static int float_y_to_uint_y_wrapper(SwsContext *c,
+                                     const uint8_t *const src[],
+                                     const int srcStride[], int srcSliceY,
+                                     int srcSliceH, uint8_t *const dst[],
+                                     const int dstStride[])
 {
     int y, x;
     ptrdiff_t srcStrideFloat = srcStride[0] >> 2;
@@ -1753,9 +1759,9 @@ static int float_y_to_uint_y_wrapper(SwsContext *c, const uint8_t* src[],
 }
 
 /* unscaled copy like stuff (assumes nearly identical formats) */
-static int packedCopyWrapper(SwsContext *c, const uint8_t *src[],
-                             int srcStride[], int srcSliceY, int srcSliceH,
-                             uint8_t *dst[], int dstStride[])
+static int packedCopyWrapper(SwsContext *c, const uint8_t *const src[],
+                             const int srcStride[], int srcSliceY, int srcSliceH,
+                             uint8_t *const dst[], const int dstStride[])
 {
     if (dstStride[0] == srcStride[0] && srcStride[0] > 0)
         memcpy(dst[0] + dstStride[0] * srcSliceY, src[0], srcSliceH * dstStride[0]);
@@ -1840,9 +1846,9 @@ static int packedCopyWrapper(SwsContext *c, const uint8_t *src[],
         }\
     }
 
-static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
-                             int srcStride[], int srcSliceY, int srcSliceH,
-                             uint8_t *dst[], int dstStride[])
+static int planarCopyWrapper(SwsContext *c, const uint8_t *const src[],
+                             const int srcStride[], int srcSliceY, int srcSliceH,
+                             uint8_t *const dst[], const int dstStride[])
 {
     const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(c->srcFormat);
     const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(c->dstFormat);
diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c
index 2a4505fa90..3ee13304fd 100644
--- a/libswscale/x86/yuv2rgb.c
+++ b/libswscale/x86/yuv2rgb.c
@@ -86,10 +86,10 @@ extern void ff_yuv_420_gbrp24_ssse3(x86_reg index, uint8_t *image, uint8_t *dst_
                                     const uint8_t *py_2index);
 #endif
 
-static inline int yuv420_rgb15_ssse3(SwsContext *c, const uint8_t *src[],
-                                     int srcStride[],
+static inline int yuv420_rgb15_ssse3(SwsContext *c, const uint8_t *const src[],
+                                     const int srcStride[],
                                      int srcSliceY, int srcSliceH,
-                                     uint8_t *dst[], int dstStride[])
+                                     uint8_t *const dst[], const int dstStride[])
 {
     int y, h_size, vshift;
 
@@ -104,10 +104,10 @@ static inline int yuv420_rgb15_ssse3(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static inline int yuv420_rgb16_ssse3(SwsContext *c, const uint8_t *src[],
-                                     int srcStride[],
+static inline int yuv420_rgb16_ssse3(SwsContext *c, const uint8_t *const src[],
+                                     const int srcStride[],
                                      int srcSliceY, int srcSliceH,
-                                     uint8_t *dst[], int dstStride[])
+                                     uint8_t *const dst[], const int dstStride[])
 {
     int y, h_size, vshift;
 
@@ -122,10 +122,10 @@ static inline int yuv420_rgb16_ssse3(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static inline int yuv420_rgb32_ssse3(SwsContext *c, const uint8_t *src[],
-                                     int srcStride[],
+static inline int yuv420_rgb32_ssse3(SwsContext *c, const uint8_t *const src[],
+                                     const int srcStride[],
                                      int srcSliceY, int srcSliceH,
-                                     uint8_t *dst[], int dstStride[])
+                                     uint8_t *const dst[], const int dstStride[])
 {
     int y, h_size, vshift;
 
@@ -136,10 +136,10 @@ static inline int yuv420_rgb32_ssse3(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static inline int yuv420_bgr32_ssse3(SwsContext *c, const uint8_t *src[],
-                                     int srcStride[],
+static inline int yuv420_bgr32_ssse3(SwsContext *c, const uint8_t *const src[],
+                                     const int srcStride[],
                                      int srcSliceY, int srcSliceH,
-                                     uint8_t *dst[], int dstStride[])
+                                     uint8_t *const dst[], const int dstStride[])
 {
     int y, h_size, vshift;
 
@@ -150,10 +150,10 @@ static inline int yuv420_bgr32_ssse3(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static inline int yuva420_rgb32_ssse3(SwsContext *c, const uint8_t *src[],
-                                      int srcStride[],
+static inline int yuva420_rgb32_ssse3(SwsContext *c, const uint8_t *const src[],
+                                      const int srcStride[],
                                       int srcSliceY, int srcSliceH,
-                                      uint8_t *dst[], int dstStride[])
+                                      uint8_t *const dst[], const int dstStride[])
 {
     int y, h_size, vshift;
     YUV2RGB_LOOP(4)
@@ -164,10 +164,10 @@ static inline int yuva420_rgb32_ssse3(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static inline int yuva420_bgr32_ssse3(SwsContext *c, const uint8_t *src[],
-                                      int srcStride[],
+static inline int yuva420_bgr32_ssse3(SwsContext *c, const uint8_t *const src[],
+                                      const int srcStride[],
                                       int srcSliceY, int srcSliceH,
-                                      uint8_t *dst[], int dstStride[])
+                                      uint8_t *const dst[], const int dstStride[])
 {
     int y, h_size, vshift;
 
@@ -179,10 +179,10 @@ static inline int yuva420_bgr32_ssse3(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static inline int yuv420_rgb24_ssse3(SwsContext *c, const uint8_t *src[],
-                                     int srcStride[],
+static inline int yuv420_rgb24_ssse3(SwsContext *c, const uint8_t *const src[],
+                                     const int srcStride[],
                                      int srcSliceY, int srcSliceH,
-                                     uint8_t *dst[], int dstStride[])
+                                     uint8_t *const dst[], const int dstStride[])
 {
     int y, h_size, vshift;
 
@@ -193,10 +193,10 @@ static inline int yuv420_rgb24_ssse3(SwsContext *c, const uint8_t *src[],
     return srcSliceH;
 }
 
-static inline int yuv420_bgr24_ssse3(SwsContext *c, const uint8_t *src[],
-                                     int srcStride[],
+static inline int yuv420_bgr24_ssse3(SwsContext *c, const uint8_t *const src[],
+                                     const int srcStride[],
                                      int srcSliceY, int srcSliceH,
-                                     uint8_t *dst[], int dstStride[])
+                                     uint8_t *const dst[], const int dstStride[])
 {
     int y, h_size, vshift;
 
@@ -208,10 +208,10 @@ static inline int yuv420_bgr24_ssse3(SwsContext *c, const uint8_t *src[],
 }
 
 #if ARCH_X86_64
-static inline int yuv420_gbrp_ssse3(SwsContext *c, const uint8_t *src[],
-                                    int srcStride[],
+static inline int yuv420_gbrp_ssse3(SwsContext *c, const uint8_t *const src[],
+                                    const int srcStride[],
                                     int srcSliceY, int srcSliceH,
-                                    uint8_t *dst[], int dstStride[])
+                                    uint8_t *const dst[], const int dstStride[])
 {
     int y, h_size, vshift;
 
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index 52fe2093e7..941971d1ab 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -135,9 +135,9 @@ const int *sws_getCoefficients(int colorspace)
     dst2_##l[2 * i + 1] = r[Y];
 
 #define YUV2RGBFUNC(func_name, dst_type, alpha, yuv422, nb_dst_planes)      \
-    static int func_name(SwsContext *c, const uint8_t *src[],               \
-                         int srcStride[], int srcSliceY, int srcSliceH,     \
-                         uint8_t *dst[], int dstStride[])                   \
+    static int func_name(SwsContext *c, const uint8_t *const src[],         \
+                         const int srcStride[], int srcSliceY, int srcSliceH, \
+                         uint8_t *const dst[], const int dstStride[])       \
     {                                                                       \
         int y;                                                              \
                                                                             \



More information about the ffmpeg-cvslog mailing list