radeon: Add cropping to encoded H.265 when padding is used
authorThong Thai <thong.thai@amd.com>
Fri, 9 Apr 2021 14:26:59 +0000 (10:26 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 12 Apr 2021 22:42:53 +0000 (22:42 +0000)
commite62c7e7c6caa6c9531afb694e7952a7fc3ac4401
tree1264e8cf5d9eb01cab599701d449474f98e76597
parent77fdabdfa55a31da915db43ff2ac44be4c3d48d5
radeon: Add cropping to encoded H.265 when padding is used

Because the VCN encoder needs the surface to be memory aligned, the
resolution of the image passed to the encoder might be larger and have
extra padding added - this change crops the resulting output to
compensate for the extra padding that might have been added.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4559
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10137>
src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
src/gallium/drivers/radeon/radeon_vcn_enc_2_0.c