Skip to content

Commit

Permalink
Merge pull request #8 from chneukirchen/fix-openmp
Browse files Browse the repository at this point in the history
Share acolormap in omp parallel for
  • Loading branch information
kornelski committed Oct 29, 2017
2 parents 7438007 + 23a079a commit 918dd4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libimagequant.c
Expand Up @@ -1256,7 +1256,7 @@ LIQ_NONNULL static float remap_to_palette(liq_image *const input_image, unsigned
kmeans_init(map, max_threads, average_color);

#pragma omp parallel for if (rows*cols > 3000) \
schedule(static) default(none) shared(average_color) reduction(+:remapping_error)
schedule(static) default(none) shared(acolormap) shared(average_color) reduction(+:remapping_error)
for(int row = 0; row < rows; ++row) {
const f_pixel *const row_pixels = liq_image_get_row_f(input_image, row);
const f_pixel *const bg_pixels = input_image->background && acolormap[transparent_index].acolor.a < 1.f/256.f ? liq_image_get_row_f(input_image->background, row) : NULL;
Expand Down

0 comments on commit 918dd4a

Please sign in to comment.