annotate msrle.c @ 2466:acfea8a94bf8 libavcodec

10l (negative strides)
author michael
date Wed, 26 Jan 2005 17:04:34 +0000
parents f67b63ed036d
children 0b546eab515d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
1 /*
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
2 * Micrsoft RLE Video Decoder
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
3 * Copyright (C) 2003 the ffmpeg project
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
4 *
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
9 *
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
13 * Lesser General Public License for more details.
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
14 *
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
18 */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
19
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
20 /**
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
21 * @file msrle.c
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
22 * MS RLE Video Decoder by Mike Melanson (melanson@pcisys.net)
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
23 * For more information about the MS RLE format, visit:
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
24 * http://www.pcisys.net/~melanson/codecs/
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
25 *
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
26 * The MS RLE decoder outputs PAL8 colorspace data.
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
27 *
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
28 * Note that this decoder expects the palette colors from the end of the
1595
b2fecae88e84 Moved to new palette API
rtognimp
parents: 1592
diff changeset
29 * BITMAPINFO header passed through palctrl.
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
30 */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
31
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
32 #include <stdio.h>
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
33 #include <stdlib.h>
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
34 #include <string.h>
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
35 #include <unistd.h>
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
36
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
37 #include "common.h"
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
38 #include "avcodec.h"
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
39 #include "dsputil.h"
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
40
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
41 typedef struct MsrleContext {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
42 AVCodecContext *avctx;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
43 AVFrame frame;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
44
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
45 unsigned char *buf;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
46 int size;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
47
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
48 } MsrleContext;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
49
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
50 #define FETCH_NEXT_STREAM_BYTE() \
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
51 if (stream_ptr >= s->size) \
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
52 { \
1598
932d306bf1dc av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
michael
parents: 1595
diff changeset
53 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: stream ptr just went out of bounds (1)\n"); \
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
54 return; \
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
55 } \
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
56 stream_byte = s->buf[stream_ptr++];
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
57
1609
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
58 static void msrle_decode_pal4(MsrleContext *s)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
59 {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
60 int stream_ptr = 0;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
61 unsigned char rle_code;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
62 unsigned char extra_byte, odd_pixel;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
63 unsigned char stream_byte;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
64 int pixel_ptr = 0;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
65 int row_dec = s->frame.linesize[0];
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
66 int row_ptr = (s->avctx->height - 1) * row_dec;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
67 int frame_size = row_dec * s->avctx->height;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
68 int i;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
69
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
70 /* make the palette available */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
71 memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
72 if (s->avctx->palctrl->palette_changed) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
73 s->frame.palette_has_changed = 1;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
74 s->avctx->palctrl->palette_changed = 0;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
75 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
76
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
77 while (row_ptr >= 0) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
78 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
79 rle_code = stream_byte;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
80 if (rle_code == 0) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
81 /* fetch the next byte to see how to handle escape code */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
82 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
83 if (stream_byte == 0) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
84 /* line is done, goto the next one */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
85 row_ptr -= row_dec;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
86 pixel_ptr = 0;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
87 } else if (stream_byte == 1) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
88 /* decode is done */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
89 return;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
90 } else if (stream_byte == 2) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
91 /* reposition frame decode coordinates */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
92 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
93 pixel_ptr += stream_byte;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
94 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
95 row_ptr -= stream_byte * row_dec;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
96 } else {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
97 // copy pixels from encoded stream
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
98 odd_pixel = stream_byte & 1;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
99 rle_code = (stream_byte + 1) / 2;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
100 extra_byte = rle_code & 0x01;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
101 if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
102 (row_ptr < 0)) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
103 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (1)\n");
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
104 return;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
105 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
106
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
107 for (i = 0; i < rle_code; i++) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
108 if (pixel_ptr >= s->avctx->width)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
109 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
110 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
111 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte >> 4;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
112 pixel_ptr++;
1769
1514fd5d434b watch those hard tabs
melanson
parents: 1630
diff changeset
113 if (i + 1 == rle_code && odd_pixel)
1514fd5d434b watch those hard tabs
melanson
parents: 1630
diff changeset
114 break;
1609
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
115 if (pixel_ptr >= s->avctx->width)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
116 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
117 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte & 0x0F;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
118 pixel_ptr++;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
119 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
120
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
121 // if the RLE code is odd, skip a byte in the stream
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
122 if (extra_byte)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
123 stream_ptr++;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
124 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
125 } else {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
126 // decode a run of data
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
127 if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
128 (row_ptr < 0)) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
129 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (1)\n");
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
130 return;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
131 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
132 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
133 for (i = 0; i < rle_code; i++) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
134 if (pixel_ptr >= s->avctx->width)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
135 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
136 if ((i & 1) == 0)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
137 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte >> 4;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
138 else
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
139 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte & 0x0F;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
140 pixel_ptr++;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
141 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
142 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
143 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
144
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
145 /* one last sanity check on the way out */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
146 if (stream_ptr < s->size)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
147 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: ended frame decode with bytes left over (%d < %d)\n",
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
148 stream_ptr, s->size);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
149 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
150
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
151
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
152
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
153 static void msrle_decode_pal8(MsrleContext *s)
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
154 {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
155 int stream_ptr = 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
156 unsigned char rle_code;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
157 unsigned char extra_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
158 unsigned char stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
159 int pixel_ptr = 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
160 int row_dec = s->frame.linesize[0];
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
161 int row_ptr = (s->avctx->height - 1) * row_dec;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
162 int frame_size = row_dec * s->avctx->height;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
163
1604
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
164 /* make the palette available */
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
165 memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
166 if (s->avctx->palctrl->palette_changed) {
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
167 s->frame.palette_has_changed = 1;
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
168 s->avctx->palctrl->palette_changed = 0;
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
169 }
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
170
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
171 while (row_ptr >= 0) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
172 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
173 rle_code = stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
174 if (rle_code == 0) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
175 /* fetch the next byte to see how to handle escape code */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
176 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
177 if (stream_byte == 0) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
178 /* line is done, goto the next one */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
179 row_ptr -= row_dec;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
180 pixel_ptr = 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
181 } else if (stream_byte == 1) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
182 /* decode is done */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
183 return;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
184 } else if (stream_byte == 2) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
185 /* reposition frame decode coordinates */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
186 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
187 pixel_ptr += stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
188 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
189 row_ptr -= stream_byte * row_dec;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
190 } else {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
191 /* copy pixels from encoded stream */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
192 if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
193 (row_ptr < 0)) {
1598
932d306bf1dc av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
michael
parents: 1595
diff changeset
194 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (1)\n");
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
195 return;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
196 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
197
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
198 rle_code = stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
199 extra_byte = stream_byte & 0x01;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
200 if (stream_ptr + rle_code + extra_byte > s->size) {
1598
932d306bf1dc av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
michael
parents: 1595
diff changeset
201 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: stream ptr just went out of bounds (2)\n");
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
202 return;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
203 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
204
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
205 while (rle_code--) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
206 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
207 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
208 pixel_ptr++;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
209 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
210
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
211 /* if the RLE code is odd, skip a byte in the stream */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
212 if (extra_byte)
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
213 stream_ptr++;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
214 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
215 } else {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
216 /* decode a run of data */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
217 if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
218 (row_ptr < 0)) {
1598
932d306bf1dc av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
michael
parents: 1595
diff changeset
219 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (2)\n");
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
220 return;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
221 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
222
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
223 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
224
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
225 while(rle_code--) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
226 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
227 pixel_ptr++;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
228 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
229 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
230 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
231
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
232 /* one last sanity check on the way out */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
233 if (stream_ptr < s->size)
1598
932d306bf1dc av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
michael
parents: 1595
diff changeset
234 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: ended frame decode with bytes left over (%d < %d)\n",
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
235 stream_ptr, s->size);
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
236 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
237
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
238 static int msrle_decode_init(AVCodecContext *avctx)
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
239 {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
240 MsrleContext *s = (MsrleContext *)avctx->priv_data;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
241
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
242 s->avctx = avctx;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
243
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
244 avctx->pix_fmt = PIX_FMT_PAL8;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
245 avctx->has_b_frames = 0;
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
246 s->frame.data[0] = NULL;
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
247
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
248 return 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
249 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
250
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
251 static int msrle_decode_frame(AVCodecContext *avctx,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
252 void *data, int *data_size,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
253 uint8_t *buf, int buf_size)
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
254 {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
255 MsrleContext *s = (MsrleContext *)avctx->priv_data;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
256
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
257 s->buf = buf;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
258 s->size = buf_size;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
259
1592
63009885ca88 100l: free previous frame, not current one!
rtognimp
parents: 1591
diff changeset
260 s->frame.reference = 1;
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
261 s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
262 if (avctx->reget_buffer(avctx, &s->frame)) {
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
263 av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
264 return -1;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
265 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
266
1609
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
267 switch (avctx->bits_per_sample) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
268 case 8:
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
269 msrle_decode_pal8(s);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
270 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
271 case 4:
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
272 msrle_decode_pal4(s);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
273 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
274 default:
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
275 av_log(avctx, AV_LOG_ERROR, "Don't know how to decode depth %u.\n",
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
276 avctx->bits_per_sample);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
277 }
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
278
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
279 *data_size = sizeof(AVFrame);
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
280 *(AVFrame*)data = s->frame;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
281
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
282 /* report that the buffer was completely consumed */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
283 return buf_size;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
284 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
285
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
286 static int msrle_decode_end(AVCodecContext *avctx)
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
287 {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
288 MsrleContext *s = (MsrleContext *)avctx->priv_data;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
289
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
290 /* release the last frame */
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
291 if (s->frame.data[0])
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
292 avctx->release_buffer(avctx, &s->frame);
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
293
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
294 return 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
295 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
296
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
297 AVCodec msrle_decoder = {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
298 "msrle",
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
299 CODEC_TYPE_VIDEO,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
300 CODEC_ID_MSRLE,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
301 sizeof(MsrleContext),
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
302 msrle_decode_init,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
303 NULL,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
304 msrle_decode_end,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
305 msrle_decode_frame,
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
306 CODEC_CAP_DR1,
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
307 };