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

Bug in IppiCopy_8u_C1 under Delphi?

ad_ms
Beginner
305 Views

EDIT: why is it that i always find my bug some minutes AFTER posting?... :(
obviously i've mistaken the parameters.

i encountered some access violations, and after having spend some hour to verify my code, i've reasons to belief that there is a bug somewhere. the following example code does crash with an access violation (near the beginning of the memory e.g. 0x00000320):

var tmp : Integer;

var pBufSrc, pBufTpl : pIpp8u;
srcRoi, tplRoi : IppiSize;
srcStep, tplStep : Integer;
begin
srcRoi.width := 640;
srcRoi.height := 640;
tplRoi.width := 640;
tplRoi.height := 640;

try
pBufSrc := ippiMalloc_8u_C1 (srcRoi.width, srcRoi.Height, @srcStep);
pBufTpl := ippiMalloc_8u_C1 (tplRoi.width, tplRoi.Height, @tplStep);
finally
end;
ippiCopy_8u_C1R (pBufSrc, srcStep, srcRoi, pBufTpl, tplStep, tplRoi);
end.

the ippiCopy is initialized via the following code:

TippiCopy_8u_C1R =
function (const pSrc: pIpp8u; srcStep: Integer; srcRoiSize : IppiSize;
pDst: PIpp8u; dstStep: Integer; dstRoiSize : IppiSize) : IppStatus; stdcall;

@ippiCopy_8u_C1R := GetProcAddress(Handle, 'ippiCopy_8u_C1R');

debugging a bit it really jumps to (some) routine, which first do some checks on roiSizes etc, so i'm sure it is part of IPP. and since i don't see any typos, i guess it is really ippiCopy_8u_C1R. can anyone help out?

thanks in advance,
aydin

0 Kudos
1 Reply
Vladimir_Dudnik
Employee
305 Views

Never mind, mistakes are possible :)

this function is declared in ippi.h file as

IPPAPI ( IppStatus, ippiCopy_8u_C1R,
( const Ipp8u* pSrc, int srcStep,
Ipp8u* pDst, int dstStep,IppiSize roiSize ))

So, it takes pointer, integer, pointer, integer, IppiSize.

Regards,
Vladimir

0 Kudos
Reply