Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ippiResizeGetBufSize() error

Nick_T_1
Beginner
536 Views

Hi Folks:

I am trying to use ResizeSqrPixel() function in Intel IPP, and I simply started with the example in the IPP manual, which is:

#ifdefOPENMP

#include <omp.h>

#endif

 

IppStatus ResizeSqrPixel( void )

{

Ipp32f src[12*12], dst[12*12];

IppiSize size = {12,12};

IppiRect srect = {0,0,12,12};

IppiRect drect = {0,0,6,6};

Ipp8u *buf;

int bufsize, nt;

IppStatus status = ippStsNoErr;

 

/* source image */

{

IppiSize roi = {12,12};

int i;

for( i=0; i<12; ++i ) {

ippiSet_32f_C1R( (Ipp32f)i, src+12*i+i, 12*sizeof(Ipp32f), roi );

--roi.width;

--roi.height;

}

}

/* calculation of work buffer size */

ippiResizeGetBufSize( srect, drect, 1, IPPI_INTER_SUPER, &bufsize );

 

#ifdefOPENMP

/* parallel algorithm */

#pragma omp parallel

{

#pragma omp master

{

/* number of threads */

nt = omp_get_num_threads();

/* memory allocate */

buf = ippsMalloc_8u( nt*bufsize );

}

#pragma omp barrier

{

/* thread's number */

int id = omp_get_thread_num();

/* ROI for one slice */

drect.y = (drect.height/nt)*id;

drect.height = (drect.height/nt)*(id+1);

if( NULL != buf )

status = ippiResizeSqrPixel_32f_C1R(

src, size, 12*sizeof(Ipp32f), srect,

dst, 6*sizeof(Ipp32f), drect,

0.5, 0.5, 0, 0, IPPI_INTER_SUPER, buf+id*bufsize );

}

}

#else

/* single algorithm */

{

/* memory allocate */

buf = ippsMalloc_8u( bufsize );

if( NULL != buf )

status = ippiResizeSqrPixel_32f_C1R(

src, size, 12*sizeof(Ipp32f), srect,

dst, 6*sizeof(Ipp32f), drect,

0.5, 0.5, 0, 0, IPPI_INTER_SUPER, buf );

}

#endif

/* memory free */

if( NULL != buf ) ippsFree( buf );

 

return status;

}

 

 

The source image

0 0 0 0 0 0 0 0 0 0 0 0

0 1 1 1 1 1 1 1 1 1 1 1

0 1 2 2 2 2 2 2 2 2 2 2

0 1 2 3 3 3 3 3 3 3 3 3

0 1 2 3 4 4 4 4 4 4 4 4

0 1 2 3 4 5 5 5 5 5 5 5

0 1 2 3 4 5 6 6 6 6 6 6

0 1 2 3 4 5 6 7 7 7 7 7

0 1 2 3 4 5 6 7 8 8 8 8

0 1 2 3 4 5 6 7 8 9 9 9

0 1 2 3 4 5 6 7 8 9 10 10

0 1 2 3 4 5 6 7 8 9 10 11

 

The image has the following contents after resizing with NEAREST NEIGHBOR interpolation

 

1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000

1.0000000 3.0000000 3.0000000 3.0000000 3.0000000 3.0000000

1.0000000 3.0000000 5.0000000 5.0000000 5.0000000 5.0000000

1.0000000 3.0000000 5.0000000 7.0000000 7.0000000 7.0000000

1.0000000 3.0000000 5.0000000 7.0000000 9.0000000 9.0000000

1.0000000 3.0000000 5.0000000 7.0000000 9.0000000 11.0000000

 

The image has the following contents after resizing with LINEAR interpolation

 

0.25000000 0.5000000 0.5000000 0.5000000 0.5000000 0.5000000

0.50000000 2.2500000 2.5000000 2.5000000 2.5000000 2.5000000

0.50000000 2.5000000 4.2500000 4.5000000 4.5000000 4.5000000

0.50000000 2.5000000 4.5000000 6.2500000 6.5000000 6.5000000

0.50000000 2.5000000 4.5000000 6.5000000 8.2500000 8.5000000

0.50000000 2.5000000 4.5000000 6.5000000 8.5000000 11.2500000

 

The image has the following contents after resizing with CUBIC interpolation

 

0.25390625 0.4335938 0.4375000 0.4375000 0.4375000 0.4375000

0.43359375 2.3828125 2.4960938 2.5000000 2.5000000 2.5000000

0.43750000 2.4960938 4.3828125 4.4960938 4.5000000 4.5000000

0.43750000 2.5000000 4.4960938 6.3828125 6.4960938 6.5000000

0.43750000 2.5000000 4.5000000 6.4960938 8.3828125 8.4960938

