Lines Matching defs:avctx
72 static av_cold int rscc_init(AVCodecContext *avctx)
74 RsccContext *ctx = avctx->priv_data;
77 int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
79 av_log(avctx, AV_LOG_ERROR, "Invalid image size %dx%d.\n",
80 avctx->width, avctx->height);
90 if (avctx->codec_tag == MKTAG('I', 'S', 'C', 'C')) {
91 if (avctx->extradata && avctx->extradata_size == 4) {
92 if ((avctx->extradata[0] >> 1) & 1) {
93 avctx->pix_fmt = AV_PIX_FMT_BGRA;
96 avctx->pix_fmt = AV_PIX_FMT_BGR24;
100 avctx->pix_fmt = AV_PIX_FMT_BGRA;
103 } else if (avctx->codec_tag == MKTAG('R', 'S', 'C', 'C')) {
104 ctx->component_size = avctx->bits_per_coded_sample / 8;
105 switch (avctx->bits_per_coded_sample) {
107 avctx->pix_fmt = AV_PIX_FMT_PAL8;
110 avctx->pix_fmt = AV_PIX_FMT_RGB555LE;
113 avctx->pix_fmt = AV_PIX_FMT_BGR24;
116 avctx->pix_fmt = AV_PIX_FMT_BGR0;
119 av_log(avctx, AV_LOG_ERROR, "Invalid bits per pixel value (%d)\n",
120 avctx->bits_per_coded_sample);
124 avctx->pix_fmt = AV_PIX_FMT_BGR0;
126 av_log(avctx, AV_LOG_WARNING, "Invalid codec tag\n");
130 ctx->inflated_size = avctx->width * avctx->height * ctx->component_size;
140 static av_cold int rscc_close(AVCodecContext *avctx)
142 RsccContext *ctx = avctx->priv_data;
151 static int rscc_decode_frame(AVCodecContext *avctx, AVFrame *frame,
154 RsccContext *ctx = avctx->priv_data;
166 av_log(avctx, AV_LOG_ERROR, "Packet too small (%d)\n", avpkt->size);
174 av_log(avctx, AV_LOG_DEBUG, "no tiles\n");
185 av_log(avctx, AV_LOG_DEBUG, "Frame with %d tiles.\n", tiles_nb);
198 ff_dlog(avctx, "packed tiles of size %lu.\n", packed_tiles_size);
218 av_log(avctx, AV_LOG_ERROR, "Tile deflate error %d.\n", ret);
239 av_log(avctx, AV_LOG_ERROR, "Invalid tile dimensions\n");
246 ff_dlog(avctx, "tile %d orig(%d,%d) %dx%d.\n", i,
251 av_log(avctx, AV_LOG_ERROR,
257 } else if (ctx->tiles[i].x + ctx->tiles[i].w > avctx->width ||
258 ctx->tiles[i].y + ctx->tiles[i].h > avctx->height) {
259 av_log(avctx, AV_LOG_ERROR,
281 ff_dlog(avctx, "pixel_size %d packed_size %d.\n", pixel_size, packed_size);
284 av_log(avctx, AV_LOG_ERROR, "Invalid tile size %d\n", packed_size);
292 av_log(avctx, AV_LOG_ERROR, "Insufficient input for %d\n", pixel_size);
300 av_log(avctx, AV_LOG_ERROR, "Insufficient input for %d\n", packed_size);
310 av_log(avctx, AV_LOG_ERROR, "Pixel deflate error %d.\n", ret);
318 ret = ff_reget_buffer(avctx, ctx->reference, 0);
326 (avctx->height - ctx->tiles[i].y - 1) +
349 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
350 frame->palette_has_changed = ff_copy_palette(ctx->palette, avpkt, avctx);
356 if (ctx->valid_pixels >= ctx->inflated_size * (100 - avctx->discard_damaged_percentage) / 100)