[FFmpeg-cvslog] avfilter/bwdifdsp: Constify

Andreas Rheinhardt git at videolan.org
Thu Sep 28 01:29:58 EEST 2023


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Sep 25 17:25:47 2023 +0200| [fa06f48371ba2b73c139810db5bb893dc27eda7a] | committer: Andreas Rheinhardt

avfilter/bwdifdsp: Constify

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavfilter/aarch64/vf_bwdif_init_aarch64.c | 12 +++---
 libavfilter/bwdifdsp.c                      | 60 ++++++++++++++---------------
 libavfilter/bwdifdsp.h                      | 12 +++---
 libavfilter/x86/vf_bwdif_init.c             | 12 +++---
 4 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/libavfilter/aarch64/vf_bwdif_init_aarch64.c b/libavfilter/aarch64/vf_bwdif_init_aarch64.c
index 2b8d212de6..74530ed5b7 100644
--- a/libavfilter/aarch64/vf_bwdif_init_aarch64.c
+++ b/libavfilter/aarch64/vf_bwdif_init_aarch64.c
@@ -24,14 +24,14 @@
 #include "libavfilter/bwdifdsp.h"
 #include "libavutil/aarch64/cpu.h"
 
-void ff_bwdif_filter_edge_neon(void *dst1, void *prev1, void *cur1, void *next1,
+void ff_bwdif_filter_edge_neon(void *dst1, const void *prev1, const void *cur1, const void *next1,
                                int w, int prefs, int mrefs, int prefs2, int mrefs2,
                                int parity, int clip_max, int spat);
 
-void ff_bwdif_filter_intra_neon(void *dst1, void *cur1, int w, int prefs, int mrefs,
+void ff_bwdif_filter_intra_neon(void *dst1, const void *cur1, int w, int prefs, int mrefs,
                                 int prefs3, int mrefs3, int parity, int clip_max);
 
-void ff_bwdif_filter_line_neon(void *dst1, void *prev1, void *cur1, void *next1,
+void ff_bwdif_filter_line_neon(void *dst1, const void *prev1, const void *cur1, const void *next1,
                                int w, int prefs, int mrefs, int prefs2, int mrefs2,
                                int prefs3, int mrefs3, int prefs4, int mrefs4,
                                int parity, int clip_max);
@@ -64,7 +64,7 @@ static void filter_line3_helper(void * dst1, int d_stride,
                                 w - w0, parity, clip_max);
 }
 
-static void filter_line_helper(void *dst1, void *prev1, void *cur1, void *next1,
+static void filter_line_helper(void *dst1, const void *prev1, const void *cur1, const void *next1,
                                int w, int prefs, int mrefs, int prefs2, int mrefs2,
                                int prefs3, int mrefs3, int prefs4, int mrefs4,
                                int parity, int clip_max)
@@ -79,7 +79,7 @@ static void filter_line_helper(void *dst1, void *prev1, void *cur1, void *next1,
                                w - w0, prefs, mrefs, prefs2, mrefs2, prefs3, mrefs3, prefs4, mrefs4, parity, clip_max);
 }
 
-static void filter_edge_helper(void *dst1, void *prev1, void *cur1, void *next1,
+static void filter_edge_helper(void *dst1, const void *prev1, const void *cur1, const void *next1,
                                int w, int prefs, int mrefs, int prefs2, int mrefs2,
                                int parity, int clip_max, int spat)
 {
@@ -94,7 +94,7 @@ static void filter_edge_helper(void *dst1, void *prev1, void *cur1, void *next1,
                                parity, clip_max, spat);
 }
 
-static void filter_intra_helper(void *dst1, void *cur1, int w, int prefs, int mrefs,
+static void filter_intra_helper(void *dst1, const void *cur1, int w, int prefs, int mrefs,
                                 int prefs3, int mrefs3, int parity, int clip_max)
 {
     const int w0 = clip_max != 255 ? 0 : w & ~15;
diff --git a/libavfilter/bwdifdsp.c b/libavfilter/bwdifdsp.c
index af217481a5..65bdbdc053 100644
--- a/libavfilter/bwdifdsp.c
+++ b/libavfilter/bwdifdsp.c
@@ -115,27 +115,27 @@ static const uint16_t coef_sp[2] = { 5077, 981 };
         next2++; \
     }
 
-void ff_bwdif_filter_intra_c(void *dst1, void *cur1, int w, int prefs, int mrefs,
+void ff_bwdif_filter_intra_c(void *dst1, const void *cur1, int w, int prefs, int mrefs,
                              int prefs3, int mrefs3, int parity, int clip_max)
 {
     uint8_t *dst = dst1;
-    uint8_t *cur = cur1;
+    const uint8_t *cur = cur1;
     int interpol, x;
 
     FILTER_INTRA()
 }
 
-void ff_bwdif_filter_line_c(void *dst1, void *prev1, void *cur1, void *next1,
+void ff_bwdif_filter_line_c(void *dst1, const void *prev1, const void *cur1, const void *next1,
                             int w, int prefs, int mrefs, int prefs2, int mrefs2,
                             int prefs3, int mrefs3, int prefs4, int mrefs4,
                             int parity, int clip_max)
 {
     uint8_t *dst   = dst1;
-    uint8_t *prev  = prev1;
-    uint8_t *cur   = cur1;
-    uint8_t *next  = next1;
-    uint8_t *prev2 = parity ? prev : cur ;
-    uint8_t *next2 = parity ? cur  : next;
+    const uint8_t *prev  = prev1;
+    const uint8_t *cur   = cur1;
+    const uint8_t *next  = next1;
+    const uint8_t *prev2 = parity ? prev : cur ;
+    const uint8_t *next2 = parity ? cur  : next;
     int interpol, x;
 
     FILTER1()
@@ -159,25 +159,25 @@ void ff_bwdif_filter_line3_c(void * dst1, int d_stride,
     const uint8_t * cur  = cur1;
     const uint8_t * next = next1;
 
-    ff_bwdif_filter_line_c(dst, (void*)prev, (void*)cur, (void*)next, w,
+    ff_bwdif_filter_line_c(dst, prev, cur, next, w,
                            prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max);
     NEXT_LINE();
     memcpy(dst, cur, w);
     NEXT_LINE();
-    ff_bwdif_filter_line_c(dst, (void*)prev, (void*)cur, (void*)next, w,
+    ff_bwdif_filter_line_c(dst, prev, cur, next, w,
                            prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max);
 }
 
-void ff_bwdif_filter_edge_c(void *dst1, void *prev1, void *cur1, void *next1,
+void ff_bwdif_filter_edge_c(void *dst1, const void *prev1, const void *cur1, const void *next1,
                             int w, int prefs, int mrefs, int prefs2, int mrefs2,
                             int parity, int clip_max, int spat)
 {
     uint8_t *dst   = dst1;
-    uint8_t *prev  = prev1;
-    uint8_t *cur   = cur1;
-    uint8_t *next  = next1;
-    uint8_t *prev2 = parity ? prev : cur ;
-    uint8_t *next2 = parity ? cur  : next;
+    const uint8_t *prev  = prev1;
+    const uint8_t *cur   = cur1;
+    const uint8_t *next  = next1;
+    const uint8_t *prev2 = parity ? prev : cur ;
+    const uint8_t *next2 = parity ? cur  : next;
     int interpol, x;
 
     FILTER1()
@@ -185,27 +185,27 @@ void ff_bwdif_filter_edge_c(void *dst1, void *prev1, void *cur1, void *next1,
     FILTER2()
 }
 
-static void filter_intra_16bit(void *dst1, void *cur1, int w, int prefs, int mrefs,
+static void filter_intra_16bit(void *dst1, const void *cur1, int w, int prefs, int mrefs,
                                int prefs3, int mrefs3, int parity, int clip_max)
 {
     uint16_t *dst = dst1;
-    uint16_t *cur = cur1;
+    const uint16_t *cur = cur1;
     int interpol, x;
 
     FILTER_INTRA()
 }
 
-static void filter_line_c_16bit(void *dst1, void *prev1, void *cur1, void *next1,
+static void filter_line_c_16bit(void *dst1, const void *prev1, const void *cur1, const void *next1,
                                 int w, int prefs, int mrefs, int prefs2, int mrefs2,
                                 int prefs3, int mrefs3, int prefs4, int mrefs4,
                                 int parity, int clip_max)
 {
     uint16_t *dst   = dst1;
-    uint16_t *prev  = prev1;
-    uint16_t *cur   = cur1;
-    uint16_t *next  = next1;
-    uint16_t *prev2 = parity ? prev : cur ;
-    uint16_t *next2 = parity ? cur  : next;
+    const uint16_t *prev  = prev1;
+    const uint16_t *cur   = cur1;
+    const uint16_t *next  = next1;
+    const uint16_t *prev2 = parity ? prev : cur ;
+    const uint16_t *next2 = parity ? cur  : next;
     int interpol, x;
 
     FILTER1()
@@ -213,16 +213,16 @@ static void filter_line_c_16bit(void *dst1, void *prev1, void *cur1, void *next1
     FILTER2()
 }
 
-static void filter_edge_16bit(void *dst1, void *prev1, void *cur1, void *next1,
+static void filter_edge_16bit(void *dst1, const void *prev1, const void *cur1, const void *next1,
                               int w, int prefs, int mrefs, int prefs2, int mrefs2,
                               int parity, int clip_max, int spat)
 {
     uint16_t *dst   = dst1;
-    uint16_t *prev  = prev1;
-    uint16_t *cur   = cur1;
-    uint16_t *next  = next1;
-    uint16_t *prev2 = parity ? prev : cur ;
-    uint16_t *next2 = parity ? cur  : next;
+    const uint16_t *prev  = prev1;
+    const uint16_t *cur   = cur1;
+    const uint16_t *next  = next1;
+    const uint16_t *prev2 = parity ? prev : cur ;
+    const uint16_t *next2 = parity ? cur  : next;
     int interpol, x;
 
     FILTER1()
diff --git a/libavfilter/bwdifdsp.h b/libavfilter/bwdifdsp.h
index 1ff810719f..4bf595355c 100644
--- a/libavfilter/bwdifdsp.h
+++ b/libavfilter/bwdifdsp.h
@@ -20,13 +20,13 @@
 #define AVFILTER_BWDIFDSP_H
 
 typedef struct BWDIFDSPContext {
-    void (*filter_intra)(void *dst1, void *cur1, int w, int prefs, int mrefs,
+    void (*filter_intra)(void *dst1, const void *cur1, int w, int prefs, int mrefs,
                          int prefs3, int mrefs3, int parity, int clip_max);
-    void (*filter_line)(void *dst, void *prev, void *cur, void *next,
+    void (*filter_line)(void *dst, const void *prev, const void *cur, const void *next,
                         int w, int prefs, int mrefs, int prefs2, int mrefs2,
                         int prefs3, int mrefs3, int prefs4, int mrefs4,
                         int parity, int clip_max);
-    void (*filter_edge)(void *dst, void *prev, void *cur, void *next,
+    void (*filter_edge)(void *dst, const void *prev, const void *cur, const void *next,
                         int w, int prefs, int mrefs, int prefs2, int mrefs2,
                         int parity, int clip_max, int spat);
     void (*filter_line3)(void *dst, int dstride,
@@ -38,14 +38,14 @@ void ff_bwdif_init_filter_line(BWDIFDSPContext *bwdif, int bit_depth);
 void ff_bwdif_init_x86(BWDIFDSPContext *bwdif, int bit_depth);
 void ff_bwdif_init_aarch64(BWDIFDSPContext *bwdif, int bit_depth);
 
-void ff_bwdif_filter_edge_c(void *dst1, void *prev1, void *cur1, void *next1,
+void ff_bwdif_filter_edge_c(void *dst1, const void *prev1, const void *cur1, const void *next1,
                             int w, int prefs, int mrefs, int prefs2, int mrefs2,
                             int parity, int clip_max, int spat);
 
-void ff_bwdif_filter_intra_c(void *dst1, void *cur1, int w, int prefs, int mrefs,
+void ff_bwdif_filter_intra_c(void *dst1, const void *cur1, int w, int prefs, int mrefs,
                              int prefs3, int mrefs3, int parity, int clip_max);
 
-void ff_bwdif_filter_line_c(void *dst1, void *prev1, void *cur1, void *next1,
+void ff_bwdif_filter_line_c(void *dst1, const void *prev1, const void *cur1, const void *next1,
                             int w, int prefs, int mrefs, int prefs2, int mrefs2,
                             int prefs3, int mrefs3, int prefs4, int mrefs4,
                             int parity, int clip_max);
diff --git a/libavfilter/x86/vf_bwdif_init.c b/libavfilter/x86/vf_bwdif_init.c
index b1d1d6a91c..69a70e3293 100644
--- a/libavfilter/x86/vf_bwdif_init.c
+++ b/libavfilter/x86/vf_bwdif_init.c
@@ -24,28 +24,28 @@
 #include "libavutil/x86/cpu.h"
 #include "libavfilter/bwdifdsp.h"
 
-void ff_bwdif_filter_line_sse2(void *dst, void *prev, void *cur, void *next,
+void ff_bwdif_filter_line_sse2(void *dst, const void *prev, const void *cur, const void *next,
                                int w, int prefs, int mrefs, int prefs2,
                                int mrefs2, int prefs3, int mrefs3, int prefs4,
                                int mrefs4, int parity, int clip_max);
-void ff_bwdif_filter_line_ssse3(void *dst, void *prev, void *cur, void *next,
+void ff_bwdif_filter_line_ssse3(void *dst, const void *prev, const void *cur, const void *next,
                                 int w, int prefs, int mrefs, int prefs2,
                                 int mrefs2, int prefs3, int mrefs3, int prefs4,
                                 int mrefs4, int parity, int clip_max);
-void ff_bwdif_filter_line_avx2(void *dst, void *prev, void *cur, void *next,
+void ff_bwdif_filter_line_avx2(void *dst, const void *prev, const void *cur, const void *next,
                                int w, int prefs, int mrefs, int prefs2,
                                int mrefs2, int prefs3, int mrefs3, int prefs4,
                                int mrefs4, int parity, int clip_max);
 
-void ff_bwdif_filter_line_12bit_sse2(void *dst, void *prev, void *cur, void *next,
+void ff_bwdif_filter_line_12bit_sse2(void *dst, const void *prev, const void *cur, const void *next,
                                      int w, int prefs, int mrefs, int prefs2,
                                      int mrefs2, int prefs3, int mrefs3, int prefs4,
                                      int mrefs4, int parity, int clip_max);
-void ff_bwdif_filter_line_12bit_ssse3(void *dst, void *prev, void *cur, void *next,
+void ff_bwdif_filter_line_12bit_ssse3(void *dst, const void *prev, const void *cur, const void *next,
                                       int w, int prefs, int mrefs, int prefs2,
                                       int mrefs2, int prefs3, int mrefs3, int prefs4,
                                       int mrefs4, int parity, int clip_max);
-void ff_bwdif_filter_line_12bit_avx2(void *dst, void *prev, void *cur, void *next,
+void ff_bwdif_filter_line_12bit_avx2(void *dst, const void *prev, const void *cur, const void *next,
                                      int w, int prefs, int mrefs, int prefs2,
                                      int mrefs2, int prefs3, int mrefs3, int prefs4,
                                      int mrefs4, int parity, int clip_max);



More information about the ffmpeg-cvslog mailing list