summaryrefslogtreecommitdiffstats
path: root/remoting/base
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-06 22:11:00 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-06 22:11:00 +0000
commite723bec4ffb1db215dc55882f18c9e4bb4deba16 (patch)
tree838295b98f430681551e9ccd2d6e10fd554253d1 /remoting/base
parente9cd4f0316b92e8c2b9277ae5d2ce3f42836720a (diff)
downloadchromium_src-e723bec4ffb1db215dc55882f18c9e4bb4deba16.zip
chromium_src-e723bec4ffb1db215dc55882f18c9e4bb4deba16.tar.gz
chromium_src-e723bec4ffb1db215dc55882f18c9e4bb4deba16.tar.bz2
Fix RGB->YUV conversion: input is BGR instead of RGB.
TEST=Colors are not screwed up BUG=None Review URL: http://codereview.chromium.org/5510003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base')
-rw-r--r--remoting/base/encoder_vp8.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/remoting/base/encoder_vp8.cc b/remoting/base/encoder_vp8.cc
index dd85fb2..61883e2 100644
--- a/remoting/base/encoder_vp8.cc
+++ b/remoting/base/encoder_vp8.cc
@@ -126,13 +126,13 @@ bool EncoderVp8::PrepareImage(scoped_refptr<CaptureData> capture_data) {
for (int j = 0; j < capture_data->width(); ++j) {
// Since the input pixel format is RGB32, there are 4 bytes per pixel.
uint8* pixel = in + 4 * j;
- y_out[j] = clip_byte(((pixel[0] * 66 + pixel[1] * 129 +
- pixel[2] * 25 + 128) >> 8) + 16);
+ y_out[j] = clip_byte(((pixel[2] * 66 + pixel[1] * 129 +
+ pixel[0] * 25 + 128) >> 8) + 16);
if (i % 2 == 0 && j % 2 == 0) {
- u_out[j / 2] = clip_byte(((pixel[0] * -38 + pixel[1] * -74 +
- pixel[2] * 112 + 128) >> 8) + 128);
- v_out[j / 2] = clip_byte(((pixel[0] * 112 + pixel[1] * -94 +
- pixel[2] * -18 + 128) >> 8) + 128);
+ u_out[j / 2] = clip_byte(((pixel[2] * -38 + pixel[1] * -74 +
+ pixel[0] * 112 + 128) >> 8) + 128);
+ v_out[j / 2] = clip_byte(((pixel[2] * 112 + pixel[1] * -94 +
+ pixel[1] * -18 + 128) >> 8) + 128);
}
}
in += in_stride;