Lines Matching defs:avctx
90 static int get_quant(AVCodecContext *avctx, NuvContext *c, const uint8_t *buf,
95 av_log(avctx, AV_LOG_ERROR, "insufficient rtjpeg quant data\n");
118 static int codec_reinit(AVCodecContext *avctx, int width, int height,
121 NuvContext *c = avctx->priv_data;
135 if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
142 av_log(avctx, AV_LOG_ERROR,
155 static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
160 NuvContext *c = avctx->priv_data;
166 int result, init_frame = !avctx->frame_number;
177 av_log(avctx, AV_LOG_ERROR, "coded frame too small\n");
187 ret = get_quant(avctx, c, buf, buf_size);
195 av_log(avctx, AV_LOG_ERROR, "not a nuv video frame\n");
228 av_log(avctx, AV_LOG_ERROR, "unknown compression\n");
241 av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
251 av_log(avctx, AV_LOG_ERROR, "Too small NUV video frame\n");
258 av_log(avctx, AV_LOG_ERROR, "Unknown secondary frame header (wrong codec_tag?)\n");
264 if ((result = codec_reinit(avctx, w, h, q)) < 0)
281 if ((result = ff_reget_buffer(avctx, c->pic, flags)) < 0)
284 memset(c->pic->data[0], 0, avctx->height * c->pic->linesize[0]);
285 memset(c->pic->data[1], 0x80, avctx->height * c->pic->linesize[1] / 2);
286 memset(c->pic->data[2], 0x80, avctx->height * c->pic->linesize[2] / 2);
297 av_log(avctx, AV_LOG_ERROR, "uncompressed frame too short\n");
327 static av_cold int decode_init(AVCodecContext *avctx)
329 NuvContext *c = avctx->priv_data;
336 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
342 c->codec_frameheader = avctx->codec_tag == MKTAG('R', 'J', 'P', 'G');
344 if (avctx->extradata_size)
345 get_quant(avctx, c, avctx->extradata, avctx->extradata_size);
347 ff_rtjpeg_init(&c->rtj, avctx);
349 if ((ret = codec_reinit(avctx, avctx->width, avctx->height, -1)) < 0)
355 static av_cold int decode_end(AVCodecContext *avctx)
357 NuvContext *c = avctx->priv_data;