annotate targa.c @ 3986:54c7481b381e libavcodec

Targa image decoder
author kostya
date Wed, 11 Oct 2006 04:15:04 +0000
parents
children 2e93c877d264
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3986
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
1 /*
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
2 * Targa (.tga) image decoder
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
3 * Copyright (c) 2006 Konstantin Shishkov
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
4 *
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
5 * This file is part of FFmpeg.
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
6 *
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
11 *
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
15 * Lesser General Public License for more details.
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
16 *
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
20 *
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
21 */
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
22 #include "avcodec.h"
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
23
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
24 enum TargaCompr{
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
25 TGA_NODATA = 0, // no image data
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
26 TGA_PAL = 1, // palettized
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
27 TGA_RGB = 2, // true-color
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
28 TGA_BW = 3, // black & white or grayscale
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
29 TGA_RLE = 8, // flag pointing that data is RLE-coded
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
30 };
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
31
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
32 typedef struct TargaContext {
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
33 AVFrame picture;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
34
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
35 int width, height;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
36 int bpp;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
37 int color_type;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
38 int compression_type;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
39 } TargaContext;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
40
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
41 static void targa_decode_rle(AVCodecContext *avctx, TargaContext *s, uint8_t *src, uint8_t *dst, int w, int h, int stride, int bpp)
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
42 {
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
43 int i, x, y;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
44 int depth = (bpp + 1) >> 3;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
45 int type, count;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
46 int diff;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
47
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
48 diff = stride - w * depth;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
49 x = y = 0;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
50 while(y < h){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
51 type = *src++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
52 count = (type & 0x7F) + 1;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
53 type &= 0x80;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
54 if((x + count > w) && (x + count + 1 > (h - y) * w)){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
55 av_log(avctx, AV_LOG_ERROR, "Packet went out of bounds: position (%i,%i) size %i\n", x, y, count);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
56 return;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
57 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
58 for(i = 0; i < count; i++){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
59 switch(depth){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
60 case 1:
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
61 *dst = *src;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
62 break;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
63 case 2:
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
64 *((uint16_t*)dst) = LE_16(src);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
65 break;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
66 case 3:
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
67 dst[0] = src[0];
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
68 dst[1] = src[1];
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
69 dst[2] = src[2];
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
70 break;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
71 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
72 dst += depth;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
73 if(!type)
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
74 src += depth;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
75
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
76 x++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
77 if(x == w){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
78 x = 0;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
79 y++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
80 dst += diff;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
81 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
82 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
83 if(type)
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
84 src += depth;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
85 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
86 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
87
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
88 static int decode_frame(AVCodecContext *avctx,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
89 void *data, int *data_size,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
90 uint8_t *buf, int buf_size)
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
91 {
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
92 TargaContext * const s = avctx->priv_data;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
93 AVFrame *picture = data;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
94 AVFrame * const p= (AVFrame*)&s->picture;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
95 uint8_t *dst;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
96 int stride;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
97 int idlen, pal, compr, x, y, w, h, bpp, flags;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
98 int first_clr, colors, csize;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
99
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
100 /* parse image header */
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
101 idlen = *buf++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
102 pal = *buf++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
103 compr = *buf++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
104 first_clr = LE_16(buf); buf += 2;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
105 colors = LE_16(buf); buf += 2;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
106 csize = *buf++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
107 x = LE_16(buf); buf += 2;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
108 y = LE_16(buf); buf += 2;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
109 w = LE_16(buf); buf += 2;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
110 h = LE_16(buf); buf += 2;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
111 bpp = *buf++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
112 flags = *buf++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
113 //skip identifier if any
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
114 buf += idlen;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
115 s->bpp = bpp;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
116 s->width = w;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
117 s->height = h;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
118 switch(s->bpp){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
119 case 8:
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
120 avctx->pix_fmt = ((compr & (~TGA_RLE)) == TGA_BW) ? PIX_FMT_GRAY8 : PIX_FMT_PAL8;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
121 break;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
122 case 15:
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
123 avctx->pix_fmt = PIX_FMT_RGB555;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
124 break;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
125 case 16:
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
126 avctx->pix_fmt = PIX_FMT_RGB555;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
127 break;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
128 case 24:
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
129 avctx->pix_fmt = PIX_FMT_BGR24;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
130 break;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
131 default:
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
132 av_log(avctx, AV_LOG_ERROR, "Bit depth %i is not supported\n", avctx->bits_per_sample);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
133 return -1;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
134 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
135
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
136 if(s->picture.data[0])
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
137 avctx->release_buffer(avctx, &s->picture);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
138
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
139 if(avcodec_check_dimensions(avctx, w, h))
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
140 return -1;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
141 if(w != avctx->width || h != avctx->height)
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
142 avcodec_set_dimensions(avctx, w, h);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
143 if(avctx->get_buffer(avctx, p) < 0){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
144 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
145 return -1;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
146 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
147 if(flags & 0x20){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
148 dst = p->data[0];
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
149 stride = p->linesize[0];
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
150 }else{ //image is upside-down
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
151 dst = p->data[0] + p->linesize[0] * (h - 1);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
152 stride = -p->linesize[0];
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
153 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
154
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
155 if(avctx->pix_fmt == PIX_FMT_PAL8 && avctx->palctrl){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
156 memcpy(p->data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
157 if(avctx->palctrl->palette_changed){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
158 p->palette_has_changed = 1;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
159 avctx->palctrl->palette_changed = 0;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
160 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
161 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
162 if(colors){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
163 if((colors + first_clr) > 256){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
164 av_log(avctx, AV_LOG_ERROR, "Incorrect palette: %i colors with offset %i\n", colors, first_clr);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
165 return -1;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
166 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
167 if(csize != 24){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
168 av_log(avctx, AV_LOG_ERROR, "Palette entry size %i bits is not supported\n", csize);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
169 return -1;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
170 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
171 if(avctx->pix_fmt != PIX_FMT_PAL8)//should not occur but skip palette anyway
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
172 buf += colors * ((csize + 1) >> 3);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
173 else{
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
174 int r, g, b, t;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
175 int32_t *pal = ((int32_t*)p->data[1]) + first_clr;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
176 for(t = 0; t < colors; t++){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
177 r = *buf++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
178 g = *buf++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
179 b = *buf++;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
180 *pal++ = (b << 16) | (g << 8) | r;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
181 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
182 p->palette_has_changed = 1;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
183 avctx->palctrl->palette_changed = 0;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
184 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
185 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
186 if((compr & (~TGA_RLE)) == TGA_NODATA)
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
187 memset(p->data[0], 0, p->linesize[0] * s->height);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
188 else{
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
189 if(compr & TGA_RLE)
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
190 targa_decode_rle(avctx, s, buf, dst, avctx->width, avctx->height, stride, bpp);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
191 else{
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
192 for(y = 0; y < s->height; y++){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
193 #ifdef WORDS_BIGENDIAN
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
194 if((s->bpp + 1) >> 3 == 2){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
195 uint16_t *dst16 = (uint16_t*)dst;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
196 for(x = 0; x < s->width; x++)
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
197 dst16[x] = LE_16(buf + x * 2);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
198 }else
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
199 #endif
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
200 memcpy(dst, buf, s->width * ((s->bpp + 1) >> 3));
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
201
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
202 dst += stride;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
203 buf += s->width * ((s->bpp + 1) >> 3);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
204 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
205 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
206 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
207
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
208 *picture= *(AVFrame*)&s->picture;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
209 *data_size = sizeof(AVPicture);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
210
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
211 return buf_size;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
212 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
213
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
214 static int targa_init(AVCodecContext *avctx){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
215 TargaContext *s = avctx->priv_data;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
216
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
217 avcodec_get_frame_defaults((AVFrame*)&s->picture);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
218 avctx->coded_frame= (AVFrame*)&s->picture;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
219 s->picture.data[0] = NULL;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
220
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
221 return 0;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
222 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
223
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
224 static int targa_end(AVCodecContext *avctx){
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
225 TargaContext *s = avctx->priv_data;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
226
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
227 if(s->picture.data[0])
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
228 avctx->release_buffer(avctx, &s->picture);
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
229
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
230 return 0;
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
231 }
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
232
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
233 AVCodec targa_decoder = {
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
234 "targa",
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
235 CODEC_TYPE_VIDEO,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
236 CODEC_ID_TARGA,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
237 sizeof(TargaContext),
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
238 targa_init,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
239 NULL,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
240 targa_end,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
241 decode_frame,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
242 0,
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
243 NULL
54c7481b381e Targa image decoder
kostya
parents:
diff changeset
244 };