Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bef25703 authored by Alec Mouri's avatar Alec Mouri Committed by Android Build Coastguard Worker
Browse files

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
parent 4c39de57
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;