19 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: image.c,v 1.43 2008-11-28 10:58:07 Isibaar Exp $ |
* $Id: image.c,v 1.44 2009-03-30 14:40:05 Isibaar Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
390 |
{ |
{ |
391 |
int width_opt, width_c, height_opt; |
int width_opt, width_c, height_opt; |
392 |
|
|
393 |
if (width==1 || height==1) return; /* forget about it */ |
if (width<0 || width==1 || height==1) return; /* forget about it */ |
394 |
|
|
395 |
if (func_opt != func_c && x_stride < size*((width+15)/16)*16) |
if (func_opt != func_c && x_stride < size*((width+15)/16)*16) |
396 |
{ |
{ |
397 |
width_opt = width & (~15); |
width_opt = width & (~15); |
398 |
width_c = (width - width_opt) & (~1); |
width_c = (width - width_opt) & (~1); |
399 |
} |
} |
400 |
else |
else if (func_opt != func_c && !(width&1) && (size==3)) |
401 |
{ |
{ |
402 |
|
/* MMX reads 4 bytes per pixel for RGB/BGR */ |
403 |
|
width_opt = width - 2; |
404 |
|
width_c = 2; |
405 |
|
} |
406 |
|
else { |
407 |
/* Enforce the width to be divisable by two. */ |
/* Enforce the width to be divisable by two. */ |
408 |
width_opt = width & (~1); |
width_opt = width & (~1); |
409 |
width_c = 0; |
width_c = 0; |