Lines Matching defs:avctx

66     AVCodecContext *avctx;
130 bw = FFMIN(ZMBV_BLOCK, c->avctx->width - x);
131 bh = FFMIN(ZMBV_BLOCK, c->avctx->height - y);
168 static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
171 ZmbvEncContext * const c = avctx->priv_data;
187 palptr = (avctx->pix_fmt == AV_PIX_FMT_PAL8) ? (uint32_t *)p->data[1] : NULL;
214 for(i = 0; i < avctx->height; i++){
215 memcpy(c->work_buf + work_size, src, avctx->width * c->bypp);
217 work_size += avctx->width * c->bypp;
225 bw = (avctx->width + ZMBV_BLOCK - 1) / ZMBV_BLOCK;
226 bh = (avctx->height + ZMBV_BLOCK - 1) / ZMBV_BLOCK;
231 for(y = 0; y < avctx->height; y += ZMBV_BLOCK) {
232 bh2 = FFMIN(avctx->height - y, ZMBV_BLOCK);
233 for(x = 0; x < avctx->width; x += ZMBV_BLOCK, mv += 2) {
234 bw2 = FFMIN(avctx->width - x, ZMBV_BLOCK);
259 for(i = 0; i < avctx->height; i++){
260 memcpy(prev, src, avctx->width * c->bypp);
276 av_log(avctx, AV_LOG_ERROR, "Error compressing data\n");
281 if ((ret = ff_get_encode_buffer(avctx, pkt, pkt_size, 0)) < 0)
303 static av_cold int encode_end(AVCodecContext *avctx)
305 ZmbvEncContext * const c = avctx->priv_data;
319 static av_cold int encode_init(AVCodecContext *avctx)
321 ZmbvEncContext * const c = avctx->priv_data;
326 switch (avctx->pix_fmt) {
358 c->avctx = avctx;
361 c->keyint = avctx->keyint_min;
365 if(avctx->me_range > 0){
366 c->lrange = FFMIN(avctx->me_range, 64);
367 c->urange = FFMIN(avctx->me_range, 63);
370 if(avctx->compression_level >= 0)
371 lvl = avctx->compression_level;
373 av_log(avctx, AV_LOG_ERROR, "Compression level should be 0-9, not %i\n", lvl);
377 c->comp_size = avctx->width * c->bypp * avctx->height + 1024 +
378 ((avctx->width + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * ((avctx->height + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * 2 + 4;
380 av_log(avctx, AV_LOG_ERROR, "Can't allocate work buffer.\n");
389 av_log(avctx, AV_LOG_ERROR, "Can't allocate compression buffer.\n");
401 c->pstride = FFALIGN((avctx->width + c->lrange) * c->bypp, 16);
402 prev_size = FFALIGN(c->lrange * c->bypp, 16) + c->pstride * (c->lrange + avctx->height + c->urange);
405 av_log(avctx, AV_LOG_ERROR, "Can't allocate picture.\n");
410 return ff_deflate_init(&c->zstream, lvl, avctx);