diff options
author | 2024-07-08 21:41:59 +0000 | |
---|---|---|
committer | 2024-07-09 17:45:30 +0000 | |
commit | ff206d6d5d9150bbfeac0dfbe92825d97a7de5b2 (patch) | |
tree | 8beb4e1cb2ded2f6a40fb4b857145e2429932d26 | |
parent | 02705d68a8ceae0ee21ab6629eb154ce6f7aa95f (diff) |
Use pixel stride of 2 for Y422_I's Y plane
Y422_I's layout is: Y0 Cr0 Y1 Cb0 ...
...which means that successive luminance samples are separated by 2
bytes, not 1.
Bug: 351311764
Test: builds
Flag: EXEMPT bugfix
Change-Id: I4c24aae97ef052f6385281dd6e73f748d880decb
-rw-r--r-- | libs/nativewindow/AHardwareBuffer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/nativewindow/AHardwareBuffer.cpp b/libs/nativewindow/AHardwareBuffer.cpp index 52612870ab..dd78049b16 100644 --- a/libs/nativewindow/AHardwareBuffer.cpp +++ b/libs/nativewindow/AHardwareBuffer.cpp @@ -300,7 +300,9 @@ int AHardwareBuffer_lockPlanes(AHardwareBuffer* buffer, uint64_t usage, if (result == 0) { outPlanes->planeCount = 3; outPlanes->planes[0].data = yuvData.y; - if (format == AHARDWAREBUFFER_FORMAT_YCbCr_P010) { + // P010 is word-aligned 10-bit semiplaner, and YCbCr_422_I is a single interleaved plane + if (format == AHARDWAREBUFFER_FORMAT_YCbCr_P010 || + format == AHARDWAREBUFFER_FORMAT_YCbCr_422_I) { outPlanes->planes[0].pixelStride = 2; } else { outPlanes->planes[0].pixelStride = 1; |