~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to libavcodec/raw.c

  • Committer: William Grant
  • Date: 2007-02-03 03:16:07 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: william.grant@ubuntu.org.au-20070203031607-08gc2ompbz6spt9i
Update to 1.0rc1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Raw Video Codec
3
3
 * Copyright (c) 2001 Fabrice Bellard.
4
4
 *
5
 
 * This library is free software; you can redistribute it and/or
 
5
 * This file is part of FFmpeg.
 
6
 *
 
7
 * FFmpeg is free software; you can redistribute it and/or
6
8
 * modify it under the terms of the GNU Lesser General Public
7
9
 * License as published by the Free Software Foundation; either
8
 
 * version 2 of the License, or (at your option) any later version.
 
10
 * version 2.1 of the License, or (at your option) any later version.
9
11
 *
10
 
 * This library is distributed in the hope that it will be useful,
 
12
 * FFmpeg is distributed in the hope that it will be useful,
11
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
15
 * Lesser General Public License for more details.
14
16
 *
15
17
 * You should have received a copy of the GNU Lesser General Public
16
 
 * License along with this library; if not, write to the Free Software
 
18
 * License along with FFmpeg; if not, write to the Free Software
17
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
20
 */
19
21
 
38
40
const PixelFormatTag pixelFormatTags[] = {
39
41
    { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
40
42
    { PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') },
 
43
    { PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') },
41
44
    { PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') },
42
45
    { PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') },
43
46
    { PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') },
141
144
    }
142
145
 
143
146
    flip(avctx, picture);
 
147
 
 
148
    if (avctx->codec_tag == MKTAG('Y', 'V', '1', '2'))
 
149
    {
 
150
        // swap fields
 
151
        unsigned char *tmp = picture->data[1];
 
152
        picture->data[1] = picture->data[2];
 
153
        picture->data[2] = tmp;
 
154
    }
 
155
 
144
156
    *data_size = sizeof(AVPicture);
145
157
    return buf_size;
146
158
}
154
166
}
155
167
 
156
168
/* RAW Encoder Implementation */
157
 
 
 
169
#ifdef CONFIG_RAWVIDEO_ENCODER
158
170
static int raw_init_encoder(AVCodecContext *avctx)
159
171
{
160
172
    avctx->coded_frame = (AVFrame *)avctx->priv_data;
172
184
                                               avctx->height, frame, buf_size);
173
185
}
174
186
 
175
 
#ifdef CONFIG_RAWVIDEO_ENCODER
176
187
AVCodec rawvideo_encoder = {
177
188
    "rawvideo",
178
189
    CODEC_TYPE_VIDEO,