Lines Matching defs:avctx
86 static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
89 TargaContext *s = avctx->priv_data;
93 picsize = av_image_get_buffer_size(avctx->pix_fmt,
94 avctx->width, avctx->height, 1);
95 if ((ret = ff_alloc_packet(avctx, pkt, picsize + 45)) < 0)
100 AV_WL16(pkt->data+12, avctx->width);
101 AV_WL16(pkt->data+14, avctx->height);
103 pkt->data[17] = 0x20 | (avctx->pix_fmt == AV_PIX_FMT_BGRA ? 8 : 0);
107 avctx->bits_per_coded_sample = av_get_bits_per_pixel(av_pix_fmt_desc_get(avctx->pix_fmt));
108 switch(avctx->pix_fmt) {
132 avctx->bits_per_coded_sample = 0x28;
137 avctx->bits_per_coded_sample =
149 av_log(avctx, AV_LOG_ERROR, "Pixel format '%s' not supported.\n",
150 av_get_pix_fmt_name(avctx->pix_fmt));
158 datasize = targa_encode_rle(out, picsize, p, bpp, avctx->width, avctx->height);
165 else datasize = targa_encode_normal(out, p, bpp, avctx->width, avctx->height);
180 static av_cold int targa_encode_init(AVCodecContext *avctx)
182 if (avctx->width > 0xffff || avctx->height > 0xffff) {
183 av_log(avctx, AV_LOG_ERROR, "image dimensions too large\n");