From 0c9269d6e81206d7bde4bd789c85e526446386bd Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 17 Nov 2014 22:11:58 -0800 Subject: [PATCH] OpenMP for Transpose. Questionable Benefit --- libImaging/Geometry.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libImaging/Geometry.c b/libImaging/Geometry.c index 1d08728da..3389b8b3b 100644 --- a/libImaging/Geometry.c +++ b/libImaging/Geometry.c @@ -5,6 +5,7 @@ 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 that the overhead from the extra loops are not apparent. */ + #define ROTATE_CHUNK 512 #define ROTATE_SMALL_CHUNK 8 @@ -163,11 +164,13 @@ ImagingTranspose(Imaging imOut, Imaging imIn) 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) - else + } else { +#pragma omp parallel for private(x,y,xx,yy,yysize,xxsize) shared(imIn,imOut) default(none) collapse(2) TRANSPOSE(INT32, image32) - + } ImagingSectionLeave(&cookie); #undef TRANSPOSE