mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
radeonsi/uvd_enc: update to use correct padding size
Update padding size calculation to use cropping.
Original method could result in 0 padding, which
generated unnessary noise in the encoding result.
Cc: mesa-stable
Fixes: mesa/mesa#9196
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28369>
(cherry picked from commit 7d00b759f3)
This commit is contained in:
parent
8b496ec0ab
commit
c4b6f6b450
3 changed files with 5 additions and 5 deletions
|
|
@ -3824,7 +3824,7 @@
|
|||
"description": "radeonsi/uvd_enc: update to use correct padding size",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -80,9 +80,9 @@ static void radeon_uvd_enc_get_param(struct radeon_uvd_encoder *enc,
|
|||
enc->enc_pic.crop_bottom = pic->seq.conf_win_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_right = 0;
|
||||
enc->enc_pic.crop_top = 0;
|
||||
enc->enc_pic.crop_bottom = (align(enc->base.height, 16) - enc->base.height) / 2;
|
||||
enc->enc_pic.crop_bottom = 0;
|
||||
}
|
||||
|
||||
enc->enc_pic.general_tier_flag = pic->seq.general_tier_flag;
|
||||
|
|
|
|||
|
|
@ -203,9 +203,9 @@ static void radeon_uvd_enc_session_init_hevc(struct radeon_uvd_encoder *enc)
|
|||
enc->enc_pic.session_init.aligned_picture_width = align(enc->base.width, 64);
|
||||
enc->enc_pic.session_init.aligned_picture_height = align(enc->base.height, 16);
|
||||
enc->enc_pic.session_init.padding_width =
|
||||
enc->enc_pic.session_init.aligned_picture_width - enc->base.width;
|
||||
(enc->enc_pic.crop_left + enc->enc_pic.crop_right) * 2;
|
||||
enc->enc_pic.session_init.padding_height =
|
||||
enc->enc_pic.session_init.aligned_picture_height - enc->base.height;
|
||||
(enc->enc_pic.crop_top + enc->enc_pic.crop_bottom) * 2;
|
||||
enc->enc_pic.session_init.pre_encode_mode = RENC_UVD_PREENCODE_MODE_NONE;
|
||||
enc->enc_pic.session_init.pre_encode_chroma_enabled = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue