1 /*
2 * Raw Video Decoder
3 * Copyright (c) 2001 Fabrice Bellard
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 /**
23 * @file
24 * Raw Video Decoder
25 */
26
35
45
48 {NULL}
49 };
50
55 };
56
68 };
69
75 // FIXME swscale does not support 16 bit in .mov, sample 16bit.mov
76 // http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
82 };
83
85 unsigned int fourcc)
86 {
88 if (tags->
fourcc == fourcc)
90 tags++;
91 }
93 }
94
95 #if LIBAVCODEC_VERSION_MAJOR < 55
97 {
99 }
100 #endif
101
103 {
106
119
121 if (!desc) {
124 }
125
132 else
134 }
135
143 } else {
146 }
147
154
158
159 return 0;
160 }
161
163 {
166 }
167
170 {
174 int buf_size = avpkt->
size;
175 int linesize_align = 4;
178
181
188
189 if (context->
tff >= 0) {
192 }
193
196
197 if (need_copy)
199 else
203
204 //2bpp and 4bpp raw in avi and mov (yes this is ugly ...)
206 int i;
210 for (i = 0; 2 * i + 1 < buf_size && i<avpkt->
size; i++) {
211 dst[2 * i + 0] = buf[i] >> 4;
212 dst[2 * i + 1] = buf[i] & 15;
213 }
214 linesize_align = 8;
215 } else {
217 for (i = 0; 4 * i + 3 < buf_size && i<avpkt->
size; i++) {
218 dst[4 * i + 0] = buf[i] >> 6;
219 dst[4 * i + 1] = buf[i] >> 4 & 3;
220 dst[4 * i + 2] = buf[i] >> 2 & 3;
221 dst[4 * i + 3] = buf[i] & 3;
222 }
223 linesize_align = 16;
224 }
225 buf = dst;
226 } else if (need_copy) {
227 memcpy(frame->
buf[0]->
data, buf, buf_size);
229 }
230
234
236 if (buf_size < len) {
237 av_log(avctx,
AV_LOG_ERROR,
"Invalid buffer size, packet size %d < expected frame_size %d\n", buf_size, len);
240 }
241
246 }
247
250 NULL);
251
252 if (pal) {
258 }
261 }
262 }
263
273
281 }
282
286 if (!frame->
buf[1]) {
289 }
291 }
292
296
298 flip(avctx, picture);
299
305
309 }
310
315 for (y = 0; y < avctx->
height; y++) {
316 for (x = 0; x < avctx->
width; x++)
317 line[2 * x + 1] ^= 0x80;
319 }
320 }
325 for(y = 0; y < avctx->
height; y++) {
326 for(x = 0; x < avctx->
width - 1; x += 2)
329 }
330 }
331
336 }
337
338 *got_frame = 1;
339 return buf_size;
340 }
341
343 {
345
347 return 0;
348 }
349
360 };