avcodec/apedec: optimize sign combination

48078630 -> 32533850 dezi cycles

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-06-23 02:04:44 +02:00
parent a125f87ac4
commit 42e6fc147b

View File

@ -913,7 +913,7 @@ static void long_filter_high_3800(int32_t *buffer, int order, int shift,
sign = APESIGN(buffer[i]); sign = APESIGN(buffer[i]);
for (j = 0; j < order; j++) { for (j = 0; j < order; j++) {
dotprod += delay[j] * coeffs[j]; dotprod += delay[j] * coeffs[j];
coeffs[j] -= (((delay[j] >> 30) & 2) - 1) * sign; coeffs[j] += ((delay[j] >> 31) | 1) * sign;
} }
buffer[i] -= dotprod >> shift; buffer[i] -= dotprod >> shift;
for (j = 0; j < order - 1; j++) for (j = 0; j < order - 1; j++)
@ -933,7 +933,7 @@ static void long_filter_ehigh_3830(int32_t *buffer, int length)
sign = APESIGN(buffer[i]); sign = APESIGN(buffer[i]);
for (j = 7; j >= 0; j--) { for (j = 7; j >= 0; j--) {
dotprod += delay[j] * coeffs[j]; dotprod += delay[j] * coeffs[j];
coeffs[j] -= (((delay[j] >> 30) & 2) - 1) * sign; coeffs[j] += ((delay[j] >> 31) | 1) * sign;
} }
for (j = 7; j > 0; j--) for (j = 7; j > 0; j--)
delay[j] = delay[j - 1]; delay[j] = delay[j - 1];