You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/libaomenc: Increase code locality
Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -681,7 +681,6 @@ static av_cold int aom_init(AVCodecContext *avctx,
|
||||
struct aom_codec_enc_cfg enccfg = { 0 };
|
||||
aom_codec_flags_t flags =
|
||||
(avctx->flags & AV_CODEC_FLAG_PSNR) ? AOM_CODEC_USE_PSNR : 0;
|
||||
AVCPBProperties *cpb_props;
|
||||
int res;
|
||||
aom_img_fmt_t img_fmt;
|
||||
aom_codec_caps_t codec_caps = aom_codec_get_caps(iface);
|
||||
@ -989,10 +988,6 @@ static av_cold int aom_init(AVCodecContext *avctx,
|
||||
if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH)
|
||||
ctx->rawimg.bit_depth = enccfg.g_bit_depth;
|
||||
|
||||
cpb_props = ff_encode_add_cpb_side_data(avctx);
|
||||
if (!cpb_props)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
ctx->dovi.logctx = avctx;
|
||||
if ((res = ff_dovi_configure(&ctx->dovi, avctx)) < 0)
|
||||
return res;
|
||||
@ -1019,6 +1014,10 @@ static av_cold int aom_init(AVCodecContext *avctx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
AVCPBProperties *cpb_props = ff_encode_add_cpb_side_data(avctx);
|
||||
if (!cpb_props)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
if (enccfg.rc_end_usage == AOM_CBR ||
|
||||
enccfg.g_pass != AOM_RC_ONE_PASS) {
|
||||
cpb_props->max_bitrate = avctx->rc_max_rate;
|
||||
|
Reference in New Issue
Block a user