Browse code

Add some forgotten const to function arguments in libavfilter & libavformat.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/05/17 07:46:48
Showing 6 changed files
... ...
@@ -33,16 +33,16 @@ typedef struct {
33 33
     int chroma_r;  ///< blur radius for the chroma planes
34 34
     uint16_t *buf; ///< holds image data for blur algorithm passed into filter.
35 35
     /// DSP functions.
36
-    void (*filter_line) (uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers);
37
-    void (*blur_line) (uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width);
36
+    void (*filter_line) (uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers);
37
+    void (*blur_line) (uint16_t *dc, uint16_t *buf, const uint16_t *buf1, const uint8_t *src, int src_linesize, int width);
38 38
 } GradFunContext;
39 39
 
40
-void ff_gradfun_filter_line_c(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers);
41
-void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width);
40
+void ff_gradfun_filter_line_c(uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers);
41
+void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, const uint16_t *buf1, const uint8_t *src, int src_linesize, int width);
42 42
 
43
-void ff_gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers);
44
-void ff_gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers);
43
+void ff_gradfun_filter_line_mmx2(uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers);
44
+void ff_gradfun_filter_line_ssse3(uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers);
45 45
 
46
-void ff_gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width);
46
+void ff_gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, const uint16_t *buf1, const uint8_t *src, int src_linesize, int width);
47 47
 
48 48
 #endif /* AVFILTER_GRADFUN_H */
... ...
@@ -49,7 +49,7 @@ DECLARE_ALIGNED(16, static const uint16_t, dither)[8][8] = {
49 49
     {0x54,0x34,0x4C,0x2C,0x52,0x32,0x4A,0x2A},
50 50
 };
51 51
 
52
-void ff_gradfun_filter_line_c(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers)
52
+void ff_gradfun_filter_line_c(uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers)
53 53
 {
54 54
     int x;
55 55
     for (x = 0; x < width; x++, dc += x & 1) {
... ...
@@ -63,7 +63,7 @@ void ff_gradfun_filter_line_c(uint8_t *dst, uint8_t *src, uint16_t *dc, int widt
63 63
     }
64 64
 }
65 65
 
66
-void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width)
66
+void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, const uint16_t *buf1, const uint8_t *src, int src_linesize, int width)
67 67
 {
68 68
     int x, v, old;
69 69
     for (x = 0; x < width; x++) {
... ...
@@ -74,7 +74,7 @@ void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t
74 74
     }
75 75
 }
76 76
 
77
-static void filter(GradFunContext *ctx, uint8_t *dst, uint8_t *src, int width, int height, int dst_linesize, int src_linesize, int r)
77
+static void filter(GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int width, int height, int dst_linesize, int src_linesize, int r)
78 78
 {
79 79
     int bstride = FFALIGN(width, 16) / 2;
80 80
     int y;
... ...
@@ -63,7 +63,7 @@ typedef struct {
63 63
     FilterParam chroma; ///< chroma parameters (width, height, amount)
64 64
 } UnsharpContext;
65 65
 
66
-static void unsharpen(uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, FilterParam *fp)
66
+static void unsharpen(uint8_t *dst, const uint8_t *src, int dst_stride, int src_stride, int width, int height, FilterParam *fp)
67 67
 {
68 68
     uint32_t **sc = fp->sc;
69 69
     uint32_t sr[(MAX_SIZE * MAX_SIZE) - 1], tmp1, tmp2;
... ...
@@ -96,7 +96,7 @@ static void unsharpen(uint8_t *dst, uint8_t *src, int dst_stride, int src_stride
96 96
                 tmp1 = sc[z + 1][x + fp->steps_x] + tmp2; sc[z + 1][x + fp->steps_x] = tmp2;
97 97
             }
98 98
             if (x >= fp->steps_x && y >= fp->steps_y) {
99
-                uint8_t* srx = src - fp->steps_y * src_stride + x - fp->steps_x;
99
+                const uint8_t* srx = src - fp->steps_y * src_stride + x - fp->steps_x;
100 100
                 uint8_t* dsx = dst - fp->steps_y * dst_stride + x - fp->steps_x;
101 101
 
102 102
                 res = (int32_t)*srx + ((((int32_t) * srx - (int32_t)((tmp1 + fp->halfscale) >> fp->scalebits)) * fp->amount) >> 16);
... ...
@@ -23,7 +23,7 @@
23 23
 DECLARE_ALIGNED(16, static const uint16_t, pw_7f)[8] = {0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F};
24 24
 DECLARE_ALIGNED(16, static const uint16_t, pw_ff)[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
25 25
 
26
-void ff_gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers)
26
+void ff_gradfun_filter_line_mmx2(uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers)
27 27
 {
28 28
 #if HAVE_MMX
29 29
     intptr_t x;
... ...
@@ -71,7 +71,7 @@ void ff_gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, int w
71 71
 #endif
72 72
 }
73 73
 
74
-void ff_gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers)
74
+void ff_gradfun_filter_line_ssse3(uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers)
75 75
 {
76 76
 #if HAVE_SSSE3
77 77
     intptr_t x;
... ...
@@ -118,7 +118,7 @@ void ff_gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, int
118 118
 #endif // HAVE_SSSE3
119 119
 }
120 120
 
121
-void ff_gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width)
121
+void ff_gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, const uint16_t *buf1, const uint8_t *src, int src_linesize, int width)
122 122
 {
123 123
 #if HAVE_SSE
124 124
 #define BLURV(load)\
... ...
@@ -152,7 +152,7 @@ static int send_command_packet(MMSTContext *mmst)
152 152
     return 0;
153 153
 }
154 154
 
155
-static void mms_put_utf16(MMSContext *mms, uint8_t *src)
155
+static void mms_put_utf16(MMSContext *mms, const uint8_t *src)
156 156
 {
157 157
     AVIOContext bic;
158 158
     int size = mms->write_out_ptr - mms->out_buffer;
... ...
@@ -1689,13 +1689,13 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
1689 1689
     }
1690 1690
 }
1691 1691
 
1692
-static int mov_open_dref(AVIOContext **pb, char *src, MOVDref *ref)
1692
+static int mov_open_dref(AVIOContext **pb, const char *src, MOVDref *ref)
1693 1693
 {
1694 1694
     /* try relative path, we do not try the absolute because it can leak information about our
1695 1695
        system to an attacker */
1696 1696
     if (ref->nlvl_to > 0 && ref->nlvl_from > 0) {
1697 1697
         char filename[1024];
1698
-        char *src_path;
1698
+        const char *src_path;
1699 1699
         int i, l;
1700 1700
 
1701 1701
         /* find a source dir */