summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoyuan Zhang <boyuan.zhang@amd.com>2019-06-17 15:02:32 -0400
committerJuan A. Suarez Romero <jasuarez@igalia.com>2019-07-29 10:51:48 +0000
commitb521c3c0c8a2fdb56f8e8c55e0567f1050cc9c10 (patch)
treecb469d3fe14d3a50a02cd0e938bfaca540798ca8
parent5c7cffe1d418f004b0c3b0d0227d149490df7fb4 (diff)
radeon/vcn: enable rate control for hevc encoding
Set cu_qp_delta_enable_flag on when rate control is enabled, and set it off when rate control is disabled (e.g. constant qp). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110673 Cc: mesa-stable@lists.freedesktop.org V2: fix typo and add bugzilla info Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com> Acked-by: Leo Liu <leo.liu@amd.com> (cherry picked from commit b0626c1f306b8f55911d8926f85dc13c6a327a2f)
-rw-r--r--src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
index 3302ed7524b..fdf0e3ac06c 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
@@ -687,7 +687,13 @@ static void radeon_enc_nalu_pps_hevc(struct radeon_encoder *enc)
radeon_enc_code_se(enc, 0x0);
radeon_enc_code_fixed_bits(enc, enc->enc_pic.hevc_spec_misc.constrained_intra_pred_flag, 1);
radeon_enc_code_fixed_bits(enc, 0x0, 1);
- radeon_enc_code_fixed_bits(enc, 0x0, 1);
+ if (enc->enc_pic.rc_session_init.rate_control_method ==
+ RENCODE_RATE_CONTROL_METHOD_NONE)
+ radeon_enc_code_fixed_bits(enc, 0x0, 1);
+ else {
+ radeon_enc_code_fixed_bits(enc, 0x1, 1);
+ radeon_enc_code_ue(enc, 0x0);
+ }
radeon_enc_code_se(enc, enc->enc_pic.hevc_deblock.cb_qp_offset);
radeon_enc_code_se(enc, enc->enc_pic.hevc_deblock.cr_qp_offset);
radeon_enc_code_fixed_bits(enc, 0x0, 1);