annotate msrle.c @ 4535:e3b224087a85 libavcodec

10l: forgot break statement
author kostya
date Sat, 17 Feb 2007 11:39:54 +0000
parents c8c591fe26f8
children 66ef3690d108
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 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
5 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
6 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
8 * 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
9 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
11 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
13 * 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
14 * 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
15 * Lesser General Public License for more details.
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
16 *
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
3036
0b546eab515d Update licensing information: The FSF changed postal address.
diego
parents: 2453
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1491
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
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
22 /**
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
23 * @file msrle.c
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
24 * 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
25 * 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
26 * http://www.pcisys.net/~melanson/codecs/
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 * 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
29 *
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
30 * 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
31 * BITMAPINFO header passed through palctrl.
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
32 */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
33
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
34 #include <stdio.h>
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
35 #include <stdlib.h>
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
36 #include <string.h>
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
37 #include <unistd.h>
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
38
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
39 #include "common.h"
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
40 #include "avcodec.h"
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
41 #include "dsputil.h"
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
42
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
43 typedef struct MsrleContext {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
44 AVCodecContext *avctx;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
45 AVFrame frame;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
46
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
47 unsigned char *buf;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
48 int size;
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 } MsrleContext;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
51
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
52 #define FETCH_NEXT_STREAM_BYTE() \
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
53 if (stream_ptr >= s->size) \
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
54 { \
1598
932d306bf1dc av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
michael
parents: 1595
diff changeset
55 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
56 return; \
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
57 } \
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
58 stream_byte = s->buf[stream_ptr++];
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
59
1609
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
60 static void msrle_decode_pal4(MsrleContext *s)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
61 {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
62 int stream_ptr = 0;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
63 unsigned char rle_code;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
64 unsigned char extra_byte, odd_pixel;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
65 unsigned char stream_byte;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
66 int pixel_ptr = 0;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
67 int row_dec = s->frame.linesize[0];
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
68 int row_ptr = (s->avctx->height - 1) * row_dec;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
69 int frame_size = row_dec * s->avctx->height;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
70 int i;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
71
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
72 /* make the palette available */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
73 memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
74 if (s->avctx->palctrl->palette_changed) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
75 s->frame.palette_has_changed = 1;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
76 s->avctx->palctrl->palette_changed = 0;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
77 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
78
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
79 while (row_ptr >= 0) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
80 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
81 rle_code = stream_byte;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
82 if (rle_code == 0) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
83 /* fetch the next byte to see how to handle escape code */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
84 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
85 if (stream_byte == 0) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
86 /* line is done, goto the next one */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
87 row_ptr -= row_dec;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
88 pixel_ptr = 0;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
89 } else if (stream_byte == 1) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
90 /* decode is done */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
91 return;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
92 } else if (stream_byte == 2) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
93 /* reposition frame decode coordinates */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
94 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
95 pixel_ptr += stream_byte;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
96 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
97 row_ptr -= stream_byte * row_dec;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
98 } else {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
99 // copy pixels from encoded stream
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
100 odd_pixel = stream_byte & 1;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
101 rle_code = (stream_byte + 1) / 2;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
102 extra_byte = rle_code & 0x01;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
103 if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
104 (row_ptr < 0)) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
105 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
106 return;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
107 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
108
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
109 for (i = 0; i < rle_code; i++) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
110 if (pixel_ptr >= s->avctx->width)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
111 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
112 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
113 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte >> 4;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
114 pixel_ptr++;
1769
1514fd5d434b watch those hard tabs
melanson
parents: 1630
diff changeset
115 if (i + 1 == rle_code && odd_pixel)
1514fd5d434b watch those hard tabs
melanson
parents: 1630
diff changeset
116 break;
1609
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
117 if (pixel_ptr >= s->avctx->width)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
118 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
119 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte & 0x0F;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
120 pixel_ptr++;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
121 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
122
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
123 // if the RLE code is odd, skip a byte in the stream
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
124 if (extra_byte)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
125 stream_ptr++;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
126 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
127 } else {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
128 // decode a run of data
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
129 if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
130 (row_ptr < 0)) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
131 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
132 return;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
133 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
134 FETCH_NEXT_STREAM_BYTE();
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
135 for (i = 0; i < rle_code; i++) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
136 if (pixel_ptr >= s->avctx->width)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
137 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
138 if ((i & 1) == 0)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
139 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte >> 4;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
140 else
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
141 s->frame.data[0][row_ptr + pixel_ptr] = stream_byte & 0x0F;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
142 pixel_ptr++;
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 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
146
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
147 /* one last sanity check on the way out */
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
148 if (stream_ptr < s->size)
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
149 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
150 stream_ptr, s->size);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
151 }
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
152
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
153
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
154
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
155 static void msrle_decode_pal8(MsrleContext *s)
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
156 {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
157 int stream_ptr = 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
158 unsigned char rle_code;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
159 unsigned char extra_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
160 unsigned char stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
161 int pixel_ptr = 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
162 int row_dec = s->frame.linesize[0];
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
163 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
164 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
165
1604
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
166 /* make the palette available */
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
167 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
168 if (s->avctx->palctrl->palette_changed) {
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
169 s->frame.palette_has_changed = 1;
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
170 s->avctx->palctrl->palette_changed = 0;
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
171 }
21190cfac0e1 100l: sometime palette was not copied to output frame
rtognimp
parents: 1598
diff changeset
172
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
173 while (row_ptr >= 0) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
174 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
175 rle_code = stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
176 if (rle_code == 0) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
177 /* 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
178 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
179 if (stream_byte == 0) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
180 /* line is done, goto the next one */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
181 row_ptr -= row_dec;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
182 pixel_ptr = 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
183 } else if (stream_byte == 1) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
184 /* decode is done */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
185 return;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
186 } else if (stream_byte == 2) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
187 /* reposition frame decode coordinates */
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 pixel_ptr += stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
190 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
191 row_ptr -= stream_byte * row_dec;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
192 } else {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
193 /* copy pixels from encoded stream */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
194 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
195 (row_ptr < 0)) {
1598
932d306bf1dc av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
michael
parents: 1595
diff changeset
196 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
197 return;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
198 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
199
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
200 rle_code = stream_byte;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
201 extra_byte = stream_byte & 0x01;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
202 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
203 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
204 return;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
205 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
206
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
207 while (rle_code--) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
208 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
209 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
210 pixel_ptr++;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
211 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
212
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
213 /* 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
214 if (extra_byte)
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
215 stream_ptr++;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
216 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
217 } else {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
218 /* decode a run of data */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
219 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
220 (row_ptr < 0)) {
1598
932d306bf1dc av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
michael
parents: 1595
diff changeset
221 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
222 return;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
223 }
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 FETCH_NEXT_STREAM_BYTE();
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
226
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
227 while(rle_code--) {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
228 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
229 pixel_ptr++;
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 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
233
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
234 /* 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
235 if (stream_ptr < s->size)
1598
932d306bf1dc av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
michael
parents: 1595
diff changeset
236 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
237 stream_ptr, s->size);
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
238 }
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 static int msrle_decode_init(AVCodecContext *avctx)
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 MsrleContext *s = (MsrleContext *)avctx->priv_data;
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 s->avctx = avctx;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
245
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
246 avctx->pix_fmt = PIX_FMT_PAL8;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
247 avctx->has_b_frames = 0;
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
248 s->frame.data[0] = NULL;
1491
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 return 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
251 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
252
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
253 static int msrle_decode_frame(AVCodecContext *avctx,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
254 void *data, int *data_size,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
255 uint8_t *buf, int buf_size)
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 MsrleContext *s = (MsrleContext *)avctx->priv_data;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
258
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
259 s->buf = buf;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
260 s->size = buf_size;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
261
1592
63009885ca88 100l: free previous frame, not current one!
rtognimp
parents: 1591
diff changeset
262 s->frame.reference = 1;
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
263 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
264 if (avctx->reget_buffer(avctx, &s->frame)) {
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
265 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
266 return -1;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
267 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
268
1609
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
269 switch (avctx->bits_per_sample) {
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
270 case 8:
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
271 msrle_decode_pal8(s);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
272 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
273 case 4:
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
274 msrle_decode_pal4(s);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
275 break;
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
276 default:
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
277 av_log(avctx, AV_LOG_ERROR, "Don't know how to decode depth %u.\n",
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
278 avctx->bits_per_sample);
7f4d1ab4ac17 4bpp support
rtognimp
parents: 1607
diff changeset
279 }
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
280
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
281 *data_size = sizeof(AVFrame);
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
282 *(AVFrame*)data = s->frame;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
283
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
284 /* report that the buffer was completely consumed */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
285 return buf_size;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
286 }
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 static int msrle_decode_end(AVCodecContext *avctx)
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 MsrleContext *s = (MsrleContext *)avctx->priv_data;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
291
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
292 /* release the last frame */
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
293 if (s->frame.data[0])
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
294 avctx->release_buffer(avctx, &s->frame);
1491
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 return 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
297 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
298
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
299 AVCodec msrle_decoder = {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
300 "msrle",
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
301 CODEC_TYPE_VIDEO,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
302 CODEC_ID_MSRLE,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
303 sizeof(MsrleContext),
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
304 msrle_decode_init,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
305 NULL,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
306 msrle_decode_end,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
307 msrle_decode_frame,
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
308 CODEC_CAP_DR1,
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
309 };