Bug 1344591 - Ensure BlankVideoCreate doesn't round down Cb and Cr strides. r=gerald
authorChris Pearce <cpearce@mozilla.com>
Mon, 06 Mar 2017 13:52:45 +1300
changeset 345965 5368b2790c4292a3004bd2c9b44ecd3dd6187e0d
parent 345964 197b5eb5e400671ef75994718d6bb77c0b7d874b
child 345966 41bd2eefc82322918a7f5d299dd913fc20c65316
push id31451
push usercbook@mozilla.com
push dateMon, 06 Mar 2017 09:52:09 +0000
treeherdermozilla-central@7099e03837e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1344591
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1344591 - Ensure BlankVideoCreate doesn't round down Cb and Cr strides. r=gerald MozReview-Commit-ID: Jjvzo7WfrFE
dom/media/platforms/agnostic/BlankDecoderModule.cpp
--- a/dom/media/platforms/agnostic/BlankDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/BlankDecoderModule.cpp
@@ -141,27 +141,27 @@ public:
     buffer.mPlanes[0].mStride = mFrameWidth;
     buffer.mPlanes[0].mHeight = mFrameHeight;
     buffer.mPlanes[0].mWidth = mFrameWidth;
     buffer.mPlanes[0].mOffset = 0;
     buffer.mPlanes[0].mSkip = 0;
 
     // Cb plane.
     buffer.mPlanes[1].mData = frame.get() + sizeY;
-    buffer.mPlanes[1].mStride = mFrameWidth / 2;
-    buffer.mPlanes[1].mHeight = mFrameHeight / 2;
-    buffer.mPlanes[1].mWidth = mFrameWidth / 2;
+    buffer.mPlanes[1].mStride = (mFrameWidth + 1) / 2;
+    buffer.mPlanes[1].mHeight = (mFrameHeight + 1) / 2;
+    buffer.mPlanes[1].mWidth = (mFrameWidth + 1) / 2;
     buffer.mPlanes[1].mOffset = 0;
     buffer.mPlanes[1].mSkip = 0;
 
     // Cr plane.
     buffer.mPlanes[2].mData = frame.get() + sizeY;
-    buffer.mPlanes[2].mStride = mFrameWidth / 2;
-    buffer.mPlanes[2].mHeight = mFrameHeight / 2;
-    buffer.mPlanes[2].mWidth = mFrameWidth / 2;
+    buffer.mPlanes[2].mStride = (mFrameWidth + 1) / 2;
+    buffer.mPlanes[2].mHeight = (mFrameHeight + 1) / 2;
+    buffer.mPlanes[2].mWidth = (mFrameWidth + 1) / 2;
     buffer.mPlanes[2].mOffset = 0;
     buffer.mPlanes[2].mSkip = 0;
 
     // Set to color white.
     memset(buffer.mPlanes[0].mData, 255, sizeY);
     memset(buffer.mPlanes[1].mData, 128, sizeCbCr);
 
     return VideoData::CreateAndCopyData(mInfo,