Lines Matching refs:avctx
56 AVCodecContext *avctx;
67 static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
70 LclEncContext *c = avctx->priv_data;
74 int max_size = deflateBound(zstream, avctx->width * avctx->height * 3);
76 if ((ret = ff_alloc_packet(avctx, pkt, max_size)) < 0)
79 if(avctx->pix_fmt != AV_PIX_FMT_BGR24){
80 av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
86 av_log(avctx, AV_LOG_ERROR, "Deflate reset error: %d\n", zret);
92 for(i = avctx->height - 1; i >= 0; i--) {
94 zstream->avail_in = avctx->width * 3;
97 av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret);
103 av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret);
113 static av_cold int encode_init(AVCodecContext *avctx)
115 LclEncContext *c = avctx->priv_data;
117 c->avctx= avctx;
119 av_assert0(avctx->width && avctx->height);
121 avctx->extradata = av_mallocz(8 + AV_INPUT_BUFFER_PADDING_SIZE);
122 if (!avctx->extradata)
125 c->compression = avctx->compression_level == FF_COMPRESSION_DEFAULT ?
127 av_clip(avctx->compression_level, 0, 9);
130 avctx->bits_per_coded_sample= 24;
132 avctx->extradata[0]= 4;
133 avctx->extradata[1]= 0;
134 avctx->extradata[2]= 0;
135 avctx->extradata[3]= 0;
136 avctx->extradata[4]= c->imgtype;
137 avctx->extradata[5]= c->compression;
138 avctx->extradata[6]= c->flags;
139 avctx->extradata[7]= CODEC_ZLIB;
140 c->avctx->extradata_size= 8;
142 return ff_deflate_init(&c->zstream, c->compression, avctx);
145 static av_cold int encode_end(AVCodecContext *avctx)
147 LclEncContext *c = avctx->priv_data;