Lines Matching defs:avctx
27 static av_cold int decode_init(AVCodecContext *avctx)
29 if (avctx->width & 1) {
30 av_log(avctx, AV_LOG_ERROR, "FRWU needs even width\n");
33 avctx->pix_fmt = PIX_FMT_UYVY422;
35 avctx->coded_frame = avcodec_alloc_frame();
40 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
44 AVFrame *pic = avctx->coded_frame;
49 avctx->release_buffer(avctx, pic);
51 if (avpkt->size < avctx->width * 2 * avctx->height + 4 + 2*8) {
52 av_log(avctx, AV_LOG_ERROR, "Packet is too small.\n");
56 av_log(avctx, AV_LOG_ERROR, "incorrect marker\n");
61 if (avctx->get_buffer(avctx, pic) < 0)
71 int field_h = (avctx->height + !field) >> 1;
72 int field_size, min_field_size = avctx->width * 2 * field_h;
79 av_log(avctx, AV_LOG_ERROR, "Field size %i is too small (required %i)\n", field_size, min_field_size);
83 av_log(avctx, AV_LOG_ERROR, "Packet is too small, need %i, have %i\n", field_size, (int)(buf_end - buf));
89 memcpy(dst, buf, avctx->width * 2);
90 buf += avctx->width * 2;
102 static av_cold int decode_close(AVCodecContext *avctx)
104 AVFrame *pic = avctx->coded_frame;
106 avctx->release_buffer(avctx, pic);
107 av_freep(&avctx->coded_frame);