Fix ConvertI420ToRGB565 bug

BUG=
TEST=test on android
Review URL: https://webrtc-codereview.appspot.com/541005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2150 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@webrtc.org 2012-04-30 17:59:08 +00:00
parent e7ac5fde72
commit 85b089a0ca

View File

@ -165,13 +165,13 @@ int ConvertI420ToRGB565(const uint8_t* src_frame,
int width, int height) { int width, int height) {
int abs_height = (height < 0) ? -height : height; int abs_height = (height < 0) ? -height : height;
const uint8_t* yplane = src_frame; const uint8_t* yplane = src_frame;
const uint8_t* uplane = src_frame + width * abs_height; const uint8_t* uplane = yplane + width * abs_height;
const uint8_t* vplane = uplane + (width * abs_height / 4); const uint8_t* vplane = uplane + (width + 1) / 2 * (abs_height + 1) / 2;
return libyuv::I420ToRGB565(yplane, width, return libyuv::I420ToRGB565(yplane, width,
uplane, width / 2, uplane, (width + 1) / 2,
vplane, width / 2, vplane, (width + 1) / 2,
dst_frame, width, dst_frame, width * 2,
width, height); width, height);
} }