149 |
|
|
150 |
/* According to the Standard Clause 7.6.4, padding is done starting at 16 |
/* According to the Standard Clause 7.6.4, padding is done starting at 16 |
151 |
* pixel width and height multiples. This was not respected in old xvids */ |
* pixel width and height multiples. This was not respected in old xvids */ |
152 |
if (bs_version == 0 || bs_version >= SETEDGES_BUG_BEFORE) { |
if (bs_version >= SETEDGES_BUG_BEFORE) { |
153 |
width = (width+15)&~15; |
width = (width+15)&~15; |
154 |
height = (height+15)&~15; |
height = (height+15)&~15; |
155 |
} |
} |
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; |