diff options
author | Paul B Mahol <onemda@gmail.com> | 2017-04-14 16:09:07 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2017-04-14 16:09:07 +0200 |
commit | 5dedb2afd64e27ad08308487e185f7e3a5bea1b9 (patch) | |
tree | f434c549995c0bd63aa7e0e401df4f13168114c9 /libavcodec/dnxhdenc.c | |
parent | 34c2eea3d8ec85de4f4e5a9085c174e4b09387b9 (diff) | |
download | ffmpeg-5dedb2afd64e27ad08308487e185f7e3a5bea1b9.tar.gz |
avcodec/dnxhd*: add ff_dnxhd_get_hr_frame_size()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r-- | libavcodec/dnxhdenc.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 35fa77794a..1c270a4ad7 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -362,13 +362,6 @@ fail: return AVERROR(ENOMEM); } -static int dnxhd_get_hr_frame_size(const CIDEntry* profile, int mb_num) -{ - int result = mb_num * profile->packet_scale.num / profile->packet_scale.den; - result = (result + 2048) / 4096 * 4096; - return FFMAX(result, 8192); -} - static av_cold int dnxhd_encode_init(AVCodecContext *avctx) { DNXHDEncContext *ctx = avctx->priv_data; @@ -483,8 +476,8 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) ctx->m.mb_num = ctx->m.mb_height * ctx->m.mb_width; if (ctx->cid_table->frame_size == DNXHD_VARIABLE) { - ctx->frame_size = dnxhd_get_hr_frame_size(ctx->cid_table, - ctx->m.mb_num); + ctx->frame_size = ff_dnxhd_get_hr_frame_size(ctx->cid, + ctx->m.mb_width, ctx->m.mb_height); ctx->coding_unit_size = ctx->frame_size; } else { ctx->frame_size = ctx->cid_table->frame_size; |