[Mesa-dev] [PATCH] radeon/vcn: Handle crop parameters for encoder

Sahu, Satyajit satyajit.sahu at amd.com
Fri Jan 3 09:06:02 UTC 2020


I do not find new merge request option in the merge request page. Do I 
need to have some specific access to create new merge request.


On 1/3/2020 2:05 AM, Liu, Leo wrote:
> The mesa process has switched to using merge requests.
>
> -----Original Message-----
> From: mesa-dev <mesa-dev-bounces at lists.freedesktop.org> On Behalf Of Satyajit Sahu
> Sent: Tuesday, December 24, 2019 4:39 AM
> To: mesa-dev at lists.freedesktop.org
> Cc: Sharma, Deepak <Deepak.Sharma at amd.com>; Sahu, Satyajit <Satyajit.Sahu at amd.com>
> Subject: [Mesa-dev] [PATCH] radeon/vcn: Handle crop parameters for encoder
>
> Set proper cropping parameter if frame cropping is enabled
>
> Signed-off-by: Satyajit Sahu <satyajit.sahu at amd.com>
>
> diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c
> index aa9182f273b..0bcce867327 100644
> --- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
> +++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
> @@ -52,10 +52,17 @@ static void radeon_vcn_enc_get_param(struct radeon_encoder *enc, struct pipe_pic
>         enc->enc_pic.ref_idx_l1 = pic->ref_idx_l1;
>         enc->enc_pic.not_referenced = pic->not_referenced;
>         enc->enc_pic.is_idr = (pic->picture_type == PIPE_H264_ENC_PICTURE_TYPE_IDR);
> -      enc->enc_pic.crop_left = 0;
> -      enc->enc_pic.crop_right = (align(enc->base.width, 16) - enc->base.width) / 2;
> -      enc->enc_pic.crop_top = 0;
> -      enc->enc_pic.crop_bottom = (align(enc->base.height, 16) - enc->base.height) / 2;
> +      if (pic->pic_ctrl.enc_frame_cropping_flag) {
> +          enc->enc_pic.crop_left = pic->pic_ctrl.enc_frame_crop_left_offset;
> +          enc->enc_pic.crop_right = pic->pic_ctrl.enc_frame_crop_right_offset;
> +          enc->enc_pic.crop_top = pic->pic_ctrl.enc_frame_crop_top_offset;
> +          enc->enc_pic.crop_bottom = pic->pic_ctrl.enc_frame_crop_bottom_offset;
> +      } else {
> +          enc->enc_pic.crop_left = 0;
> +          enc->enc_pic.crop_right = (align(enc->base.width, 16) - enc->base.width) / 2;
> +          enc->enc_pic.crop_top = 0;
> +          enc->enc_pic.crop_bottom = (align(enc->base.height, 16) - enc->base.height) / 2;
> +      }
>         enc->enc_pic.rc_layer_init.target_bit_rate = pic->rate_ctrl.target_bitrate;
>         enc->enc_pic.rc_layer_init.peak_bit_rate = pic->rate_ctrl.peak_bitrate;
>         enc->enc_pic.rc_layer_init.frame_rate_num = pic->rate_ctrl.frame_rate_num;


More information about the mesa-dev mailing list