summaryrefslogtreecommitdiffstats
path: root/remoting/base
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-02 00:20:19 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-02 00:20:19 +0000
commitbdde9f26ec7c21e7d1d5d8f56c35063b6846efe6 (patch)
tree63f72a8932d27ebdd32f57926acd5404aa80d6a0 /remoting/base
parent3f9331ac5068bb0cf9df1436b74b473c31e68e15 (diff)
downloadchromium_src-bdde9f26ec7c21e7d1d5d8f56c35063b6846efe6.zip
chromium_src-bdde9f26ec7c21e7d1d5d8f56c35063b6846efe6.tar.gz
chromium_src-bdde9f26ec7c21e7d1d5d8f56c35063b6846efe6.tar.bz2
Reverse rows in VP8 decoder.
TEST=None BUG=None Review URL: http://codereview.chromium.org/5310011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base')
-rw-r--r--remoting/base/decoder_vp8.cc16
-rw-r--r--remoting/base/decoder_vp8.h3
2 files changed, 14 insertions, 5 deletions
diff --git a/remoting/base/decoder_vp8.cc b/remoting/base/decoder_vp8.cc
index 516e9f4..fc89503 100644
--- a/remoting/base/decoder_vp8.cc
+++ b/remoting/base/decoder_vp8.cc
@@ -18,7 +18,8 @@ extern "C" {
namespace remoting {
DecoderVp8::DecoderVp8()
- : state_(kUninitialized),
+ : reverse_rows_(true),
+ state_(kUninitialized),
codec_(NULL) {
}
@@ -82,11 +83,16 @@ Decoder::DecodeResult DecoderVp8::DecodePacket(const VideoPacket* packet) {
}
// Perform YUV conversion.
+ uint8* data_start = frame_->data(media::VideoFrame::kRGBPlane);
+ int stride = frame_->stride(media::VideoFrame::kRGBPlane);
+ if (reverse_rows_) {
+ data_start = data_start + (frame_->height() - 1) * stride;
+ stride = -stride;
+ }
+
media::ConvertYUVToRGB32(image->planes[0], image->planes[1], image->planes[2],
- frame_->data(media::VideoFrame::kRGBPlane),
- frame_->width(), frame_->height(),
- image->stride[0], image->stride[1],
- frame_->stride(media::VideoFrame::kRGBPlane),
+ data_start, frame_->width(), frame_->height(),
+ image->stride[0], image->stride[1], stride,
media::YV12);
return DECODE_DONE;
}
diff --git a/remoting/base/decoder_vp8.h b/remoting/base/decoder_vp8.h
index ebe082a..a59a601 100644
--- a/remoting/base/decoder_vp8.h
+++ b/remoting/base/decoder_vp8.h
@@ -31,6 +31,9 @@ class DecoderVp8 : public Decoder {
kError,
};
+ // True if we should decode the image upside down.
+ bool reverse_rows_;
+
// The internal state of the decoder.
State state_;