Commit 989dd5bf authored by Yaowu Xu's avatar Yaowu Xu

Fix msvc 2015 build

BUG=aomedia:900

Change-Id: I9ca596f677e174ccd12a6e4eb927733d25e76f58
parent fbe1477b
......@@ -1728,9 +1728,9 @@ void av1_build_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
av1_build_inter_predictors_sbuv(cm, xd, mi_row, mi_col, ctx, bsize);
}
void av1_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE],
BLOCK_SIZE bsize, const YV12_BUFFER_CONFIG *src,
int mi_row, int mi_col) {
void av1_setup_dst_planes(struct macroblockd_plane *planes, BLOCK_SIZE bsize,
const YV12_BUFFER_CONFIG *src, int mi_row,
int mi_col) {
const int widths[MAX_MB_PLANE] = { src->y_crop_width, src->uv_crop_width,
src->uv_crop_width };
const int heights[MAX_MB_PLANE] = { src->y_crop_height, src->uv_crop_height,
......
......@@ -446,9 +446,9 @@ static INLINE void setup_pred_plane(struct buf_2d *dst, BLOCK_SIZE bsize,
dst->stride = stride;
}
void av1_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE],
BLOCK_SIZE bsize, const YV12_BUFFER_CONFIG *src,
int mi_row, int mi_col);
void av1_setup_dst_planes(struct macroblockd_plane *planes, BLOCK_SIZE bsize,
const YV12_BUFFER_CONFIG *src, int mi_row,
int mi_col);
void av1_setup_pre_planes(MACROBLOCKD *xd, int idx,
const YV12_BUFFER_CONFIG *src, int mi_row, int mi_col,
......
......@@ -286,10 +286,9 @@ static int loop_filter_row_worker(AV1LfSync *const lf_sync,
#endif // CONFIG_PARALLEL_DEBLOCKING
static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only,
AVxWorker *workers, int nworkers,
AV1LfSync *lf_sync) {
struct macroblockd_plane *planes, int start,
int stop, int y_only, AVxWorker *workers,
int nworkers, AV1LfSync *lf_sync) {
#if CONFIG_EXT_PARTITION
printf(
"STOPPING: This code has not been modified to work with the "
......@@ -415,7 +414,7 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
}
void av1_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
struct macroblockd_plane *planes,
int frame_filter_level,
#if CONFIG_LOOPFILTER_LEVEL
int frame_filter_level_r,
......
......@@ -49,7 +49,7 @@ void av1_loop_filter_dealloc(AV1LfSync *lf_sync);
// Multi-threaded loopfilter that uses the tile threads.
void av1_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, struct AV1Common *cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
struct macroblockd_plane *planes,
int frame_filter_level,
#if CONFIG_LOOPFILTER_LEVEL
int frame_filter_level_r,
......
......@@ -10,9 +10,11 @@
av1_selfguided_restoration)
*/
static void calc_block(__m128i sum, __m128i sum_sq, __m128i n,
__m128i one_over_n, __m128i s, int bit_depth, int idx,
int32_t *A, int32_t *B) {
__m128i *one_over_n_, __m128i *s_, int bit_depth,
int idx, int32_t *A, int32_t *B) {
__m128i a, b, p;
__m128i one_over_n = *one_over_n_;
__m128i s = *s_;
#if CONFIG_HIGHBITDEPTH
if (bit_depth > 8) {
__m128i rounding_a = _mm_set1_epi32((1 << (2 * (bit_depth - 8))) >> 1);
......@@ -147,7 +149,7 @@ static void selfguided_restoration_1_h(int32_t *A, int32_t *B, int width,
__m128i s = _mm_set_epi32(
sgrproj_mtable[eps - 1][3 * h - 1], sgrproj_mtable[eps - 1][3 * h - 1],
sgrproj_mtable[eps - 1][3 * h - 1], sgrproj_mtable[eps - 1][2 * h - 1]);
calc_block(sum_, sum_sq_, n, one_over_n, s, bit_depth, i * buf_stride, A,
calc_block(sum_, sum_sq_, n, &one_over_n, &s, bit_depth, i * buf_stride, A,
B);
n = _mm_set1_epi32(3 * h);
......@@ -178,8 +180,8 @@ static void selfguided_restoration_1_h(int32_t *A, int32_t *B, int width,
_mm_alignr_epi8(b2, b1, 8)));
sum_sq_ = _mm_add_epi32(a1, _mm_add_epi32(_mm_alignr_epi8(a2, a1, 4),
_mm_alignr_epi8(a2, a1, 8)));
calc_block(sum_, sum_sq_, n, one_over_n, s, bit_depth, i * buf_stride + j,
A, B);
calc_block(sum_, sum_sq_, n, &one_over_n, &s, bit_depth,
i * buf_stride + j, A, B);
}
__m128i a3 = _mm_loadu_si128((__m128i *)&A[i * buf_stride + j + 3]);
__m128i b3 = _mm_loadu_si128((__m128i *)&B[i * buf_stride + j + 3]);
......@@ -227,7 +229,7 @@ static void selfguided_restoration_1_h(int32_t *A, int32_t *B, int width,
s = _mm_set_epi32(
sgrproj_mtable[eps - 1][2 * h - 1], sgrproj_mtable[eps - 1][3 * h - 1],
sgrproj_mtable[eps - 1][3 * h - 1], sgrproj_mtable[eps - 1][3 * h - 1]);
calc_block(sum_, sum_sq_, n, one_over_n, s, bit_depth, i * buf_stride + j,
calc_block(sum_, sum_sq_, n, &one_over_n, &s, bit_depth, i * buf_stride + j,
A, B);
}
}
......@@ -342,7 +344,7 @@ static void selfguided_restoration_2_h(int32_t *A, int32_t *B, int width,
__m128i s = _mm_set_epi32(
sgrproj_mtable[eps - 1][5 * h - 1], sgrproj_mtable[eps - 1][5 * h - 1],
sgrproj_mtable[eps - 1][4 * h - 1], sgrproj_mtable[eps - 1][3 * h - 1]);
calc_block(sum_, sum_sq_, n, one_over_n, s, bit_depth, i * buf_stride, A,
calc_block(sum_, sum_sq_, n, &one_over_n, &s, bit_depth, i * buf_stride, A,
B);
// Re-align a1 and b1 so that they start at index i * buf_stride + 2
......@@ -372,8 +374,8 @@ static void selfguided_restoration_2_h(int32_t *A, int32_t *B, int width,
_mm_alignr_epi8(a2, a1, 8))),
_mm_add_epi32(_mm_alignr_epi8(a2, a1, 12), a2));
calc_block(sum_, sum_sq_, n, one_over_n, s, bit_depth, i * buf_stride + j,
A, B);
calc_block(sum_, sum_sq_, n, &one_over_n, &s, bit_depth,
i * buf_stride + j, A, B);
}
// If the width is not a multiple of 4, we need to reset j to width - 4
// and adjust a1, a2, b1, b2 so that the loop invariant above is maintained
......@@ -428,7 +430,7 @@ static void selfguided_restoration_2_h(int32_t *A, int32_t *B, int width,
s = _mm_set_epi32(
sgrproj_mtable[eps - 1][3 * h - 1], sgrproj_mtable[eps - 1][4 * h - 1],
sgrproj_mtable[eps - 1][5 * h - 1], sgrproj_mtable[eps - 1][5 * h - 1]);
calc_block(sum_, sum_sq_, n, one_over_n, s, bit_depth, i * buf_stride + j,
calc_block(sum_, sum_sq_, n, &one_over_n, &s, bit_depth, i * buf_stride + j,
A, B);
}
}
......@@ -562,7 +564,7 @@ static void selfguided_restoration_3_h(int32_t *A, int32_t *B, int width,
__m128i s = _mm_set_epi32(
sgrproj_mtable[eps - 1][7 * h - 1], sgrproj_mtable[eps - 1][6 * h - 1],
sgrproj_mtable[eps - 1][5 * h - 1], sgrproj_mtable[eps - 1][4 * h - 1]);
calc_block(sum_, sum_sq_, n, one_over_n, s, bit_depth, i * buf_stride, A,
calc_block(sum_, sum_sq_, n, &one_over_n, &s, bit_depth, i * buf_stride, A,
B);
// Re-align a1 and b1 so that they start at index i * buf_stride + 1
......@@ -599,8 +601,8 @@ static void selfguided_restoration_3_h(int32_t *A, int32_t *B, int width,
_mm_add_epi32(_mm_add_epi32(a2, _mm_alignr_epi8(a3, a2, 4)),
_mm_alignr_epi8(a3, a2, 8)));
calc_block(sum_, sum_sq_, n, one_over_n, s, bit_depth, i * buf_stride + j,
A, B);
calc_block(sum_, sum_sq_, n, &one_over_n, &s, bit_depth,
i * buf_stride + j, A, B);
}
__m128i a3 = _mm_loadu_si128((__m128i *)&A[i * buf_stride + j + 1]);
__m128i b3 = _mm_loadu_si128((__m128i *)&B[i * buf_stride + j + 1]);
......@@ -657,7 +659,7 @@ static void selfguided_restoration_3_h(int32_t *A, int32_t *B, int width,
s = _mm_set_epi32(
sgrproj_mtable[eps - 1][4 * h - 1], sgrproj_mtable[eps - 1][5 * h - 1],
sgrproj_mtable[eps - 1][6 * h - 1], sgrproj_mtable[eps - 1][7 * h - 1]);
calc_block(sum_, sum_sq_, n, one_over_n, s, bit_depth, i * buf_stride + j,
calc_block(sum_, sum_sq_, n, &one_over_n, &s, bit_depth, i * buf_stride + j,
A, B);
}
}
......
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