Module: Mesa
Branch: main
Commit: 8dda860f83ac30d042dc6beb4438cc925d1fd130
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8dda860f83ac30d042dc6beb4438cc925d1fd130

Author: David Rosca <now...@gmail.com>
Date:   Tue Oct 31 09:14:35 2023 +0100

Revert "radeon/radeon_vce: fix out of target bitrate in CBR mode (H.264)"

This reverts commit f7e7cf637e1b457d56b3aaf4d05c928ef9acff17.

It is now possible to change the buffer size from VA frontend, so this
is no longer needed and instead it's up to applications to set
appropriate value.

Reviewed-by: Ruijing Dong <ruijing.d...@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>

---

 src/gallium/drivers/radeonsi/radeon_vce_52.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/radeon_vce_52.c 
b/src/gallium/drivers/radeonsi/radeon_vce_52.c
index c9368dffdc4..4df561521fb 100644
--- a/src/gallium/drivers/radeonsi/radeon_vce_52.c
+++ b/src/gallium/drivers/radeonsi/radeon_vce_52.c
@@ -28,17 +28,7 @@ static void get_rate_control_param(struct rvce_encoder *enc, 
struct pipe_h264_en
    enc->enc_pic.rc.frame_rate_num = pic->rate_ctrl[0].frame_rate_num;
    enc->enc_pic.rc.frame_rate_den = pic->rate_ctrl[0].frame_rate_den;
    enc->enc_pic.rc.max_qp = 51;
-
-   /* For CBR mode, to guarantee bitrate of generated stream complies with
-    * target bitrate (e.g. no over +/-10%), vbv_buffer_size should be same
-    * as target bitrate.
-    */
-   if (enc->enc_pic.rc.rc_method == 
PIPE_H2645_ENC_RATE_CONTROL_METHOD_CONSTANT) {
-           enc->enc_pic.rc.vbv_buffer_size = pic->rate_ctrl[0].target_bitrate;
-   } else {
-           enc->enc_pic.rc.vbv_buffer_size = pic->rate_ctrl[0].vbv_buffer_size;
-   }
-
+   enc->enc_pic.rc.vbv_buffer_size = pic->rate_ctrl[0].vbv_buffer_size;
    enc->enc_pic.rc.vbv_buf_lv = pic->rate_ctrl[0].vbv_buf_lv;
    enc->enc_pic.rc.fill_data_enable = pic->rate_ctrl[0].fill_data_enable;
    enc->enc_pic.rc.enforce_hrd = pic->rate_ctrl[0].enforce_hrd;

Reply via email to