Mesa (master): gallium/auxiliary/vl: Odd Dimensions are failing

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 21 16:05:43 UTC 2020


Module: Mesa
Branch: master
Commit: d78e7b7aee8c2da6235820bd4790c5ddbf39febd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d78e7b7aee8c2da6235820bd4790c5ddbf39febd

Author: Krunal Patel <krunalkumarmukeshkumar.patel at amd.corp-partner.google.com>
Date:   Mon Sep 21 03:07:20 2020 +0530

gallium/auxiliary/vl: Odd Dimensions are failing

Issue: While running the tast for odd resolutions there are green lines
observed in the dumped image. The resolution is 321x241, the extra 1 pixel
data is missing in the image. The reason for this is in the post
processing when we adjust the size of height and width we are
dividing it by 2.

Fix: To resolve this issue we first need to align it to 2 and then divide
by 2 to get the required values. Once we do this we will have proper data
in the dumped image and missing pixel data will be available.

Signed-off-by: Krunal Patel <krunalkumarmukeshkumar.patel at amd.corp-partner.google.com>
Reviewed-by: Leo Liu <leo.liu at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6795>

---

 src/gallium/auxiliary/vl/vl_video_buffer.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.h b/src/gallium/auxiliary/vl/vl_video_buffer.h
index ee8b5f14698..fe92d4cfcfa 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.h
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.h
@@ -54,14 +54,14 @@ vl_video_buffer_adjust_size(unsigned *width, unsigned *height, unsigned plane,
                             bool interlaced)
 {
    if (interlaced) {
-      *height /= 2;
+      *height = align(*height, 2) / 2;
    }
    if (plane > 0) {
       if (chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420) {
-         *width /= 2;
-         *height /= 2;
+         *width = align(*width, 2) / 2;
+         *height = align(*height, 2) / 2;
       } else if (chroma_format == PIPE_VIDEO_CHROMA_FORMAT_422) {
-         *width /= 2;
+         *width = align(*width, 2) / 2;
       }
    }
 }



More information about the mesa-commit mailing list