Bug 1255688 - Fix TypeFromSize for YV16 case; r=jrmuizel
authorKaku Kuo <tkuo@mozilla.com>
Thu, 10 Mar 2016 17:58:00 +0800
changeset 340571 f5804d79ba15e4e16aaa004cd37331a4b2233a9f
parent 340570 3da545fd691fa27d09ab8865b1fa2916418cad7f
child 340572 dbd9ceba3964f756765cbd96d3beea7b3de0a933
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1255688
milestone49.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 1255688 - Fix TypeFromSize for YV16 case; r=jrmuizel MozReview-Commit-ID: KATnTZaLLdG
gfx/ycbcr/yuv_convert.cpp
--- a/gfx/ycbcr/yuv_convert.cpp
+++ b/gfx/ycbcr/yuv_convert.cpp
@@ -20,31 +20,31 @@
 
 // Header for low level row functions.
 #include "yuv_row.h"
 #include "mozilla/SSE.h"
 
 namespace mozilla {
 
 namespace gfx {
- 
+
 // 16.16 fixed point arithmetic
 const int kFractionBits = 16;
 const int kFractionMax = 1 << kFractionBits;
 const int kFractionMask = ((1 << kFractionBits) - 1);
 
-YUVType TypeFromSize(int ywidth, 
-                              int yheight, 
-                              int cbcrwidth, 
+YUVType TypeFromSize(int ywidth,
+                              int yheight,
+                              int cbcrwidth,
                               int cbcrheight)
 {
   if (ywidth == cbcrwidth && yheight == cbcrheight) {
     return YV24;
   }
-  else if (ywidth / 2 == cbcrwidth && yheight == cbcrheight) {
+  else if ((ywidth + 1) / 2 == cbcrwidth && yheight == cbcrheight) {
     return YV16;
   }
   else {
     return YV12;
   }
 }
 
 // Convert a frame of YUV to 32 bit ARGB.