]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
consts
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 1 Feb 2008 03:26:31 +0000 (03:26 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 1 Feb 2008 03:26:31 +0000 (03:26 +0000)
I have underestimated this a little, and these are just some ...

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11708 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

33 files changed:
libavcodec/bytestream.h
libavcodec/dnxhdenc.c
libavcodec/dpcm.c
libavcodec/dsicinav.c
libavcodec/dsputil.c
libavcodec/dv.c
libavcodec/dvbsubdec.c
libavcodec/dvdsubdec.c
libavcodec/gifdec.c
libavcodec/idcinvideo.c
libavcodec/imc.c
libavcodec/indeo2.c
libavcodec/indeo3.c
libavcodec/interplayvideo.c
libavcodec/kmvc.c
libavcodec/lcldec.c
libavcodec/loco.c
libavcodec/lzw.c
libavcodec/lzw.h
libavcodec/mmvideo.c
libavcodec/mpc7.c
libavcodec/mpc8.c
libavcodec/mpegaudiodec.c
libavcodec/msrle.c
libavcodec/msvideo1.c
libavcodec/nellymoserdec.c
libavcodec/nuv.c
libavcodec/pcm.c
libavcodec/roqvideodec.c
libavcodec/sgidec.c
libavcodec/ulti.c
libavcodec/vb.c
libavcodec/xsubdec.c

index 653ccff2af5243b07de96bf3c094b3a4d95eb96b..3a94e719ca4ab46d2d2a4b4393198114693cfe52 100644 (file)
@@ -25,7 +25,7 @@
 #include "common.h"
 
 #define DEF_T(type, name, bytes, read, write)                             \
-static av_always_inline type bytestream_get_ ## name(uint8_t **b){\
+static av_always_inline type bytestream_get_ ## name(const uint8_t **b){\
     (*b) += bytes;\
     return read(*b - bytes);\
 }\
@@ -53,7 +53,7 @@ DEF  (byte, 1, AV_RB8 , AV_WB8 )
 #undef DEF64
 #undef DEF_T
 
-static av_always_inline unsigned int bytestream_get_buffer(uint8_t **b, uint8_t *dst, unsigned int size)
+static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, uint8_t *dst, unsigned int size)
 {
     memcpy(dst, *b, size);
     (*b) += size;
index 9ca842e1d74f9e1ed53bc4da1ecfc2e6d6666db6..3da6a1a67b2382446f75619b723de4e316bef7a5 100644 (file)
@@ -693,7 +693,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
 
 static int dnxhd_rc_cmp(const void *a, const void *b)
 {
-    return ((RCCMPEntry *)b)->value - ((RCCMPEntry *)a)->value;
+    return ((const RCCMPEntry *)b)->value - ((const RCCMPEntry *)a)->value;
 }
 
 static int dnxhd_encode_fast(AVCodecContext *avctx, DNXHDEncContext *ctx)
@@ -733,7 +733,7 @@ static int dnxhd_encode_fast(AVCodecContext *avctx, DNXHDEncContext *ctx)
     return 0;
 }
 
-static void dnxhd_load_picture(DNXHDEncContext *ctx, AVFrame *frame)
+static void dnxhd_load_picture(DNXHDEncContext *ctx, const AVFrame *frame)
 {
     int i;
 
@@ -753,7 +753,7 @@ static void dnxhd_load_picture(DNXHDEncContext *ctx, AVFrame *frame)
     ctx->cur_field = frame->interlaced_frame && !frame->top_field_first;
 }
 
