[SCM] libav/experimental: Use void * instead of uint8_t * for the destination buffer for dsp.bswap_buf where easily possible (mimic, eatqi, 4xm). This allows to avoid a typecast.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:43:57 UTC 2013


The following commit has been merged in the experimental branch:
commit 9bf993a5b5f8bf10c590d83c795467606f92cf6e
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Sun Apr 12 12:25:53 2009 +0000

    Use void * instead of uint8_t * for the destination buffer for dsp.bswap_buf
    where easily possible (mimic, eatqi, 4xm).
    This allows to avoid a typecast.
    
    Originally committed as revision 18469 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 3348ed0..4003742 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -138,7 +138,7 @@ typedef struct FourXContext{
     VLC pre_vlc;
     int last_dc;
     DECLARE_ALIGNED_8(DCTELEM, block[6][64]);
-    uint8_t *bitstream_buffer;
+    void *bitstream_buffer;
     unsigned int bitstream_buffer_size;
     int version;
     CFrameBuffer cfrm[CFRAME_BUFFER_COUNT];
@@ -379,7 +379,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
     }
 
     f->bitstream_buffer= av_fast_realloc(f->bitstream_buffer, &f->bitstream_buffer_size, bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    f->dsp.bswap_buf((uint32_t*)f->bitstream_buffer, (const uint32_t*)(buf + extra), bitstream_size/4);
+    f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)(buf + extra), bitstream_size/4);
     init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);
 
     f->wordstream= (const uint16_t*)(buf + extra + bitstream_size);
@@ -657,7 +657,7 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
     prestream_size= length + buf - prestream;
 
     f->bitstream_buffer= av_fast_realloc(f->bitstream_buffer, &f->bitstream_buffer_size, prestream_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    f->dsp.bswap_buf((uint32_t*)f->bitstream_buffer, (const uint32_t*)prestream, prestream_size/4);
+    f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)prestream, prestream_size/4);
     init_get_bits(&f->pre_gb, f->bitstream_buffer, 8*prestream_size);
 
     f->last_dc= 0*128*8*8;
diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c
index acddec0..06dd714 100644
--- a/libavcodec/eatqi.c
+++ b/libavcodec/eatqi.c
@@ -38,7 +38,7 @@
 typedef struct TqiContext {
     MpegEncContext s;
     AVFrame frame;
-    uint8_t *bitstream_buf;
+    void *bitstream_buf;
     unsigned int bitstream_buf_size;
 } TqiContext;
 
@@ -129,7 +129,7 @@ static int tqi_decode_frame(AVCodecContext *avctx,
     t->bitstream_buf = av_fast_realloc(t->bitstream_buf, &t->bitstream_buf_size, (buf_end-buf) + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!t->bitstream_buf)
         return AVERROR(ENOMEM);
-    s->dsp.bswap_buf((uint32_t*)t->bitstream_buf, (const uint32_t*)buf, (buf_end-buf)/4);
+    s->dsp.bswap_buf(t->bitstream_buf, (const uint32_t*)buf, (buf_end-buf)/4);
     init_get_bits(&s->gb, t->bitstream_buf, 8*(buf_end-buf));
 
     s->last_dc[0] = s->last_dc[1] = s->last_dc[2] = 0;
diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index 3b40fdf..4716284 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -36,7 +36,7 @@ typedef struct {
     int             num_vblocks[3];
     int             num_hblocks[3];
 
-    uint8_t        *swap_buf;
+    void           *swap_buf;
     int             swap_buf_size;
 
     int             cur_index;
@@ -339,7 +339,7 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data,
     if(!ctx->swap_buf)
         return AVERROR(ENOMEM);
 
-    ctx->dsp.bswap_buf((uint32_t*)ctx->swap_buf,
+    ctx->dsp.bswap_buf(ctx->swap_buf,
                         (const uint32_t*) buf,
                         swap_buf_size>>2);
     init_get_bits(&ctx->gb, ctx->swap_buf, swap_buf_size << 3);

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list