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

Unified Diff: cc/video_layer_impl.cc

Issue 11413005: YUV software decode path stride fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « no previous file | media/base/video_frame.cc » ('j') | media/base/video_frame.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/video_layer_impl.cc
diff --git a/cc/video_layer_impl.cc b/cc/video_layer_impl.cc
index 9930a0c4eac8bd4b7e0dac633d74d82951699d99..6d671adf97e699c22e36e53ced004895a3422e1d 100644
--- a/cc/video_layer_impl.cc
+++ b/cc/video_layer_impl.cc
@@ -204,9 +204,9 @@ void VideoLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad
gfx::Size codedSize = m_frame->coded_size();
// pixels for macroblocked formats.
- const float texWidthScale =
+ float texWidthScale =
static_cast<float>(visibleRect.width()) / codedSize.width();
- const float texHeightScale =
+ float texHeightScale =
Ami GONE FROM CHROMIUM 2012/11/15 18:15:36 Undo these changes?
sheu 2012/11/15 19:46:38 They're applicable for the rest of the paths, so I
Ami GONE FROM CHROMIUM 2012/11/15 20:39:09 My point was that all you changed was dropping the
sheu 2012/11/15 22:20:53 Ah right, no-op change. Fixed.
static_cast<float>(visibleRect.height()) / codedSize.height();
switch (m_format) {
@@ -215,7 +215,11 @@ void VideoLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad
const FramePlane& yPlane = m_framePlanes[media::VideoFrame::kYPlane];
const FramePlane& uPlane = m_framePlanes[media::VideoFrame::kUPlane];
const FramePlane& vPlane = m_framePlanes[media::VideoFrame::kVPlane];
- gfx::SizeF texScale(texWidthScale, texHeightScale);
+ // YUV software decoder uses CPU-allocated textures that have extra
+ // padding past what coded_size_ reflects.
Ami GONE FROM CHROMIUM 2012/11/15 18:15:36 I don't see how this CL changes things; how is yPl
sheu 2012/11/15 19:46:38 See video_frame.cc, where we do some extra alignme
Ami GONE FROM CHROMIUM 2012/11/15 20:39:09 I somehow missed the thunk below in videoFrameDime
+ gfx::SizeF texScale(
+ static_cast<float>(visibleRect.width()) / yPlane.size.width(),
Ami GONE FROM CHROMIUM 2012/11/15 20:39:09 What is this supposed to be scaling from/to? My a
sheu 2012/11/15 22:20:53 We're not scaling to <video> dimensions -- that's
+ static_cast<float>(visibleRect.height()) / yPlane.size.height());
scoped_ptr<YUVVideoDrawQuad> yuvVideoQuad = YUVVideoDrawQuad::create(
sharedQuadState, quadRect, texScale, yPlane, uPlane, vPlane);
quadSink.append(yuvVideoQuad.PassAs<DrawQuad>(), appendQuadsData);
@@ -287,18 +291,12 @@ void VideoLayerImpl::didDraw(ResourceProvider* resourceProvider)
}
static gfx::Size videoFrameDimension(media::VideoFrame* frame, int plane) {
- gfx::Size dimensions = frame->coded_size();
+ gfx::Size dimensions = gfx::Size(frame->stride(plane),
+ frame->coded_size().height());
switch (frame->format()) {
case media::VideoFrame::YV12:
- if (plane != media::VideoFrame::kYPlane) {
- dimensions.set_width(dimensions.width() / 2);
+ if (plane != media::VideoFrame::kYPlane)
dimensions.set_height(dimensions.height() / 2);
- }
- break;
- case media::VideoFrame::YV16:
- if (plane != media::VideoFrame::kYPlane) {
- dimensions.set_width(dimensions.width() / 2);
- }
break;
default:
break;
« no previous file with comments | « no previous file | media/base/video_frame.cc » ('j') | media/base/video_frame.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698