diff options
Diffstat (limited to 'contrib/ffmpeg/libavcodec/tiertexseqv.c')
-rw-r--r-- | contrib/ffmpeg/libavcodec/tiertexseqv.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/contrib/ffmpeg/libavcodec/tiertexseqv.c b/contrib/ffmpeg/libavcodec/tiertexseqv.c index ca3baf09e..f106ceb32 100644 --- a/contrib/ffmpeg/libavcodec/tiertexseqv.c +++ b/contrib/ffmpeg/libavcodec/tiertexseqv.c @@ -25,7 +25,6 @@ */ #include "avcodec.h" -#include "common.h" #define ALT_BITSTREAM_READER_LE #include "bitstream.h" @@ -38,7 +37,7 @@ typedef struct SeqVideoContext { } SeqVideoContext; -static unsigned char *seq_unpack_rle_block(unsigned char *src, unsigned char *dst, int dst_size) +static const unsigned char *seq_unpack_rle_block(const unsigned char *src, unsigned char *dst, int dst_size) { int i, len, sz; GetBitContext gb; @@ -68,9 +67,9 @@ static unsigned char *seq_unpack_rle_block(unsigned char *src, unsigned char *ds return src; } -static unsigned char *seq_decode_op1(SeqVideoContext *seq, unsigned char *src, unsigned char *dst) +static const unsigned char *seq_decode_op1(SeqVideoContext *seq, const unsigned char *src, unsigned char *dst) { - unsigned char *color_table; + const unsigned char *color_table; int b, i, len, bits; GetBitContext gb; @@ -108,7 +107,7 @@ static unsigned char *seq_decode_op1(SeqVideoContext *seq, unsigned char *src, u return src; } -static unsigned char *seq_decode_op2(SeqVideoContext *seq, unsigned char *src, unsigned char *dst) +static const unsigned char *seq_decode_op2(SeqVideoContext *seq, const unsigned char *src, unsigned char *dst) { int i; @@ -121,7 +120,7 @@ static unsigned char *seq_decode_op2(SeqVideoContext *seq, unsigned char *src, u return src; } -static unsigned char *seq_decode_op3(SeqVideoContext *seq, unsigned char *src, unsigned char *dst) +static const unsigned char *seq_decode_op3(SeqVideoContext *seq, const unsigned char *src, unsigned char *dst) { int pos, offset; @@ -134,7 +133,7 @@ static unsigned char *seq_decode_op3(SeqVideoContext *seq, unsigned char *src, u return src; } -static void seqvideo_decode(SeqVideoContext *seq, unsigned char *data, int data_size) +static void seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size) { GetBitContext gb; int flags, i, j, x, y, op; @@ -147,7 +146,7 @@ static void seqvideo_decode(SeqVideoContext *seq, unsigned char *data, int data_ for (i = 0; i < 256; i++) { for (j = 0; j < 3; j++, data++) c[j] = (*data << 2) | (*data >> 4); - seq->palette[i] = (c[0] << 16) | (c[1] << 8) | c[2]; + seq->palette[i] = AV_RB24(c); } memcpy(seq->frame.data[1], seq->palette, sizeof(seq->palette)); seq->frame.palette_has_changed = 1; @@ -176,11 +175,10 @@ static void seqvideo_decode(SeqVideoContext *seq, unsigned char *data, int data_ static int seqvideo_decode_init(AVCodecContext *avctx) { - SeqVideoContext *seq = (SeqVideoContext *)avctx->priv_data; + SeqVideoContext *seq = avctx->priv_data; seq->avctx = avctx; avctx->pix_fmt = PIX_FMT_PAL8; - avctx->has_b_frames = 0; seq->frame.data[0] = NULL; @@ -189,10 +187,10 @@ static int seqvideo_decode_init(AVCodecContext *avctx) static int seqvideo_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - uint8_t *buf, int buf_size) + const uint8_t *buf, int buf_size) { - SeqVideoContext *seq = (SeqVideoContext *)avctx->priv_data; + SeqVideoContext *seq = avctx->priv_data; seq->frame.reference = 1; seq->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; @@ -211,7 +209,7 @@ static int seqvideo_decode_frame(AVCodecContext *avctx, static int seqvideo_decode_end(AVCodecContext *avctx) { - SeqVideoContext *seq = (SeqVideoContext *)avctx->priv_data; + SeqVideoContext *seq = avctx->priv_data; if (seq->frame.data[0]) avctx->release_buffer(avctx, &seq->frame); |