annotate pnmdec.c @ 10555:3d8ab953a869 libavcodec

Support 4:2:2 and 4:4:4 subsampling in libtheora encoding
author conrad
date Sun, 22 Nov 2009 21:08:43 +0000
parents 267588850827
children d6860312274c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10465
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
1 /*
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
2 * PNM image format
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
3 * Copyright (c) 2002, 2003 Fabrice Bellard
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
4 *
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
5 * This file is part of FFmpeg.
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
6 *
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
11 *
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
15 * Lesser General Public License for more details.
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
16 *
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
20 */
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
21
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
22 #include "avcodec.h"
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
23 #include "bytestream.h"
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
24 #include "pnm.h"
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
25
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
26
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
27 static int pnm_decode_frame(AVCodecContext *avctx, void *data,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
28 int *data_size, AVPacket *avpkt)
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
29 {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
30 const uint8_t *buf = avpkt->data;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
31 int buf_size = avpkt->size;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
32 PNMContext * const s = avctx->priv_data;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
33 AVFrame *picture = data;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
34 AVFrame * const p = (AVFrame*)&s->picture;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
35 int i, n, linesize, h, upgrade = 0;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
36 unsigned char *ptr;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
37
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
38 s->bytestream_start =
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
39 s->bytestream = buf;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
40 s->bytestream_end = buf + buf_size;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
41
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
42 if (ff_pnm_decode_header(avctx, s) < 0)
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
43 return -1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
44
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
45 if (p->data[0])
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
46 avctx->release_buffer(avctx, p);
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
47
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
48 p->reference = 0;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
49 if (avctx->get_buffer(avctx, p) < 0) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
50 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
51 return -1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
52 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
53 p->pict_type = FF_I_TYPE;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
54 p->key_frame = 1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
55
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
56 switch (avctx->pix_fmt) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
57 default:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
58 return -1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
59 case PIX_FMT_RGB48BE:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
60 n = avctx->width * 6;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
61 goto do_read;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
62 case PIX_FMT_RGB24:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
63 n = avctx->width * 3;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
64 goto do_read;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
65 case PIX_FMT_GRAY8:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
66 n = avctx->width;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
67 if (s->maxval < 255)
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
68 upgrade = 1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
69 goto do_read;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
70 case PIX_FMT_GRAY16BE:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
71 case PIX_FMT_GRAY16LE:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
72 n = avctx->width * 2;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
73 if (s->maxval < 65535)
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
74 upgrade = 2;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
75 goto do_read;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
76 case PIX_FMT_MONOWHITE:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
77 case PIX_FMT_MONOBLACK:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
78 n = (avctx->width + 7) >> 3;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
79 do_read:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
80 ptr = p->data[0];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
81 linesize = p->linesize[0];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
82 if (s->bytestream + n * avctx->height > s->bytestream_end)
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
83 return -1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
84 for (i = 0; i < avctx->height; i++) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
85 if (!upgrade)
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
86 memcpy(ptr, s->bytestream, n);
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
87 else if (upgrade == 1) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
88 unsigned int j, f = (255 * 128 + s->maxval / 2) / s->maxval;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
89 for (j = 0; j < n; j++)
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
90 ptr[j] = (s->bytestream[j] * f + 64) >> 7;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
91 } else if (upgrade == 2) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
92 unsigned int j, v, f = (65535 * 32768 + s->maxval / 2) / s->maxval;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
93 for (j = 0; j < n / 2; j++) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
94 v = be2me_16(((uint16_t *)s->bytestream)[j]);
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
95 ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
96 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
97 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
98 s->bytestream += n;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
99 ptr += linesize;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
100 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
101 break;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
102 case PIX_FMT_YUV420P:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
103 {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
104 unsigned char *ptr1, *ptr2;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
105
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
106 n = avctx->width;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
107 ptr = p->data[0];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
108 linesize = p->linesize[0];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
109 if (s->bytestream + n * avctx->height * 3 / 2 > s->bytestream_end)
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
110 return -1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
111 for (i = 0; i < avctx->height; i++) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
112 memcpy(ptr, s->bytestream, n);
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
113 s->bytestream += n;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
114 ptr += linesize;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
115 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
116 ptr1 = p->data[1];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
117 ptr2 = p->data[2];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
118 n >>= 1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
119 h = avctx->height >> 1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
120 for (i = 0; i < h; i++) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
121 memcpy(ptr1, s->bytestream, n);
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
122 s->bytestream += n;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
123 memcpy(ptr2, s->bytestream, n);
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
124 s->bytestream += n;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
125 ptr1 += p->linesize[1];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
126 ptr2 += p->linesize[2];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
127 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
128 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
129 break;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
130 case PIX_FMT_RGB32:
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
131 ptr = p->data[0];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
132 linesize = p->linesize[0];
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
133 if (s->bytestream + avctx->width * avctx->height * 4 > s->bytestream_end)
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
134 return -1;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
135 for (i = 0; i < avctx->height; i++) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
136 int j, r, g, b, a;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
137
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
138 for (j = 0; j < avctx->width; j++) {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
139 r = *s->bytestream++;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
140 g = *s->bytestream++;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
141 b = *s->bytestream++;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
142 a = *s->bytestream++;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
143 ((uint32_t *)ptr)[j] = (a << 24) | (r << 16) | (g << 8) | b;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
144 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
145 ptr += linesize;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
146 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
147 break;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
148 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
149 *picture = *(AVFrame*)&s->picture;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
150 *data_size = sizeof(AVPicture);
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
151
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
152 return s->bytestream - s->bytestream_start;
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
153 }
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
154
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
155
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
156 #if CONFIG_PGM_DECODER
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
157 AVCodec pgm_decoder = {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
158 "pgm",
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
159 CODEC_TYPE_VIDEO,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
160 CODEC_ID_PGM,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
161 sizeof(PNMContext),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
162 ff_pnm_init,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
163 NULL,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
164 ff_pnm_end,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
165 pnm_decode_frame,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
166 CODEC_CAP_DR1,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
167 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE},
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
168 .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
169 };
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
170 #endif
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
171
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
172 #if CONFIG_PGMYUV_DECODER
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
173 AVCodec pgmyuv_decoder = {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
174 "pgmyuv",
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
175 CODEC_TYPE_VIDEO,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
176 CODEC_ID_PGMYUV,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
177 sizeof(PNMContext),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
178 ff_pnm_init,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
179 NULL,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
180 ff_pnm_end,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
181 pnm_decode_frame,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
182 CODEC_CAP_DR1,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
183 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
184 .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
185 };
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
186 #endif
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
187
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
188 #if CONFIG_PPM_DECODER
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
189 AVCodec ppm_decoder = {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
190 "ppm",
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
191 CODEC_TYPE_VIDEO,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
192 CODEC_ID_PPM,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
193 sizeof(PNMContext),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
194 ff_pnm_init,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
195 NULL,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
196 ff_pnm_end,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
197 pnm_decode_frame,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
198 CODEC_CAP_DR1,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
199 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE},
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
200 .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
201 };
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
202 #endif
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
203
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
204 #if CONFIG_PBM_DECODER
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
205 AVCodec pbm_decoder = {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
206 "pbm",
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
207 CODEC_TYPE_VIDEO,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
208 CODEC_ID_PBM,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
209 sizeof(PNMContext),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
210 ff_pnm_init,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
211 NULL,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
212 ff_pnm_end,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
213 pnm_decode_frame,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
214 CODEC_CAP_DR1,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
215 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_MONOWHITE, PIX_FMT_NONE},
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
216 .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
217 };
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
218 #endif
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
219
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
220 #if CONFIG_PAM_DECODER
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
221 AVCodec pam_decoder = {
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
222 "pam",
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
223 CODEC_TYPE_VIDEO,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
224 CODEC_ID_PAM,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
225 sizeof(PNMContext),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
226 ff_pnm_init,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
227 NULL,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
228 ff_pnm_end,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
229 pnm_decode_frame,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
230 CODEC_CAP_DR1,
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
231 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE},
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
232 .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
233 };
267588850827 Split the decoders from pnmen.c off into their own file.
diego
parents:
diff changeset
234 #endif