You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/libsvtav1: signal CPB properties through side data
This way values such as maxrate/bufsize can be utilized further down the chain. First, syncs up the max_rate and buffer_size from SVT-AV1 back to avctx, and then in case at least one of the utilized values is nonzero, adds the CPB properties side data.
This commit is contained in:
@@ -297,8 +297,20 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
|
|||||||
param->profile = FF_PROFILE_AV1_HIGH;
|
param->profile = FF_PROFILE_AV1_HIGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
avctx->bit_rate = param->rate_control_mode > 0 ?
|
avctx->bit_rate = param->rate_control_mode > 0 ?
|
||||||
param->target_bit_rate : 0;
|
param->target_bit_rate : 0;
|
||||||
|
avctx->rc_max_rate = param->max_bit_rate;
|
||||||
|
avctx->rc_buffer_size = param->vbv_bufsize;
|
||||||
|
|
||||||
|
if (avctx->bit_rate || avctx->rc_max_rate || avctx->rc_buffer_size) {
|
||||||
|
AVCPBProperties *cpb_props = ff_add_cpb_side_data(avctx);
|
||||||
|
if (!cpb_props)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
cpb_props->buffer_size = avctx->rc_buffer_size;
|
||||||
|
cpb_props->max_bitrate = avctx->rc_max_rate;
|
||||||
|
cpb_props->avg_bitrate = avctx->bit_rate;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user