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

QualityIndex bug? (IPP 5.3)

jon_shadforth
Novice
371 Views
Have odd behaviour with the QualityIndex function, whereby the first time I call it (under certain circumstances) it returns ippStsQualityIndexErr (Quality Index can't be calculated for image filled with constant), but on subsequent calls with exactly the same image information it works fine.

Scenario: make two images, initialise with Jaehne pattern, apply gaussian to one image, then find quality index. Code shown below. This can also easily be replicated using the IPPI demo program.

Code ->

void main()
{
const int width = 640;
const int height = 480;

Ipp8u pSrc1[width * height];
Ipp8u pSrc2[width * height];

int step = width * sizeof(Ipp8u);
IppiSize wholeImageROI = { width, height };

ippiImageJaehne_8u_C1R(pSrc1, step, wholeImageROI);
ippiImageJaehne_8u_C1R(pSrc2, step, wholeImageROI);

// Gaussian with 1-pixel border taken off
//IppiSize gaussRoiSize = {638, 478};
IppiSize gaussRoiSize = {width - 2, height - 2};
ippiFilterGauss_8u_C1R(
pSrc2 + step + 1,
step,
pSrc1 + step + 1,
step,
gaussRoiSize,
ippMskSize3x3);

Ipp32f pQIndex = -999;
IppStatus ippStatus;

// First call fails with ippStsQualityIndexErr
ippStatus = ippiQualityIndex_8u32f_C1R(pSrc1, step, pSrc2, step, wholeImageROI, &pQIndex);
ippStatus = ippiQualityIndex_8u32f_C1R(pSrc1, step, pSrc2, step, wholeImageROI, &pQIndex);
ippStatus = ippiQualityIndex_8u32f_C1R(pSrc1, step, pSrc2, step, wholeImageROI, &pQIndex);
}

Any thoughts on this appreciated!

Jon.

0 Kudos
3 Replies
jon_shadforth
Novice
371 Views
Quoting - jon_shadforth
Have odd behaviour with the QualityIndex function, whereby the first time I call it (under certain circumstances) it returns ippStsQualityIndexErr (Quality Index can't be calculated for image filled with constant), but on subsequent calls with exactly the same image information it works fine.

Scenario: make two images, initialise with Jaehne pattern, apply gaussian to one image, then find quality index. Code shown below. This can also easily be replicated using the IPPI demo program.

Code ->

void main()
{
const int width = 640;
const int height = 480;

Ipp8u pSrc1[width * height];
Ipp8u pSrc2[width * height];

int step = width * sizeof(Ipp8u);
IppiSize wholeImageROI = { width, height };

ippiImageJaehne_8u_C1R(pSrc1, step, wholeImageROI);
ippiImageJaehne_8u_C1R(pSrc2, step, wholeImageROI);

// Gaussian with 1-pixel border taken off
//IppiSize gaussRoiSize = {638, 478};
IppiSize gaussRoiSize = {width - 2, height - 2};
ippiFilterGauss_8u_C1R(
pSrc2 + step + 1,
step,
pSrc1 + step + 1,
step,
gaussRoiSize,
ippMskSize3x3);

Ipp32f pQIndex = -999;
IppStatus ippStatus;

// First call fails with ippStsQualityIndexErr
ippStatus = ippiQualityIndex_8u32f_C1R(pSrc1, step, pSrc2, step, wholeImageROI, &pQIndex);
ippStatus = ippiQualityIndex_8u32f_C1R(pSrc1, step, pSrc2, step, wholeImageROI, &pQIndex);
ippStatus = ippiQualityIndex_8u32f_C1R(pSrc1, step, pSrc2, step, wholeImageROI, &pQIndex);
}

Any thoughts on this appreciated!

Jon.


Additional info: this may be related to the Gauss function. If, in the above example, I insert a duplicate call to the Gauss function above the final QualityIndex function call, then the following QualityFunction call again fails.

As I mentioned this can be replicated using the IPPI demo program. (Create a 640*480 1C image with Jaehne, do a 3*3 Gauss which produces a new image using reduced ROI, then run quality index on the two images and the first time it will fail).
0 Kudos
Ying_H_Intel
Employee
371 Views
Quoting - jon_shadforth

Additional info: this may be related to the Gauss function. If, in the above example, I insert a duplicate call to the Gauss function above the final QualityIndex function call, then the following QualityFunction call again fails.

As I mentioned this can be replicated using the IPPI demo program. (Create a 640*480 1C image with Jaehne, do a 3*3 Gauss which produces a new image using reduced ROI, then run quality index on the two images and the first time it will fail).

Hello Jon,

Thank you a lot for the catch. We can reproduce the problem. It is really a bug in IPP function, - not in ippiQualityIndex, but in ippiFilterGauss_8u_C1R function (in dynamic and threaded static libraries only, no such bug in non-threaded static version, see static linkage mode here <http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-for-windows-find-the-intel-ipp-libraries-needed-by-your-application/> We will fix it in next release.

There are several possible workarounds , you maytry them temporarily
for example, use no-threaded static library or disable the thread inippiFilterGuass
int n;

ippGetNumThreads( &n );

ippSetNumThreads( 1 );

ippiFilterGauss_8u_C1R();

ippSetNumThreads( n );

......................

Thanks
Ying

0 Kudos
Ying_H_Intel
Employee
371 Views
For those who aresuffering the bug, the fixed is includedin IPP 6.1 update 5 release.
Thanks,
Ying
0 Kudos
Reply