Lines Matching defs:avctx

79 static av_cold int tdsc_close(AVCodecContext *avctx)
81 TDSCContext *ctx = avctx->priv_data;
94 static av_cold int tdsc_init(AVCodecContext *avctx)
96 TDSCContext *ctx = avctx->priv_data;
100 avctx->pix_fmt = AV_PIX_FMT_BGR24;
103 if (!(avctx->width && avctx->height)) {
104 av_log(avctx, AV_LOG_ERROR, "Video size not set.\n");
109 ctx->deflatelen = avctx->width * avctx->height * (3 + 1);
128 ctx->jpeg_avctx->flags = avctx->flags;
129 ctx->jpeg_avctx->flags2 = avctx->flags2;
130 ctx->jpeg_avctx->dct_algo = avctx->dct_algo;
131 ctx->jpeg_avctx->idct_algo = avctx->idct_algo;
137 ctx->refframe->format = avctx->pix_fmt;
146 static void tdsc_paint_cursor(AVCodecContext *avctx, uint8_t *dst, int stride)
148 TDSCContext *ctx = avctx->priv_data;
191 static int tdsc_load_cursor(AVCodecContext *avctx)
193 TDSCContext *ctx = avctx->priv_data;
205 if (ctx->cursor_x >= avctx->width || ctx->cursor_y >= avctx->height) {
206 av_log(avctx, AV_LOG_ERROR,
208 ctx->cursor_x, ctx->cursor_y, avctx->width, avctx->height);
213 av_log(avctx, AV_LOG_ERROR,
220 av_log(avctx, AV_LOG_WARNING, "Invalid hotspot position %d.%d.\n",
228 av_log(avctx, AV_LOG_ERROR, "Cannot allocate cursor buffer.\n");
310 avpriv_request_sample(avctx, "Cursor format %08x", cursor_fmt);
345 static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int tile_size,
348 TDSCContext *ctx = avctx->priv_data;
358 av_log(avctx, AV_LOG_ERROR, "Error submitting a packet for decoding\n");
364 av_log(avctx, AV_LOG_ERROR,
368 if (avctx->err_recognition & AV_EF_EXPLODE)
387 static int tdsc_decode_tiles(AVCodecContext *avctx, int number_tiles)
389 TDSCContext *ctx = avctx->priv_data;
402 av_log(avctx, AV_LOG_ERROR, "TDSB tag is too small.\n");
420 av_log(avctx, AV_LOG_ERROR,
436 ret = tdsc_decode_jpeg_tile(avctx, tile_size, x, y, w, h);
446 av_log(avctx, AV_LOG_ERROR, "Unknown tile type %08x.\n", tile_mode);
449 av_log(avctx, AV_LOG_DEBUG, "Tile %d, %dx%d (%d.%d)\n", i, w, h, x, y);
455 static int tdsc_parse_tdsf(AVCodecContext *avctx, int number_tiles)
457 TDSCContext *ctx = avctx->priv_data;
465 /* Store size, but wait for context reinit before updating avctx */
476 if (avctx->width != w || avctx->height != h) {
477 av_log(avctx, AV_LOG_DEBUG, "Size update %dx%d -> %d%d.\n",
478 avctx->width, avctx->height, ctx->width, ctx->height);
479 ret = ff_set_dimensions(avctx, w, h);
495 return tdsc_decode_tiles(avctx, number_tiles);
498 static int tdsc_parse_dtsm(AVCodecContext *avctx)
500 TDSCContext *ctx = avctx->priv_data;
513 ret = tdsc_load_cursor(avctx);
515 if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
519 avpriv_request_sample(avctx, "Cursor action %d", action);
525 static int tdsc_decode_frame(AVCodecContext *avctx, AVFrame *frame,
528 TDSCContext *ctx = avctx->priv_data;
533 if (ctx->width != avctx->width || ctx->height != avctx->height) {
534 int deflatelen = avctx->width * avctx->height * (3 + 1);
549 av_log(avctx, AV_LOG_ERROR, "Deflate error %d.\n", ret);
557 av_log(avctx, AV_LOG_ERROR, "Frame is too small.\n");
567 av_log(avctx, AV_LOG_ERROR, "TDSF tag is too small.\n");
576 ret = tdsc_parse_tdsf(avctx, number_tiles);
591 av_log(avctx, AV_LOG_ERROR, "DTSM tag is too small.\n");
595 ret = tdsc_parse_dtsm(avctx);
601 ret = ff_get_buffer(avctx, frame, 0);
610 tdsc_paint_cursor(avctx, frame->data[0], frame->linesize[0]);