aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsuresh guttula <[email protected]>2019-04-11 10:19:33 +0530
committerLeo Liu <[email protected]>2019-04-16 10:15:09 -0400
commit05cc018ae6f91ccdb96bc0badcbb25124ee2275e (patch)
tree7700dcc4db5a9b9f2cc43135db42980783bc73c9
parent8becf5b46d3a97bafcc6df602d3a17069967ae9d (diff)
radeon/vce:Add support for frame_cropping_flag of VAEncSequenceParameterBufferH264
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. v2: Moving default crop setting to else when enc_frame_cropping_flag is not set. Signed-off-by: Satyajit Sahu <[email protected]> Reviewed-by: Leo Liu <[email protected]>
-rw-r--r--src/gallium/drivers/radeon/radeon_vce_52.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vce_52.c b/src/gallium/drivers/radeon/radeon_vce_52.c
index fc7ddc62a90..364da4dbe24 100644
--- a/src/gallium/drivers/radeon/radeon_vce_52.c
+++ b/src/gallium/drivers/radeon/radeon_vce_52.c
@@ -81,8 +81,15 @@ static void get_pic_control_param(struct rvce_encoder *enc, struct pipe_h264_enc
unsigned encNumMBsPerSlice;
encNumMBsPerSlice = align(enc->base.width, 16) / 16;
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;
+ 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;
+ } else {
+ 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;
+ }
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);