Lines Matching defs:avctx

31 static int bmp_decode_frame(AVCodecContext *avctx, AVFrame *p,
50 av_log(avctx, AV_LOG_ERROR, "buf size too small (%d)\n", buf_size);
56 av_log(avctx, AV_LOG_ERROR, "bad magic number\n");
62 av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %u), trying to decode anyway\n",
73 av_log(avctx, AV_LOG_ERROR, "invalid header size %u\n", hsize);
82 av_log(avctx, AV_LOG_ERROR,
102 avpriv_report_missing_feature(avctx, "Information header size %u",
109 av_log(avctx, AV_LOG_ERROR, "invalid BMP header\n");
122 av_log(avctx, AV_LOG_ERROR, "BMP coding %d not supported\n", comp);
135 ret = ff_set_dimensions(avctx, width, height > 0 ? height : -(unsigned)height);
137 av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions %d %d\n", width, height);
141 avctx->pix_fmt = AV_PIX_FMT_NONE;
147 avctx->pix_fmt = alpha ? AV_PIX_FMT_ABGR : AV_PIX_FMT_0BGR;
149 avctx->pix_fmt = alpha ? AV_PIX_FMT_BGRA : AV_PIX_FMT_BGR0;
151 avctx->pix_fmt = alpha ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB;
153 avctx->pix_fmt = alpha ? AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB0;
155 av_log(avctx, AV_LOG_ERROR, "Unknown bitfields "
160 avctx->pix_fmt = AV_PIX_FMT_BGRA;
164 avctx->pix_fmt = AV_PIX_FMT_BGR24;
168 avctx->pix_fmt = AV_PIX_FMT_RGB555;
171 avctx->pix_fmt = AV_PIX_FMT_RGB565;
173 avctx->pix_fmt = AV_PIX_FMT_RGB555;
175 avctx->pix_fmt = AV_PIX_FMT_RGB444;
177 av_log(avctx, AV_LOG_ERROR,
186 avctx->pix_fmt = AV_PIX_FMT_PAL8;
188 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
193 avctx->pix_fmt = AV_PIX_FMT_PAL8;
195 av_log(avctx, AV_LOG_ERROR, "Unknown palette for %u-colour BMP\n",
201 av_log(avctx, AV_LOG_ERROR, "depth %u not supported\n", depth);
205 if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
206 av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
210 if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
219 n = ((avctx->width * depth + 31) / 8) & ~3;
221 if (n * avctx->height > dsize && comp != BMP_RLE4 && comp != BMP_RLE8) {
222 n = (avctx->width * depth + 7) / 8;
223 if (n * avctx->height > dsize) {
224 av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d)\n",
225 dsize, n * avctx->height);
228 av_log(avctx, AV_LOG_ERROR, "data size too small, assuming missing line alignment\n");
233 memset(p->data[0], 0, avctx->height * p->linesize[0]);
236 ptr = p->data[0] + (avctx->height - 1) * p->linesize[0];
243 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
253 av_log(avctx, AV_LOG_ERROR,
266 av_log(avctx, AV_LOG_ERROR, "palette doesn't fit in packet\n");
279 p->data[0] += p->linesize[0] * (avctx->height - 1);
283 ff_msrle_decode(avctx, p, depth, &gb);
285 p->data[0] += p->linesize[0] * (avctx->height - 1);
291 for (i = 0; i < avctx->height; i++) {
293 for (j = 0; j < avctx->width >> 3; j++) {
303 for (j = 0; j < (avctx->width & 7); j++) {
304 ptr[avctx->width - (avctx->width & 7) + j] = buf[avctx->width >> 3] >> (7 - j) & 1;
313 for (i = 0; i < avctx->height; i++) {
320 for (i = 0; i < avctx->height; i++) {
331 for (i = 0; i < avctx->height; i++) {
335 for (j = 0; j < avctx->width; j++)
343 av_log(avctx, AV_LOG_ERROR, "BMP decoder is broken\n");
347 if (avctx->pix_fmt == AV_PIX_FMT_BGRA) {
348 for (i = 0; i < avctx->height; i++) {
351 for (j = 0; j < avctx->width; j++) {
355 if (j < avctx->width)
358 if (i == avctx->height)
359 avctx->pix_fmt = p->format = AV_PIX_FMT_BGR0;