Lines Matching defs:avctx
72 static void to_meta_with_crop(AVCodecContext *avctx,
77 int height = FFMIN(avctx->height, C64YRES);
78 int width = FFMIN(avctx->width , C64XRES);
103 static void render_charset(AVCodecContext *avctx, uint8_t *charset,
106 A64Context *c = avctx->priv_data;
198 static av_cold int a64multi_close_encoder(AVCodecContext *avctx)
200 A64Context *c = avctx->priv_data;
211 static av_cold int a64multi_encode_init(AVCodecContext *avctx)
213 A64Context *c = avctx->priv_data;
217 if (avctx->global_quality < 1) {
220 c->mc_lifetime = avctx->global_quality / FF_QP2LAMBDA;
223 av_log(avctx, AV_LOG_INFO, "charset lifetime set to %d frame(s)\n", c->mc_lifetime);
226 c->mc_use_5col = avctx->codec->id == AV_CODEC_ID_A64_MULTI5;
240 av_log(avctx, AV_LOG_ERROR, "Failed to allocate buffer memory.\n");
245 if (!(avctx->extradata = av_mallocz(8 * 4 + AV_INPUT_BUFFER_PADDING_SIZE))) {
246 av_log(avctx, AV_LOG_ERROR, "Failed to allocate memory for extradata.\n");
249 avctx->extradata_size = 8 * 4;
250 AV_WB32(avctx->extradata, c->mc_lifetime);
251 AV_WB32(avctx->extradata + 16, INTERLACED);
253 if (!avctx->codec_tag)
254 avctx->codec_tag = AV_RL32("a64m");
276 static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
279 A64Context *c = avctx->priv_data;
299 b_height = FFMIN(avctx->height,C64YRES) >> 3;
300 b_width = FFMIN(avctx->width ,C64XRES) >> 3;
322 to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter);
337 if ((ret = ff_get_encode_buffer(avctx, pkt, alloc_size, 0)) < 0)
348 render_charset(avctx, buf, colram);
379 AV_WB32(avctx->extradata + 4, c->mc_frame_counter);
380 AV_WB32(avctx->extradata + 8, charset_size);
381 AV_WB32(avctx->extradata + 12, screen_size + colram_size);