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

Commit eae6ae14 authored by Caio Schnepper's avatar Caio Schnepper Committed by Gerrit Code Review
Browse files

stagefright: Correct Exynos4 stride alignment

For the OMX_COLOR_FormatYUV420Planar color format case, Google's VP9
codec is used, in that case the colors were shifting 16 bytes per
horizontal line, causing green lines to appear on video playback.

Change-Id: I4cf0fd40b79e53882d99f1c3f263c8a98fff1f30
parent 555aa158
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -225,10 +225,19 @@ void SoftwareRenderer::render(

        uint8_t *dst_y = (uint8_t *)dst;
        size_t dst_y_size = buf->stride * buf->height;

#ifdef EXYNOS4_ENHANCEMENTS
        size_t dst_c_stride = buf->stride / 2;
        size_t dst_c_size = dst_c_stride * buf->height / 2;
        size_t dst_c_size_aligned = ALIGN(buf->stride / 2, 16) * buf->height / 2;
        uint8_t *dst_v = dst_y + dst_y_size;
        uint8_t *dst_u = dst_v + dst_c_size_aligned;
#else
        size_t dst_c_stride = ALIGN(buf->stride / 2, 16);
        size_t dst_c_size = dst_c_stride * buf->height / 2;
        uint8_t *dst_v = dst_y + dst_y_size;
        uint8_t *dst_u = dst_v + dst_c_size;
#endif

        for (int y = 0; y < mCropHeight; ++y) {
            memcpy(dst_y, src_y, mCropWidth);