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

Erro in IPP ippsRSDecodeInit_8u

max-divulskiy
Beginner
625 Views
Hi.
Detected error in IPP decoder function. For Parallel studio XE-sp1 function ippsRSDecodeInit_8u always write ippStsRangeErr, at the same time for Studio XE its always normal.

[bash]#include 
#include 
#include 
#include 
#include 
#include 

typedef	IppStatus (__stdcall *_ippsGFGetSize_8u)			(int gfDegree, int* pSize);
typedef	IppStatus (__stdcall *_ippsGFInit_8u)				(int gfDegree, const Ipp8u* pPolynomial, IppsGFSpec_8u* pGF);
typedef	IppStatus (__stdcall *_ippsRSDecodeGetSize_8u)	(int codeLen, int dataLen, int* pSize);
typedef	IppStatus (__stdcall *_ippsRSDecodeInit_8u)		(int codeLen, int dataLen, const IppsGFSpec_8u* pGF, Ipp8u root, IppsRSDecodeSpec_8u* pRS);


int _tmain(int argc, _TCHAR* argv[])
{
	ippStaticInit();


	HINSTANCE	hInstLibrary_xe;
	HINSTANCE	hInstLibrary_xesp1;

	_ippsGFGetSize_8u			ippsGFGetSize_8u_xe;
	_ippsGFGetSize_8u			ippsGFGetSize_8u_xesp1;
	_ippsGFInit_8u				ippsGFInit_8u_xe;
	_ippsGFInit_8u				ippsGFInit_8u_xesp1;
	_ippsRSDecodeGetSize_8u		ippsRSDecodeGetSize_8u_xe;
	_ippsRSDecodeGetSize_8u		ippsRSDecodeGetSize_8u_xesp1;
	_ippsRSDecodeInit_8u		ippsRSDecodeInit_8u_xe;
	_ippsRSDecodeInit_8u		ippsRSDecodeInit_8u_xesp1;


	if ( hInstLibrary_xe = LoadLibraryA("c:\\Program Files (x86)\\Intel\\ComposerXE-2011\\redist\\ia32\\ipp\\ippdip8-7.0.dll") )
	{
		ippsGFGetSize_8u_xe			= (_ippsGFGetSize_8u)		GetProcAddress( hInstLibrary_xe, "ippsGFGetSize_8u");
		ippsGFInit_8u_xe			= (_ippsGFInit_8u)			GetProcAddress( hInstLibrary_xe, "ippsGFInit_8u");
		ippsRSDecodeGetSize_8u_xe	= (_ippsRSDecodeGetSize_8u) GetProcAddress( hInstLibrary_xe, "ippsRSDecodeGetSize_8u");
		ippsRSDecodeInit_8u_xe		= (_ippsRSDecodeInit_8u)	GetProcAddress( hInstLibrary_xe, "ippsRSDecodeInit_8u");
	}

	if ( hInstLibrary_xesp1 = LoadLibraryA("c:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\redist\\ia32\\ipp\\ippdip8-7.0.dll") )
	{
		ippsGFGetSize_8u_xesp1		= (_ippsGFGetSize_8u)		GetProcAddress( hInstLibrary_xesp1, "ippsGFGetSize_8u");
		ippsGFInit_8u_xesp1			= (_ippsGFInit_8u)			GetProcAddress( hInstLibrary_xesp1, "ippsGFInit_8u");
		ippsRSDecodeGetSize_8u_xesp1= (_ippsRSDecodeGetSize_8u) GetProcAddress( hInstLibrary_xesp1, "ippsRSDecodeGetSize_8u");
		ippsRSDecodeInit_8u_xesp1	= (_ippsRSDecodeInit_8u)	GetProcAddress( hInstLibrary_xesp1, "ippsRSDecodeInit_8u");
	}


	IppStatus	ipps_xe		= ippStsNoErr;
	IppStatus	ipps_xesp1	= ippStsNoErr;


	int size_xe;
	ipps_xe = ippsGFGetSize_8u_xe(8, &size_xe);
	assert(ipps_xe == ippStsNoErr);


	int size_xesp1;
	ipps_xesp1 = ippsGFGetSize_8u_xesp1(8, &size_xesp1);
	assert(ipps_xesp1 == ippStsNoErr);


	IppsGFSpec_8u*	GFSpec_xe = (IppsGFSpec_8u*) _aligned_malloc(size_xe, 32);
	assert(GFSpec_xe);

	IppsGFSpec_8u*	GFSpec_xesp1 = (IppsGFSpec_8u*) _aligned_malloc(size_xesp1, 32);
	assert(GFSpec_xesp1);


	const Ipp8u Poly[] = { 1, 0, 1, 1, 1, 0, 0, 0, 1};


	ipps_xe = ippsGFInit_8u_xe(8, Poly, GFSpec_xe);
	assert(ipps_xe == ippStsNoErr);

	ipps_xesp1 = ippsGFInit_8u_xesp1(8, Poly, GFSpec_xesp1);
	assert(ipps_xe == ippStsNoErr);


	ipps_xe = ippsRSDecodeGetSize_8u_xe(204, 188, &size_xe);
	assert(ipps_xe == ippStsNoErr);


	ipps_xe = ippsRSDecodeGetSize_8u_xesp1(204, 188, &size_xesp1);
	assert(ipps_xesp1 == ippStsNoErr);


	IppsRSDecodeSpec_8u*	DecoderSpec_xe = (IppsRSDecodeSpec_8u*)_aligned_malloc(size_xe, 32);
	assert(DecoderSpec_xe);


	IppsRSDecodeSpec_8u*	DecoderSpec_xesp1 = (IppsRSDecodeSpec_8u*)_aligned_malloc(size_xesp1, 32);
	assert(DecoderSpec_xesp1);


	ipps_xe = ippsRSDecodeInit_8u_xe(204, 188, GFSpec_xe, 1, DecoderSpec_xe);
	assert(ipps_xe == ippStsNoErr);


	ipps_xesp1 = ippsRSDecodeInit_8u_xesp1(204, 188, GFSpec_xesp1, 1, DecoderSpec_xesp1);
	assert(ipps_xesp1 == ippStsNoErr);


	return 0;
}[/bash]
0 Kudos
1 Reply
Chao_Y_Intel
Moderator
625 Views

Hello,

There is some change in IPP 7.0.5:

IPP implementation does not support "shorted" RS decoders.

In the old releases, IPP does not have any check when calling init the RS decoder. So the code may crash when using the RS decoders.

In the 7.0.5, IPP added such sanity check. If it is such codes, IPP will return errors when init the RS decoders.

Thanks,
Chao

0 Kudos
Reply