[Cin] Anyone with h264-enc capable Radeon?

Andrew Randrianasulu randrianasulu at gmail.com
Fri Oct 2 13:54:47 CEST 2020


Hi all!

I was looking into https://gitlab.freedesktop.org/mesa/mesa/-/issues/3540 and found something interesting.

Apparently, current driver hardcodes quality profile to SPEED, but those who interested in quality encoding might wat to play with other modes?


https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c

static void radeon_enc_op_speed(struct radeon_encoder *enc)
{
   RADEON_ENC_BEGIN(RENCODE_IB_OP_SET_SPEED_ENCODING_MODE);
   RADEON_ENC_END();
}

defined in https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/radeon/radeon_vcn_enc.h

#define RENCODE_IB_OP_SET_SPEED_ENCODING_MODE                                       0x01000006
#define RENCODE_IB_OP_SET_BALANCE_ENCODING_MODE                                     0x01000007
#define RENCODE_IB_OP_SET_QUALITY_ENCODING_MODE                                     0x01000008

I wonder what results will be if you change such setting?

May be something like Nouveau's use of env. variables can be copied if there is no way to express this via va-api ?

https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/nouveau_video.c


 if (getenv("XVMC_VL")) 

just in our case it will be like, RADEON_ENC_QUALITY?

also, there are other interesting parameters related to quality. Might be worth experimenting with.

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;

   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_END();
}



More information about the Cin mailing list