mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
radeonsi/vcn: Use temporal_layer_index to select temporal layer
Don't change enc_pic.temporal_id as that is used in AV1 encode.
Fixes: 8d44a11508 ("radeonsi/vcn: Don't reinitialize encode session on bitrate/fps change")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27558>
This commit is contained in:
parent
8c9445896f
commit
252ba4bbdd
3 changed files with 4 additions and 7 deletions
|
|
@ -238,7 +238,6 @@ static void radeon_vcn_enc_h264_get_rc_param(struct radeon_encoder *enc,
|
|||
uint32_t frame_rate_den, frame_rate_num;
|
||||
|
||||
enc->enc_pic.num_temporal_layers = pic->seq.num_temporal_layers ? pic->seq.num_temporal_layers : 1;
|
||||
enc->enc_pic.temporal_id = 0;
|
||||
for (int i = 0; i < enc->enc_pic.num_temporal_layers; i++) {
|
||||
enc->enc_pic.rc_layer_init[i].target_bit_rate = pic->rate_ctrl[i].target_bitrate;
|
||||
enc->enc_pic.rc_layer_init[i].peak_bit_rate = pic->rate_ctrl[i].peak_bitrate;
|
||||
|
|
|
|||
|
|
@ -114,8 +114,6 @@ static void radeon_enc_layer_control(struct radeon_encoder *enc)
|
|||
|
||||
static void radeon_enc_layer_select(struct radeon_encoder *enc)
|
||||
{
|
||||
enc->enc_pic.layer_sel.temporal_layer_index = enc->enc_pic.temporal_id;
|
||||
|
||||
RADEON_ENC_BEGIN(enc->cmd.layer_select);
|
||||
RADEON_ENC_CS(enc->enc_pic.layer_sel.temporal_layer_index);
|
||||
RADEON_ENC_END();
|
||||
|
|
@ -183,7 +181,7 @@ static void radeon_enc_rc_session_init(struct radeon_encoder *enc)
|
|||
|
||||
static void radeon_enc_rc_layer_init(struct radeon_encoder *enc)
|
||||
{
|
||||
unsigned int i = enc->enc_pic.temporal_id;
|
||||
unsigned int i = enc->enc_pic.layer_sel.temporal_layer_index;
|
||||
RADEON_ENC_BEGIN(enc->cmd.rc_layer_init);
|
||||
RADEON_ENC_CS(enc->enc_pic.rc_layer_init[i].target_bit_rate);
|
||||
RADEON_ENC_CS(enc->enc_pic.rc_layer_init[i].peak_bit_rate);
|
||||
|
|
@ -1350,7 +1348,7 @@ static void begin(struct radeon_encoder *enc)
|
|||
|
||||
i = 0;
|
||||
do {
|
||||
enc->enc_pic.temporal_id = i;
|
||||
enc->enc_pic.layer_sel.temporal_layer_index = i;
|
||||
enc->layer_select(enc);
|
||||
enc->rc_layer_init(enc);
|
||||
enc->layer_select(enc);
|
||||
|
|
@ -1402,7 +1400,7 @@ static void encode(struct radeon_encoder *enc)
|
|||
if (enc->need_rate_control) {
|
||||
i = 0;
|
||||
do {
|
||||
enc->enc_pic.temporal_id = i;
|
||||
enc->enc_pic.layer_sel.temporal_layer_index = i;
|
||||
enc->layer_select(enc);
|
||||
enc->rc_layer_init(enc);
|
||||
} while (++i < enc->enc_pic.num_temporal_layers);
|
||||
|
|
|
|||
|
|
@ -515,7 +515,7 @@ static void encode(struct radeon_encoder *enc)
|
|||
if (enc->need_rate_control) {
|
||||
i = 0;
|
||||
do {
|
||||
enc->enc_pic.temporal_id = i;
|
||||
enc->enc_pic.layer_sel.temporal_layer_index = i;
|
||||
enc->layer_select(enc);
|
||||
enc->rc_layer_init(enc);
|
||||
} while (++i < enc->enc_pic.num_temporal_layers);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue