[Mesa-dev] [PATCH 2/3] radeon/vce:Add support for frame_cropping_flag of VAEncSequenceParameterBufferH264

Liu, Leo Leo.Liu at amd.com
Thu Apr 11 19:18:06 UTC 2019


On 2019-04-11 6:36 a.m., Sahu, Satyajit wrote:
> From: suresh guttula <suresh.guttula at amd.com>
>
> This patch will add support for frame_cropping when the input size is not
> matched with aligned size. Currently vaapi driver ignores frame cropping
> values provided by client. This change will update SPS nalu with proper
> cropping values.
>
> Signed-off-by: Satyajit Sahu <satyajit.sahu at amd.com>
> ---
>   src/gallium/drivers/radeon/radeon_vce_52.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/src/gallium/drivers/radeon/radeon_vce_52.c b/src/gallium/drivers/radeon/radeon_vce_52.c
> index fc7ddc62a90..53f7b2f5fb5 100644
> --- a/src/gallium/drivers/radeon/radeon_vce_52.c
> +++ b/src/gallium/drivers/radeon/radeon_vce_52.c
> @@ -83,6 +83,12 @@ static void get_pic_control_param(struct rvce_encoder *enc, struct pipe_h264_enc
>   	encNumMBsPerSlice *= align(enc->base.height, 16) / 16;
>   	enc->enc_pic.pc.enc_crop_right_offset = (align(enc->base.width, 16) - enc->base.width) >> 1;
>   	enc->enc_pic.pc.enc_crop_bottom_offset = (align(enc->base.height, 16) - enc->base.height) >> 1;

Please put above 2 lines to the else case of frame_cropping_flag.

With that fixed, the series are

Reviewed-by: Leo Liu <leo.liu at amd.com>


> +	if (pic->pic_ctrl.enc_frame_cropping_flag) {
> +		enc->enc_pic.pc.enc_crop_left_offset = pic->pic_ctrl.enc_frame_crop_left_offset;
> +		enc->enc_pic.pc.enc_crop_right_offset = pic->pic_ctrl.enc_frame_crop_right_offset;
> +		enc->enc_pic.pc.enc_crop_top_offset = pic->pic_ctrl.enc_frame_crop_top_offset;
> +		enc->enc_pic.pc.enc_crop_bottom_offset = pic->pic_ctrl.enc_frame_crop_bottom_offset;
> +	}
>   	enc->enc_pic.pc.enc_num_mbs_per_slice = encNumMBsPerSlice;
>   	enc->enc_pic.pc.enc_b_pic_pattern = MAX2(enc->base.max_references, 1) - 1;
>   	enc->enc_pic.pc.enc_number_of_reference_frames = MIN2(enc->base.max_references, 2);


More information about the mesa-dev mailing list