[FFmpeg-devel] [PATCH 35/39] avcodec/mpegvideodsp: Constify src pointers

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Jul 27 01:08:10 EEST 2022


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/mpegvideodsp.c     | 4 ++--
 libavcodec/mpegvideodsp.h     | 6 +++---
 libavcodec/ppc/mpegvideodsp.c | 2 +-
 libavcodec/x86/mpegvideodsp.c | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/mpegvideodsp.c b/libavcodec/mpegvideodsp.c
index a8cf7fbe35..05893d0e01 100644
--- a/libavcodec/mpegvideodsp.c
+++ b/libavcodec/mpegvideodsp.c
@@ -21,7 +21,7 @@
 #include "libavutil/common.h"
 #include "mpegvideodsp.h"
 
-static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h,
+static void gmc1_c(uint8_t *dst, const uint8_t *src, int stride, int h,
                    int x16, int y16, int rounder)
 {
     const int A = (16 - x16) * (16 - y16);
@@ -44,7 +44,7 @@ static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h,
     }
 }
 
-void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
+void ff_gmc_c(uint8_t *dst, const uint8_t *src, int stride, int h, int ox, int oy,
               int dxx, int dxy, int dyx, int dyy, int shift, int r,
               int width, int height)
 {
diff --git a/libavcodec/mpegvideodsp.h b/libavcodec/mpegvideodsp.h
index 293e2548d3..69e6053c68 100644
--- a/libavcodec/mpegvideodsp.h
+++ b/libavcodec/mpegvideodsp.h
@@ -21,7 +21,7 @@
 
 #include <stdint.h>
 
-void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
+void ff_gmc_c(uint8_t *dst, const uint8_t *src, int stride, int h, int ox, int oy,
               int dxx, int dxy, int dyx, int dyy, int shift, int r,
               int width, int height);
 
@@ -29,12 +29,12 @@ typedef struct MpegVideoDSPContext {
     /**
      * translational global motion compensation.
      */
-    void (*gmc1)(uint8_t *dst /* align 8 */, uint8_t *src /* align 1 */,
+    void (*gmc1)(uint8_t *dst /* align 8 */, const uint8_t *src /* align 1 */,
                  int srcStride, int h, int x16, int y16, int rounder);
     /**
      * global motion compensation.
      */
-    void (*gmc)(uint8_t *dst /* align 8 */, uint8_t *src /* align 1 */,
+    void (*gmc)(uint8_t *dst /* align 8 */, const uint8_t *src /* align 1 */,
                 int stride, int h, int ox, int oy,
                 int dxx, int dxy, int dyx, int dyy,
                 int shift, int r, int width, int height);
diff --git a/libavcodec/ppc/mpegvideodsp.c b/libavcodec/ppc/mpegvideodsp.c
index 42d65dbe3d..3e99e089ea 100644
--- a/libavcodec/ppc/mpegvideodsp.c
+++ b/libavcodec/ppc/mpegvideodsp.c
@@ -31,7 +31,7 @@
 #if HAVE_ALTIVEC
 /* AltiVec-enhanced gmc1. ATM this code assumes stride is a multiple of 8
  * to preserve proper dst alignment. */
-static void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */,
+static void gmc1_altivec(uint8_t *dst /* align 8 */, const uint8_t *src /* align1 */,
                          int stride, int h, int x16, int y16, int rounder)
 {
     int i;
diff --git a/libavcodec/x86/mpegvideodsp.c b/libavcodec/x86/mpegvideodsp.c
index 6009b64e07..ea1d941fba 100644
--- a/libavcodec/x86/mpegvideodsp.c
+++ b/libavcodec/x86/mpegvideodsp.c
@@ -25,7 +25,7 @@
 
 #if HAVE_INLINE_ASM
 
-static void gmc_mmx(uint8_t *dst, uint8_t *src,
+static void gmc_mmx(uint8_t *dst, const uint8_t *src,
                     int stride, int h, int ox, int oy,
                     int dxx, int dxy, int dyx, int dyy,
                     int shift, int r, int width, int height)
-- 
2.34.1



More information about the ffmpeg-devel mailing list