Lines Matching refs:avctx
65 int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
88 avctx->pix_fmt = AV_PIX_FMT_GBRPF32;
90 avctx->pix_fmt = AV_PIX_FMT_GRAYF32;
92 avctx->pix_fmt = AV_PIX_FMT_GBRPF32;
95 avctx->pix_fmt = AV_PIX_FMT_GRAYF32;
98 avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
100 if (avctx->codec_id == AV_CODEC_ID_PGMYUV)
101 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
103 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
105 avctx->pix_fmt = AV_PIX_FMT_RGB24;
141 av_image_check_size(w, h, 0, avctx) || s->bytestream >= s->bytestream_end)
144 ret = ff_set_dimensions(avctx, w, h);
150 avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
152 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
154 avctx->pix_fmt = AV_PIX_FMT_GRAY16;
158 avctx->pix_fmt = AV_PIX_FMT_GRAY8A;
160 avctx->pix_fmt = AV_PIX_FMT_YA16;
164 avctx->pix_fmt = AV_PIX_FMT_RGB24;
166 avctx->pix_fmt = AV_PIX_FMT_RGB48;
170 avctx->pix_fmt = AV_PIX_FMT_RGBA;
172 avctx->pix_fmt = AV_PIX_FMT_RGBA64;
185 if(w <= 0 || h <= 0 || av_image_check_size(w, h, 0, avctx) || s->bytestream >= s->bytestream_end)
188 ret = ff_set_dimensions(avctx, w, h);
192 if (avctx->pix_fmt == AV_PIX_FMT_GBRPF32 || avctx->pix_fmt == AV_PIX_FMT_GRAYF32) {
195 av_log(avctx, AV_LOG_ERROR, "Invalid scale.\n");
201 } else if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE && avctx->pix_fmt != AV_PIX_FMT_MONOBLACK) {
205 av_log(avctx, AV_LOG_ERROR, "Invalid maxval: %d\n", s->maxval);
209 if (avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
210 avctx->pix_fmt = AV_PIX_FMT_GRAY16;
211 } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) {
212 avctx->pix_fmt = AV_PIX_FMT_RGB48;
213 } else if (avctx->pix_fmt == AV_PIX_FMT_YUV420P && s->maxval < 65536) {
215 avctx->pix_fmt = AV_PIX_FMT_YUV420P9;
217 avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
219 avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
221 av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n");
222 avctx->pix_fmt = AV_PIX_FMT_NONE;
233 if ((av_pix_fmt_desc_get(avctx->pix_fmt)->flags & AV_PIX_FMT_FLAG_PLANAR) &&
234 avctx->pix_fmt != AV_PIX_FMT_GBRPF32) {
235 if ((avctx->width & 1) != 0)
237 h = (avctx->height * 2);
241 avctx->height = h;