vpx_fdct16x16_1_c/msa: fix accumulator overflow

tran_low_t is only signed 16-bits in non-high-bitdepth mode

Change-Id: Ie02b5caf2658e8e71f995c17dd5ce666a4d64918
This commit is contained in:
James Zern
2016-03-29 21:04:38 -07:00
parent 3735def667
commit eb64ea3e89
3 changed files with 85 additions and 9 deletions

View File

@@ -237,11 +237,9 @@ void vpx_fdct16x16_msa(const int16_t *input, int16_t *output,
}
void vpx_fdct16x16_1_msa(const int16_t *input, int16_t *out, int32_t stride) {
out[1] = 0;
out[0] = LD_HADD(input, stride);
out[0] += LD_HADD(input + 8, stride);
out[0] += LD_HADD(input + 16 * 8, stride);
out[0] += LD_HADD(input + 16 * 8 + 8, stride);
out[0] >>= 1;
int sum = LD_HADD(input, stride);
sum += LD_HADD(input + 8, stride);
sum += LD_HADD(input + 16 * 8, stride);
sum += LD_HADD(input + 16 * 8 + 8, stride);
out[0] = (int16_t)(sum >> 1);
}