diff --git a/android/opengl/system/OpenglSystemCommon/FormatConversions.cpp b/android/opengl/system/OpenglSystemCommon/FormatConversions.cpp index 6473b48dbf1e280a3c0aea3f9778dae7b4edc3a5..da8dfa26ca13966ba04ad9c9fee07a2150eeec25 100644 --- a/android/opengl/system/OpenglSystemCommon/FormatConversions.cpp +++ b/android/opengl/system/OpenglSystemCommon/FormatConversions.cpp @@ -96,8 +96,8 @@ void rgb565_to_yv12(char *dest, char *src, int width, int height, int left, int yv12_y[i] = clamp_rgb((77 * R + 150 * G + 29 * B) >> 8); bool ieven = (i & 1) == 0; if (jeven && ieven) { - yv12_u[i] = clamp_rgb(((-43 * R - 85 * G + 128 * B) >> 8) + 128); - yv12_v[i] = clamp_rgb(((128 * R - 107 * G - 21 * B) >> 8) + 128); + yv12_u[i/2] = clamp_rgb(((-43 * R - 85 * G + 128 * B) >> 8) + 128); + yv12_v[i/2] = clamp_rgb(((128 * R - 107 * G - 21 * B) >> 8) + 128); } } } @@ -132,8 +132,8 @@ void rgb888_to_yv12(char *dest, char *src, int width, int height, int left, int yv12_y[i] = clamp_rgb((77 * R + 150 * G + 29 * B) >> 8); bool ieven = (i & 1) == 0; if (jeven && ieven) { - yv12_u[i] = clamp_rgb(((-43 * R - 85 * G + 128 * B) >> 8) + 128); - yv12_v[i] = clamp_rgb(((128 * R - 107 * G - 21 * B) >> 8) + 128); + yv12_u[i/2] = clamp_rgb(((-43 * R - 85 * G + 128 * B) >> 8) + 128); + yv12_v[i/2] = clamp_rgb(((128 * R - 107 * G - 21 * B) >> 8) + 128); } } }