Commit 117bc8e6 authored by Christophe Gisquet's avatar Christophe Gisquet Committed by Michael Niedermayer

proresenc_kostya: properly account for alpha

The packet buffer allocation considered as dct-coded, while it is
actually run-coded and thus requires a larger buffer.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4ba45c18
......@@ -1208,8 +1208,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
ctx->bits_per_mb = ls * 8;
if (ctx->chroma_factor == CFACTOR_Y444)
ctx->bits_per_mb += ls * 4;
if (ctx->num_planes == 4)
ctx->bits_per_mb += ls * 4;
}
ctx->frame_size_upper_bound = ctx->pictures_per_frame *
......@@ -1218,6 +1216,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
(mps * ctx->bits_per_mb) / 8)
+ 200;
if (ctx->alpha_bits) {
// alpha plane is run-coded and might run over bit budget
ctx->frame_size_upper_bound += ctx->pictures_per_frame *
ctx->slices_per_picture *
/* num pixels per slice */ (ctx->mbs_per_slice * 256 *
/* bits per pixel */ (1 + ctx->alpha_bits + 1) + 7 >> 3);
}
avctx->codec_tag = ctx->profile_info->tag;
av_log(avctx, AV_LOG_DEBUG,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment