mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-27 07:34:46 +03:00
OpenMP for Transpose. Questionable Benefit
This commit is contained in:
parent
e4903e2abe
commit
0c9269d6e8
|
@ -5,6 +5,7 @@
|
||||||
Rotating in chunks that fit in the cache can speed up rotation
|
Rotating in chunks that fit in the cache can speed up rotation
|
||||||
8x on a modern CPU. A chunk size of 128 requires only 65k and is large enough
|
8x on a modern CPU. A chunk size of 128 requires only 65k and is large enough
|
||||||
that the overhead from the extra loops are not apparent. */
|
that the overhead from the extra loops are not apparent. */
|
||||||
|
|
||||||
#define ROTATE_CHUNK 512
|
#define ROTATE_CHUNK 512
|
||||||
#define ROTATE_SMALL_CHUNK 8
|
#define ROTATE_SMALL_CHUNK 8
|
||||||
|
|
||||||
|
@ -163,11 +164,13 @@ ImagingTranspose(Imaging imOut, Imaging imIn)
|
||||||
|
|
||||||
ImagingSectionEnter(&cookie);
|
ImagingSectionEnter(&cookie);
|
||||||
|
|
||||||
if (imIn->image8)
|
if (imIn->image8){
|
||||||
|
#pragma omp parallel for private(x,y,xx,yy,yysize,xxsize) shared(imIn,imOut) default(none) collapse(2)
|
||||||
TRANSPOSE(UINT8, image8)
|
TRANSPOSE(UINT8, image8)
|
||||||
else
|
} else {
|
||||||
|
#pragma omp parallel for private(x,y,xx,yy,yysize,xxsize) shared(imIn,imOut) default(none) collapse(2)
|
||||||
TRANSPOSE(INT32, image32)
|
TRANSPOSE(INT32, image32)
|
||||||
|
}
|
||||||
ImagingSectionLeave(&cookie);
|
ImagingSectionLeave(&cookie);
|
||||||
|
|
||||||
#undef TRANSPOSE
|
#undef TRANSPOSE
|
||||||
|
|
Loading…
Reference in New Issue
Block a user