Lines Matching defs:avctx
48 static int parse_palette(AVCodecContext *avctx, GetByteContext *gbc,
57 av_log(avctx, AV_LOG_WARNING,
62 if (avctx->pix_fmt != AV_PIX_FMT_PAL8)
75 static int decode_rle_bpp2(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc)
77 int offset = avctx->width;
81 for (i = 0; i < avctx->height; i++) {
130 static int decode_rle_bpp4(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc)
132 int offset = avctx->width;
136 for (i = 0; i < avctx->height; i++) {
174 static int decode_rle16(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc)
176 int offset = avctx->width;
180 for (i = 0; i < avctx->height; i++) {
217 static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
221 int offset = avctx->width * step;
224 for (i = 0; i < avctx->height; i++) {
291 static int decode_frame(AVCodecContext *avctx, AVFrame *p,
309 av_log(avctx, AV_LOG_ERROR, "Frame is too small %d\n",
318 ret = ff_set_dimensions(avctx, w, h);
325 avpriv_request_sample(avctx, "QuickDraw version 1");
328 avpriv_request_sample(avctx, "QuickDraw version unknown (%X)", bytestream2_get_be32(&gbc));
346 av_log(avctx, AV_LOG_DEBUG, "Parsing Packbit opcode\n");
353 av_log(avctx, AV_LOG_DEBUG, "bppcount %d bpp %d\n", bppcnt, bpp);
355 avctx->pix_fmt = AV_PIX_FMT_PAL8;
357 avctx->pix_fmt = AV_PIX_FMT_PAL8;
359 avctx->pix_fmt = AV_PIX_FMT_RGB555;
361 av_log(avctx, AV_LOG_ERROR,
372 av_log(avctx, AV_LOG_ERROR,
377 av_log(avctx, AV_LOG_ERROR, "Palette is too small %d\n",
381 if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
384 ret = parse_palette(avctx, &gbc, (uint32_t *)p->data[1], colors, flags & 0x8000);
394 avpriv_report_missing_feature(avctx, "Packbit mask region");
397 if (avctx->pix_fmt == AV_PIX_FMT_RGB555)
398 ret = decode_rle16(avctx, p, &gbc);
400 ret = decode_rle_bpp2(avctx, p, &gbc);
402 ret = decode_rle_bpp4(avctx, p, &gbc);
404 ret = decode_rle(avctx, p, &gbc, bppcnt);
411 av_log(avctx, AV_LOG_DEBUG, "Parsing Directbit opcode\n");
416 avpriv_report_missing_feature(avctx, "Short rowbytes");
425 ret = ff_set_dimensions(avctx, w, h);
435 av_log(avctx, AV_LOG_DEBUG, "bppcount %d bpp %d\n", bppcnt, bpp);
437 avctx->pix_fmt = AV_PIX_FMT_RGB24;
439 avctx->pix_fmt = AV_PIX_FMT_RGB555;
441 avctx->pix_fmt = AV_PIX_FMT_ARGB;
443 av_log(avctx, AV_LOG_ERROR,
454 avpriv_request_sample(avctx, "Pack type %d", pack_type);
459 if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
467 avpriv_report_missing_feature(avctx, "DirectBit mask region");
470 if (avctx->pix_fmt == AV_PIX_FMT_RGB555)
471 ret = decode_rle16(avctx, p, &gbc);
473 ret = decode_rle(avctx, p, &gbc, bppcnt);
483 av_log(avctx, AV_LOG_TRACE, "Unknown 0x%04X opcode\n", opcode);
496 av_log(avctx, AV_LOG_WARNING,
499 av_log(avctx, AV_LOG_WARNING, "Got %d trailing bytes\n", trail);
510 av_log(avctx, AV_LOG_ERROR, "Frame contained no usable data\n");