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

Unified Diff: media/base/video_frame.cc

Issue 8511043: Correct some rounding errors introduced recently. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
===================================================================
--- media/base/video_frame.cc (revision 109319)
+++ media/base/video_frame.cc (working copy)
@@ -118,10 +118,10 @@
// to avoid any potential of faulting by code that attempts to access the Y
// values of the final row, but assumes that the last row of U & V applies to
// a full two rows of Y.
- size_t y_height = RoundUp(rows(VideoFrame::kYPlane), 2);
+ size_t y_height = rows(VideoFrame::kYPlane);
scherkus (not reviewing) 2011/11/10 04:09:41 this change looks OK and avoids over-allocating on
size_t y_stride = RoundUp(row_bytes(VideoFrame::kYPlane), 4);
size_t uv_stride = RoundUp(row_bytes(VideoFrame::kUPlane), 4);
- size_t uv_height = RoundUp(rows(VideoFrame::kUPlane), 2);
+ size_t uv_height = rows(VideoFrame::kUPlane);
size_t y_bytes = y_height * y_stride;
size_t uv_bytes = uv_height * uv_stride;
@@ -195,7 +195,7 @@
case YV16:
if (plane == kYPlane)
return width_;
- return width_ / 2;
+ return RoundUp(width_, 2) / 2;
scherkus (not reviewing) 2011/11/10 04:09:41 so we're always rounding up post-divide? i.e., th
Chris Evans 2011/11/10 06:32:38 The intent is to round up pre-divide -- the divide
default:
break;
@@ -220,7 +220,7 @@
case YV12:
if (plane == kYPlane)
return height_;
- return height_ / 2;
+ return RoundUp(height_, 2) / 2;
default:
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698