Commit 2e6f6a73 authored by Yaowu Xu's avatar Yaowu Xu

Align stack arrays to be 16-byte aligned

This fixes a number of segmentation faults.

BUG=aomedia:874
BUG=aomedia:658

Change-Id: I9d1c549e9c7d44a03c5b1b35e8de389c085d95b8
parent 989dd5bf
......@@ -129,8 +129,10 @@ static double calc_psnrhvs(const unsigned char *src, int _systride,
const uint8_t *_dst8 = dst;
const uint16_t *_src16 = CONVERT_TO_SHORTPTR(src);
const uint16_t *_dst16 = CONVERT_TO_SHORTPTR(dst);
int16_t dct_s[8 * 8], dct_d[8 * 8];
tran_low_t dct_s_coef[8 * 8], dct_d_coef[8 * 8];
DECLARE_ALIGNED(16, int16_t, dct_s[8 * 8]);
DECLARE_ALIGNED(16, int16_t, dct_d[8 * 8]);
DECLARE_ALIGNED(16, tran_low_t, dct_s_coef[8 * 8]);
DECLARE_ALIGNED(16, tran_low_t, dct_d_coef[8 * 8]);
double mask[8][8];
int pixels;
int x;
......
......@@ -28,7 +28,8 @@ void aom_convolve8_add_src_hip_sse2(const uint8_t *src, ptrdiff_t src_stride,
(void)x_step_q4;
(void)y_step_q4;
uint16_t temp[(MAX_SB_SIZE + SUBPEL_TAPS - 1) * MAX_SB_SIZE];
DECLARE_ALIGNED(16, uint16_t,
temp[(MAX_SB_SIZE + SUBPEL_TAPS - 1) * MAX_SB_SIZE]);
int intermediate_height = h + SUBPEL_TAPS - 1;
int i, j;
const int center_tap = ((SUBPEL_TAPS - 1) / 2);
......
......@@ -667,10 +667,10 @@ static void selfguided_restoration_3_h(int32_t *A, int32_t *B, int width,
void av1_selfguided_restoration_sse4_1(uint8_t *dgd, int width, int height,
int dgd_stride, int32_t *dst,
int dst_stride, int r, int eps) {
DECLARE_ALIGNED(16, int32_t, A_[RESTORATION_PROC_UNIT_PELS]);
DECLARE_ALIGNED(16, int32_t, B_[RESTORATION_PROC_UNIT_PELS]);
const int width_ext = width + 2 * SGRPROJ_BORDER_HORZ;
const int height_ext = height + 2 * SGRPROJ_BORDER_VERT;
int32_t A_[RESTORATION_PROC_UNIT_PELS];
int32_t B_[RESTORATION_PROC_UNIT_PELS];
int32_t *A = A_;
int32_t *B = B_;
int i, j;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment