1 /*
2 * AVRn decoder
3 * Copyright (c) 2012 Michael Niedermayer
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
26
31
33 {
36
39
41
44 a->interlace = !memcmp(avctx->
extradata + ndx,
"1:1(", 4);
47 }
48 }
49
50 return 0;
51 }
52
55 {
57 const uint8_t *buf = avpkt->
data;
58 int buf_size = avpkt->
size;
59 int y,
ret, true_height;
60
61 true_height = buf_size / (2*avctx->
width);
62
66 }
67
70
73 for(y = 0; y < avctx->
height-1; y+=2) {
74 memcpy(
p->data[0] + (y+
a->tff)*
p->linesize[0], buf , 2*avctx->
width);
75 memcpy(
p->data[0] + (y+!
a->tff)*
p->linesize[0], buf + avctx->
width*true_height+4, 2*avctx->
width);
76 buf += 2*avctx->
width;
77 }
78 } else {
79 buf += (true_height - avctx->
height)*avctx->
width*2;
80 for(y = 0; y < avctx->
height; y++) {
81 memcpy(
p->data[0] + y*
p->linesize[0], buf, 2*avctx->
width);
82 buf += 2*avctx->
width;
83 }
84 }
85
86 *got_frame = 1;
87 return buf_size;
88 }
89
100 };