avcodec/proresenc_kostya: set initial max_slice_size based on frame_size_upper_bound

If the initial max_slice_size is 0 then reallocation is disabled for the first
slice.

Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-18 20:42:27 +02:00
parent 1467780772
commit 76a8cb9d7b
1 changed files with 2 additions and 1 deletions

View File

@ -938,7 +938,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int sizes[4] = { 0 }; int sizes[4] = { 0 };
int slice_hdr_size = 2 + 2 * (ctx->num_planes - 1); int slice_hdr_size = 2 + 2 * (ctx->num_planes - 1);
int frame_size, picture_size, slice_size; int frame_size, picture_size, slice_size;
int pkt_size, ret, max_slice_size = 0; int pkt_size, ret;
int max_slice_size = (ctx->frame_size_upper_bound - 200) / ctx->pictures_per_frame / ctx->slices_per_picture;
uint8_t frame_flags; uint8_t frame_flags;
*avctx->coded_frame = *pic; *avctx->coded_frame = *pic;