[openal] [PATCH V4] Add some mixer SSE2/SSE4.1/AVX optimisations

Chris Robinson chris.kcat at gmail.com
Fri Jun 6 04:34:10 EDT 2014


On 06/06/2014 01:18 AM, Timothy Arceri wrote:
> +    /* setup pos and frac arrays */
> +    for (i=0;i < size-2; i++) {
> +        frac_tmp = frac_arr[i] + increment;
> +        pos_arr[i+1] = pos_arr[i] + (frac_tmp>>FRACTIONBITS);
> +        frac_arr[i+1] = frac_tmp & FRACTIONMASK;
> +    }

Shouldn't this be for(i = 0;i < size-1;i++)? The last element of pos_arr 
and frac_arr aren't being initialized. I'd rewrite the loop to be:

for(i = 1;i < size;i++)
{
     frac_tmp = frac_arr[i-1] + increment;
     pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
     frac_arr[i] = frac_tmp & FRACTIONMASK;
}

Actually I have the SSE2/4.1 resamplers committed locally, but haven't 
pushed yet, so this won't apply as it. I'll get that pushed soon.


More information about the openal mailing list