Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Unified Diff: remoting/base/decoder_vp8.cc

Issue 5310011: Reverse rows in VP8 decoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/decoder_vp8.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/decoder_vp8.cc
diff --git a/remoting/base/decoder_vp8.cc b/remoting/base/decoder_vp8.cc
index 516e9f439423361c0c0a14f1a464bd239f9c166e..fc89503ef9336c6d223599356334aa82065dbaca 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;
}
« no previous file with comments | « remoting/base/decoder_vp8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698