annotate msrle.c @ 11715:a0f514fb84d6 libavcodec

Fix mpegaudio tablegen. Patch by Michael Kostylev, michael D kostylev A gmail
author michael
date Thu, 13 May 2010 10:02:48 +0000
parents 7dd2a45249a9
children
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 /**
11644
7dd2a45249a9 Remove explicit filename from Doxygen @file commands.
diego
parents: 11560
diff changeset
23 * @file
1491
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
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"
7885
f874e1d5cf07 Factorize out code used for MS RLE format decoding in different decoders.
kostya
parents: 7823
diff changeset
40 #include "msrledec.h"
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
41
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
42 typedef struct MsrleContext {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
43 AVCodecContext *avctx;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
44 AVFrame frame;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
45
6218
michael
parents: 4962
diff changeset
46 const unsigned char *buf;
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
47 int size;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
48
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
49 } MsrleContext;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
50
6517
48759bfbd073 Apply 'cold' attribute to init/uninit functions in libavcodec
zuxy
parents: 6218
diff changeset
51 static av_cold int msrle_decode_init(AVCodecContext *avctx)
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
52 {
4827
b3ee9a1526b0 Get rid of unnecessary pointer casts.
diego
parents: 4801
diff changeset
53 MsrleContext *s = avctx->priv_data;
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
54
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
55 s->avctx = avctx;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
56
9723
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
57 switch (avctx->bits_per_coded_sample) {
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
58 case 4:
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
59 case 8:
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
60 avctx->pix_fmt = PIX_FMT_PAL8;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
61 break;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
62 case 24:
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
63 avctx->pix_fmt = PIX_FMT_BGR24;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
64 break;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
65 default:
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
66 av_log(avctx, AV_LOG_ERROR, "unsupported bits per sample\n");
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
67 return -1;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
68 }
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
69
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
70 s->frame.data[0] = NULL;
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
71
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
72 return 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
73 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
74
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
75 static int msrle_decode_frame(AVCodecContext *avctx,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
76 void *data, int *data_size,
9355
54bc8a2727b0 Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
rbultje
parents: 8720
diff changeset
77 AVPacket *avpkt)
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
78 {
9355
54bc8a2727b0 Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
rbultje
parents: 8720
diff changeset
79 const uint8_t *buf = avpkt->data;
54bc8a2727b0 Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
rbultje
parents: 8720
diff changeset
80 int buf_size = avpkt->size;
4827
b3ee9a1526b0 Get rid of unnecessary pointer casts.
diego
parents: 4801
diff changeset
81 MsrleContext *s = avctx->priv_data;
9723
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
82 int istride = FFALIGN(avctx->width*avctx->bits_per_coded_sample, 32) / 8;
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
83
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
84 s->buf = buf;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
85 s->size = buf_size;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
86
1592
63009885ca88 100l: free previous frame, not current one!
rtognimp
parents: 1591
diff changeset
87 s->frame.reference = 1;
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
88 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
89 if (avctx->reget_buffer(avctx, &s->frame)) {
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
90 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
91 return -1;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
92 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
93
9622
02715614161f check for palette presence, fix crash with QT-BMP.mov, issue #1074
bcoudurier
parents: 9355
diff changeset
94 if (s->avctx->palctrl) {
9623
5083846ac1f3 reindent
bcoudurier
parents: 9622
diff changeset
95 /* make the palette available */
5083846ac1f3 reindent
bcoudurier
parents: 9622
diff changeset
96 memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
5083846ac1f3 reindent
bcoudurier
parents: 9622
diff changeset
97 if (s->avctx->palctrl->palette_changed) {
5083846ac1f3 reindent
bcoudurier
parents: 9622
diff changeset
98 s->frame.palette_has_changed = 1;
5083846ac1f3 reindent
bcoudurier
parents: 9622
diff changeset
99 s->avctx->palctrl->palette_changed = 0;
5083846ac1f3 reindent
bcoudurier
parents: 9622
diff changeset
100 }
9622
02715614161f check for palette presence, fix crash with QT-BMP.mov, issue #1074
bcoudurier
parents: 9355
diff changeset
101 }
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
102
9723
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
103 /* FIXME how to correctly detect RLE ??? */
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
104 if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
105 int linesize = avctx->width * avctx->bits_per_coded_sample / 8;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
106 uint8_t *ptr = s->frame.data[0];
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
107 uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
108 int i, j;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
109
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
110 for (i = 0; i < avctx->height; i++) {
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
111 if (avctx->bits_per_coded_sample == 4) {
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
112 for (j = 0; j < avctx->width - 1; j += 2) {
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
113 ptr[j+0] = buf[j>>1] >> 4;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
114 ptr[j+1] = buf[j>>1] & 0xF;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
115 }
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
116 if (avctx->width & 1)
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
117 ptr[j+0] = buf[j>>1] >> 4;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
118 } else {
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
119 memcpy(ptr, buf, linesize);
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
120 }
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
121 buf -= istride;
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
122 ptr += s->frame.linesize[0];
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
123 }
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
124 } else {
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
125 ff_msrle_decode(avctx, (AVPicture*)&s->frame, avctx->bits_per_coded_sample, buf, buf_size);
11839f0e3908 msrle uncompressed decoding, fix #1074 and many other samples under /RLE
bcoudurier
parents: 9623
diff changeset
126 }
7885
f874e1d5cf07 Factorize out code used for MS RLE format decoding in different decoders.
kostya
parents: 7823
diff changeset
127
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
128 *data_size = sizeof(AVFrame);
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
129 *(AVFrame*)data = s->frame;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
130
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
131 /* report that the buffer was completely consumed */
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
132 return buf_size;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
133 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
134
6517
48759bfbd073 Apply 'cold' attribute to init/uninit functions in libavcodec
zuxy
parents: 6218
diff changeset
135 static av_cold int msrle_decode_end(AVCodecContext *avctx)
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
136 {
4827
b3ee9a1526b0 Get rid of unnecessary pointer casts.
diego
parents: 4801
diff changeset
137 MsrleContext *s = avctx->priv_data;
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
138
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
139 /* release the last frame */
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
140 if (s->frame.data[0])
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
141 avctx->release_buffer(avctx, &s->frame);
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
142
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
143 return 0;
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
144 }
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
145
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
146 AVCodec msrle_decoder = {
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
147 "msrle",
11560
8a4984c5cacc Define AVMediaType enum, and use it instead of enum CodecType, which
stefano
parents: 9981
diff changeset
148 AVMEDIA_TYPE_VIDEO,
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
149 CODEC_ID_MSRLE,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
150 sizeof(MsrleContext),
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
151 msrle_decode_init,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
152 NULL,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
153 msrle_decode_end,
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
154 msrle_decode_frame,
1630
586b5c08863c - Add reget_buffer() function to AVCodecContext
rtognimp
parents: 1609
diff changeset
155 CODEC_CAP_DR1,
7040
e943e1409077 Make AVCodec long_names definition conditional depending on CONFIG_SMALL.
stefano
parents: 6717
diff changeset
156 .long_name= NULL_IF_CONFIG_SMALL("Microsoft RLE"),
1491
222643544cf1 New demuxers: Sega FILM/CPK, Westwood VQA & AUD; new decoders: MS RLE &
tmmm
parents:
diff changeset
157 };