-static int dnxhd_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
+static int dnxhd_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, const void *data)
 {
     DNXHDEncContext *ctx = avctx->priv_data;
     int first_field = 1;
index 53382d66356ca119fb4650ef1998aef81a15b85d..01dd5cce04ed298b90c51e82e4aceee3244f7e06 100644 (file)
@@ -159,7 +159,7 @@ static int dpcm_decode_init(AVCodecContext *avctx)
 
 static int dpcm_decode_frame(AVCodecContext *avctx,
                              void *data, int *data_size,
-                             uint8_t *buf, int buf_size)
+                             const uint8_t *buf, int buf_size)
 {
     DPCMContext *s = avctx->priv_data;
     int in, out = 0;
index f593a59d707a013a0c1baa4b4aed0034c55a1e40..e549487c7e4269b3fb65eb66eb86074cf6062dbe 100644 (file)
@@ -195,7 +195,7 @@ static void cin_decode_rle(const unsigned char *src, int src_size, unsigned char
 
 static int cinvideo_decode_frame(AVCodecContext *avctx,
                                  void *data, int *data_size,
-                                 uint8_t *buf, int buf_size)
+                                 const uint8_t *buf, int buf_size)
 {
     CinVideoContext *cin = avctx->priv_data;
     int i, y, palette_type, palette_colors_count, bitmap_frame_type, bitmap_frame_size;
@@ -311,10 +311,10 @@ static int cinaudio_decode_init(AVCodecContext *avctx)
 
 static int cinaudio_decode_frame(AVCodecContext *avctx,
                                  void *data, int *data_size,
-                                 uint8_t *buf, int buf_size)
+                                 const uint8_t *buf, int buf_size)
 {
     CinAudioContext *cin = avctx->priv_data;
-    uint8_t *src = buf;
+    const uint8_t *src = buf;
     int16_t *samples = (int16_t *)data;
 
     buf_size = FFMIN(buf_size, *data_size/2);
index 0d4ac92b9bcc7544739617cf04b8d9bb38640482..d9e0127e4f96d50d0e6865b538efcf107591661e 100644 (file)
@@ -3785,7 +3785,7 @@ void ff_vector_fmul_add_add_c(float *dst, const float *src0, const float *src1,
 void ff_float_to_int16_c(int16_t *dst, const float *src, int len){
     int i;
     for(i=0; i<len; i++) {
-        int_fast32_t tmp = ((int32_t*)src)[i];
+        int_fast32_t tmp = ((const int32_t*)src)[i];
         if(tmp & 0xf0000){
             tmp = (0x43c0ffff - tmp)>>31;
             // is this faster on some gcc/cpu combinations?
index 2244263b93ff8793c8ae876fefadabbd4a7e943c..8db3226744961fb3171c8a4ce783d3eb0c65d27a 100644 (file)
@@ -1031,7 +1031,7 @@ static int dv_encode_mt(AVCodecContext *avctx, void* sl)
    144000 bytes for PAL - or twice those for 50Mbps) */
 static int dvvideo_decode_frame(AVCodecContext *avctx,
                                  void *data, int *data_size,
-                                 uint8_t *buf, int buf_size)
+                                 const uint8_t *buf, int buf_size)
 {
     DVVideoContext *s = avctx->priv_data;
 
index d0f39a3b2e47ad63e830d4c45a24089652ca20ae..5822564e786b756287d3f5870c666d7585830e19 100644 (file)
@@ -429,7 +429,7 @@ static int dvbsub_close_decoder(AVCodecContext *avctx)
 }
 
 static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len,
-                                   uint8_t **srcbuf, int buf_size,
+                                   const uint8_t **srcbuf, int buf_size,
                                    int non_mod, uint8_t *map_table)
 {
     GetBitContext gb;
@@ -534,7 +534,7 @@ static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len,
 }
 
 static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len,
-                                   uint8_t **srcbuf, int buf_size,
+                                   const uint8_t **srcbuf, int buf_size,
                                    int non_mod, uint8_t *map_table)
 {
     GetBitContext gb;
@@ -655,10 +655,10 @@ static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len,
 }
 
 static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len,
-                                    uint8_t **srcbuf, int buf_size,
+                                    const uint8_t **srcbuf, int buf_size,
                                     int non_mod, uint8_t *map_table)
 {
-    uint8_t *sbuf_end = (*srcbuf) + buf_size;
+    const uint8_t *sbuf_end = (*srcbuf) + buf_size;
     int bits;
     int run_length;
     int pixels_read = 0;
@@ -714,12 +714,12 @@ static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len,
 
 
 static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDisplay *display,
-                                          uint8_t *buf, int buf_size, int top_bottom, int non_mod)
+                                          const uint8_t *buf, int buf_size, int top_bottom, int non_mod)
 {
     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
 
     DVBSubRegion *region = get_region(ctx, display->region_id);
-    uint8_t *buf_end = buf + buf_size;
+    const uint8_t *buf_end = buf + buf_size;
     uint8_t *pbuf;
     int x_pos, y_pos;
     int i;
@@ -833,12 +833,12 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
 }
 
 static void dvbsub_parse_object_segment(AVCodecContext *avctx,
-                                        uint8_t *buf, int buf_size)
+                                        const uint8_t *buf, int buf_size)
 {
     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
 
-    uint8_t *buf_end = buf + buf_size;
-    uint8_t *block;
+    const uint8_t *buf_end = buf + buf_size;
+    const uint8_t *block;
     int object_id;
     DVBSubObject *object;
     DVBSubObjectDisplay *display;
@@ -892,11 +892,11 @@ static void dvbsub_parse_object_segment(AVCodecContext *avctx,
 }
 
 static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
-                                        uint8_t *buf, int buf_size)
+                                        const uint8_t *buf, int buf_size)
 {
     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
 
-    uint8_t *buf_end = buf + buf_size;
+    const uint8_t *buf_end = buf + buf_size;
     int clut_id;
     DVBSubCLUT *clut;
     int entry_id, depth , full_range;
@@ -982,11 +982,11 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
 
 
 static void dvbsub_parse_region_segment(AVCodecContext *avctx,
-                                        uint8_t *buf, int buf_size)
+                                        const uint8_t *buf, int buf_size)
 {
     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
 
-    uint8_t *buf_end = buf + buf_size;
+    const uint8_t *buf_end = buf + buf_size;
     int region_id, object_id;
     DVBSubRegion *region;
     DVBSubObject *object;
@@ -1098,13 +1098,13 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
 }
 
 static void dvbsub_parse_page_segment(AVCodecContext *avctx,
-                                        uint8_t *buf, int buf_size)
+                                        const uint8_t *buf, int buf_size)
 {
     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
     DVBSubRegionDisplay *display;
     DVBSubRegionDisplay *tmp_display_list, **tmp_ptr;
 
-    uint8_t *buf_end = buf + buf_size;
+    const uint8_t *buf_end = buf + buf_size;
     int region_id;
     int page_state;
 
@@ -1265,7 +1265,7 @@ static void save_display_set(DVBSubContext *ctx)
 }
 #endif
 
