Bug 1137614: Align the mvsadcost array to work around a possible compiler issue. r=rillian
authorDavid Major <dmajor@mozilla.com>
Tue, 07 Apr 2015 04:32:46 +1200
changeset 267644 7a1eb59f83a5b0d1e4522a1cf7fb5fcc756f3a5b
parent 267643 183190289b9c69fff9812491924005f2c1e8fbc9
child 267645 681b04addd40b48c1ea2b4c4e6462d89df068f59
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1137614
milestone40.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 1137614: Align the mvsadcost array to work around a possible compiler issue. r=rillian
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