[Mesa-dev] [PATCH] radeon: Fix width align for hevc encode

Lei Zhou zhoulei at kylinos.cn
Mon Apr 15 06:23:36 UTC 2019


Before, width is aligned to 16, we get 512x800 when encoding
with 480x800, and conformance_window_flag=0 in sps.

Signed-off-by: Lei Zhou <zhoulei at kylinos.cn>
---
 src/gallium/drivers/radeon/radeon_uvd_enc.c | 2 +-
 src/gallium/drivers/radeon/radeon_vcn_enc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeon/radeon_uvd_enc.c b/src/gallium/drivers/radeon/radeon_uvd_enc.c
index 3164dbb2c20..f0bf756ec50 100644
--- a/src/gallium/drivers/radeon/radeon_uvd_enc.c
+++ b/src/gallium/drivers/radeon/radeon_uvd_enc.c
@@ -66,7 +66,7 @@ radeon_uvd_enc_get_param(struct radeon_uvd_encoder *enc,
       || (pic->picture_type == PIPE_H265_ENC_PICTURE_TYPE_I);
    enc->enc_pic.crop_left = 0;
    enc->enc_pic.crop_right =
-      (align(enc->base.width, 16) - enc->base.width) / 2;
+      (align(enc->base.width, 64) - enc->base.width) / 2;
    enc->enc_pic.crop_top = 0;
    enc->enc_pic.crop_bottom =
       (align(enc->base.height, 16) - enc->base.height) / 2;
diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c
index 7d64a28a405..248f4c7d99e 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
@@ -66,7 +66,7 @@ static void radeon_vcn_enc_get_param(struct radeon_encoder *enc, struct pipe_pic
       enc->enc_pic.is_idr = (pic->picture_type == PIPE_H265_ENC_PICTURE_TYPE_IDR) ||
                             (pic->picture_type == PIPE_H265_ENC_PICTURE_TYPE_I);
       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 = (align(enc->base.width, 64) - 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.general_tier_flag = pic->seq.general_tier_flag;
-- 
2.21.0





More information about the mesa-dev mailing list