Lines Matching defs:avctx

52 static av_cold int decode_init(AVCodecContext *avctx)
54 XbinContext *s = avctx->priv_data;
58 avctx->pix_fmt = AV_PIX_FMT_PAL8;
59 p = avctx->extradata;
64 if(avctx->extradata_size < 2 + (!!(s->flags & BINTEXT_PALETTE))*3*16
66 av_log(avctx, AV_LOG_ERROR, "not enough extradata\n");
70 av_log(avctx, AV_LOG_ERROR, "invalid font height\n");
93 av_log(avctx, AV_LOG_WARNING, "font height %i not supported\n", s->font_height);
103 if (avctx->width < FONT_WIDTH || avctx->height < s->font_height) {
104 av_log(avctx, AV_LOG_ERROR, "Resolution too small for font.\n");
112 av_unused static void hscroll(AVCodecContext *avctx)
114 XbinContext *s = avctx->priv_data;
115 if (s->y < avctx->height - s->font_height) {
119 (avctx->height - s->font_height)*s->frame->linesize[0]);
120 memset(s->frame->data[0] + (avctx->height - s->font_height)*s->frame->linesize[0],
128 static void draw_char(AVCodecContext *avctx, int c, int a)
130 XbinContext *s = avctx->priv_data;
131 if (s->y > avctx->height - s->font_height)
137 if (s->x > avctx->width - FONT_WIDTH) {
143 static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
146 XbinContext *s = avctx->priv_data;
152 if ((avctx->width / FONT_WIDTH) * (avctx->height / s->font_height) / 256 > buf_size)
157 if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0)
163 if (avctx->codec_id == AV_CODEC_ID_XBIN) {
172 draw_char(avctx, buf[0], buf[1]);
179 draw_char(avctx, c, *buf++);
184 draw_char(avctx, *buf++, a);
190 draw_char(avctx, c, a);
194 } else if (avctx->codec_id == AV_CODEC_ID_IDF) {
201 draw_char(avctx, buf[4], buf[5]);
204 draw_char(avctx, buf[0], buf[1]);
210 draw_char(avctx, buf[0], buf[1]);