Mercurial > libavcodec.hg
annotate targaenc.c @ 4725:74caca70e2b3 libavcodec
simplify
author | michael |
---|---|
date | Sun, 25 Mar 2007 13:41:14 +0000 |
parents | ae5abc4dc946 |
children | a3667e74f44b |
rev | line source |
---|---|
4673 | 1 /* |
2 * Targa (.tga) image encoder | |
3 * Copyright (c) 2007 Bobby Bingham | |
4 * | |
5 * This file is part of FFmpeg. | |
6 * | |
7 * FFmpeg is free software; you can redistribute it and/or | |
8 * modify it under the terms of the GNU Lesser General Public | |
9 * License as published by the Free Software Foundation; either | |
10 * version 2.1 of the License, or (at your option) any later version. | |
11 * | |
12 * FFmpeg is distributed in the hope that it will be useful, | |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Lesser General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Lesser General Public | |
18 * License along with FFmpeg; if not, write to the Free Software | |
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
20 * | |
21 */ | |
22 #include "avcodec.h" | |
23 | |
4678
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
24 /** |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
25 * Count up to 127 consecutive pixels which are either all the same or |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
26 * all differ from the previous and next pixels. |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
27 * @param start Pointer to the first pixel |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
28 * @param len Maximum number of pixels |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
29 * @param bpp Bytes per pixel |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
30 * @param same 1 if searching for identical pixel values. 0 for differing |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
31 * @return Number of matching consecutive pixels found |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
32 */ |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
33 static int count_pixels(uint8_t *start, int len, int bpp, int same) |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
34 { |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
35 uint8_t *pos; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
36 int count = 1; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
37 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
38 for(pos = start + bpp; count < FFMIN(128, len); pos += bpp, count ++) { |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
39 if(same != !memcmp(pos-bpp, pos, bpp)) { |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
40 if(!same) { |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
41 /* if bpp == 1, then 0 1 1 0 is more efficiently encoded as a single |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
42 * raw block of pixels. for larger bpp, RLE is as good or better */ |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
43 if(bpp == 1 && count + 1 < FFMIN(128, len) && *pos != *(pos+1)) |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
44 continue; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
45 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
46 /* if RLE can encode the next block better than as a raw block, |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
47 * back up and leave _all_ the identical pixels for RLE */ |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
48 count --; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
49 } |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
50 break; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
51 } |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
52 } |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
53 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
54 return count; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
55 } |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
56 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
57 /** |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
58 * RLE compress the image, with maximum size of out_size |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
59 * @param outbuf Output buffer |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
60 * @param out_size Maximum output size |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
61 * @param pic Image to compress |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
62 * @param bpp Bytes per pixel |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
63 * @param w Image width |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
64 * @param h Image height |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
65 * @return Size of output in bytes, or -1 if larger than out_size |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
66 */ |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
67 static int targa_encode_rle(uint8_t *outbuf, int out_size, AVFrame *pic, |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
68 int bpp, int w, int h) |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
69 { |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
70 int count, x, y; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
71 uint8_t *ptr, *line, *out; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
72 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
73 out = outbuf; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
74 line = pic->data[0]; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
75 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
76 for(y = 0; y < h; y ++) { |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
77 ptr = line; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
78 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
79 for(x = 0; x < w; x += count) { |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
80 /* see if we can encode the next set of pixels with RLE */ |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
81 if((count = count_pixels(ptr, w-x, bpp, 1)) > 1) { |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
82 if(out + bpp + 1 > outbuf + out_size) return -1; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
83 *out++ = 0x80 | (count - 1); |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
84 memcpy(out, ptr, bpp); |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
85 out += bpp; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
86 } else { |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
87 /* fall back on uncompressed */ |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
88 count = count_pixels(ptr, w-x, bpp, 0); |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
89 *out++ = count - 1; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
90 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
91 if(out + bpp*count > outbuf + out_size) return -1; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
92 memcpy(out, ptr, bpp * count); |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
93 out += bpp * count; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
94 } |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
95 ptr += count * bpp; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
96 } |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
97 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
98 line += pic->linesize[0]; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
99 } |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
100 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
101 return out - outbuf; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
102 } |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
103 |
4677
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
104 static int targa_encode_normal(uint8_t *outbuf, AVFrame *pic, int bpp, int w, int h) |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
105 { |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
106 int i, n = bpp * w; |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
107 uint8_t *out = outbuf; |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
108 uint8_t *ptr = pic->data[0]; |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
109 |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
110 for(i=0; i < h; i++) { |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
111 memcpy(out, ptr, n); |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
112 out += n; |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
113 ptr += pic->linesize[0]; |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
114 } |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
115 |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
116 return out - outbuf; |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
117 } |
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
118 |
4673 | 119 static int targa_encode_frame(AVCodecContext *avctx, |
120 unsigned char *outbuf, | |
121 int buf_size, void *data){ | |
122 AVFrame *p = data; | |
4678
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
123 int bpp, picsize, datasize; |
4677
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
124 uint8_t *out; |
4673 | 125 |
126 if(avctx->width > 0xffff || avctx->height > 0xffff) { | |
127 av_log(avctx, AV_LOG_ERROR, "image dimensions too large\n"); | |
128 return -1; | |
129 } | |
4678
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
130 picsize = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
131 if(buf_size < picsize + 45) { |
4673 | 132 av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n"); |
133 return -1; | |
134 } | |
135 | |
136 p->pict_type= FF_I_TYPE; | |
137 p->key_frame= 1; | |
138 | |
139 /* zero out the header and only set applicable fields */ | |
140 memset(outbuf, 0, 11); | |
141 AV_WL16(outbuf+12, avctx->width); | |
142 AV_WL16(outbuf+14, avctx->height); | |
143 outbuf[17] = 0x20; /* origin is top-left. no alpha */ | |
144 | |
4678
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
145 /* TODO: support alpha channel */ |
4673 | 146 switch(avctx->pix_fmt) { |
147 case PIX_FMT_GRAY8: | |
148 outbuf[2] = 3; /* uncompressed grayscale image */ | |
149 outbuf[16] = 8; /* bpp */ | |
150 break; | |
4676
046456cf7d31
Add 15 bit support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4673
diff
changeset
|
151 case PIX_FMT_RGB555: |
046456cf7d31
Add 15 bit support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4673
diff
changeset
|
152 outbuf[2] = 2; /* uncompresses true-color image */ |
046456cf7d31
Add 15 bit support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4673
diff
changeset
|
153 outbuf[16] = 16; /* bpp */ |
046456cf7d31
Add 15 bit support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4673
diff
changeset
|
154 break; |
4673 | 155 case PIX_FMT_BGR24: |
156 outbuf[2] = 2; /* uncompressed true-color image */ | |
157 outbuf[16] = 24; /* bpp */ | |
158 break; | |
159 default: | |
160 return -1; | |
161 } | |
4677
47237f2638b2
Move the encoding of the image data to its own function.
diego
parents:
4676
diff
changeset
|
162 bpp = outbuf[16] >> 3; |
4673 | 163 |
164 out = outbuf + 18; /* skip past the header we just output */ | |
165 | |
4678
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
166 /* try RLE compression */ |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
167 datasize = targa_encode_rle(out, picsize, p, bpp, avctx->width, avctx->height); |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
168 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
169 /* if that worked well, mark the picture as RLE compressed */ |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
170 if(datasize >= 0) |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
171 outbuf[2] |= 8; |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
172 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
173 /* if RLE didn't make it smaller, go back to no compression */ |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
174 else datasize = targa_encode_normal(out, p, bpp, avctx->width, avctx->height); |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
175 |
ae5abc4dc946
Add RLE encoding support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4677
diff
changeset
|
176 out += datasize; |
4673 | 177 |
178 /* The standard recommends including this section, even if we don't use | |
179 * any of the features it affords. TODO: take advantage of the pixel | |
180 * aspect ratio and encoder ID fields available? */ | |
181 memcpy(out, "\0\0\0\0\0\0\0\0TRUEVISION-XFILE.", 26); | |
182 | |
183 return out + 26 - outbuf; | |
184 } | |
185 | |
186 static int targa_encode_init(AVCodecContext *avctx) | |
187 { | |
188 return 0; | |
189 } | |
190 | |
191 AVCodec targa_encoder = { | |
192 .name = "targa", | |
193 .type = CODEC_TYPE_VIDEO, | |
194 .id = CODEC_ID_TARGA, | |
195 .priv_data_size = 0, | |
196 .init = targa_encode_init, | |
197 .encode = targa_encode_frame, | |
4676
046456cf7d31
Add 15 bit support, patch by Bobby Bingham, uhmmmm gmail com.
diego
parents:
4673
diff
changeset
|
198 .pix_fmts= (enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_RGB555, PIX_FMT_GRAY8, -1}, |
4673 | 199 }; |