Lines Matching defs:avctx
71 int (*magy_decode_slice)(AVCodecContext *avctx, void *tdata,
115 static int magy_decode_slice10(AVCodecContext *avctx, void *tdata,
118 MagicYUVContext *s = avctx->priv_data;
129 int height = AV_CEIL_RSHIFT(FFMIN(s->slice_height, avctx->coded_height - j * s->slice_height), s->vshift[i]);
130 int width = AV_CEIL_RSHIFT(avctx->coded_width, s->hshift[i]);
222 avpriv_request_sample(avctx, "Unknown prediction: %d", pred);
227 int height = FFMIN(s->slice_height, avctx->coded_height - j * s->slice_height);
228 int width = avctx->coded_width;
247 static int magy_decode_slice(AVCodecContext *avctx, void *tdata,
250 MagicYUVContext *s = avctx->priv_data;
259 int height = AV_CEIL_RSHIFT(FFMIN(s->slice_height, avctx->coded_height - j * s->slice_height), s->vshift[i]);
260 int width = AV_CEIL_RSHIFT(avctx->coded_width, s->hshift[i]);
355 avpriv_request_sample(avctx, "Unknown prediction: %d", pred);
360 int height = FFMIN(s->slice_height, avctx->coded_height - j * s->slice_height);
361 int width = avctx->coded_width;
378 static int build_huffman(AVCodecContext *avctx, const uint8_t *table,
381 MagicYUVContext *s = avctx->priv_data;
401 av_log(avctx, AV_LOG_ERROR, "Invalid Huffman codes\n");
411 if (huff_build(len, length_count, &s->vlc[i], max, avctx)) {
412 av_log(avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n");
424 av_log(avctx, AV_LOG_ERROR, "Huffman tables too short\n");
431 static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p,
434 MagicYUVContext *s = avctx->priv_data;
449 av_log(avctx, AV_LOG_ERROR,
456 avpriv_request_sample(avctx, "Version %d", version);
470 avctx->pix_fmt = AV_PIX_FMT_GBRP;
474 avctx->pix_fmt = AV_PIX_FMT_GBRAP;
478 avctx->pix_fmt = AV_PIX_FMT_YUV444P;
481 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
486 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
493 avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
496 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
499 avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
505 avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
509 avctx->pix_fmt = AV_PIX_FMT_GBRP10;
514 avctx->pix_fmt = AV_PIX_FMT_GBRAP10;
519 avctx->pix_fmt = AV_PIX_FMT_GBRP12;
524 avctx->pix_fmt = AV_PIX_FMT_GBRAP12;
529 avctx->pix_fmt = AV_PIX_FMT_GRAY10;
533 avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
541 avpriv_request_sample(avctx, "Format 0x%X", format);
546 s->planes = av_pix_fmt_count_planes(avctx->pix_fmt);
556 ret = ff_set_dimensions(avctx, width, height);
561 if (slice_width != avctx->coded_width) {
562 avpriv_request_sample(avctx, "Slice width %"PRIu32, slice_width);
566 if (s->slice_height <= 0 || s->slice_height > INT_MAX - avctx->coded_height) {
567 av_log(avctx, AV_LOG_ERROR,
574 s->nb_slices = (avctx->coded_height + s->slice_height - 1) / s->slice_height;
576 av_log(avctx, AV_LOG_ERROR,
583 av_log(avctx, AV_LOG_ERROR, "impossible slice height\n");
586 if ((avctx->coded_height % s->slice_height) && ((avctx->coded_height % s->slice_height) >> s->vshift[1]) < 2) {
587 av_log(avctx, AV_LOG_ERROR, "impossible height\n");
635 ret = build_huffman(avctx, avpkt->data + bytestream2_tell(&gb),
643 if ((ret = ff_thread_get_buffer(avctx, p, 0)) < 0)
648 avctx->execute2(avctx, s->magy_decode_slice, NULL, NULL, s->nb_slices);
650 if (avctx->pix_fmt == AV_PIX_FMT_GBRP ||
651 avctx->pix_fmt == AV_PIX_FMT_GBRAP ||
652 avctx->pix_fmt == AV_PIX_FMT_GBRP10 ||
653 avctx->pix_fmt == AV_PIX_FMT_GBRAP10||
654 avctx->pix_fmt == AV_PIX_FMT_GBRAP12||
655 avctx->pix_fmt == AV_PIX_FMT_GBRP12) {
675 static av_cold int magy_decode_init(AVCodecContext *avctx)
677 MagicYUVContext *s = avctx->priv_data;
682 static av_cold int magy_decode_end(AVCodecContext *avctx)
684 MagicYUVContext * const s = avctx->priv_data;