Lines Matching defs:avctx
112 static int parse_pixel_format(AVCodecContext *avctx)
114 DDSContext *ctx = avctx->priv_data;
132 av_log(avctx, AV_LOG_ERROR, "Invalid pixel format header %d.\n", size);
142 av_log(avctx, AV_LOG_WARNING,
159 av_log(avctx, AV_LOG_VERBOSE, "fourcc %s bpp %d "
162 av_log(avctx, AV_LOG_VERBOSE, "and GIMP-DDS tag %s\n", av_fourcc2str(gimp_tag));
165 avctx->pix_fmt = AV_PIX_FMT_RGBA;
227 avctx->pix_fmt = AV_PIX_FMT_UYVY422;
231 avctx->pix_fmt = AV_PIX_FMT_YUYV422;
237 avctx->pix_fmt = AV_PIX_FMT_PAL8;
241 avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
252 av_log(avctx, AV_LOG_VERBOSE,
258 av_log(avctx, AV_LOG_VERBOSE, "DXGI format %d.\n", dxgi);
267 avctx->pix_fmt = AV_PIX_FMT_BGRA64;
270 avctx->colorspace = AVCOL_SPC_RGB;
276 avctx->pix_fmt = AV_PIX_FMT_BGRA;
279 avctx->colorspace = AVCOL_SPC_RGB;
282 avctx->pix_fmt = AV_PIX_FMT_RGBA;
285 avctx->colorspace = AVCOL_SPC_RGB;
288 avctx->pix_fmt = AV_PIX_FMT_RGBA; // opaque
291 avctx->pix_fmt = AV_PIX_FMT_RGB565LE;
295 avctx->colorspace = AVCOL_SPC_RGB;
302 avctx->colorspace = AVCOL_SPC_RGB;
309 avctx->colorspace = AVCOL_SPC_RGB;
334 av_log(avctx, AV_LOG_ERROR,
340 av_log(avctx, AV_LOG_ERROR, "Unsupported %s fourcc.\n", av_fourcc2str(fourcc));
345 avctx->pix_fmt = AV_PIX_FMT_PAL8;
347 av_log(avctx, AV_LOG_ERROR, "Unsupported palette bpp %d.\n", bpp);
353 avctx->pix_fmt = AV_PIX_FMT_PAL8;
356 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
358 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
361 avctx->pix_fmt = AV_PIX_FMT_YA8;
363 avctx->pix_fmt = AV_PIX_FMT_YA8;
367 avctx->pix_fmt = AV_PIX_FMT_GRAY16LE;
369 avctx->pix_fmt = AV_PIX_FMT_RGB555LE;
371 avctx->pix_fmt = AV_PIX_FMT_RGB555LE; // alpha ignored
373 avctx->pix_fmt = AV_PIX_FMT_RGB565LE;
376 avctx->pix_fmt = AV_PIX_FMT_BGR24;
379 avctx->pix_fmt = AV_PIX_FMT_BGR0; // opaque
381 avctx->pix_fmt = AV_PIX_FMT_RGB0; // opaque
383 avctx->pix_fmt = AV_PIX_FMT_BGRA;
385 avctx->pix_fmt = AV_PIX_FMT_RGBA;
388 av_log(avctx, AV_LOG_ERROR, "Unknown pixel format "
442 static void run_postproc(AVCodecContext *avctx, AVFrame *frame)
444 DDSContext *ctx = avctx->priv_data;
452 av_log(avctx, AV_LOG_DEBUG, "Post-processing alpha exponent.\n");
473 av_log(avctx, AV_LOG_DEBUG, "Post-processing normal map.\n");
495 av_log(avctx, AV_LOG_DEBUG, "Post-processing raw YCoCg.\n");
512 av_log(avctx, AV_LOG_DEBUG, "Post-processing swapped Luma/Alpha.\n");
521 av_log(avctx, AV_LOG_DEBUG, "Post-processing A2XY swizzle.\n");
526 av_log(avctx, AV_LOG_DEBUG, "Post-processing RBXG swizzle.\n");
532 av_log(avctx, AV_LOG_DEBUG, "Post-processing RGXB swizzle.\n");
537 av_log(avctx, AV_LOG_DEBUG, "Post-processing RXBG swizzle.\n");
542 av_log(avctx, AV_LOG_DEBUG, "Post-processing RXGB swizzle.\n");
547 av_log(avctx, AV_LOG_DEBUG, "Post-processing XGBR swizzle.\n");
554 av_log(avctx, AV_LOG_DEBUG, "Post-processing XGXR swizzle.\n");
561 av_log(avctx, AV_LOG_DEBUG, "Post-processing XRBG swizzle.\n");
568 static int dds_decode(AVCodecContext *avctx, AVFrame *frame,
571 DDSContext *ctx = avctx->priv_data;
581 av_log(avctx, AV_LOG_ERROR, "Frame is too small (%d).\n",
588 av_log(avctx, AV_LOG_ERROR, "Invalid DDS header.\n");
596 ret = ff_set_dimensions(avctx, width, height);
598 av_log(avctx, AV_LOG_ERROR, "Invalid image size %dx%d.\n",
599 avctx->width, avctx->height);
604 avctx->coded_width = FFALIGN(avctx->width, TEXTURE_BLOCK_W);
605 avctx->coded_height = FFALIGN(avctx->height, TEXTURE_BLOCK_H);
611 av_log(avctx, AV_LOG_VERBOSE, "Found %d mipmaps (ignored).\n", mipmap);
615 ret = parse_pixel_format(avctx);
619 ret = ff_get_buffer(avctx, frame, 0);
624 int size = (avctx->coded_height / TEXTURE_BLOCK_H) *
625 (avctx->coded_width / TEXTURE_BLOCK_W) * ctx->dec.tex_ratio;
626 ctx->dec.slice_count = av_clip(avctx->thread_count, 1,
627 avctx->coded_height / TEXTURE_BLOCK_H);
630 av_log(avctx, AV_LOG_ERROR,
640 avctx->execute2(avctx, ff_texturedsp_decompress_thread, &ctx->dec, NULL, ctx->dec.slice_count);
641 } else if (!ctx->paletted && ctx->bpp == 4 && avctx->pix_fmt == AV_PIX_FMT_PAL8) {
658 av_log(avctx, AV_LOG_ERROR, "Buffer is too small (%d < %d).\n",
672 int linesize = av_image_get_linesize(avctx->pix_fmt, frame->width, 0);
690 av_log(avctx, AV_LOG_ERROR, "Buffer is too small (%d < %d).\n",
702 run_postproc(avctx, frame);