From 20a21b993ee7b061868e10a153e9118db094c98e Mon Sep 17 00:00:00 2001 From: wenchangliu Date: Fri, 24 Sep 2021 16:05:59 +0800 Subject: Add missing 16 alignment constraint of chroma stride for YV12 Exynos encoder need 16 stride alignment for both luma and chroma in YV12. Add 32 stride alignment for luma to ensure we meet the requirement. This change will not impact the decoding case since we use 64 stride alignment by default. Bug: 201012738 Test: run vts -m VtsHalMediaC2V1_0TargetVideoEncTest Change-Id: I7086366bfaf4f589e878c732b30b615034ccfa20 (cherry picked from commit a48bf1aa7ec589878545d291b2b44110b54076db) --- gralloc4/src/core/mali_gralloc_bufferallocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp index fe2349b..e928637 100644 --- a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp +++ b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp @@ -446,7 +446,7 @@ static void update_yv12_stride(int8_t plane, { if (plane == 0) { - *byte_stride = GRALLOC_ALIGN(luma_stride, stride_align); + *byte_stride = GRALLOC_ALIGN(luma_stride, GRALLOC_ALIGN(stride_align, 32)); } else { @@ -456,7 +456,7 @@ static void update_yv12_stride(int8_t plane, * 2. Multiple of 16px (16 bytes) */ *byte_stride = luma_stride / 2; - assert(*byte_stride == GRALLOC_ALIGN(*byte_stride, stride_align / 2)); + assert(*byte_stride == GRALLOC_ALIGN(*byte_stride, GRALLOC_ALIGN(stride_align / 2, 16))); assert(*byte_stride & 15 == 0); } } -- cgit v1.2.3