for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
while (ctx->mb_width - x < mbs_per_slice)
mbs_per_slice >>= 1;
- q = find_slice_quant(avctx, avctx->coded_frame,
+ q = find_slice_quant(avctx, arg,
(mb + 1) * TRELLIS_WIDTH, x, y,
mbs_per_slice, td);
}
int max_slice_size = (ctx->frame_size_upper_bound - 200) / (ctx->pictures_per_frame * ctx->slices_per_picture + 1);
uint8_t frame_flags;
- *avctx->coded_frame = *pic;
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
- avctx->coded_frame->key_frame = 1;
-
pkt_size = ctx->frame_size_upper_bound;
if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size + FF_MIN_BUFFER_SIZE)) < 0)
// slices
if (!ctx->force_quant) {
- ret = avctx->execute2(avctx, find_quant_thread, NULL, NULL,
+ ret = avctx->execute2(avctx, find_quant_thread, (void*)pic, NULL,
ctx->mb_height);
if (ret)
return ret;
slice_hdr = pkt->data + (slice_hdr - start);
tmp = pkt->data + (tmp - start);
}
- init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8);
+ init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)));
ret = encode_slice(avctx, pic, &pb, sizes, x, y, q,
mbs_per_slice);
if (ret < 0)
ProresContext *ctx = avctx->priv_data;
int i;
- av_freep(&avctx->coded_frame);
+ av_frame_free(&avctx->coded_frame);
if (ctx->tdata) {
for (i = 0; i < avctx->thread_count; i++)
avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
+ avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+ avctx->coded_frame->key_frame = 1;
ctx->fdct = prores_fdct;
ctx->scantable = interlaced ? ff_prores_interlaced_scan