Bug 1137614 - Align the mvsadcost array to work around a possible compiler issue. r=rillian, a=sledru
authorDavid Major <dmajor@mozilla.com>
Tue, 07 Apr 2015 04:32:46 +1200
changeset 258373 58b20f079d4f
parent 258372 1dc6d70e9022
child 258374 d4e6fe0b0eb5
push id4654
push userryanvm@gmail.com
push date2015-04-08 19:02 +0000
treeherdermozilla-beta@01cf08a90d44 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian, sledru
bugs1137614
milestone38.0
Bug 1137614 - Align the mvsadcost array to work around a possible compiler issue. r=rillian, a=sledru
media/libvpx/bug1137614.patch
media/libvpx/update.py
media/libvpx/vp8/encoder/block.h
new file mode 100644
--- /dev/null
+++ b/media/libvpx/bug1137614.patch
@@ -0,0 +1,23 @@
+diff --git a/media/libvpx/vp8/encoder/block.h b/media/libvpx/vp8/encoder/block.h
+--- a/media/libvpx/vp8/encoder/block.h
++++ b/media/libvpx/vp8/encoder/block.h
+@@ -93,17 +93,18 @@ typedef struct macroblock
+     int rddiv;
+     int rdmult;
+     unsigned int * mb_activity_ptr;
+     int * mb_norm_activity_ptr;
+     signed int act_zbin_adj;
+     signed int last_act_zbin_adj;
+ 
+     int *mvcost[2];
+-    int *mvsadcost[2];
++    /* MSVC generates code that thinks this is 16-byte aligned */
++    DECLARE_ALIGNED(16, int*, mvsadcost[2]);
+     int (*mbmode_cost)[MB_MODE_COUNT];
+     int (*intra_uv_mode_cost)[MB_MODE_COUNT];
+     int (*bmode_costs)[10][10];
+     int *inter_bmode_costs;
+     int (*token_costs)[COEF_BANDS][PREV_COEF_CONTEXTS]
+     [MAX_ENTROPY_TOKENS];
+ 
+     /* These define limits to motion vector components to prevent
--- a/media/libvpx/update.py
+++ b/media/libvpx/update.py
@@ -529,16 +529,18 @@ def update_and_remove_files(prefix, libv
 
 def apply_patches():
     # Patch to permit vpx users to specify their own <stdint.h> types.
     os.system("patch -p0 < stdint.patch")
     # Patch to allow older versions of Apple's clang to build libvpx.
     os.system("patch -p3 < apple-clang.patch")
     # Patch to allow MSVC 2015 to compile libvpx
     os.system("patch -p3 < msvc2015.patch")
+    # Patch to fix a crash caused by MSVC 2013
+    os.system("patch -p3 < bug1137614.patch")
 
 def update_readme(commit):
     with open('README_MOZILLA') as f:
         readme = f.read()
 
     if 'The git commit ID used was' in readme:
         new_readme = re.sub('The git commit ID used was [a-f0-9]+',
             'The git commit ID used was %s' % commit, readme)
--- a/media/libvpx/vp8/encoder/block.h
+++ b/media/libvpx/vp8/encoder/block.h
@@ -93,17 +93,18 @@ typedef struct macroblock
     int rddiv;
     int rdmult;
     unsigned int * mb_activity_ptr;
     int * mb_norm_activity_ptr;
     signed int act_zbin_adj;
     signed int last_act_zbin_adj;
 
     int *mvcost[2];
-    int *mvsadcost[2];
+    /* MSVC generates code that thinks this is 16-byte aligned */
+    DECLARE_ALIGNED(16, int*, mvsadcost[2]);
     int (*mbmode_cost)[MB_MODE_COUNT];
     int (*intra_uv_mode_cost)[MB_MODE_COUNT];
     int (*bmode_costs)[10][10];
     int *inter_bmode_costs;
     int (*token_costs)[COEF_BANDS][PREV_COEF_CONTEXTS]
     [MAX_ENTROPY_TOKENS];
 
     /* These define limits to motion vector components to prevent