commit | bef25703de7472a32ba1d28e44f46041e81c7298 | [log] [tgz] |
---|---|---|
author | Alec Mouri <alecmouri@google.com> | Mon Jul 08 21:41:59 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Jul 24 01:38:30 2024 +0000 |
tree | d3ef8cba08828c2cd829d9735bd1f082ad28425f | |
parent | 4c39de57098cb8e6c2f94488b40072520b561379 [diff] [blame] |
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 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ff206d6d5d9150bbfeac0dfbe92825d97a7de5b2) Merged-In: I4c24aae97ef052f6385281dd6e73f748d880decb Change-Id: I4c24aae97ef052f6385281dd6e73f748d880decb
diff --git a/libs/nativewindow/AHardwareBuffer.cpp b/libs/nativewindow/AHardwareBuffer.cpp index 5261287..dd78049 100644 --- a/libs/nativewindow/AHardwareBuffer.cpp +++ b/libs/nativewindow/AHardwareBuffer.cpp
@@ -300,7 +300,9 @@ 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;