/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk

« back to all changes in this revision

Viewing changes to dict_hw/src/dict_image.cpp

  • Committer: Suren A. Chilingaryan
  • Date: 2010-08-09 00:10:31 UTC
  • Revision ID: csa@dside.dyndns.org-20100809001031-59vi0m04osiimrvz
Timing measurements are fixed, openmp support to accelerate image reduction

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
#include "dict_image.h"
14
14
 
 
15
#ifdef HAVE_OPENMP
 
16
# include <omp.h>
 
17
#endif /* HAVE_OPENMP */
 
18
 
15
19
static int dictImageFreeBuffer(DICTContext ctx, DICTImageType image_type, void *image_buf) {
16
20
    switch (image_type) {
17
21
#ifdef DICT_TIFF_SUPPORT
209
213
                int aligned_width = (width / TRANSPOSE_SIZE) * TRANSPOSE_SIZE;
210
214
                int aligned_height = (height / TRANSPOSE_SIZE) * TRANSPOSE_SIZE;
211
215
 
 
216
# pragma omp parallel for
212
217
                for (int col = 0; col < aligned_height; col+=TRANSPOSE_SIZE) {
213
218
                    for (int lin = 0; lin < aligned_width; lin+=TRANSPOSE_SIZE) {
214
219
 
236
241
#ifdef USE_SSE
237
242
                reduct_ssse3(res, image, size);
238
243
#else /* USE_SSE */
 
244
# pragma omp parallel for
239
245
                for (int i = 0; i < size; ++i) {
240
246
                    int pos = 4 * i;
241
247
                    unsigned short sum = 85 * (image[pos] + image[pos+1] + image[pos+2]);