if ((ret = ffv1_allocate_initial_states(s)) < 0)
return ret;
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
if (!s->transparency)
s->plane_count = 2;
put_symbol(c, state, f->plane[j].quant_table_index, 0);
av_assert0(f->plane[j].quant_table_index == f->avctx->context_model);
}
- if (!f->avctx->coded_frame->interlaced_frame)
+ if (!f->frame->interlaced_frame)
put_symbol(c, state, 3, 0);
else
- put_symbol(c, state, 1 + !f->avctx->coded_frame->top_field_first, 0);
- put_symbol(c, state, f->avctx->coded_frame->sample_aspect_ratio.num, 0);
- put_symbol(c, state, f->avctx->coded_frame->sample_aspect_ratio.den, 0);
+ put_symbol(c, state, 1 + !f->frame->top_field_first, 0);
+ put_symbol(c, state, f->frame->sample_aspect_ratio.num, 0);
+ put_symbol(c, state, f->frame->sample_aspect_ratio.den, 0);
}
static int encode_slice(AVCodecContext *c, void *arg)
? (f->bits_per_raw_sample > 8) + 1
: 4;
- if (c->coded_frame->key_frame)
+ if (f->key_frame)
ffv1_clear_slice_state(f, fs);
if (f->version > 2) {
encode_slice_header(f, fs);
{
FFV1Context *f = avctx->priv_data;
RangeCoder *const c = &f->slice_context[0]->c;
- AVFrame *const p = avctx->coded_frame;
int used_count = 0;
uint8_t keystate = 128;
uint8_t *buf_p;
if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) {
put_rac(c, &keystate, 1);
- p->key_frame = 1;
+ f->key_frame = 1;
f->gob_count++;
write_header(f);
} else {
put_rac(c, &keystate, 0);
- p->key_frame = 0;
+ f->key_frame = 0;
}
if (f->ac > 1) {
} else if (avctx->flags & CODEC_FLAG_PASS1)
avctx->stats_out[0] = '\0';
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->key_frame = f->key_frame;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
f->picture_number++;
pkt->size = buf_p - pkt->data;
- pkt->flags |= AV_PKT_FLAG_KEY * p->key_frame;
+ pkt->flags |= AV_PKT_FLAG_KEY * f->key_frame;
*got_packet = 1;
return 0;
static av_cold int ffv1_encode_close(AVCodecContext *avctx)
{
- av_frame_free(&avctx->coded_frame);
ffv1_close(avctx);
return 0;
}