diff options
author | 2010-02-18 13:58:24 -0800 | |
---|---|---|
committer | 2010-02-18 14:02:56 -0800 | |
commit | d7381a199bb4641cdcaf28ae6cadbf2513b14fae (patch) | |
tree | 50e67abae6e4e2fe561f116adfd2428d8e259e95 | |
parent | 6f760ee1c232b39a5593dd0a53f0788c6700ee68 (diff) |
Fix the rgb to yuv422sp conversion. The order of uv is different from the
original version, but it should be ok as the original Y,Cb,Cr are all incorrect.
-rw-r--r-- | camera/libcameraservice/FakeCamera.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/camera/libcameraservice/FakeCamera.cpp b/camera/libcameraservice/FakeCamera.cpp index 3daf47dbadeb..674989982728 100644 --- a/camera/libcameraservice/FakeCamera.cpp +++ b/camera/libcameraservice/FakeCamera.cpp @@ -234,7 +234,7 @@ uint32_t temp; uint8_t y0, y1, u, v; pixels = inputRGB[i]; - temp = (ALPHA*(pixels & 0x001F) + BETA*(pixels>>11) ); + temp = (BETA*(pixels & 0x001F) + ALPHA*(pixels>>11) ); y0 = y_tab[(temp>>SHIFT1) + ((pixels>>3) & 0x00FC)]; G_ds += (pixels>>1) & 0x03E0; @@ -242,7 +242,7 @@ uint32_t temp; R_ds += (pixels>>6) & 0x03E0; pixels = inputRGB[i+1]; - temp = (ALPHA*(pixels & 0x001F) + BETA*(pixels>>11) ); + temp = (BETA*(pixels & 0x001F) + ALPHA*(pixels>>11) ); y1 = y_tab[(temp>>SHIFT1) + ((pixels>>3) & 0x00FC)]; G_ds += (pixels>>1) & 0x03E0; @@ -255,8 +255,8 @@ uint32_t temp; tmp = R_ds - B_ds; - u = cb_tab[(((R_ds-G_ds)<<SHIFT2) + DELTA*tmp)>>(SHIFT2+2)]; - v = cr_tab[(((B_ds-G_ds)<<SHIFT2) - GAMMA*tmp)>>(SHIFT2+2)]; + u = cb_tab[(((B_ds-G_ds)<<SHIFT2) - GAMMA*tmp)>>(SHIFT2+2)]; + v = cr_tab[(((R_ds-G_ds)<<SHIFT2) + DELTA*tmp)>>(SHIFT2+2)]; tempY[0] = y0; tempY[1] = y1; |