diff options
author | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-10 19:40:21 +0000 |
---|---|---|
committer | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-10 19:40:21 +0000 |
commit | 598cc6a4da6202980cc5634e3ae73ddfa0842ba9 (patch) | |
tree | 4c240ec0d604403bf0421ad8175c18ca3df40891 /media | |
parent | 3d3c846fb3a515a3ec47e1e8c88d119f73caeeec (diff) | |
download | chromium_src-598cc6a4da6202980cc5634e3ae73ddfa0842ba9.zip chromium_src-598cc6a4da6202980cc5634e3ae73ddfa0842ba9.tar.gz chromium_src-598cc6a4da6202980cc5634e3ae73ddfa0842ba9.tar.bz2 |
Correct some rounding errors introduced recently.
BUG=101494
Review URL: http://codereview.chromium.org/8511043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/base/video_frame.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc index 340ba19..a0dc579 100644 --- a/media/base/video_frame.cc +++ b/media/base/video_frame.cc @@ -118,10 +118,10 @@ void VideoFrame::AllocateYUV() { // 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); 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 @@ int VideoFrame::row_bytes(size_t plane) const { case YV16: if (plane == kYPlane) return width_; - return width_ / 2; + return RoundUp(width_, 2) / 2; default: break; @@ -220,7 +220,7 @@ int VideoFrame::rows(size_t plane) const { case YV12: if (plane == kYPlane) return height_; - return height_ / 2; + return RoundUp(height_, 2) / 2; default: break; |