summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwenchangliu <wenchangliu@google.com>2021-09-24 16:05:59 +0800
committerwenchangliu <wenchangliu@google.com>2021-09-24 18:20:51 +0800
commita48bf1aa7ec589878545d291b2b44110b54076db (patch)
treea37135091395f228de4e87d59be80f76b092974e
parent313da845beaba91bee8793308923ab05dcbc60f7 (diff)
downloadgchips-a48bf1aa7ec589878545d291b2b44110b54076db.tar.gz
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
-rw-r--r--gralloc4/src/core/mali_gralloc_bufferallocation.cpp4
1 files 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);
}
}