From 19983d3d4aae3f2a6415a7e8d43bbf69a34d2a0b Mon Sep 17 00:00:00 2001 From: Boyuan Zhang Date: Thu, 11 Jun 2020 19:22:51 -0400 Subject: [PATCH] radeon/vcn: bump vcn3.0 encode major version to 1 And add quality params for this version Signed-off-by: Boyuan Zhang Signed-off-by: Leo Liu Reviewed-by: Thong Thai Reviewed-by: Leo Liu Reviewed-by: James Zhu Part-of: --- .../drivers/radeon/radeon_vcn_enc_3_0.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc_3_0.c b/src/gallium/drivers/radeon/radeon_vcn_enc_3_0.c index 525eaff2122..0e381045b51 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_enc_3_0.c +++ b/src/gallium/drivers/radeon/radeon_vcn_enc_3_0.c @@ -35,7 +35,7 @@ #include "radeon_video.h" #include "radeon_vcn_enc.h" -#define RENCODE_FW_INTERFACE_MAJOR_VERSION 0 +#define RENCODE_FW_INTERFACE_MAJOR_VERSION 1 #define RENCODE_FW_INTERFACE_MINOR_VERSION 0 static void radeon_enc_spec_misc(struct radeon_encoder *enc) @@ -63,6 +63,22 @@ static void radeon_enc_spec_misc(struct radeon_encoder *enc) RADEON_ENC_END(); } +static void radeon_enc_quality_params(struct radeon_encoder *enc) +{ + enc->enc_pic.quality_params.vbaq_mode = 0; + enc->enc_pic.quality_params.scene_change_sensitivity = 0; + enc->enc_pic.quality_params.scene_change_min_idr_interval = 0; + enc->enc_pic.quality_params.two_pass_search_center_map_mode = 0; + + RADEON_ENC_BEGIN(enc->cmd.quality_params); + RADEON_ENC_CS(enc->enc_pic.quality_params.vbaq_mode); + RADEON_ENC_CS(enc->enc_pic.quality_params.scene_change_sensitivity); + RADEON_ENC_CS(enc->enc_pic.quality_params.scene_change_min_idr_interval); + RADEON_ENC_CS(enc->enc_pic.quality_params.two_pass_search_center_map_mode); + RADEON_ENC_CS(0); + RADEON_ENC_END(); +} + static void radeon_enc_encode_params_h264(struct radeon_encoder *enc) { enc->enc_pic.h264_enc_params.input_picture_structure = RENCODE_H264_PICTURE_STRUCTURE_FRAME; @@ -161,6 +177,7 @@ void radeon_enc_3_0_init(struct radeon_encoder *enc) if (u_reduce_video_profile(enc->base.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC) { enc->spec_misc = radeon_enc_spec_misc; enc->encode_params_codec_spec = radeon_enc_encode_params_h264; + enc->quality_params = radeon_enc_quality_params; } if (u_reduce_video_profile(enc->base.profile) == PIPE_VIDEO_FORMAT_HEVC) -- 2.30.2