0.43750000 2.5000000 4.5000000 6.5000000 8.4960938 10.3789060

 

The image has the following contents after resizing with LANCZOS interpolation

 

0.26301101 0.3761742 0.4124454 0.4130435 0.4130435 0.4130435

0.37617415 2.4499352 2.4631310 2.4994020 2.5000002 2.5000002

0.41244543 2.4631310 4.4499354 4.4631310 4.4994025 4.5000005

0.41304356 2.4994023 4.4631310 6.4499359 6.4631314 6.4994025

0.41304356 2.5000005 4.4994020 6.4631314 8.4499359 8.4631310

0.41304356 2.5000005 4.5000000 6.4994025 8.4631310 10.4369250

 

The image has the following contents after resizing with SUPERSAMPLING interpolation

 

0.25000000 0.5000000 0.5000000 0.5000000 0.5000000 0.5000000

0.50000000 2.2500000 2.5000000 2.5000000 2.5000000 2.5000000

0.50000000 2.5000000 4.2500000 4.5000000 4.5000000 4.5000000

0.50000000 2.5000000 4.5000000 6.2500000 6.5000000 6.5000000

0.50000000 2.5000000 4.5000000 6.5000000 8.2500000 8.5000000

0.50000000 2.5000000 4.5000000 6.5000000 8.5000000 10.2500000

However, my compile could not succeed because of ippiResizeGetBufSize( srect, drect, 1, IPPI_INTER_SUPER, &bufsize ); and here is the error message:

>IntelIPPTest.obj : error LNK2019: unresolved external symbol _ippiResizeGetBufSize@44 referenced in function "enum IppStatus __cdecl ResizeTemplate(void)" (?ResizeTemplate@@YA?AW4IppStatus@@XZ)
1>C:\Users\ncui.THORLABS\Documents\Visual Studio 2008\Projects\IntelIPP\Debug\IntelIPP.exe : fatal error LNK1120: 1 unresolved externals

I am very confused since there seems no reason for this failure. I have included the ippi.h file, and I am using vs2008 on windows 7 32bit. Any one can please give some hint? Thanks a lot.

0 Kudos
6 Replies
Gennady_F_Intel
Moderator
536 Views
how did you link the example? it seems you need to add these libraries ippi.lib ipps.lib ippcore.lib to your linking line.
0 Kudos
Nick_T_1
Beginner
536 Views
Gennady Fedorov (Intel) wrote:

how did you link the example?
it seems you need to add these libraries ippi.lib ipps.lib ippcore.lib to your linking line.

Hi Sergey: Thanks, I added libs you mentioned, it looks the project can be built now. But now issues came across: the project is builtable, but not excutable. If I click the green little triangle to "start debugging", a message box popped up and it says: The program can't start because ipps-7.0.dll is missing from your computer. Try reinstalling the program to fix this problem. I searched my entire computer, seems I don't have this ipps-7.0.dll.
0 Kudos
pvonkaenel
New Contributor III
536 Views
Hi Nick, The IPP DLLs are installed as part of IPP on the system you're developing on. If you're trying to run on a non-development PC, then you will need to install the IPP redistributable package. Alternatively, you can just link against the IPP static libs and forget about the DLLs completely - this is the way I have IPP set up in my projects. Peter
0 Kudos
Nick_T_1
Beginner
536 Views
pvonkaenel wrote:

Hi Nick,

The IPP DLLs are installed as part of IPP on the system you're developing on. If you're trying to run on a non-development PC, then you will need to install the IPP redistributable package. Alternatively, you can just link against the IPP static libs and forget about the DLLs completely - this is the way I have IPP set up in my projects.

Peter

Hi Peter: Thanks a lot for your reply, and I hope I understand it correctly: statically linking libraries will solve this problem. If so, how do I statically link the IPP libraries (*.lib files) when I am using VS2008 on a win 32 machine? Thanks a lot.
0 Kudos
Gennady_F_Intel
Moderator
536 Views
there 2 comments on this: 1.see the user's quide description about how you can link your application: http://software.intel.com/sites/products/documentation/doclib/ipp_sa/71/ipp_userguide_lnx/index.htm 2. since version 7.0, threaded static libraries (_t) are available as a separate download. You need to download it from registration center.
0 Kudos
Nick_T_1
Beginner
536 Views
Gennady Fedorov (Intel) wrote:

there 2 comments on this:
1.see the user's quide description about how you can link your application:
http://software.intel.com/sites/products/documentation/doclib/ipp_sa/71/...

2. since version 7.0, threaded static libraries (_t) are available as a separate download. You need to download it from registration center.

Thanks Federov, that helps.
0 Kudos
Reply