dimanche 28 février 2016

What is the fastest way to put 8 bit integer in 16 bit integer array

I am working on a program that processes images. If I could store RGBA values in 16bit integers I could increase performance by using SSE (without the risk of overflow). However the conversion from 8 bit integers to 16 bit integers is the bottleneck. What is the fastest way to put signed 8 bit integers into 16 bit inetger array, an efficient equvalent of

int8_t a[128];
int16_t b[128];

for (int i=0;i<128;i++)
       b[i]=a[i];

Of course I am using openmp and pointers.

Aucun commentaire:

Enregistrer un commentaire