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

Commit ff206d6d authored by Alec Mouri's avatar Alec Mouri
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
Change-Id: I4c24aae97ef052f6385281dd6e73f748d880decb
parent 02705d68
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;