-static int dvbsub_display_end_segment(AVCodecContext *avctx, uint8_t *buf,
+static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
                                         int buf_size, AVSubtitle *sub)
 {
     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
@@ -1341,11 +1341,11 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, uint8_t *buf,
 
 static int dvbsub_decode(AVCodecContext *avctx,
                          void *data, int *data_size,
-                         uint8_t *buf, int buf_size)
+                         const uint8_t *buf, int buf_size)
 {
     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
     AVSubtitle *sub = (AVSubtitle*) data;
-    uint8_t *p, *p_end;
+    const uint8_t *p, *p_end;
     int segment_type;
     int page_id;
     int segment_length;
index ed50596563ac59f6d3714d0ad59c3064c4d988ac..0927b7a178411ba6a5dfa3d4d56eab606127a5a3 100644 (file)
@@ -469,7 +469,7 @@ static void ppm_save(const char *filename, uint8_t *bitmap, int w, int h,
 
 static int dvdsub_decode(AVCodecContext *avctx,
                          void *data, int *data_size,
-                         uint8_t *buf, int buf_size)
+                         const uint8_t *buf, int buf_size)
 {
     AVSubtitle *sub = (void *)data;
     int is_menu;
index c08dc9a7027771efd69f8e0fe4c941e71c7c629e..8f0252694bb231eda8997b0becbd9df05c971283 100644 (file)
@@ -47,8 +47,8 @@ typedef struct GifState {
     int gce_delay;
 
     /* LZW compatible decoder */
-    uint8_t *bytestream;
-    uint8_t *bytestream_end;
+    const uint8_t *bytestream;
+    const uint8_t *bytestream_end;
     LZWState *lzw;
 
     /* aux buffers */
@@ -285,7 +285,7 @@ static int gif_decode_init(AVCodecContext *avctx)
     return 0;
 }
 
-static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
+static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
 {
     GifState *s = avctx->priv_data;
     AVFrame *picture = data;
index eeb538c4f0d3680d85f9ac3f3b3cbe7e8e0de69e..79ed6fb1701d422a3f75bc772f8e9ac0c63301a8 100644 (file)
@@ -69,7 +69,7 @@ typedef struct IdcinContext {
     DSPContext dsp;
     AVFrame frame;
 
-    unsigned char *buf;
+    const unsigned char *buf;
     int size;
 
     hnode_t huff_nodes[256][HUF_TOKENS*2];
@@ -212,7 +212,7 @@ static void idcin_decode_vlcs(IdcinContext *s)
 
 static int idcin_decode_frame(AVCodecContext *avctx,
                               void *data, int *data_size,
-                              uint8_t *buf, int buf_size)
+                              const uint8_t *buf, int buf_size)
 {
     IdcinContext *s = avctx->priv_data;
     AVPaletteControl *palette_control = avctx->palctrl;
index 9260b9ba2b7de3752431ae9d502b51f662481da0..6d1ec098a0bf079b44aa72dc76fcaf1de89817e6 100644 (file)
@@ -625,7 +625,7 @@ static int imc_get_coeffs (IMCContext* q) {
 
 static int imc_decode_frame(AVCodecContext * avctx,
                             void *data, int *data_size,
-                            uint8_t * buf, int buf_size)
+                            const uint8_t * buf, int buf_size)
 {
 
     IMCContext *q = avctx->priv_data;
index 9935854b74d5daf86f60a27766e44112c7ca2d54..4a7e2d01f537c0dcfc84f4381c3af27313972fe1 100644 (file)
@@ -136,7 +136,7 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_
 
 static int ir2_decode_frame(AVCodecContext *avctx,
                         void *data, int *data_size,
-                        uint8_t *buf, int buf_size)
+                        const uint8_t *buf, int buf_size)
 {
     Ir2Context * const s = avctx->priv_data;
     AVFrame *picture = data;
index 96b9854961595ad8d77aaf520e45323273767b77..ab221ddff90d69299e7e29a31c7f18b6145fa2fb 100644 (file)
@@ -176,12 +176,12 @@ static void iv_free_func(Indeo3DecodeContext *s)
 
 /* ---------------------------------------------------------------------- */
 static unsigned long iv_decode_frame(Indeo3DecodeContext *s,
-                                     unsigned char *buf, int buf_size)
+                                     const unsigned char *buf, int buf_size)
 {
   unsigned int hdr_width, hdr_height,
     chroma_width, chroma_height;
   unsigned long fflags1, fflags2, fflags3, offs1, offs2, offs3, offs;
-  unsigned char *hdr_pos, *buf_pos;
+  const unsigned char *hdr_pos, *buf_pos;
 
   buf_pos = buf;
   buf_pos += 18;
@@ -1074,7 +1074,7 @@ static int indeo3_decode_init(AVCodecContext *avctx)
 
 static int indeo3_decode_frame(AVCodecContext *avctx,
                                void *data, int *data_size,
-                               unsigned char *buf, int buf_size)
+                               const unsigned char *buf, int buf_size)
 {
     Indeo3DecodeContext *s=avctx->priv_data;
     unsigned char *src, *dest;
index 23532f42af5abf8d441bc08424d4c9fd697f0d2f..3731fb2757aa3e24f6937c99dbc10753922b1305 100644 (file)
@@ -60,14 +60,14 @@ typedef struct IpvideoContext {
     AVFrame second_last_frame;
     AVFrame last_frame;
     AVFrame current_frame;
-    unsigned char *decoding_map;
+    const unsigned char *decoding_map;
     int decoding_map_size;
 
-    unsigned char *buf;
+    const unsigned char *buf;
     int size;
 
-    unsigned char *stream_ptr;
-    unsigned char *stream_end;
+    const unsigned char *stream_ptr;
+    const unsigned char *stream_end;
     unsigned char *pixel_ptr;
     int line_inc;
     int stride;
@@ -879,7 +879,7 @@ static int ipvideo_decode_init(AVCodecContext *avctx)
 
 static int ipvideo_decode_frame(AVCodecContext *avctx,
                                 void *data, int *data_size,
-                                uint8_t *buf, int buf_size)
+                                const uint8_t *buf, int buf_size)
 {
     IpvideoContext *s = avctx->priv_data;
     AVPaletteControl *palette_control = avctx->palctrl;
index ccff678fa4467d179d481e310a211ed171c57e82..395ca2cb99ec0e0a6c59170aa13182233b2dee61 100644 (file)
@@ -67,7 +67,7 @@ typedef struct BitBuf {
     } \
 }
 
-static void kmvc_decode_intra_8x8(KmvcContext * ctx, uint8_t * src, int w, int h)
+static void kmvc_decode_intra_8x8(KmvcContext * ctx, const uint8_t * src, int w, int h)
 {
     BitBuf bb;
     int res, val;
@@ -142,7 +142,7 @@ static void kmvc_decode_intra_8x8(KmvcContext * ctx, uint8_t * src, int w, int h
         }
 }
 
-static void kmvc_decode_inter_8x8(KmvcContext * ctx, uint8_t * src, int w, int h)
+static void kmvc_decode_inter_8x8(KmvcContext * ctx, const uint8_t * src, int w, int h)
 {
     BitBuf bb;
     int res, val;
@@ -224,7 +224,7 @@ static void kmvc_decode_inter_8x8(KmvcContext * ctx, uint8_t * src, int w, int h
         }
 }
 
-static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, uint8_t * buf,
+static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, const uint8_t * buf,
                         int buf_size)
 {
     KmvcContext *const ctx = avctx->priv_data;
index 1364c3d147b611170206cb91c79e02b8c6917fb1..80cd1d7dda0965c2a426461ea5e951635bb220e2 100644 (file)
@@ -161,7 +161,7 @@ static unsigned int mszh_decomp(unsigned char * srcptr, int srclen, unsigned cha
  * Decode a frame
  *
  */
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
 {
     LclDecContext * const c = avctx->priv_data;
     unsigned char *encoded = (unsigned char *)buf;
index 355e955aad4d0d1b2661dfc03f2d0d4edb873112..14be6f0192029ba44f0310d989f935a3603f60fc 100644 (file)
@@ -116,7 +116,7 @@ static inline int loco_predict(uint8_t* data, int stride, int step)
 }
 
 static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int height,
-                             int stride, uint8_t *buf, int buf_size, int step)
+                             int stride, const uint8_t *buf, int buf_size, int step)
 {
     RICEContext rc;
     int val;
@@ -157,7 +157,7 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
 
 static int decode_frame(AVCodecContext *avctx,
                         void *data, int *data_size,
-                        uint8_t *buf, int buf_size)
+                        const uint8_t *buf, int buf_size)
 {
     LOCOContext * const l = avctx->priv_data;
     AVFrame * const p= (AVFrame*)&l->pic;
index 6bc0b9a48a2bac009339dbc561a8f1abd2ce8760..833c9d0ab376b936988523e27645a29cf5c81110 100644 (file)
@@ -42,7 +42,7 @@ static const uint16_t mask[17] =
 };
 
 struct LZWState {
-    uint8_t *pbuf, *ebuf;
+    const uint8_t *pbuf, *ebuf;
     int bbits;
     unsigned int bbuf;
 
@@ -91,7 +91,7 @@ static int lzw_get_code(struct LZWState * s)
     return c & s->curmask;
 }
 
-uint8_t* ff_lzw_cur_ptr(LZWState *p)
+const uint8_t* ff_lzw_cur_ptr(LZWState *p)
 {
     return ((struct LZWState*)p)->pbuf;
 }
@@ -127,7 +127,7 @@ void ff_lzw_decode_close(LZWState **p)
  * @param buf_size input data size
  * @param mode decoder working mode - either GIF or TIFF
  */
-int ff_lzw_decode_init(LZWState *p, int csize, uint8_t *buf, int buf_size, int mode)
+int ff_lzw_decode_init(LZWState *p, int csize, const uint8_t *buf, int buf_size, int mode)
 {
     struct LZWState *s = (struct LZWState *)p;
 
index 69038627079fb66f47c9538c5c47abb3ae5fbe77..161f0dce5615c079df98a51f61c13625b8475b90 100644 (file)
@@ -43,9 +43,9 @@ typedef void LZWState;
 /* first two functions de/allocate memory for LZWState */
 void ff_lzw_decode_open(LZWState **p);
 void ff_lzw_decode_close(LZWState **p);
-int ff_lzw_decode_init(LZWState *s, int csize, uint8_t *buf, int buf_size, int mode);
+int ff_lzw_decode_init(LZWState *s, int csize, const uint8_t *buf, int buf_size, int mode);
 int ff_lzw_decode(LZWState *s, uint8_t *buf, int len);
-uint8_t* ff_lzw_cur_ptr(LZWState *lzw);
+const uint8_t* ff_lzw_cur_ptr(LZWState *lzw);
 void ff_lzw_decode_tail(LZWState *lzw);
 
 /** LZW encode state */
index d1b9cb04e74922db9444c05548b846de0b0a286a..9c169a0044de82f2777344bb078b3f34ec56598a 100644 (file)
@@ -150,7 +150,7 @@ static void mm_decode_inter(MmContext * s, int half_horiz, int half_vert, const
 
 static int mm_decode_frame(AVCodecContext *avctx,
                             void *data, int *data_size,
-                            uint8_t *buf, int buf_size)
+                            const uint8_t *buf, int buf_size)
 {
     MmContext *s = avctx->priv_data;
     AVPaletteControl *palette_control = avctx->palctrl;
index 1632dfc2af5aa277bc1a420dc532d8d868ac09da..21154d01948fab78be66217d1bde74633286f387 100644 (file)
@@ -158,7 +158,7 @@ static inline void idx_to_quant(MPCContext *c, GetBitContext *gb, int idx, int *
 
 static int mpc7_decode_frame(AVCodecContext * avctx,
                             void *data, int *data_size,
-                            uint8_t * buf, int buf_size)
+                            const uint8_t * buf, int buf_size)
 {
     MPCContext *c = avctx->priv_data;
     GetBitContext gb;
index c6c62f6611017e2be66db0fca4cb8ab8b45d3527..b2115031128ab17d0932beac67e21c66339d929b 100644 (file)
@@ -182,7 +182,7 @@ static int mpc8_decode_init(AVCodecContext * avctx)
 
 static int mpc8_decode_frame(AVCodecContext * avctx,
                             void *data, int *data_size,
-                            uint8_t * buf, int buf_size)
+                            const uint8_t * buf, int buf_size)
 {
     MPCContext *c = avctx->priv_data;
     GetBitContext gb2, *gb = &gb2;
index 1a9e6ab92e779fabac03d8cda063d1c604592d82..75903e950ae1945cb9a60db9290967e50e56e597 100644 (file)
@@ -2367,7 +2367,7 @@ static int mp_decode_frame(MPADecodeContext *s,
 
 static int decode_frame(AVCodecContext * avctx,
                         void *data, int *data_size,
-                        uint8_t * buf, int buf_size)
+                        const uint8_t * buf, int buf_size)
 {
     MPADecodeContext *s = avctx->priv_data;
     uint32_t header;
@@ -2438,7 +2438,7 @@ static void flush(AVCodecContext *avctx){
 #ifdef CONFIG_MP3ADU_DECODER
 static int decode_frame_adu(AVCodecContext * avctx,
                         void *data, int *data_size,
-                        uint8_t * buf, int buf_size)
+                        const uint8_t * buf, int buf_size)
 {
     MPADecodeContext *s = avctx->priv_data;
     uint32_t header;
@@ -2564,7 +2564,7 @@ static int decode_close_mp3on4(AVCodecContext * avctx)
 
 static int decode_frame_mp3on4(AVCodecContext * avctx,
                         void *data, int *data_size,
-                        uint8_t * buf, int buf_size)
+                        const uint8_t * buf, int buf_size)
 {
     MP3On4DecodeContext *s = avctx->priv_data;
     MPADecodeContext *m;
@@ -2574,7 +2574,7 @@ static int decode_frame_mp3on4(AVCodecContext * avctx,
     OUT_INT decoded_buf[MPA_FRAME_SIZE * MPA_MAX_CHANNELS];
     OUT_INT *outptr, *bp;
     int fsize;
-    unsigned char *start2 = buf, *start;
+    const unsigned char *start2 = buf, *start;
     int fr, i, j, n;
     int off = avctx->channels;
     int *coff = chan_offset[s->chan_cfg];
index 4b9dc0ce5bae4078d89e92a291b3674db9879889..51893cbb7bb332a69db5cef007a567a3f0da27f8 100644 (file)
@@ -43,7 +43,7 @@ typedef struct MsrleContext {
     AVCodecContext *avctx;
     AVFrame frame;
 
-    unsigned char *buf;
+    const unsigned char *buf;
     int size;
 
 } MsrleContext;
@@ -250,7 +250,7 @@ static int msrle_decode_init(AVCodecContext *avctx)
 
 static int msrle_decode_frame(AVCodecContext *avctx,
                               void *data, int *data_size,
-                              uint8_t *buf, int buf_size)
+                              const uint8_t *buf, int buf_size)
 {
     MsrleContext *s = avctx->priv_data;
 
index 2106498baedcebf29c85ea0da7acf8a1958b8bfb..baac48a851dbad97a635e4870862b0d1c4d5185a 100644 (file)
@@ -52,7 +52,7 @@ typedef struct Msvideo1Context {
     DSPContext dsp;
     AVFrame frame;
 
-    unsigned char *buf;
+    const unsigned char *buf;
     int size;
 
     int mode_8bit;  /* if it's not 8-bit, it's 16-bit */
@@ -297,7 +297,7 @@ static void msvideo1_decode_16bit(Msvideo1Context *s)
 
 static int msvideo1_decode_frame(AVCodecContext *avctx,
                                 void *data, int *data_size,
-                                uint8_t *buf, int buf_size)
+                                const uint8_t *buf, int buf_size)
 {
     Msvideo1Context *s = avctx->priv_data;
 
index aae3c035009a9918990cd009fd0262ba69883cbd..7c83bd5620e0529936e2339f89d86403f016dda6 100644 (file)
@@ -274,7 +274,7 @@ static void get_sample_bits(const float *buf, int *bits)
     }
 }
 
-void nelly_decode_block(NellyMoserDecodeContext *s, unsigned char block[NELLY_BLOCK_LEN], float audio[NELLY_SAMPLES])
+void nelly_decode_block(NellyMoserDecodeContext *s, const unsigned char block[NELLY_BLOCK_LEN], float audio[NELLY_SAMPLES])
 {
     int i,j;
     float buf[NELLY_FILL_LEN], pows[NELLY_FILL_LEN];
@@ -358,7 +358,7 @@ static int decode_init(AVCodecContext * avctx) {
 
 static int decode_tag(AVCodecContext * avctx,
                       void *data, int *data_size,
-                      uint8_t * buf, int buf_size) {
+                      const uint8_t * buf, int buf_size) {
     NellyMoserDecodeContext *s = avctx->priv_data;
     int blocks, i;
     int16_t* samples;
index d157383672b6808f0e4f8916cd9fd2bddaba478e..d25fa6f8201db06ec32aefbe1f1357249a98145b 100644 (file)
@@ -129,7 +129,7 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, int qualit
 }
 
 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
-                        uint8_t *buf, int buf_size) {
+                        const uint8_t *buf, int buf_size) {
     NuvContext *c = avctx->priv_data;
     AVFrame *picture = data;
     int orig_size = buf_size;
index c7a7e82477773ccc5c330448ca5a32afb383d7cf..926c6f01095f2616c3d9fdc8a53ba43a488c147a 100644 (file)
@@ -355,7 +355,7 @@ static int pcm_decode_init(AVCodecContext * avctx)
  * \param src_len number of bytes in src
  */
 static inline void decode_to16(int bps, int le, int us,
-                               uint8_t **src, short **samples, int src_len)
+                               const uint8_t **src, short **samples, int src_len)
 {
     int usum = us ? -0x8000 : 0;
     register int n = src_len / bps;
@@ -373,12 +373,12 @@ static inline void decode_to16(int bps, int le, int us,
 
 static int pcm_decode_frame(AVCodecContext *avctx,
                             void *data, int *data_size,
-                            uint8_t *buf, int buf_size)
+                            const uint8_t *buf, int buf_size)
 {
     PCMDecode *s = avctx->priv_data;
     int c, n;
     short *samples;
-    uint8_t *src, *src2[MAX_CHANNELS];
+    const uint8_t *src, *src2[MAX_CHANNELS];
 
     samples = data;
     src = buf;
index 2d811c5b25ccd29b89985c779a66dec9e9173d3f..43d14a43fdb62d5ac182683028e601949f4de0b7 100644 (file)
@@ -43,7 +43,7 @@ static void roqvideo_decode_frame(RoqContext *ri)
     int vqid, bpos, xpos, ypos, xp, yp, x, y, mx, my;
     int frame_stats[2][4] = {{0},{0}};
     roq_qcell *qcell;
-    unsigned char *buf = ri->buf;
+    const unsigned char *buf = ri->buf;
     unsigned char *buf_end = ri->buf + ri->size;
 
     while (buf < buf_end) {
index aac32b41667bd4cd1bcc3b708baa6243a7e82829..5a85cdcdd03bf6d64024d1abb74a38acac162ef6 100644 (file)
@@ -40,7 +40,7 @@ typedef struct SgiState {
  * @param pixelstride pixel stride of input buffer
  * @return size of output in bytes, -1 if buffer overflows
  */
-static int expand_rle_row(uint8_t *in_buf, uint8_t* in_end,
+static int expand_rle_row(const uint8_t *in_buf, const uint8_t* in_end,
             unsigned char *out_buf, uint8_t* out_end, int pixelstride)
 {
     unsigned char pixel, count;
@@ -80,12 +80,12 @@ static int expand_rle_row(uint8_t *in_buf, uint8_t* in_end,
  * @param s the current image state
  * @return 0 if no error, else return error number.
  */
-static int read_rle_sgi(unsigned char* out_buf, uint8_t *in_buf,
-                        uint8_t *in_end, SgiState* s)
+static int read_rle_sgi(unsigned char* out_buf, const uint8_t *in_buf,
+                        const uint8_t *in_end, SgiState* s)
 {
     uint8_t *dest_row;
     unsigned int len = s->height * s->depth * 4;
-    uint8_t *start_table = in_buf;
+    const uint8_t *start_table = in_buf;
     unsigned int y, z;
     unsigned int start_offset;
 
@@ -121,10 +121,10 @@ static int read_rle_sgi(unsigned char* out_buf, uint8_t *in_buf,
  * @return 0 if read success, otherwise return -1.
  */
 static int read_uncompressed_sgi(unsigned char* out_buf, uint8_t* out_end,
-                uint8_t *in_buf, uint8_t *in_end, SgiState* s)
+                const uint8_t *in_buf, const uint8_t *in_end, SgiState* s)
 {
     int x, y, z;
-    uint8_t *ptr;
+    const uint8_t *ptr;
     unsigned int offset = s->height * s->width;
 
     /* Test buffer size. */
@@ -147,12 +147,12 @@ static int read_uncompressed_sgi(unsigned char* out_buf, uint8_t* out_end,
 
 static int decode_frame(AVCodecContext *avctx,
                         void *data, int *data_size,
-                        uint8_t *in_buf, int buf_size)
+                        const uint8_t *in_buf, int buf_size)
 {
     SgiState *s = avctx->priv_data;
     AVFrame *picture = data;
     AVFrame *p = &s->picture;
-    uint8_t *in_end = in_buf + buf_size;
+    const uint8_t *in_end = in_buf + buf_size;
     unsigned int dimension, bytes_per_channel, rle;
     int ret = 0;
     uint8_t *out_buf, *out_end;
index 5b1f4aaaf05df5bc6869b8092183085ef94fb618..cf0c28f1f093d27f4dd54a6994e8889a64412e3e 100644 (file)
@@ -200,7 +200,7 @@ static void ulti_grad(AVFrame *frame, int x, int y, uint8_t *Y, int chroma, int
 
 static int ulti_decode_frame(AVCodecContext *avctx,
                              void *data, int *data_size,
-                             uint8_t *buf, int buf_size)
+                             const uint8_t *buf, int buf_size)
 {
     UltimotionDecodeContext *s=avctx->priv_data;
     int modifier = 0;
index 5854a0f63d39ccd58c1a688bdbd3db50a048ad3b..7a2e0070560352f95594e2e53c8bc71e08604e95 100644 (file)
@@ -44,7 +44,7 @@ typedef struct VBDecContext {
 
     uint8_t *frame, *prev_frame;
     uint32_t pal[256];
-    uint8_t *stream;
+    const uint8_t *stream;
 } VBDecContext;
 
 static const uint16_t vb_patterns[64] = {
@@ -82,7 +82,7 @@ static inline int check_line(uint8_t *buf, uint8_t *start, uint8_t *end)
     return buf >= start && (buf + 4) <= end;
 }
 
-static int vb_decode_framedata(VBDecContext *c, uint8_t *buf, int offset)
+static int vb_decode_framedata(VBDecContext *c, const uint8_t *buf, int offset)
 {
     uint8_t *prev, *cur;
     int blk, blocks, t, blk2;
@@ -173,7 +173,7 @@ static int vb_decode_framedata(VBDecContext *c, uint8_t *buf, int offset)
     return 0;
 }
 
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
 {
     VBDecContext * const c = avctx->priv_data;
     uint8_t *outptr, *srcptr;
index b229c696b9d184e7ad8d5df9e865c5da670ddc64..391a003acb885e23661269aaafcc06e19aa5f654 100644 (file)
@@ -30,7 +30,7 @@ static int decode_init(AVCodecContext *avctx) {
 static const uint8_t tc_offsets[9] = { 0, 1, 3, 4, 6, 7, 9, 10, 11 };
 static const uint8_t tc_muls[9] = { 10, 6, 10, 6, 10, 6, 10, 10, 1 };
 
-static uint64_t parse_timecode(uint8_t *buf) {
+static uint64_t parse_timecode(const uint8_t *buf) {
     int i;
     int64_t ms = 0;
     if (buf[2] != ':' || buf[5] != ':' || buf[8] != '.')
@@ -44,9 +44,9 @@ static uint64_t parse_timecode(uint8_t *buf) {
 }
 
 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
-                        uint8_t *buf, int buf_size) {
+                        const uint8_t *buf, int buf_size) {
     AVSubtitle *sub = data;
-    uint8_t *buf_end = buf + buf_size;
+    const uint8_t *buf_end = buf + buf_size;
     uint8_t *bitmap;
     int w, h, x, y, rlelen, i;
     GetBitContext gb;