Lines Matching defs:avctx

179 static int decode_555(AVCodecContext *avctx, GetByteContext *gB, uint16_t *dst, ptrdiff_t stride,
217 av_log(avctx, AV_LOG_ERROR, "repeat overflow\n");
379 static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size,
382 MSS2Context *ctx = avctx->priv_data;
384 VC1Context *v = avctx->priv_data;
389 ff_mpeg_flush(avctx);
394 s->loop_filter = avctx->skip_loop_filter < AVDISCARD_ALL;
397 av_log(v->s.avctx, AV_LOG_ERROR, "header error\n");
402 av_log(v->s.avctx, AV_LOG_ERROR, "expected I-frame\n");
406 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
408 if ((ret = ff_mpv_frame_start(s, avctx)) < 0) {
409 av_log(v->s.avctx, AV_LOG_ERROR, "ff_mpv_frame_start error\n");
410 avctx->pix_fmt = AV_PIX_FMT_RGB24;
428 av_log(v->s.avctx, AV_LOG_WARNING,
442 avpriv_request_sample(v->s.avctx,
462 avctx->pix_fmt = AV_PIX_FMT_RGB24;
474 static int mss2_decode_frame(AVCodecContext *avctx, AVFrame *frame,
479 MSS2Context *ctx = avctx->priv_data;
512 ctx->split_position = avctx->height / 2;
515 ctx->split_position = avctx->height;
518 ctx->split_position > avctx->height - 1))
531 avctx->pix_fmt = is_555 ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_RGB24;
532 if (ctx->last_pic->format != avctx->pix_fmt)
546 r->x = arith2_get_number(&acoder, avctx->width);
548 r->x = arith2_get_number(&acoder, avctx->width -
551 r->y = arith2_get_number(&acoder, avctx->height);
552 r->w = arith2_get_number(&acoder, avctx->width - r->x) + 1;
553 r->h = arith2_get_number(&acoder, avctx->height - r->y) + 1;
558 av_log(avctx, AV_LOG_ERROR, "implicit_rect && used_rects > 0\n");
565 wmv9rects[0].w = avctx->width;
566 wmv9rects[0].h = avctx->height;
572 av_log(avctx, AV_LOG_ERROR, "Unexpected grandchildren\n");
600 c->mvX = AV_RB16(buf - 4) - avctx->width;
601 c->mvY = AV_RB16(buf - 2) - avctx->height;
607 if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
613 ctx->last_pic->linesize[0] * (avctx->height - 1);
615 av_log(avctx, AV_LOG_ERROR, "Missing keyframe\n");
619 if ((ret = ff_reget_buffer(avctx, ctx->last_pic, 0)) < 0)
627 frame->linesize[0] * (avctx->height - 1);
636 if (decode_555(avctx, &gB, (uint16_t *)c->rgb_pic, c->rgb_stride >> 1,
637 keyframe, avctx->width, avctx->height))
654 avctx->width, avctx->height))
662 avctx->width, avctx->height))
675 avctx->width,
688 avctx->width,
689 avctx->height - ctx->split_position))
696 memset(c->pal_pic, 0, c->pal_stride * avctx->height);
709 if (ret = decode_wmv9(avctx, buf + 3, buf_size - 3,
733 av_log(avctx, AV_LOG_WARNING, "buffer not fully consumed\n");
747 static av_cold int wmv9_init(AVCodecContext *avctx)
749 VC1Context *v = avctx->priv_data;
752 v->s.avctx = avctx;
784 v->s.max_b_frames = avctx->max_b_frames = 0;
793 if ((ret = ff_msmpeg4_decode_init(avctx)) < 0 ||
804 static av_cold int mss2_decode_end(AVCodecContext *avctx)
806 MSS2Context *const ctx = avctx->priv_data;
813 ff_vc1_decode_end(avctx);
818 static av_cold int mss2_decode_init(AVCodecContext *avctx)
820 MSS2Context * const ctx = avctx->priv_data;
823 c->avctx = avctx;
828 c->pal_pic = av_mallocz(c->pal_stride * avctx->height);
829 c->last_pal_pic = av_mallocz(c->pal_stride * avctx->height);
831 mss2_decode_end(avctx);
834 if (ret = wmv9_init(avctx)) {
835 mss2_decode_end(avctx);
840 avctx->pix_fmt = c->free_colours == 127 ? AV_PIX_FMT_RGB555