Bug 1173396 - Restore libvpx alignment patch. r=kinetik, a=sledru
authorRalph Giles <giles@mozilla.com>
Wed, 10 Jun 2015 09:31:00 -0700
changeset 275059 69d21e7b13856672fc663423931f9d4c7cd3d4ab
parent 275058 d0d6aa6c7ace82fd4062ff4b1ced79e8b84bd175
child 275060 e9cbcee3f6da818a7a74ac599229b9eca8cfe041
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik, sledru
bugs1173396
milestone40.0a2
Bug 1173396 - Restore libvpx alignment patch. r=kinetik, a=sledru The crash in vp8_diamond_search_sadx4 is reproducing again so it looks like switching off unified build didn't fix this.
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
@@ -519,16 +519,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 for AVX intrinsic support with Apple's clang.
     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